@illalabs/interfaces 0.2.0 → 0.3.0-canary.1a04c18e

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 (118) 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 -579
  10. package/dist/schemas/chatContext.d.ts.map +1 -1
  11. package/dist/schemas/chatContext.js +2 -2
  12. package/dist/schemas/chatContext.js.map +1 -1
  13. package/dist/schemas/chatRequestBody.d.ts +511 -827
  14. package/dist/schemas/chatRequestBody.d.ts.map +1 -1
  15. package/dist/schemas/chatRequestBody.js +11 -4
  16. package/dist/schemas/chatRequestBody.js.map +1 -1
  17. package/dist/schemas/executionCheckerQueryParams.d.ts +5 -5
  18. package/dist/schemas/illaTools.d.ts +266 -0
  19. package/dist/schemas/illaTools.d.ts.map +1 -0
  20. package/dist/schemas/illaTools.js +58 -0
  21. package/dist/schemas/illaTools.js.map +1 -0
  22. package/dist/schemas/index.d.ts +3 -0
  23. package/dist/schemas/index.d.ts.map +1 -1
  24. package/dist/schemas/index.js +3 -0
  25. package/dist/schemas/index.js.map +1 -1
  26. package/dist/schemas/messages.d.ts +95 -930
  27. package/dist/schemas/messages.d.ts.map +1 -1
  28. package/dist/schemas/messages.js +10 -113
  29. package/dist/schemas/messages.js.map +1 -1
  30. package/dist/schemas/modelContext.d.ts +23 -0
  31. package/dist/schemas/modelContext.d.ts.map +1 -0
  32. package/dist/schemas/modelContext.js +13 -0
  33. package/dist/schemas/modelContext.js.map +1 -0
  34. package/dist/schemas/telemetryEvents.d.ts +1645 -0
  35. package/dist/schemas/telemetryEvents.d.ts.map +1 -0
  36. package/dist/schemas/telemetryEvents.js +236 -0
  37. package/dist/schemas/telemetryEvents.js.map +1 -0
  38. package/dist/schemas/toolAutorouter.d.ts +6 -6
  39. package/dist/tools/IllaToolError.d.ts +117 -0
  40. package/dist/tools/IllaToolError.d.ts.map +1 -0
  41. package/dist/tools/IllaToolError.js +147 -0
  42. package/dist/tools/IllaToolError.js.map +1 -0
  43. package/dist/tools/IllaToolOutcome.d.ts +131 -0
  44. package/dist/tools/IllaToolOutcome.d.ts.map +1 -0
  45. package/dist/tools/IllaToolOutcome.js +191 -0
  46. package/dist/tools/IllaToolOutcome.js.map +1 -0
  47. package/dist/tools/index.d.ts +3 -0
  48. package/dist/tools/index.d.ts.map +1 -0
  49. package/dist/tools/index.js +3 -0
  50. package/dist/tools/index.js.map +1 -0
  51. package/dist/types/actions/inputs.d.ts +5 -3
  52. package/dist/types/actions/inputs.d.ts.map +1 -1
  53. package/dist/types/actions/tools/{swapBridgeAction.d.ts → bridgeAction.d.ts} +4 -4
  54. package/dist/types/actions/tools/bridgeAction.d.ts.map +1 -0
  55. package/dist/types/actions/tools/bridgeAction.js +2 -0
  56. package/dist/types/actions/tools/bridgeAction.js.map +1 -0
  57. package/dist/types/actions/tools/defiFetchListingsAction.d.ts +1 -2
  58. package/dist/types/actions/tools/defiFetchListingsAction.d.ts.map +1 -1
  59. package/dist/types/actions/tools/defiFetchListingsAction.js +1 -1
  60. package/dist/types/actions/tools/defiFetchListingsAction.js.map +1 -1
  61. package/dist/types/actions/tools/defiPositionsAction.d.ts +1 -2
  62. package/dist/types/actions/tools/defiPositionsAction.d.ts.map +1 -1
  63. package/dist/types/actions/tools/defiPositionsAction.js +1 -1
  64. package/dist/types/actions/tools/defiPositionsAction.js.map +1 -1
  65. package/dist/types/actions/tools/defiSupplyAction.d.ts +1 -2
  66. package/dist/types/actions/tools/defiSupplyAction.d.ts.map +1 -1
  67. package/dist/types/actions/tools/defiSupplyAction.js +1 -1
  68. package/dist/types/actions/tools/defiSupplyAction.js.map +1 -1
  69. package/dist/types/actions/tools/defiWithdrawAction.d.ts +1 -2
  70. package/dist/types/actions/tools/defiWithdrawAction.d.ts.map +1 -1
  71. package/dist/types/actions/tools/defiWithdrawAction.js +1 -1
  72. package/dist/types/actions/tools/defiWithdrawAction.js.map +1 -1
  73. package/dist/types/actions/tools/exchangeRateAction.d.ts +1 -2
  74. package/dist/types/actions/tools/exchangeRateAction.d.ts.map +1 -1
  75. package/dist/types/actions/tools/exchangeRateAction.js +1 -1
  76. package/dist/types/actions/tools/exchangeRateAction.js.map +1 -1
  77. package/dist/types/actions/tools/getWalletBalanceAction.d.ts +2 -2
  78. package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
  79. package/dist/types/actions/tools/getWalletBalanceAction.js +1 -1
  80. package/dist/types/actions/tools/getWalletBalanceAction.js.map +1 -1
  81. package/dist/types/actions/tools/index.d.ts +9 -3
  82. package/dist/types/actions/tools/index.d.ts.map +1 -1
  83. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts +21 -0
  84. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts.map +1 -0
  85. package/dist/types/actions/tools/predictionMarketsFetchAction.js +2 -0
  86. package/dist/types/actions/tools/predictionMarketsFetchAction.js.map +1 -0
  87. package/dist/types/actions/tools/swapAction.d.ts +16 -0
  88. package/dist/types/actions/tools/swapAction.d.ts.map +1 -0
  89. package/dist/types/actions/tools/swapAction.js +2 -0
  90. package/dist/types/actions/tools/swapAction.js.map +1 -0
  91. package/dist/types/actions/tools/tokenTransferAction.d.ts +1 -2
  92. package/dist/types/actions/tools/tokenTransferAction.d.ts.map +1 -1
  93. package/dist/types/actions/tools/tokenTransferAction.js +1 -1
  94. package/dist/types/actions/tools/tokenTransferAction.js.map +1 -1
  95. package/dist/types/index.d.ts +2 -0
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/types/index.js +2 -0
  98. package/dist/types/index.js.map +1 -1
  99. package/dist/types/messages.d.ts +3 -6
  100. package/dist/types/messages.d.ts.map +1 -1
  101. package/dist/types/messages.js +1 -1
  102. package/dist/types/messages.js.map +1 -1
  103. package/dist/types/streaming.d.ts +81 -0
  104. package/dist/types/streaming.d.ts.map +1 -0
  105. package/dist/types/streaming.js +2 -0
  106. package/dist/types/streaming.js.map +1 -0
  107. package/dist/types/telemetry.d.ts +139 -0
  108. package/dist/types/telemetry.d.ts.map +1 -0
  109. package/dist/types/telemetry.js +7 -0
  110. package/dist/types/telemetry.js.map +1 -0
  111. package/dist/utils/constants.d.ts +6 -4
  112. package/dist/utils/constants.d.ts.map +1 -1
  113. package/dist/utils/constants.js +18 -3
  114. package/dist/utils/constants.js.map +1 -1
  115. package/package.json +4 -4
  116. package/dist/types/actions/tools/swapBridgeAction.d.ts.map +0 -1
  117. package/dist/types/actions/tools/swapBridgeAction.js +0 -2
  118. package/dist/types/actions/tools/swapBridgeAction.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pick<{
2
+ export declare const ChatContextSchema: z.ZodObject<Pick<{
3
3
  toolsConfig: z.ZodObject<{
4
4
  autoRouter: z.ZodOptional<z.ZodObject<{
5
5
  defi: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -29,7 +29,6 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
29
29
  }>]>>;
30
30
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi"]>>;
31
31
  }, "strict", z.ZodTypeAny, {
32
- swapOrBridge?: "lifi" | undefined;
33
32
  defi?: {
34
33
  lending: "aave";
35
34
  supply?: undefined;
@@ -39,8 +38,8 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
39
38
  withdraw: "aave";
40
39
  lending?: undefined;
41
40
  } | undefined;
42
- }, {
43
41
  swapOrBridge?: "lifi" | undefined;
42
+ }, {
44
43
  defi?: {
45
44
  lending: "aave";
46
45
  supply?: undefined;
@@ -50,10 +49,10 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
50
49
  withdraw: "aave";
51
50
  lending?: undefined;
52
51
  } | undefined;
52
+ swapOrBridge?: "lifi" | undefined;
53
53
  }>>;
54
54
  }, "strict", z.ZodTypeAny, {
55
55
  autoRouter?: {
56
- swapOrBridge?: "lifi" | undefined;
57
56
  defi?: {
58
57
  lending: "aave";
59
58
  supply?: undefined;
@@ -63,10 +62,10 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
63
62
  withdraw: "aave";
64
63
  lending?: undefined;
65
64
  } | undefined;
65
+ swapOrBridge?: "lifi" | undefined;
66
66
  } | undefined;
67
67
  }, {
68
68
  autoRouter?: {
69
- swapOrBridge?: "lifi" | undefined;
70
69
  defi?: {
71
70
  lending: "aave";
72
71
  supply?: undefined;
@@ -76,6 +75,7 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
76
75
  withdraw: "aave";
77
76
  lending?: undefined;
78
77
  } | undefined;
78
+ swapOrBridge?: "lifi" | undefined;
79
79
  } | undefined;
80
80
  }>;
81
81
  messages: z.ZodArray<z.ZodType<import("@ai-sdk/provider-utils").ModelMessage, z.ZodTypeDef, import("@ai-sdk/provider-utils").ModelMessage>, "many">;
@@ -86,9 +86,9 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
86
86
  }, {
87
87
  address: string;
88
88
  }>;
89
- prompt: z.ZodObject<{
90
- role: z.ZodEnum<["user", "assistant", "tool", "system"]>;
91
- content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
89
+ prompt: z.ZodOptional<z.ZodObject<{
90
+ role: z.ZodLiteral<"user">;
91
+ content: z.ZodArray<z.ZodObject<{
92
92
  type: z.ZodLiteral<"text">;
93
93
  text: z.ZodString;
94
94
  }, "strict", z.ZodTypeAny, {
@@ -97,578 +97,93 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
97
97
  }, {
98
98
  type: "text";
99
99
  text: string;
100
- }>, z.ZodDiscriminatedUnion<"toolName", [z.ZodObject<{
101
- type: z.ZodLiteral<"tool-call">;
102
- toolCallId: z.ZodString;
103
- toolName: z.ZodLiteral<"tokenTransfer">;
104
- args: z.ZodType<import("../external.js").TokenTransferActionInput>;
105
- }, "strict", z.ZodTypeAny, {
106
- type: "tool-call";
107
- toolName: "tokenTransfer";
108
- toolCallId: string;
109
- args: {
110
- fromAddress: string;
111
- toAddress: string;
112
- amount: string;
113
- token: string;
114
- chain: string;
115
- missingParameters?: string[] | undefined;
116
- humanFriendlyMessage?: string | undefined;
117
- };
118
- }, {
119
- type: "tool-call";
120
- toolName: "tokenTransfer";
121
- toolCallId: string;
122
- args: {
123
- fromAddress: string;
124
- toAddress: string;
125
- amount: string;
126
- token: string;
127
- chain: string;
128
- missingParameters?: string[] | undefined;
129
- humanFriendlyMessage?: string | undefined;
130
- };
131
- }>, z.ZodObject<{
132
- type: z.ZodLiteral<"tool-call">;
133
- toolCallId: z.ZodString;
134
- toolName: z.ZodLiteral<"swapOrBridge">;
135
- args: z.ZodType<import("../external.js").SwapBridgeActionInput>;
136
- }, "strict", z.ZodTypeAny, {
137
- type: "tool-call";
138
- toolName: "swapOrBridge";
139
- toolCallId: string;
140
- args: {
141
- fromAddress: string;
142
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
143
- fromToken: string;
144
- fromAmount: string;
145
- protocol: "lifi";
146
- toAddress?: string | undefined;
147
- missingParameters?: string[] | undefined;
148
- humanFriendlyMessage?: string | undefined;
149
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
150
- toToken?: string | undefined;
151
- toAmount?: string | undefined;
152
- };
153
- }, {
154
- type: "tool-call";
155
- toolName: "swapOrBridge";
156
- toolCallId: string;
157
- args: {
158
- fromAddress: string;
159
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
160
- fromToken: string;
161
- fromAmount: string;
162
- protocol: "lifi";
163
- toAddress?: string | undefined;
164
- missingParameters?: string[] | undefined;
165
- humanFriendlyMessage?: string | undefined;
166
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
167
- toToken?: string | undefined;
168
- toAmount?: string | undefined;
169
- };
170
- }>, z.ZodObject<{
171
- type: z.ZodLiteral<"tool-call">;
172
- toolCallId: z.ZodString;
173
- toolName: z.ZodLiteral<"exchangeRate">;
174
- args: z.ZodType<import("../external.js").ExchangeRateActionInput>;
175
- }, "strict", z.ZodTypeAny, {
176
- type: "tool-call";
177
- toolName: "exchangeRate";
178
- toolCallId: string;
179
- args: {
180
- provider: "coinMarketCap";
181
- arguments: {
182
- baseCurrency: string;
183
- quoteCurrency: string;
184
- baseAmount?: string | undefined;
185
- quoteAmount?: string | undefined;
186
- }[];
187
- missingParameters?: string[] | undefined;
188
- humanFriendlyMessage?: string | undefined;
189
- };
190
- }, {
191
- type: "tool-call";
192
- toolName: "exchangeRate";
193
- toolCallId: string;
194
- args: {
195
- provider: "coinMarketCap";
196
- arguments: {
197
- baseCurrency: string;
198
- quoteCurrency: string;
199
- baseAmount?: string | undefined;
200
- quoteAmount?: string | undefined;
201
- }[];
202
- missingParameters?: string[] | undefined;
203
- humanFriendlyMessage?: string | undefined;
204
- };
205
- }>, z.ZodObject<{
206
- type: z.ZodLiteral<"tool-call">;
207
- toolCallId: z.ZodString;
208
- toolName: z.ZodLiteral<"getWalletBalance">;
209
- args: z.ZodType<import("../external.js").GetWalletBalanceActionInput>;
210
- }, "strict", z.ZodTypeAny, {
211
- type: "tool-call";
212
- toolName: "getWalletBalance";
213
- toolCallId: string;
214
- args: {
215
- address: string;
216
- provider: "moralis";
217
- token?: string | undefined;
218
- chain?: string | undefined;
219
- missingParameters?: string[] | undefined;
220
- humanFriendlyMessage?: string | undefined;
221
- };
222
- }, {
223
- type: "tool-call";
224
- toolName: "getWalletBalance";
225
- toolCallId: string;
226
- args: {
227
- address: string;
228
- provider: "moralis";
229
- token?: string | undefined;
230
- chain?: string | undefined;
231
- missingParameters?: string[] | undefined;
232
- humanFriendlyMessage?: string | undefined;
233
- };
234
- }>, z.ZodObject<{
235
- type: z.ZodLiteral<"tool-call">;
236
- toolCallId: z.ZodString;
237
- toolName: z.ZodLiteral<"defiFetchListings">;
238
- args: z.ZodType<import("../external.js").DefiFetchListingsActionInput>;
239
- }, "strict", z.ZodTypeAny, {
240
- type: "tool-call";
241
- toolName: "defiFetchListings";
242
- toolCallId: string;
243
- args: {
244
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
245
- protocol: "aave";
246
- missingParameters?: string[] | undefined;
247
- humanFriendlyMessage?: string | undefined;
248
- tokens?: string[] | undefined;
249
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
250
- limit?: number | undefined;
251
- };
252
- }, {
253
- type: "tool-call";
254
- toolName: "defiFetchListings";
255
- toolCallId: string;
256
- args: {
257
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
258
- protocol: "aave";
259
- missingParameters?: string[] | undefined;
260
- humanFriendlyMessage?: string | undefined;
261
- tokens?: string[] | undefined;
262
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
263
- limit?: number | undefined;
264
- };
265
- }>, z.ZodObject<{
266
- type: z.ZodLiteral<"tool-call">;
267
- toolCallId: z.ZodString;
268
- toolName: z.ZodLiteral<"defiSupply">;
269
- args: z.ZodType<import("../external.js").DefiSupplyActionInput>;
270
- }, "strict", z.ZodTypeAny, {
271
- type: "tool-call";
272
- toolName: "defiSupply";
273
- toolCallId: string;
274
- args: {
275
- amount: string;
276
- token: string;
277
- chain: string;
278
- protocol: "aave";
279
- userAddress: string;
280
- missingParameters?: string[] | undefined;
281
- humanFriendlyMessage?: string | undefined;
282
- };
283
- }, {
284
- type: "tool-call";
285
- toolName: "defiSupply";
286
- toolCallId: string;
287
- args: {
288
- amount: string;
289
- token: string;
290
- chain: string;
291
- protocol: "aave";
292
- userAddress: string;
293
- missingParameters?: string[] | undefined;
294
- humanFriendlyMessage?: string | undefined;
295
- };
296
- }>, z.ZodObject<{
297
- type: z.ZodLiteral<"tool-call">;
298
- toolCallId: z.ZodString;
299
- toolName: z.ZodLiteral<"defiWithdraw">;
300
- args: z.ZodType<import("../external.js").DefiWithdrawActionInput>;
301
- }, "strict", z.ZodTypeAny, {
302
- type: "tool-call";
303
- toolName: "defiWithdraw";
304
- toolCallId: string;
305
- args: {
306
- amount: string;
307
- token: string;
308
- chain: string;
309
- protocol: "aave";
310
- userAddress: string;
311
- missingParameters?: string[] | undefined;
312
- humanFriendlyMessage?: string | undefined;
313
- };
314
- }, {
315
- type: "tool-call";
316
- toolName: "defiWithdraw";
317
- toolCallId: string;
318
- args: {
319
- amount: string;
320
- token: string;
321
- chain: string;
322
- protocol: "aave";
323
- userAddress: string;
324
- missingParameters?: string[] | undefined;
325
- humanFriendlyMessage?: string | undefined;
326
- };
327
- }>, z.ZodObject<{
328
- type: z.ZodLiteral<"tool-call">;
329
- toolCallId: z.ZodString;
330
- toolName: z.ZodLiteral<"defiPositions">;
331
- args: z.ZodType<import("../external.js").DefiPositionsActionInput>;
332
- }, "strict", z.ZodTypeAny, {
333
- type: "tool-call";
334
- toolName: "defiPositions";
335
- toolCallId: string;
336
- args: {
337
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
338
- protocol: "aave";
339
- userAddress: string;
340
- missingParameters?: string[] | undefined;
341
- humanFriendlyMessage?: string | undefined;
342
- tokens?: string[] | undefined;
343
- };
344
- }, {
345
- type: "tool-call";
346
- toolName: "defiPositions";
347
- toolCallId: string;
348
- args: {
349
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
350
- protocol: "aave";
351
- userAddress: string;
352
- missingParameters?: string[] | undefined;
353
- humanFriendlyMessage?: string | undefined;
354
- tokens?: string[] | undefined;
355
- };
356
- }>]>, z.ZodObject<{
357
- type: z.ZodLiteral<"tool-result">;
358
- toolCallId: z.ZodString;
359
- toolName: z.ZodString;
360
- result: z.ZodUnknown;
361
- }, "strict", z.ZodTypeAny, {
362
- type: "tool-result";
363
- toolName: string;
364
- toolCallId: string;
365
- result?: unknown;
366
- }, {
367
- type: "tool-result";
368
- toolName: string;
369
- toolCallId: string;
370
- result?: unknown;
371
- }>, z.ZodObject<{
372
- type: z.ZodLiteral<"tool-incomplete">;
373
- toolCallId: z.ZodString;
374
- toolName: z.ZodString;
375
- args: z.ZodUnknown;
376
- missingParams: z.ZodArray<z.ZodString, "many">;
377
- humanReadableDescription: z.ZodString;
100
+ }>, "many">;
101
+ }, "strict", z.ZodTypeAny, {
102
+ role: "user";
103
+ content: {
104
+ type: "text";
105
+ text: string;
106
+ }[];
107
+ }, {
108
+ role: "user";
109
+ content: {
110
+ type: "text";
111
+ text: string;
112
+ }[];
113
+ }>>;
114
+ toolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
115
+ id: z.ZodString;
116
+ name: z.ZodString;
117
+ result: z.ZodOptional<z.ZodUnknown>;
118
+ error: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
119
+ type: z.ZodLiteral<"input">;
120
+ errors: z.ZodArray<z.ZodObject<{
121
+ path: z.ZodString;
122
+ message: z.ZodString;
123
+ }, "strict", z.ZodTypeAny, {
124
+ path: string;
125
+ message: string;
126
+ }, {
127
+ path: string;
128
+ message: string;
129
+ }>, "many">;
378
130
  }, "strict", z.ZodTypeAny, {
379
- type: "tool-incomplete";
380
- toolName: string;
381
- toolCallId: string;
382
- missingParams: string[];
383
- humanReadableDescription: string;
384
- args?: unknown;
131
+ type: "input";
132
+ errors: {
133
+ path: string;
134
+ message: string;
135
+ }[];
385
136
  }, {
386
- type: "tool-incomplete";
387
- toolName: string;
388
- toolCallId: string;
389
- missingParams: string[];
390
- humanReadableDescription: string;
391
- args?: unknown;
137
+ type: "input";
138
+ errors: {
139
+ path: string;
140
+ message: string;
141
+ }[];
392
142
  }>, z.ZodObject<{
393
- type: z.ZodLiteral<"tool-error">;
394
- toolCallId: z.ZodString;
395
- toolName: z.ZodString;
396
- error: z.ZodType<import("../types/actions/errors.js").ActionError<unknown>>;
143
+ type: z.ZodLiteral<"execution">;
144
+ message: z.ZodString;
145
+ details: z.ZodOptional<z.ZodUnknown>;
397
146
  }, "strict", z.ZodTypeAny, {
398
- type: "tool-error";
399
- toolName: string;
400
- toolCallId: string;
401
- error: import("../types/actions/errors.js").ActionError<unknown>;
147
+ message: string;
148
+ type: "execution";
149
+ details?: unknown;
402
150
  }, {
403
- type: "tool-error";
404
- toolName: string;
405
- toolCallId: string;
406
- error: import("../types/actions/errors.js").ActionError<unknown>;
407
- }>]>, "many">;
151
+ message: string;
152
+ type: "execution";
153
+ details?: unknown;
154
+ }>]>>;
408
155
  }, "strict", z.ZodTypeAny, {
409
- role: "user" | "assistant" | "tool" | "system";
410
- content: ({
411
- type: "text";
412
- text: string;
413
- } | {
414
- type: "tool-call";
415
- toolName: "tokenTransfer";
416
- toolCallId: string;
417
- args: {
418
- fromAddress: string;
419
- toAddress: string;
420
- amount: string;
421
- token: string;
422
- chain: string;
423
- missingParameters?: string[] | undefined;
424
- humanFriendlyMessage?: string | undefined;
425
- };
426
- } | {
427
- type: "tool-call";
428
- toolName: "swapOrBridge";
429
- toolCallId: string;
430
- args: {
431
- fromAddress: string;
432
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
433
- fromToken: string;
434
- fromAmount: string;
435
- protocol: "lifi";
436
- toAddress?: string | undefined;
437
- missingParameters?: string[] | undefined;
438
- humanFriendlyMessage?: string | undefined;
439
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
440
- toToken?: string | undefined;
441
- toAmount?: string | undefined;
442
- };
443
- } | {
444
- type: "tool-call";
445
- toolName: "exchangeRate";
446
- toolCallId: string;
447
- args: {
448
- provider: "coinMarketCap";
449
- arguments: {
450
- baseCurrency: string;
451
- quoteCurrency: string;
452
- baseAmount?: string | undefined;
453
- quoteAmount?: string | undefined;
454
- }[];
455
- missingParameters?: string[] | undefined;
456
- humanFriendlyMessage?: string | undefined;
457
- };
458
- } | {
459
- type: "tool-call";
460
- toolName: "getWalletBalance";
461
- toolCallId: string;
462
- args: {
463
- address: string;
464
- provider: "moralis";
465
- token?: string | undefined;
466
- chain?: string | undefined;
467
- missingParameters?: string[] | undefined;
468
- humanFriendlyMessage?: string | undefined;
469
- };
470
- } | {
471
- type: "tool-call";
472
- toolName: "defiFetchListings";
473
- toolCallId: string;
474
- args: {
475
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
476
- protocol: "aave";
477
- missingParameters?: string[] | undefined;
478
- humanFriendlyMessage?: string | undefined;
479
- tokens?: string[] | undefined;
480
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
481
- limit?: number | undefined;
482
- };
483
- } | {
484
- type: "tool-call";
485
- toolName: "defiSupply";
486
- toolCallId: string;
487
- args: {
488
- amount: string;
489
- token: string;
490
- chain: string;
491
- protocol: "aave";
492
- userAddress: string;
493
- missingParameters?: string[] | undefined;
494
- humanFriendlyMessage?: string | undefined;
495
- };
496
- } | {
497
- type: "tool-call";
498
- toolName: "defiWithdraw";
499
- toolCallId: string;
500
- args: {
501
- amount: string;
502
- token: string;
503
- chain: string;
504
- protocol: "aave";
505
- userAddress: string;
506
- missingParameters?: string[] | undefined;
507
- humanFriendlyMessage?: string | undefined;
508
- };
156
+ id: string;
157
+ name: string;
158
+ result?: unknown;
159
+ error?: {
160
+ type: "input";
161
+ errors: {
162
+ path: string;
163
+ message: string;
164
+ }[];
509
165
  } | {
510
- type: "tool-call";
511
- toolName: "defiPositions";
512
- toolCallId: string;
513
- args: {
514
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
515
- protocol: "aave";
516
- userAddress: string;
517
- missingParameters?: string[] | undefined;
518
- humanFriendlyMessage?: string | undefined;
519
- tokens?: string[] | undefined;
520
- };
521
- } | {
522
- type: "tool-result";
523
- toolName: string;
524
- toolCallId: string;
525
- result?: unknown;
526
- } | {
527
- type: "tool-incomplete";
528
- toolName: string;
529
- toolCallId: string;
530
- missingParams: string[];
531
- humanReadableDescription: string;
532
- args?: unknown;
533
- } | {
534
- type: "tool-error";
535
- toolName: string;
536
- toolCallId: string;
537
- error: import("../types/actions/errors.js").ActionError<unknown>;
538
- })[];
166
+ message: string;
167
+ type: "execution";
168
+ details?: unknown;
169
+ } | undefined;
539
170
  }, {
540
- role: "user" | "assistant" | "tool" | "system";
541
- content: ({
542
- type: "text";
543
- text: string;
544
- } | {
545
- type: "tool-call";
546
- toolName: "tokenTransfer";
547
- toolCallId: string;
548
- args: {
549
- fromAddress: string;
550
- toAddress: string;
551
- amount: string;
552
- token: string;
553
- chain: string;
554
- missingParameters?: string[] | undefined;
555
- humanFriendlyMessage?: string | undefined;
556
- };
557
- } | {
558
- type: "tool-call";
559
- toolName: "swapOrBridge";
560
- toolCallId: string;
561
- args: {
562
- fromAddress: string;
563
- fromChain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
564
- fromToken: string;
565
- fromAmount: string;
566
- protocol: "lifi";
567
- toAddress?: string | undefined;
568
- missingParameters?: string[] | undefined;
569
- humanFriendlyMessage?: string | undefined;
570
- toChain?: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC" | undefined;
571
- toToken?: string | undefined;
572
- toAmount?: string | undefined;
573
- };
574
- } | {
575
- type: "tool-call";
576
- toolName: "exchangeRate";
577
- toolCallId: string;
578
- args: {
579
- provider: "coinMarketCap";
580
- arguments: {
581
- baseCurrency: string;
582
- quoteCurrency: string;
583
- baseAmount?: string | undefined;
584
- quoteAmount?: string | undefined;
585
- }[];
586
- missingParameters?: string[] | undefined;
587
- humanFriendlyMessage?: string | undefined;
588
- };
589
- } | {
590
- type: "tool-call";
591
- toolName: "getWalletBalance";
592
- toolCallId: string;
593
- args: {
594
- address: string;
595
- provider: "moralis";
596
- token?: string | undefined;
597
- chain?: string | undefined;
598
- missingParameters?: string[] | undefined;
599
- humanFriendlyMessage?: string | undefined;
600
- };
171
+ id: string;
172
+ name: string;
173
+ result?: unknown;
174
+ error?: {
175
+ type: "input";
176
+ errors: {
177
+ path: string;
178
+ message: string;
179
+ }[];
601
180
  } | {
602
- type: "tool-call";
603
- toolName: "defiFetchListings";
604
- toolCallId: string;
605
- args: {
606
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
607
- protocol: "aave";
608
- missingParameters?: string[] | undefined;
609
- humanFriendlyMessage?: string | undefined;
610
- tokens?: string[] | undefined;
611
- criteria?: "supplyAPY" | "totalLiquidityUSD" | undefined;
612
- limit?: number | undefined;
613
- };
614
- } | {
615
- type: "tool-call";
616
- toolName: "defiSupply";
617
- toolCallId: string;
618
- args: {
619
- amount: string;
620
- token: string;
621
- chain: string;
622
- protocol: "aave";
623
- userAddress: string;
624
- missingParameters?: string[] | undefined;
625
- humanFriendlyMessage?: string | undefined;
626
- };
627
- } | {
628
- type: "tool-call";
629
- toolName: "defiWithdraw";
630
- toolCallId: string;
631
- args: {
632
- amount: string;
633
- token: string;
634
- chain: string;
635
- protocol: "aave";
636
- userAddress: string;
637
- missingParameters?: string[] | undefined;
638
- humanFriendlyMessage?: string | undefined;
639
- };
640
- } | {
641
- type: "tool-call";
642
- toolName: "defiPositions";
643
- toolCallId: string;
644
- args: {
645
- chain: "Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC";
646
- protocol: "aave";
647
- userAddress: string;
648
- missingParameters?: string[] | undefined;
649
- humanFriendlyMessage?: string | undefined;
650
- tokens?: string[] | undefined;
651
- };
652
- } | {
653
- type: "tool-result";
654
- toolName: string;
655
- toolCallId: string;
656
- result?: unknown;
657
- } | {
658
- type: "tool-incomplete";
659
- toolName: string;
660
- toolCallId: string;
661
- missingParams: string[];
662
- humanReadableDescription: string;
663
- args?: unknown;
664
- } | {
665
- type: "tool-error";
666
- toolName: string;
667
- toolCallId: string;
668
- error: import("../types/actions/errors.js").ActionError<unknown>;
669
- })[];
670
- }>;
671
- languageModel: z.ZodOptional<z.ZodString>;
181
+ message: string;
182
+ type: "execution";
183
+ details?: unknown;
184
+ } | undefined;
185
+ }>, "many">>;
186
+ languageModel: z.ZodString;
672
187
  personalityContext: z.ZodDefault<z.ZodOptional<z.ZodObject<{
673
188
  channel: z.ZodEnum<["voice", "text"]>;
674
189
  }, "strip", z.ZodTypeAny, {
@@ -676,7 +191,8 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
676
191
  }, {
677
192
  channel: "text" | "voice";
678
193
  }>>>;
679
- }, "messages">, {
194
+ requestId: z.ZodOptional<z.ZodString>;
195
+ }, "messages"> & {
680
196
  toolsConfig: z.ZodObject<{
681
197
  autoRouter: z.ZodOptional<z.ZodObject<{
682
198
  defi: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -706,7 +222,6 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
706
222
  }>]>>;
707
223
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi"]>>;
708
224
  }, "strict", z.ZodTypeAny, {
709
- swapOrBridge?: "lifi" | undefined;
710
225
  defi?: {
711
226
  lending: "aave";
712
227
  supply?: undefined;
@@ -716,8 +231,8 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
716
231
  withdraw: "aave";
717
232
  lending?: undefined;
718
233
  } | undefined;
719
- }, {
720
234
  swapOrBridge?: "lifi" | undefined;
235
+ }, {
721
236
  defi?: {
722
237
  lending: "aave";
723
238
  supply?: undefined;
@@ -727,10 +242,10 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
727
242
  withdraw: "aave";
728
243
  lending?: undefined;
729
244
  } | undefined;
245
+ swapOrBridge?: "lifi" | undefined;
730
246
  }>>;
731
247
  }, "strict", z.ZodTypeAny, {
732
248
  autoRouter?: {
733
- swapOrBridge?: "lifi" | undefined;
734
249
  defi?: {
735
250
  lending: "aave";
736
251
  supply?: undefined;
@@ -740,10 +255,10 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
740
255
  withdraw: "aave";
741
256
  lending?: undefined;
742
257
  } | undefined;
258
+ swapOrBridge?: "lifi" | undefined;
743
259
  } | undefined;
744
260
  }, {
745
261
  autoRouter?: {
746
- swapOrBridge?: "lifi" | undefined;
747
262
  defi?: {
748
263
  lending: "aave";
749
264
  supply?: undefined;
@@ -753,12 +268,12 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
753
268
  withdraw: "aave";
754
269
  lending?: undefined;
755
270
  } | undefined;
271
+ swapOrBridge?: "lifi" | undefined;
756
272
  } | undefined;
757
273
  }>;
758
- }>, "strip", z.ZodTypeAny, {
274
+ }, "strip", z.ZodTypeAny, {
759
275
  toolsConfig: {
760
276
  autoRouter?: {
761
- swapOrBridge?: "lifi" | undefined;
762
277
  defi?: {
763
278
  lending: "aave";
764
279
  supply?: undefined;
@@ -768,13 +283,13 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
768
283
  withdraw: "aave";
769
284
  lending?: undefined;
770
285
  } | undefined;
286
+ swapOrBridge?: "lifi" | undefined;
771
287
  } | undefined;
772
288
  };
773
289
  messages: import("@ai-sdk/provider-utils").ModelMessage[];
774
290
  }, {
775
291
  toolsConfig: {
776
292
  autoRouter?: {
777
- swapOrBridge?: "lifi" | undefined;
778
293
  defi?: {
779
294
  lending: "aave";
780
295
  supply?: undefined;
@@ -784,6 +299,7 @@ export declare const ChatContextSchema: z.ZodObject<z.objectUtil.extendShape<Pic
784
299
  withdraw: "aave";
785
300
  lending?: undefined;
786
301
  } | undefined;
302
+ swapOrBridge?: "lifi" | undefined;
787
303
  } | undefined;
788
304
  };
789
305
  messages: import("@ai-sdk/provider-utils").ModelMessage[];