import { type StateAction } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/actions"; import type { ServerNotificationMap } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/messages"; /** * The current protocol version that new code speaks. * * Formatted as a [SemVer](https://semver.org) `MAJOR.MINOR.PATCH` string. */ export declare const PROTOCOL_VERSION = "0.5.1"; /** * Every protocol version a client built from this source tree is willing * to negotiate via the `initialize` handshake. Ordered **most preferred * first** so a server picking the first acceptable entry honors the * client's preference (see [versioning](../../docs/specification/versioning.md)). * * The first entry MUST equal {@link PROTOCOL_VERSION} — the version * "new code speaks" is by definition the most preferred one. Older * versions may be appended if a client retains the ability to fall back * to them; today only one version is advertised. * * Every generated client (Rust, Kotlin, Swift) re-exports this constant * verbatim. The TypeScript client consumes it directly. The per-client * `release-metadata.json` files are validated against this list by * `scripts/verify-release-metadata.ts`. */ export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[]; /** * Compares two `MAJOR.MINOR.PATCH` SemVer strings. * * Returns a negative number if `a < b`, zero if `a === b`, and a positive * number if `a > b`. */ export declare function compareProtocolVersions(a: string, b: string): number; /** * Maps every action type to the protocol version that introduced it. * Adding a new action to `StateAction` without adding it here is a compile error. * * Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`). */ export declare const ACTION_INTRODUCED_IN: { readonly [K in StateAction["type"]]: string; }; /** * Returns whether the given action type is known to the specified protocol version. */ export declare function isActionKnownToVersion(action: StateAction, clientVersion: string): boolean; /** * Server → client notification method names that are part of the AHP * protocol surface. The set is a subset of {@link ServerNotificationMap} * keys that excludes `action` (the action envelope) since action versions * are tracked via {@link ACTION_INTRODUCED_IN}. */ export type ProtocolNotificationMethod = Exclude; /** * Maps every server → client protocol notification method to the protocol * version that introduced it. Adding a new notification method to * {@link ServerNotificationMap} without adding it here is a compile error. * * Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`). */ export declare const NOTIFICATION_INTRODUCED_IN: { readonly [K in ProtocolNotificationMethod]: string; }; /** * Returns whether the given notification method is known to the specified * protocol version. */ export declare function isNotificationKnownToVersion(method: ProtocolNotificationMethod, clientVersion: string): boolean;