@ingram-tech/ingram-cloud-sdk 0.1.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.
package/ts/schemas.ts ADDED
@@ -0,0 +1,1101 @@
1
+ import { z } from "zod";
2
+
3
+ type SpanOut = {
4
+ attributes?: {} | undefined;
5
+ children?: ((Array<SpanOut> | null) | Array<Array<SpanOut> | null>) | undefined;
6
+ cost?: ((number | null) | Array<number | null>) | undefined;
7
+ duration_ms?: ((number | null) | Array<number | null>) | undefined;
8
+ ended_at?: ((string | null) | Array<string | null>) | undefined;
9
+ id: string;
10
+ input_tokens?: ((number | null) | Array<number | null>) | undefined;
11
+ kind: string;
12
+ model?: ((string | null) | Array<string | null>) | undefined;
13
+ name?: ((string | null) | Array<string | null>) | undefined;
14
+ output_tokens?: ((number | null) | Array<number | null>) | undefined;
15
+ parent_span_id?: ((string | null) | Array<string | null>) | undefined;
16
+ started_at?: ((string | null) | Array<string | null>) | undefined;
17
+ status: string;
18
+ trace_id: string;
19
+ } & {
20
+ [key: string]: any;
21
+ };
22
+
23
+ const AgentDraftOut = z
24
+ .object({
25
+ auto_memory: z.union([z.boolean(), z.null()]).optional(),
26
+ enabled_hosted_tools: z.array(z.string()),
27
+ instructions: z.union([z.string(), z.null()]).optional(),
28
+ model: z.union([z.string(), z.null()]).optional(),
29
+ variables: z.array(z.object({}).partial().passthrough()),
30
+ })
31
+ .passthrough();
32
+ const AgentOut = z
33
+ .object({
34
+ active_version: z.union([z.number(), z.null()]).optional(),
35
+ created_at: z.union([z.string(), z.null()]).optional(),
36
+ draft: AgentDraftOut,
37
+ id: z.string(),
38
+ is_default: z.boolean(),
39
+ name: z.string(),
40
+ rollout_percent: z.union([z.number(), z.null()]).optional(),
41
+ rollout_version: z.union([z.number(), z.null()]).optional(),
42
+ slug: z.union([z.string(), z.null()]).optional(),
43
+ smith_count: z.union([z.number(), z.null()]).optional(),
44
+ updated_at: z.union([z.string(), z.null()]).optional(),
45
+ })
46
+ .passthrough();
47
+ const AgentListOut = z.object({ data: z.array(AgentOut) }).passthrough();
48
+ const AgentIn = z
49
+ .object({
50
+ auto_memory: z.union([z.boolean(), z.null()]).optional(),
51
+ enabled_hosted_tools: z.union([z.array(z.string()), z.null()]).optional(),
52
+ instructions: z.union([z.string(), z.null()]).optional(),
53
+ model: z.union([z.string(), z.null()]).optional(),
54
+ name: z.string(),
55
+ slug: z.union([z.string(), z.null()]).optional(),
56
+ variables: z
57
+ .union([z.array(z.object({}).partial().passthrough()), z.null()])
58
+ .optional(),
59
+ })
60
+ .passthrough();
61
+ const idempotency_key = z.union([z.string(), z.null()]).optional();
62
+ const ValidationError = z
63
+ .object({
64
+ ctx: z.object({}).partial().passthrough().optional(),
65
+ input: z.unknown().optional(),
66
+ loc: z.array(z.union([z.string(), z.number()])),
67
+ msg: z.string(),
68
+ type: z.string(),
69
+ })
70
+ .passthrough();
71
+ const HTTPValidationError = z
72
+ .object({ detail: z.array(ValidationError) })
73
+ .partial()
74
+ .passthrough();
75
+ const ImportIn = z.object({ from_smith: z.string(), name: z.string() }).passthrough();
76
+ const AgentPatch = z
77
+ .object({
78
+ auto_memory: z.union([z.boolean(), z.null()]),
79
+ enabled_hosted_tools: z.union([z.array(z.string()), z.null()]),
80
+ instructions: z.union([z.string(), z.null()]),
81
+ model: z.union([z.string(), z.null()]),
82
+ name: z.union([z.string(), z.null()]),
83
+ variables: z.union([z.array(z.object({}).partial().passthrough()), z.null()]),
84
+ })
85
+ .partial()
86
+ .passthrough();
87
+ const AttachIn = z
88
+ .object({
89
+ all: z.boolean().default(false),
90
+ smith_ids: z.union([z.array(z.string()), z.null()]),
91
+ })
92
+ .partial()
93
+ .passthrough();
94
+ const AttachedSmithOut = z
95
+ .object({ override_keys: z.array(z.string()), smith_id: z.string() })
96
+ .passthrough();
97
+ const AttachOut = z
98
+ .object({ attached: z.array(AttachedSmithOut), count: z.number().int() })
99
+ .passthrough();
100
+ const RolloutIn = z
101
+ .object({
102
+ percent: z.number().int().optional().default(100),
103
+ version: z.number().int(),
104
+ })
105
+ .passthrough();
106
+ const AgentVersionOut = z
107
+ .object({
108
+ created_at: z.union([z.string(), z.null()]).optional(),
109
+ created_by: z.union([z.string(), z.null()]).optional(),
110
+ note: z.union([z.string(), z.null()]).optional(),
111
+ snapshot: z.object({}).partial().passthrough(),
112
+ version: z.number().int(),
113
+ })
114
+ .passthrough();
115
+ const AgentVersionListOut = z.object({ data: z.array(AgentVersionOut) }).passthrough();
116
+ const PublishIn = z
117
+ .object({ note: z.union([z.string(), z.null()]) })
118
+ .partial()
119
+ .passthrough();
120
+ const publish_version_v1_agents__aid__versions_post_Body = z.union([
121
+ PublishIn,
122
+ z.null(),
123
+ ]);
124
+ const ApprovalOut = z
125
+ .object({
126
+ actor: z.union([z.string(), z.null()]).optional(),
127
+ args: z.object({}).partial().passthrough(),
128
+ created_at: z.union([z.string(), z.null()]).optional(),
129
+ id: z.string(),
130
+ reason: z.union([z.string(), z.null()]).optional(),
131
+ resolved_at: z.union([z.string(), z.null()]).optional(),
132
+ run_id: z.union([z.string(), z.null()]).optional(),
133
+ smith_id: z.union([z.string(), z.null()]).optional(),
134
+ status: z.string(),
135
+ tool: z.union([z.string(), z.null()]).optional(),
136
+ tool_call_id: z.union([z.string(), z.null()]).optional(),
137
+ })
138
+ .passthrough();
139
+ const ApprovalListOut = z.object({ data: z.array(ApprovalOut) }).passthrough();
140
+ const BudgetOut = z
141
+ .object({
142
+ action: z.string(),
143
+ created_at: z.union([z.string(), z.null()]).optional(),
144
+ id: z.string(),
145
+ limit_usd: z.number(),
146
+ period: z.string(),
147
+ scope: z.string(),
148
+ scope_id: z.union([z.string(), z.null()]).optional(),
149
+ })
150
+ .passthrough();
151
+ const BudgetListOut = z.object({ data: z.array(BudgetOut) }).passthrough();
152
+ const BudgetIn = z
153
+ .object({
154
+ action: z.string().optional().default("warn"),
155
+ limit_usd: z.number(),
156
+ period: z.string().optional().default("monthly"),
157
+ scope: z.string(),
158
+ scope_id: z.union([z.string(), z.null()]).optional(),
159
+ })
160
+ .passthrough();
161
+ const BudgetPatch = z
162
+ .object({
163
+ action: z.union([z.string(), z.null()]),
164
+ limit_usd: z.union([z.number(), z.null()]),
165
+ })
166
+ .partial()
167
+ .passthrough();
168
+ const BudgetStatusOut = z
169
+ .object({
170
+ action: z.string(),
171
+ created_at: z.union([z.string(), z.null()]).optional(),
172
+ id: z.string(),
173
+ limit_usd: z.number(),
174
+ over: z.boolean(),
175
+ pct: z.number(),
176
+ period: z.string(),
177
+ period_key: z.string(),
178
+ period_start: z.string(),
179
+ scope: z.string(),
180
+ scope_id: z.union([z.string(), z.null()]).optional(),
181
+ spent: z.number(),
182
+ })
183
+ .passthrough();
184
+ const CatalogAuthOut = z
185
+ .object({
186
+ client_mode: z.string(),
187
+ kind: z.string(),
188
+ provider: z.union([z.string(), z.null()]).optional(),
189
+ })
190
+ .passthrough();
191
+ const ApprovalRuleOut = z
192
+ .object({ match: z.string(), require: z.string() })
193
+ .passthrough();
194
+ const CatalogEntryOut = z
195
+ .object({
196
+ auth: CatalogAuthOut,
197
+ default_allowlist: z.union([z.array(z.string()), z.null()]).optional(),
198
+ default_approval_policy: z.array(ApprovalRuleOut),
199
+ description: z.string(),
200
+ display_name: z.string(),
201
+ docs_url: z.union([z.string(), z.null()]).optional(),
202
+ logo_url: z.union([z.string(), z.null()]).optional(),
203
+ mcp_url: z.string(),
204
+ scopes: z.array(z.string()),
205
+ slug: z.string(),
206
+ })
207
+ .passthrough();
208
+ const CatalogListOut = z.object({ data: z.array(CatalogEntryOut) }).passthrough();
209
+ const _Msg = z
210
+ .object({
211
+ content: z.unknown().optional(),
212
+ name: z.union([z.string(), z.null()]).optional(),
213
+ role: z.string(),
214
+ tool_call_id: z.union([z.string(), z.null()]).optional(),
215
+ })
216
+ .passthrough();
217
+ const _StreamOptions = z
218
+ .object({ include_usage: z.boolean().default(false) })
219
+ .partial()
220
+ .passthrough();
221
+ const ChatCompletionsIn = z
222
+ .object({
223
+ messages: z.array(_Msg).default([]),
224
+ model: z.string().default(""),
225
+ stream: z.boolean().default(false),
226
+ stream_options: z.union([_StreamOptions, z.null()]),
227
+ user: z.union([z.string(), z.null()]),
228
+ })
229
+ .partial()
230
+ .passthrough();
231
+ const CustomerOut = z
232
+ .object({
233
+ created_at: z.string(),
234
+ external_ids: z.object({}).partial().passthrough(),
235
+ id: z.string(),
236
+ metadata: z.object({}).partial().passthrough(),
237
+ name: z.string(),
238
+ smith_count: z.union([z.number(), z.null()]).optional(),
239
+ })
240
+ .passthrough();
241
+ const CustomerListOut = z
242
+ .object({
243
+ data: z.array(CustomerOut),
244
+ has_more: z.boolean(),
245
+ next_cursor: z.union([z.string(), z.null()]).optional(),
246
+ })
247
+ .passthrough();
248
+ const CustomerCreate = z
249
+ .object({
250
+ external_ids: z.object({}).partial().passthrough().optional().default({}),
251
+ metadata: z.object({}).partial().passthrough().optional().default({}),
252
+ name: z.string(),
253
+ })
254
+ .passthrough();
255
+ const CustomerPatch = z
256
+ .object({
257
+ external_ids: z.union([z.object({}).partial().passthrough(), z.null()]),
258
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
259
+ name: z.union([z.string(), z.null()]),
260
+ })
261
+ .partial()
262
+ .passthrough();
263
+ const EventOut = z
264
+ .object({
265
+ created_at: z.union([z.string(), z.null()]).optional(),
266
+ data: z.object({}).partial().passthrough().optional().default({}),
267
+ id: z.string(),
268
+ smith_id: z.union([z.string(), z.null()]).optional(),
269
+ type: z.string(),
270
+ v: z.number().int(),
271
+ })
272
+ .passthrough();
273
+ const EventListOut = z.object({ data: z.array(EventOut) }).passthrough();
274
+ const ProjectOut = z
275
+ .object({
276
+ archived_at: z.union([z.string(), z.null()]).optional(),
277
+ created_at: z.string(),
278
+ id: z.string(),
279
+ metadata: z.object({}).partial().passthrough(),
280
+ name: z.string(),
281
+ organization: z.string(),
282
+ })
283
+ .passthrough();
284
+ const ProjectListOut = z.object({ data: z.array(ProjectOut) }).passthrough();
285
+ const ProjectIn = z
286
+ .object({
287
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
288
+ name: z.string(),
289
+ })
290
+ .passthrough();
291
+ const ProjectTokenIn = z
292
+ .object({
293
+ name: z.union([z.string(), z.null()]),
294
+ ttl_seconds: z.union([z.number(), z.null()]),
295
+ })
296
+ .partial()
297
+ .passthrough();
298
+ const ResponsesIn = z
299
+ .object({
300
+ input: z.unknown(),
301
+ instructions: z.union([z.string(), z.null()]),
302
+ model: z.string().default(""),
303
+ previous_response_id: z.union([z.string(), z.null()]),
304
+ store: z.boolean().default(true),
305
+ stream: z.boolean().default(false),
306
+ user: z.union([z.string(), z.null()]),
307
+ })
308
+ .partial()
309
+ .passthrough();
310
+ const RunOut = z
311
+ .object({
312
+ channel: z.union([z.string(), z.null()]).optional(),
313
+ created_at: z.union([z.string(), z.null()]).optional(),
314
+ id: z.string(),
315
+ input: z.array(z.object({}).partial().passthrough()),
316
+ metadata: z.object({}).partial().passthrough(),
317
+ output: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
318
+ smith_id: z.string(),
319
+ status: z.string(),
320
+ stop_reason: z.union([z.string(), z.null()]).optional(),
321
+ thread_id: z.string(),
322
+ updated_at: z.union([z.string(), z.null()]).optional(),
323
+ usage: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
324
+ })
325
+ .passthrough();
326
+ const RunListOut = z.object({ data: z.array(RunOut) }).passthrough();
327
+ const SmithOut = z
328
+ .object({
329
+ agent_id: z.union([z.string(), z.null()]).optional(),
330
+ agent_version: z.union([z.number(), z.null()]).optional(),
331
+ auto_memory: z.union([z.boolean(), z.null()]).optional(),
332
+ config_source: z.string(),
333
+ created_at: z.union([z.string(), z.null()]).optional(),
334
+ customer_id: z.union([z.string(), z.null()]).optional(),
335
+ display_name: z.union([z.string(), z.null()]).optional(),
336
+ enabled_hosted_tools: z.array(z.unknown()),
337
+ external_id: z.union([z.string(), z.null()]).optional(),
338
+ id: z.string(),
339
+ instructions: z.union([z.string(), z.null()]).optional(),
340
+ locale: z.union([z.string(), z.null()]).optional(),
341
+ metadata: z.object({}).partial().passthrough(),
342
+ model: z.string(),
343
+ pin: z.union([z.number(), z.null()]).optional(),
344
+ rendered_instructions: z.union([z.string(), z.null()]).optional(),
345
+ timezone: z.union([z.string(), z.null()]).optional(),
346
+ })
347
+ .passthrough();
348
+ const SmithListOut = z
349
+ .object({
350
+ data: z.array(SmithOut),
351
+ has_more: z.boolean(),
352
+ next_cursor: z.union([z.string(), z.null()]).optional(),
353
+ })
354
+ .passthrough();
355
+ const SmithCreate = z
356
+ .object({
357
+ agent_id: z.union([z.string(), z.null()]),
358
+ auto_memory: z.union([z.boolean(), z.null()]),
359
+ customer_id: z.union([z.string(), z.null()]),
360
+ display_name: z.union([z.string(), z.null()]),
361
+ enabled_hosted_tools: z.union([z.array(z.string()), z.null()]),
362
+ external_id: z.union([z.string(), z.null()]),
363
+ instructions: z.union([z.string(), z.null()]),
364
+ locale: z.union([z.string(), z.null()]),
365
+ metadata: z.object({}).partial().passthrough().default({}),
366
+ model: z.union([z.string(), z.null()]),
367
+ pin: z.union([z.number(), z.null()]),
368
+ timezone: z.union([z.string(), z.null()]),
369
+ })
370
+ .partial()
371
+ .passthrough();
372
+ const SmithPatch = z
373
+ .object({
374
+ agent_id: z.union([z.string(), z.null()]),
375
+ auto_memory: z.union([z.boolean(), z.null()]),
376
+ customer_id: z.union([z.string(), z.null()]),
377
+ display_name: z.union([z.string(), z.null()]),
378
+ enabled_hosted_tools: z.union([z.array(z.string()), z.null()]),
379
+ instructions: z.union([z.string(), z.null()]),
380
+ locale: z.union([z.string(), z.null()]),
381
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
382
+ model: z.union([z.string(), z.null()]),
383
+ pin: z.union([z.number(), z.null()]),
384
+ timezone: z.union([z.string(), z.null()]),
385
+ })
386
+ .partial()
387
+ .passthrough();
388
+ const BlockOut = z
389
+ .object({
390
+ char_limit: z.union([z.number(), z.null()]).optional(),
391
+ description: z.union([z.string(), z.null()]).optional(),
392
+ id: z.string(),
393
+ label: z.string(),
394
+ updated_at: z.union([z.string(), z.null()]).optional(),
395
+ value: z.string(),
396
+ })
397
+ .passthrough();
398
+ const BlockListOut = z.object({ data: z.array(BlockOut) }).passthrough();
399
+ const BlockPatch = z
400
+ .object({ mode: z.string().optional().default("replace"), value: z.string() })
401
+ .passthrough();
402
+ const BlockSingleOut = z.object({ data: BlockOut }).passthrough();
403
+ const ChannelOut = z
404
+ .object({
405
+ address: z.union([z.string(), z.null()]).optional(),
406
+ created_at: z.union([z.string(), z.null()]).optional(),
407
+ id: z.string(),
408
+ kind: z.string(),
409
+ provider: z.union([z.string(), z.null()]).optional(),
410
+ provider_metadata: z.object({}).partial().passthrough(),
411
+ secret_keys: z.union([z.array(z.string()), z.null()]).optional(),
412
+ status: z.string(),
413
+ })
414
+ .passthrough();
415
+ const ChannelListOut = z.object({ data: z.array(ChannelOut) }).passthrough();
416
+ const ChannelIn = z
417
+ .object({
418
+ address: z.union([z.string(), z.null()]).optional(),
419
+ kind: z.string(),
420
+ provider: z.union([z.string(), z.null()]).optional(),
421
+ provider_metadata: z.object({}).partial().passthrough().optional().default({}),
422
+ secrets: z.object({}).partial().passthrough().optional().default({}),
423
+ setup: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
424
+ })
425
+ .passthrough();
426
+ const ChannelPatch = z
427
+ .object({
428
+ display_name: z.union([z.string(), z.null()]),
429
+ owner_email: z.union([z.string(), z.null()]),
430
+ })
431
+ .partial()
432
+ .passthrough();
433
+ const ConnectionOut = z
434
+ .object({
435
+ created_at: z.union([z.string(), z.null()]).optional(),
436
+ expires_at: z.union([z.string(), z.null()]).optional(),
437
+ id: z.string(),
438
+ metadata: z.object({}).partial().passthrough(),
439
+ provider: z.string(),
440
+ scopes: z.array(z.string()),
441
+ status: z.string(),
442
+ })
443
+ .passthrough();
444
+ const ConnectionListOut = z.object({ data: z.array(ConnectionOut) }).passthrough();
445
+ const Credential = z
446
+ .object({
447
+ access_token: z.union([z.string(), z.null()]),
448
+ expires_at: z.union([z.string(), z.null()]),
449
+ kind: z.string().default("oauth_tokens"),
450
+ refresh_token: z.union([z.string(), z.null()]),
451
+ token_uri: z.union([z.string(), z.null()]),
452
+ })
453
+ .partial()
454
+ .passthrough();
455
+ const ConnectionIn = z
456
+ .object({
457
+ credential: Credential,
458
+ metadata: z.object({}).partial().passthrough().optional().default({}),
459
+ provider: z.string(),
460
+ scopes: z.array(z.string()).optional().default([]),
461
+ })
462
+ .passthrough();
463
+ const AuthorizeIn = z
464
+ .object({
465
+ mcp_server: z.union([z.string(), z.null()]).optional(),
466
+ provider: z.string(),
467
+ return_url: z.union([z.string(), z.null()]).optional(),
468
+ })
469
+ .passthrough();
470
+ const AuthorizeOut = z
471
+ .object({
472
+ authorize_url: z.union([z.string(), z.null()]).optional(),
473
+ provider: z.string(),
474
+ })
475
+ .passthrough();
476
+ const ConnectionPatch = z
477
+ .object({
478
+ credential: z.union([Credential, z.null()]),
479
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
480
+ scopes: z.union([z.array(z.string()), z.null()]),
481
+ status: z.union([z.string(), z.null()]),
482
+ })
483
+ .partial()
484
+ .passthrough();
485
+ const MemoryOut = z
486
+ .object({
487
+ category: z.union([z.string(), z.null()]).optional(),
488
+ confidence: z.union([z.number(), z.null()]).optional(),
489
+ content: z.union([z.string(), z.null()]).optional(),
490
+ created_at: z.union([z.string(), z.null()]).optional(),
491
+ id: z.string(),
492
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
493
+ score: z.union([z.number(), z.null()]).optional(),
494
+ source: z.union([z.string(), z.null()]).optional(),
495
+ subject: z.union([z.string(), z.null()]).optional(),
496
+ updated_at: z.union([z.string(), z.null()]).optional(),
497
+ })
498
+ .passthrough();
499
+ const MemoryListOut = z
500
+ .object({ data: z.array(MemoryOut), has_more: z.boolean() })
501
+ .passthrough();
502
+ const MemoryIn = z
503
+ .object({
504
+ category: z.union([z.string(), z.null()]).optional(),
505
+ confidence: z.union([z.number(), z.null()]).optional(),
506
+ content: z.string(),
507
+ metadata: z.object({}).partial().passthrough().optional().default({}),
508
+ source: z.union([z.string(), z.null()]).optional(),
509
+ subject: z.union([z.string(), z.null()]).optional(),
510
+ })
511
+ .passthrough();
512
+ const MemoryBatch = z.object({ memories: z.array(MemoryIn) }).passthrough();
513
+ const MemoryBatchOut = z.object({ memories: z.array(MemoryOut) }).passthrough();
514
+ const SearchBody = z
515
+ .object({
516
+ categories: z.union([z.array(z.string()), z.null()]).optional(),
517
+ limit: z.number().int().optional().default(10),
518
+ query: z.string(),
519
+ })
520
+ .passthrough();
521
+ const MemorySearchOut = z.object({ data: z.array(MemoryOut) }).passthrough();
522
+ const MemoryPatch = z
523
+ .object({
524
+ category: z.union([z.string(), z.null()]),
525
+ confidence: z.union([z.number(), z.null()]),
526
+ content: z.union([z.string(), z.null()]),
527
+ metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
528
+ source: z.union([z.string(), z.null()]),
529
+ subject: z.union([z.string(), z.null()]),
530
+ })
531
+ .partial()
532
+ .passthrough();
533
+ const RevisionOut = z
534
+ .object({
535
+ created_at: z.union([z.string(), z.null()]).optional(),
536
+ created_by: z.union([z.string(), z.null()]).optional(),
537
+ note: z.union([z.string(), z.null()]).optional(),
538
+ snapshot: z.object({}).partial().passthrough(),
539
+ version: z.number().int(),
540
+ })
541
+ .passthrough();
542
+ const RevisionListOut = z.object({ data: z.array(RevisionOut) }).passthrough();
543
+ const RestoreIn = z
544
+ .object({ note: z.union([z.string(), z.null()]) })
545
+ .partial()
546
+ .passthrough();
547
+ const restore_version_v1_smiths__pid__revisions__version__restore_post_Body = z.union([
548
+ RestoreIn,
549
+ z.null(),
550
+ ]);
551
+ const RunIn = z
552
+ .object({
553
+ channel: z.string().default("api"),
554
+ input: z.array(z.object({}).partial().passthrough()).default([]),
555
+ metadata: z.object({}).partial().passthrough().default({}),
556
+ response_format: z.union([z.object({}).partial().passthrough(), z.null()]),
557
+ stream: z.boolean().default(false),
558
+ thread_id: z.union([z.string(), z.null()]),
559
+ })
560
+ .partial()
561
+ .passthrough();
562
+ const Submit = z
563
+ .object({
564
+ actor: z.union([z.string(), z.null()]).optional(),
565
+ approval_id: z.union([z.string(), z.null()]).optional(),
566
+ decision: z.union([z.string(), z.null()]).optional(),
567
+ kind: z.string(),
568
+ reason: z.union([z.string(), z.null()]).optional(),
569
+ result: z.union([z.object({}).partial().passthrough(), z.null()]).optional(),
570
+ stream: z.boolean().optional().default(false),
571
+ tool_call_id: z.union([z.string(), z.null()]).optional(),
572
+ })
573
+ .passthrough();
574
+ const ScheduleOut = z
575
+ .object({
576
+ created_at: z.union([z.string(), z.null()]).optional(),
577
+ cron: z.string(),
578
+ enabled: z.boolean(),
579
+ id: z.string(),
580
+ input: z.array(z.object({}).partial().passthrough()),
581
+ last_fire_at: z.union([z.string(), z.null()]).optional(),
582
+ max_concurrent: z.number().int(),
583
+ name: z.union([z.string(), z.null()]).optional(),
584
+ next_fire_at: z.union([z.string(), z.null()]).optional(),
585
+ on_failure: z.string(),
586
+ thread_id: z.union([z.string(), z.null()]).optional(),
587
+ timezone: z.string(),
588
+ })
589
+ .passthrough();
590
+ const ScheduleListOut = z.object({ data: z.array(ScheduleOut) }).passthrough();
591
+ const ScheduleIn = z
592
+ .object({
593
+ cron: z.string(),
594
+ enabled: z.boolean().optional().default(true),
595
+ input: z.array(z.object({}).partial().passthrough()).optional().default([]),
596
+ max_concurrent: z.number().int().optional().default(1),
597
+ name: z.union([z.string(), z.null()]).optional(),
598
+ on_failure: z.string().optional().default("webhook"),
599
+ thread_id: z.union([z.string(), z.null()]).optional(),
600
+ timezone: z.string().optional().default("UTC"),
601
+ })
602
+ .passthrough();
603
+ const SchedulePatch = z
604
+ .object({
605
+ cron: z.union([z.string(), z.null()]),
606
+ enabled: z.union([z.boolean(), z.null()]),
607
+ input: z.union([z.array(z.object({}).partial().passthrough()), z.null()]),
608
+ max_concurrent: z.union([z.number(), z.null()]),
609
+ name: z.union([z.string(), z.null()]),
610
+ on_failure: z.union([z.string(), z.null()]),
611
+ thread_id: z.union([z.string(), z.null()]),
612
+ timezone: z.union([z.string(), z.null()]),
613
+ })
614
+ .partial()
615
+ .passthrough();
616
+ const ScheduleRunNowOut = z
617
+ .object({
618
+ run: z.object({}).partial().passthrough(),
619
+ schedule_id: z.string(),
620
+ })
621
+ .passthrough();
622
+ const EmailConfigIn = z
623
+ .object({
624
+ cloudflare_account_id: z.string(),
625
+ cloudflare_api_token: z.string(),
626
+ display_name: z.union([z.string(), z.null()]).optional(),
627
+ from_domain: z.string(),
628
+ inbound_secret: z.union([z.string(), z.null()]).optional(),
629
+ })
630
+ .passthrough();
631
+ const SuppressionIn = z
632
+ .object({
633
+ address: z.string(),
634
+ reason: z.string().optional().default("manual"),
635
+ })
636
+ .passthrough();
637
+ const HostedToolsListOut = z
638
+ .object({ data: z.array(z.object({}).partial().passthrough()) })
639
+ .passthrough();
640
+ const MCPAuth = z
641
+ .object({
642
+ client_mode: z.union([z.string(), z.null()]),
643
+ kind: z.union([z.string(), z.null()]),
644
+ provider: z.union([z.string(), z.null()]),
645
+ secret: z.union([z.string(), z.null()]),
646
+ })
647
+ .partial()
648
+ .passthrough();
649
+ const MCPServerIn = z
650
+ .object({
651
+ approval_policy: z.union([
652
+ z.array(z.object({}).partial().passthrough()),
653
+ z.null(),
654
+ ]),
655
+ auth: z.union([MCPAuth, z.null()]),
656
+ catalog: z.union([z.string(), z.null()]),
657
+ tool_allowlist: z.union([z.array(z.string()), z.null()]),
658
+ url: z.union([z.string(), z.null()]),
659
+ })
660
+ .partial()
661
+ .passthrough();
662
+ const ModelKeyOut = z
663
+ .object({
664
+ base_url: z.union([z.string(), z.null()]).optional(),
665
+ has_key: z.boolean(),
666
+ provider: z.string(),
667
+ updated_at: z.union([z.string(), z.null()]).optional(),
668
+ })
669
+ .passthrough();
670
+ const ModelKeyListOut = z.object({ data: z.array(ModelKeyOut) }).passthrough();
671
+ const ModelKeyIn = z
672
+ .object({
673
+ api_key: z.string(),
674
+ base_url: z.union([z.string(), z.null()]).optional(),
675
+ })
676
+ .passthrough();
677
+ const ModelKeyConfiguredOut = z
678
+ .object({
679
+ base_url: z.union([z.string(), z.null()]).optional(),
680
+ configured: z.boolean(),
681
+ provider: z.string(),
682
+ })
683
+ .passthrough();
684
+ const ModelOut = z
685
+ .object({
686
+ available: z.boolean(),
687
+ source: z.union([z.string(), z.null()]).optional(),
688
+ })
689
+ .passthrough();
690
+ const ModelProviderOut = z
691
+ .object({
692
+ base_url: z.boolean(),
693
+ id: z.string(),
694
+ label: z.string(),
695
+ platform_key: z.boolean(),
696
+ })
697
+ .passthrough();
698
+ const ModelsListOut = z
699
+ .object({ data: z.array(ModelOut), providers: z.array(ModelProviderOut) })
700
+ .passthrough();
701
+ const ProviderOut = z
702
+ .object({
703
+ client_id: z.union([z.string(), z.null()]).optional(),
704
+ has_client_secret: z.boolean(),
705
+ provider: z.string(),
706
+ refresh_webhook: z.union([z.string(), z.null()]).optional(),
707
+ scopes_allowed: z.array(z.string()).optional().default([]),
708
+ token_uri: z.union([z.string(), z.null()]).optional(),
709
+ })
710
+ .passthrough();
711
+ const ProviderListOut = z.object({ data: z.array(ProviderOut) }).passthrough();
712
+ const ProviderIn = z
713
+ .object({
714
+ client_id: z.union([z.string(), z.null()]),
715
+ client_secret: z.union([z.string(), z.null()]),
716
+ refresh_webhook: z.union([z.string(), z.null()]),
717
+ scopes_allowed: z.array(z.string()).default([]),
718
+ token_uri: z.union([z.string(), z.null()]),
719
+ })
720
+ .partial()
721
+ .passthrough();
722
+ const ProviderConfiguredOut = z
723
+ .object({ configured: z.boolean(), provider: z.string() })
724
+ .passthrough();
725
+ const SlackFactoryIn = z
726
+ .object({
727
+ config_refresh_token: z.union([z.string(), z.null()]).optional(),
728
+ config_token: z.string(),
729
+ manifest_template: z.object({}).partial().passthrough(),
730
+ })
731
+ .passthrough();
732
+ const SlackAppIn = z
733
+ .object({
734
+ bot_token: z.union([z.string(), z.null()]),
735
+ client_id: z.union([z.string(), z.null()]),
736
+ client_secret: z.union([z.string(), z.null()]),
737
+ factory: z.union([SlackFactoryIn, z.null()]),
738
+ oauth_scopes: z.union([z.string(), z.null()]),
739
+ oauth_user_scopes: z.union([z.string(), z.null()]),
740
+ return_url: z.union([z.string(), z.null()]),
741
+ signing_secret: z.union([z.string(), z.null()]),
742
+ })
743
+ .partial()
744
+ .passthrough();
745
+ const TelegramBotIn = z
746
+ .object({
747
+ bot_token: z.string(),
748
+ webhook_secret: z.union([z.string(), z.null()]).optional(),
749
+ })
750
+ .passthrough();
751
+ const TokenSummaryOut = z
752
+ .object({
753
+ created_at: z.union([z.string(), z.null()]).optional(),
754
+ expires_at: z.union([z.string(), z.null()]).optional(),
755
+ id: z.string(),
756
+ name: z.union([z.string(), z.null()]).optional(),
757
+ prefix: z.union([z.string(), z.null()]).optional(),
758
+ revoked_at: z.union([z.string(), z.null()]).optional(),
759
+ scopes: z.array(z.string()).optional().default([]),
760
+ sub: z.union([z.string(), z.null()]).optional(),
761
+ })
762
+ .passthrough();
763
+ const TokenListOut = z.object({ data: z.array(TokenSummaryOut) }).passthrough();
764
+ const TokenIn = z
765
+ .object({
766
+ name: z.union([z.string(), z.null()]),
767
+ permissions: z.union([z.array(z.string()), z.null()]),
768
+ scope: z.string().default("smith"),
769
+ smith_id: z.union([z.string(), z.null()]),
770
+ ttl_seconds: z.union([z.number(), z.null()]),
771
+ })
772
+ .partial()
773
+ .passthrough();
774
+ const TokenOut = z
775
+ .object({
776
+ expires_at: z.union([z.string(), z.null()]).optional(),
777
+ id: z.string(),
778
+ scope: z.string(),
779
+ scopes: z.array(z.string()).optional().default([]),
780
+ sub: z.string(),
781
+ token: z.string(),
782
+ })
783
+ .passthrough();
784
+ const UsageSeriesPointOut = z
785
+ .object({
786
+ date: z.string(),
787
+ runs: z.number().int(),
788
+ total_tokens: z.number().int(),
789
+ })
790
+ .passthrough();
791
+ const v1__tenant__UsageTotalsOut = z
792
+ .object({
793
+ input_tokens: z.number().int(),
794
+ output_tokens: z.number().int(),
795
+ runs: z.number().int(),
796
+ total_tokens: z.number().int(),
797
+ })
798
+ .passthrough();
799
+ const v1__tenant__UsageOut = z
800
+ .object({
801
+ series: z.array(UsageSeriesPointOut),
802
+ totals: v1__tenant__UsageTotalsOut,
803
+ })
804
+ .passthrough();
805
+ const WebhookOut = z
806
+ .object({
807
+ active: z.boolean(),
808
+ created_at: z.union([z.string(), z.null()]).optional(),
809
+ events: z.array(z.string()).optional().default([]),
810
+ id: z.string(),
811
+ url: z.string(),
812
+ })
813
+ .passthrough();
814
+ const WebhookListOut = z.object({ data: z.array(WebhookOut) }).passthrough();
815
+ const WebhookIn = z
816
+ .object({
817
+ active: z.boolean().optional().default(true),
818
+ events: z.array(z.string()).optional().default([]),
819
+ url: z.string(),
820
+ })
821
+ .passthrough();
822
+ const WebhookCreateOut = z
823
+ .object({
824
+ active: z.boolean(),
825
+ events: z.array(z.string()).optional().default([]),
826
+ id: z.string(),
827
+ secret: z.string(),
828
+ url: z.string(),
829
+ })
830
+ .passthrough();
831
+ const WebhookPatch = z
832
+ .object({
833
+ active: z.union([z.boolean(), z.null()]),
834
+ events: z.union([z.array(z.string()), z.null()]),
835
+ url: z.union([z.string(), z.null()]),
836
+ })
837
+ .partial()
838
+ .passthrough();
839
+ const WebhookIdOut = z.object({ id: z.string() }).passthrough();
840
+ const WebhookTestOut = z.object({ delivered: z.boolean() }).passthrough();
841
+ const WhatsAppConfigIn = z
842
+ .object({
843
+ access_token: z.string(),
844
+ app_secret: z.union([z.string(), z.null()]).optional(),
845
+ business_id: z.union([z.string(), z.null()]).optional(),
846
+ phone_number_id: z.string(),
847
+ verify_token: z.union([z.string(), z.null()]).optional(),
848
+ })
849
+ .passthrough();
850
+ const SpanOut: z.ZodType<SpanOut> = z.lazy(() =>
851
+ z
852
+ .object({
853
+ attributes: z.object({}).partial().passthrough().optional().default({}),
854
+ children: z.union([z.array(SpanOut), z.null()]).optional(),
855
+ cost: z.union([z.number(), z.null()]).optional(),
856
+ duration_ms: z.union([z.number(), z.null()]).optional(),
857
+ ended_at: z.union([z.string(), z.null()]).optional(),
858
+ id: z.string(),
859
+ input_tokens: z.union([z.number(), z.null()]).optional(),
860
+ kind: z.string(),
861
+ model: z.union([z.string(), z.null()]).optional(),
862
+ name: z.union([z.string(), z.null()]).optional(),
863
+ output_tokens: z.union([z.number(), z.null()]).optional(),
864
+ parent_span_id: z.union([z.string(), z.null()]).optional(),
865
+ started_at: z.union([z.string(), z.null()]).optional(),
866
+ status: z.string(),
867
+ trace_id: z.string(),
868
+ })
869
+ .passthrough(),
870
+ );
871
+ const TraceOut = z
872
+ .object({
873
+ app_id: z.union([z.string(), z.null()]).optional(),
874
+ attributes: z.object({}).partial().passthrough().optional().default({}),
875
+ duration_ms: z.union([z.number(), z.null()]).optional(),
876
+ ended_at: z.union([z.string(), z.null()]).optional(),
877
+ id: z.string(),
878
+ name: z.union([z.string(), z.null()]).optional(),
879
+ root_kind: z.union([z.string(), z.null()]).optional(),
880
+ smith_id: z.union([z.string(), z.null()]).optional(),
881
+ span_tree: z.union([z.array(SpanOut), z.null()]).optional(),
882
+ spans: z.union([z.array(SpanOut), z.null()]).optional(),
883
+ started_at: z.union([z.string(), z.null()]).optional(),
884
+ status: z.union([z.string(), z.null()]).optional(),
885
+ total_cost: z.union([z.number(), z.null()]).optional(),
886
+ total_tokens: z.union([z.number(), z.null()]).optional(),
887
+ })
888
+ .passthrough();
889
+ const TraceListOut = z.object({ data: z.array(TraceOut) }).passthrough();
890
+ const SpanIn = z
891
+ .object({
892
+ app_id: z.union([z.string(), z.null()]),
893
+ attributes: z.object({}).partial().passthrough().default({}),
894
+ cache_read_tokens: z.union([z.number(), z.null()]),
895
+ cache_write_tokens: z.union([z.number(), z.null()]),
896
+ duration_ms: z.union([z.number(), z.null()]),
897
+ ended_at: z.union([z.string(), z.null()]),
898
+ input_tokens: z.union([z.number(), z.null()]),
899
+ kind: z.string().default("runtime_event"),
900
+ model: z.union([z.string(), z.null()]),
901
+ name: z.union([z.string(), z.null()]),
902
+ open_trace: z.boolean().default(false),
903
+ output_tokens: z.union([z.number(), z.null()]),
904
+ parent_span_id: z.union([z.string(), z.null()]),
905
+ smith_id: z.union([z.string(), z.null()]),
906
+ span_id: z.union([z.string(), z.null()]),
907
+ started_at: z.union([z.string(), z.null()]),
908
+ status: z.string().default("ok"),
909
+ trace_id: z.union([z.string(), z.null()]),
910
+ })
911
+ .partial()
912
+ .passthrough();
913
+ const IngestIn = z
914
+ .object({ spans: z.array(SpanIn).default([]) })
915
+ .partial()
916
+ .passthrough();
917
+ const IngestOut = z.object({ accepted: z.number().int() }).passthrough();
918
+ const UsageGroupOut = z
919
+ .object({
920
+ cost: z.number(),
921
+ run_count: z.number().int(),
922
+ tokens: z.number().int(),
923
+ })
924
+ .passthrough();
925
+ const UsageMeterOut = z
926
+ .object({
927
+ customer: z.union([z.string(), z.null()]).optional(),
928
+ events: z.number().int(),
929
+ meter: z.string(),
930
+ quantity: z.number(),
931
+ })
932
+ .passthrough();
933
+ const v1__observability__UsageTotalsOut = z
934
+ .object({
935
+ cost: z.number(),
936
+ run_count: z.number().int(),
937
+ tokens: z.number().int(),
938
+ })
939
+ .passthrough();
940
+ const v1__observability__UsageOut = z
941
+ .object({
942
+ group_by: z.string(),
943
+ groups: z.array(UsageGroupOut),
944
+ meters: z.array(UsageMeterOut),
945
+ totals: v1__observability__UsageTotalsOut,
946
+ })
947
+ .passthrough();
948
+ const UsageEventOut = z
949
+ .object({
950
+ created_at: z.union([z.string(), z.null()]).optional(),
951
+ customer_id: z.union([z.string(), z.null()]).optional(),
952
+ day: z.string(),
953
+ id: z.string(),
954
+ metadata: z.object({}).partial().passthrough().optional().default({}),
955
+ meter: z.string(),
956
+ quantity: z.number(),
957
+ smith_id: z.union([z.string(), z.null()]).optional(),
958
+ })
959
+ .passthrough();
960
+ const UsageEventListOut = z.object({ data: z.array(UsageEventOut) }).passthrough();
961
+ const UsageEventIn = z
962
+ .object({
963
+ idempotency_key: z.union([z.string(), z.null()]).optional(),
964
+ metadata: z.object({}).partial().passthrough().optional().default({}),
965
+ meter: z.string(),
966
+ quantity: z.number().optional().default(1),
967
+ smith_id: z.union([z.string(), z.null()]).optional(),
968
+ })
969
+ .passthrough();
970
+
971
+ export const schemas = {
972
+ AgentDraftOut,
973
+ AgentOut,
974
+ AgentListOut,
975
+ AgentIn,
976
+ idempotency_key,
977
+ ValidationError,
978
+ HTTPValidationError,
979
+ ImportIn,
980
+ AgentPatch,
981
+ AttachIn,
982
+ AttachedSmithOut,
983
+ AttachOut,
984
+ RolloutIn,
985
+ AgentVersionOut,
986
+ AgentVersionListOut,
987
+ PublishIn,
988
+ publish_version_v1_agents__aid__versions_post_Body,
989
+ ApprovalOut,
990
+ ApprovalListOut,
991
+ BudgetOut,
992
+ BudgetListOut,
993
+ BudgetIn,
994
+ BudgetPatch,
995
+ BudgetStatusOut,
996
+ CatalogAuthOut,
997
+ ApprovalRuleOut,
998
+ CatalogEntryOut,
999
+ CatalogListOut,
1000
+ _Msg,
1001
+ _StreamOptions,
1002
+ ChatCompletionsIn,
1003
+ CustomerOut,
1004
+ CustomerListOut,
1005
+ CustomerCreate,
1006
+ CustomerPatch,
1007
+ EventOut,
1008
+ EventListOut,
1009
+ ProjectOut,
1010
+ ProjectListOut,
1011
+ ProjectIn,
1012
+ ProjectTokenIn,
1013
+ ResponsesIn,
1014
+ RunOut,
1015
+ RunListOut,
1016
+ SmithOut,
1017
+ SmithListOut,
1018
+ SmithCreate,
1019
+ SmithPatch,
1020
+ BlockOut,
1021
+ BlockListOut,
1022
+ BlockPatch,
1023
+ BlockSingleOut,
1024
+ ChannelOut,
1025
+ ChannelListOut,
1026
+ ChannelIn,
1027
+ ChannelPatch,
1028
+ ConnectionOut,
1029
+ ConnectionListOut,
1030
+ Credential,
1031
+ ConnectionIn,
1032
+ AuthorizeIn,
1033
+ AuthorizeOut,
1034
+ ConnectionPatch,
1035
+ MemoryOut,
1036
+ MemoryListOut,
1037
+ MemoryIn,
1038
+ MemoryBatch,
1039
+ MemoryBatchOut,
1040
+ SearchBody,
1041
+ MemorySearchOut,
1042
+ MemoryPatch,
1043
+ RevisionOut,
1044
+ RevisionListOut,
1045
+ RestoreIn,
1046
+ restore_version_v1_smiths__pid__revisions__version__restore_post_Body,
1047
+ RunIn,
1048
+ Submit,
1049
+ ScheduleOut,
1050
+ ScheduleListOut,
1051
+ ScheduleIn,
1052
+ SchedulePatch,
1053
+ ScheduleRunNowOut,
1054
+ EmailConfigIn,
1055
+ SuppressionIn,
1056
+ HostedToolsListOut,
1057
+ MCPAuth,
1058
+ MCPServerIn,
1059
+ ModelKeyOut,
1060
+ ModelKeyListOut,
1061
+ ModelKeyIn,
1062
+ ModelKeyConfiguredOut,
1063
+ ModelOut,
1064
+ ModelProviderOut,
1065
+ ModelsListOut,
1066
+ ProviderOut,
1067
+ ProviderListOut,
1068
+ ProviderIn,
1069
+ ProviderConfiguredOut,
1070
+ SlackFactoryIn,
1071
+ SlackAppIn,
1072
+ TelegramBotIn,
1073
+ TokenSummaryOut,
1074
+ TokenListOut,
1075
+ TokenIn,
1076
+ TokenOut,
1077
+ UsageSeriesPointOut,
1078
+ v1__tenant__UsageTotalsOut,
1079
+ v1__tenant__UsageOut,
1080
+ WebhookOut,
1081
+ WebhookListOut,
1082
+ WebhookIn,
1083
+ WebhookCreateOut,
1084
+ WebhookPatch,
1085
+ WebhookIdOut,
1086
+ WebhookTestOut,
1087
+ WhatsAppConfigIn,
1088
+ SpanOut,
1089
+ TraceOut,
1090
+ TraceListOut,
1091
+ SpanIn,
1092
+ IngestIn,
1093
+ IngestOut,
1094
+ UsageGroupOut,
1095
+ UsageMeterOut,
1096
+ v1__observability__UsageTotalsOut,
1097
+ v1__observability__UsageOut,
1098
+ UsageEventOut,
1099
+ UsageEventListOut,
1100
+ UsageEventIn,
1101
+ };