optio-contracts 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.
@@ -0,0 +1,1681 @@
1
+ import { z } from 'zod';
2
+ export declare const processesContract: {
3
+ list: {
4
+ query: z.ZodObject<{
5
+ cursor: z.ZodOptional<z.ZodString>;
6
+ limit: z.ZodDefault<z.ZodNumber>;
7
+ } & {
8
+ rootId: z.ZodOptional<z.ZodString>;
9
+ state: z.ZodOptional<z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>>;
10
+ database: z.ZodOptional<z.ZodString>;
11
+ prefix: z.ZodOptional<z.ZodString>;
12
+ metadataFilter: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, any, string>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ limit: number;
15
+ cursor?: string | undefined;
16
+ state?: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled" | undefined;
17
+ rootId?: string | undefined;
18
+ database?: string | undefined;
19
+ prefix?: string | undefined;
20
+ metadataFilter?: Record<string, unknown> | undefined;
21
+ }, {
22
+ cursor?: string | undefined;
23
+ limit?: number | undefined;
24
+ state?: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled" | undefined;
25
+ rootId?: string | undefined;
26
+ database?: string | undefined;
27
+ prefix?: string | undefined;
28
+ metadataFilter?: string | undefined;
29
+ }>;
30
+ summary: "List and filter processes";
31
+ method: "GET";
32
+ path: "/processes";
33
+ responses: {
34
+ 200: z.ZodObject<{
35
+ items: z.ZodArray<z.ZodObject<{
36
+ _id: z.ZodString;
37
+ processId: z.ZodString;
38
+ name: z.ZodString;
39
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
40
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
+ parentId: z.ZodOptional<z.ZodString>;
42
+ rootId: z.ZodString;
43
+ depth: z.ZodNumber;
44
+ order: z.ZodNumber;
45
+ cancellable: z.ZodBoolean;
46
+ special: z.ZodOptional<z.ZodBoolean>;
47
+ warning: z.ZodOptional<z.ZodString>;
48
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ status: z.ZodObject<{
50
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
51
+ error: z.ZodOptional<z.ZodString>;
52
+ runningSince: z.ZodOptional<z.ZodDate>;
53
+ doneAt: z.ZodOptional<z.ZodDate>;
54
+ duration: z.ZodOptional<z.ZodNumber>;
55
+ failedAt: z.ZodOptional<z.ZodDate>;
56
+ stoppedAt: z.ZodOptional<z.ZodDate>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
59
+ error?: string | undefined;
60
+ runningSince?: Date | undefined;
61
+ doneAt?: Date | undefined;
62
+ duration?: number | undefined;
63
+ failedAt?: Date | undefined;
64
+ stoppedAt?: Date | undefined;
65
+ }, {
66
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
67
+ error?: string | undefined;
68
+ runningSince?: Date | undefined;
69
+ doneAt?: Date | undefined;
70
+ duration?: number | undefined;
71
+ failedAt?: Date | undefined;
72
+ stoppedAt?: Date | undefined;
73
+ }>;
74
+ progress: z.ZodObject<{
75
+ percent: z.ZodNullable<z.ZodNumber>;
76
+ message: z.ZodOptional<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ percent: number | null;
79
+ message?: string | undefined;
80
+ }, {
81
+ percent: number | null;
82
+ message?: string | undefined;
83
+ }>;
84
+ log: z.ZodArray<z.ZodObject<{
85
+ timestamp: z.ZodDate;
86
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
87
+ message: z.ZodString;
88
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ message: string;
91
+ timestamp: Date;
92
+ level: "error" | "event" | "info" | "debug" | "warning";
93
+ data?: Record<string, unknown> | undefined;
94
+ }, {
95
+ message: string;
96
+ timestamp: Date;
97
+ level: "error" | "event" | "info" | "debug" | "warning";
98
+ data?: Record<string, unknown> | undefined;
99
+ }>, "many">;
100
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
+ widgetData: z.ZodOptional<z.ZodUnknown>;
102
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
103
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
104
+ createdAt: z.ZodDate;
105
+ }, "strip", z.ZodTypeAny, {
106
+ status: {
107
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
108
+ error?: string | undefined;
109
+ runningSince?: Date | undefined;
110
+ doneAt?: Date | undefined;
111
+ duration?: number | undefined;
112
+ failedAt?: Date | undefined;
113
+ stoppedAt?: Date | undefined;
114
+ };
115
+ _id: string;
116
+ processId: string;
117
+ name: string;
118
+ rootId: string;
119
+ depth: number;
120
+ order: number;
121
+ cancellable: boolean;
122
+ progress: {
123
+ percent: number | null;
124
+ message?: string | undefined;
125
+ };
126
+ log: {
127
+ message: string;
128
+ timestamp: Date;
129
+ level: "error" | "event" | "info" | "debug" | "warning";
130
+ data?: Record<string, unknown> | undefined;
131
+ }[];
132
+ createdAt: Date;
133
+ params?: Record<string, unknown> | undefined;
134
+ warning?: string | undefined;
135
+ metadata?: Record<string, unknown> | undefined;
136
+ parentId?: string | undefined;
137
+ special?: boolean | undefined;
138
+ description?: string | null | undefined;
139
+ uiWidget?: string | null | undefined;
140
+ widgetData?: unknown;
141
+ supportsResume?: boolean | undefined;
142
+ hasSavedState?: boolean | undefined;
143
+ }, {
144
+ status: {
145
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
146
+ error?: string | undefined;
147
+ runningSince?: Date | undefined;
148
+ doneAt?: Date | undefined;
149
+ duration?: number | undefined;
150
+ failedAt?: Date | undefined;
151
+ stoppedAt?: Date | undefined;
152
+ };
153
+ _id: string;
154
+ processId: string;
155
+ name: string;
156
+ rootId: string;
157
+ depth: number;
158
+ order: number;
159
+ cancellable: boolean;
160
+ progress: {
161
+ percent: number | null;
162
+ message?: string | undefined;
163
+ };
164
+ log: {
165
+ message: string;
166
+ timestamp: Date;
167
+ level: "error" | "event" | "info" | "debug" | "warning";
168
+ data?: Record<string, unknown> | undefined;
169
+ }[];
170
+ createdAt: Date;
171
+ params?: Record<string, unknown> | undefined;
172
+ warning?: string | undefined;
173
+ metadata?: Record<string, unknown> | undefined;
174
+ parentId?: string | undefined;
175
+ special?: boolean | undefined;
176
+ description?: string | null | undefined;
177
+ uiWidget?: string | null | undefined;
178
+ widgetData?: unknown;
179
+ supportsResume?: boolean | undefined;
180
+ hasSavedState?: boolean | undefined;
181
+ }>, "many">;
182
+ nextCursor: z.ZodNullable<z.ZodString>;
183
+ totalCount: z.ZodNumber;
184
+ }, "strip", z.ZodTypeAny, {
185
+ items: {
186
+ status: {
187
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
188
+ error?: string | undefined;
189
+ runningSince?: Date | undefined;
190
+ doneAt?: Date | undefined;
191
+ duration?: number | undefined;
192
+ failedAt?: Date | undefined;
193
+ stoppedAt?: Date | undefined;
194
+ };
195
+ _id: string;
196
+ processId: string;
197
+ name: string;
198
+ rootId: string;
199
+ depth: number;
200
+ order: number;
201
+ cancellable: boolean;
202
+ progress: {
203
+ percent: number | null;
204
+ message?: string | undefined;
205
+ };
206
+ log: {
207
+ message: string;
208
+ timestamp: Date;
209
+ level: "error" | "event" | "info" | "debug" | "warning";
210
+ data?: Record<string, unknown> | undefined;
211
+ }[];
212
+ createdAt: Date;
213
+ params?: Record<string, unknown> | undefined;
214
+ warning?: string | undefined;
215
+ metadata?: Record<string, unknown> | undefined;
216
+ parentId?: string | undefined;
217
+ special?: boolean | undefined;
218
+ description?: string | null | undefined;
219
+ uiWidget?: string | null | undefined;
220
+ widgetData?: unknown;
221
+ supportsResume?: boolean | undefined;
222
+ hasSavedState?: boolean | undefined;
223
+ }[];
224
+ nextCursor: string | null;
225
+ totalCount: number;
226
+ }, {
227
+ items: {
228
+ status: {
229
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
230
+ error?: string | undefined;
231
+ runningSince?: Date | undefined;
232
+ doneAt?: Date | undefined;
233
+ duration?: number | undefined;
234
+ failedAt?: Date | undefined;
235
+ stoppedAt?: Date | undefined;
236
+ };
237
+ _id: string;
238
+ processId: string;
239
+ name: string;
240
+ rootId: string;
241
+ depth: number;
242
+ order: number;
243
+ cancellable: boolean;
244
+ progress: {
245
+ percent: number | null;
246
+ message?: string | undefined;
247
+ };
248
+ log: {
249
+ message: string;
250
+ timestamp: Date;
251
+ level: "error" | "event" | "info" | "debug" | "warning";
252
+ data?: Record<string, unknown> | undefined;
253
+ }[];
254
+ createdAt: Date;
255
+ params?: Record<string, unknown> | undefined;
256
+ warning?: string | undefined;
257
+ metadata?: Record<string, unknown> | undefined;
258
+ parentId?: string | undefined;
259
+ special?: boolean | undefined;
260
+ description?: string | null | undefined;
261
+ uiWidget?: string | null | undefined;
262
+ widgetData?: unknown;
263
+ supportsResume?: boolean | undefined;
264
+ hasSavedState?: boolean | undefined;
265
+ }[];
266
+ nextCursor: string | null;
267
+ totalCount: number;
268
+ }>;
269
+ };
270
+ };
271
+ get: {
272
+ pathParams: z.ZodObject<{
273
+ id: z.ZodString;
274
+ }, "strip", z.ZodTypeAny, {
275
+ id: string;
276
+ }, {
277
+ id: string;
278
+ }>;
279
+ query: z.ZodObject<{
280
+ database: z.ZodOptional<z.ZodString>;
281
+ prefix: z.ZodOptional<z.ZodString>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ database?: string | undefined;
284
+ prefix?: string | undefined;
285
+ }, {
286
+ database?: string | undefined;
287
+ prefix?: string | undefined;
288
+ }>;
289
+ summary: "Get single process";
290
+ method: "GET";
291
+ path: "/processes/:id";
292
+ responses: {
293
+ 200: z.ZodObject<{
294
+ _id: z.ZodString;
295
+ processId: z.ZodString;
296
+ name: z.ZodString;
297
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
298
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
299
+ parentId: z.ZodOptional<z.ZodString>;
300
+ rootId: z.ZodString;
301
+ depth: z.ZodNumber;
302
+ order: z.ZodNumber;
303
+ cancellable: z.ZodBoolean;
304
+ special: z.ZodOptional<z.ZodBoolean>;
305
+ warning: z.ZodOptional<z.ZodString>;
306
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ status: z.ZodObject<{
308
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
309
+ error: z.ZodOptional<z.ZodString>;
310
+ runningSince: z.ZodOptional<z.ZodDate>;
311
+ doneAt: z.ZodOptional<z.ZodDate>;
312
+ duration: z.ZodOptional<z.ZodNumber>;
313
+ failedAt: z.ZodOptional<z.ZodDate>;
314
+ stoppedAt: z.ZodOptional<z.ZodDate>;
315
+ }, "strip", z.ZodTypeAny, {
316
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
317
+ error?: string | undefined;
318
+ runningSince?: Date | undefined;
319
+ doneAt?: Date | undefined;
320
+ duration?: number | undefined;
321
+ failedAt?: Date | undefined;
322
+ stoppedAt?: Date | undefined;
323
+ }, {
324
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
325
+ error?: string | undefined;
326
+ runningSince?: Date | undefined;
327
+ doneAt?: Date | undefined;
328
+ duration?: number | undefined;
329
+ failedAt?: Date | undefined;
330
+ stoppedAt?: Date | undefined;
331
+ }>;
332
+ progress: z.ZodObject<{
333
+ percent: z.ZodNullable<z.ZodNumber>;
334
+ message: z.ZodOptional<z.ZodString>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ percent: number | null;
337
+ message?: string | undefined;
338
+ }, {
339
+ percent: number | null;
340
+ message?: string | undefined;
341
+ }>;
342
+ log: z.ZodArray<z.ZodObject<{
343
+ timestamp: z.ZodDate;
344
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
345
+ message: z.ZodString;
346
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
347
+ }, "strip", z.ZodTypeAny, {
348
+ message: string;
349
+ timestamp: Date;
350
+ level: "error" | "event" | "info" | "debug" | "warning";
351
+ data?: Record<string, unknown> | undefined;
352
+ }, {
353
+ message: string;
354
+ timestamp: Date;
355
+ level: "error" | "event" | "info" | "debug" | "warning";
356
+ data?: Record<string, unknown> | undefined;
357
+ }>, "many">;
358
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ widgetData: z.ZodOptional<z.ZodUnknown>;
360
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
361
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
362
+ createdAt: z.ZodDate;
363
+ }, "strip", z.ZodTypeAny, {
364
+ status: {
365
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
366
+ error?: string | undefined;
367
+ runningSince?: Date | undefined;
368
+ doneAt?: Date | undefined;
369
+ duration?: number | undefined;
370
+ failedAt?: Date | undefined;
371
+ stoppedAt?: Date | undefined;
372
+ };
373
+ _id: string;
374
+ processId: string;
375
+ name: string;
376
+ rootId: string;
377
+ depth: number;
378
+ order: number;
379
+ cancellable: boolean;
380
+ progress: {
381
+ percent: number | null;
382
+ message?: string | undefined;
383
+ };
384
+ log: {
385
+ message: string;
386
+ timestamp: Date;
387
+ level: "error" | "event" | "info" | "debug" | "warning";
388
+ data?: Record<string, unknown> | undefined;
389
+ }[];
390
+ createdAt: Date;
391
+ params?: Record<string, unknown> | undefined;
392
+ warning?: string | undefined;
393
+ metadata?: Record<string, unknown> | undefined;
394
+ parentId?: string | undefined;
395
+ special?: boolean | undefined;
396
+ description?: string | null | undefined;
397
+ uiWidget?: string | null | undefined;
398
+ widgetData?: unknown;
399
+ supportsResume?: boolean | undefined;
400
+ hasSavedState?: boolean | undefined;
401
+ }, {
402
+ status: {
403
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
404
+ error?: string | undefined;
405
+ runningSince?: Date | undefined;
406
+ doneAt?: Date | undefined;
407
+ duration?: number | undefined;
408
+ failedAt?: Date | undefined;
409
+ stoppedAt?: Date | undefined;
410
+ };
411
+ _id: string;
412
+ processId: string;
413
+ name: string;
414
+ rootId: string;
415
+ depth: number;
416
+ order: number;
417
+ cancellable: boolean;
418
+ progress: {
419
+ percent: number | null;
420
+ message?: string | undefined;
421
+ };
422
+ log: {
423
+ message: string;
424
+ timestamp: Date;
425
+ level: "error" | "event" | "info" | "debug" | "warning";
426
+ data?: Record<string, unknown> | undefined;
427
+ }[];
428
+ createdAt: Date;
429
+ params?: Record<string, unknown> | undefined;
430
+ warning?: string | undefined;
431
+ metadata?: Record<string, unknown> | undefined;
432
+ parentId?: string | undefined;
433
+ special?: boolean | undefined;
434
+ description?: string | null | undefined;
435
+ uiWidget?: string | null | undefined;
436
+ widgetData?: unknown;
437
+ supportsResume?: boolean | undefined;
438
+ hasSavedState?: boolean | undefined;
439
+ }>;
440
+ 404: z.ZodObject<{
441
+ message: z.ZodString;
442
+ }, "strip", z.ZodTypeAny, {
443
+ message: string;
444
+ }, {
445
+ message: string;
446
+ }>;
447
+ };
448
+ };
449
+ getTree: {
450
+ pathParams: z.ZodObject<{
451
+ id: z.ZodString;
452
+ }, "strip", z.ZodTypeAny, {
453
+ id: string;
454
+ }, {
455
+ id: string;
456
+ }>;
457
+ query: z.ZodObject<{
458
+ maxDepth: z.ZodOptional<z.ZodNumber>;
459
+ database: z.ZodOptional<z.ZodString>;
460
+ prefix: z.ZodOptional<z.ZodString>;
461
+ }, "strip", z.ZodTypeAny, {
462
+ database?: string | undefined;
463
+ prefix?: string | undefined;
464
+ maxDepth?: number | undefined;
465
+ }, {
466
+ database?: string | undefined;
467
+ prefix?: string | undefined;
468
+ maxDepth?: number | undefined;
469
+ }>;
470
+ summary: "Get full process subtree";
471
+ method: "GET";
472
+ path: "/processes/:id/tree";
473
+ responses: {
474
+ 200: z.ZodObject<{
475
+ _id: z.ZodString;
476
+ processId: z.ZodString;
477
+ name: z.ZodString;
478
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
479
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
480
+ parentId: z.ZodOptional<z.ZodString>;
481
+ rootId: z.ZodString;
482
+ depth: z.ZodNumber;
483
+ order: z.ZodNumber;
484
+ cancellable: z.ZodBoolean;
485
+ special: z.ZodOptional<z.ZodBoolean>;
486
+ warning: z.ZodOptional<z.ZodString>;
487
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
488
+ status: z.ZodObject<{
489
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
490
+ error: z.ZodOptional<z.ZodString>;
491
+ runningSince: z.ZodOptional<z.ZodDate>;
492
+ doneAt: z.ZodOptional<z.ZodDate>;
493
+ duration: z.ZodOptional<z.ZodNumber>;
494
+ failedAt: z.ZodOptional<z.ZodDate>;
495
+ stoppedAt: z.ZodOptional<z.ZodDate>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
498
+ error?: string | undefined;
499
+ runningSince?: Date | undefined;
500
+ doneAt?: Date | undefined;
501
+ duration?: number | undefined;
502
+ failedAt?: Date | undefined;
503
+ stoppedAt?: Date | undefined;
504
+ }, {
505
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
506
+ error?: string | undefined;
507
+ runningSince?: Date | undefined;
508
+ doneAt?: Date | undefined;
509
+ duration?: number | undefined;
510
+ failedAt?: Date | undefined;
511
+ stoppedAt?: Date | undefined;
512
+ }>;
513
+ progress: z.ZodObject<{
514
+ percent: z.ZodNullable<z.ZodNumber>;
515
+ message: z.ZodOptional<z.ZodString>;
516
+ }, "strip", z.ZodTypeAny, {
517
+ percent: number | null;
518
+ message?: string | undefined;
519
+ }, {
520
+ percent: number | null;
521
+ message?: string | undefined;
522
+ }>;
523
+ log: z.ZodArray<z.ZodObject<{
524
+ timestamp: z.ZodDate;
525
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
526
+ message: z.ZodString;
527
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
528
+ }, "strip", z.ZodTypeAny, {
529
+ message: string;
530
+ timestamp: Date;
531
+ level: "error" | "event" | "info" | "debug" | "warning";
532
+ data?: Record<string, unknown> | undefined;
533
+ }, {
534
+ message: string;
535
+ timestamp: Date;
536
+ level: "error" | "event" | "info" | "debug" | "warning";
537
+ data?: Record<string, unknown> | undefined;
538
+ }>, "many">;
539
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
540
+ widgetData: z.ZodOptional<z.ZodUnknown>;
541
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
542
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
543
+ createdAt: z.ZodDate;
544
+ } & {
545
+ children: z.ZodArray<z.ZodLazy<z.ZodObject<{
546
+ _id: z.ZodString;
547
+ processId: z.ZodString;
548
+ name: z.ZodString;
549
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
550
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
551
+ parentId: z.ZodOptional<z.ZodString>;
552
+ rootId: z.ZodString;
553
+ depth: z.ZodNumber;
554
+ order: z.ZodNumber;
555
+ cancellable: z.ZodBoolean;
556
+ special: z.ZodOptional<z.ZodBoolean>;
557
+ warning: z.ZodOptional<z.ZodString>;
558
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
559
+ status: z.ZodObject<{
560
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
561
+ error: z.ZodOptional<z.ZodString>;
562
+ runningSince: z.ZodOptional<z.ZodDate>;
563
+ doneAt: z.ZodOptional<z.ZodDate>;
564
+ duration: z.ZodOptional<z.ZodNumber>;
565
+ failedAt: z.ZodOptional<z.ZodDate>;
566
+ stoppedAt: z.ZodOptional<z.ZodDate>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
569
+ error?: string | undefined;
570
+ runningSince?: Date | undefined;
571
+ doneAt?: Date | undefined;
572
+ duration?: number | undefined;
573
+ failedAt?: Date | undefined;
574
+ stoppedAt?: Date | undefined;
575
+ }, {
576
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
577
+ error?: string | undefined;
578
+ runningSince?: Date | undefined;
579
+ doneAt?: Date | undefined;
580
+ duration?: number | undefined;
581
+ failedAt?: Date | undefined;
582
+ stoppedAt?: Date | undefined;
583
+ }>;
584
+ progress: z.ZodObject<{
585
+ percent: z.ZodNullable<z.ZodNumber>;
586
+ message: z.ZodOptional<z.ZodString>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ percent: number | null;
589
+ message?: string | undefined;
590
+ }, {
591
+ percent: number | null;
592
+ message?: string | undefined;
593
+ }>;
594
+ log: z.ZodArray<z.ZodObject<{
595
+ timestamp: z.ZodDate;
596
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
597
+ message: z.ZodString;
598
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
599
+ }, "strip", z.ZodTypeAny, {
600
+ message: string;
601
+ timestamp: Date;
602
+ level: "error" | "event" | "info" | "debug" | "warning";
603
+ data?: Record<string, unknown> | undefined;
604
+ }, {
605
+ message: string;
606
+ timestamp: Date;
607
+ level: "error" | "event" | "info" | "debug" | "warning";
608
+ data?: Record<string, unknown> | undefined;
609
+ }>, "many">;
610
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
611
+ widgetData: z.ZodOptional<z.ZodUnknown>;
612
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
613
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
614
+ createdAt: z.ZodDate;
615
+ } & {
616
+ children: z.ZodArray<z.ZodAny, "many">;
617
+ }, "strip", z.ZodTypeAny, {
618
+ status: {
619
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
620
+ error?: string | undefined;
621
+ runningSince?: Date | undefined;
622
+ doneAt?: Date | undefined;
623
+ duration?: number | undefined;
624
+ failedAt?: Date | undefined;
625
+ stoppedAt?: Date | undefined;
626
+ };
627
+ _id: string;
628
+ processId: string;
629
+ name: string;
630
+ rootId: string;
631
+ depth: number;
632
+ order: number;
633
+ cancellable: boolean;
634
+ progress: {
635
+ percent: number | null;
636
+ message?: string | undefined;
637
+ };
638
+ log: {
639
+ message: string;
640
+ timestamp: Date;
641
+ level: "error" | "event" | "info" | "debug" | "warning";
642
+ data?: Record<string, unknown> | undefined;
643
+ }[];
644
+ createdAt: Date;
645
+ children: any[];
646
+ params?: Record<string, unknown> | undefined;
647
+ warning?: string | undefined;
648
+ metadata?: Record<string, unknown> | undefined;
649
+ parentId?: string | undefined;
650
+ special?: boolean | undefined;
651
+ description?: string | null | undefined;
652
+ uiWidget?: string | null | undefined;
653
+ widgetData?: unknown;
654
+ supportsResume?: boolean | undefined;
655
+ hasSavedState?: boolean | undefined;
656
+ }, {
657
+ status: {
658
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
659
+ error?: string | undefined;
660
+ runningSince?: Date | undefined;
661
+ doneAt?: Date | undefined;
662
+ duration?: number | undefined;
663
+ failedAt?: Date | undefined;
664
+ stoppedAt?: Date | undefined;
665
+ };
666
+ _id: string;
667
+ processId: string;
668
+ name: string;
669
+ rootId: string;
670
+ depth: number;
671
+ order: number;
672
+ cancellable: boolean;
673
+ progress: {
674
+ percent: number | null;
675
+ message?: string | undefined;
676
+ };
677
+ log: {
678
+ message: string;
679
+ timestamp: Date;
680
+ level: "error" | "event" | "info" | "debug" | "warning";
681
+ data?: Record<string, unknown> | undefined;
682
+ }[];
683
+ createdAt: Date;
684
+ children: any[];
685
+ params?: Record<string, unknown> | undefined;
686
+ warning?: string | undefined;
687
+ metadata?: Record<string, unknown> | undefined;
688
+ parentId?: string | undefined;
689
+ special?: boolean | undefined;
690
+ description?: string | null | undefined;
691
+ uiWidget?: string | null | undefined;
692
+ widgetData?: unknown;
693
+ supportsResume?: boolean | undefined;
694
+ hasSavedState?: boolean | undefined;
695
+ }>>, "many">;
696
+ }, "strip", z.ZodTypeAny, {
697
+ status: {
698
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
699
+ error?: string | undefined;
700
+ runningSince?: Date | undefined;
701
+ doneAt?: Date | undefined;
702
+ duration?: number | undefined;
703
+ failedAt?: Date | undefined;
704
+ stoppedAt?: Date | undefined;
705
+ };
706
+ _id: string;
707
+ processId: string;
708
+ name: string;
709
+ rootId: string;
710
+ depth: number;
711
+ order: number;
712
+ cancellable: boolean;
713
+ progress: {
714
+ percent: number | null;
715
+ message?: string | undefined;
716
+ };
717
+ log: {
718
+ message: string;
719
+ timestamp: Date;
720
+ level: "error" | "event" | "info" | "debug" | "warning";
721
+ data?: Record<string, unknown> | undefined;
722
+ }[];
723
+ createdAt: Date;
724
+ children: {
725
+ status: {
726
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
727
+ error?: string | undefined;
728
+ runningSince?: Date | undefined;
729
+ doneAt?: Date | undefined;
730
+ duration?: number | undefined;
731
+ failedAt?: Date | undefined;
732
+ stoppedAt?: Date | undefined;
733
+ };
734
+ _id: string;
735
+ processId: string;
736
+ name: string;
737
+ rootId: string;
738
+ depth: number;
739
+ order: number;
740
+ cancellable: boolean;
741
+ progress: {
742
+ percent: number | null;
743
+ message?: string | undefined;
744
+ };
745
+ log: {
746
+ message: string;
747
+ timestamp: Date;
748
+ level: "error" | "event" | "info" | "debug" | "warning";
749
+ data?: Record<string, unknown> | undefined;
750
+ }[];
751
+ createdAt: Date;
752
+ children: any[];
753
+ params?: Record<string, unknown> | undefined;
754
+ warning?: string | undefined;
755
+ metadata?: Record<string, unknown> | undefined;
756
+ parentId?: string | undefined;
757
+ special?: boolean | undefined;
758
+ description?: string | null | undefined;
759
+ uiWidget?: string | null | undefined;
760
+ widgetData?: unknown;
761
+ supportsResume?: boolean | undefined;
762
+ hasSavedState?: boolean | undefined;
763
+ }[];
764
+ params?: Record<string, unknown> | undefined;
765
+ warning?: string | undefined;
766
+ metadata?: Record<string, unknown> | undefined;
767
+ parentId?: string | undefined;
768
+ special?: boolean | undefined;
769
+ description?: string | null | undefined;
770
+ uiWidget?: string | null | undefined;
771
+ widgetData?: unknown;
772
+ supportsResume?: boolean | undefined;
773
+ hasSavedState?: boolean | undefined;
774
+ }, {
775
+ status: {
776
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
777
+ error?: string | undefined;
778
+ runningSince?: Date | undefined;
779
+ doneAt?: Date | undefined;
780
+ duration?: number | undefined;
781
+ failedAt?: Date | undefined;
782
+ stoppedAt?: Date | undefined;
783
+ };
784
+ _id: string;
785
+ processId: string;
786
+ name: string;
787
+ rootId: string;
788
+ depth: number;
789
+ order: number;
790
+ cancellable: boolean;
791
+ progress: {
792
+ percent: number | null;
793
+ message?: string | undefined;
794
+ };
795
+ log: {
796
+ message: string;
797
+ timestamp: Date;
798
+ level: "error" | "event" | "info" | "debug" | "warning";
799
+ data?: Record<string, unknown> | undefined;
800
+ }[];
801
+ createdAt: Date;
802
+ children: {
803
+ status: {
804
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
805
+ error?: string | undefined;
806
+ runningSince?: Date | undefined;
807
+ doneAt?: Date | undefined;
808
+ duration?: number | undefined;
809
+ failedAt?: Date | undefined;
810
+ stoppedAt?: Date | undefined;
811
+ };
812
+ _id: string;
813
+ processId: string;
814
+ name: string;
815
+ rootId: string;
816
+ depth: number;
817
+ order: number;
818
+ cancellable: boolean;
819
+ progress: {
820
+ percent: number | null;
821
+ message?: string | undefined;
822
+ };
823
+ log: {
824
+ message: string;
825
+ timestamp: Date;
826
+ level: "error" | "event" | "info" | "debug" | "warning";
827
+ data?: Record<string, unknown> | undefined;
828
+ }[];
829
+ createdAt: Date;
830
+ children: any[];
831
+ params?: Record<string, unknown> | undefined;
832
+ warning?: string | undefined;
833
+ metadata?: Record<string, unknown> | undefined;
834
+ parentId?: string | undefined;
835
+ special?: boolean | undefined;
836
+ description?: string | null | undefined;
837
+ uiWidget?: string | null | undefined;
838
+ widgetData?: unknown;
839
+ supportsResume?: boolean | undefined;
840
+ hasSavedState?: boolean | undefined;
841
+ }[];
842
+ params?: Record<string, unknown> | undefined;
843
+ warning?: string | undefined;
844
+ metadata?: Record<string, unknown> | undefined;
845
+ parentId?: string | undefined;
846
+ special?: boolean | undefined;
847
+ description?: string | null | undefined;
848
+ uiWidget?: string | null | undefined;
849
+ widgetData?: unknown;
850
+ supportsResume?: boolean | undefined;
851
+ hasSavedState?: boolean | undefined;
852
+ }>;
853
+ 404: z.ZodObject<{
854
+ message: z.ZodString;
855
+ }, "strip", z.ZodTypeAny, {
856
+ message: string;
857
+ }, {
858
+ message: string;
859
+ }>;
860
+ };
861
+ };
862
+ getLog: {
863
+ pathParams: z.ZodObject<{
864
+ id: z.ZodString;
865
+ }, "strip", z.ZodTypeAny, {
866
+ id: string;
867
+ }, {
868
+ id: string;
869
+ }>;
870
+ query: z.ZodObject<{
871
+ cursor: z.ZodOptional<z.ZodString>;
872
+ limit: z.ZodDefault<z.ZodNumber>;
873
+ } & {
874
+ database: z.ZodOptional<z.ZodString>;
875
+ prefix: z.ZodOptional<z.ZodString>;
876
+ }, "strip", z.ZodTypeAny, {
877
+ limit: number;
878
+ cursor?: string | undefined;
879
+ database?: string | undefined;
880
+ prefix?: string | undefined;
881
+ }, {
882
+ cursor?: string | undefined;
883
+ limit?: number | undefined;
884
+ database?: string | undefined;
885
+ prefix?: string | undefined;
886
+ }>;
887
+ summary: "Get log entries for a single process";
888
+ method: "GET";
889
+ path: "/processes/:id/log";
890
+ responses: {
891
+ 200: z.ZodObject<{
892
+ items: z.ZodArray<z.ZodObject<{
893
+ timestamp: z.ZodDate;
894
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
895
+ message: z.ZodString;
896
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ message: string;
899
+ timestamp: Date;
900
+ level: "error" | "event" | "info" | "debug" | "warning";
901
+ data?: Record<string, unknown> | undefined;
902
+ }, {
903
+ message: string;
904
+ timestamp: Date;
905
+ level: "error" | "event" | "info" | "debug" | "warning";
906
+ data?: Record<string, unknown> | undefined;
907
+ }>, "many">;
908
+ nextCursor: z.ZodNullable<z.ZodString>;
909
+ totalCount: z.ZodNumber;
910
+ }, "strip", z.ZodTypeAny, {
911
+ items: {
912
+ message: string;
913
+ timestamp: Date;
914
+ level: "error" | "event" | "info" | "debug" | "warning";
915
+ data?: Record<string, unknown> | undefined;
916
+ }[];
917
+ nextCursor: string | null;
918
+ totalCount: number;
919
+ }, {
920
+ items: {
921
+ message: string;
922
+ timestamp: Date;
923
+ level: "error" | "event" | "info" | "debug" | "warning";
924
+ data?: Record<string, unknown> | undefined;
925
+ }[];
926
+ nextCursor: string | null;
927
+ totalCount: number;
928
+ }>;
929
+ 404: z.ZodObject<{
930
+ message: z.ZodString;
931
+ }, "strip", z.ZodTypeAny, {
932
+ message: string;
933
+ }, {
934
+ message: string;
935
+ }>;
936
+ };
937
+ };
938
+ getTreeLog: {
939
+ pathParams: z.ZodObject<{
940
+ id: z.ZodString;
941
+ }, "strip", z.ZodTypeAny, {
942
+ id: string;
943
+ }, {
944
+ id: string;
945
+ }>;
946
+ query: z.ZodObject<{
947
+ cursor: z.ZodOptional<z.ZodString>;
948
+ limit: z.ZodDefault<z.ZodNumber>;
949
+ } & {
950
+ maxDepth: z.ZodOptional<z.ZodNumber>;
951
+ database: z.ZodOptional<z.ZodString>;
952
+ prefix: z.ZodOptional<z.ZodString>;
953
+ }, "strip", z.ZodTypeAny, {
954
+ limit: number;
955
+ cursor?: string | undefined;
956
+ database?: string | undefined;
957
+ prefix?: string | undefined;
958
+ maxDepth?: number | undefined;
959
+ }, {
960
+ cursor?: string | undefined;
961
+ limit?: number | undefined;
962
+ database?: string | undefined;
963
+ prefix?: string | undefined;
964
+ maxDepth?: number | undefined;
965
+ }>;
966
+ summary: "Get merged log entries across subtree";
967
+ method: "GET";
968
+ path: "/processes/:id/tree/log";
969
+ responses: {
970
+ 200: z.ZodObject<{
971
+ items: z.ZodArray<z.ZodObject<{
972
+ timestamp: z.ZodDate;
973
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
974
+ message: z.ZodString;
975
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
976
+ } & {
977
+ processId: z.ZodString;
978
+ processLabel: z.ZodString;
979
+ }, "strip", z.ZodTypeAny, {
980
+ message: string;
981
+ timestamp: Date;
982
+ level: "error" | "event" | "info" | "debug" | "warning";
983
+ processId: string;
984
+ processLabel: string;
985
+ data?: Record<string, unknown> | undefined;
986
+ }, {
987
+ message: string;
988
+ timestamp: Date;
989
+ level: "error" | "event" | "info" | "debug" | "warning";
990
+ processId: string;
991
+ processLabel: string;
992
+ data?: Record<string, unknown> | undefined;
993
+ }>, "many">;
994
+ nextCursor: z.ZodNullable<z.ZodString>;
995
+ totalCount: z.ZodNumber;
996
+ }, "strip", z.ZodTypeAny, {
997
+ items: {
998
+ message: string;
999
+ timestamp: Date;
1000
+ level: "error" | "event" | "info" | "debug" | "warning";
1001
+ processId: string;
1002
+ processLabel: string;
1003
+ data?: Record<string, unknown> | undefined;
1004
+ }[];
1005
+ nextCursor: string | null;
1006
+ totalCount: number;
1007
+ }, {
1008
+ items: {
1009
+ message: string;
1010
+ timestamp: Date;
1011
+ level: "error" | "event" | "info" | "debug" | "warning";
1012
+ processId: string;
1013
+ processLabel: string;
1014
+ data?: Record<string, unknown> | undefined;
1015
+ }[];
1016
+ nextCursor: string | null;
1017
+ totalCount: number;
1018
+ }>;
1019
+ 404: z.ZodObject<{
1020
+ message: z.ZodString;
1021
+ }, "strip", z.ZodTypeAny, {
1022
+ message: string;
1023
+ }, {
1024
+ message: string;
1025
+ }>;
1026
+ };
1027
+ };
1028
+ launch: {
1029
+ pathParams: z.ZodObject<{
1030
+ id: z.ZodString;
1031
+ }, "strip", z.ZodTypeAny, {
1032
+ id: string;
1033
+ }, {
1034
+ id: string;
1035
+ }>;
1036
+ query: z.ZodObject<{
1037
+ database: z.ZodOptional<z.ZodString>;
1038
+ prefix: z.ZodOptional<z.ZodString>;
1039
+ }, "strip", z.ZodTypeAny, {
1040
+ database?: string | undefined;
1041
+ prefix?: string | undefined;
1042
+ }, {
1043
+ database?: string | undefined;
1044
+ prefix?: string | undefined;
1045
+ }>;
1046
+ summary: "Launch a process (optionally in resume mode)";
1047
+ method: "POST";
1048
+ body: z.ZodOptional<z.ZodObject<{
1049
+ resume: z.ZodOptional<z.ZodBoolean>;
1050
+ }, "strip", z.ZodTypeAny, {
1051
+ resume?: boolean | undefined;
1052
+ }, {
1053
+ resume?: boolean | undefined;
1054
+ }>>;
1055
+ path: "/processes/:id/launch";
1056
+ responses: {
1057
+ 200: z.ZodObject<{
1058
+ _id: z.ZodString;
1059
+ processId: z.ZodString;
1060
+ name: z.ZodString;
1061
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1062
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1063
+ parentId: z.ZodOptional<z.ZodString>;
1064
+ rootId: z.ZodString;
1065
+ depth: z.ZodNumber;
1066
+ order: z.ZodNumber;
1067
+ cancellable: z.ZodBoolean;
1068
+ special: z.ZodOptional<z.ZodBoolean>;
1069
+ warning: z.ZodOptional<z.ZodString>;
1070
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1071
+ status: z.ZodObject<{
1072
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
1073
+ error: z.ZodOptional<z.ZodString>;
1074
+ runningSince: z.ZodOptional<z.ZodDate>;
1075
+ doneAt: z.ZodOptional<z.ZodDate>;
1076
+ duration: z.ZodOptional<z.ZodNumber>;
1077
+ failedAt: z.ZodOptional<z.ZodDate>;
1078
+ stoppedAt: z.ZodOptional<z.ZodDate>;
1079
+ }, "strip", z.ZodTypeAny, {
1080
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1081
+ error?: string | undefined;
1082
+ runningSince?: Date | undefined;
1083
+ doneAt?: Date | undefined;
1084
+ duration?: number | undefined;
1085
+ failedAt?: Date | undefined;
1086
+ stoppedAt?: Date | undefined;
1087
+ }, {
1088
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1089
+ error?: string | undefined;
1090
+ runningSince?: Date | undefined;
1091
+ doneAt?: Date | undefined;
1092
+ duration?: number | undefined;
1093
+ failedAt?: Date | undefined;
1094
+ stoppedAt?: Date | undefined;
1095
+ }>;
1096
+ progress: z.ZodObject<{
1097
+ percent: z.ZodNullable<z.ZodNumber>;
1098
+ message: z.ZodOptional<z.ZodString>;
1099
+ }, "strip", z.ZodTypeAny, {
1100
+ percent: number | null;
1101
+ message?: string | undefined;
1102
+ }, {
1103
+ percent: number | null;
1104
+ message?: string | undefined;
1105
+ }>;
1106
+ log: z.ZodArray<z.ZodObject<{
1107
+ timestamp: z.ZodDate;
1108
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
1109
+ message: z.ZodString;
1110
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1111
+ }, "strip", z.ZodTypeAny, {
1112
+ message: string;
1113
+ timestamp: Date;
1114
+ level: "error" | "event" | "info" | "debug" | "warning";
1115
+ data?: Record<string, unknown> | undefined;
1116
+ }, {
1117
+ message: string;
1118
+ timestamp: Date;
1119
+ level: "error" | "event" | "info" | "debug" | "warning";
1120
+ data?: Record<string, unknown> | undefined;
1121
+ }>, "many">;
1122
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1123
+ widgetData: z.ZodOptional<z.ZodUnknown>;
1124
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
1125
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
1126
+ createdAt: z.ZodDate;
1127
+ }, "strip", z.ZodTypeAny, {
1128
+ status: {
1129
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1130
+ error?: string | undefined;
1131
+ runningSince?: Date | undefined;
1132
+ doneAt?: Date | undefined;
1133
+ duration?: number | undefined;
1134
+ failedAt?: Date | undefined;
1135
+ stoppedAt?: Date | undefined;
1136
+ };
1137
+ _id: string;
1138
+ processId: string;
1139
+ name: string;
1140
+ rootId: string;
1141
+ depth: number;
1142
+ order: number;
1143
+ cancellable: boolean;
1144
+ progress: {
1145
+ percent: number | null;
1146
+ message?: string | undefined;
1147
+ };
1148
+ log: {
1149
+ message: string;
1150
+ timestamp: Date;
1151
+ level: "error" | "event" | "info" | "debug" | "warning";
1152
+ data?: Record<string, unknown> | undefined;
1153
+ }[];
1154
+ createdAt: Date;
1155
+ params?: Record<string, unknown> | undefined;
1156
+ warning?: string | undefined;
1157
+ metadata?: Record<string, unknown> | undefined;
1158
+ parentId?: string | undefined;
1159
+ special?: boolean | undefined;
1160
+ description?: string | null | undefined;
1161
+ uiWidget?: string | null | undefined;
1162
+ widgetData?: unknown;
1163
+ supportsResume?: boolean | undefined;
1164
+ hasSavedState?: boolean | undefined;
1165
+ }, {
1166
+ status: {
1167
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1168
+ error?: string | undefined;
1169
+ runningSince?: Date | undefined;
1170
+ doneAt?: Date | undefined;
1171
+ duration?: number | undefined;
1172
+ failedAt?: Date | undefined;
1173
+ stoppedAt?: Date | undefined;
1174
+ };
1175
+ _id: string;
1176
+ processId: string;
1177
+ name: string;
1178
+ rootId: string;
1179
+ depth: number;
1180
+ order: number;
1181
+ cancellable: boolean;
1182
+ progress: {
1183
+ percent: number | null;
1184
+ message?: string | undefined;
1185
+ };
1186
+ log: {
1187
+ message: string;
1188
+ timestamp: Date;
1189
+ level: "error" | "event" | "info" | "debug" | "warning";
1190
+ data?: Record<string, unknown> | undefined;
1191
+ }[];
1192
+ createdAt: Date;
1193
+ params?: Record<string, unknown> | undefined;
1194
+ warning?: string | undefined;
1195
+ metadata?: Record<string, unknown> | undefined;
1196
+ parentId?: string | undefined;
1197
+ special?: boolean | undefined;
1198
+ description?: string | null | undefined;
1199
+ uiWidget?: string | null | undefined;
1200
+ widgetData?: unknown;
1201
+ supportsResume?: boolean | undefined;
1202
+ hasSavedState?: boolean | undefined;
1203
+ }>;
1204
+ 404: z.ZodObject<{
1205
+ reason: z.ZodEnum<["not-found", "not-launchable", "no-resume-support", "launch-blocked"]>;
1206
+ message: z.ZodString;
1207
+ }, "strip", z.ZodTypeAny, {
1208
+ message: string;
1209
+ reason: "not-found" | "not-launchable" | "no-resume-support" | "launch-blocked";
1210
+ }, {
1211
+ message: string;
1212
+ reason: "not-found" | "not-launchable" | "no-resume-support" | "launch-blocked";
1213
+ }>;
1214
+ 409: z.ZodObject<{
1215
+ reason: z.ZodEnum<["not-found", "not-launchable", "no-resume-support", "launch-blocked"]>;
1216
+ message: z.ZodString;
1217
+ }, "strip", z.ZodTypeAny, {
1218
+ message: string;
1219
+ reason: "not-found" | "not-launchable" | "no-resume-support" | "launch-blocked";
1220
+ }, {
1221
+ message: string;
1222
+ reason: "not-found" | "not-launchable" | "no-resume-support" | "launch-blocked";
1223
+ }>;
1224
+ };
1225
+ };
1226
+ cancel: {
1227
+ pathParams: z.ZodObject<{
1228
+ id: z.ZodString;
1229
+ }, "strip", z.ZodTypeAny, {
1230
+ id: string;
1231
+ }, {
1232
+ id: string;
1233
+ }>;
1234
+ query: z.ZodObject<{
1235
+ database: z.ZodOptional<z.ZodString>;
1236
+ prefix: z.ZodOptional<z.ZodString>;
1237
+ }, "strip", z.ZodTypeAny, {
1238
+ database?: string | undefined;
1239
+ prefix?: string | undefined;
1240
+ }, {
1241
+ database?: string | undefined;
1242
+ prefix?: string | undefined;
1243
+ }>;
1244
+ summary: "Request process cancellation";
1245
+ method: "POST";
1246
+ body: typeof import("@ts-rest/core").ContractNoBody;
1247
+ path: "/processes/:id/cancel";
1248
+ responses: {
1249
+ 200: z.ZodObject<{
1250
+ _id: z.ZodString;
1251
+ processId: z.ZodString;
1252
+ name: z.ZodString;
1253
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1254
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1255
+ parentId: z.ZodOptional<z.ZodString>;
1256
+ rootId: z.ZodString;
1257
+ depth: z.ZodNumber;
1258
+ order: z.ZodNumber;
1259
+ cancellable: z.ZodBoolean;
1260
+ special: z.ZodOptional<z.ZodBoolean>;
1261
+ warning: z.ZodOptional<z.ZodString>;
1262
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1263
+ status: z.ZodObject<{
1264
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
1265
+ error: z.ZodOptional<z.ZodString>;
1266
+ runningSince: z.ZodOptional<z.ZodDate>;
1267
+ doneAt: z.ZodOptional<z.ZodDate>;
1268
+ duration: z.ZodOptional<z.ZodNumber>;
1269
+ failedAt: z.ZodOptional<z.ZodDate>;
1270
+ stoppedAt: z.ZodOptional<z.ZodDate>;
1271
+ }, "strip", z.ZodTypeAny, {
1272
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1273
+ error?: string | undefined;
1274
+ runningSince?: Date | undefined;
1275
+ doneAt?: Date | undefined;
1276
+ duration?: number | undefined;
1277
+ failedAt?: Date | undefined;
1278
+ stoppedAt?: Date | undefined;
1279
+ }, {
1280
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1281
+ error?: string | undefined;
1282
+ runningSince?: Date | undefined;
1283
+ doneAt?: Date | undefined;
1284
+ duration?: number | undefined;
1285
+ failedAt?: Date | undefined;
1286
+ stoppedAt?: Date | undefined;
1287
+ }>;
1288
+ progress: z.ZodObject<{
1289
+ percent: z.ZodNullable<z.ZodNumber>;
1290
+ message: z.ZodOptional<z.ZodString>;
1291
+ }, "strip", z.ZodTypeAny, {
1292
+ percent: number | null;
1293
+ message?: string | undefined;
1294
+ }, {
1295
+ percent: number | null;
1296
+ message?: string | undefined;
1297
+ }>;
1298
+ log: z.ZodArray<z.ZodObject<{
1299
+ timestamp: z.ZodDate;
1300
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
1301
+ message: z.ZodString;
1302
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1303
+ }, "strip", z.ZodTypeAny, {
1304
+ message: string;
1305
+ timestamp: Date;
1306
+ level: "error" | "event" | "info" | "debug" | "warning";
1307
+ data?: Record<string, unknown> | undefined;
1308
+ }, {
1309
+ message: string;
1310
+ timestamp: Date;
1311
+ level: "error" | "event" | "info" | "debug" | "warning";
1312
+ data?: Record<string, unknown> | undefined;
1313
+ }>, "many">;
1314
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1315
+ widgetData: z.ZodOptional<z.ZodUnknown>;
1316
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
1317
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
1318
+ createdAt: z.ZodDate;
1319
+ }, "strip", z.ZodTypeAny, {
1320
+ status: {
1321
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1322
+ error?: string | undefined;
1323
+ runningSince?: Date | undefined;
1324
+ doneAt?: Date | undefined;
1325
+ duration?: number | undefined;
1326
+ failedAt?: Date | undefined;
1327
+ stoppedAt?: Date | undefined;
1328
+ };
1329
+ _id: string;
1330
+ processId: string;
1331
+ name: string;
1332
+ rootId: string;
1333
+ depth: number;
1334
+ order: number;
1335
+ cancellable: boolean;
1336
+ progress: {
1337
+ percent: number | null;
1338
+ message?: string | undefined;
1339
+ };
1340
+ log: {
1341
+ message: string;
1342
+ timestamp: Date;
1343
+ level: "error" | "event" | "info" | "debug" | "warning";
1344
+ data?: Record<string, unknown> | undefined;
1345
+ }[];
1346
+ createdAt: Date;
1347
+ params?: Record<string, unknown> | undefined;
1348
+ warning?: string | undefined;
1349
+ metadata?: Record<string, unknown> | undefined;
1350
+ parentId?: string | undefined;
1351
+ special?: boolean | undefined;
1352
+ description?: string | null | undefined;
1353
+ uiWidget?: string | null | undefined;
1354
+ widgetData?: unknown;
1355
+ supportsResume?: boolean | undefined;
1356
+ hasSavedState?: boolean | undefined;
1357
+ }, {
1358
+ status: {
1359
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1360
+ error?: string | undefined;
1361
+ runningSince?: Date | undefined;
1362
+ doneAt?: Date | undefined;
1363
+ duration?: number | undefined;
1364
+ failedAt?: Date | undefined;
1365
+ stoppedAt?: Date | undefined;
1366
+ };
1367
+ _id: string;
1368
+ processId: string;
1369
+ name: string;
1370
+ rootId: string;
1371
+ depth: number;
1372
+ order: number;
1373
+ cancellable: boolean;
1374
+ progress: {
1375
+ percent: number | null;
1376
+ message?: string | undefined;
1377
+ };
1378
+ log: {
1379
+ message: string;
1380
+ timestamp: Date;
1381
+ level: "error" | "event" | "info" | "debug" | "warning";
1382
+ data?: Record<string, unknown> | undefined;
1383
+ }[];
1384
+ createdAt: Date;
1385
+ params?: Record<string, unknown> | undefined;
1386
+ warning?: string | undefined;
1387
+ metadata?: Record<string, unknown> | undefined;
1388
+ parentId?: string | undefined;
1389
+ special?: boolean | undefined;
1390
+ description?: string | null | undefined;
1391
+ uiWidget?: string | null | undefined;
1392
+ widgetData?: unknown;
1393
+ supportsResume?: boolean | undefined;
1394
+ hasSavedState?: boolean | undefined;
1395
+ }>;
1396
+ 404: z.ZodObject<{
1397
+ reason: z.ZodEnum<["not-found", "not-cancellable"]>;
1398
+ message: z.ZodString;
1399
+ }, "strip", z.ZodTypeAny, {
1400
+ message: string;
1401
+ reason: "not-found" | "not-cancellable";
1402
+ }, {
1403
+ message: string;
1404
+ reason: "not-found" | "not-cancellable";
1405
+ }>;
1406
+ 409: z.ZodObject<{
1407
+ reason: z.ZodEnum<["not-found", "not-cancellable"]>;
1408
+ message: z.ZodString;
1409
+ }, "strip", z.ZodTypeAny, {
1410
+ message: string;
1411
+ reason: "not-found" | "not-cancellable";
1412
+ }, {
1413
+ message: string;
1414
+ reason: "not-found" | "not-cancellable";
1415
+ }>;
1416
+ };
1417
+ };
1418
+ dismiss: {
1419
+ pathParams: z.ZodObject<{
1420
+ id: z.ZodString;
1421
+ }, "strip", z.ZodTypeAny, {
1422
+ id: string;
1423
+ }, {
1424
+ id: string;
1425
+ }>;
1426
+ query: z.ZodObject<{
1427
+ database: z.ZodOptional<z.ZodString>;
1428
+ prefix: z.ZodOptional<z.ZodString>;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ database?: string | undefined;
1431
+ prefix?: string | undefined;
1432
+ }, {
1433
+ database?: string | undefined;
1434
+ prefix?: string | undefined;
1435
+ }>;
1436
+ summary: "Dismiss process (reset to idle)";
1437
+ method: "POST";
1438
+ body: typeof import("@ts-rest/core").ContractNoBody;
1439
+ path: "/processes/:id/dismiss";
1440
+ responses: {
1441
+ 200: z.ZodObject<{
1442
+ _id: z.ZodString;
1443
+ processId: z.ZodString;
1444
+ name: z.ZodString;
1445
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1446
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1447
+ parentId: z.ZodOptional<z.ZodString>;
1448
+ rootId: z.ZodString;
1449
+ depth: z.ZodNumber;
1450
+ order: z.ZodNumber;
1451
+ cancellable: z.ZodBoolean;
1452
+ special: z.ZodOptional<z.ZodBoolean>;
1453
+ warning: z.ZodOptional<z.ZodString>;
1454
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1455
+ status: z.ZodObject<{
1456
+ state: z.ZodEnum<["idle", "scheduled", "running", "done", "failed", "cancel_requested", "cancelling", "cancelled"]>;
1457
+ error: z.ZodOptional<z.ZodString>;
1458
+ runningSince: z.ZodOptional<z.ZodDate>;
1459
+ doneAt: z.ZodOptional<z.ZodDate>;
1460
+ duration: z.ZodOptional<z.ZodNumber>;
1461
+ failedAt: z.ZodOptional<z.ZodDate>;
1462
+ stoppedAt: z.ZodOptional<z.ZodDate>;
1463
+ }, "strip", z.ZodTypeAny, {
1464
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1465
+ error?: string | undefined;
1466
+ runningSince?: Date | undefined;
1467
+ doneAt?: Date | undefined;
1468
+ duration?: number | undefined;
1469
+ failedAt?: Date | undefined;
1470
+ stoppedAt?: Date | undefined;
1471
+ }, {
1472
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1473
+ error?: string | undefined;
1474
+ runningSince?: Date | undefined;
1475
+ doneAt?: Date | undefined;
1476
+ duration?: number | undefined;
1477
+ failedAt?: Date | undefined;
1478
+ stoppedAt?: Date | undefined;
1479
+ }>;
1480
+ progress: z.ZodObject<{
1481
+ percent: z.ZodNullable<z.ZodNumber>;
1482
+ message: z.ZodOptional<z.ZodString>;
1483
+ }, "strip", z.ZodTypeAny, {
1484
+ percent: number | null;
1485
+ message?: string | undefined;
1486
+ }, {
1487
+ percent: number | null;
1488
+ message?: string | undefined;
1489
+ }>;
1490
+ log: z.ZodArray<z.ZodObject<{
1491
+ timestamp: z.ZodDate;
1492
+ level: z.ZodEnum<["event", "info", "debug", "warning", "error"]>;
1493
+ message: z.ZodString;
1494
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1495
+ }, "strip", z.ZodTypeAny, {
1496
+ message: string;
1497
+ timestamp: Date;
1498
+ level: "error" | "event" | "info" | "debug" | "warning";
1499
+ data?: Record<string, unknown> | undefined;
1500
+ }, {
1501
+ message: string;
1502
+ timestamp: Date;
1503
+ level: "error" | "event" | "info" | "debug" | "warning";
1504
+ data?: Record<string, unknown> | undefined;
1505
+ }>, "many">;
1506
+ uiWidget: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1507
+ widgetData: z.ZodOptional<z.ZodUnknown>;
1508
+ supportsResume: z.ZodOptional<z.ZodBoolean>;
1509
+ hasSavedState: z.ZodOptional<z.ZodBoolean>;
1510
+ createdAt: z.ZodDate;
1511
+ }, "strip", z.ZodTypeAny, {
1512
+ status: {
1513
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1514
+ error?: string | undefined;
1515
+ runningSince?: Date | undefined;
1516
+ doneAt?: Date | undefined;
1517
+ duration?: number | undefined;
1518
+ failedAt?: Date | undefined;
1519
+ stoppedAt?: Date | undefined;
1520
+ };
1521
+ _id: string;
1522
+ processId: string;
1523
+ name: string;
1524
+ rootId: string;
1525
+ depth: number;
1526
+ order: number;
1527
+ cancellable: boolean;
1528
+ progress: {
1529
+ percent: number | null;
1530
+ message?: string | undefined;
1531
+ };
1532
+ log: {
1533
+ message: string;
1534
+ timestamp: Date;
1535
+ level: "error" | "event" | "info" | "debug" | "warning";
1536
+ data?: Record<string, unknown> | undefined;
1537
+ }[];
1538
+ createdAt: Date;
1539
+ params?: Record<string, unknown> | undefined;
1540
+ warning?: string | undefined;
1541
+ metadata?: Record<string, unknown> | undefined;
1542
+ parentId?: string | undefined;
1543
+ special?: boolean | undefined;
1544
+ description?: string | null | undefined;
1545
+ uiWidget?: string | null | undefined;
1546
+ widgetData?: unknown;
1547
+ supportsResume?: boolean | undefined;
1548
+ hasSavedState?: boolean | undefined;
1549
+ }, {
1550
+ status: {
1551
+ state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
1552
+ error?: string | undefined;
1553
+ runningSince?: Date | undefined;
1554
+ doneAt?: Date | undefined;
1555
+ duration?: number | undefined;
1556
+ failedAt?: Date | undefined;
1557
+ stoppedAt?: Date | undefined;
1558
+ };
1559
+ _id: string;
1560
+ processId: string;
1561
+ name: string;
1562
+ rootId: string;
1563
+ depth: number;
1564
+ order: number;
1565
+ cancellable: boolean;
1566
+ progress: {
1567
+ percent: number | null;
1568
+ message?: string | undefined;
1569
+ };
1570
+ log: {
1571
+ message: string;
1572
+ timestamp: Date;
1573
+ level: "error" | "event" | "info" | "debug" | "warning";
1574
+ data?: Record<string, unknown> | undefined;
1575
+ }[];
1576
+ createdAt: Date;
1577
+ params?: Record<string, unknown> | undefined;
1578
+ warning?: string | undefined;
1579
+ metadata?: Record<string, unknown> | undefined;
1580
+ parentId?: string | undefined;
1581
+ special?: boolean | undefined;
1582
+ description?: string | null | undefined;
1583
+ uiWidget?: string | null | undefined;
1584
+ widgetData?: unknown;
1585
+ supportsResume?: boolean | undefined;
1586
+ hasSavedState?: boolean | undefined;
1587
+ }>;
1588
+ 404: z.ZodObject<{
1589
+ reason: z.ZodEnum<["not-found", "not-dismissable"]>;
1590
+ message: z.ZodString;
1591
+ }, "strip", z.ZodTypeAny, {
1592
+ message: string;
1593
+ reason: "not-found" | "not-dismissable";
1594
+ }, {
1595
+ message: string;
1596
+ reason: "not-found" | "not-dismissable";
1597
+ }>;
1598
+ 409: z.ZodObject<{
1599
+ reason: z.ZodEnum<["not-found", "not-dismissable"]>;
1600
+ message: z.ZodString;
1601
+ }, "strip", z.ZodTypeAny, {
1602
+ message: string;
1603
+ reason: "not-found" | "not-dismissable";
1604
+ }, {
1605
+ message: string;
1606
+ reason: "not-found" | "not-dismissable";
1607
+ }>;
1608
+ };
1609
+ };
1610
+ resync: {
1611
+ query: z.ZodObject<{
1612
+ database: z.ZodOptional<z.ZodString>;
1613
+ prefix: z.ZodOptional<z.ZodString>;
1614
+ }, "strip", z.ZodTypeAny, {
1615
+ database?: string | undefined;
1616
+ prefix?: string | undefined;
1617
+ }, {
1618
+ database?: string | undefined;
1619
+ prefix?: string | undefined;
1620
+ }>;
1621
+ summary: "Re-sync process definitions";
1622
+ method: "POST";
1623
+ body: z.ZodObject<{
1624
+ clean: z.ZodOptional<z.ZodBoolean>;
1625
+ metadataFilter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1626
+ }, "strip", z.ZodTypeAny, {
1627
+ metadataFilter?: Record<string, unknown> | undefined;
1628
+ clean?: boolean | undefined;
1629
+ }, {
1630
+ metadataFilter?: Record<string, unknown> | undefined;
1631
+ clean?: boolean | undefined;
1632
+ }>;
1633
+ path: "/processes/resync";
1634
+ responses: {
1635
+ 202: z.ZodObject<{
1636
+ message: z.ZodString;
1637
+ }, "strip", z.ZodTypeAny, {
1638
+ message: string;
1639
+ }, {
1640
+ message: string;
1641
+ }>;
1642
+ };
1643
+ };
1644
+ };
1645
+ export declare const discoveryContract: {
1646
+ instances: {
1647
+ summary: "Discover active optio instances across databases";
1648
+ method: "GET";
1649
+ path: "/optio/instances";
1650
+ responses: {
1651
+ 200: z.ZodObject<{
1652
+ instances: z.ZodArray<z.ZodObject<{
1653
+ database: z.ZodString;
1654
+ prefix: z.ZodString;
1655
+ live: z.ZodBoolean;
1656
+ }, "strip", z.ZodTypeAny, {
1657
+ database: string;
1658
+ prefix: string;
1659
+ live: boolean;
1660
+ }, {
1661
+ database: string;
1662
+ prefix: string;
1663
+ live: boolean;
1664
+ }>, "many">;
1665
+ }, "strip", z.ZodTypeAny, {
1666
+ instances: {
1667
+ database: string;
1668
+ prefix: string;
1669
+ live: boolean;
1670
+ }[];
1671
+ }, {
1672
+ instances: {
1673
+ database: string;
1674
+ prefix: string;
1675
+ live: boolean;
1676
+ }[];
1677
+ }>;
1678
+ };
1679
+ };
1680
+ };
1681
+ //# sourceMappingURL=api-to-frontend.d.ts.map