@illalabs/interfaces 0.22.0 → 0.24.0

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.
@@ -152,45 +152,45 @@ export declare const toolCallBatchEventSchema: z.ZodObject<{
152
152
  args?: Record<string, unknown> | undefined;
153
153
  }>, "many">;
154
154
  }, "strip", z.ZodTypeAny, {
155
- iteration: number;
156
155
  tools: {
157
156
  toolCallId: string;
158
157
  toolName: string;
159
158
  providerMetadata?: Record<string, unknown> | undefined;
160
159
  args?: Record<string, unknown> | undefined;
161
160
  }[];
162
- }, {
163
161
  iteration: number;
162
+ }, {
164
163
  tools: {
165
164
  toolCallId: string;
166
165
  toolName: string;
167
166
  providerMetadata?: Record<string, unknown> | undefined;
168
167
  args?: Record<string, unknown> | undefined;
169
168
  }[];
169
+ iteration: number;
170
170
  }>;
171
171
  }, "strip", z.ZodTypeAny, {
172
172
  type: "tool_call_batch";
173
173
  data: {
174
- iteration: number;
175
174
  tools: {
176
175
  toolCallId: string;
177
176
  toolName: string;
178
177
  providerMetadata?: Record<string, unknown> | undefined;
179
178
  args?: Record<string, unknown> | undefined;
180
179
  }[];
180
+ iteration: number;
181
181
  };
182
182
  requestId: string;
183
183
  timestamp?: number | undefined;
184
184
  }, {
185
185
  type: "tool_call_batch";
186
186
  data: {
187
- iteration: number;
188
187
  tools: {
189
188
  toolCallId: string;
190
189
  toolName: string;
191
190
  providerMetadata?: Record<string, unknown> | undefined;
192
191
  args?: Record<string, unknown> | undefined;
193
192
  }[];
193
+ iteration: number;
194
194
  };
195
195
  requestId: string;
196
196
  timestamp?: number | undefined;
@@ -1510,45 +1510,45 @@ export declare const telemetryEventSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
1510
1510
  args?: Record<string, unknown> | undefined;
1511
1511
  }>, "many">;
1512
1512
  }, "strip", z.ZodTypeAny, {
1513
- iteration: number;
1514
1513
  tools: {
1515
1514
  toolCallId: string;
1516
1515
  toolName: string;
1517
1516
  providerMetadata?: Record<string, unknown> | undefined;
1518
1517
  args?: Record<string, unknown> | undefined;
1519
1518
  }[];
1520
- }, {
1521
1519
  iteration: number;
1520
+ }, {
1522
1521
  tools: {
1523
1522
  toolCallId: string;
1524
1523
  toolName: string;
1525
1524
  providerMetadata?: Record<string, unknown> | undefined;
1526
1525
  args?: Record<string, unknown> | undefined;
1527
1526
  }[];
1527
+ iteration: number;
1528
1528
  }>;
1529
1529
  }, "strip", z.ZodTypeAny, {
1530
1530
  type: "tool_call_batch";
1531
1531
  data: {
1532
- iteration: number;
1533
1532
  tools: {
1534
1533
  toolCallId: string;
1535
1534
  toolName: string;
1536
1535
  providerMetadata?: Record<string, unknown> | undefined;
1537
1536
  args?: Record<string, unknown> | undefined;
1538
1537
  }[];
1538
+ iteration: number;
1539
1539
  };
1540
1540
  requestId: string;
1541
1541
  timestamp?: number | undefined;
1542
1542
  }, {
1543
1543
  type: "tool_call_batch";
1544
1544
  data: {
1545
- iteration: number;
1546
1545
  tools: {
1547
1546
  toolCallId: string;
1548
1547
  toolName: string;
1549
1548
  providerMetadata?: Record<string, unknown> | undefined;
1550
1549
  args?: Record<string, unknown> | undefined;
1551
1550
  }[];
1551
+ iteration: number;
1552
1552
  };
1553
1553
  requestId: string;
1554
1554
  timestamp?: number | undefined;
@@ -25,6 +25,95 @@ export declare const DeFiConfigSchema: z.ZodUnion<[z.ZodObject<{
25
25
  lending?: undefined;
26
26
  }>]>;
27
27
  export declare const SwapBridgeProviderSchema: z.ZodEnum<["lifi", "aerodrome"]>;
28
+ /**
29
+ * Per-key allowlist over the full tool surface. When present on an
30
+ * {@link AutoRouterConfigSchema} it is authoritative: only the listed
31
+ * categories are built (an arbitrary subset, e.g. prediction-markets-only, or
32
+ * swap + balances with no transfer). When absent, the legacy `defi` /
33
+ * `swapOrBridge` fields drive the narrower custom tool set and the canonical
34
+ * full surface is unchanged.
35
+ *
36
+ * `transfer` / `balances` / `exchangeRate` / `resolveName` are boolean-only:
37
+ * they have no autorouter-selectable provider today.
38
+ */
39
+ export declare const ToolsAllowlistSchema: z.ZodObject<{
40
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
41
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
42
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
43
+ }, "strict", z.ZodTypeAny, {
44
+ provider?: "lifi" | "aerodrome" | undefined;
45
+ }, {
46
+ provider?: "lifi" | "aerodrome" | undefined;
47
+ }>]>>;
48
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
49
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ provider?: "lifi" | undefined;
52
+ }, {
53
+ provider?: "lifi" | undefined;
54
+ }>]>>;
55
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
56
+ provider: z.ZodOptional<z.ZodEnum<["aave"]>>;
57
+ supply: z.ZodOptional<z.ZodBoolean>;
58
+ withdraw: z.ZodOptional<z.ZodBoolean>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ supply?: boolean | undefined;
61
+ withdraw?: boolean | undefined;
62
+ provider?: "aave" | undefined;
63
+ }, {
64
+ supply?: boolean | undefined;
65
+ withdraw?: boolean | undefined;
66
+ provider?: "aave" | undefined;
67
+ }>]>>;
68
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
69
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
70
+ }, "strict", z.ZodTypeAny, {
71
+ provider?: "polymarket" | undefined;
72
+ }, {
73
+ provider?: "polymarket" | undefined;
74
+ }>]>>;
75
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
76
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
77
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
78
+ }, "strict", z.ZodTypeAny, {
79
+ swap?: true | {
80
+ provider?: "lifi" | "aerodrome" | undefined;
81
+ } | undefined;
82
+ bridge?: true | {
83
+ provider?: "lifi" | undefined;
84
+ } | undefined;
85
+ transfer?: true | undefined;
86
+ exchangeRate?: true | undefined;
87
+ resolveName?: true | undefined;
88
+ lend?: true | {
89
+ supply?: boolean | undefined;
90
+ withdraw?: boolean | undefined;
91
+ provider?: "aave" | undefined;
92
+ } | undefined;
93
+ predictionMarkets?: true | {
94
+ provider?: "polymarket" | undefined;
95
+ } | undefined;
96
+ balances?: true | undefined;
97
+ }, {
98
+ swap?: true | {
99
+ provider?: "lifi" | "aerodrome" | undefined;
100
+ } | undefined;
101
+ bridge?: true | {
102
+ provider?: "lifi" | undefined;
103
+ } | undefined;
104
+ transfer?: true | undefined;
105
+ exchangeRate?: true | undefined;
106
+ resolveName?: true | undefined;
107
+ lend?: true | {
108
+ supply?: boolean | undefined;
109
+ withdraw?: boolean | undefined;
110
+ provider?: "aave" | undefined;
111
+ } | undefined;
112
+ predictionMarkets?: true | {
113
+ provider?: "polymarket" | undefined;
114
+ } | undefined;
115
+ balances?: true | undefined;
116
+ }>;
28
117
  export declare const AutoRouterConfigSchema: z.ZodObject<{
29
118
  defi: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
30
119
  lending: z.ZodEnum<["aave"]>;
@@ -52,6 +141,85 @@ export declare const AutoRouterConfigSchema: z.ZodObject<{
52
141
  lending?: undefined;
53
142
  }>]>>;
54
143
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
144
+ tools: z.ZodOptional<z.ZodObject<{
145
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
146
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
147
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
148
+ }, "strict", z.ZodTypeAny, {
149
+ provider?: "lifi" | "aerodrome" | undefined;
150
+ }, {
151
+ provider?: "lifi" | "aerodrome" | undefined;
152
+ }>]>>;
153
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
154
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
155
+ }, "strict", z.ZodTypeAny, {
156
+ provider?: "lifi" | undefined;
157
+ }, {
158
+ provider?: "lifi" | undefined;
159
+ }>]>>;
160
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
161
+ provider: z.ZodOptional<z.ZodEnum<["aave"]>>;
162
+ supply: z.ZodOptional<z.ZodBoolean>;
163
+ withdraw: z.ZodOptional<z.ZodBoolean>;
164
+ }, "strict", z.ZodTypeAny, {
165
+ supply?: boolean | undefined;
166
+ withdraw?: boolean | undefined;
167
+ provider?: "aave" | undefined;
168
+ }, {
169
+ supply?: boolean | undefined;
170
+ withdraw?: boolean | undefined;
171
+ provider?: "aave" | undefined;
172
+ }>]>>;
173
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
174
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
175
+ }, "strict", z.ZodTypeAny, {
176
+ provider?: "polymarket" | undefined;
177
+ }, {
178
+ provider?: "polymarket" | undefined;
179
+ }>]>>;
180
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
181
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
182
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
183
+ }, "strict", z.ZodTypeAny, {
184
+ swap?: true | {
185
+ provider?: "lifi" | "aerodrome" | undefined;
186
+ } | undefined;
187
+ bridge?: true | {
188
+ provider?: "lifi" | undefined;
189
+ } | undefined;
190
+ transfer?: true | undefined;
191
+ exchangeRate?: true | undefined;
192
+ resolveName?: true | undefined;
193
+ lend?: true | {
194
+ supply?: boolean | undefined;
195
+ withdraw?: boolean | undefined;
196
+ provider?: "aave" | undefined;
197
+ } | undefined;
198
+ predictionMarkets?: true | {
199
+ provider?: "polymarket" | undefined;
200
+ } | undefined;
201
+ balances?: true | undefined;
202
+ }, {
203
+ swap?: true | {
204
+ provider?: "lifi" | "aerodrome" | undefined;
205
+ } | undefined;
206
+ bridge?: true | {
207
+ provider?: "lifi" | undefined;
208
+ } | undefined;
209
+ transfer?: true | undefined;
210
+ exchangeRate?: true | undefined;
211
+ resolveName?: true | undefined;
212
+ lend?: true | {
213
+ supply?: boolean | undefined;
214
+ withdraw?: boolean | undefined;
215
+ provider?: "aave" | undefined;
216
+ } | undefined;
217
+ predictionMarkets?: true | {
218
+ provider?: "polymarket" | undefined;
219
+ } | undefined;
220
+ balances?: true | undefined;
221
+ }>>;
222
+ chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["Ethereum", "Polygon", "Optimism", "Base", "Arbitrum", "Avalanche", "BSC"]>, "many">>;
55
223
  }, "strict", z.ZodTypeAny, {
56
224
  defi?: {
57
225
  lending: "aave";
@@ -63,6 +231,27 @@ export declare const AutoRouterConfigSchema: z.ZodObject<{
63
231
  lending?: undefined;
64
232
  } | undefined;
65
233
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
234
+ tools?: {
235
+ swap?: true | {
236
+ provider?: "lifi" | "aerodrome" | undefined;
237
+ } | undefined;
238
+ bridge?: true | {
239
+ provider?: "lifi" | undefined;
240
+ } | undefined;
241
+ transfer?: true | undefined;
242
+ exchangeRate?: true | undefined;
243
+ resolveName?: true | undefined;
244
+ lend?: true | {
245
+ supply?: boolean | undefined;
246
+ withdraw?: boolean | undefined;
247
+ provider?: "aave" | undefined;
248
+ } | undefined;
249
+ predictionMarkets?: true | {
250
+ provider?: "polymarket" | undefined;
251
+ } | undefined;
252
+ balances?: true | undefined;
253
+ } | undefined;
254
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
66
255
  }, {
67
256
  defi?: {
68
257
  lending: "aave";
@@ -74,6 +263,27 @@ export declare const AutoRouterConfigSchema: z.ZodObject<{
74
263
  lending?: undefined;
75
264
  } | undefined;
76
265
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
266
+ tools?: {
267
+ swap?: true | {
268
+ provider?: "lifi" | "aerodrome" | undefined;
269
+ } | undefined;
270
+ bridge?: true | {
271
+ provider?: "lifi" | undefined;
272
+ } | undefined;
273
+ transfer?: true | undefined;
274
+ exchangeRate?: true | undefined;
275
+ resolveName?: true | undefined;
276
+ lend?: true | {
277
+ supply?: boolean | undefined;
278
+ withdraw?: boolean | undefined;
279
+ provider?: "aave" | undefined;
280
+ } | undefined;
281
+ predictionMarkets?: true | {
282
+ provider?: "polymarket" | undefined;
283
+ } | undefined;
284
+ balances?: true | undefined;
285
+ } | undefined;
286
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
77
287
  }>;
78
288
  export declare const ToolAutorouterSchema: z.ZodObject<{
79
289
  autoRouter: z.ZodOptional<z.ZodObject<{
@@ -103,6 +313,85 @@ export declare const ToolAutorouterSchema: z.ZodObject<{
103
313
  lending?: undefined;
104
314
  }>]>>;
105
315
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
316
+ tools: z.ZodOptional<z.ZodObject<{
317
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
318
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
319
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
320
+ }, "strict", z.ZodTypeAny, {
321
+ provider?: "lifi" | "aerodrome" | undefined;
322
+ }, {
323
+ provider?: "lifi" | "aerodrome" | undefined;
324
+ }>]>>;
325
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
326
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
327
+ }, "strict", z.ZodTypeAny, {
328
+ provider?: "lifi" | undefined;
329
+ }, {
330
+ provider?: "lifi" | undefined;
331
+ }>]>>;
332
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
333
+ provider: z.ZodOptional<z.ZodEnum<["aave"]>>;
334
+ supply: z.ZodOptional<z.ZodBoolean>;
335
+ withdraw: z.ZodOptional<z.ZodBoolean>;
336
+ }, "strict", z.ZodTypeAny, {
337
+ supply?: boolean | undefined;
338
+ withdraw?: boolean | undefined;
339
+ provider?: "aave" | undefined;
340
+ }, {
341
+ supply?: boolean | undefined;
342
+ withdraw?: boolean | undefined;
343
+ provider?: "aave" | undefined;
344
+ }>]>>;
345
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
346
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
347
+ }, "strict", z.ZodTypeAny, {
348
+ provider?: "polymarket" | undefined;
349
+ }, {
350
+ provider?: "polymarket" | undefined;
351
+ }>]>>;
352
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
353
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
354
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
355
+ }, "strict", z.ZodTypeAny, {
356
+ swap?: true | {
357
+ provider?: "lifi" | "aerodrome" | undefined;
358
+ } | undefined;
359
+ bridge?: true | {
360
+ provider?: "lifi" | undefined;
361
+ } | undefined;
362
+ transfer?: true | undefined;
363
+ exchangeRate?: true | undefined;
364
+ resolveName?: true | undefined;
365
+ lend?: true | {
366
+ supply?: boolean | undefined;
367
+ withdraw?: boolean | undefined;
368
+ provider?: "aave" | undefined;
369
+ } | undefined;
370
+ predictionMarkets?: true | {
371
+ provider?: "polymarket" | undefined;
372
+ } | undefined;
373
+ balances?: true | undefined;
374
+ }, {
375
+ swap?: true | {
376
+ provider?: "lifi" | "aerodrome" | undefined;
377
+ } | undefined;
378
+ bridge?: true | {
379
+ provider?: "lifi" | undefined;
380
+ } | undefined;
381
+ transfer?: true | undefined;
382
+ exchangeRate?: true | undefined;
383
+ resolveName?: true | undefined;
384
+ lend?: true | {
385
+ supply?: boolean | undefined;
386
+ withdraw?: boolean | undefined;
387
+ provider?: "aave" | undefined;
388
+ } | undefined;
389
+ predictionMarkets?: true | {
390
+ provider?: "polymarket" | undefined;
391
+ } | undefined;
392
+ balances?: true | undefined;
393
+ }>>;
394
+ chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["Ethereum", "Polygon", "Optimism", "Base", "Arbitrum", "Avalanche", "BSC"]>, "many">>;
106
395
  }, "strict", z.ZodTypeAny, {
107
396
  defi?: {
108
397
  lending: "aave";
@@ -114,6 +403,27 @@ export declare const ToolAutorouterSchema: z.ZodObject<{
114
403
  lending?: undefined;
115
404
  } | undefined;
116
405
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
406
+ tools?: {
407
+ swap?: true | {
408
+ provider?: "lifi" | "aerodrome" | undefined;
409
+ } | undefined;
410
+ bridge?: true | {
411
+ provider?: "lifi" | undefined;
412
+ } | undefined;
413
+ transfer?: true | undefined;
414
+ exchangeRate?: true | undefined;
415
+ resolveName?: true | undefined;
416
+ lend?: true | {
417
+ supply?: boolean | undefined;
418
+ withdraw?: boolean | undefined;
419
+ provider?: "aave" | undefined;
420
+ } | undefined;
421
+ predictionMarkets?: true | {
422
+ provider?: "polymarket" | undefined;
423
+ } | undefined;
424
+ balances?: true | undefined;
425
+ } | undefined;
426
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
117
427
  }, {
118
428
  defi?: {
119
429
  lending: "aave";
@@ -125,6 +435,27 @@ export declare const ToolAutorouterSchema: z.ZodObject<{
125
435
  lending?: undefined;
126
436
  } | undefined;
127
437
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
438
+ tools?: {
439
+ swap?: true | {
440
+ provider?: "lifi" | "aerodrome" | undefined;
441
+ } | undefined;
442
+ bridge?: true | {
443
+ provider?: "lifi" | undefined;
444
+ } | undefined;
445
+ transfer?: true | undefined;
446
+ exchangeRate?: true | undefined;
447
+ resolveName?: true | undefined;
448
+ lend?: true | {
449
+ supply?: boolean | undefined;
450
+ withdraw?: boolean | undefined;
451
+ provider?: "aave" | undefined;
452
+ } | undefined;
453
+ predictionMarkets?: true | {
454
+ provider?: "polymarket" | undefined;
455
+ } | undefined;
456
+ balances?: true | undefined;
457
+ } | undefined;
458
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
128
459
  }>>;
129
460
  }, "strict", z.ZodTypeAny, {
130
461
  autoRouter?: {
@@ -138,6 +469,27 @@ export declare const ToolAutorouterSchema: z.ZodObject<{
138
469
  lending?: undefined;
139
470
  } | undefined;
140
471
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
472
+ tools?: {
473
+ swap?: true | {
474
+ provider?: "lifi" | "aerodrome" | undefined;
475
+ } | undefined;
476
+ bridge?: true | {
477
+ provider?: "lifi" | undefined;
478
+ } | undefined;
479
+ transfer?: true | undefined;
480
+ exchangeRate?: true | undefined;
481
+ resolveName?: true | undefined;
482
+ lend?: true | {
483
+ supply?: boolean | undefined;
484
+ withdraw?: boolean | undefined;
485
+ provider?: "aave" | undefined;
486
+ } | undefined;
487
+ predictionMarkets?: true | {
488
+ provider?: "polymarket" | undefined;
489
+ } | undefined;
490
+ balances?: true | undefined;
491
+ } | undefined;
492
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
141
493
  } | undefined;
142
494
  }, {
143
495
  autoRouter?: {
@@ -151,6 +503,27 @@ export declare const ToolAutorouterSchema: z.ZodObject<{
151
503
  lending?: undefined;
152
504
  } | undefined;
153
505
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
506
+ tools?: {
507
+ swap?: true | {
508
+ provider?: "lifi" | "aerodrome" | undefined;
509
+ } | undefined;
510
+ bridge?: true | {
511
+ provider?: "lifi" | undefined;
512
+ } | undefined;
513
+ transfer?: true | undefined;
514
+ exchangeRate?: true | undefined;
515
+ resolveName?: true | undefined;
516
+ lend?: true | {
517
+ supply?: boolean | undefined;
518
+ withdraw?: boolean | undefined;
519
+ provider?: "aave" | undefined;
520
+ } | undefined;
521
+ predictionMarkets?: true | {
522
+ provider?: "polymarket" | undefined;
523
+ } | undefined;
524
+ balances?: true | undefined;
525
+ } | undefined;
526
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
154
527
  } | undefined;
155
528
  }>;
156
529
  //# sourceMappingURL=toolAutorouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;IAAkD,CAAC;AAGhF,eAAO,MAAM,wBAAwB,kCAAgC,CAAC;AAGtE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpB,CAAC"}
1
+ {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;IAAkD,CAAC;AAGhF,eAAO,MAAM,wBAAwB,kCAAgC,CAAC;AA0CtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAYd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { LENDING_PROVIDERS, SWAP_BRIDGE_PROVIDERS } from "../utils/constants.js";
2
+ import { LENDING_PROVIDERS, PREDICTION_MARKET_PROVIDERS, SUPPORTED_BRIDGE_PROVIDERS, SUPPORTED_CHAIN_NAMES, SUPPORTED_SWAP_PROVIDERS, SWAP_BRIDGE_PROVIDERS, } from "../utils/constants.js";
3
3
  // Define the Zod schema for LendingProvider
4
4
  const LendingProviderSchema = z.enum(LENDING_PROVIDERS);
5
5
  // Define the schemas for DeFi configuration
@@ -21,11 +21,79 @@ const ActionsOnlySchema = z
21
21
  export const DeFiConfigSchema = z.union([LendingOnlySchema, ActionsOnlySchema]);
22
22
  // Define the Zod schema for SwapBridgeProvider
23
23
  export const SwapBridgeProviderSchema = z.enum(SWAP_BRIDGE_PROVIDERS);
24
+ // ===== Per-key tool category allowlist =====
25
+ //
26
+ // Each category value is `true` (enable with the server's default provider[s])
27
+ // or an object that pins a provider. Categories whose tools route to a single
28
+ // provider today (`bridge` -> lifi, `lend` -> aave, `predictionMarkets` ->
29
+ // polymarket) still accept a `provider` for forward-compatibility; only `swap`
30
+ // (lifi/aerodrome) has a runtime-meaningful choice, enforced at the swap tool's
31
+ // `protocol` enum.
32
+ const SwapCategorySchema = z.union([
33
+ z.literal(true),
34
+ z.object({ provider: z.enum(SUPPORTED_SWAP_PROVIDERS).optional() }).strict(),
35
+ ]);
36
+ const BridgeCategorySchema = z.union([
37
+ z.literal(true),
38
+ z.object({ provider: z.enum(SUPPORTED_BRIDGE_PROVIDERS).optional() }).strict(),
39
+ ]);
40
+ /**
41
+ * Lending category. Read (listings/positions) is implied whenever `lend` is
42
+ * present; `supply`/`withdraw` default to enabled and can be turned off
43
+ * individually to express, for example, a read-only lending key.
44
+ */
45
+ const LendCategorySchema = z.union([
46
+ z.literal(true),
47
+ z
48
+ .object({
49
+ provider: LendingProviderSchema.optional(),
50
+ supply: z.boolean().optional(),
51
+ withdraw: z.boolean().optional(),
52
+ })
53
+ .strict(),
54
+ ]);
55
+ const PredictionMarketsCategorySchema = z.union([
56
+ z.literal(true),
57
+ z.object({ provider: z.enum(PREDICTION_MARKET_PROVIDERS).optional() }).strict(),
58
+ ]);
59
+ /**
60
+ * Per-key allowlist over the full tool surface. When present on an
61
+ * {@link AutoRouterConfigSchema} it is authoritative: only the listed
62
+ * categories are built (an arbitrary subset, e.g. prediction-markets-only, or
63
+ * swap + balances with no transfer). When absent, the legacy `defi` /
64
+ * `swapOrBridge` fields drive the narrower custom tool set and the canonical
65
+ * full surface is unchanged.
66
+ *
67
+ * `transfer` / `balances` / `exchangeRate` / `resolveName` are boolean-only:
68
+ * they have no autorouter-selectable provider today.
69
+ */
70
+ export const ToolsAllowlistSchema = z
71
+ .object({
72
+ transfer: z.literal(true).optional(),
73
+ swap: SwapCategorySchema.optional(),
74
+ bridge: BridgeCategorySchema.optional(),
75
+ lend: LendCategorySchema.optional(),
76
+ predictionMarkets: PredictionMarketsCategorySchema.optional(),
77
+ balances: z.literal(true).optional(),
78
+ exchangeRate: z.literal(true).optional(),
79
+ resolveName: z.literal(true).optional(),
80
+ })
81
+ .strict();
82
+ /**
83
+ * Optional per-key chain allowlist, orthogonal to the provider/tool filters
84
+ * above. When set, every resolved tool is restricted to these chains (the
85
+ * tool's `chain` enum is narrowed), independent of which providers/categories
86
+ * are enabled. A chain-only config (no `tools`/`defi`/`swapOrBridge`) keeps the
87
+ * full tool surface, just limited to these chains.
88
+ */
89
+ const ChainAllowlistSchema = z.array(z.enum(SUPPORTED_CHAIN_NAMES)).min(1);
24
90
  // Define the main AutoRouterConfig schema
25
91
  export const AutoRouterConfigSchema = z
26
92
  .object({
27
93
  defi: DeFiConfigSchema.optional(),
28
94
  swapOrBridge: SwapBridgeProviderSchema.optional(),
95
+ tools: ToolsAllowlistSchema.optional(),
96
+ chains: ChainAllowlistSchema.optional(),
29
97
  })
30
98
  .strict();
31
99
  // Define the Zod schema for ToolAutorouter
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.js","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,4CAA4C;AAC5C,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAExD,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC;KACtB,MAAM,CAAC;IACJ,OAAO,EAAE,qBAAqB;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC;KACD,MAAM,EAAE,CAAC;AAEd,MAAM,iBAAiB,GAAG,CAAC;KACtB,MAAM,CAAC;IACJ,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM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AAC,MAAM,sBAAsB,GAAG,CAAC;KAClC,MAAM,CAAC;IACJ,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACjD,KAAK,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACtC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC1C,CAAC;KACD,MAAM,EAAE,CAAC;AAEd,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAChC,MAAM,CAAC;IACJ,UAAU,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CAChD,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -1,7 +1,14 @@
1
1
  import type { TypeOf } from "zod";
2
- import { AutoRouterConfigSchema, DeFiConfigSchema, SwapBridgeProviderSchema, ToolAutorouterSchema } from "../internal.js";
2
+ import { AutoRouterConfigSchema, DeFiConfigSchema, SwapBridgeProviderSchema, ToolAutorouterSchema, ToolsAllowlistSchema } from "../internal.js";
3
3
  export type ToolAutorouterRequest = TypeOf<typeof ToolAutorouterSchema>;
4
4
  export type AutoRouterConfigType = TypeOf<typeof AutoRouterConfigSchema>;
5
5
  export type LendingProviderType = TypeOf<typeof DeFiConfigSchema>;
6
6
  export type SwapBridgeProviderType = TypeOf<typeof SwapBridgeProviderSchema>;
7
+ /**
8
+ * Per-key tool category allowlist. The set fields are the enabled
9
+ * categories; an absent field means the category is excluded.
10
+ */
11
+ export type ToolsAllowlistType = TypeOf<typeof ToolsAllowlistSchema>;
12
+ /** The category keys of {@link ToolsAllowlistType}. */
13
+ export type AutoRouterToolCategory = keyof ToolsAllowlistType;
7
14
  //# sourceMappingURL=toolAutorouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/types/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/types/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,uDAAuD;AACvD,MAAM,MAAM,sBAAsB,GAAG,MAAM,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
- import { AutoRouterConfigSchema, DeFiConfigSchema, SwapBridgeProviderSchema, ToolAutorouterSchema, } from "../internal.js";
1
+ import { AutoRouterConfigSchema, DeFiConfigSchema, SwapBridgeProviderSchema, ToolAutorouterSchema, ToolsAllowlistSchema, } from "../internal.js";
2
2
  //# sourceMappingURL=toolAutorouter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.js","sourceRoot":"","sources":["../../src/types/toolAutorouter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,GACvB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"toolAutorouter.js","sourceRoot":"","sources":["../../src/types/toolAutorouter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,GACvB,MAAM,gBAAgB,CAAC"}