@@ -41,7 +41,6 @@ import {
4141 assertClientRequestTaskCapability ,
4242 assertToolsCallTaskCapability ,
4343 CallToolResultSchema ,
44- TaskManager ,
4544 CompleteResultSchema ,
4645 CreateMessageRequestSchema ,
4746 CreateMessageResultSchema ,
@@ -69,6 +68,7 @@ import {
6968 ResourceListChangedNotificationSchema ,
7069 safeParse ,
7170 SUPPORTED_PROTOCOL_VERSIONS ,
71+ TaskManager ,
7272 ToolListChangedNotificationSchema
7373} from '@modelcontextprotocol/core' ;
7474
@@ -148,71 +148,72 @@ export function getSupportedElicitationModes(capabilities: ClientCapabilities['e
148148 return { supportsFormMode, supportsUrlMode } ;
149149}
150150
151- export type ClientOptions = ProtocolOptions & Partial < TaskManagerOptions > & {
152- /**
153- * Capabilities to advertise as being supported by this client.
154- */
155- capabilities ?: ClientCapabilities ;
156-
157- /**
158- * JSON Schema validator for tool output validation.
159- *
160- * The validator is used to validate structured content returned by tools
161- * against their declared output schemas.
162- *
163- * @default AjvJsonSchemaValidator
164- *
165- * @example
166- * ```typescript
167- * // ajv
168- * const client = new Client(
169- * { name: 'my-client', version: '1.0.0' },
170- * {
171- * capabilities: {},
172- * jsonSchemaValidator: new AjvJsonSchemaValidator()
173- * }
174- * );
175- *
176- * // @cfworker /json-schema
177- * const client = new Client(
178- * { name: 'my-client', version: '1.0.0' },
179- * {
180- * capabilities: {},
181- * jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
182- * }
183- * );
184- * ```
185- */
186- jsonSchemaValidator ?: jsonSchemaValidator ;
187-
188- /**
189- * Configure handlers for list changed notifications (tools, prompts, resources).
190- *
191- * @example
192- * ```typescript
193- * const client = new Client(
194- * { name: 'my-client', version: '1.0.0' },
195- * {
196- * listChanged: {
197- * tools: {
198- * onChanged: (error, tools) => {
199- * if (error) {
200- * console.error('Failed to refresh tools:', error);
201- * return;
202- * }
203- * console.log('Tools updated:', tools);
204- * }
205- * },
206- * prompts: {
207- * onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
208- * }
209- * }
210- * }
211- * );
212- * ```
213- */
214- listChanged ?: ListChangedHandlers ;
215- } ;
151+ export type ClientOptions = ProtocolOptions &
152+ Partial < TaskManagerOptions > & {
153+ /**
154+ * Capabilities to advertise as being supported by this client.
155+ */
156+ capabilities ?: ClientCapabilities ;
157+
158+ /**
159+ * JSON Schema validator for tool output validation.
160+ *
161+ * The validator is used to validate structured content returned by tools
162+ * against their declared output schemas.
163+ *
164+ * @default AjvJsonSchemaValidator
165+ *
166+ * @example
167+ * ```typescript
168+ * // ajv
169+ * const client = new Client(
170+ * { name: 'my-client', version: '1.0.0' },
171+ * {
172+ * capabilities: {},
173+ * jsonSchemaValidator: new AjvJsonSchemaValidator()
174+ * }
175+ * );
176+ *
177+ * // @cfworker /json-schema
178+ * const client = new Client(
179+ * { name: 'my-client', version: '1.0.0' },
180+ * {
181+ * capabilities: {},
182+ * jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
183+ * }
184+ * );
185+ * ```
186+ */
187+ jsonSchemaValidator ?: jsonSchemaValidator ;
188+
189+ /**
190+ * Configure handlers for list changed notifications (tools, prompts, resources).
191+ *
192+ * @example
193+ * ```typescript
194+ * const client = new Client(
195+ * { name: 'my-client', version: '1.0.0' },
196+ * {
197+ * listChanged: {
198+ * tools: {
199+ * onChanged: (error, tools) => {
200+ * if (error) {
201+ * console.error('Failed to refresh tools:', error);
202+ * return;
203+ * }
204+ * console.log('Tools updated:', tools);
205+ * }
206+ * },
207+ * prompts: {
208+ * onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
209+ * }
210+ * }
211+ * }
212+ * );
213+ * ```
214+ */
215+ listChanged ?: ListChangedHandlers ;
216+ } ;
216217
217218/**
218219 * An MCP client on top of a pluggable transport.
0 commit comments