agents 0.0.0-e934f53 → 0.0.0-ecbd795

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 (67) hide show
  1. package/README.md +129 -7
  2. package/dist/_esm-LV5FJ3HK.js +3922 -0
  3. package/dist/_esm-LV5FJ3HK.js.map +1 -0
  4. package/dist/ai-chat-agent.d.ts +9 -8
  5. package/dist/ai-chat-agent.js +151 -59
  6. package/dist/ai-chat-agent.js.map +1 -1
  7. package/dist/ai-chat-v5-migration.d.ts +152 -0
  8. package/dist/ai-chat-v5-migration.js +20 -0
  9. package/dist/ai-chat-v5-migration.js.map +1 -0
  10. package/dist/ai-react.d.ts +65 -70
  11. package/dist/ai-react.js +178 -37
  12. package/dist/ai-react.js.map +1 -1
  13. package/dist/ai-types.d.ts +37 -19
  14. package/dist/ai-types.js +7 -0
  15. package/dist/ccip-CMBYN64O.js +15 -0
  16. package/dist/ccip-CMBYN64O.js.map +1 -0
  17. package/dist/chunk-5Y6BEZDY.js +276 -0
  18. package/dist/chunk-5Y6BEZDY.js.map +1 -0
  19. package/dist/chunk-BER7KXUJ.js +18 -0
  20. package/dist/chunk-BER7KXUJ.js.map +1 -0
  21. package/dist/chunk-JJBFIGUC.js +5202 -0
  22. package/dist/chunk-JJBFIGUC.js.map +1 -0
  23. package/dist/{chunk-JXN5WZFQ.js → chunk-KK7D3KRW.js} +90 -77
  24. package/dist/chunk-KK7D3KRW.js.map +1 -0
  25. package/dist/{chunk-PVQZBKN7.js → chunk-LL2AFX7V.js} +5 -2
  26. package/dist/chunk-LL2AFX7V.js.map +1 -0
  27. package/dist/chunk-PR4QN5HX.js +43 -0
  28. package/dist/chunk-PR4QN5HX.js.map +1 -0
  29. package/dist/{chunk-KUH345EY.js → chunk-QEVM4BVL.js} +5 -5
  30. package/dist/chunk-QEVM4BVL.js.map +1 -0
  31. package/dist/{chunk-HY7ZLHJB.js → chunk-THPMWGLS.js} +20 -5
  32. package/dist/chunk-THPMWGLS.js.map +1 -0
  33. package/dist/chunk-TYAY6AU6.js +159 -0
  34. package/dist/chunk-TYAY6AU6.js.map +1 -0
  35. package/dist/chunk-UJVEAURM.js +150 -0
  36. package/dist/chunk-UJVEAURM.js.map +1 -0
  37. package/dist/{client-DgyzBU_8.d.ts → client-CvaJdLQA.d.ts} +425 -11
  38. package/dist/client.js +3 -1
  39. package/dist/index.d.ts +555 -32
  40. package/dist/index.js +8 -4
  41. package/dist/mcp/client.d.ts +1 -1
  42. package/dist/mcp/client.js +2 -1
  43. package/dist/mcp/do-oauth-client-provider.d.ts +1 -0
  44. package/dist/mcp/do-oauth-client-provider.js +2 -1
  45. package/dist/mcp/index.d.ts +56 -76
  46. package/dist/mcp/index.js +904 -760
  47. package/dist/mcp/index.js.map +1 -1
  48. package/dist/mcp/x402.d.ts +31 -0
  49. package/dist/mcp/x402.js +3195 -0
  50. package/dist/mcp/x402.js.map +1 -0
  51. package/dist/observability/index.d.ts +46 -14
  52. package/dist/observability/index.js +6 -4
  53. package/dist/react.d.ts +4 -2
  54. package/dist/react.js +8 -5
  55. package/dist/react.js.map +1 -1
  56. package/dist/schedule.d.ts +79 -5
  57. package/dist/schedule.js +17 -2
  58. package/dist/schedule.js.map +1 -1
  59. package/dist/secp256k1-M22GZP2U.js +2193 -0
  60. package/dist/secp256k1-M22GZP2U.js.map +1 -0
  61. package/package.json +20 -7
  62. package/src/index.ts +124 -88
  63. package/dist/chunk-HY7ZLHJB.js.map +0 -1
  64. package/dist/chunk-JXN5WZFQ.js.map +0 -1
  65. package/dist/chunk-KUH345EY.js.map +0 -1
  66. package/dist/chunk-PVQZBKN7.js.map +0 -1
  67. package/dist/index-BCJclX6q.d.ts +0 -615
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ai-chat-v5-migration.ts"],"sourcesContent":["import type { UIMessage } from \"ai\";\n\n/**\n * AI SDK v5 Migration following https://jhak.im/blog/ai-sdk-migration-handling-previously-saved-messages\n * Using exact types from the official AI SDK documentation\n */\n\n/**\n * AI SDK v5 Message Part types reference (from official AI SDK documentation)\n *\n * The migration logic below transforms legacy messages to match these official AI SDK v5 formats:\n * - TextUIPart: { type: \"text\", text: string, state?: \"streaming\" | \"done\" }\n * - ReasoningUIPart: { type: \"reasoning\", text: string, state?: \"streaming\" | \"done\", providerMetadata?: Record<string, unknown> }\n * - FileUIPart: { type: \"file\", mediaType: string, filename?: string, url: string }\n * - ToolUIPart: { type: `tool-${string}`, toolCallId: string, state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\", input?: Record<string, unknown>, output?: unknown, errorText?: string, providerExecuted?: boolean }\n */\n\n/**\n * Tool invocation from v4 format\n */\ntype ToolInvocation = {\n toolCallId: string;\n toolName: string;\n args: Record<string, unknown>;\n result?: unknown;\n state: \"partial-call\" | \"call\" | \"result\" | \"error\";\n};\n\n/**\n * Legacy part from v4 format\n */\ntype LegacyPart = {\n type: string;\n text?: string;\n url?: string;\n data?: string;\n mimeType?: string;\n mediaType?: string;\n filename?: string;\n};\n\n/**\n * Legacy message format from AI SDK v4\n */\nexport type LegacyMessage = {\n id?: string;\n role: string;\n content: string;\n reasoning?: string;\n toolInvocations?: ToolInvocation[];\n parts?: LegacyPart[];\n [key: string]: unknown;\n};\n\n/**\n * Corrupt content item\n */\ntype CorruptContentItem = {\n type: string;\n text: string;\n};\n\n/**\n * Corrupted message format - has content as array instead of parts\n */\nexport type CorruptArrayMessage = {\n id?: string;\n role: string;\n content: CorruptContentItem[];\n reasoning?: string;\n toolInvocations?: ToolInvocation[];\n [key: string]: unknown;\n};\n\n/**\n * Union type for messages that could be in any format\n */\nexport type MigratableMessage = LegacyMessage | CorruptArrayMessage | UIMessage;\n\n/**\n * Tool call state mapping for v4 to v5 migration\n */\nconst STATE_MAP = {\n \"partial-call\": \"input-streaming\",\n call: \"input-available\",\n result: \"output-available\",\n error: \"output-error\"\n} as const;\n\n/**\n * Checks if a message is already in the UIMessage format (has parts array)\n */\nexport function isUIMessage(message: unknown): message is UIMessage {\n return (\n typeof message === \"object\" &&\n message !== null &&\n \"parts\" in message &&\n Array.isArray((message as { parts: unknown }).parts)\n );\n}\n\n/**\n * Type guard to check if a message is in legacy format (content as string)\n */\nfunction isLegacyMessage(message: unknown): message is LegacyMessage {\n return (\n typeof message === \"object\" &&\n message !== null &&\n \"role\" in message &&\n \"content\" in message &&\n typeof (message as { role: unknown }).role === \"string\" &&\n typeof (message as { content: unknown }).content === \"string\"\n );\n}\n\n/**\n * Type guard to check if a message has corrupted array content format\n * Detects: {role: \"user\", content: [{type: \"text\", text: \"...\"}]}\n */\nfunction isCorruptArrayMessage(\n message: unknown\n): message is CorruptArrayMessage {\n return (\n typeof message === \"object\" &&\n message !== null &&\n \"role\" in message &&\n \"content\" in message &&\n typeof (message as { role: unknown }).role === \"string\" &&\n Array.isArray((message as { content: unknown }).content) &&\n !(\"parts\" in message) // Ensure it's not already a UIMessage\n );\n}\n\n/**\n * Internal message part type for transformation\n */\ntype TransformMessagePart = {\n type: string;\n text?: string;\n toolCallId?: string;\n state?: string;\n input?: Record<string, unknown>;\n output?: unknown;\n url?: string;\n mediaType?: string;\n errorText?: string;\n filename?: string;\n};\n\n/**\n * Input message that could be in any format - using unknown for flexibility\n */\ntype InputMessage = {\n id?: string;\n role?: string;\n content?: unknown;\n reasoning?: string;\n toolInvocations?: unknown[];\n parts?: unknown[];\n [key: string]: unknown;\n};\n\n/**\n * Automatic message transformer following the blog post pattern\n * Handles comprehensive migration from AI SDK v4 to v5 format\n * @param message - Message in any legacy format\n * @param index - Index for ID generation fallback\n * @returns UIMessage in v5 format\n */\nexport function autoTransformMessage(\n message: InputMessage,\n index = 0\n): UIMessage {\n // Already in v5 format\n if (isUIMessage(message)) {\n return message;\n }\n\n const parts: TransformMessagePart[] = [];\n\n // Handle reasoning transformation\n if (message.reasoning) {\n parts.push({\n type: \"reasoning\",\n text: message.reasoning\n });\n }\n\n // Handle tool invocations transformation\n if (message.toolInvocations && Array.isArray(message.toolInvocations)) {\n message.toolInvocations.forEach((inv: unknown) => {\n if (typeof inv === \"object\" && inv !== null && \"toolName\" in inv) {\n const invObj = inv as ToolInvocation;\n parts.push({\n type: `tool-${invObj.toolName}`,\n toolCallId: invObj.toolCallId,\n state:\n STATE_MAP[invObj.state as keyof typeof STATE_MAP] ||\n \"input-available\",\n input: invObj.args,\n output: invObj.result !== undefined ? invObj.result : null\n });\n }\n });\n }\n\n // Handle file parts transformation\n if (message.parts && Array.isArray(message.parts)) {\n message.parts.forEach((part: unknown) => {\n if (typeof part === \"object\" && part !== null && \"type\" in part) {\n const partObj = part as LegacyPart;\n if (partObj.type === \"file\") {\n parts.push({\n type: \"file\",\n url:\n partObj.url ||\n (partObj.data\n ? `data:${partObj.mimeType || partObj.mediaType};base64,${partObj.data}`\n : undefined),\n mediaType: partObj.mediaType || partObj.mimeType,\n filename: partObj.filename\n });\n }\n }\n });\n }\n\n // Handle corrupt array format: {role: \"user\", content: [{type: \"text\", text: \"...\"}]}\n if (Array.isArray(message.content)) {\n message.content.forEach((item: unknown) => {\n if (typeof item === \"object\" && item !== null && \"text\" in item) {\n const itemObj = item as CorruptContentItem;\n parts.push({\n type: itemObj.type || \"text\",\n text: itemObj.text || \"\"\n });\n }\n });\n }\n\n // Fallback: convert plain content to text part\n if (!parts.length && message.content !== undefined) {\n parts.push({\n type: \"text\",\n text:\n typeof message.content === \"string\"\n ? message.content\n : JSON.stringify(message.content)\n });\n }\n\n // If still no parts, create a default text part\n if (!parts.length) {\n parts.push({\n type: \"text\",\n text: typeof message === \"string\" ? message : JSON.stringify(message)\n });\n }\n\n return {\n id: message.id || `msg-${index}`,\n role:\n message.role === \"data\"\n ? \"system\"\n : (message.role as \"user\" | \"assistant\" | \"system\") || \"user\",\n parts: parts as UIMessage[\"parts\"]\n };\n}\n\n/**\n * Legacy single message migration for backward compatibility\n */\nexport function migrateToUIMessage(message: MigratableMessage): UIMessage {\n return autoTransformMessage(message as InputMessage);\n}\n\n/**\n * Automatic message transformer for arrays following the blog post pattern\n * @param messages - Array of messages in any format\n * @returns Array of UIMessages in v5 format\n */\nexport function autoTransformMessages(messages: unknown[]): UIMessage[] {\n return messages.map((msg, i) => autoTransformMessage(msg as InputMessage, i));\n}\n\n/**\n * Migrates an array of messages to UIMessage format (legacy compatibility)\n * @param messages - Array of messages in old or new format\n * @returns Array of UIMessages in the new format\n */\nexport function migrateMessagesToUIFormat(\n messages: MigratableMessage[]\n): UIMessage[] {\n return autoTransformMessages(messages as InputMessage[]);\n}\n\n/**\n * Checks if any messages in an array need migration\n * @param messages - Array of messages to check\n * @returns true if any messages are not in proper UIMessage format\n */\nexport function needsMigration(messages: unknown[]): boolean {\n return messages.some((message) => {\n // If it's already a UIMessage, no migration needed\n if (isUIMessage(message)) {\n return false;\n }\n\n // Check for corrupt array format specifically\n if (isCorruptArrayMessage(message)) {\n return true;\n }\n\n // Check for legacy string format\n if (isLegacyMessage(message)) {\n return true;\n }\n\n // Any other format needs migration\n return true;\n });\n}\n\n/**\n * Analyzes the corruption types in a message array for debugging\n * @param messages - Array of messages to analyze\n * @returns Statistics about corruption types found\n */\nexport function analyzeCorruption(messages: unknown[]): {\n total: number;\n clean: number;\n legacyString: number;\n corruptArray: number;\n unknown: number;\n examples: {\n legacyString?: unknown;\n corruptArray?: unknown;\n unknown?: unknown;\n };\n} {\n const stats = {\n total: messages.length,\n clean: 0,\n legacyString: 0,\n corruptArray: 0,\n unknown: 0,\n examples: {} as {\n legacyString?: unknown;\n corruptArray?: unknown;\n unknown?: unknown;\n }\n };\n\n for (const message of messages) {\n if (isUIMessage(message)) {\n stats.clean++;\n } else if (isCorruptArrayMessage(message)) {\n stats.corruptArray++;\n if (!stats.examples.corruptArray) {\n stats.examples.corruptArray = message;\n }\n } else if (isLegacyMessage(message)) {\n stats.legacyString++;\n if (!stats.examples.legacyString) {\n stats.examples.legacyString = message;\n }\n } else {\n stats.unknown++;\n if (!stats.examples.unknown) {\n stats.examples.unknown = message;\n }\n }\n }\n\n return stats;\n}\n"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xE,SAAO,qBAAqB,OAAuB;AACrD;AAOO,SAAS,sBAAsB,UAAkC;AACtE,SAAO,SAAS,IAAI,CAAC,KAAK,MAAM,qBAAqB,KAAqB,CAAC,CAAC;AAC9E;AAOO,SAAS,0BACd,UACa;AACb,SAAO,sBAAsB,QAA0B;AACzD;AAOO,SAAS,eAAe,UAA8B;AAC3D,SAAO,SAAS,KAAK,CAAC,YAAY;AAEhC,QAAI,YAAY,OAAO,GAAG;AACxB,aAAO;AAAA,IACT;AAGA,QAAI,sBAAsB,OAAO,GAAG;AAClC,aAAO;AAAA,IACT;AAGA,QAAI,gBAAgB,OAAO,GAAG;AAC5B,aAAO;AAAA,IACT;AAGA,WAAO;AAAA,EACT,CAAC;AACH;AAOO,SAAS,kBAAkB,UAWhC;AACA,QAAM,QAAQ;AAAA,IACZ,OAAO,SAAS;AAAA,IAChB,OAAO;AAAA,IACP,cAAc;AAAA,IACd,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU,CAAC;AAAA,EAKb;AAEA,aAAW,WAAW,UAAU;AAC9B,QAAI,YAAY,OAAO,GAAG;AACxB,YAAM;AAAA,IACR,WAAW,sBAAsB,OAAO,GAAG;AACzC,YAAM;AACN,UAAI,CAAC,MAAM,SAAS,cAAc;AAChC,cAAM,SAAS,eAAe;AAAA,MAChC;AAAA,IACF,WAAW,gBAAgB,OAAO,GAAG;AACnC,YAAM;AACN,UAAI,CAAC,MAAM,SAAS,cAAc;AAChC,cAAM,SAAS,eAAe;AAAA,MAChC;AAAA,IACF,OAAO;AACL,YAAM;AACN,UAAI,CAAC,MAAM,SAAS,SAAS;AAC3B,cAAM,SAAS,UAAU;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -106,7 +106,6 @@ declare class MCPClientConnection {
106
106
  fetchTools(): Promise<
107
107
  {
108
108
  [x: string]: unknown;
109
- name: string;
110
109
  inputSchema: {
111
110
  [x: string]: unknown;
112
111
  type: "object";
@@ -117,13 +116,7 @@ declare class MCPClientConnection {
117
116
  | undefined;
118
117
  required?: string[] | undefined;
119
118
  };
120
- _meta?:
121
- | {
122
- [x: string]: unknown;
123
- }
124
- | undefined;
125
- title?: string | undefined;
126
- description?: string | undefined;
119
+ name: string;
127
120
  outputSchema?:
128
121
  | {
129
122
  [x: string]: unknown;
@@ -136,6 +129,13 @@ declare class MCPClientConnection {
136
129
  required?: string[] | undefined;
137
130
  }
138
131
  | undefined;
132
+ description?: string | undefined;
133
+ _meta?:
134
+ | {
135
+ [x: string]: unknown;
136
+ }
137
+ | undefined;
138
+ title?: string | undefined;
139
139
  annotations?:
140
140
  | {
141
141
  [x: string]: unknown;
@@ -146,6 +146,14 @@ declare class MCPClientConnection {
146
146
  openWorldHint?: boolean | undefined;
147
147
  }
148
148
  | undefined;
149
+ icons?:
150
+ | {
151
+ [x: string]: unknown;
152
+ src: string;
153
+ mimeType?: string | undefined;
154
+ sizes?: string | undefined;
155
+ }[]
156
+ | undefined;
149
157
  }[]
150
158
  >;
151
159
  fetchResources(): Promise<
@@ -153,13 +161,21 @@ declare class MCPClientConnection {
153
161
  [x: string]: unknown;
154
162
  name: string;
155
163
  uri: string;
164
+ description?: string | undefined;
156
165
  _meta?:
157
166
  | {
158
167
  [x: string]: unknown;
159
168
  }
160
169
  | undefined;
161
170
  title?: string | undefined;
162
- description?: string | undefined;
171
+ icons?:
172
+ | {
173
+ [x: string]: unknown;
174
+ src: string;
175
+ mimeType?: string | undefined;
176
+ sizes?: string | undefined;
177
+ }[]
178
+ | undefined;
163
179
  mimeType?: string | undefined;
164
180
  }[]
165
181
  >;
@@ -167,13 +183,21 @@ declare class MCPClientConnection {
167
183
  {
168
184
  [x: string]: unknown;
169
185
  name: string;
186
+ description?: string | undefined;
170
187
  _meta?:
171
188
  | {
172
189
  [x: string]: unknown;
173
190
  }
174
191
  | undefined;
175
192
  title?: string | undefined;
176
- description?: string | undefined;
193
+ icons?:
194
+ | {
195
+ [x: string]: unknown;
196
+ src: string;
197
+ mimeType?: string | undefined;
198
+ sizes?: string | undefined;
199
+ }[]
200
+ | undefined;
177
201
  arguments?:
178
202
  | {
179
203
  [x: string]: unknown;
@@ -189,13 +213,13 @@ declare class MCPClientConnection {
189
213
  [x: string]: unknown;
190
214
  name: string;
191
215
  uriTemplate: string;
216
+ description?: string | undefined;
192
217
  _meta?:
193
218
  | {
194
219
  [x: string]: unknown;
195
220
  }
196
221
  | undefined;
197
222
  title?: string | undefined;
198
- description?: string | undefined;
199
223
  mimeType?: string | undefined;
200
224
  }[]
201
225
  >;
@@ -226,6 +250,7 @@ declare class MCPClientManager {
226
250
  private _version;
227
251
  mcpConnections: Record<string, MCPClientConnection>;
228
252
  private _callbackUrls;
253
+ private _didWarnAboutUnstableGetAITools;
229
254
  /**
230
255
  * @param _name Name of the MCP client
231
256
  * @param _version Version of the MCP Client
@@ -266,6 +291,11 @@ declare class MCPClientManager {
266
291
  /**
267
292
  * @returns a set of tools that you can use with the AI SDK
268
293
  */
294
+ getAITools(): ToolSet;
295
+ /**
296
+ * @deprecated this has been renamed to getAITools(), and unstable_getAITools will be removed in the next major version
297
+ * @returns a set of tools that you can use with the AI SDK
298
+ */
269
299
  unstable_getAITools(): ToolSet;
270
300
  /**
271
301
  * Closes all connections to MCP servers
@@ -546,6 +576,38 @@ declare class MCPClientManager {
546
576
  uri: zod.ZodString;
547
577
  description: zod.ZodOptional<zod.ZodString>;
548
578
  mimeType: zod.ZodOptional<zod.ZodString>;
579
+ icons: zod.ZodOptional<
580
+ zod.ZodArray<
581
+ zod.ZodObject<
582
+ {
583
+ src: zod.ZodString;
584
+ mimeType: zod.ZodOptional<zod.ZodString>;
585
+ sizes: zod.ZodOptional<zod.ZodString>;
586
+ },
587
+ "passthrough",
588
+ zod.ZodTypeAny,
589
+ zod.objectOutputType<
590
+ {
591
+ src: zod.ZodString;
592
+ mimeType: zod.ZodOptional<zod.ZodString>;
593
+ sizes: zod.ZodOptional<zod.ZodString>;
594
+ },
595
+ zod.ZodTypeAny,
596
+ "passthrough"
597
+ >,
598
+ zod.objectInputType<
599
+ {
600
+ src: zod.ZodString;
601
+ mimeType: zod.ZodOptional<zod.ZodString>;
602
+ sizes: zod.ZodOptional<zod.ZodString>;
603
+ },
604
+ zod.ZodTypeAny,
605
+ "passthrough"
606
+ >
607
+ >,
608
+ "many"
609
+ >
610
+ >;
549
611
  _meta: zod.ZodOptional<
550
612
  zod.ZodObject<
551
613
  {},
@@ -582,6 +644,38 @@ declare class MCPClientManager {
582
644
  uri: zod.ZodString;
583
645
  description: zod.ZodOptional<zod.ZodString>;
584
646
  mimeType: zod.ZodOptional<zod.ZodString>;
647
+ icons: zod.ZodOptional<
648
+ zod.ZodArray<
649
+ zod.ZodObject<
650
+ {
651
+ src: zod.ZodString;
652
+ mimeType: zod.ZodOptional<zod.ZodString>;
653
+ sizes: zod.ZodOptional<zod.ZodString>;
654
+ },
655
+ "passthrough",
656
+ zod.ZodTypeAny,
657
+ zod.objectOutputType<
658
+ {
659
+ src: zod.ZodString;
660
+ mimeType: zod.ZodOptional<zod.ZodString>;
661
+ sizes: zod.ZodOptional<zod.ZodString>;
662
+ },
663
+ zod.ZodTypeAny,
664
+ "passthrough"
665
+ >,
666
+ zod.objectInputType<
667
+ {
668
+ src: zod.ZodString;
669
+ mimeType: zod.ZodOptional<zod.ZodString>;
670
+ sizes: zod.ZodOptional<zod.ZodString>;
671
+ },
672
+ zod.ZodTypeAny,
673
+ "passthrough"
674
+ >
675
+ >,
676
+ "many"
677
+ >
678
+ >;
585
679
  _meta: zod.ZodOptional<
586
680
  zod.ZodObject<
587
681
  {},
@@ -619,6 +713,38 @@ declare class MCPClientManager {
619
713
  uri: zod.ZodString;
620
714
  description: zod.ZodOptional<zod.ZodString>;
621
715
  mimeType: zod.ZodOptional<zod.ZodString>;
716
+ icons: zod.ZodOptional<
717
+ zod.ZodArray<
718
+ zod.ZodObject<
719
+ {
720
+ src: zod.ZodString;
721
+ mimeType: zod.ZodOptional<zod.ZodString>;
722
+ sizes: zod.ZodOptional<zod.ZodString>;
723
+ },
724
+ "passthrough",
725
+ zod.ZodTypeAny,
726
+ zod.objectOutputType<
727
+ {
728
+ src: zod.ZodString;
729
+ mimeType: zod.ZodOptional<zod.ZodString>;
730
+ sizes: zod.ZodOptional<zod.ZodString>;
731
+ },
732
+ zod.ZodTypeAny,
733
+ "passthrough"
734
+ >,
735
+ zod.objectInputType<
736
+ {
737
+ src: zod.ZodString;
738
+ mimeType: zod.ZodOptional<zod.ZodString>;
739
+ sizes: zod.ZodOptional<zod.ZodString>;
740
+ },
741
+ zod.ZodTypeAny,
742
+ "passthrough"
743
+ >
744
+ >,
745
+ "many"
746
+ >
747
+ >;
622
748
  _meta: zod.ZodOptional<
623
749
  zod.ZodObject<
624
750
  {},
@@ -1778,6 +1904,38 @@ declare class MCPClientManager {
1778
1904
  uri: zod.ZodString;
1779
1905
  description: zod.ZodOptional<zod.ZodString>;
1780
1906
  mimeType: zod.ZodOptional<zod.ZodString>;
1907
+ icons: zod.ZodOptional<
1908
+ zod.ZodArray<
1909
+ zod.ZodObject<
1910
+ {
1911
+ src: zod.ZodString;
1912
+ mimeType: zod.ZodOptional<zod.ZodString>;
1913
+ sizes: zod.ZodOptional<zod.ZodString>;
1914
+ },
1915
+ "passthrough",
1916
+ zod.ZodTypeAny,
1917
+ zod.objectOutputType<
1918
+ {
1919
+ src: zod.ZodString;
1920
+ mimeType: zod.ZodOptional<zod.ZodString>;
1921
+ sizes: zod.ZodOptional<zod.ZodString>;
1922
+ },
1923
+ zod.ZodTypeAny,
1924
+ "passthrough"
1925
+ >,
1926
+ zod.objectInputType<
1927
+ {
1928
+ src: zod.ZodString;
1929
+ mimeType: zod.ZodOptional<zod.ZodString>;
1930
+ sizes: zod.ZodOptional<zod.ZodString>;
1931
+ },
1932
+ zod.ZodTypeAny,
1933
+ "passthrough"
1934
+ >
1935
+ >,
1936
+ "many"
1937
+ >
1938
+ >;
1781
1939
  _meta: zod.ZodOptional<
1782
1940
  zod.ZodObject<
1783
1941
  {},
@@ -1814,6 +1972,38 @@ declare class MCPClientManager {
1814
1972
  uri: zod.ZodString;
1815
1973
  description: zod.ZodOptional<zod.ZodString>;
1816
1974
  mimeType: zod.ZodOptional<zod.ZodString>;
1975
+ icons: zod.ZodOptional<
1976
+ zod.ZodArray<
1977
+ zod.ZodObject<
1978
+ {
1979
+ src: zod.ZodString;
1980
+ mimeType: zod.ZodOptional<zod.ZodString>;
1981
+ sizes: zod.ZodOptional<zod.ZodString>;
1982
+ },
1983
+ "passthrough",
1984
+ zod.ZodTypeAny,
1985
+ zod.objectOutputType<
1986
+ {
1987
+ src: zod.ZodString;
1988
+ mimeType: zod.ZodOptional<zod.ZodString>;
1989
+ sizes: zod.ZodOptional<zod.ZodString>;
1990
+ },
1991
+ zod.ZodTypeAny,
1992
+ "passthrough"
1993
+ >,
1994
+ zod.objectInputType<
1995
+ {
1996
+ src: zod.ZodString;
1997
+ mimeType: zod.ZodOptional<zod.ZodString>;
1998
+ sizes: zod.ZodOptional<zod.ZodString>;
1999
+ },
2000
+ zod.ZodTypeAny,
2001
+ "passthrough"
2002
+ >
2003
+ >,
2004
+ "many"
2005
+ >
2006
+ >;
1817
2007
  _meta: zod.ZodOptional<
1818
2008
  zod.ZodObject<
1819
2009
  {},
@@ -1851,6 +2041,38 @@ declare class MCPClientManager {
1851
2041
  uri: zod.ZodString;
1852
2042
  description: zod.ZodOptional<zod.ZodString>;
1853
2043
  mimeType: zod.ZodOptional<zod.ZodString>;
2044
+ icons: zod.ZodOptional<
2045
+ zod.ZodArray<
2046
+ zod.ZodObject<
2047
+ {
2048
+ src: zod.ZodString;
2049
+ mimeType: zod.ZodOptional<zod.ZodString>;
2050
+ sizes: zod.ZodOptional<zod.ZodString>;
2051
+ },
2052
+ "passthrough",
2053
+ zod.ZodTypeAny,
2054
+ zod.objectOutputType<
2055
+ {
2056
+ src: zod.ZodString;
2057
+ mimeType: zod.ZodOptional<zod.ZodString>;
2058
+ sizes: zod.ZodOptional<zod.ZodString>;
2059
+ },
2060
+ zod.ZodTypeAny,
2061
+ "passthrough"
2062
+ >,
2063
+ zod.objectInputType<
2064
+ {
2065
+ src: zod.ZodString;
2066
+ mimeType: zod.ZodOptional<zod.ZodString>;
2067
+ sizes: zod.ZodOptional<zod.ZodString>;
2068
+ },
2069
+ zod.ZodTypeAny,
2070
+ "passthrough"
2071
+ >
2072
+ >,
2073
+ "many"
2074
+ >
2075
+ >;
1854
2076
  _meta: zod.ZodOptional<
1855
2077
  zod.ZodObject<
1856
2078
  {},
@@ -2786,6 +3008,38 @@ declare class MCPClientManager {
2786
3008
  uri: zod.ZodString;
2787
3009
  description: zod.ZodOptional<zod.ZodString>;
2788
3010
  mimeType: zod.ZodOptional<zod.ZodString>;
3011
+ icons: zod.ZodOptional<
3012
+ zod.ZodArray<
3013
+ zod.ZodObject<
3014
+ {
3015
+ src: zod.ZodString;
3016
+ mimeType: zod.ZodOptional<zod.ZodString>;
3017
+ sizes: zod.ZodOptional<zod.ZodString>;
3018
+ },
3019
+ "passthrough",
3020
+ zod.ZodTypeAny,
3021
+ zod.objectOutputType<
3022
+ {
3023
+ src: zod.ZodString;
3024
+ mimeType: zod.ZodOptional<zod.ZodString>;
3025
+ sizes: zod.ZodOptional<zod.ZodString>;
3026
+ },
3027
+ zod.ZodTypeAny,
3028
+ "passthrough"
3029
+ >,
3030
+ zod.objectInputType<
3031
+ {
3032
+ src: zod.ZodString;
3033
+ mimeType: zod.ZodOptional<zod.ZodString>;
3034
+ sizes: zod.ZodOptional<zod.ZodString>;
3035
+ },
3036
+ zod.ZodTypeAny,
3037
+ "passthrough"
3038
+ >
3039
+ >,
3040
+ "many"
3041
+ >
3042
+ >;
2789
3043
  _meta: zod.ZodOptional<
2790
3044
  zod.ZodObject<
2791
3045
  {},
@@ -2822,6 +3076,38 @@ declare class MCPClientManager {
2822
3076
  uri: zod.ZodString;
2823
3077
  description: zod.ZodOptional<zod.ZodString>;
2824
3078
  mimeType: zod.ZodOptional<zod.ZodString>;
3079
+ icons: zod.ZodOptional<
3080
+ zod.ZodArray<
3081
+ zod.ZodObject<
3082
+ {
3083
+ src: zod.ZodString;
3084
+ mimeType: zod.ZodOptional<zod.ZodString>;
3085
+ sizes: zod.ZodOptional<zod.ZodString>;
3086
+ },
3087
+ "passthrough",
3088
+ zod.ZodTypeAny,
3089
+ zod.objectOutputType<
3090
+ {
3091
+ src: zod.ZodString;
3092
+ mimeType: zod.ZodOptional<zod.ZodString>;
3093
+ sizes: zod.ZodOptional<zod.ZodString>;
3094
+ },
3095
+ zod.ZodTypeAny,
3096
+ "passthrough"
3097
+ >,
3098
+ zod.objectInputType<
3099
+ {
3100
+ src: zod.ZodString;
3101
+ mimeType: zod.ZodOptional<zod.ZodString>;
3102
+ sizes: zod.ZodOptional<zod.ZodString>;
3103
+ },
3104
+ zod.ZodTypeAny,
3105
+ "passthrough"
3106
+ >
3107
+ >,
3108
+ "many"
3109
+ >
3110
+ >;
2825
3111
  _meta: zod.ZodOptional<
2826
3112
  zod.ZodObject<
2827
3113
  {},
@@ -2859,6 +3145,38 @@ declare class MCPClientManager {
2859
3145
  uri: zod.ZodString;
2860
3146
  description: zod.ZodOptional<zod.ZodString>;
2861
3147
  mimeType: zod.ZodOptional<zod.ZodString>;
3148
+ icons: zod.ZodOptional<
3149
+ zod.ZodArray<
3150
+ zod.ZodObject<
3151
+ {
3152
+ src: zod.ZodString;
3153
+ mimeType: zod.ZodOptional<zod.ZodString>;
3154
+ sizes: zod.ZodOptional<zod.ZodString>;
3155
+ },
3156
+ "passthrough",
3157
+ zod.ZodTypeAny,
3158
+ zod.objectOutputType<
3159
+ {
3160
+ src: zod.ZodString;
3161
+ mimeType: zod.ZodOptional<zod.ZodString>;
3162
+ sizes: zod.ZodOptional<zod.ZodString>;
3163
+ },
3164
+ zod.ZodTypeAny,
3165
+ "passthrough"
3166
+ >,
3167
+ zod.objectInputType<
3168
+ {
3169
+ src: zod.ZodString;
3170
+ mimeType: zod.ZodOptional<zod.ZodString>;
3171
+ sizes: zod.ZodOptional<zod.ZodString>;
3172
+ },
3173
+ zod.ZodTypeAny,
3174
+ "passthrough"
3175
+ >
3176
+ >,
3177
+ "many"
3178
+ >
3179
+ >;
2862
3180
  _meta: zod.ZodOptional<
2863
3181
  zod.ZodObject<
2864
3182
  {},
@@ -3799,6 +4117,38 @@ declare class MCPClientManager {
3799
4117
  uri: zod.ZodString;
3800
4118
  description: zod.ZodOptional<zod.ZodString>;
3801
4119
  mimeType: zod.ZodOptional<zod.ZodString>;
4120
+ icons: zod.ZodOptional<
4121
+ zod.ZodArray<
4122
+ zod.ZodObject<
4123
+ {
4124
+ src: zod.ZodString;
4125
+ mimeType: zod.ZodOptional<zod.ZodString>;
4126
+ sizes: zod.ZodOptional<zod.ZodString>;
4127
+ },
4128
+ "passthrough",
4129
+ zod.ZodTypeAny,
4130
+ zod.objectOutputType<
4131
+ {
4132
+ src: zod.ZodString;
4133
+ mimeType: zod.ZodOptional<zod.ZodString>;
4134
+ sizes: zod.ZodOptional<zod.ZodString>;
4135
+ },
4136
+ zod.ZodTypeAny,
4137
+ "passthrough"
4138
+ >,
4139
+ zod.objectInputType<
4140
+ {
4141
+ src: zod.ZodString;
4142
+ mimeType: zod.ZodOptional<zod.ZodString>;
4143
+ sizes: zod.ZodOptional<zod.ZodString>;
4144
+ },
4145
+ zod.ZodTypeAny,
4146
+ "passthrough"
4147
+ >
4148
+ >,
4149
+ "many"
4150
+ >
4151
+ >;
3802
4152
  _meta: zod.ZodOptional<
3803
4153
  zod.ZodObject<
3804
4154
  {},
@@ -3835,6 +4185,38 @@ declare class MCPClientManager {
3835
4185
  uri: zod.ZodString;
3836
4186
  description: zod.ZodOptional<zod.ZodString>;
3837
4187
  mimeType: zod.ZodOptional<zod.ZodString>;
4188
+ icons: zod.ZodOptional<
4189
+ zod.ZodArray<
4190
+ zod.ZodObject<
4191
+ {
4192
+ src: zod.ZodString;
4193
+ mimeType: zod.ZodOptional<zod.ZodString>;
4194
+ sizes: zod.ZodOptional<zod.ZodString>;
4195
+ },
4196
+ "passthrough",
4197
+ zod.ZodTypeAny,
4198
+ zod.objectOutputType<
4199
+ {
4200
+ src: zod.ZodString;
4201
+ mimeType: zod.ZodOptional<zod.ZodString>;
4202
+ sizes: zod.ZodOptional<zod.ZodString>;
4203
+ },
4204
+ zod.ZodTypeAny,
4205
+ "passthrough"
4206
+ >,
4207
+ zod.objectInputType<
4208
+ {
4209
+ src: zod.ZodString;
4210
+ mimeType: zod.ZodOptional<zod.ZodString>;
4211
+ sizes: zod.ZodOptional<zod.ZodString>;
4212
+ },
4213
+ zod.ZodTypeAny,
4214
+ "passthrough"
4215
+ >
4216
+ >,
4217
+ "many"
4218
+ >
4219
+ >;
3838
4220
  _meta: zod.ZodOptional<
3839
4221
  zod.ZodObject<
3840
4222
  {},
@@ -3872,6 +4254,38 @@ declare class MCPClientManager {
3872
4254
  uri: zod.ZodString;
3873
4255
  description: zod.ZodOptional<zod.ZodString>;
3874
4256
  mimeType: zod.ZodOptional<zod.ZodString>;
4257
+ icons: zod.ZodOptional<
4258
+ zod.ZodArray<
4259
+ zod.ZodObject<
4260
+ {
4261
+ src: zod.ZodString;
4262
+ mimeType: zod.ZodOptional<zod.ZodString>;
4263
+ sizes: zod.ZodOptional<zod.ZodString>;
4264
+ },
4265
+ "passthrough",
4266
+ zod.ZodTypeAny,
4267
+ zod.objectOutputType<
4268
+ {
4269
+ src: zod.ZodString;
4270
+ mimeType: zod.ZodOptional<zod.ZodString>;
4271
+ sizes: zod.ZodOptional<zod.ZodString>;
4272
+ },
4273
+ zod.ZodTypeAny,
4274
+ "passthrough"
4275
+ >,
4276
+ zod.objectInputType<
4277
+ {
4278
+ src: zod.ZodString;
4279
+ mimeType: zod.ZodOptional<zod.ZodString>;
4280
+ sizes: zod.ZodOptional<zod.ZodString>;
4281
+ },
4282
+ zod.ZodTypeAny,
4283
+ "passthrough"
4284
+ >
4285
+ >,
4286
+ "many"
4287
+ >
4288
+ >;
3875
4289
  _meta: zod.ZodOptional<
3876
4290
  zod.ZodObject<
3877
4291
  {},
package/dist/client.js CHANGED
@@ -2,7 +2,9 @@ import {
2
2
  AgentClient,
3
3
  agentFetch,
4
4
  camelCaseToKebabCase
5
- } from "./chunk-KUH345EY.js";
5
+ } from "./chunk-QEVM4BVL.js";
6
+ import "./chunk-BER7KXUJ.js";
7
+ import "./chunk-PR4QN5HX.js";
6
8
  export {
7
9
  AgentClient,
8
10
  agentFetch,