@chaoslabs/ai-sdk 0.0.1

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.
@@ -0,0 +1,547 @@
1
+ import { z } from "zod";
2
+ export declare const ChaosConfigSchema: z.ZodObject<{
3
+ apiKey: z.ZodString;
4
+ baseUrl: z.ZodOptional<z.ZodString>;
5
+ timeout: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export declare const InputItemSchema: z.ZodObject<{
8
+ type: z.ZodLiteral<"message">;
9
+ role: z.ZodEnum<{
10
+ user: "user";
11
+ system: "system";
12
+ }>;
13
+ content: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export declare const RequestMetadataSchema: z.ZodObject<{
16
+ user_id: z.ZodString;
17
+ session_id: z.ZodString;
18
+ wallet_id: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ export declare const CreateResponseParamsSchema: z.ZodObject<{
21
+ model: z.ZodString;
22
+ input: z.ZodArray<z.ZodObject<{
23
+ type: z.ZodLiteral<"message">;
24
+ role: z.ZodEnum<{
25
+ user: "user";
26
+ system: "system";
27
+ }>;
28
+ content: z.ZodString;
29
+ }, z.core.$strip>>;
30
+ stream: z.ZodOptional<z.ZodBoolean>;
31
+ metadata: z.ZodObject<{
32
+ user_id: z.ZodString;
33
+ session_id: z.ZodString;
34
+ wallet_id: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strip>;
37
+ export declare const TableCellValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
38
+ export declare const TableBlockSchema: z.ZodObject<{
39
+ type: z.ZodLiteral<"table">;
40
+ title: z.ZodString;
41
+ tableHeaders: z.ZodArray<z.ZodString>;
42
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
43
+ }, z.core.$strip>;
44
+ export declare const MarkdownBlockSchema: z.ZodObject<{
45
+ type: z.ZodLiteral<"markdown">;
46
+ content: z.ZodString;
47
+ }, z.core.$strip>;
48
+ export declare const PrimitiveParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
49
+ export declare const PrimitiveDisplaySchema: z.ZodObject<{
50
+ headline: z.ZodString;
51
+ amount: z.ZodOptional<z.ZodString>;
52
+ action_verb: z.ZodOptional<z.ZodString>;
53
+ from_asset: z.ZodOptional<z.ZodString>;
54
+ to_asset: z.ZodOptional<z.ZodString>;
55
+ from_chain: z.ZodOptional<z.ZodString>;
56
+ to_chain: z.ZodOptional<z.ZodString>;
57
+ protocol: z.ZodOptional<z.ZodString>;
58
+ leverage: z.ZodOptional<z.ZodString>;
59
+ direction: z.ZodOptional<z.ZodString>;
60
+ recipient: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>;
62
+ export declare const PrimitiveSchema: z.ZodObject<{
63
+ primitive: z.ZodString;
64
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
65
+ display: z.ZodOptional<z.ZodObject<{
66
+ headline: z.ZodString;
67
+ amount: z.ZodOptional<z.ZodString>;
68
+ action_verb: z.ZodOptional<z.ZodString>;
69
+ from_asset: z.ZodOptional<z.ZodString>;
70
+ to_asset: z.ZodOptional<z.ZodString>;
71
+ from_chain: z.ZodOptional<z.ZodString>;
72
+ to_chain: z.ZodOptional<z.ZodString>;
73
+ protocol: z.ZodOptional<z.ZodString>;
74
+ leverage: z.ZodOptional<z.ZodString>;
75
+ direction: z.ZodOptional<z.ZodString>;
76
+ recipient: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>>;
78
+ }, z.core.$strip>;
79
+ export declare const RisksSchema: z.ZodObject<{
80
+ level: z.ZodEnum<{
81
+ low: "low";
82
+ medium: "medium";
83
+ high: "high";
84
+ critical: "critical";
85
+ }>;
86
+ warnings: z.ZodArray<z.ZodString>;
87
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ }, z.core.$strip>;
89
+ export declare const TransactionActionBlockSchema: z.ZodObject<{
90
+ type: z.ZodLiteral<"transaction_action">;
91
+ title: z.ZodString;
92
+ primitives: z.ZodArray<z.ZodObject<{
93
+ primitive: z.ZodString;
94
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
95
+ display: z.ZodOptional<z.ZodObject<{
96
+ headline: z.ZodString;
97
+ amount: z.ZodOptional<z.ZodString>;
98
+ action_verb: z.ZodOptional<z.ZodString>;
99
+ from_asset: z.ZodOptional<z.ZodString>;
100
+ to_asset: z.ZodOptional<z.ZodString>;
101
+ from_chain: z.ZodOptional<z.ZodString>;
102
+ to_chain: z.ZodOptional<z.ZodString>;
103
+ protocol: z.ZodOptional<z.ZodString>;
104
+ leverage: z.ZodOptional<z.ZodString>;
105
+ direction: z.ZodOptional<z.ZodString>;
106
+ recipient: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strip>>;
109
+ risks: z.ZodOptional<z.ZodObject<{
110
+ level: z.ZodEnum<{
111
+ low: "low";
112
+ medium: "medium";
113
+ high: "high";
114
+ critical: "critical";
115
+ }>;
116
+ warnings: z.ZodArray<z.ZodString>;
117
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
120
+ export declare const InteractiveOptionSchema: z.ZodObject<{
121
+ id: z.ZodString;
122
+ label: z.ZodString;
123
+ description: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>;
125
+ export declare const InteractiveCardBlockSchema: z.ZodObject<{
126
+ type: z.ZodLiteral<"interactive_card">;
127
+ title: z.ZodString;
128
+ body: z.ZodOptional<z.ZodString>;
129
+ style: z.ZodEnum<{
130
+ options: "options";
131
+ confirm_cancel: "confirm_cancel";
132
+ }>;
133
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
134
+ id: z.ZodString;
135
+ label: z.ZodString;
136
+ description: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>>>;
138
+ }, z.core.$strip>;
139
+ export declare const TimeseriesDataPointSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
140
+ export declare const TimeseriesSeriesSchema: z.ZodObject<{
141
+ label: z.ZodString;
142
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
143
+ }, z.core.$strip>;
144
+ export declare const TimeseriesDataSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
145
+ label: z.ZodString;
146
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
147
+ }, z.core.$strip>>>;
148
+ export declare const TimeseriesBlockSchema: z.ZodObject<{
149
+ type: z.ZodLiteral<"timeseries">;
150
+ title: z.ZodString;
151
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
152
+ label: z.ZodString;
153
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
154
+ }, z.core.$strip>>>;
155
+ }, z.core.$strip>;
156
+ export declare const PieChartBlockSchema: z.ZodObject<{
157
+ type: z.ZodLiteral<"pie_chart">;
158
+ title: z.ZodString;
159
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
160
+ }, z.core.$strip>;
161
+ export declare const BlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
162
+ type: z.ZodLiteral<"table">;
163
+ title: z.ZodString;
164
+ tableHeaders: z.ZodArray<z.ZodString>;
165
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ type: z.ZodLiteral<"markdown">;
168
+ content: z.ZodString;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ type: z.ZodLiteral<"transaction_action">;
171
+ title: z.ZodString;
172
+ primitives: z.ZodArray<z.ZodObject<{
173
+ primitive: z.ZodString;
174
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
175
+ display: z.ZodOptional<z.ZodObject<{
176
+ headline: z.ZodString;
177
+ amount: z.ZodOptional<z.ZodString>;
178
+ action_verb: z.ZodOptional<z.ZodString>;
179
+ from_asset: z.ZodOptional<z.ZodString>;
180
+ to_asset: z.ZodOptional<z.ZodString>;
181
+ from_chain: z.ZodOptional<z.ZodString>;
182
+ to_chain: z.ZodOptional<z.ZodString>;
183
+ protocol: z.ZodOptional<z.ZodString>;
184
+ leverage: z.ZodOptional<z.ZodString>;
185
+ direction: z.ZodOptional<z.ZodString>;
186
+ recipient: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>>;
188
+ }, z.core.$strip>>;
189
+ risks: z.ZodOptional<z.ZodObject<{
190
+ level: z.ZodEnum<{
191
+ low: "low";
192
+ medium: "medium";
193
+ high: "high";
194
+ critical: "critical";
195
+ }>;
196
+ warnings: z.ZodArray<z.ZodString>;
197
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
198
+ }, z.core.$strip>>;
199
+ }, z.core.$strip>, z.ZodObject<{
200
+ type: z.ZodLiteral<"interactive_card">;
201
+ title: z.ZodString;
202
+ body: z.ZodOptional<z.ZodString>;
203
+ style: z.ZodEnum<{
204
+ options: "options";
205
+ confirm_cancel: "confirm_cancel";
206
+ }>;
207
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
208
+ id: z.ZodString;
209
+ label: z.ZodString;
210
+ description: z.ZodOptional<z.ZodString>;
211
+ }, z.core.$strip>>>;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ type: z.ZodLiteral<"timeseries">;
214
+ title: z.ZodString;
215
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
216
+ label: z.ZodString;
217
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
218
+ }, z.core.$strip>>>;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ type: z.ZodLiteral<"pie_chart">;
221
+ title: z.ZodString;
222
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
223
+ }, z.core.$strip>], "type">;
224
+ export declare const OutputTextSchema: z.ZodObject<{
225
+ type: z.ZodLiteral<"output_text">;
226
+ text: z.ZodString;
227
+ }, z.core.$strip>;
228
+ export declare const ChaosBlockSchema: z.ZodObject<{
229
+ type: z.ZodLiteral<"chaos.block">;
230
+ block: z.ZodDiscriminatedUnion<[z.ZodObject<{
231
+ type: z.ZodLiteral<"table">;
232
+ title: z.ZodString;
233
+ tableHeaders: z.ZodArray<z.ZodString>;
234
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
235
+ }, z.core.$strip>, z.ZodObject<{
236
+ type: z.ZodLiteral<"markdown">;
237
+ content: z.ZodString;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ type: z.ZodLiteral<"transaction_action">;
240
+ title: z.ZodString;
241
+ primitives: z.ZodArray<z.ZodObject<{
242
+ primitive: z.ZodString;
243
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
244
+ display: z.ZodOptional<z.ZodObject<{
245
+ headline: z.ZodString;
246
+ amount: z.ZodOptional<z.ZodString>;
247
+ action_verb: z.ZodOptional<z.ZodString>;
248
+ from_asset: z.ZodOptional<z.ZodString>;
249
+ to_asset: z.ZodOptional<z.ZodString>;
250
+ from_chain: z.ZodOptional<z.ZodString>;
251
+ to_chain: z.ZodOptional<z.ZodString>;
252
+ protocol: z.ZodOptional<z.ZodString>;
253
+ leverage: z.ZodOptional<z.ZodString>;
254
+ direction: z.ZodOptional<z.ZodString>;
255
+ recipient: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strip>>;
257
+ }, z.core.$strip>>;
258
+ risks: z.ZodOptional<z.ZodObject<{
259
+ level: z.ZodEnum<{
260
+ low: "low";
261
+ medium: "medium";
262
+ high: "high";
263
+ critical: "critical";
264
+ }>;
265
+ warnings: z.ZodArray<z.ZodString>;
266
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
267
+ }, z.core.$strip>>;
268
+ }, z.core.$strip>, z.ZodObject<{
269
+ type: z.ZodLiteral<"interactive_card">;
270
+ title: z.ZodString;
271
+ body: z.ZodOptional<z.ZodString>;
272
+ style: z.ZodEnum<{
273
+ options: "options";
274
+ confirm_cancel: "confirm_cancel";
275
+ }>;
276
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
277
+ id: z.ZodString;
278
+ label: z.ZodString;
279
+ description: z.ZodOptional<z.ZodString>;
280
+ }, z.core.$strip>>>;
281
+ }, z.core.$strip>, z.ZodObject<{
282
+ type: z.ZodLiteral<"timeseries">;
283
+ title: z.ZodString;
284
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
285
+ label: z.ZodString;
286
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
287
+ }, z.core.$strip>>>;
288
+ }, z.core.$strip>, z.ZodObject<{
289
+ type: z.ZodLiteral<"pie_chart">;
290
+ title: z.ZodString;
291
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
292
+ }, z.core.$strip>], "type">;
293
+ }, z.core.$strip>;
294
+ export declare const ContentPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
295
+ type: z.ZodLiteral<"output_text">;
296
+ text: z.ZodString;
297
+ }, z.core.$strip>, z.ZodObject<{
298
+ type: z.ZodLiteral<"chaos.block">;
299
+ block: z.ZodDiscriminatedUnion<[z.ZodObject<{
300
+ type: z.ZodLiteral<"table">;
301
+ title: z.ZodString;
302
+ tableHeaders: z.ZodArray<z.ZodString>;
303
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
304
+ }, z.core.$strip>, z.ZodObject<{
305
+ type: z.ZodLiteral<"markdown">;
306
+ content: z.ZodString;
307
+ }, z.core.$strip>, z.ZodObject<{
308
+ type: z.ZodLiteral<"transaction_action">;
309
+ title: z.ZodString;
310
+ primitives: z.ZodArray<z.ZodObject<{
311
+ primitive: z.ZodString;
312
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
313
+ display: z.ZodOptional<z.ZodObject<{
314
+ headline: z.ZodString;
315
+ amount: z.ZodOptional<z.ZodString>;
316
+ action_verb: z.ZodOptional<z.ZodString>;
317
+ from_asset: z.ZodOptional<z.ZodString>;
318
+ to_asset: z.ZodOptional<z.ZodString>;
319
+ from_chain: z.ZodOptional<z.ZodString>;
320
+ to_chain: z.ZodOptional<z.ZodString>;
321
+ protocol: z.ZodOptional<z.ZodString>;
322
+ leverage: z.ZodOptional<z.ZodString>;
323
+ direction: z.ZodOptional<z.ZodString>;
324
+ recipient: z.ZodOptional<z.ZodString>;
325
+ }, z.core.$strip>>;
326
+ }, z.core.$strip>>;
327
+ risks: z.ZodOptional<z.ZodObject<{
328
+ level: z.ZodEnum<{
329
+ low: "low";
330
+ medium: "medium";
331
+ high: "high";
332
+ critical: "critical";
333
+ }>;
334
+ warnings: z.ZodArray<z.ZodString>;
335
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
336
+ }, z.core.$strip>>;
337
+ }, z.core.$strip>, z.ZodObject<{
338
+ type: z.ZodLiteral<"interactive_card">;
339
+ title: z.ZodString;
340
+ body: z.ZodOptional<z.ZodString>;
341
+ style: z.ZodEnum<{
342
+ options: "options";
343
+ confirm_cancel: "confirm_cancel";
344
+ }>;
345
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
346
+ id: z.ZodString;
347
+ label: z.ZodString;
348
+ description: z.ZodOptional<z.ZodString>;
349
+ }, z.core.$strip>>>;
350
+ }, z.core.$strip>, z.ZodObject<{
351
+ type: z.ZodLiteral<"timeseries">;
352
+ title: z.ZodString;
353
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
354
+ label: z.ZodString;
355
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
356
+ }, z.core.$strip>>>;
357
+ }, z.core.$strip>, z.ZodObject<{
358
+ type: z.ZodLiteral<"pie_chart">;
359
+ title: z.ZodString;
360
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
361
+ }, z.core.$strip>], "type">;
362
+ }, z.core.$strip>], "type">;
363
+ export declare const OutputItemSchema: z.ZodObject<{
364
+ type: z.ZodLiteral<"message">;
365
+ role: z.ZodLiteral<"assistant">;
366
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
367
+ type: z.ZodLiteral<"output_text">;
368
+ text: z.ZodString;
369
+ }, z.core.$strip>, z.ZodObject<{
370
+ type: z.ZodLiteral<"chaos.block">;
371
+ block: z.ZodDiscriminatedUnion<[z.ZodObject<{
372
+ type: z.ZodLiteral<"table">;
373
+ title: z.ZodString;
374
+ tableHeaders: z.ZodArray<z.ZodString>;
375
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
376
+ }, z.core.$strip>, z.ZodObject<{
377
+ type: z.ZodLiteral<"markdown">;
378
+ content: z.ZodString;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ type: z.ZodLiteral<"transaction_action">;
381
+ title: z.ZodString;
382
+ primitives: z.ZodArray<z.ZodObject<{
383
+ primitive: z.ZodString;
384
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
385
+ display: z.ZodOptional<z.ZodObject<{
386
+ headline: z.ZodString;
387
+ amount: z.ZodOptional<z.ZodString>;
388
+ action_verb: z.ZodOptional<z.ZodString>;
389
+ from_asset: z.ZodOptional<z.ZodString>;
390
+ to_asset: z.ZodOptional<z.ZodString>;
391
+ from_chain: z.ZodOptional<z.ZodString>;
392
+ to_chain: z.ZodOptional<z.ZodString>;
393
+ protocol: z.ZodOptional<z.ZodString>;
394
+ leverage: z.ZodOptional<z.ZodString>;
395
+ direction: z.ZodOptional<z.ZodString>;
396
+ recipient: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>>;
398
+ }, z.core.$strip>>;
399
+ risks: z.ZodOptional<z.ZodObject<{
400
+ level: z.ZodEnum<{
401
+ low: "low";
402
+ medium: "medium";
403
+ high: "high";
404
+ critical: "critical";
405
+ }>;
406
+ warnings: z.ZodArray<z.ZodString>;
407
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
408
+ }, z.core.$strip>>;
409
+ }, z.core.$strip>, z.ZodObject<{
410
+ type: z.ZodLiteral<"interactive_card">;
411
+ title: z.ZodString;
412
+ body: z.ZodOptional<z.ZodString>;
413
+ style: z.ZodEnum<{
414
+ options: "options";
415
+ confirm_cancel: "confirm_cancel";
416
+ }>;
417
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
418
+ id: z.ZodString;
419
+ label: z.ZodString;
420
+ description: z.ZodOptional<z.ZodString>;
421
+ }, z.core.$strip>>>;
422
+ }, z.core.$strip>, z.ZodObject<{
423
+ type: z.ZodLiteral<"timeseries">;
424
+ title: z.ZodString;
425
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
426
+ label: z.ZodString;
427
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
428
+ }, z.core.$strip>>>;
429
+ }, z.core.$strip>, z.ZodObject<{
430
+ type: z.ZodLiteral<"pie_chart">;
431
+ title: z.ZodString;
432
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
433
+ }, z.core.$strip>], "type">;
434
+ }, z.core.$strip>], "type">>;
435
+ }, z.core.$strip>;
436
+ export declare const ResponseErrorSchema: z.ZodObject<{
437
+ message: z.ZodString;
438
+ type: z.ZodString;
439
+ code: z.ZodString;
440
+ }, z.core.$strip>;
441
+ export declare const ResponseSchema: z.ZodObject<{
442
+ id: z.ZodString;
443
+ object: z.ZodLiteral<"response">;
444
+ model: z.ZodString;
445
+ status: z.ZodEnum<{
446
+ completed: "completed";
447
+ failed: "failed";
448
+ }>;
449
+ output: z.ZodArray<z.ZodObject<{
450
+ type: z.ZodLiteral<"message">;
451
+ role: z.ZodLiteral<"assistant">;
452
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
453
+ type: z.ZodLiteral<"output_text">;
454
+ text: z.ZodString;
455
+ }, z.core.$strip>, z.ZodObject<{
456
+ type: z.ZodLiteral<"chaos.block">;
457
+ block: z.ZodDiscriminatedUnion<[z.ZodObject<{
458
+ type: z.ZodLiteral<"table">;
459
+ title: z.ZodString;
460
+ tableHeaders: z.ZodArray<z.ZodString>;
461
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
462
+ }, z.core.$strip>, z.ZodObject<{
463
+ type: z.ZodLiteral<"markdown">;
464
+ content: z.ZodString;
465
+ }, z.core.$strip>, z.ZodObject<{
466
+ type: z.ZodLiteral<"transaction_action">;
467
+ title: z.ZodString;
468
+ primitives: z.ZodArray<z.ZodObject<{
469
+ primitive: z.ZodString;
470
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
471
+ display: z.ZodOptional<z.ZodObject<{
472
+ headline: z.ZodString;
473
+ amount: z.ZodOptional<z.ZodString>;
474
+ action_verb: z.ZodOptional<z.ZodString>;
475
+ from_asset: z.ZodOptional<z.ZodString>;
476
+ to_asset: z.ZodOptional<z.ZodString>;
477
+ from_chain: z.ZodOptional<z.ZodString>;
478
+ to_chain: z.ZodOptional<z.ZodString>;
479
+ protocol: z.ZodOptional<z.ZodString>;
480
+ leverage: z.ZodOptional<z.ZodString>;
481
+ direction: z.ZodOptional<z.ZodString>;
482
+ recipient: z.ZodOptional<z.ZodString>;
483
+ }, z.core.$strip>>;
484
+ }, z.core.$strip>>;
485
+ risks: z.ZodOptional<z.ZodObject<{
486
+ level: z.ZodEnum<{
487
+ low: "low";
488
+ medium: "medium";
489
+ high: "high";
490
+ critical: "critical";
491
+ }>;
492
+ warnings: z.ZodArray<z.ZodString>;
493
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
494
+ }, z.core.$strip>>;
495
+ }, z.core.$strip>, z.ZodObject<{
496
+ type: z.ZodLiteral<"interactive_card">;
497
+ title: z.ZodString;
498
+ body: z.ZodOptional<z.ZodString>;
499
+ style: z.ZodEnum<{
500
+ options: "options";
501
+ confirm_cancel: "confirm_cancel";
502
+ }>;
503
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
504
+ id: z.ZodString;
505
+ label: z.ZodString;
506
+ description: z.ZodOptional<z.ZodString>;
507
+ }, z.core.$strip>>>;
508
+ }, z.core.$strip>, z.ZodObject<{
509
+ type: z.ZodLiteral<"timeseries">;
510
+ title: z.ZodString;
511
+ data: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
512
+ label: z.ZodString;
513
+ data: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
514
+ }, z.core.$strip>>>;
515
+ }, z.core.$strip>, z.ZodObject<{
516
+ type: z.ZodLiteral<"pie_chart">;
517
+ title: z.ZodString;
518
+ data: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber], null>>;
519
+ }, z.core.$strip>], "type">;
520
+ }, z.core.$strip>], "type">>;
521
+ }, z.core.$strip>>;
522
+ error: z.ZodOptional<z.ZodObject<{
523
+ message: z.ZodString;
524
+ type: z.ZodString;
525
+ code: z.ZodString;
526
+ }, z.core.$strip>>;
527
+ }, z.core.$strip>;
528
+ export type ChaosConfigInput = z.input<typeof ChaosConfigSchema>;
529
+ export type CreateResponseParamsInput = z.input<typeof CreateResponseParamsSchema>;
530
+ export type InputItemInput = z.input<typeof InputItemSchema>;
531
+ export type RequestMetadataInput = z.input<typeof RequestMetadataSchema>;
532
+ export type ResponseInput = z.input<typeof ResponseSchema>;
533
+ export type OutputItemInput = z.input<typeof OutputItemSchema>;
534
+ export type ContentPartInput = z.input<typeof ContentPartSchema>;
535
+ export type OutputTextInput = z.input<typeof OutputTextSchema>;
536
+ export type ChaosBlockInput = z.input<typeof ChaosBlockSchema>;
537
+ export type BlockInput = z.input<typeof BlockSchema>;
538
+ export type TableBlockInput = z.input<typeof TableBlockSchema>;
539
+ export type MarkdownBlockInput = z.input<typeof MarkdownBlockSchema>;
540
+ export type TransactionActionBlockInput = z.input<typeof TransactionActionBlockSchema>;
541
+ export type PrimitiveInput = z.input<typeof PrimitiveSchema>;
542
+ export type InteractiveCardBlockInput = z.input<typeof InteractiveCardBlockSchema>;
543
+ export type InteractiveOptionInput = z.input<typeof InteractiveOptionSchema>;
544
+ export type TimeseriesBlockInput = z.input<typeof TimeseriesBlockSchema>;
545
+ export type PieChartBlockInput = z.input<typeof PieChartBlockSchema>;
546
+ export type RisksInput = z.input<typeof RisksSchema>;
547
+ export type ResponseErrorInput = z.input<typeof ResponseErrorSchema>;
@@ -0,0 +1,143 @@
1
+ // Chaos AI SDK V1 - Zod Schemas
2
+ import { z } from "zod";
3
+ // ============================================================================
4
+ // Client Configuration
5
+ // ============================================================================
6
+ export const ChaosConfigSchema = z.object({
7
+ apiKey: z.string(),
8
+ baseUrl: z.string().optional(),
9
+ timeout: z.number().optional(),
10
+ });
11
+ // ============================================================================
12
+ // Request Types
13
+ // ============================================================================
14
+ export const InputItemSchema = z.object({
15
+ type: z.literal("message"),
16
+ role: z.enum(["user", "system"]),
17
+ content: z.string(),
18
+ });
19
+ export const RequestMetadataSchema = z.object({
20
+ user_id: z.string(),
21
+ session_id: z.string(),
22
+ wallet_id: z.string().optional(),
23
+ });
24
+ export const CreateResponseParamsSchema = z.object({
25
+ model: z.string(),
26
+ input: z.array(InputItemSchema),
27
+ stream: z.boolean().optional(),
28
+ metadata: RequestMetadataSchema,
29
+ });
30
+ // ============================================================================
31
+ // Block Types
32
+ // ============================================================================
33
+ export const TableCellValueSchema = z.union([z.string(), z.number()]);
34
+ export const TableBlockSchema = z.object({
35
+ type: z.literal("table"),
36
+ title: z.string(),
37
+ tableHeaders: z.array(z.string()),
38
+ rows: z.array(z.array(TableCellValueSchema)),
39
+ });
40
+ export const MarkdownBlockSchema = z.object({
41
+ type: z.literal("markdown"),
42
+ content: z.string(),
43
+ });
44
+ // Primitive params - accepts any JSON-compatible value
45
+ export const PrimitiveParamsSchema = z.record(z.string(), z.unknown());
46
+ export const PrimitiveDisplaySchema = z.object({
47
+ headline: z.string(),
48
+ amount: z.string().optional(),
49
+ action_verb: z.string().optional(),
50
+ from_asset: z.string().optional(),
51
+ to_asset: z.string().optional(),
52
+ from_chain: z.string().optional(),
53
+ to_chain: z.string().optional(),
54
+ protocol: z.string().optional(),
55
+ leverage: z.string().optional(),
56
+ direction: z.string().optional(),
57
+ recipient: z.string().optional(),
58
+ });
59
+ export const PrimitiveSchema = z.object({
60
+ primitive: z.string(),
61
+ params: PrimitiveParamsSchema,
62
+ display: PrimitiveDisplaySchema.optional(),
63
+ });
64
+ export const RisksSchema = z.object({
65
+ level: z.enum(["low", "medium", "high", "critical"]),
66
+ warnings: z.array(z.string()),
67
+ blockers: z.array(z.string()).optional(),
68
+ });
69
+ export const TransactionActionBlockSchema = z.object({
70
+ type: z.literal("transaction_action"),
71
+ title: z.string(),
72
+ primitives: z.array(PrimitiveSchema),
73
+ risks: RisksSchema.optional(),
74
+ });
75
+ export const InteractiveOptionSchema = z.object({
76
+ id: z.string(),
77
+ label: z.string(),
78
+ description: z.string().optional(),
79
+ });
80
+ export const InteractiveCardBlockSchema = z.object({
81
+ type: z.literal("interactive_card"),
82
+ title: z.string(),
83
+ body: z.string().optional(),
84
+ style: z.enum(["options", "confirm_cancel"]),
85
+ options: z.array(InteractiveOptionSchema).optional(),
86
+ });
87
+ export const TimeseriesDataPointSchema = z.tuple([z.number(), z.number()]);
88
+ export const TimeseriesSeriesSchema = z.object({
89
+ label: z.string(),
90
+ data: z.array(TimeseriesDataPointSchema),
91
+ });
92
+ export const TimeseriesDataSchema = z.record(z.string(), z.array(TimeseriesSeriesSchema));
93
+ export const TimeseriesBlockSchema = z.object({
94
+ type: z.literal("timeseries"),
95
+ title: z.string(),
96
+ data: TimeseriesDataSchema,
97
+ });
98
+ export const PieChartBlockSchema = z.object({
99
+ type: z.literal("pie_chart"),
100
+ title: z.string(),
101
+ data: z.array(z.tuple([z.string(), z.number()])),
102
+ });
103
+ export const BlockSchema = z.discriminatedUnion("type", [
104
+ TableBlockSchema,
105
+ MarkdownBlockSchema,
106
+ TransactionActionBlockSchema,
107
+ InteractiveCardBlockSchema,
108
+ TimeseriesBlockSchema,
109
+ PieChartBlockSchema,
110
+ ]);
111
+ // ============================================================================
112
+ // Response Types
113
+ // ============================================================================
114
+ export const OutputTextSchema = z.object({
115
+ type: z.literal("output_text"),
116
+ text: z.string(),
117
+ });
118
+ export const ChaosBlockSchema = z.object({
119
+ type: z.literal("chaos.block"),
120
+ block: BlockSchema,
121
+ });
122
+ export const ContentPartSchema = z.discriminatedUnion("type", [
123
+ OutputTextSchema,
124
+ ChaosBlockSchema,
125
+ ]);
126
+ export const OutputItemSchema = z.object({
127
+ type: z.literal("message"),
128
+ role: z.literal("assistant"),
129
+ content: z.array(ContentPartSchema),
130
+ });
131
+ export const ResponseErrorSchema = z.object({
132
+ message: z.string(),
133
+ type: z.string(),
134
+ code: z.string(),
135
+ });
136
+ export const ResponseSchema = z.object({
137
+ id: z.string(),
138
+ object: z.literal("response"),
139
+ model: z.string(),
140
+ status: z.enum(["completed", "failed"]),
141
+ output: z.array(OutputItemSchema),
142
+ error: ResponseErrorSchema.optional(),
143
+ });