diff --git a/CHANGELOG.md b/CHANGELOG.md index 7518fea..2113466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.5.1 (2025-10-24) + +- Add ability for agents and clients to provide information about their implementation +- Fix incorrectly serialized `_meta` field on `SetSessionModeResponse + ## 0.5.0 (2025-10-24) - Provide access to an `AbortSignal` and `closed` promise on connections so you can wait for the connection to close and handle any other cleanup tasks you need for a graceful shutdown. https://github.com/agentclientprotocol/typescript-sdk/pull/11 diff --git a/package-lock.json b/package-lock.json index 4a52a9e..a065bf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@agentclientprotocol/sdk", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@agentclientprotocol/sdk", - "version": "0.5.0", + "version": "0.5.1", "license": "Apache-2.0", "dependencies": { "zod": "^3.0.0" diff --git a/package.json b/package.json index 7430675..06b366d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agentclientprotocol/sdk", - "version": "0.5.0", + "version": "0.5.1", "publishConfig": { "access": "public" }, diff --git a/schema/schema.json b/schema/schema.json index 7102970..709abbf 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -958,6 +958,25 @@ "required": ["name", "value"], "type": "object" }, + "Implementation": { + "description": "Describes the name and version of an MCP implementation, with an optional\ntitle for UI representation.", + "properties": { + "name": { + "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.", + "type": "string" + }, + "title": { + "description": "Intended for UI and end-user contexts — optimized to be human-readable\nand easily understood.\n\nIf not provided, the name should be used for display.", + "type": ["string", "null"] + }, + "version": { + "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes.", + "type": "string" + } + }, + "required": ["name", "version"], + "type": "object" + }, "InitializeRequest": { "description": "Request parameters for the initialize method.\n\nSent by the client to establish connection and negotiate capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", "properties": { @@ -975,6 +994,17 @@ }, "description": "Capabilities supported by the client." }, + "clientInfo": { + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." + }, "protocolVersion": { "$ref": "#/$defs/ProtocolVersion", "description": "The latest protocol version supported by the client." @@ -1007,6 +1037,17 @@ }, "description": "Capabilities supported by the agent." }, + "agentInfo": { + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." + }, "authMethods": { "default": [], "description": "Authentication methods supported by the agent.", @@ -2050,7 +2091,7 @@ "SetSessionModeResponse": { "description": "Response to `session/set_mode` method.", "properties": { - "meta": true + "_meta": true }, "type": "object", "x-method": "session/set_mode", diff --git a/scripts/generate.js b/scripts/generate.js index 4d38046..230124b 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -5,7 +5,7 @@ import { generate } from "ts-to-zod"; import * as fs from "fs/promises"; import { dirname } from "path"; -const CURRENT_SCHEMA_RELEASE = "v0.5.0"; +const CURRENT_SCHEMA_RELEASE = "v0.6.2"; await downloadSchemas(CURRENT_SCHEMA_RELEASE); diff --git a/src/schema.ts b/src/schema.ts index 2276f96..43f3f1c 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -870,6 +870,12 @@ export interface InitializeResponse { [k: string]: unknown; }; agentCapabilities?: AgentCapabilities; + /** + * Information about the Agent name and version sent to the Client. + * + * Note: in future versions of the protocol, this will be required. + */ + agentInfo?: Implementation | null; /** * Authentication methods supported by the agent. */ @@ -944,6 +950,29 @@ export interface PromptCapabilities { */ image?: boolean; } +/** + * Describes the name and version of an MCP implementation, with an optional + * title for UI representation. + */ +export interface Implementation { + /** + * Intended for programmatic or logical use, but can be used as a display + * name fallback if title isn’t present. + */ + name: string; + /** + * Intended for UI and end-user contexts — optimized to be human-readable + * and easily understood. + * + * If not provided, the name should be used for display. + */ + title?: string | null; + /** + * Version of the implementation. Can be displayed to the user or used + * for debugging or metrics purposes. + */ + version: string; +} /** * Describes an available authentication method. */ @@ -1125,7 +1154,7 @@ export interface LoadSessionResponse { * Response to `session/set_mode` method. */ export interface SetSessionModeResponse { - meta?: unknown; + _meta?: unknown; } /** * Response from processing a user prompt. @@ -1707,6 +1736,12 @@ export interface InitializeRequest { [k: string]: unknown; }; clientCapabilities?: ClientCapabilities; + /** + * Information about the Client name and version sent to the Agent. + * + * Note: in future versions of the protocol, this will be required. + */ + clientInfo?: Implementation | null; /** * The latest protocol version supported by the client. */ @@ -2284,7 +2319,7 @@ export const authenticateResponseSchema = z.object({ /** @internal */ export const setSessionModeResponseSchema = z.object({ - meta: z.unknown().optional(), + _meta: z.unknown().optional(), }); /** @internal */ @@ -2516,6 +2551,13 @@ export const envVariableSchema = z.object({ value: z.string(), }); +/** @internal */ +export const implementationSchema = z.object({ + name: z.string(), + title: z.string().optional().nullable(), + version: z.string(), +}); + /** @internal */ export const authMethodSchema = z.object({ _meta: z.record(z.unknown()).optional(), @@ -2798,6 +2840,7 @@ export const requestSchema = z.object({ export const initializeResponseSchema = z.object({ _meta: z.record(z.unknown()).optional(), agentCapabilities: agentCapabilitiesSchema.optional(), + agentInfo: implementationSchema.optional().nullable(), authMethods: z.array(authMethodSchema).optional(), protocolVersion: z.number(), }); @@ -3005,6 +3048,7 @@ export const sessionNotificationSchema = z.object({ export const initializeRequestSchema = z.object({ _meta: z.record(z.unknown()).optional(), clientCapabilities: clientCapabilitiesSchema.optional(), + clientInfo: implementationSchema.optional().nullable(), protocolVersion: z.number(), });