Path: blob/main/src/vs/platform/agentHost/common/state/sessionCapabilities.ts
13399 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45// Protocol version constants and capability derivation.6// See protocol.md -> Versioning for the full design.7//8// The authoritative version numbers and action-filtering logic live in9// versions/versionRegistry.ts. This file re-exports them and provides the10// capability-object API that client code uses to gate features.1112export const PROTOCOL_VERSION = 1;13export const MIN_PROTOCOL_VERSION = 1;1415/**16* Capabilities derived from a protocol version.17* Core features (v1) are always-present literal `true`.18* Features from later versions are optional `true | undefined`.19*/20export interface ProtocolCapabilities {21// v1 — always present22readonly sessions: true;23readonly tools: true;24readonly permissions: true;25}2627/**28* Derives the set of capabilities available at a given protocol version.29* Newer clients use this to determine which features the server supports.30*/31export function capabilitiesForVersion(version: number): ProtocolCapabilities {32if (version < 1) {33throw new Error(`Unsupported protocol version: ${version}`);34}3536return {37sessions: true,38tools: true,39permissions: true,40// Future versions add fields here:41// ...(version >= 2 ? { reasoning: true as const } : {}),42};43}444546