@@ -40,7 +40,6 @@ import {
4040 assertClientRequestTaskCapability ,
4141 assertToolsCallTaskCapability ,
4242 CallToolResultSchema ,
43- TaskManager ,
4443 CompleteResultSchema ,
4544 CreateMessageRequestSchema ,
4645 CreateMessageResultSchema ,
@@ -63,7 +62,8 @@ import {
6362 Protocol ,
6463 ReadResourceResultSchema ,
6564 safeParse ,
66- SUPPORTED_PROTOCOL_VERSIONS
65+ SUPPORTED_PROTOCOL_VERSIONS ,
66+ TaskManager
6767} from '@modelcontextprotocol/core' ;
6868
6969import { ExperimentalClientTasks } from '../experimental/tasks/client.js' ;
@@ -142,71 +142,72 @@ export function getSupportedElicitationModes(capabilities: ClientCapabilities['e
142142 return { supportsFormMode, supportsUrlMode } ;
143143}
144144
145- export type ClientOptions = ProtocolOptions & Partial < TaskManagerOptions > & {
146- /**
147- * Capabilities to advertise as being supported by this client.
148- */
149- capabilities ?: ClientCapabilities ;
150-
151- /**
152- * JSON Schema validator for tool output validation.
153- *
154- * The validator is used to validate structured content returned by tools
155- * against their declared output schemas.
156- *
157- * @default AjvJsonSchemaValidator
158- *
159- * @example
160- * ```typescript
161- * // ajv
162- * const client = new Client(
163- * { name: 'my-client', version: '1.0.0' },
164- * {
165- * capabilities: {},
166- * jsonSchemaValidator: new AjvJsonSchemaValidator()
167- * }
168- * );
169- *
170- * // @cfworker /json-schema
171- * const client = new Client(
172- * { name: 'my-client', version: '1.0.0' },
173- * {
174- * capabilities: {},
175- * jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
176- * }
177- * );
178- * ```
179- */
180- jsonSchemaValidator ?: jsonSchemaValidator ;
181-
182- /**
183- * Configure handlers for list changed notifications (tools, prompts, resources).
184- *
185- * @example
186- * ```typescript
187- * const client = new Client(
188- * { name: 'my-client', version: '1.0.0' },
189- * {
190- * listChanged: {
191- * tools: {
192- * onChanged: (error, tools) => {
193- * if (error) {
194- * console.error('Failed to refresh tools:', error);
195- * return;
196- * }
197- * console.log('Tools updated:', tools);
198- * }
199- * },
200- * prompts: {
201- * onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
202- * }
203- * }
204- * }
205- * );
206- * ```
207- */
208- listChanged ?: ListChangedHandlers ;
209- } ;
145+ export type ClientOptions = ProtocolOptions &
146+ Partial < TaskManagerOptions > & {
147+ /**
148+ * Capabilities to advertise as being supported by this client.
149+ */
150+ capabilities ?: ClientCapabilities ;
151+
152+ /**
153+ * JSON Schema validator for tool output validation.
154+ *
155+ * The validator is used to validate structured content returned by tools
156+ * against their declared output schemas.
157+ *
158+ * @default AjvJsonSchemaValidator
159+ *
160+ * @example
161+ * ```typescript
162+ * // ajv
163+ * const client = new Client(
164+ * { name: 'my-client', version: '1.0.0' },
165+ * {
166+ * capabilities: {},
167+ * jsonSchemaValidator: new AjvJsonSchemaValidator()
168+ * }
169+ * );
170+ *
171+ * // @cfworker /json-schema
172+ * const client = new Client(
173+ * { name: 'my-client', version: '1.0.0' },
174+ * {
175+ * capabilities: {},
176+ * jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
177+ * }
178+ * );
179+ * ```
180+ */
181+ jsonSchemaValidator ?: jsonSchemaValidator ;
182+
183+ /**
184+ * Configure handlers for list changed notifications (tools, prompts, resources).
185+ *
186+ * @example
187+ * ```typescript
188+ * const client = new Client(
189+ * { name: 'my-client', version: '1.0.0' },
190+ * {
191+ * listChanged: {
192+ * tools: {
193+ * onChanged: (error, tools) => {
194+ * if (error) {
195+ * console.error('Failed to refresh tools:', error);
196+ * return;
197+ * }
198+ * console.log('Tools updated:', tools);
199+ * }
200+ * },
201+ * prompts: {
202+ * onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
203+ * }
204+ * }
205+ * }
206+ * );
207+ * ```
208+ */
209+ listChanged ?: ListChangedHandlers ;
210+ } ;
210211
211212/**
212213 * An MCP client on top of a pluggable transport.
0 commit comments