@illalabs/interfaces 0.2.1 → 0.3.0-canary-beta-08a68673

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 (135) hide show
  1. package/dist/errors/endpoints/chat/ChatBaseError.d.ts +16 -5
  2. package/dist/errors/endpoints/chat/ChatBaseError.d.ts.map +1 -1
  3. package/dist/external.d.ts +1 -0
  4. package/dist/external.d.ts.map +1 -1
  5. package/dist/external.js +1 -0
  6. package/dist/external.js.map +1 -1
  7. package/dist/interfaces/chat/response.d.ts +5 -3
  8. package/dist/interfaces/chat/response.d.ts.map +1 -1
  9. package/dist/schemas/chatContext.d.ts +95 -592
  10. package/dist/schemas/chatContext.d.ts.map +1 -1
  11. package/dist/schemas/chatRequestBody.d.ts +292 -1962
  12. package/dist/schemas/chatRequestBody.d.ts.map +1 -1
  13. package/dist/schemas/chatRequestBody.js +6 -4
  14. package/dist/schemas/chatRequestBody.js.map +1 -1
  15. package/dist/schemas/executionCheckerQueryParams.d.ts +5 -5
  16. package/dist/schemas/illaTools.d.ts +266 -0
  17. package/dist/schemas/illaTools.d.ts.map +1 -0
  18. package/dist/schemas/illaTools.js +58 -0
  19. package/dist/schemas/illaTools.js.map +1 -0
  20. package/dist/schemas/index.d.ts +3 -0
  21. package/dist/schemas/index.d.ts.map +1 -1
  22. package/dist/schemas/index.js +3 -0
  23. package/dist/schemas/index.js.map +1 -1
  24. package/dist/schemas/messages.d.ts +566 -928
  25. package/dist/schemas/messages.d.ts.map +1 -1
  26. package/dist/schemas/messages.js +74 -113
  27. package/dist/schemas/messages.js.map +1 -1
  28. package/dist/schemas/modelContext.d.ts +23 -0
  29. package/dist/schemas/modelContext.d.ts.map +1 -0
  30. package/dist/schemas/modelContext.js +13 -0
  31. package/dist/schemas/modelContext.js.map +1 -0
  32. package/dist/schemas/telemetryEvents.d.ts +2417 -0
  33. package/dist/schemas/telemetryEvents.d.ts.map +1 -0
  34. package/dist/schemas/telemetryEvents.js +236 -0
  35. package/dist/schemas/telemetryEvents.js.map +1 -0
  36. package/dist/schemas/toolAutorouter.d.ts +9 -9
  37. package/dist/schemas/toolAutorouter.d.ts.map +1 -1
  38. package/dist/schemas/userContext.d.ts +3 -0
  39. package/dist/schemas/userContext.d.ts.map +1 -1
  40. package/dist/schemas/userContext.js +4 -0
  41. package/dist/schemas/userContext.js.map +1 -1
  42. package/dist/tools/IllaToolError.d.ts +117 -0
  43. package/dist/tools/IllaToolError.d.ts.map +1 -0
  44. package/dist/tools/IllaToolError.js +147 -0
  45. package/dist/tools/IllaToolError.js.map +1 -0
  46. package/dist/tools/IllaToolOutcome.d.ts +131 -0
  47. package/dist/tools/IllaToolOutcome.d.ts.map +1 -0
  48. package/dist/tools/IllaToolOutcome.js +191 -0
  49. package/dist/tools/IllaToolOutcome.js.map +1 -0
  50. package/dist/tools/index.d.ts +3 -0
  51. package/dist/tools/index.d.ts.map +1 -0
  52. package/dist/tools/index.js +3 -0
  53. package/dist/tools/index.js.map +1 -0
  54. package/dist/types/actions/inputs.d.ts +8 -3
  55. package/dist/types/actions/inputs.d.ts.map +1 -1
  56. package/dist/types/actions/outputs.d.ts +19 -1
  57. package/dist/types/actions/outputs.d.ts.map +1 -1
  58. package/dist/types/actions/tools/{swapBridgeAction.d.ts → bridgeAction.d.ts} +4 -4
  59. package/dist/types/actions/tools/bridgeAction.d.ts.map +1 -0
  60. package/dist/types/actions/tools/bridgeAction.js +2 -0
  61. package/dist/types/actions/tools/bridgeAction.js.map +1 -0
  62. package/dist/types/actions/tools/defiFetchListingsAction.d.ts +1 -2
  63. package/dist/types/actions/tools/defiFetchListingsAction.d.ts.map +1 -1
  64. package/dist/types/actions/tools/defiFetchListingsAction.js +1 -1
  65. package/dist/types/actions/tools/defiFetchListingsAction.js.map +1 -1
  66. package/dist/types/actions/tools/defiPositionsAction.d.ts +1 -2
  67. package/dist/types/actions/tools/defiPositionsAction.d.ts.map +1 -1
  68. package/dist/types/actions/tools/defiPositionsAction.js +1 -1
  69. package/dist/types/actions/tools/defiPositionsAction.js.map +1 -1
  70. package/dist/types/actions/tools/defiSupplyAction.d.ts +1 -2
  71. package/dist/types/actions/tools/defiSupplyAction.d.ts.map +1 -1
  72. package/dist/types/actions/tools/defiSupplyAction.js +1 -1
  73. package/dist/types/actions/tools/defiSupplyAction.js.map +1 -1
  74. package/dist/types/actions/tools/defiWithdrawAction.d.ts +1 -2
  75. package/dist/types/actions/tools/defiWithdrawAction.d.ts.map +1 -1
  76. package/dist/types/actions/tools/defiWithdrawAction.js +1 -1
  77. package/dist/types/actions/tools/defiWithdrawAction.js.map +1 -1
  78. package/dist/types/actions/tools/exchangeRateAction.d.ts +1 -2
  79. package/dist/types/actions/tools/exchangeRateAction.d.ts.map +1 -1
  80. package/dist/types/actions/tools/exchangeRateAction.js +1 -1
  81. package/dist/types/actions/tools/exchangeRateAction.js.map +1 -1
  82. package/dist/types/actions/tools/getWalletBalanceAction.d.ts +4 -3
  83. package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
  84. package/dist/types/actions/tools/getWalletBalanceAction.js +1 -1
  85. package/dist/types/actions/tools/getWalletBalanceAction.js.map +1 -1
  86. package/dist/types/actions/tools/index.d.ts +18 -3
  87. package/dist/types/actions/tools/index.d.ts.map +1 -1
  88. package/dist/types/actions/tools/polymarketPostOrderAction.d.ts +83 -0
  89. package/dist/types/actions/tools/polymarketPostOrderAction.d.ts.map +1 -0
  90. package/dist/types/actions/tools/polymarketPostOrderAction.js +2 -0
  91. package/dist/types/actions/tools/polymarketPostOrderAction.js.map +1 -0
  92. package/dist/types/actions/tools/predictionMarketsBetAction.d.ts +19 -0
  93. package/dist/types/actions/tools/predictionMarketsBetAction.d.ts.map +1 -0
  94. package/dist/types/actions/tools/predictionMarketsBetAction.js +2 -0
  95. package/dist/types/actions/tools/predictionMarketsBetAction.js.map +1 -0
  96. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts +21 -0
  97. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts.map +1 -0
  98. package/dist/types/actions/tools/predictionMarketsFetchAction.js +2 -0
  99. package/dist/types/actions/tools/predictionMarketsFetchAction.js.map +1 -0
  100. package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts +25 -0
  101. package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts.map +1 -0
  102. package/dist/types/actions/tools/predictionMarketsPositionsAction.js +2 -0
  103. package/dist/types/actions/tools/predictionMarketsPositionsAction.js.map +1 -0
  104. package/dist/types/actions/tools/swapAction.d.ts +16 -0
  105. package/dist/types/actions/tools/swapAction.d.ts.map +1 -0
  106. package/dist/types/actions/tools/swapAction.js +2 -0
  107. package/dist/types/actions/tools/swapAction.js.map +1 -0
  108. package/dist/types/actions/tools/tokenTransferAction.d.ts +1 -2
  109. package/dist/types/actions/tools/tokenTransferAction.d.ts.map +1 -1
  110. package/dist/types/actions/tools/tokenTransferAction.js +1 -1
  111. package/dist/types/actions/tools/tokenTransferAction.js.map +1 -1
  112. package/dist/types/index.d.ts +2 -0
  113. package/dist/types/index.d.ts.map +1 -1
  114. package/dist/types/index.js +2 -0
  115. package/dist/types/index.js.map +1 -1
  116. package/dist/types/messages.d.ts +3 -6
  117. package/dist/types/messages.d.ts.map +1 -1
  118. package/dist/types/messages.js +1 -1
  119. package/dist/types/messages.js.map +1 -1
  120. package/dist/types/streaming.d.ts +81 -0
  121. package/dist/types/streaming.d.ts.map +1 -0
  122. package/dist/types/streaming.js +2 -0
  123. package/dist/types/streaming.js.map +1 -0
  124. package/dist/types/telemetry.d.ts +139 -0
  125. package/dist/types/telemetry.d.ts.map +1 -0
  126. package/dist/types/telemetry.js +7 -0
  127. package/dist/types/telemetry.js.map +1 -0
  128. package/dist/utils/constants.d.ts +8 -6
  129. package/dist/utils/constants.d.ts.map +1 -1
  130. package/dist/utils/constants.js +23 -5
  131. package/dist/utils/constants.js.map +1 -1
  132. package/package.json +4 -4
  133. package/dist/types/actions/tools/swapBridgeAction.d.ts.map +0 -1
  134. package/dist/types/actions/tools/swapBridgeAction.js +0 -2
  135. package/dist/types/actions/tools/swapBridgeAction.js.map +0 -1
@@ -1,31 +1,151 @@
1
1
  import type { ModelMessage } from "@ai-sdk/provider-utils";
2
2
  import type { PrepareTransactionRequestReturnType } from "viem";
3
3
  import { z } from "zod";
4
- import type { ActionError } from "../types/actions/errors.js";
5
- import type { DefiFetchListingsActionInput } from "../types/actions/tools/defiFetchListingsAction.js";
6
- import type { DefiPositionsActionInput } from "../types/actions/tools/defiPositionsAction.js";
7
- import type { DefiSupplyActionInput } from "../types/actions/tools/defiSupplyAction.js";
8
- import type { DefiWithdrawActionInput } from "../types/actions/tools/defiWithdrawAction.js";
9
- import type { ExchangeRateActionInput } from "../types/actions/tools/exchangeRateAction.js";
10
- import type { GetWalletBalanceActionInput } from "../types/actions/tools/getWalletBalanceAction.js";
11
- import type { SwapBridgeActionInput } from "../types/actions/tools/swapBridgeAction.js";
12
- import type { TokenTransferActionInput } from "../types/actions/tools/tokenTransferAction.js";
13
- export declare const ToolResultSchema: z.ZodObject<{
14
- toolCallId: z.ZodString;
15
- toolName: z.ZodString;
16
- result: z.ZodUnknown;
17
- error: z.ZodOptional<z.ZodUnknown>;
18
- }, "strict", z.ZodTypeAny, {
19
- toolName: string;
20
- toolCallId: string;
21
- result?: unknown;
22
- error?: unknown;
4
+ /**
5
+ * EIP-712 typed data structure for off-chain signatures
6
+ */
7
+ export declare const EIP712TypedDataSchema: z.ZodObject<{
8
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
9
+ name: z.ZodString;
10
+ type: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ type: string;
13
+ name: string;
14
+ }, {
15
+ type: string;
16
+ name: string;
17
+ }>, "many">>;
18
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
20
+ primaryType: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ message: Record<string, unknown>;
23
+ types: Record<string, {
24
+ type: string;
25
+ name: string;
26
+ }[]>;
27
+ domain: Record<string, unknown>;
28
+ primaryType: string;
23
29
  }, {
24
- toolName: string;
25
- toolCallId: string;
26
- result?: unknown;
27
- error?: unknown;
30
+ message: Record<string, unknown>;
31
+ types: Record<string, {
32
+ type: string;
33
+ name: string;
34
+ }[]>;
35
+ domain: Record<string, unknown>;
36
+ primaryType: string;
28
37
  }>;
38
+ export type EIP712TypedData = z.infer<typeof EIP712TypedDataSchema>;
39
+ /**
40
+ * Generic signature request for off-chain signing.
41
+ * Used when an action requires the client to sign data.
42
+ *
43
+ * This is a discriminated union based on `signMethod`:
44
+ * - `signMethod: 'typedData'` requires `typedData` (EIP-712 typed data for eth_signTypedData_v4)
45
+ * - `signMethod: 'message'` requires `rawHash` (for personal_sign)
46
+ */
47
+ export declare const SignatureRequestSchema: z.ZodDiscriminatedUnion<"signMethod", [z.ZodObject<{
48
+ /** Unique identifier for this signature request */
49
+ id: z.ZodString;
50
+ /** Address of the signer (EOA) */
51
+ signerAddress: z.ZodString;
52
+ /** Human-readable description for the UI */
53
+ description: z.ZodOptional<z.ZodString>;
54
+ /** Generic key-value metadata for action-specific data */
55
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
56
+ } & {
57
+ signMethod: z.ZodLiteral<"typedData">;
58
+ /** EIP-712 typed data to be signed */
59
+ typedData: z.ZodObject<{
60
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
61
+ name: z.ZodString;
62
+ type: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ type: string;
65
+ name: string;
66
+ }, {
67
+ type: string;
68
+ name: string;
69
+ }>, "many">>;
70
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
71
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
72
+ primaryType: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ message: Record<string, unknown>;
75
+ types: Record<string, {
76
+ type: string;
77
+ name: string;
78
+ }[]>;
79
+ domain: Record<string, unknown>;
80
+ primaryType: string;
81
+ }, {
82
+ message: Record<string, unknown>;
83
+ types: Record<string, {
84
+ type: string;
85
+ name: string;
86
+ }[]>;
87
+ domain: Record<string, unknown>;
88
+ primaryType: string;
89
+ }>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ id: string;
92
+ signerAddress: string;
93
+ signMethod: "typedData";
94
+ typedData: {
95
+ message: Record<string, unknown>;
96
+ types: Record<string, {
97
+ type: string;
98
+ name: string;
99
+ }[]>;
100
+ domain: Record<string, unknown>;
101
+ primaryType: string;
102
+ };
103
+ description?: string | undefined;
104
+ metadata?: Record<string, unknown> | undefined;
105
+ }, {
106
+ id: string;
107
+ signerAddress: string;
108
+ signMethod: "typedData";
109
+ typedData: {
110
+ message: Record<string, unknown>;
111
+ types: Record<string, {
112
+ type: string;
113
+ name: string;
114
+ }[]>;
115
+ domain: Record<string, unknown>;
116
+ primaryType: string;
117
+ };
118
+ description?: string | undefined;
119
+ metadata?: Record<string, unknown> | undefined;
120
+ }>, z.ZodObject<{
121
+ /** Unique identifier for this signature request */
122
+ id: z.ZodString;
123
+ /** Address of the signer (EOA) */
124
+ signerAddress: z.ZodString;
125
+ /** Human-readable description for the UI */
126
+ description: z.ZodOptional<z.ZodString>;
127
+ /** Generic key-value metadata for action-specific data */
128
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
+ } & {
130
+ signMethod: z.ZodLiteral<"message">;
131
+ /** Raw hash to be signed */
132
+ rawHash: z.ZodString;
133
+ }, "strip", z.ZodTypeAny, {
134
+ id: string;
135
+ signerAddress: string;
136
+ signMethod: "message";
137
+ rawHash: string;
138
+ description?: string | undefined;
139
+ metadata?: Record<string, unknown> | undefined;
140
+ }, {
141
+ id: string;
142
+ signerAddress: string;
143
+ signMethod: "message";
144
+ rawHash: string;
145
+ description?: string | undefined;
146
+ metadata?: Record<string, unknown> | undefined;
147
+ }>]>;
148
+ export type SignatureRequest = z.infer<typeof SignatureRequestSchema>;
29
149
  export declare const PendingToolCallSchema: z.ZodObject<{
30
150
  type: z.ZodLiteral<"tool-call">;
31
151
  toolCallId: z.ZodString;
@@ -58,7 +178,6 @@ export declare const PendingToolCallSchema: z.ZodObject<{
58
178
  } | undefined;
59
179
  }>, "many">;
60
180
  }, "strip", z.ZodTypeAny, {
61
- type: "BatchTransactions";
62
181
  value: {
63
182
  transaction: PrepareTransactionRequestReturnType;
64
183
  metadata?: {
@@ -66,8 +185,8 @@ export declare const PendingToolCallSchema: z.ZodObject<{
66
185
  usdValue?: string | undefined;
67
186
  } | undefined;
68
187
  }[];
69
- }, {
70
188
  type: "BatchTransactions";
189
+ }, {
71
190
  value: {
72
191
  transaction: PrepareTransactionRequestReturnType;
73
192
  metadata?: {
@@ -75,6 +194,7 @@ export declare const PendingToolCallSchema: z.ZodObject<{
75
194
  usdValue?: string | undefined;
76
195
  } | undefined;
77
196
  }[];
197
+ type: "BatchTransactions";
78
198
  }>, z.ZodObject<{
79
199
  type: z.ZodLiteral<"SingleTransaction">;
80
200
  value: z.ZodObject<{
@@ -103,7 +223,6 @@ export declare const PendingToolCallSchema: z.ZodObject<{
103
223
  } | undefined;
104
224
  }>;
105
225
  }, "strip", z.ZodTypeAny, {
106
- type: "SingleTransaction";
107
226
  value: {
108
227
  transaction: PrepareTransactionRequestReturnType;
109
228
  metadata?: {
@@ -111,8 +230,8 @@ export declare const PendingToolCallSchema: z.ZodObject<{
111
230
  usdValue?: string | undefined;
112
231
  } | undefined;
113
232
  };
114
- }, {
115
233
  type: "SingleTransaction";
234
+ }, {
116
235
  value: {
117
236
  transaction: PrepareTransactionRequestReturnType;
118
237
  metadata?: {
@@ -120,13 +239,271 @@ export declare const PendingToolCallSchema: z.ZodObject<{
120
239
  usdValue?: string | undefined;
121
240
  } | undefined;
122
241
  };
242
+ type: "SingleTransaction";
243
+ }>, z.ZodObject<{
244
+ type: z.ZodLiteral<"SignatureRequests">;
245
+ value: z.ZodObject<{
246
+ signatureRequests: z.ZodArray<z.ZodDiscriminatedUnion<"signMethod", [z.ZodObject<{
247
+ /** Unique identifier for this signature request */
248
+ id: z.ZodString;
249
+ /** Address of the signer (EOA) */
250
+ signerAddress: z.ZodString;
251
+ /** Human-readable description for the UI */
252
+ description: z.ZodOptional<z.ZodString>;
253
+ /** Generic key-value metadata for action-specific data */
254
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
255
+ } & {
256
+ signMethod: z.ZodLiteral<"typedData">;
257
+ /** EIP-712 typed data to be signed */
258
+ typedData: z.ZodObject<{
259
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
260
+ name: z.ZodString;
261
+ type: z.ZodString;
262
+ }, "strip", z.ZodTypeAny, {
263
+ type: string;
264
+ name: string;
265
+ }, {
266
+ type: string;
267
+ name: string;
268
+ }>, "many">>;
269
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
270
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
271
+ primaryType: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ message: Record<string, unknown>;
274
+ types: Record<string, {
275
+ type: string;
276
+ name: string;
277
+ }[]>;
278
+ domain: Record<string, unknown>;
279
+ primaryType: string;
280
+ }, {
281
+ message: Record<string, unknown>;
282
+ types: Record<string, {
283
+ type: string;
284
+ name: string;
285
+ }[]>;
286
+ domain: Record<string, unknown>;
287
+ primaryType: string;
288
+ }>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ id: string;
291
+ signerAddress: string;
292
+ signMethod: "typedData";
293
+ typedData: {
294
+ message: Record<string, unknown>;
295
+ types: Record<string, {
296
+ type: string;
297
+ name: string;
298
+ }[]>;
299
+ domain: Record<string, unknown>;
300
+ primaryType: string;
301
+ };
302
+ description?: string | undefined;
303
+ metadata?: Record<string, unknown> | undefined;
304
+ }, {
305
+ id: string;
306
+ signerAddress: string;
307
+ signMethod: "typedData";
308
+ typedData: {
309
+ message: Record<string, unknown>;
310
+ types: Record<string, {
311
+ type: string;
312
+ name: string;
313
+ }[]>;
314
+ domain: Record<string, unknown>;
315
+ primaryType: string;
316
+ };
317
+ description?: string | undefined;
318
+ metadata?: Record<string, unknown> | undefined;
319
+ }>, z.ZodObject<{
320
+ /** Unique identifier for this signature request */
321
+ id: z.ZodString;
322
+ /** Address of the signer (EOA) */
323
+ signerAddress: z.ZodString;
324
+ /** Human-readable description for the UI */
325
+ description: z.ZodOptional<z.ZodString>;
326
+ /** Generic key-value metadata for action-specific data */
327
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
328
+ } & {
329
+ signMethod: z.ZodLiteral<"message">;
330
+ /** Raw hash to be signed */
331
+ rawHash: z.ZodString;
332
+ }, "strip", z.ZodTypeAny, {
333
+ id: string;
334
+ signerAddress: string;
335
+ signMethod: "message";
336
+ rawHash: string;
337
+ description?: string | undefined;
338
+ metadata?: Record<string, unknown> | undefined;
339
+ }, {
340
+ id: string;
341
+ signerAddress: string;
342
+ signMethod: "message";
343
+ rawHash: string;
344
+ description?: string | undefined;
345
+ metadata?: Record<string, unknown> | undefined;
346
+ }>]>, "many">;
347
+ transactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
348
+ transaction: z.ZodType<PrepareTransactionRequestReturnType>;
349
+ metadata: z.ZodOptional<z.ZodObject<{
350
+ explorerUrl: z.ZodOptional<z.ZodString>;
351
+ usdValue: z.ZodOptional<z.ZodString>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ explorerUrl?: string | undefined;
354
+ usdValue?: string | undefined;
355
+ }, {
356
+ explorerUrl?: string | undefined;
357
+ usdValue?: string | undefined;
358
+ }>>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ transaction: PrepareTransactionRequestReturnType;
361
+ metadata?: {
362
+ explorerUrl?: string | undefined;
363
+ usdValue?: string | undefined;
364
+ } | undefined;
365
+ }, {
366
+ transaction: PrepareTransactionRequestReturnType;
367
+ metadata?: {
368
+ explorerUrl?: string | undefined;
369
+ usdValue?: string | undefined;
370
+ } | undefined;
371
+ }>, "many">>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ signatureRequests: ({
374
+ id: string;
375
+ signerAddress: string;
376
+ signMethod: "typedData";
377
+ typedData: {
378
+ message: Record<string, unknown>;
379
+ types: Record<string, {
380
+ type: string;
381
+ name: string;
382
+ }[]>;
383
+ domain: Record<string, unknown>;
384
+ primaryType: string;
385
+ };
386
+ description?: string | undefined;
387
+ metadata?: Record<string, unknown> | undefined;
388
+ } | {
389
+ id: string;
390
+ signerAddress: string;
391
+ signMethod: "message";
392
+ rawHash: string;
393
+ description?: string | undefined;
394
+ metadata?: Record<string, unknown> | undefined;
395
+ })[];
396
+ transactions?: {
397
+ transaction: PrepareTransactionRequestReturnType;
398
+ metadata?: {
399
+ explorerUrl?: string | undefined;
400
+ usdValue?: string | undefined;
401
+ } | undefined;
402
+ }[] | undefined;
403
+ }, {
404
+ signatureRequests: ({
405
+ id: string;
406
+ signerAddress: string;
407
+ signMethod: "typedData";
408
+ typedData: {
409
+ message: Record<string, unknown>;
410
+ types: Record<string, {
411
+ type: string;
412
+ name: string;
413
+ }[]>;
414
+ domain: Record<string, unknown>;
415
+ primaryType: string;
416
+ };
417
+ description?: string | undefined;
418
+ metadata?: Record<string, unknown> | undefined;
419
+ } | {
420
+ id: string;
421
+ signerAddress: string;
422
+ signMethod: "message";
423
+ rawHash: string;
424
+ description?: string | undefined;
425
+ metadata?: Record<string, unknown> | undefined;
426
+ })[];
427
+ transactions?: {
428
+ transaction: PrepareTransactionRequestReturnType;
429
+ metadata?: {
430
+ explorerUrl?: string | undefined;
431
+ usdValue?: string | undefined;
432
+ } | undefined;
433
+ }[] | undefined;
434
+ }>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ value: {
437
+ signatureRequests: ({
438
+ id: string;
439
+ signerAddress: string;
440
+ signMethod: "typedData";
441
+ typedData: {
442
+ message: Record<string, unknown>;
443
+ types: Record<string, {
444
+ type: string;
445
+ name: string;
446
+ }[]>;
447
+ domain: Record<string, unknown>;
448
+ primaryType: string;
449
+ };
450
+ description?: string | undefined;
451
+ metadata?: Record<string, unknown> | undefined;
452
+ } | {
453
+ id: string;
454
+ signerAddress: string;
455
+ signMethod: "message";
456
+ rawHash: string;
457
+ description?: string | undefined;
458
+ metadata?: Record<string, unknown> | undefined;
459
+ })[];
460
+ transactions?: {
461
+ transaction: PrepareTransactionRequestReturnType;
462
+ metadata?: {
463
+ explorerUrl?: string | undefined;
464
+ usdValue?: string | undefined;
465
+ } | undefined;
466
+ }[] | undefined;
467
+ };
468
+ type: "SignatureRequests";
469
+ }, {
470
+ value: {
471
+ signatureRequests: ({
472
+ id: string;
473
+ signerAddress: string;
474
+ signMethod: "typedData";
475
+ typedData: {
476
+ message: Record<string, unknown>;
477
+ types: Record<string, {
478
+ type: string;
479
+ name: string;
480
+ }[]>;
481
+ domain: Record<string, unknown>;
482
+ primaryType: string;
483
+ };
484
+ description?: string | undefined;
485
+ metadata?: Record<string, unknown> | undefined;
486
+ } | {
487
+ id: string;
488
+ signerAddress: string;
489
+ signMethod: "message";
490
+ rawHash: string;
491
+ description?: string | undefined;
492
+ metadata?: Record<string, unknown> | undefined;
493
+ })[];
494
+ transactions?: {
495
+ transaction: PrepareTransactionRequestReturnType;
496
+ metadata?: {
497
+ explorerUrl?: string | undefined;
498
+ usdValue?: string | undefined;
499
+ } | undefined;
500
+ }[] | undefined;
501
+ };
502
+ type: "SignatureRequests";
123
503
  }>]>;
124
504
  }, "strict", z.ZodTypeAny, {
125
505
  type: "tool-call";
126
- toolName: string;
127
- toolCallId: string;
128
506
  input: {
129
- type: "BatchTransactions";
130
507
  value: {
131
508
  transaction: PrepareTransactionRequestReturnType;
132
509
  metadata?: {
@@ -134,8 +511,8 @@ export declare const PendingToolCallSchema: z.ZodObject<{
134
511
  usdValue?: string | undefined;
135
512
  } | undefined;
136
513
  }[];
514
+ type: "BatchTransactions";
137
515
  } | {
138
- type: "SingleTransaction";
139
516
  value: {
140
517
  transaction: PrepareTransactionRequestReturnType;
141
518
  metadata?: {
@@ -143,13 +520,47 @@ export declare const PendingToolCallSchema: z.ZodObject<{
143
520
  usdValue?: string | undefined;
144
521
  } | undefined;
145
522
  };
523
+ type: "SingleTransaction";
524
+ } | {
525
+ value: {
526
+ signatureRequests: ({
527
+ id: string;
528
+ signerAddress: string;
529
+ signMethod: "typedData";
530
+ typedData: {
531
+ message: Record<string, unknown>;
532
+ types: Record<string, {
533
+ type: string;
534
+ name: string;
535
+ }[]>;
536
+ domain: Record<string, unknown>;
537
+ primaryType: string;
538
+ };
539
+ description?: string | undefined;
540
+ metadata?: Record<string, unknown> | undefined;
541
+ } | {
542
+ id: string;
543
+ signerAddress: string;
544
+ signMethod: "message";
545
+ rawHash: string;
546
+ description?: string | undefined;
547
+ metadata?: Record<string, unknown> | undefined;
548
+ })[];
549
+ transactions?: {
550
+ transaction: PrepareTransactionRequestReturnType;
551
+ metadata?: {
552
+ explorerUrl?: string | undefined;
553
+ usdValue?: string | undefined;
554
+ } | undefined;
555
+ }[] | undefined;
556
+ };
557
+ type: "SignatureRequests";
146
558
  };
559
+ toolCallId: string;
560
+ toolName: string;
147
561
  }, {
148
562
  type: "tool-call";
149
- toolName: string;
150
- toolCallId: string;
151
563
  input: {
152
- type: "BatchTransactions";
153
564
  value: {
154
565
  transaction: PrepareTransactionRequestReturnType;
155
566
  metadata?: {
@@ -157,8 +568,8 @@ export declare const PendingToolCallSchema: z.ZodObject<{
157
568
  usdValue?: string | undefined;
158
569
  } | undefined;
159
570
  }[];
571
+ type: "BatchTransactions";
160
572
  } | {
161
- type: "SingleTransaction";
162
573
  value: {
163
574
  transaction: PrepareTransactionRequestReturnType;
164
575
  metadata?: {
@@ -166,63 +577,48 @@ export declare const PendingToolCallSchema: z.ZodObject<{
166
577
  usdValue?: string | undefined;
167
578
  } | undefined;
168
579
  };
580
+ type: "SingleTransaction";
581
+ } | {
582
+ value: {
583
+ signatureRequests: ({
584
+ id: string;
585
+ signerAddress: string;
586
+ signMethod: "typedData";
587
+ typedData: {
588
+ message: Record<string, unknown>;
589
+ types: Record<string, {
590
+ type: string;
591
+ name: string;
592
+ }[]>;
593
+ domain: Record<string, unknown>;
594
+ primaryType: string;
595
+ };
596
+ description?: string | undefined;
597
+ metadata?: Record<string, unknown> | undefined;
598
+ } | {
599
+ id: string;
600
+ signerAddress: string;
601
+ signMethod: "message";
602
+ rawHash: string;
603
+ description?: string | undefined;
604
+ metadata?: Record<string, unknown> | undefined;
605
+ })[];
606
+ transactions?: {
607
+ transaction: PrepareTransactionRequestReturnType;
608
+ metadata?: {
609
+ explorerUrl?: string | undefined;
610
+ usdValue?: string | undefined;
611
+ } | undefined;
612
+ }[] | undefined;
613
+ };
614
+ type: "SignatureRequests";
169
615
  };
170
- }>;
171
- export declare const ToolResultArraySchema: z.ZodArray<z.ZodObject<{
172
- toolCallId: z.ZodString;
173
- toolName: z.ZodString;
174
- result: z.ZodUnknown;
175
- error: z.ZodOptional<z.ZodUnknown>;
176
- }, "strict", z.ZodTypeAny, {
177
- toolName: string;
178
- toolCallId: string;
179
- result?: unknown;
180
- error?: unknown;
181
- }, {
182
- toolName: string;
183
- toolCallId: string;
184
- result?: unknown;
185
- error?: unknown;
186
- }>, "many">;
187
- export declare const MessageSchema: z.ZodString;
188
- export declare const ToolIncompletePartSchema: z.ZodObject<{
189
- type: z.ZodLiteral<"tool-incomplete">;
190
- toolCallId: z.ZodString;
191
- toolName: z.ZodString;
192
- args: z.ZodUnknown;
193
- missingParams: z.ZodArray<z.ZodString, "many">;
194
- humanReadableDescription: z.ZodString;
195
- }, "strict", z.ZodTypeAny, {
196
- type: "tool-incomplete";
197
- toolName: string;
198
616
  toolCallId: string;
199
- missingParams: string[];
200
- humanReadableDescription: string;
201
- args?: unknown;
202
- }, {
203
- type: "tool-incomplete";
204
617
  toolName: string;
205
- toolCallId: string;
206
- missingParams: string[];
207
- humanReadableDescription: string;
208
- args?: unknown;
209
- }>;
210
- export declare const ToolErrorPartSchema: z.ZodObject<{
211
- type: z.ZodLiteral<"tool-error">;
212
- toolCallId: z.ZodString;
213
- toolName: z.ZodString;
214
- error: z.ZodType<ActionError<unknown>>;
215
- }, "strict", z.ZodTypeAny, {
216
- type: "tool-error";
217
- toolName: string;
218
- toolCallId: string;
219
- error: ActionError<unknown>;
220
- }, {
221
- type: "tool-error";
222
- toolName: string;
223
- toolCallId: string;
224
- error: ActionError<unknown>;
225
618
  }>;
619
+ /**
620
+ * Text content part schema for prompt messages.
621
+ */
226
622
  export declare const TextPartSchema: z.ZodObject<{
227
623
  type: z.ZodLiteral<"text">;
228
624
  text: z.ZodString;
@@ -234,285 +630,12 @@ export declare const TextPartSchema: z.ZodObject<{
234
630
  text: string;
235
631
  }>;
236
632
  /**
237
- * Discriminated union schema for tool calls based on toolName
238
- * Each tool has its own specific args schema
633
+ * Prompt schema matching the API's CoreMessageSchema format.
634
+ * Used for sending user prompts to the API.
239
635
  */
240
- export declare const ToolCallPartSchema: z.ZodDiscriminatedUnion<"toolName", [z.ZodObject<{
241
- type: z.ZodLiteral<"tool-call">;
242
- toolCallId: z.ZodString;
243
- toolName: z.ZodLiteral<"tokenTransfer">;
244
- args: z.ZodType<TokenTransferActionInput>;
245
- }, "strict", z.ZodTypeAny, {
246
- type: "tool-call";
247
- toolName: "tokenTransfer";
248
- toolCallId: string;
249
- args: {
250
- fromAddress: string;
251
- toAddress: string;
252
- amount: string;
253
- token: string;
254
- chain: string;
255
- missingParameters?: string[] | undefined;
256
- humanFriendlyMessage?: string | undefined;
257
- };
258
- }, {
259
- type: "tool-call";
260
- toolName: "tokenTransfer";
261
- toolCallId: string;
262
- args: {
263
- fromAddress: string;
264
- toAddress: string;
265
- amount: string;
266
- token: string;
267
- chain: string;
268
- missingParameters?: string[] | undefined;
269
- humanFriendlyMessage?: string | undefined;
270
- };
271
- }>, z.ZodObject<{
272
- type: z.ZodLiteral<"tool-call">;
273
- toolCallId: z.ZodString;
274
- toolName: z.ZodLiteral<"swapOrBridge">;
275
- args: z.ZodType<SwapBridgeActionInput>;
276
- }, "strict", z.ZodTypeAny, {
277
- type: "tool-call";
278
- toolName: "swapOrBridge";
279
- toolCallId: string;
280
- args: {
281
- fromAddress: string;
282
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
283
- fromToken: string;
284
- fromAmount: string;
285
- protocol: "lifi";
286
- toAddress?: string | undefined;
287
- missingParameters?: string[] | undefined;
288
- humanFriendlyMessage?: string | undefined;
289
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
290
- toToken?: string | undefined;
291
- toAmount?: string | undefined;
292
- };
293
- }, {
294
- type: "tool-call";
295
- toolName: "swapOrBridge";
296
- toolCallId: string;
297
- args: {
298
- fromAddress: string;
299
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
300
- fromToken: string;
301
- fromAmount: string;
302
- protocol: "lifi";
303
- toAddress?: string | undefined;
304
- missingParameters?: string[] | undefined;
305
- humanFriendlyMessage?: string | undefined;
306
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
307
- toToken?: string | undefined;
308
- toAmount?: string | undefined;
309
- };
310
- }>, z.ZodObject<{
311
- type: z.ZodLiteral<"tool-call">;
312
- toolCallId: z.ZodString;
313
- toolName: z.ZodLiteral<"exchangeRate">;
314
- args: z.ZodType<ExchangeRateActionInput>;
315
- }, "strict", z.ZodTypeAny, {
316
- type: "tool-call";
317
- toolName: "exchangeRate";
318
- toolCallId: string;
319
- args: {
320
- provider: "coinMarketCap";
321
- arguments: {
322
- baseCurrency: string;
323
- quoteCurrency: string;
324
- baseAmount?: string | undefined;
325
- quoteAmount?: string | undefined;
326
- }[];
327
- missingParameters?: string[] | undefined;
328
- humanFriendlyMessage?: string | undefined;
329
- };
330
- }, {
331
- type: "tool-call";
332
- toolName: "exchangeRate";
333
- toolCallId: string;
334
- args: {
335
- provider: "coinMarketCap";
336
- arguments: {
337
- baseCurrency: string;
338
- quoteCurrency: string;
339
- baseAmount?: string | undefined;
340
- quoteAmount?: string | undefined;
341
- }[];
342
- missingParameters?: string[] | undefined;
343
- humanFriendlyMessage?: string | undefined;
344
- };
345
- }>, z.ZodObject<{
346
- type: z.ZodLiteral<"tool-call">;
347
- toolCallId: z.ZodString;
348
- toolName: z.ZodLiteral<"getWalletBalance">;
349
- args: z.ZodType<GetWalletBalanceActionInput>;
350
- }, "strict", z.ZodTypeAny, {
351
- type: "tool-call";
352
- toolName: "getWalletBalance";
353
- toolCallId: string;
354
- args: {
355
- address: string;
356
- provider: "moralis";
357
- token?: string | undefined;
358
- chain?: string | undefined;
359
- missingParameters?: string[] | undefined;
360
- humanFriendlyMessage?: string | undefined;
361
- };
362
- }, {
363
- type: "tool-call";
364
- toolName: "getWalletBalance";
365
- toolCallId: string;
366
- args: {
367
- address: string;
368
- provider: "moralis";
369
- token?: string | undefined;
370
- chain?: string | undefined;
371
- missingParameters?: string[] | undefined;
372
- humanFriendlyMessage?: string | undefined;
373
- };
374
- }>, z.ZodObject<{
375
- type: z.ZodLiteral<"tool-call">;
376
- toolCallId: z.ZodString;
377
- toolName: z.ZodLiteral<"defiFetchListings">;
378
- args: z.ZodType<DefiFetchListingsActionInput>;
379
- }, "strict", z.ZodTypeAny, {
380
- type: "tool-call";
381
- toolName: "defiFetchListings";
382
- toolCallId: string;
383
- args: {
384
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
385
- protocol: "aave";
386
- missingParameters?: string[] | undefined;
387
- humanFriendlyMessage?: string | undefined;
388
- tokens?: string[] | undefined;
389
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
390
- limit?: number | undefined;
391
- };
392
- }, {
393
- type: "tool-call";
394
- toolName: "defiFetchListings";
395
- toolCallId: string;
396
- args: {
397
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
398
- protocol: "aave";
399
- missingParameters?: string[] | undefined;
400
- humanFriendlyMessage?: string | undefined;
401
- tokens?: string[] | undefined;
402
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
403
- limit?: number | undefined;
404
- };
405
- }>, z.ZodObject<{
406
- type: z.ZodLiteral<"tool-call">;
407
- toolCallId: z.ZodString;
408
- toolName: z.ZodLiteral<"defiSupply">;
409
- args: z.ZodType<DefiSupplyActionInput>;
410
- }, "strict", z.ZodTypeAny, {
411
- type: "tool-call";
412
- toolName: "defiSupply";
413
- toolCallId: string;
414
- args: {
415
- amount: string;
416
- token: string;
417
- chain: string;
418
- protocol: "aave";
419
- userAddress: string;
420
- missingParameters?: string[] | undefined;
421
- humanFriendlyMessage?: string | undefined;
422
- };
423
- }, {
424
- type: "tool-call";
425
- toolName: "defiSupply";
426
- toolCallId: string;
427
- args: {
428
- amount: string;
429
- token: string;
430
- chain: string;
431
- protocol: "aave";
432
- userAddress: string;
433
- missingParameters?: string[] | undefined;
434
- humanFriendlyMessage?: string | undefined;
435
- };
436
- }>, z.ZodObject<{
437
- type: z.ZodLiteral<"tool-call">;
438
- toolCallId: z.ZodString;
439
- toolName: z.ZodLiteral<"defiWithdraw">;
440
- args: z.ZodType<DefiWithdrawActionInput>;
441
- }, "strict", z.ZodTypeAny, {
442
- type: "tool-call";
443
- toolName: "defiWithdraw";
444
- toolCallId: string;
445
- args: {
446
- amount: string;
447
- token: string;
448
- chain: string;
449
- protocol: "aave";
450
- userAddress: string;
451
- missingParameters?: string[] | undefined;
452
- humanFriendlyMessage?: string | undefined;
453
- };
454
- }, {
455
- type: "tool-call";
456
- toolName: "defiWithdraw";
457
- toolCallId: string;
458
- args: {
459
- amount: string;
460
- token: string;
461
- chain: string;
462
- protocol: "aave";
463
- userAddress: string;
464
- missingParameters?: string[] | undefined;
465
- humanFriendlyMessage?: string | undefined;
466
- };
467
- }>, z.ZodObject<{
468
- type: z.ZodLiteral<"tool-call">;
469
- toolCallId: z.ZodString;
470
- toolName: z.ZodLiteral<"defiPositions">;
471
- args: z.ZodType<DefiPositionsActionInput>;
472
- }, "strict", z.ZodTypeAny, {
473
- type: "tool-call";
474
- toolName: "defiPositions";
475
- toolCallId: string;
476
- args: {
477
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
478
- protocol: "aave";
479
- userAddress: string;
480
- missingParameters?: string[] | undefined;
481
- humanFriendlyMessage?: string | undefined;
482
- tokens?: string[] | undefined;
483
- };
484
- }, {
485
- type: "tool-call";
486
- toolName: "defiPositions";
487
- toolCallId: string;
488
- args: {
489
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
490
- protocol: "aave";
491
- userAddress: string;
492
- missingParameters?: string[] | undefined;
493
- humanFriendlyMessage?: string | undefined;
494
- tokens?: string[] | undefined;
495
- };
496
- }>]>;
497
- export declare const ToolResultPartSchema: z.ZodObject<{
498
- type: z.ZodLiteral<"tool-result">;
499
- toolCallId: z.ZodString;
500
- toolName: z.ZodString;
501
- result: z.ZodUnknown;
502
- }, "strict", z.ZodTypeAny, {
503
- type: "tool-result";
504
- toolName: string;
505
- toolCallId: string;
506
- result?: unknown;
507
- }, {
508
- type: "tool-result";
509
- toolName: string;
510
- toolCallId: string;
511
- result?: unknown;
512
- }>;
513
- export declare const CoreMessageSchema: z.ZodObject<{
514
- role: z.ZodEnum<["user", "assistant", "tool", "system"]>;
515
- content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
636
+ export declare const PromptSchema: z.ZodObject<{
637
+ role: z.ZodLiteral<"user">;
638
+ content: z.ZodArray<z.ZodObject<{
516
639
  type: z.ZodLiteral<"text">;
517
640
  text: z.ZodString;
518
641
  }, "strict", z.ZodTypeAny, {
@@ -521,576 +644,91 @@ export declare const CoreMessageSchema: z.ZodObject<{
521
644
  }, {
522
645
  type: "text";
523
646
  text: string;
524
- }>, z.ZodDiscriminatedUnion<"toolName", [z.ZodObject<{
525
- type: z.ZodLiteral<"tool-call">;
526
- toolCallId: z.ZodString;
527
- toolName: z.ZodLiteral<"tokenTransfer">;
528
- args: z.ZodType<TokenTransferActionInput>;
529
- }, "strict", z.ZodTypeAny, {
530
- type: "tool-call";
531
- toolName: "tokenTransfer";
532
- toolCallId: string;
533
- args: {
534
- fromAddress: string;
535
- toAddress: string;
536
- amount: string;
537
- token: string;
538
- chain: string;
539
- missingParameters?: string[] | undefined;
540
- humanFriendlyMessage?: string | undefined;
541
- };
542
- }, {
543
- type: "tool-call";
544
- toolName: "tokenTransfer";
545
- toolCallId: string;
546
- args: {
547
- fromAddress: string;
548
- toAddress: string;
549
- amount: string;
550
- token: string;
551
- chain: string;
552
- missingParameters?: string[] | undefined;
553
- humanFriendlyMessage?: string | undefined;
554
- };
555
- }>, z.ZodObject<{
556
- type: z.ZodLiteral<"tool-call">;
557
- toolCallId: z.ZodString;
558
- toolName: z.ZodLiteral<"swapOrBridge">;
559
- args: z.ZodType<SwapBridgeActionInput>;
560
- }, "strict", z.ZodTypeAny, {
561
- type: "tool-call";
562
- toolName: "swapOrBridge";
563
- toolCallId: string;
564
- args: {
565
- fromAddress: string;
566
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
567
- fromToken: string;
568
- fromAmount: string;
569
- protocol: "lifi";
570
- toAddress?: string | undefined;
571
- missingParameters?: string[] | undefined;
572
- humanFriendlyMessage?: string | undefined;
573
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
574
- toToken?: string | undefined;
575
- toAmount?: string | undefined;
576
- };
577
- }, {
578
- type: "tool-call";
579
- toolName: "swapOrBridge";
580
- toolCallId: string;
581
- args: {
582
- fromAddress: string;
583
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
584
- fromToken: string;
585
- fromAmount: string;
586
- protocol: "lifi";
587
- toAddress?: string | undefined;
588
- missingParameters?: string[] | undefined;
589
- humanFriendlyMessage?: string | undefined;
590
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
591
- toToken?: string | undefined;
592
- toAmount?: string | undefined;
593
- };
594
- }>, z.ZodObject<{
595
- type: z.ZodLiteral<"tool-call">;
596
- toolCallId: z.ZodString;
597
- toolName: z.ZodLiteral<"exchangeRate">;
598
- args: z.ZodType<ExchangeRateActionInput>;
599
- }, "strict", z.ZodTypeAny, {
600
- type: "tool-call";
601
- toolName: "exchangeRate";
602
- toolCallId: string;
603
- args: {
604
- provider: "coinMarketCap";
605
- arguments: {
606
- baseCurrency: string;
607
- quoteCurrency: string;
608
- baseAmount?: string | undefined;
609
- quoteAmount?: string | undefined;
610
- }[];
611
- missingParameters?: string[] | undefined;
612
- humanFriendlyMessage?: string | undefined;
613
- };
614
- }, {
615
- type: "tool-call";
616
- toolName: "exchangeRate";
617
- toolCallId: string;
618
- args: {
619
- provider: "coinMarketCap";
620
- arguments: {
621
- baseCurrency: string;
622
- quoteCurrency: string;
623
- baseAmount?: string | undefined;
624
- quoteAmount?: string | undefined;
625
- }[];
626
- missingParameters?: string[] | undefined;
627
- humanFriendlyMessage?: string | undefined;
628
- };
629
- }>, z.ZodObject<{
630
- type: z.ZodLiteral<"tool-call">;
631
- toolCallId: z.ZodString;
632
- toolName: z.ZodLiteral<"getWalletBalance">;
633
- args: z.ZodType<GetWalletBalanceActionInput>;
634
- }, "strict", z.ZodTypeAny, {
635
- type: "tool-call";
636
- toolName: "getWalletBalance";
637
- toolCallId: string;
638
- args: {
639
- address: string;
640
- provider: "moralis";
641
- token?: string | undefined;
642
- chain?: string | undefined;
643
- missingParameters?: string[] | undefined;
644
- humanFriendlyMessage?: string | undefined;
645
- };
646
- }, {
647
- type: "tool-call";
648
- toolName: "getWalletBalance";
649
- toolCallId: string;
650
- args: {
651
- address: string;
652
- provider: "moralis";
653
- token?: string | undefined;
654
- chain?: string | undefined;
655
- missingParameters?: string[] | undefined;
656
- humanFriendlyMessage?: string | undefined;
657
- };
658
- }>, z.ZodObject<{
659
- type: z.ZodLiteral<"tool-call">;
660
- toolCallId: z.ZodString;
661
- toolName: z.ZodLiteral<"defiFetchListings">;
662
- args: z.ZodType<DefiFetchListingsActionInput>;
663
- }, "strict", z.ZodTypeAny, {
664
- type: "tool-call";
665
- toolName: "defiFetchListings";
666
- toolCallId: string;
667
- args: {
668
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
669
- protocol: "aave";
670
- missingParameters?: string[] | undefined;
671
- humanFriendlyMessage?: string | undefined;
672
- tokens?: string[] | undefined;
673
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
674
- limit?: number | undefined;
675
- };
676
- }, {
677
- type: "tool-call";
678
- toolName: "defiFetchListings";
679
- toolCallId: string;
680
- args: {
681
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
682
- protocol: "aave";
683
- missingParameters?: string[] | undefined;
684
- humanFriendlyMessage?: string | undefined;
685
- tokens?: string[] | undefined;
686
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
687
- limit?: number | undefined;
688
- };
689
- }>, z.ZodObject<{
690
- type: z.ZodLiteral<"tool-call">;
691
- toolCallId: z.ZodString;
692
- toolName: z.ZodLiteral<"defiSupply">;
693
- args: z.ZodType<DefiSupplyActionInput>;
694
- }, "strict", z.ZodTypeAny, {
695
- type: "tool-call";
696
- toolName: "defiSupply";
697
- toolCallId: string;
698
- args: {
699
- amount: string;
700
- token: string;
701
- chain: string;
702
- protocol: "aave";
703
- userAddress: string;
704
- missingParameters?: string[] | undefined;
705
- humanFriendlyMessage?: string | undefined;
706
- };
707
- }, {
708
- type: "tool-call";
709
- toolName: "defiSupply";
710
- toolCallId: string;
711
- args: {
712
- amount: string;
713
- token: string;
714
- chain: string;
715
- protocol: "aave";
716
- userAddress: string;
717
- missingParameters?: string[] | undefined;
718
- humanFriendlyMessage?: string | undefined;
719
- };
720
- }>, z.ZodObject<{
721
- type: z.ZodLiteral<"tool-call">;
722
- toolCallId: z.ZodString;
723
- toolName: z.ZodLiteral<"defiWithdraw">;
724
- args: z.ZodType<DefiWithdrawActionInput>;
725
- }, "strict", z.ZodTypeAny, {
726
- type: "tool-call";
727
- toolName: "defiWithdraw";
728
- toolCallId: string;
729
- args: {
730
- amount: string;
731
- token: string;
732
- chain: string;
733
- protocol: "aave";
734
- userAddress: string;
735
- missingParameters?: string[] | undefined;
736
- humanFriendlyMessage?: string | undefined;
737
- };
738
- }, {
739
- type: "tool-call";
740
- toolName: "defiWithdraw";
741
- toolCallId: string;
742
- args: {
743
- amount: string;
744
- token: string;
745
- chain: string;
746
- protocol: "aave";
747
- userAddress: string;
748
- missingParameters?: string[] | undefined;
749
- humanFriendlyMessage?: string | undefined;
750
- };
751
- }>, z.ZodObject<{
752
- type: z.ZodLiteral<"tool-call">;
753
- toolCallId: z.ZodString;
754
- toolName: z.ZodLiteral<"defiPositions">;
755
- args: z.ZodType<DefiPositionsActionInput>;
756
- }, "strict", z.ZodTypeAny, {
757
- type: "tool-call";
758
- toolName: "defiPositions";
759
- toolCallId: string;
760
- args: {
761
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
762
- protocol: "aave";
763
- userAddress: string;
764
- missingParameters?: string[] | undefined;
765
- humanFriendlyMessage?: string | undefined;
766
- tokens?: string[] | undefined;
767
- };
768
- }, {
769
- type: "tool-call";
770
- toolName: "defiPositions";
771
- toolCallId: string;
772
- args: {
773
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
774
- protocol: "aave";
775
- userAddress: string;
776
- missingParameters?: string[] | undefined;
777
- humanFriendlyMessage?: string | undefined;
778
- tokens?: string[] | undefined;
779
- };
780
- }>]>, z.ZodObject<{
781
- type: z.ZodLiteral<"tool-result">;
782
- toolCallId: z.ZodString;
783
- toolName: z.ZodString;
784
- result: z.ZodUnknown;
785
- }, "strict", z.ZodTypeAny, {
786
- type: "tool-result";
787
- toolName: string;
788
- toolCallId: string;
789
- result?: unknown;
790
- }, {
791
- type: "tool-result";
792
- toolName: string;
793
- toolCallId: string;
794
- result?: unknown;
795
- }>, z.ZodObject<{
796
- type: z.ZodLiteral<"tool-incomplete">;
797
- toolCallId: z.ZodString;
798
- toolName: z.ZodString;
799
- args: z.ZodUnknown;
800
- missingParams: z.ZodArray<z.ZodString, "many">;
801
- humanReadableDescription: z.ZodString;
647
+ }>, "many">;
648
+ }, "strict", z.ZodTypeAny, {
649
+ role: "user";
650
+ content: {
651
+ type: "text";
652
+ text: string;
653
+ }[];
654
+ }, {
655
+ role: "user";
656
+ content: {
657
+ type: "text";
658
+ text: string;
659
+ }[];
660
+ }>;
661
+ export declare const ToolOutcomesSchema: z.ZodArray<z.ZodObject<{
662
+ id: z.ZodString;
663
+ name: z.ZodString;
664
+ result: z.ZodOptional<z.ZodUnknown>;
665
+ error: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
666
+ type: z.ZodLiteral<"input">;
667
+ errors: z.ZodArray<z.ZodObject<{
668
+ path: z.ZodString;
669
+ message: z.ZodString;
670
+ }, "strict", z.ZodTypeAny, {
671
+ path: string;
672
+ message: string;
673
+ }, {
674
+ path: string;
675
+ message: string;
676
+ }>, "many">;
802
677
  }, "strict", z.ZodTypeAny, {
803
- type: "tool-incomplete";
804
- toolName: string;
805
- toolCallId: string;
806
- missingParams: string[];
807
- humanReadableDescription: string;
808
- args?: unknown;
678
+ type: "input";
679
+ errors: {
680
+ path: string;
681
+ message: string;
682
+ }[];
809
683
  }, {
810
- type: "tool-incomplete";
811
- toolName: string;
812
- toolCallId: string;
813
- missingParams: string[];
814
- humanReadableDescription: string;
815
- args?: unknown;
684
+ type: "input";
685
+ errors: {
686
+ path: string;
687
+ message: string;
688
+ }[];
816
689
  }>, z.ZodObject<{
817
- type: z.ZodLiteral<"tool-error">;
818
- toolCallId: z.ZodString;
819
- toolName: z.ZodString;
820
- error: z.ZodType<ActionError<unknown>>;
690
+ type: z.ZodLiteral<"execution">;
691
+ message: z.ZodString;
692
+ details: z.ZodOptional<z.ZodUnknown>;
821
693
  }, "strict", z.ZodTypeAny, {
822
- type: "tool-error";
823
- toolName: string;
824
- toolCallId: string;
825
- error: ActionError<unknown>;
694
+ message: string;
695
+ type: "execution";
696
+ details?: unknown;
826
697
  }, {
827
- type: "tool-error";
828
- toolName: string;
829
- toolCallId: string;
830
- error: ActionError<unknown>;
831
- }>]>, "many">;
698
+ message: string;
699
+ type: "execution";
700
+ details?: unknown;
701
+ }>]>>;
832
702
  }, "strict", z.ZodTypeAny, {
833
- role: "user" | "assistant" | "tool" | "system";
834
- content: ({
835
- type: "text";
836
- text: string;
837
- } | {
838
- type: "tool-call";
839
- toolName: "tokenTransfer";
840
- toolCallId: string;
841
- args: {
842
- fromAddress: string;
843
- toAddress: string;
844
- amount: string;
845
- token: string;
846
- chain: string;
847
- missingParameters?: string[] | undefined;
848
- humanFriendlyMessage?: string | undefined;
849
- };
850
- } | {
851
- type: "tool-call";
852
- toolName: "swapOrBridge";
853
- toolCallId: string;
854
- args: {
855
- fromAddress: string;
856
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
857
- fromToken: string;
858
- fromAmount: string;
859
- protocol: "lifi";
860
- toAddress?: string | undefined;
861
- missingParameters?: string[] | undefined;
862
- humanFriendlyMessage?: string | undefined;
863
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
864
- toToken?: string | undefined;
865
- toAmount?: string | undefined;
866
- };
867
- } | {
868
- type: "tool-call";
869
- toolName: "exchangeRate";
870
- toolCallId: string;
871
- args: {
872
- provider: "coinMarketCap";
873
- arguments: {
874
- baseCurrency: string;
875
- quoteCurrency: string;
876
- baseAmount?: string | undefined;
877
- quoteAmount?: string | undefined;
878
- }[];
879
- missingParameters?: string[] | undefined;
880
- humanFriendlyMessage?: string | undefined;
881
- };
882
- } | {
883
- type: "tool-call";
884
- toolName: "getWalletBalance";
885
- toolCallId: string;
886
- args: {
887
- address: string;
888
- provider: "moralis";
889
- token?: string | undefined;
890
- chain?: string | undefined;
891
- missingParameters?: string[] | undefined;
892
- humanFriendlyMessage?: string | undefined;
893
- };
894
- } | {
895
- type: "tool-call";
896
- toolName: "defiFetchListings";
897
- toolCallId: string;
898
- args: {
899
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
900
- protocol: "aave";
901
- missingParameters?: string[] | undefined;
902
- humanFriendlyMessage?: string | undefined;
903
- tokens?: string[] | undefined;
904
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
905
- limit?: number | undefined;
906
- };
907
- } | {
908
- type: "tool-call";
909
- toolName: "defiSupply";
910
- toolCallId: string;
911
- args: {
912
- amount: string;
913
- token: string;
914
- chain: string;
915
- protocol: "aave";
916
- userAddress: string;
917
- missingParameters?: string[] | undefined;
918
- humanFriendlyMessage?: string | undefined;
919
- };
920
- } | {
921
- type: "tool-call";
922
- toolName: "defiWithdraw";
923
- toolCallId: string;
924
- args: {
925
- amount: string;
926
- token: string;
927
- chain: string;
928
- protocol: "aave";
929
- userAddress: string;
930
- missingParameters?: string[] | undefined;
931
- humanFriendlyMessage?: string | undefined;
932
- };
933
- } | {
934
- type: "tool-call";
935
- toolName: "defiPositions";
936
- toolCallId: string;
937
- args: {
938
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
939
- protocol: "aave";
940
- userAddress: string;
941
- missingParameters?: string[] | undefined;
942
- humanFriendlyMessage?: string | undefined;
943
- tokens?: string[] | undefined;
944
- };
945
- } | {
946
- type: "tool-result";
947
- toolName: string;
948
- toolCallId: string;
949
- result?: unknown;
950
- } | {
951
- type: "tool-incomplete";
952
- toolName: string;
953
- toolCallId: string;
954
- missingParams: string[];
955
- humanReadableDescription: string;
956
- args?: unknown;
703
+ id: string;
704
+ name: string;
705
+ result?: unknown;
706
+ error?: {
707
+ type: "input";
708
+ errors: {
709
+ path: string;
710
+ message: string;
711
+ }[];
957
712
  } | {
958
- type: "tool-error";
959
- toolName: string;
960
- toolCallId: string;
961
- error: ActionError<unknown>;
962
- })[];
713
+ message: string;
714
+ type: "execution";
715
+ details?: unknown;
716
+ } | undefined;
963
717
  }, {
964
- role: "user" | "assistant" | "tool" | "system";
965
- content: ({
966
- type: "text";
967
- text: string;
968
- } | {
969
- type: "tool-call";
970
- toolName: "tokenTransfer";
971
- toolCallId: string;
972
- args: {
973
- fromAddress: string;
974
- toAddress: string;
975
- amount: string;
976
- token: string;
977
- chain: string;
978
- missingParameters?: string[] | undefined;
979
- humanFriendlyMessage?: string | undefined;
980
- };
981
- } | {
982
- type: "tool-call";
983
- toolName: "swapOrBridge";
984
- toolCallId: string;
985
- args: {
986
- fromAddress: string;
987
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
988
- fromToken: string;
989
- fromAmount: string;
990
- protocol: "lifi";
991
- toAddress?: string | undefined;
992
- missingParameters?: string[] | undefined;
993
- humanFriendlyMessage?: string | undefined;
994
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
995
- toToken?: string | undefined;
996
- toAmount?: string | undefined;
997
- };
998
- } | {
999
- type: "tool-call";
1000
- toolName: "exchangeRate";
1001
- toolCallId: string;
1002
- args: {
1003
- provider: "coinMarketCap";
1004
- arguments: {
1005
- baseCurrency: string;
1006
- quoteCurrency: string;
1007
- baseAmount?: string | undefined;
1008
- quoteAmount?: string | undefined;
1009
- }[];
1010
- missingParameters?: string[] | undefined;
1011
- humanFriendlyMessage?: string | undefined;
1012
- };
1013
- } | {
1014
- type: "tool-call";
1015
- toolName: "getWalletBalance";
1016
- toolCallId: string;
1017
- args: {
1018
- address: string;
1019
- provider: "moralis";
1020
- token?: string | undefined;
1021
- chain?: string | undefined;
1022
- missingParameters?: string[] | undefined;
1023
- humanFriendlyMessage?: string | undefined;
1024
- };
1025
- } | {
1026
- type: "tool-call";
1027
- toolName: "defiFetchListings";
1028
- toolCallId: string;
1029
- args: {
1030
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
1031
- protocol: "aave";
1032
- missingParameters?: string[] | undefined;
1033
- humanFriendlyMessage?: string | undefined;
1034
- tokens?: string[] | undefined;
1035
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
1036
- limit?: number | undefined;
1037
- };
1038
- } | {
1039
- type: "tool-call";
1040
- toolName: "defiSupply";
1041
- toolCallId: string;
1042
- args: {
1043
- amount: string;
1044
- token: string;
1045
- chain: string;
1046
- protocol: "aave";
1047
- userAddress: string;
1048
- missingParameters?: string[] | undefined;
1049
- humanFriendlyMessage?: string | undefined;
1050
- };
1051
- } | {
1052
- type: "tool-call";
1053
- toolName: "defiWithdraw";
1054
- toolCallId: string;
1055
- args: {
1056
- amount: string;
1057
- token: string;
1058
- chain: string;
1059
- protocol: "aave";
1060
- userAddress: string;
1061
- missingParameters?: string[] | undefined;
1062
- humanFriendlyMessage?: string | undefined;
1063
- };
1064
- } | {
1065
- type: "tool-call";
1066
- toolName: "defiPositions";
1067
- toolCallId: string;
1068
- args: {
1069
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
1070
- protocol: "aave";
1071
- userAddress: string;
1072
- missingParameters?: string[] | undefined;
1073
- humanFriendlyMessage?: string | undefined;
1074
- tokens?: string[] | undefined;
1075
- };
1076
- } | {
1077
- type: "tool-result";
1078
- toolName: string;
1079
- toolCallId: string;
1080
- result?: unknown;
1081
- } | {
1082
- type: "tool-incomplete";
1083
- toolName: string;
1084
- toolCallId: string;
1085
- missingParams: string[];
1086
- humanReadableDescription: string;
1087
- args?: unknown;
718
+ id: string;
719
+ name: string;
720
+ result?: unknown;
721
+ error?: {
722
+ type: "input";
723
+ errors: {
724
+ path: string;
725
+ message: string;
726
+ }[];
1088
727
  } | {
1089
- type: "tool-error";
1090
- toolName: string;
1091
- toolCallId: string;
1092
- error: ActionError<unknown>;
1093
- })[];
1094
- }>;
728
+ message: string;
729
+ type: "execution";
730
+ details?: unknown;
731
+ } | undefined;
732
+ }>, "many">;
1095
733
  export declare const HistorySchema: z.ZodArray<z.ZodType<ModelMessage, z.ZodTypeDef, ModelMessage>, "many">;
1096
734
  //# sourceMappingURL=messages.d.ts.map