agents 0.0.0-2801d35 → 0.0.0-293b546

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +257 -27
  2. package/dist/ai-chat-agent.d.ts +95 -19
  3. package/dist/ai-chat-agent.js +798 -222
  4. package/dist/ai-chat-agent.js.map +1 -1
  5. package/dist/ai-chat-v5-migration-BSiGZmYU.js +155 -0
  6. package/dist/ai-chat-v5-migration-BSiGZmYU.js.map +1 -0
  7. package/dist/ai-chat-v5-migration.d.ts +155 -0
  8. package/dist/ai-chat-v5-migration.js +3 -0
  9. package/dist/ai-react.d.ts +78 -84
  10. package/dist/ai-react.js +396 -199
  11. package/dist/ai-react.js.map +1 -1
  12. package/dist/ai-types-81H_-Uxh.d.ts +103 -0
  13. package/dist/ai-types-CrMqkwc_.js +24 -0
  14. package/dist/ai-types-CrMqkwc_.js.map +1 -0
  15. package/dist/ai-types.d.ts +6 -74
  16. package/dist/ai-types.js +3 -1
  17. package/dist/cli.d.ts +8 -0
  18. package/dist/cli.js +27 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/client-B3SR12TQ.js +117 -0
  21. package/dist/client-B3SR12TQ.js.map +1 -0
  22. package/dist/client-BAQA84dr.d.ts +104 -0
  23. package/dist/client-BG2wUgN5.d.ts +1462 -0
  24. package/dist/client-C8VrzljV.js +921 -0
  25. package/dist/client-C8VrzljV.js.map +1 -0
  26. package/dist/client.d.ts +12 -87
  27. package/dist/client.js +4 -11
  28. package/dist/codemode/ai.d.ts +27 -0
  29. package/dist/codemode/ai.js +151 -0
  30. package/dist/codemode/ai.js.map +1 -0
  31. package/dist/do-oauth-client-provider-C2CHH5x-.d.ts +55 -0
  32. package/dist/do-oauth-client-provider-CwqK5SXm.js +94 -0
  33. package/dist/do-oauth-client-provider-CwqK5SXm.js.map +1 -0
  34. package/dist/index-7kI1zprE.d.ts +578 -0
  35. package/dist/index-BUle9RiP.d.ts +58 -0
  36. package/dist/index.d.ts +61 -402
  37. package/dist/index.js +7 -22
  38. package/dist/mcp/client.d.ts +4 -783
  39. package/dist/mcp/client.js +4 -9
  40. package/dist/mcp/do-oauth-client-provider.d.ts +2 -41
  41. package/dist/mcp/do-oauth-client-provider.js +3 -7
  42. package/dist/mcp/index.d.ts +190 -81
  43. package/dist/mcp/index.js +1435 -767
  44. package/dist/mcp/index.js.map +1 -1
  45. package/dist/mcp/x402.d.ts +34 -0
  46. package/dist/mcp/x402.js +198 -0
  47. package/dist/mcp/x402.js.map +1 -0
  48. package/dist/mcp-BwPscEiF.d.ts +61 -0
  49. package/dist/observability/index.d.ts +3 -0
  50. package/dist/observability/index.js +7 -0
  51. package/dist/react-9nVfoERh.d.ts +113 -0
  52. package/dist/react.d.ts +10 -104
  53. package/dist/react.js +183 -100
  54. package/dist/react.js.map +1 -1
  55. package/dist/schedule.d.ts +89 -12
  56. package/dist/schedule.js +46 -21
  57. package/dist/schedule.js.map +1 -1
  58. package/dist/serializable-faDkMCai.d.ts +39 -0
  59. package/dist/serializable.d.ts +7 -0
  60. package/dist/serializable.js +1 -0
  61. package/dist/src-xjQt2wBU.js +1180 -0
  62. package/dist/src-xjQt2wBU.js.map +1 -0
  63. package/package.json +125 -72
  64. package/dist/ai-types.js.map +0 -1
  65. package/dist/chunk-BZXOAZUX.js +0 -106
  66. package/dist/chunk-BZXOAZUX.js.map +0 -1
  67. package/dist/chunk-J6T74FUS.js +0 -783
  68. package/dist/chunk-J6T74FUS.js.map +0 -1
  69. package/dist/chunk-QSGN3REV.js +0 -123
  70. package/dist/chunk-QSGN3REV.js.map +0 -1
  71. package/dist/chunk-Y67CHZBI.js +0 -464
  72. package/dist/chunk-Y67CHZBI.js.map +0 -1
  73. package/dist/client.js.map +0 -1
  74. package/dist/index.js.map +0 -1
  75. package/dist/mcp/client.js.map +0 -1
  76. package/dist/mcp/do-oauth-client-provider.js.map +0 -1
  77. package/src/index.ts +0 -1250
@@ -0,0 +1,1462 @@
1
+ import { t as MCPObservabilityEvent } from "./mcp-BwPscEiF.js";
2
+ import { t as AgentsOAuthProvider } from "./do-oauth-client-provider-C2CHH5x-.js";
3
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
4
+ import {
5
+ SSEClientTransport,
6
+ SSEClientTransportOptions
7
+ } from "@modelcontextprotocol/sdk/client/sse.js";
8
+ import {
9
+ StreamableHTTPClientTransport,
10
+ StreamableHTTPClientTransportOptions
11
+ } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
12
+ import {
13
+ CallToolRequest,
14
+ CallToolResultSchema,
15
+ CompatibilityCallToolResultSchema,
16
+ ElicitRequest,
17
+ ElicitResult,
18
+ GetPromptRequest,
19
+ Prompt,
20
+ ReadResourceRequest,
21
+ Resource,
22
+ ResourceTemplate,
23
+ ServerCapabilities,
24
+ Tool
25
+ } from "@modelcontextprotocol/sdk/types.js";
26
+ import * as ai0 from "ai";
27
+ import { ToolSet } from "ai";
28
+ import * as zod0 from "zod";
29
+ import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
30
+
31
+ //#region src/core/events.d.ts
32
+ interface Disposable {
33
+ dispose(): void;
34
+ }
35
+ type Event<T> = (listener: (e: T) => void) => Disposable;
36
+ //#endregion
37
+ //#region src/mcp/types.d.ts
38
+ type MaybePromise<T> = T | Promise<T>;
39
+ type BaseTransportType = "sse" | "streamable-http";
40
+ type TransportType = BaseTransportType | "auto";
41
+ interface CORSOptions {
42
+ origin?: string;
43
+ methods?: string;
44
+ headers?: string;
45
+ maxAge?: number;
46
+ exposeHeaders?: string;
47
+ }
48
+ interface ServeOptions {
49
+ binding?: string;
50
+ corsOptions?: CORSOptions;
51
+ transport?: BaseTransportType;
52
+ jurisdiction?: DurableObjectJurisdiction;
53
+ }
54
+ //#endregion
55
+ //#region src/mcp/client-connection.d.ts
56
+ /**
57
+ * Connection state machine for MCP client connections.
58
+ *
59
+ * State transitions:
60
+ * - Non-OAuth: init() → "connecting" → "discovering" → "ready"
61
+ * - OAuth: init() → "authenticating" → (callback) → "connecting" → "discovering" → "ready"
62
+ * - Any state can transition to "failed" on error
63
+ */
64
+ type MCPConnectionState =
65
+ /**
66
+ * Waiting for OAuth authorization to complete.
67
+ * Server requires OAuth and user must complete the authorization flow.
68
+ * Next state: "connecting" (after handleCallbackRequest + establishConnection)
69
+ */
70
+ | "authenticating"
71
+ /**
72
+ * Establishing transport connection to MCP server.
73
+ * OAuth (if required) is complete, now connecting to the actual MCP endpoint.
74
+ * Next state: "discovering" (after transport connected)
75
+ */
76
+ | "connecting"
77
+ /**
78
+ * Fully connected and ready to use.
79
+ * Tools, resources, and prompts have been discovered and registered.
80
+ * This is the terminal success state.
81
+ */
82
+ | "ready"
83
+ /**
84
+ * Discovering server capabilities (tools, resources, prompts).
85
+ * Transport is connected, now fetching available capabilities via MCP protocol.
86
+ * Next state: "ready" (after capabilities fetched)
87
+ */
88
+ | "discovering"
89
+ /**
90
+ * Connection failed at some point.
91
+ * Check observability events for error details.
92
+ * This is a terminal error state.
93
+ */
94
+ | "failed";
95
+ type MCPTransportOptions = (
96
+ | SSEClientTransportOptions
97
+ | StreamableHTTPClientTransportOptions
98
+ ) & {
99
+ authProvider?: AgentsOAuthProvider;
100
+ type?: TransportType;
101
+ };
102
+ declare class MCPClientConnection {
103
+ url: URL;
104
+ options: {
105
+ transport: MCPTransportOptions;
106
+ client: ConstructorParameters<typeof Client>[1];
107
+ };
108
+ client: Client;
109
+ connectionState: MCPConnectionState;
110
+ lastConnectedTransport: BaseTransportType | undefined;
111
+ instructions?: string;
112
+ tools: Tool[];
113
+ prompts: Prompt[];
114
+ resources: Resource[];
115
+ resourceTemplates: ResourceTemplate[];
116
+ serverCapabilities: ServerCapabilities | undefined;
117
+ private readonly _onObservabilityEvent;
118
+ readonly onObservabilityEvent: Event<MCPObservabilityEvent>;
119
+ constructor(
120
+ url: URL,
121
+ info: ConstructorParameters<typeof Client>[0],
122
+ options?: {
123
+ transport: MCPTransportOptions;
124
+ client: ConstructorParameters<typeof Client>[1];
125
+ }
126
+ );
127
+ /**
128
+ * Initialize a client connection
129
+ *
130
+ * @returns
131
+ */
132
+ init(): Promise<void>;
133
+ /**
134
+ * Finish OAuth by probing transports based on configured type.
135
+ * - Explicit: finish on that transport
136
+ * - Auto: try streamable-http, then sse on 404/405/Not Implemented
137
+ */
138
+ private finishAuthProbe;
139
+ /**
140
+ * Complete OAuth authorization
141
+ */
142
+ completeAuthorization(code: string): Promise<void>;
143
+ /**
144
+ * Establish connection after successful authorization
145
+ */
146
+ establishConnection(): Promise<void>;
147
+ /**
148
+ * Discover server capabilities and register tools, resources, prompts, and templates
149
+ */
150
+ private discoverAndRegister;
151
+ /**
152
+ * Notification handler registration
153
+ */
154
+ registerTools(): Promise<Tool[]>;
155
+ registerResources(): Promise<Resource[]>;
156
+ registerPrompts(): Promise<Prompt[]>;
157
+ registerResourceTemplates(): Promise<ResourceTemplate[]>;
158
+ fetchTools(): Promise<
159
+ {
160
+ name: string;
161
+ inputSchema: {
162
+ type: "object";
163
+ required?: string[] | undefined;
164
+ properties?:
165
+ | {
166
+ [x: string]: object;
167
+ }
168
+ | undefined;
169
+ };
170
+ _meta?:
171
+ | {
172
+ [x: string]: unknown;
173
+ }
174
+ | undefined;
175
+ icons?:
176
+ | {
177
+ src: string;
178
+ mimeType?: string | undefined | undefined;
179
+ sizes?: string[] | undefined;
180
+ }[]
181
+ | undefined;
182
+ title?: string | undefined | undefined;
183
+ description?: string | undefined | undefined;
184
+ outputSchema?:
185
+ | {
186
+ type: "object";
187
+ required?: string[] | undefined;
188
+ properties?:
189
+ | {
190
+ [x: string]: object;
191
+ }
192
+ | undefined;
193
+ additionalProperties?: boolean | undefined | undefined;
194
+ }
195
+ | undefined;
196
+ annotations?:
197
+ | {
198
+ title?: string | undefined | undefined;
199
+ readOnlyHint?: boolean | undefined | undefined;
200
+ destructiveHint?: boolean | undefined | undefined;
201
+ idempotentHint?: boolean | undefined | undefined;
202
+ openWorldHint?: boolean | undefined | undefined;
203
+ }
204
+ | undefined;
205
+ }[]
206
+ >;
207
+ fetchResources(): Promise<
208
+ {
209
+ name: string;
210
+ uri: string;
211
+ _meta?:
212
+ | {
213
+ [x: string]: unknown;
214
+ }
215
+ | undefined;
216
+ mimeType?: string | undefined | undefined;
217
+ icons?:
218
+ | {
219
+ src: string;
220
+ mimeType?: string | undefined | undefined;
221
+ sizes?: string[] | undefined;
222
+ }[]
223
+ | undefined;
224
+ title?: string | undefined | undefined;
225
+ description?: string | undefined | undefined;
226
+ }[]
227
+ >;
228
+ fetchPrompts(): Promise<
229
+ {
230
+ name: string;
231
+ _meta?:
232
+ | {
233
+ [x: string]: unknown;
234
+ }
235
+ | undefined;
236
+ icons?:
237
+ | {
238
+ src: string;
239
+ mimeType?: string | undefined | undefined;
240
+ sizes?: string[] | undefined;
241
+ }[]
242
+ | undefined;
243
+ title?: string | undefined | undefined;
244
+ description?: string | undefined | undefined;
245
+ arguments?:
246
+ | {
247
+ name: string;
248
+ description?: string | undefined | undefined;
249
+ required?: boolean | undefined | undefined;
250
+ }[]
251
+ | undefined;
252
+ }[]
253
+ >;
254
+ fetchResourceTemplates(): Promise<
255
+ {
256
+ name: string;
257
+ uriTemplate: string;
258
+ _meta?:
259
+ | {
260
+ [x: string]: unknown;
261
+ }
262
+ | undefined;
263
+ mimeType?: string | undefined | undefined;
264
+ icons?:
265
+ | {
266
+ src: string;
267
+ mimeType?: string | undefined | undefined;
268
+ sizes?: string[] | undefined;
269
+ }[]
270
+ | undefined;
271
+ title?: string | undefined | undefined;
272
+ description?: string | undefined | undefined;
273
+ }[]
274
+ >;
275
+ /**
276
+ * Handle elicitation request from server
277
+ * Automatically uses the Agent's built-in elicitation handling if available
278
+ */
279
+ handleElicitationRequest(_request: ElicitRequest): Promise<ElicitResult>;
280
+ /**
281
+ * Get the transport for the client
282
+ * @param transportType - The transport type to get
283
+ * @returns The transport for the client
284
+ */
285
+ getTransport(
286
+ transportType: BaseTransportType
287
+ ): StreamableHTTPClientTransport | SSEClientTransport;
288
+ private tryConnect;
289
+ private _capabilityErrorHandler;
290
+ }
291
+ //#endregion
292
+ //#region src/mcp/client-storage.d.ts
293
+ /**
294
+ * Represents a row in the cf_agents_mcp_servers table
295
+ */
296
+ type MCPServerRow = {
297
+ id: string;
298
+ name: string;
299
+ server_url: string;
300
+ client_id: string | null;
301
+ auth_url: string | null;
302
+ callback_url: string;
303
+ server_options: string | null;
304
+ };
305
+ //#endregion
306
+ //#region src/mcp/client.d.ts
307
+ /**
308
+ * Options that can be stored in the server_options column
309
+ * This is what gets JSON.stringify'd and stored in the database
310
+ */
311
+ type MCPServerOptions = {
312
+ client?: ConstructorParameters<typeof Client>[1];
313
+ transport?: {
314
+ headers?: HeadersInit;
315
+ type?: TransportType;
316
+ };
317
+ };
318
+ /**
319
+ * Options for registering an MCP server
320
+ */
321
+ type RegisterServerOptions = {
322
+ url: string;
323
+ name: string;
324
+ callbackUrl: string;
325
+ client?: ConstructorParameters<typeof Client>[1];
326
+ transport?: MCPTransportOptions;
327
+ authUrl?: string;
328
+ clientId?: string;
329
+ };
330
+ /**
331
+ * Result of attempting to connect to an MCP server.
332
+ * Returns the current connection state after the operation.
333
+ *
334
+ * - "ready": Connection established and ready to use (non-OAuth)
335
+ * - "authenticating": OAuth required, user must visit authUrl to authorize
336
+ */
337
+ type MCPConnectionResult =
338
+ | {
339
+ state: "ready";
340
+ }
341
+ | {
342
+ state: "authenticating";
343
+ authUrl: string;
344
+ clientId?: string;
345
+ };
346
+ type MCPClientOAuthCallbackConfig = {
347
+ successRedirect?: string;
348
+ errorRedirect?: string;
349
+ customHandler?: (result: MCPClientOAuthResult) => Response;
350
+ };
351
+ type MCPClientOAuthResult = {
352
+ serverId: string;
353
+ authSuccess: boolean;
354
+ authError?: string;
355
+ };
356
+ type MCPClientManagerOptions = {
357
+ storage: DurableObjectStorage;
358
+ };
359
+ /**
360
+ * Utility class that aggregates multiple MCP clients into one
361
+ */
362
+ declare class MCPClientManager {
363
+ private _name;
364
+ private _version;
365
+ mcpConnections: Record<string, MCPClientConnection>;
366
+ private _didWarnAboutUnstableGetAITools;
367
+ private _oauthCallbackConfig?;
368
+ private _connectionDisposables;
369
+ private _storage;
370
+ private _isRestored;
371
+ private readonly _onObservabilityEvent;
372
+ readonly onObservabilityEvent: Event<MCPObservabilityEvent>;
373
+ private readonly _onServerStateChanged;
374
+ /**
375
+ * Event that fires whenever any MCP server state changes (registered, connected, removed, etc.)
376
+ * This is useful for broadcasting server state to clients.
377
+ */
378
+ readonly onServerStateChanged: Event<void>;
379
+ /**
380
+ * @param _name Name of the MCP client
381
+ * @param _version Version of the MCP Client
382
+ * @param options Storage adapter for persisting MCP server state
383
+ */
384
+ constructor(
385
+ _name: string,
386
+ _version: string,
387
+ options: MCPClientManagerOptions
388
+ );
389
+ private sql;
390
+ private saveServerToStorage;
391
+ private removeServerFromStorage;
392
+ private getServersFromStorage;
393
+ private clearServerAuthUrl;
394
+ jsonSchema: typeof ai0.jsonSchema | undefined;
395
+ /**
396
+ * Create an auth provider for a server
397
+ * @internal
398
+ */
399
+ private createAuthProvider;
400
+ /**
401
+ * Restore MCP server connections from storage
402
+ * This method is called on Agent initialization to restore previously connected servers
403
+ *
404
+ * @param clientName Name to use for OAuth client (typically the agent instance name)
405
+ */
406
+ restoreConnectionsFromStorage(clientName: string): Promise<void>;
407
+ /**
408
+ * Connect to and register an MCP server
409
+ *
410
+ * @deprecated This method is maintained for backward compatibility.
411
+ * For new code, use registerServer() and connectToServer() separately.
412
+ *
413
+ * @param url Server URL
414
+ * @param options Connection options
415
+ * @returns Object with server ID, auth URL (if OAuth), and client ID (if OAuth)
416
+ */
417
+ connect(
418
+ url: string,
419
+ options?: {
420
+ reconnect?: {
421
+ id: string;
422
+ oauthClientId?: string;
423
+ oauthCode?: string;
424
+ };
425
+ transport?: MCPTransportOptions;
426
+ client?: ConstructorParameters<typeof Client>[1];
427
+ }
428
+ ): Promise<{
429
+ id: string;
430
+ authUrl?: string;
431
+ clientId?: string;
432
+ }>;
433
+ /**
434
+ * Create an in-memory connection object and set up observability
435
+ * Does NOT save to storage - use registerServer() for that
436
+ */
437
+ private createConnection;
438
+ /**
439
+ * Register an MCP server connection without connecting
440
+ * Creates the connection object, sets up observability, and saves to storage
441
+ *
442
+ * @param id Server ID
443
+ * @param options Registration options including URL, name, callback URL, and connection config
444
+ * @returns Server ID
445
+ */
446
+ registerServer(id: string, options: RegisterServerOptions): Promise<string>;
447
+ /**
448
+ * Connect to an already registered MCP server and initialize the connection.
449
+ *
450
+ * For OAuth servers, this returns `{ state: "authenticating", authUrl, clientId? }`
451
+ * without establishing the connection. The user must complete the OAuth flow via
452
+ * the authUrl, which will trigger a callback handled by `handleCallbackRequest()`.
453
+ *
454
+ * For non-OAuth servers, this establishes the connection immediately and returns
455
+ * `{ state: "ready" }`.
456
+ *
457
+ * Updates storage with auth URL and client ID after connection.
458
+ *
459
+ * @param id Server ID (must be registered first via registerServer())
460
+ * @returns Connection result with current state and OAuth info (if applicable)
461
+ */
462
+ connectToServer(id: string): Promise<MCPConnectionResult>;
463
+ isCallbackRequest(req: Request): boolean;
464
+ handleCallbackRequest(req: Request): Promise<
465
+ | {
466
+ serverId: string;
467
+ authSuccess: boolean;
468
+ authError: string;
469
+ }
470
+ | {
471
+ serverId: string;
472
+ authSuccess: boolean;
473
+ authError?: undefined;
474
+ }
475
+ >;
476
+ /**
477
+ * Establish connection in the background after OAuth completion
478
+ * This method is called asynchronously and doesn't block the OAuth callback response
479
+ * @param serverId The server ID to establish connection for
480
+ */
481
+ establishConnection(serverId: string): Promise<void>;
482
+ /**
483
+ * Configure OAuth callback handling
484
+ * @param config OAuth callback configuration
485
+ */
486
+ configureOAuthCallback(config: MCPClientOAuthCallbackConfig): void;
487
+ /**
488
+ * Get the current OAuth callback configuration
489
+ * @returns The current OAuth callback configuration
490
+ */
491
+ getOAuthCallbackConfig(): MCPClientOAuthCallbackConfig | undefined;
492
+ /**
493
+ * @returns namespaced list of tools
494
+ */
495
+ listTools(): NamespacedData["tools"];
496
+ /**
497
+ * Lazy-loads the jsonSchema function from the AI SDK.
498
+ *
499
+ * This defers importing the "ai" package until it's actually needed, which helps reduce
500
+ * initial bundle size and startup time. The jsonSchema function is required for converting
501
+ * MCP tools into AI SDK tool definitions via getAITools().
502
+ *
503
+ * @internal This method is for internal use only. It's automatically called before operations
504
+ * that need jsonSchema (like getAITools() or OAuth flows). External consumers should not need
505
+ * to call this directly.
506
+ */
507
+ ensureJsonSchema(): Promise<void>;
508
+ /**
509
+ * @returns a set of tools that you can use with the AI SDK
510
+ */
511
+ getAITools(): ToolSet;
512
+ /**
513
+ * @deprecated this has been renamed to getAITools(), and unstable_getAITools will be removed in the next major version
514
+ * @returns a set of tools that you can use with the AI SDK
515
+ */
516
+ unstable_getAITools(): ToolSet;
517
+ /**
518
+ * Closes all connections to MCP servers
519
+ */
520
+ closeAllConnections(): Promise<void>;
521
+ /**
522
+ * Closes a connection to an MCP server
523
+ * @param id The id of the connection to close
524
+ */
525
+ closeConnection(id: string): Promise<void>;
526
+ /**
527
+ * Remove an MCP server from storage
528
+ */
529
+ removeServer(serverId: string): void;
530
+ /**
531
+ * List all MCP servers from storage
532
+ */
533
+ listServers(): MCPServerRow[];
534
+ /**
535
+ * Dispose the manager and all resources.
536
+ */
537
+ dispose(): Promise<void>;
538
+ /**
539
+ * @returns namespaced list of prompts
540
+ */
541
+ listPrompts(): NamespacedData["prompts"];
542
+ /**
543
+ * @returns namespaced list of tools
544
+ */
545
+ listResources(): NamespacedData["resources"];
546
+ /**
547
+ * @returns namespaced list of resource templates
548
+ */
549
+ listResourceTemplates(): NamespacedData["resourceTemplates"];
550
+ /**
551
+ * Namespaced version of callTool
552
+ */
553
+ callTool(
554
+ params: CallToolRequest["params"] & {
555
+ serverId: string;
556
+ },
557
+ resultSchema?:
558
+ | typeof CallToolResultSchema
559
+ | typeof CompatibilityCallToolResultSchema,
560
+ options?: RequestOptions
561
+ ): Promise<
562
+ | zod0.objectOutputType<
563
+ {
564
+ _meta: zod0.ZodOptional<
565
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
566
+ >;
567
+ } & {
568
+ content: zod0.ZodDefault<
569
+ zod0.ZodArray<
570
+ zod0.ZodUnion<
571
+ [
572
+ zod0.ZodObject<
573
+ {
574
+ type: zod0.ZodLiteral<"text">;
575
+ text: zod0.ZodString;
576
+ _meta: zod0.ZodOptional<
577
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
578
+ >;
579
+ },
580
+ "strip",
581
+ zod0.ZodTypeAny,
582
+ {
583
+ type: "text";
584
+ text: string;
585
+ _meta?: Record<string, unknown> | undefined;
586
+ },
587
+ {
588
+ type: "text";
589
+ text: string;
590
+ _meta?: Record<string, unknown> | undefined;
591
+ }
592
+ >,
593
+ zod0.ZodObject<
594
+ {
595
+ type: zod0.ZodLiteral<"image">;
596
+ data: zod0.ZodEffects<zod0.ZodString, string, string>;
597
+ mimeType: zod0.ZodString;
598
+ _meta: zod0.ZodOptional<
599
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
600
+ >;
601
+ },
602
+ "strip",
603
+ zod0.ZodTypeAny,
604
+ {
605
+ type: "image";
606
+ data: string;
607
+ mimeType: string;
608
+ _meta?: Record<string, unknown> | undefined;
609
+ },
610
+ {
611
+ type: "image";
612
+ data: string;
613
+ mimeType: string;
614
+ _meta?: Record<string, unknown> | undefined;
615
+ }
616
+ >,
617
+ zod0.ZodObject<
618
+ {
619
+ type: zod0.ZodLiteral<"audio">;
620
+ data: zod0.ZodEffects<zod0.ZodString, string, string>;
621
+ mimeType: zod0.ZodString;
622
+ _meta: zod0.ZodOptional<
623
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
624
+ >;
625
+ },
626
+ "strip",
627
+ zod0.ZodTypeAny,
628
+ {
629
+ type: "audio";
630
+ data: string;
631
+ mimeType: string;
632
+ _meta?: Record<string, unknown> | undefined;
633
+ },
634
+ {
635
+ type: "audio";
636
+ data: string;
637
+ mimeType: string;
638
+ _meta?: Record<string, unknown> | undefined;
639
+ }
640
+ >,
641
+ zod0.ZodObject<
642
+ zod0.objectUtil.extendShape<
643
+ zod0.objectUtil.extendShape<
644
+ zod0.objectUtil.extendShape<
645
+ {
646
+ name: zod0.ZodString;
647
+ title: zod0.ZodOptional<zod0.ZodString>;
648
+ },
649
+ {
650
+ uri: zod0.ZodString;
651
+ description: zod0.ZodOptional<zod0.ZodString>;
652
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
653
+ _meta: zod0.ZodOptional<
654
+ zod0.ZodObject<
655
+ {},
656
+ "passthrough",
657
+ zod0.ZodTypeAny,
658
+ zod0.objectOutputType<
659
+ {},
660
+ zod0.ZodTypeAny,
661
+ "passthrough"
662
+ >,
663
+ zod0.objectInputType<
664
+ {},
665
+ zod0.ZodTypeAny,
666
+ "passthrough"
667
+ >
668
+ >
669
+ >;
670
+ }
671
+ >,
672
+ {
673
+ icons: zod0.ZodOptional<
674
+ zod0.ZodArray<
675
+ zod0.ZodObject<
676
+ {
677
+ src: zod0.ZodString;
678
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
679
+ sizes: zod0.ZodOptional<
680
+ zod0.ZodArray<zod0.ZodString, "many">
681
+ >;
682
+ },
683
+ "strip",
684
+ zod0.ZodTypeAny,
685
+ {
686
+ src: string;
687
+ mimeType?: string | undefined;
688
+ sizes?: string[] | undefined;
689
+ },
690
+ {
691
+ src: string;
692
+ mimeType?: string | undefined;
693
+ sizes?: string[] | undefined;
694
+ }
695
+ >,
696
+ "many"
697
+ >
698
+ >;
699
+ }
700
+ >,
701
+ {
702
+ type: zod0.ZodLiteral<"resource_link">;
703
+ }
704
+ >,
705
+ "strip",
706
+ zod0.ZodTypeAny,
707
+ {
708
+ type: "resource_link";
709
+ name: string;
710
+ uri: string;
711
+ _meta?:
712
+ | zod0.objectOutputType<
713
+ {},
714
+ zod0.ZodTypeAny,
715
+ "passthrough"
716
+ >
717
+ | undefined;
718
+ mimeType?: string | undefined;
719
+ icons?:
720
+ | {
721
+ src: string;
722
+ mimeType?: string | undefined;
723
+ sizes?: string[] | undefined;
724
+ }[]
725
+ | undefined;
726
+ title?: string | undefined;
727
+ description?: string | undefined;
728
+ },
729
+ {
730
+ type: "resource_link";
731
+ name: string;
732
+ uri: string;
733
+ _meta?:
734
+ | zod0.objectInputType<
735
+ {},
736
+ zod0.ZodTypeAny,
737
+ "passthrough"
738
+ >
739
+ | undefined;
740
+ mimeType?: string | undefined;
741
+ icons?:
742
+ | {
743
+ src: string;
744
+ mimeType?: string | undefined;
745
+ sizes?: string[] | undefined;
746
+ }[]
747
+ | undefined;
748
+ title?: string | undefined;
749
+ description?: string | undefined;
750
+ }
751
+ >,
752
+ zod0.ZodObject<
753
+ {
754
+ type: zod0.ZodLiteral<"resource">;
755
+ resource: zod0.ZodUnion<
756
+ [
757
+ zod0.ZodObject<
758
+ zod0.objectUtil.extendShape<
759
+ {
760
+ uri: zod0.ZodString;
761
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
762
+ _meta: zod0.ZodOptional<
763
+ zod0.ZodRecord<
764
+ zod0.ZodString,
765
+ zod0.ZodUnknown
766
+ >
767
+ >;
768
+ },
769
+ {
770
+ text: zod0.ZodString;
771
+ }
772
+ >,
773
+ "strip",
774
+ zod0.ZodTypeAny,
775
+ {
776
+ uri: string;
777
+ text: string;
778
+ _meta?: Record<string, unknown> | undefined;
779
+ mimeType?: string | undefined;
780
+ },
781
+ {
782
+ uri: string;
783
+ text: string;
784
+ _meta?: Record<string, unknown> | undefined;
785
+ mimeType?: string | undefined;
786
+ }
787
+ >,
788
+ zod0.ZodObject<
789
+ zod0.objectUtil.extendShape<
790
+ {
791
+ uri: zod0.ZodString;
792
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
793
+ _meta: zod0.ZodOptional<
794
+ zod0.ZodRecord<
795
+ zod0.ZodString,
796
+ zod0.ZodUnknown
797
+ >
798
+ >;
799
+ },
800
+ {
801
+ blob: zod0.ZodEffects<
802
+ zod0.ZodString,
803
+ string,
804
+ string
805
+ >;
806
+ }
807
+ >,
808
+ "strip",
809
+ zod0.ZodTypeAny,
810
+ {
811
+ uri: string;
812
+ blob: string;
813
+ _meta?: Record<string, unknown> | undefined;
814
+ mimeType?: string | undefined;
815
+ },
816
+ {
817
+ uri: string;
818
+ blob: string;
819
+ _meta?: Record<string, unknown> | undefined;
820
+ mimeType?: string | undefined;
821
+ }
822
+ >
823
+ ]
824
+ >;
825
+ _meta: zod0.ZodOptional<
826
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
827
+ >;
828
+ },
829
+ "strip",
830
+ zod0.ZodTypeAny,
831
+ {
832
+ type: "resource";
833
+ resource:
834
+ | {
835
+ uri: string;
836
+ text: string;
837
+ _meta?: Record<string, unknown> | undefined;
838
+ mimeType?: string | undefined;
839
+ }
840
+ | {
841
+ uri: string;
842
+ blob: string;
843
+ _meta?: Record<string, unknown> | undefined;
844
+ mimeType?: string | undefined;
845
+ };
846
+ _meta?: Record<string, unknown> | undefined;
847
+ },
848
+ {
849
+ type: "resource";
850
+ resource:
851
+ | {
852
+ uri: string;
853
+ text: string;
854
+ _meta?: Record<string, unknown> | undefined;
855
+ mimeType?: string | undefined;
856
+ }
857
+ | {
858
+ uri: string;
859
+ blob: string;
860
+ _meta?: Record<string, unknown> | undefined;
861
+ mimeType?: string | undefined;
862
+ };
863
+ _meta?: Record<string, unknown> | undefined;
864
+ }
865
+ >
866
+ ]
867
+ >,
868
+ "many"
869
+ >
870
+ >;
871
+ structuredContent: zod0.ZodOptional<
872
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
873
+ >;
874
+ isError: zod0.ZodOptional<zod0.ZodBoolean>;
875
+ },
876
+ zod0.ZodTypeAny,
877
+ "passthrough"
878
+ >
879
+ | zod0.objectOutputType<
880
+ {
881
+ _meta: zod0.ZodOptional<
882
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
883
+ >;
884
+ } & {
885
+ toolResult: zod0.ZodUnknown;
886
+ },
887
+ zod0.ZodTypeAny,
888
+ "passthrough"
889
+ >
890
+ >;
891
+ /**
892
+ * Namespaced version of readResource
893
+ */
894
+ readResource(
895
+ params: ReadResourceRequest["params"] & {
896
+ serverId: string;
897
+ },
898
+ options: RequestOptions
899
+ ): Promise<
900
+ zod0.objectOutputType<
901
+ {
902
+ _meta: zod0.ZodOptional<
903
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
904
+ >;
905
+ } & {
906
+ contents: zod0.ZodArray<
907
+ zod0.ZodUnion<
908
+ [
909
+ zod0.ZodObject<
910
+ zod0.objectUtil.extendShape<
911
+ {
912
+ uri: zod0.ZodString;
913
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
914
+ _meta: zod0.ZodOptional<
915
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
916
+ >;
917
+ },
918
+ {
919
+ text: zod0.ZodString;
920
+ }
921
+ >,
922
+ "strip",
923
+ zod0.ZodTypeAny,
924
+ {
925
+ uri: string;
926
+ text: string;
927
+ _meta?: Record<string, unknown> | undefined;
928
+ mimeType?: string | undefined;
929
+ },
930
+ {
931
+ uri: string;
932
+ text: string;
933
+ _meta?: Record<string, unknown> | undefined;
934
+ mimeType?: string | undefined;
935
+ }
936
+ >,
937
+ zod0.ZodObject<
938
+ zod0.objectUtil.extendShape<
939
+ {
940
+ uri: zod0.ZodString;
941
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
942
+ _meta: zod0.ZodOptional<
943
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
944
+ >;
945
+ },
946
+ {
947
+ blob: zod0.ZodEffects<zod0.ZodString, string, string>;
948
+ }
949
+ >,
950
+ "strip",
951
+ zod0.ZodTypeAny,
952
+ {
953
+ uri: string;
954
+ blob: string;
955
+ _meta?: Record<string, unknown> | undefined;
956
+ mimeType?: string | undefined;
957
+ },
958
+ {
959
+ uri: string;
960
+ blob: string;
961
+ _meta?: Record<string, unknown> | undefined;
962
+ mimeType?: string | undefined;
963
+ }
964
+ >
965
+ ]
966
+ >,
967
+ "many"
968
+ >;
969
+ },
970
+ zod0.ZodTypeAny,
971
+ "passthrough"
972
+ >
973
+ >;
974
+ /**
975
+ * Namespaced version of getPrompt
976
+ */
977
+ getPrompt(
978
+ params: GetPromptRequest["params"] & {
979
+ serverId: string;
980
+ },
981
+ options: RequestOptions
982
+ ): Promise<
983
+ zod0.objectOutputType<
984
+ {
985
+ _meta: zod0.ZodOptional<
986
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
987
+ >;
988
+ } & {
989
+ description: zod0.ZodOptional<zod0.ZodString>;
990
+ messages: zod0.ZodArray<
991
+ zod0.ZodObject<
992
+ {
993
+ role: zod0.ZodEnum<["user", "assistant"]>;
994
+ content: zod0.ZodUnion<
995
+ [
996
+ zod0.ZodObject<
997
+ {
998
+ type: zod0.ZodLiteral<"text">;
999
+ text: zod0.ZodString;
1000
+ _meta: zod0.ZodOptional<
1001
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
1002
+ >;
1003
+ },
1004
+ "strip",
1005
+ zod0.ZodTypeAny,
1006
+ {
1007
+ type: "text";
1008
+ text: string;
1009
+ _meta?: Record<string, unknown> | undefined;
1010
+ },
1011
+ {
1012
+ type: "text";
1013
+ text: string;
1014
+ _meta?: Record<string, unknown> | undefined;
1015
+ }
1016
+ >,
1017
+ zod0.ZodObject<
1018
+ {
1019
+ type: zod0.ZodLiteral<"image">;
1020
+ data: zod0.ZodEffects<zod0.ZodString, string, string>;
1021
+ mimeType: zod0.ZodString;
1022
+ _meta: zod0.ZodOptional<
1023
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
1024
+ >;
1025
+ },
1026
+ "strip",
1027
+ zod0.ZodTypeAny,
1028
+ {
1029
+ type: "image";
1030
+ data: string;
1031
+ mimeType: string;
1032
+ _meta?: Record<string, unknown> | undefined;
1033
+ },
1034
+ {
1035
+ type: "image";
1036
+ data: string;
1037
+ mimeType: string;
1038
+ _meta?: Record<string, unknown> | undefined;
1039
+ }
1040
+ >,
1041
+ zod0.ZodObject<
1042
+ {
1043
+ type: zod0.ZodLiteral<"audio">;
1044
+ data: zod0.ZodEffects<zod0.ZodString, string, string>;
1045
+ mimeType: zod0.ZodString;
1046
+ _meta: zod0.ZodOptional<
1047
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
1048
+ >;
1049
+ },
1050
+ "strip",
1051
+ zod0.ZodTypeAny,
1052
+ {
1053
+ type: "audio";
1054
+ data: string;
1055
+ mimeType: string;
1056
+ _meta?: Record<string, unknown> | undefined;
1057
+ },
1058
+ {
1059
+ type: "audio";
1060
+ data: string;
1061
+ mimeType: string;
1062
+ _meta?: Record<string, unknown> | undefined;
1063
+ }
1064
+ >,
1065
+ zod0.ZodObject<
1066
+ zod0.objectUtil.extendShape<
1067
+ zod0.objectUtil.extendShape<
1068
+ zod0.objectUtil.extendShape<
1069
+ {
1070
+ name: zod0.ZodString;
1071
+ title: zod0.ZodOptional<zod0.ZodString>;
1072
+ },
1073
+ {
1074
+ uri: zod0.ZodString;
1075
+ description: zod0.ZodOptional<zod0.ZodString>;
1076
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
1077
+ _meta: zod0.ZodOptional<
1078
+ zod0.ZodObject<
1079
+ {},
1080
+ "passthrough",
1081
+ zod0.ZodTypeAny,
1082
+ zod0.objectOutputType<
1083
+ {},
1084
+ zod0.ZodTypeAny,
1085
+ "passthrough"
1086
+ >,
1087
+ zod0.objectInputType<
1088
+ {},
1089
+ zod0.ZodTypeAny,
1090
+ "passthrough"
1091
+ >
1092
+ >
1093
+ >;
1094
+ }
1095
+ >,
1096
+ {
1097
+ icons: zod0.ZodOptional<
1098
+ zod0.ZodArray<
1099
+ zod0.ZodObject<
1100
+ {
1101
+ src: zod0.ZodString;
1102
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
1103
+ sizes: zod0.ZodOptional<
1104
+ zod0.ZodArray<zod0.ZodString, "many">
1105
+ >;
1106
+ },
1107
+ "strip",
1108
+ zod0.ZodTypeAny,
1109
+ {
1110
+ src: string;
1111
+ mimeType?: string | undefined;
1112
+ sizes?: string[] | undefined;
1113
+ },
1114
+ {
1115
+ src: string;
1116
+ mimeType?: string | undefined;
1117
+ sizes?: string[] | undefined;
1118
+ }
1119
+ >,
1120
+ "many"
1121
+ >
1122
+ >;
1123
+ }
1124
+ >,
1125
+ {
1126
+ type: zod0.ZodLiteral<"resource_link">;
1127
+ }
1128
+ >,
1129
+ "strip",
1130
+ zod0.ZodTypeAny,
1131
+ {
1132
+ type: "resource_link";
1133
+ name: string;
1134
+ uri: string;
1135
+ _meta?:
1136
+ | zod0.objectOutputType<
1137
+ {},
1138
+ zod0.ZodTypeAny,
1139
+ "passthrough"
1140
+ >
1141
+ | undefined;
1142
+ mimeType?: string | undefined;
1143
+ icons?:
1144
+ | {
1145
+ src: string;
1146
+ mimeType? /**
1147
+ * We need to delay loading ai sdk, because putting it in module scope is
1148
+ * causing issues with startup time.
1149
+ * The only place it's used is in getAITools, which only matters after
1150
+ * .connect() is called on at least one server.
1151
+ * So it's safe to delay loading it until .connect() is called.
1152
+ */
1153
+ : string | undefined;
1154
+ sizes?: string[] | undefined;
1155
+ }[]
1156
+ | undefined;
1157
+ title?: string | undefined;
1158
+ description?: string | undefined;
1159
+ },
1160
+ {
1161
+ type: "resource_link";
1162
+ name: string;
1163
+ uri: string;
1164
+ _meta?:
1165
+ | zod0.objectInputType<
1166
+ {},
1167
+ zod0.ZodTypeAny,
1168
+ "passthrough"
1169
+ >
1170
+ | undefined;
1171
+ mimeType?: string | undefined;
1172
+ icons?:
1173
+ | {
1174
+ src: string;
1175
+ mimeType?: string | undefined;
1176
+ sizes?: string[] | undefined;
1177
+ }[]
1178
+ | undefined;
1179
+ title?: string | undefined;
1180
+ description?: string | undefined;
1181
+ }
1182
+ >,
1183
+ zod0.ZodObject<
1184
+ {
1185
+ type: zod0.ZodLiteral<"resource">;
1186
+ resource: zod0.ZodUnion<
1187
+ [
1188
+ zod0.ZodObject<
1189
+ zod0.objectUtil.extendShape<
1190
+ {
1191
+ uri: zod0.ZodString;
1192
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
1193
+ _meta: zod0.ZodOptional<
1194
+ zod0.ZodRecord<
1195
+ zod0.ZodString,
1196
+ zod0.ZodUnknown
1197
+ >
1198
+ >;
1199
+ },
1200
+ {
1201
+ text: zod0.ZodString;
1202
+ }
1203
+ >,
1204
+ "strip",
1205
+ zod0.ZodTypeAny,
1206
+ {
1207
+ uri: string;
1208
+ text: string;
1209
+ _meta?: Record<string, unknown> | undefined;
1210
+ mimeType?: string | undefined;
1211
+ },
1212
+ {
1213
+ uri: string;
1214
+ text: string;
1215
+ _meta?: Record<string, unknown> | undefined;
1216
+ mimeType?: string | undefined;
1217
+ }
1218
+ >,
1219
+ zod0.ZodObject<
1220
+ zod0.objectUtil.extendShape<
1221
+ {
1222
+ uri: zod0.ZodString;
1223
+ mimeType: zod0.ZodOptional<zod0.ZodString>;
1224
+ _meta: zod0.ZodOptional<
1225
+ zod0.ZodRecord<
1226
+ zod0.ZodString,
1227
+ zod0.ZodUnknown
1228
+ >
1229
+ >;
1230
+ },
1231
+ {
1232
+ blob: zod0.ZodEffects<
1233
+ zod0.ZodString,
1234
+ string,
1235
+ string
1236
+ >;
1237
+ }
1238
+ >,
1239
+ "strip",
1240
+ zod0.ZodTypeAny,
1241
+ {
1242
+ uri: string;
1243
+ blob: string;
1244
+ _meta?: Record<string, unknown> | undefined;
1245
+ mimeType?: string | undefined;
1246
+ },
1247
+ {
1248
+ uri: string;
1249
+ blob: string;
1250
+ _meta?: Record<string, unknown> | undefined;
1251
+ mimeType?: string | undefined;
1252
+ }
1253
+ >
1254
+ ]
1255
+ >;
1256
+ _meta: zod0.ZodOptional<
1257
+ zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>
1258
+ >;
1259
+ },
1260
+ "strip",
1261
+ zod0.ZodTypeAny,
1262
+ {
1263
+ type: "resource";
1264
+ resource:
1265
+ | {
1266
+ uri: string;
1267
+ text: string;
1268
+ _meta?: Record<string, unknown> | undefined;
1269
+ mimeType?: string | undefined;
1270
+ }
1271
+ | {
1272
+ uri: string;
1273
+ blob: string;
1274
+ _meta?: Record<string, unknown> | undefined;
1275
+ mimeType?: string | undefined;
1276
+ };
1277
+ _meta?: Record<string, unknown> | undefined;
1278
+ },
1279
+ {
1280
+ type: "resource";
1281
+ resource:
1282
+ | {
1283
+ uri: string;
1284
+ text: string;
1285
+ _meta?: Record<string, unknown> | undefined;
1286
+ mimeType?: string | undefined;
1287
+ }
1288
+ | {
1289
+ uri: string;
1290
+ blob: string;
1291
+ _meta?: Record<string, unknown> | undefined;
1292
+ mimeType?: string | undefined;
1293
+ };
1294
+ _meta?: Record<string, unknown> | undefined;
1295
+ }
1296
+ >
1297
+ ]
1298
+ >;
1299
+ },
1300
+ "strip",
1301
+ zod0.ZodTypeAny,
1302
+ {
1303
+ role: "user" | "assistant";
1304
+ content:
1305
+ | {
1306
+ type: "text";
1307
+ text: string;
1308
+ _meta?: Record<string, unknown> | undefined;
1309
+ }
1310
+ | {
1311
+ type: "image";
1312
+ data: string;
1313
+ mimeType: string;
1314
+ _meta?: Record<string, unknown> | undefined;
1315
+ }
1316
+ | {
1317
+ type: "audio";
1318
+ data: string;
1319
+ mimeType: string;
1320
+ _meta?: Record<string, unknown> | undefined;
1321
+ }
1322
+ | {
1323
+ type: "resource";
1324
+ resource:
1325
+ | {
1326
+ uri: string;
1327
+ text: string;
1328
+ _meta?: Record<string, unknown> | undefined;
1329
+ mimeType?: string | undefined;
1330
+ }
1331
+ | {
1332
+ uri: string;
1333
+ blob: string;
1334
+ _meta?: Record<string, unknown> | undefined;
1335
+ mimeType?: string | undefined;
1336
+ };
1337
+ _meta?: Record<string, unknown> | undefined;
1338
+ }
1339
+ | {
1340
+ type: "resource_link";
1341
+ name: string;
1342
+ uri: string;
1343
+ _meta?:
1344
+ | zod0.objectOutputType<
1345
+ {},
1346
+ zod0.ZodTypeAny,
1347
+ "passthrough"
1348
+ >
1349
+ | undefined;
1350
+ mimeType?: string | undefined;
1351
+ icons?:
1352
+ | {
1353
+ src: string;
1354
+ mimeType?: string | undefined;
1355
+ sizes?: string[] | undefined;
1356
+ }[]
1357
+ | undefined;
1358
+ title?: string | undefined;
1359
+ description?: string | undefined;
1360
+ };
1361
+ },
1362
+ {
1363
+ role: "user" | "assistant";
1364
+ content:
1365
+ | {
1366
+ type: "text";
1367
+ text: string;
1368
+ _meta?: Record<string, unknown> | undefined;
1369
+ }
1370
+ | {
1371
+ type: "image";
1372
+ data: string;
1373
+ mimeType: string;
1374
+ _meta?: Record<string, unknown> | undefined;
1375
+ }
1376
+ | {
1377
+ type: "audio";
1378
+ data: string;
1379
+ mimeType: string;
1380
+ _meta?: Record<string, unknown> | undefined;
1381
+ }
1382
+ | {
1383
+ type: "resource";
1384
+ resource:
1385
+ | {
1386
+ uri: string;
1387
+ text: string;
1388
+ _meta?: Record<string, unknown> | undefined;
1389
+ mimeType?: string | undefined;
1390
+ }
1391
+ | {
1392
+ uri: string;
1393
+ blob: string;
1394
+ _meta?: Record<string, unknown> | undefined;
1395
+ mimeType?: string | undefined;
1396
+ };
1397
+ _meta?: Record<string, unknown> | undefined;
1398
+ }
1399
+ | {
1400
+ type: "resource_link";
1401
+ name: string;
1402
+ uri: string;
1403
+ _meta?:
1404
+ | zod0.objectInputType<{}, zod0.ZodTypeAny, "passthrough">
1405
+ | undefined;
1406
+ mimeType?: string | undefined;
1407
+ icons?:
1408
+ | {
1409
+ src: string;
1410
+ mimeType?: string | undefined;
1411
+ sizes?: string[] | undefined;
1412
+ }[]
1413
+ | undefined;
1414
+ title?: string | undefined;
1415
+ description?: string | undefined;
1416
+ };
1417
+ }
1418
+ >,
1419
+ "many"
1420
+ >;
1421
+ },
1422
+ zod0.ZodTypeAny,
1423
+ "passthrough"
1424
+ >
1425
+ >;
1426
+ }
1427
+ type NamespacedData = {
1428
+ tools: (Tool & {
1429
+ serverId: string;
1430
+ })[];
1431
+ prompts: (Prompt & {
1432
+ serverId: string;
1433
+ })[];
1434
+ resources: (Resource & {
1435
+ serverId: string;
1436
+ })[];
1437
+ resourceTemplates: (ResourceTemplate & {
1438
+ serverId: string;
1439
+ })[];
1440
+ };
1441
+ declare function getNamespacedData<T extends keyof NamespacedData>(
1442
+ mcpClients: Record<string, MCPClientConnection>,
1443
+ type: T
1444
+ ): NamespacedData[T];
1445
+ //#endregion
1446
+ export {
1447
+ MCPConnectionResult as a,
1448
+ getNamespacedData as c,
1449
+ CORSOptions as d,
1450
+ MaybePromise as f,
1451
+ MCPClientOAuthResult as i,
1452
+ MCPConnectionState as l,
1453
+ TransportType as m,
1454
+ MCPClientManagerOptions as n,
1455
+ MCPServerOptions as o,
1456
+ ServeOptions as p,
1457
+ MCPClientOAuthCallbackConfig as r,
1458
+ RegisterServerOptions as s,
1459
+ MCPClientManager as t,
1460
+ BaseTransportType as u
1461
+ };
1462
+ //# sourceMappingURL=client-BG2wUgN5.d.ts.map