@driftgate/sdk 0.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4167 @@
1
+ import { z } from 'zod';
2
+ import { V4SessionStartRequestSchema, V4SessionResourceSchema, V4ExecutionRequestSchema, EdgeInterceptorRegistration, EdgeInterceptorRegisterRequest, EdgeInterceptorStatus, FirewallInspectRequest, FirewallInspectResponse, FirewallEvent, WorkflowVersion, PolicyDecision } from '@driftgate/contracts';
3
+
4
+ declare const CanonicalMetaSchema: z.ZodObject<{
5
+ requestId: z.ZodString;
6
+ sessionId: z.ZodOptional<z.ZodString>;
7
+ executionId: z.ZodOptional<z.ZodString>;
8
+ lineageId: z.ZodOptional<z.ZodString>;
9
+ policy: z.ZodOptional<z.ZodObject<{
10
+ ref: z.ZodString;
11
+ version: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ version: string;
14
+ ref: string;
15
+ }, {
16
+ version: string;
17
+ ref: string;
18
+ }>>;
19
+ route: z.ZodOptional<z.ZodObject<{
20
+ provider: z.ZodOptional<z.ZodString>;
21
+ model: z.ZodOptional<z.ZodString>;
22
+ region: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ provider?: string | undefined;
25
+ model?: string | undefined;
26
+ region?: string | undefined;
27
+ }, {
28
+ provider?: string | undefined;
29
+ model?: string | undefined;
30
+ region?: string | undefined;
31
+ }>>;
32
+ risk: z.ZodOptional<z.ZodObject<{
33
+ score: z.ZodOptional<z.ZodNumber>;
34
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ score?: number | undefined;
37
+ decision?: "allow" | "deny" | "review" | undefined;
38
+ }, {
39
+ score?: number | undefined;
40
+ decision?: "allow" | "deny" | "review" | undefined;
41
+ }>>;
42
+ timingMs: z.ZodObject<{
43
+ total: z.ZodNumber;
44
+ policy: z.ZodOptional<z.ZodNumber>;
45
+ route: z.ZodOptional<z.ZodNumber>;
46
+ tool: z.ZodOptional<z.ZodNumber>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ total: number;
49
+ policy?: number | undefined;
50
+ route?: number | undefined;
51
+ tool?: number | undefined;
52
+ }, {
53
+ total: number;
54
+ policy?: number | undefined;
55
+ route?: number | undefined;
56
+ tool?: number | undefined;
57
+ }>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ requestId: string;
60
+ timingMs: {
61
+ total: number;
62
+ policy?: number | undefined;
63
+ route?: number | undefined;
64
+ tool?: number | undefined;
65
+ };
66
+ policy?: {
67
+ version: string;
68
+ ref: string;
69
+ } | undefined;
70
+ route?: {
71
+ provider?: string | undefined;
72
+ model?: string | undefined;
73
+ region?: string | undefined;
74
+ } | undefined;
75
+ sessionId?: string | undefined;
76
+ executionId?: string | undefined;
77
+ lineageId?: string | undefined;
78
+ risk?: {
79
+ score?: number | undefined;
80
+ decision?: "allow" | "deny" | "review" | undefined;
81
+ } | undefined;
82
+ }, {
83
+ requestId: string;
84
+ timingMs: {
85
+ total: number;
86
+ policy?: number | undefined;
87
+ route?: number | undefined;
88
+ tool?: number | undefined;
89
+ };
90
+ policy?: {
91
+ version: string;
92
+ ref: string;
93
+ } | undefined;
94
+ route?: {
95
+ provider?: string | undefined;
96
+ model?: string | undefined;
97
+ region?: string | undefined;
98
+ } | undefined;
99
+ sessionId?: string | undefined;
100
+ executionId?: string | undefined;
101
+ lineageId?: string | undefined;
102
+ risk?: {
103
+ score?: number | undefined;
104
+ decision?: "allow" | "deny" | "review" | undefined;
105
+ } | undefined;
106
+ }>;
107
+ declare const CanonicalErrorSchema: z.ZodObject<{
108
+ code: z.ZodString;
109
+ message: z.ZodString;
110
+ status: z.ZodNumber;
111
+ retryable: z.ZodBoolean;
112
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ code: string;
115
+ message: string;
116
+ status: number;
117
+ retryable: boolean;
118
+ details?: Record<string, unknown> | undefined;
119
+ }, {
120
+ code: string;
121
+ message: string;
122
+ status: number;
123
+ retryable: boolean;
124
+ details?: Record<string, unknown> | undefined;
125
+ }>;
126
+ declare const REQUIRED_V4_ERROR_CODES: readonly ["AUTH_INVALID", "POLICY_DENIED", "RISK_EXCEEDED", "ROUTE_UNAVAILABLE", "TOOL_BLOCKED", "RATE_LIMITED", "TIMEOUT", "INTERNAL"];
127
+ declare const RunResponseSchema: z.ZodObject<{
128
+ run: z.ZodObject<{
129
+ id: z.ZodString;
130
+ workspaceId: z.ZodString;
131
+ workflowVersionId: z.ZodString;
132
+ state: z.ZodEnum<["queued", "running", "waiting_approval", "approved", "denied", "succeeded", "failed", "aborted", "timed_out", "canceled"]>;
133
+ correlationId: z.ZodString;
134
+ idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ triggerSource: z.ZodEnum<["ui", "api", "sdk", "cli", "hosted", "webhook"]>;
136
+ requestedBy: z.ZodString;
137
+ requestedAt: z.ZodString;
138
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ slaPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ slaDueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ slaViolatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ id: string;
145
+ workspaceId: string;
146
+ workflowVersionId: string;
147
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
148
+ correlationId: string;
149
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
150
+ requestedBy: string;
151
+ requestedAt: string;
152
+ idempotencyKey?: string | null | undefined;
153
+ startedAt?: string | null | undefined;
154
+ completedAt?: string | null | undefined;
155
+ slaPolicyId?: string | null | undefined;
156
+ slaDueAt?: string | null | undefined;
157
+ slaViolatedAt?: string | null | undefined;
158
+ }, {
159
+ id: string;
160
+ workspaceId: string;
161
+ workflowVersionId: string;
162
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
163
+ correlationId: string;
164
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
165
+ requestedBy: string;
166
+ requestedAt: string;
167
+ idempotencyKey?: string | null | undefined;
168
+ startedAt?: string | null | undefined;
169
+ completedAt?: string | null | undefined;
170
+ slaPolicyId?: string | null | undefined;
171
+ slaDueAt?: string | null | undefined;
172
+ slaViolatedAt?: string | null | undefined;
173
+ }>;
174
+ approval: z.ZodOptional<z.ZodNullable<z.ZodObject<{
175
+ id: z.ZodString;
176
+ runId: z.ZodString;
177
+ requiredRole: z.ZodString;
178
+ status: z.ZodEnum<["pending", "approved", "denied"]>;
179
+ createdAt: z.ZodString;
180
+ decidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
+ decidedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ status: "approved" | "denied" | "pending";
184
+ id: string;
185
+ runId: string;
186
+ requiredRole: string;
187
+ createdAt: string;
188
+ decidedAt?: string | null | undefined;
189
+ decidedBy?: string | null | undefined;
190
+ }, {
191
+ status: "approved" | "denied" | "pending";
192
+ id: string;
193
+ runId: string;
194
+ requiredRole: string;
195
+ createdAt: string;
196
+ decidedAt?: string | null | undefined;
197
+ decidedBy?: string | null | undefined;
198
+ }>>>;
199
+ blocked: z.ZodOptional<z.ZodBoolean>;
200
+ policyDecisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
201
+ mode: z.ZodEnum<["monitor", "enforce"]>;
202
+ decision: z.ZodEnum<["allow", "deny"]>;
203
+ policyId: z.ZodString;
204
+ ruleId: z.ZodString;
205
+ reasonCode: z.ZodString;
206
+ reasonText: z.ZodString;
207
+ correlationId: z.ZodString;
208
+ trace: z.ZodRecord<z.ZodString, z.ZodUnknown>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ correlationId: string;
211
+ mode: "monitor" | "enforce";
212
+ decision: "allow" | "deny";
213
+ policyId: string;
214
+ ruleId: string;
215
+ reasonCode: string;
216
+ reasonText: string;
217
+ trace: Record<string, unknown>;
218
+ }, {
219
+ correlationId: string;
220
+ mode: "monitor" | "enforce";
221
+ decision: "allow" | "deny";
222
+ policyId: string;
223
+ ruleId: string;
224
+ reasonCode: string;
225
+ reasonText: string;
226
+ trace: Record<string, unknown>;
227
+ }>, "many">>;
228
+ entitlementDecision: z.ZodOptional<z.ZodObject<{
229
+ id: z.ZodString;
230
+ reasonCode: z.ZodString;
231
+ reasonText: z.ZodString;
232
+ entitled: z.ZodBoolean;
233
+ }, "strip", z.ZodTypeAny, {
234
+ id: string;
235
+ reasonCode: string;
236
+ reasonText: string;
237
+ entitled: boolean;
238
+ }, {
239
+ id: string;
240
+ reasonCode: string;
241
+ reasonText: string;
242
+ entitled: boolean;
243
+ }>>;
244
+ usageEntry: z.ZodOptional<z.ZodObject<{
245
+ id: z.ZodString;
246
+ quantity: z.ZodNumber;
247
+ }, "strip", z.ZodTypeAny, {
248
+ id: string;
249
+ quantity: number;
250
+ }, {
251
+ id: string;
252
+ quantity: number;
253
+ }>>;
254
+ boundaryDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
255
+ action: z.ZodEnum<["allow", "block", "redact", "mask", "escalate"]>;
256
+ reasonCode: z.ZodString;
257
+ reasonText: z.ZodString;
258
+ policyId: z.ZodOptional<z.ZodString>;
259
+ ruleId: z.ZodOptional<z.ZodString>;
260
+ classification: z.ZodOptional<z.ZodString>;
261
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
262
+ maskedFields: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ reasonCode: string;
265
+ reasonText: string;
266
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
267
+ tags: string[];
268
+ maskedFields: string[];
269
+ policyId?: string | undefined;
270
+ ruleId?: string | undefined;
271
+ classification?: string | undefined;
272
+ }, {
273
+ reasonCode: string;
274
+ reasonText: string;
275
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
276
+ policyId?: string | undefined;
277
+ ruleId?: string | undefined;
278
+ classification?: string | undefined;
279
+ tags?: string[] | undefined;
280
+ maskedFields?: string[] | undefined;
281
+ }>>>;
282
+ firewallDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
283
+ action: z.ZodEnum<["allow", "sanitize", "deny"]>;
284
+ reasonCode: z.ZodString;
285
+ reasonText: z.ZodString;
286
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
287
+ ruleKey: z.ZodString;
288
+ category: z.ZodEnum<["prompt_injection", "secret", "pii", "malicious_payload"]>;
289
+ severity: z.ZodEnum<["low", "med", "high", "critical"]>;
290
+ target: z.ZodEnum<["input", "output", "tool_call", "payload"]>;
291
+ fieldPath: z.ZodString;
292
+ matchPreview: z.ZodString;
293
+ }, "strip", z.ZodTypeAny, {
294
+ target: "input" | "payload" | "output" | "tool_call";
295
+ severity: "low" | "high" | "critical" | "med";
296
+ ruleKey: string;
297
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
298
+ fieldPath: string;
299
+ matchPreview: string;
300
+ }, {
301
+ target: "input" | "payload" | "output" | "tool_call";
302
+ severity: "low" | "high" | "critical" | "med";
303
+ ruleKey: string;
304
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
305
+ fieldPath: string;
306
+ matchPreview: string;
307
+ }>, "many">>;
308
+ redactions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
309
+ blockedTools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
310
+ blockedDomains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
311
+ sanitizedPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
312
+ score: z.ZodNumber;
313
+ }, "strip", z.ZodTypeAny, {
314
+ score: number;
315
+ reasonCode: string;
316
+ reasonText: string;
317
+ action: "allow" | "deny" | "sanitize";
318
+ findings: {
319
+ target: "input" | "payload" | "output" | "tool_call";
320
+ severity: "low" | "high" | "critical" | "med";
321
+ ruleKey: string;
322
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
323
+ fieldPath: string;
324
+ matchPreview: string;
325
+ }[];
326
+ redactions: string[];
327
+ blockedTools: string[];
328
+ blockedDomains: string[];
329
+ sanitizedPayload?: Record<string, unknown> | undefined;
330
+ }, {
331
+ score: number;
332
+ reasonCode: string;
333
+ reasonText: string;
334
+ action: "allow" | "deny" | "sanitize";
335
+ findings?: {
336
+ target: "input" | "payload" | "output" | "tool_call";
337
+ severity: "low" | "high" | "critical" | "med";
338
+ ruleKey: string;
339
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
340
+ fieldPath: string;
341
+ matchPreview: string;
342
+ }[] | undefined;
343
+ redactions?: string[] | undefined;
344
+ blockedTools?: string[] | undefined;
345
+ blockedDomains?: string[] | undefined;
346
+ sanitizedPayload?: Record<string, unknown> | undefined;
347
+ }>>>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ run: {
350
+ id: string;
351
+ workspaceId: string;
352
+ workflowVersionId: string;
353
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
354
+ correlationId: string;
355
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
356
+ requestedBy: string;
357
+ requestedAt: string;
358
+ idempotencyKey?: string | null | undefined;
359
+ startedAt?: string | null | undefined;
360
+ completedAt?: string | null | undefined;
361
+ slaPolicyId?: string | null | undefined;
362
+ slaDueAt?: string | null | undefined;
363
+ slaViolatedAt?: string | null | undefined;
364
+ };
365
+ approval?: {
366
+ status: "approved" | "denied" | "pending";
367
+ id: string;
368
+ runId: string;
369
+ requiredRole: string;
370
+ createdAt: string;
371
+ decidedAt?: string | null | undefined;
372
+ decidedBy?: string | null | undefined;
373
+ } | null | undefined;
374
+ blocked?: boolean | undefined;
375
+ policyDecisions?: {
376
+ correlationId: string;
377
+ mode: "monitor" | "enforce";
378
+ decision: "allow" | "deny";
379
+ policyId: string;
380
+ ruleId: string;
381
+ reasonCode: string;
382
+ reasonText: string;
383
+ trace: Record<string, unknown>;
384
+ }[] | undefined;
385
+ entitlementDecision?: {
386
+ id: string;
387
+ reasonCode: string;
388
+ reasonText: string;
389
+ entitled: boolean;
390
+ } | undefined;
391
+ usageEntry?: {
392
+ id: string;
393
+ quantity: number;
394
+ } | undefined;
395
+ boundaryDecision?: {
396
+ reasonCode: string;
397
+ reasonText: string;
398
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
399
+ tags: string[];
400
+ maskedFields: string[];
401
+ policyId?: string | undefined;
402
+ ruleId?: string | undefined;
403
+ classification?: string | undefined;
404
+ } | null | undefined;
405
+ firewallDecision?: {
406
+ score: number;
407
+ reasonCode: string;
408
+ reasonText: string;
409
+ action: "allow" | "deny" | "sanitize";
410
+ findings: {
411
+ target: "input" | "payload" | "output" | "tool_call";
412
+ severity: "low" | "high" | "critical" | "med";
413
+ ruleKey: string;
414
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
415
+ fieldPath: string;
416
+ matchPreview: string;
417
+ }[];
418
+ redactions: string[];
419
+ blockedTools: string[];
420
+ blockedDomains: string[];
421
+ sanitizedPayload?: Record<string, unknown> | undefined;
422
+ } | null | undefined;
423
+ }, {
424
+ run: {
425
+ id: string;
426
+ workspaceId: string;
427
+ workflowVersionId: string;
428
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
429
+ correlationId: string;
430
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
431
+ requestedBy: string;
432
+ requestedAt: string;
433
+ idempotencyKey?: string | null | undefined;
434
+ startedAt?: string | null | undefined;
435
+ completedAt?: string | null | undefined;
436
+ slaPolicyId?: string | null | undefined;
437
+ slaDueAt?: string | null | undefined;
438
+ slaViolatedAt?: string | null | undefined;
439
+ };
440
+ approval?: {
441
+ status: "approved" | "denied" | "pending";
442
+ id: string;
443
+ runId: string;
444
+ requiredRole: string;
445
+ createdAt: string;
446
+ decidedAt?: string | null | undefined;
447
+ decidedBy?: string | null | undefined;
448
+ } | null | undefined;
449
+ blocked?: boolean | undefined;
450
+ policyDecisions?: {
451
+ correlationId: string;
452
+ mode: "monitor" | "enforce";
453
+ decision: "allow" | "deny";
454
+ policyId: string;
455
+ ruleId: string;
456
+ reasonCode: string;
457
+ reasonText: string;
458
+ trace: Record<string, unknown>;
459
+ }[] | undefined;
460
+ entitlementDecision?: {
461
+ id: string;
462
+ reasonCode: string;
463
+ reasonText: string;
464
+ entitled: boolean;
465
+ } | undefined;
466
+ usageEntry?: {
467
+ id: string;
468
+ quantity: number;
469
+ } | undefined;
470
+ boundaryDecision?: {
471
+ reasonCode: string;
472
+ reasonText: string;
473
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
474
+ policyId?: string | undefined;
475
+ ruleId?: string | undefined;
476
+ classification?: string | undefined;
477
+ tags?: string[] | undefined;
478
+ maskedFields?: string[] | undefined;
479
+ } | null | undefined;
480
+ firewallDecision?: {
481
+ score: number;
482
+ reasonCode: string;
483
+ reasonText: string;
484
+ action: "allow" | "deny" | "sanitize";
485
+ findings?: {
486
+ target: "input" | "payload" | "output" | "tool_call";
487
+ severity: "low" | "high" | "critical" | "med";
488
+ ruleKey: string;
489
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
490
+ fieldPath: string;
491
+ matchPreview: string;
492
+ }[] | undefined;
493
+ redactions?: string[] | undefined;
494
+ blockedTools?: string[] | undefined;
495
+ blockedDomains?: string[] | undefined;
496
+ sanitizedPayload?: Record<string, unknown> | undefined;
497
+ } | null | undefined;
498
+ }>;
499
+ declare const V4SessionStartDataSchema: z.ZodObject<{
500
+ session: z.ZodObject<{
501
+ sessionId: z.ZodString;
502
+ workspaceId: z.ZodString;
503
+ agent: z.ZodString;
504
+ subject: z.ZodOptional<z.ZodString>;
505
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
506
+ policy: z.ZodOptional<z.ZodObject<{
507
+ ref: z.ZodString;
508
+ version: z.ZodString;
509
+ }, "strip", z.ZodTypeAny, {
510
+ version: string;
511
+ ref: string;
512
+ }, {
513
+ version: string;
514
+ ref: string;
515
+ }>>;
516
+ route: z.ZodOptional<z.ZodObject<{
517
+ provider: z.ZodOptional<z.ZodString>;
518
+ model: z.ZodOptional<z.ZodString>;
519
+ region: z.ZodOptional<z.ZodString>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ provider?: string | undefined;
522
+ model?: string | undefined;
523
+ region?: string | undefined;
524
+ }, {
525
+ provider?: string | undefined;
526
+ model?: string | undefined;
527
+ region?: string | undefined;
528
+ }>>;
529
+ risk: z.ZodOptional<z.ZodObject<{
530
+ score: z.ZodOptional<z.ZodNumber>;
531
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
532
+ }, "strip", z.ZodTypeAny, {
533
+ score?: number | undefined;
534
+ decision?: "allow" | "deny" | "review" | undefined;
535
+ }, {
536
+ score?: number | undefined;
537
+ decision?: "allow" | "deny" | "review" | undefined;
538
+ }>>;
539
+ workflowVersionId: z.ZodOptional<z.ZodString>;
540
+ createdAt: z.ZodString;
541
+ expiresAt: z.ZodOptional<z.ZodString>;
542
+ }, "strip", z.ZodTypeAny, {
543
+ sessionId: string;
544
+ workspaceId: string;
545
+ createdAt: string;
546
+ agent: string;
547
+ workflowVersionId?: string | undefined;
548
+ policy?: {
549
+ version: string;
550
+ ref: string;
551
+ } | undefined;
552
+ route?: {
553
+ provider?: string | undefined;
554
+ model?: string | undefined;
555
+ region?: string | undefined;
556
+ } | undefined;
557
+ risk?: {
558
+ score?: number | undefined;
559
+ decision?: "allow" | "deny" | "review" | undefined;
560
+ } | undefined;
561
+ subject?: string | undefined;
562
+ metadata?: Record<string, unknown> | undefined;
563
+ expiresAt?: string | undefined;
564
+ }, {
565
+ sessionId: string;
566
+ workspaceId: string;
567
+ createdAt: string;
568
+ agent: string;
569
+ workflowVersionId?: string | undefined;
570
+ policy?: {
571
+ version: string;
572
+ ref: string;
573
+ } | undefined;
574
+ route?: {
575
+ provider?: string | undefined;
576
+ model?: string | undefined;
577
+ region?: string | undefined;
578
+ } | undefined;
579
+ risk?: {
580
+ score?: number | undefined;
581
+ decision?: "allow" | "deny" | "review" | undefined;
582
+ } | undefined;
583
+ subject?: string | undefined;
584
+ metadata?: Record<string, unknown> | undefined;
585
+ expiresAt?: string | undefined;
586
+ }>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ session: {
589
+ sessionId: string;
590
+ workspaceId: string;
591
+ createdAt: string;
592
+ agent: string;
593
+ workflowVersionId?: string | undefined;
594
+ policy?: {
595
+ version: string;
596
+ ref: string;
597
+ } | undefined;
598
+ route?: {
599
+ provider?: string | undefined;
600
+ model?: string | undefined;
601
+ region?: string | undefined;
602
+ } | undefined;
603
+ risk?: {
604
+ score?: number | undefined;
605
+ decision?: "allow" | "deny" | "review" | undefined;
606
+ } | undefined;
607
+ subject?: string | undefined;
608
+ metadata?: Record<string, unknown> | undefined;
609
+ expiresAt?: string | undefined;
610
+ };
611
+ }, {
612
+ session: {
613
+ sessionId: string;
614
+ workspaceId: string;
615
+ createdAt: string;
616
+ agent: string;
617
+ workflowVersionId?: string | undefined;
618
+ policy?: {
619
+ version: string;
620
+ ref: string;
621
+ } | undefined;
622
+ route?: {
623
+ provider?: string | undefined;
624
+ model?: string | undefined;
625
+ region?: string | undefined;
626
+ } | undefined;
627
+ risk?: {
628
+ score?: number | undefined;
629
+ decision?: "allow" | "deny" | "review" | undefined;
630
+ } | undefined;
631
+ subject?: string | undefined;
632
+ metadata?: Record<string, unknown> | undefined;
633
+ expiresAt?: string | undefined;
634
+ };
635
+ }>;
636
+ declare const V4SessionStartResponseSchema: z.ZodObject<{
637
+ ok: z.ZodBoolean;
638
+ data: z.ZodNullable<z.ZodObject<{
639
+ session: z.ZodObject<{
640
+ sessionId: z.ZodString;
641
+ workspaceId: z.ZodString;
642
+ agent: z.ZodString;
643
+ subject: z.ZodOptional<z.ZodString>;
644
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
645
+ policy: z.ZodOptional<z.ZodObject<{
646
+ ref: z.ZodString;
647
+ version: z.ZodString;
648
+ }, "strip", z.ZodTypeAny, {
649
+ version: string;
650
+ ref: string;
651
+ }, {
652
+ version: string;
653
+ ref: string;
654
+ }>>;
655
+ route: z.ZodOptional<z.ZodObject<{
656
+ provider: z.ZodOptional<z.ZodString>;
657
+ model: z.ZodOptional<z.ZodString>;
658
+ region: z.ZodOptional<z.ZodString>;
659
+ }, "strip", z.ZodTypeAny, {
660
+ provider?: string | undefined;
661
+ model?: string | undefined;
662
+ region?: string | undefined;
663
+ }, {
664
+ provider?: string | undefined;
665
+ model?: string | undefined;
666
+ region?: string | undefined;
667
+ }>>;
668
+ risk: z.ZodOptional<z.ZodObject<{
669
+ score: z.ZodOptional<z.ZodNumber>;
670
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ score?: number | undefined;
673
+ decision?: "allow" | "deny" | "review" | undefined;
674
+ }, {
675
+ score?: number | undefined;
676
+ decision?: "allow" | "deny" | "review" | undefined;
677
+ }>>;
678
+ workflowVersionId: z.ZodOptional<z.ZodString>;
679
+ createdAt: z.ZodString;
680
+ expiresAt: z.ZodOptional<z.ZodString>;
681
+ }, "strip", z.ZodTypeAny, {
682
+ sessionId: string;
683
+ workspaceId: string;
684
+ createdAt: string;
685
+ agent: string;
686
+ workflowVersionId?: string | undefined;
687
+ policy?: {
688
+ version: string;
689
+ ref: string;
690
+ } | undefined;
691
+ route?: {
692
+ provider?: string | undefined;
693
+ model?: string | undefined;
694
+ region?: string | undefined;
695
+ } | undefined;
696
+ risk?: {
697
+ score?: number | undefined;
698
+ decision?: "allow" | "deny" | "review" | undefined;
699
+ } | undefined;
700
+ subject?: string | undefined;
701
+ metadata?: Record<string, unknown> | undefined;
702
+ expiresAt?: string | undefined;
703
+ }, {
704
+ sessionId: string;
705
+ workspaceId: string;
706
+ createdAt: string;
707
+ agent: string;
708
+ workflowVersionId?: string | undefined;
709
+ policy?: {
710
+ version: string;
711
+ ref: string;
712
+ } | undefined;
713
+ route?: {
714
+ provider?: string | undefined;
715
+ model?: string | undefined;
716
+ region?: string | undefined;
717
+ } | undefined;
718
+ risk?: {
719
+ score?: number | undefined;
720
+ decision?: "allow" | "deny" | "review" | undefined;
721
+ } | undefined;
722
+ subject?: string | undefined;
723
+ metadata?: Record<string, unknown> | undefined;
724
+ expiresAt?: string | undefined;
725
+ }>;
726
+ }, "strip", z.ZodTypeAny, {
727
+ session: {
728
+ sessionId: string;
729
+ workspaceId: string;
730
+ createdAt: string;
731
+ agent: string;
732
+ workflowVersionId?: string | undefined;
733
+ policy?: {
734
+ version: string;
735
+ ref: string;
736
+ } | undefined;
737
+ route?: {
738
+ provider?: string | undefined;
739
+ model?: string | undefined;
740
+ region?: string | undefined;
741
+ } | undefined;
742
+ risk?: {
743
+ score?: number | undefined;
744
+ decision?: "allow" | "deny" | "review" | undefined;
745
+ } | undefined;
746
+ subject?: string | undefined;
747
+ metadata?: Record<string, unknown> | undefined;
748
+ expiresAt?: string | undefined;
749
+ };
750
+ }, {
751
+ session: {
752
+ sessionId: string;
753
+ workspaceId: string;
754
+ createdAt: string;
755
+ agent: string;
756
+ workflowVersionId?: string | undefined;
757
+ policy?: {
758
+ version: string;
759
+ ref: string;
760
+ } | undefined;
761
+ route?: {
762
+ provider?: string | undefined;
763
+ model?: string | undefined;
764
+ region?: string | undefined;
765
+ } | undefined;
766
+ risk?: {
767
+ score?: number | undefined;
768
+ decision?: "allow" | "deny" | "review" | undefined;
769
+ } | undefined;
770
+ subject?: string | undefined;
771
+ metadata?: Record<string, unknown> | undefined;
772
+ expiresAt?: string | undefined;
773
+ };
774
+ }>>;
775
+ meta: z.ZodObject<{
776
+ requestId: z.ZodString;
777
+ sessionId: z.ZodOptional<z.ZodString>;
778
+ executionId: z.ZodOptional<z.ZodString>;
779
+ lineageId: z.ZodOptional<z.ZodString>;
780
+ policy: z.ZodOptional<z.ZodObject<{
781
+ ref: z.ZodString;
782
+ version: z.ZodString;
783
+ }, "strip", z.ZodTypeAny, {
784
+ version: string;
785
+ ref: string;
786
+ }, {
787
+ version: string;
788
+ ref: string;
789
+ }>>;
790
+ route: z.ZodOptional<z.ZodObject<{
791
+ provider: z.ZodOptional<z.ZodString>;
792
+ model: z.ZodOptional<z.ZodString>;
793
+ region: z.ZodOptional<z.ZodString>;
794
+ }, "strip", z.ZodTypeAny, {
795
+ provider?: string | undefined;
796
+ model?: string | undefined;
797
+ region?: string | undefined;
798
+ }, {
799
+ provider?: string | undefined;
800
+ model?: string | undefined;
801
+ region?: string | undefined;
802
+ }>>;
803
+ risk: z.ZodOptional<z.ZodObject<{
804
+ score: z.ZodOptional<z.ZodNumber>;
805
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
806
+ }, "strip", z.ZodTypeAny, {
807
+ score?: number | undefined;
808
+ decision?: "allow" | "deny" | "review" | undefined;
809
+ }, {
810
+ score?: number | undefined;
811
+ decision?: "allow" | "deny" | "review" | undefined;
812
+ }>>;
813
+ timingMs: z.ZodObject<{
814
+ total: z.ZodNumber;
815
+ policy: z.ZodOptional<z.ZodNumber>;
816
+ route: z.ZodOptional<z.ZodNumber>;
817
+ tool: z.ZodOptional<z.ZodNumber>;
818
+ }, "strip", z.ZodTypeAny, {
819
+ total: number;
820
+ policy?: number | undefined;
821
+ route?: number | undefined;
822
+ tool?: number | undefined;
823
+ }, {
824
+ total: number;
825
+ policy?: number | undefined;
826
+ route?: number | undefined;
827
+ tool?: number | undefined;
828
+ }>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ requestId: string;
831
+ timingMs: {
832
+ total: number;
833
+ policy?: number | undefined;
834
+ route?: number | undefined;
835
+ tool?: number | undefined;
836
+ };
837
+ policy?: {
838
+ version: string;
839
+ ref: string;
840
+ } | undefined;
841
+ route?: {
842
+ provider?: string | undefined;
843
+ model?: string | undefined;
844
+ region?: string | undefined;
845
+ } | undefined;
846
+ sessionId?: string | undefined;
847
+ executionId?: string | undefined;
848
+ lineageId?: string | undefined;
849
+ risk?: {
850
+ score?: number | undefined;
851
+ decision?: "allow" | "deny" | "review" | undefined;
852
+ } | undefined;
853
+ }, {
854
+ requestId: string;
855
+ timingMs: {
856
+ total: number;
857
+ policy?: number | undefined;
858
+ route?: number | undefined;
859
+ tool?: number | undefined;
860
+ };
861
+ policy?: {
862
+ version: string;
863
+ ref: string;
864
+ } | undefined;
865
+ route?: {
866
+ provider?: string | undefined;
867
+ model?: string | undefined;
868
+ region?: string | undefined;
869
+ } | undefined;
870
+ sessionId?: string | undefined;
871
+ executionId?: string | undefined;
872
+ lineageId?: string | undefined;
873
+ risk?: {
874
+ score?: number | undefined;
875
+ decision?: "allow" | "deny" | "review" | undefined;
876
+ } | undefined;
877
+ }>;
878
+ error: z.ZodNullable<z.ZodObject<{
879
+ code: z.ZodString;
880
+ message: z.ZodString;
881
+ status: z.ZodNumber;
882
+ retryable: z.ZodBoolean;
883
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
884
+ }, "strip", z.ZodTypeAny, {
885
+ code: string;
886
+ message: string;
887
+ status: number;
888
+ retryable: boolean;
889
+ details?: Record<string, unknown> | undefined;
890
+ }, {
891
+ code: string;
892
+ message: string;
893
+ status: number;
894
+ retryable: boolean;
895
+ details?: Record<string, unknown> | undefined;
896
+ }>>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ error: {
899
+ code: string;
900
+ message: string;
901
+ status: number;
902
+ retryable: boolean;
903
+ details?: Record<string, unknown> | undefined;
904
+ } | null;
905
+ ok: boolean;
906
+ data: {
907
+ session: {
908
+ sessionId: string;
909
+ workspaceId: string;
910
+ createdAt: string;
911
+ agent: string;
912
+ workflowVersionId?: string | undefined;
913
+ policy?: {
914
+ version: string;
915
+ ref: string;
916
+ } | undefined;
917
+ route?: {
918
+ provider?: string | undefined;
919
+ model?: string | undefined;
920
+ region?: string | undefined;
921
+ } | undefined;
922
+ risk?: {
923
+ score?: number | undefined;
924
+ decision?: "allow" | "deny" | "review" | undefined;
925
+ } | undefined;
926
+ subject?: string | undefined;
927
+ metadata?: Record<string, unknown> | undefined;
928
+ expiresAt?: string | undefined;
929
+ };
930
+ } | null;
931
+ meta: {
932
+ requestId: string;
933
+ timingMs: {
934
+ total: number;
935
+ policy?: number | undefined;
936
+ route?: number | undefined;
937
+ tool?: number | undefined;
938
+ };
939
+ policy?: {
940
+ version: string;
941
+ ref: string;
942
+ } | undefined;
943
+ route?: {
944
+ provider?: string | undefined;
945
+ model?: string | undefined;
946
+ region?: string | undefined;
947
+ } | undefined;
948
+ sessionId?: string | undefined;
949
+ executionId?: string | undefined;
950
+ lineageId?: string | undefined;
951
+ risk?: {
952
+ score?: number | undefined;
953
+ decision?: "allow" | "deny" | "review" | undefined;
954
+ } | undefined;
955
+ };
956
+ }, {
957
+ error: {
958
+ code: string;
959
+ message: string;
960
+ status: number;
961
+ retryable: boolean;
962
+ details?: Record<string, unknown> | undefined;
963
+ } | null;
964
+ ok: boolean;
965
+ data: {
966
+ session: {
967
+ sessionId: string;
968
+ workspaceId: string;
969
+ createdAt: string;
970
+ agent: string;
971
+ workflowVersionId?: string | undefined;
972
+ policy?: {
973
+ version: string;
974
+ ref: string;
975
+ } | undefined;
976
+ route?: {
977
+ provider?: string | undefined;
978
+ model?: string | undefined;
979
+ region?: string | undefined;
980
+ } | undefined;
981
+ risk?: {
982
+ score?: number | undefined;
983
+ decision?: "allow" | "deny" | "review" | undefined;
984
+ } | undefined;
985
+ subject?: string | undefined;
986
+ metadata?: Record<string, unknown> | undefined;
987
+ expiresAt?: string | undefined;
988
+ };
989
+ } | null;
990
+ meta: {
991
+ requestId: string;
992
+ timingMs: {
993
+ total: number;
994
+ policy?: number | undefined;
995
+ route?: number | undefined;
996
+ tool?: number | undefined;
997
+ };
998
+ policy?: {
999
+ version: string;
1000
+ ref: string;
1001
+ } | undefined;
1002
+ route?: {
1003
+ provider?: string | undefined;
1004
+ model?: string | undefined;
1005
+ region?: string | undefined;
1006
+ } | undefined;
1007
+ sessionId?: string | undefined;
1008
+ executionId?: string | undefined;
1009
+ lineageId?: string | undefined;
1010
+ risk?: {
1011
+ score?: number | undefined;
1012
+ decision?: "allow" | "deny" | "review" | undefined;
1013
+ } | undefined;
1014
+ };
1015
+ }>;
1016
+ declare const V4ExecutionResponseSchema: z.ZodObject<{
1017
+ ok: z.ZodBoolean;
1018
+ data: z.ZodNullable<z.ZodObject<{
1019
+ run: z.ZodObject<{
1020
+ id: z.ZodString;
1021
+ workspaceId: z.ZodString;
1022
+ workflowVersionId: z.ZodString;
1023
+ state: z.ZodEnum<["queued", "running", "waiting_approval", "approved", "denied", "succeeded", "failed", "aborted", "timed_out", "canceled"]>;
1024
+ correlationId: z.ZodString;
1025
+ idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1026
+ triggerSource: z.ZodEnum<["ui", "api", "sdk", "cli", "hosted", "webhook"]>;
1027
+ requestedBy: z.ZodString;
1028
+ requestedAt: z.ZodString;
1029
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1030
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1031
+ slaPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1032
+ slaDueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1033
+ slaViolatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1034
+ }, "strip", z.ZodTypeAny, {
1035
+ id: string;
1036
+ workspaceId: string;
1037
+ workflowVersionId: string;
1038
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1039
+ correlationId: string;
1040
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1041
+ requestedBy: string;
1042
+ requestedAt: string;
1043
+ idempotencyKey?: string | null | undefined;
1044
+ startedAt?: string | null | undefined;
1045
+ completedAt?: string | null | undefined;
1046
+ slaPolicyId?: string | null | undefined;
1047
+ slaDueAt?: string | null | undefined;
1048
+ slaViolatedAt?: string | null | undefined;
1049
+ }, {
1050
+ id: string;
1051
+ workspaceId: string;
1052
+ workflowVersionId: string;
1053
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1054
+ correlationId: string;
1055
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1056
+ requestedBy: string;
1057
+ requestedAt: string;
1058
+ idempotencyKey?: string | null | undefined;
1059
+ startedAt?: string | null | undefined;
1060
+ completedAt?: string | null | undefined;
1061
+ slaPolicyId?: string | null | undefined;
1062
+ slaDueAt?: string | null | undefined;
1063
+ slaViolatedAt?: string | null | undefined;
1064
+ }>;
1065
+ approval: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1066
+ id: z.ZodString;
1067
+ runId: z.ZodString;
1068
+ requiredRole: z.ZodString;
1069
+ status: z.ZodEnum<["pending", "approved", "denied"]>;
1070
+ createdAt: z.ZodString;
1071
+ decidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1072
+ decidedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ status: "approved" | "denied" | "pending";
1075
+ id: string;
1076
+ runId: string;
1077
+ requiredRole: string;
1078
+ createdAt: string;
1079
+ decidedAt?: string | null | undefined;
1080
+ decidedBy?: string | null | undefined;
1081
+ }, {
1082
+ status: "approved" | "denied" | "pending";
1083
+ id: string;
1084
+ runId: string;
1085
+ requiredRole: string;
1086
+ createdAt: string;
1087
+ decidedAt?: string | null | undefined;
1088
+ decidedBy?: string | null | undefined;
1089
+ }>>>;
1090
+ blocked: z.ZodOptional<z.ZodBoolean>;
1091
+ policyDecisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1092
+ mode: z.ZodEnum<["monitor", "enforce"]>;
1093
+ decision: z.ZodEnum<["allow", "deny"]>;
1094
+ policyId: z.ZodString;
1095
+ ruleId: z.ZodString;
1096
+ reasonCode: z.ZodString;
1097
+ reasonText: z.ZodString;
1098
+ correlationId: z.ZodString;
1099
+ trace: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1100
+ }, "strip", z.ZodTypeAny, {
1101
+ correlationId: string;
1102
+ mode: "monitor" | "enforce";
1103
+ decision: "allow" | "deny";
1104
+ policyId: string;
1105
+ ruleId: string;
1106
+ reasonCode: string;
1107
+ reasonText: string;
1108
+ trace: Record<string, unknown>;
1109
+ }, {
1110
+ correlationId: string;
1111
+ mode: "monitor" | "enforce";
1112
+ decision: "allow" | "deny";
1113
+ policyId: string;
1114
+ ruleId: string;
1115
+ reasonCode: string;
1116
+ reasonText: string;
1117
+ trace: Record<string, unknown>;
1118
+ }>, "many">>;
1119
+ entitlementDecision: z.ZodOptional<z.ZodObject<{
1120
+ id: z.ZodString;
1121
+ reasonCode: z.ZodString;
1122
+ reasonText: z.ZodString;
1123
+ entitled: z.ZodBoolean;
1124
+ }, "strip", z.ZodTypeAny, {
1125
+ id: string;
1126
+ reasonCode: string;
1127
+ reasonText: string;
1128
+ entitled: boolean;
1129
+ }, {
1130
+ id: string;
1131
+ reasonCode: string;
1132
+ reasonText: string;
1133
+ entitled: boolean;
1134
+ }>>;
1135
+ usageEntry: z.ZodOptional<z.ZodObject<{
1136
+ id: z.ZodString;
1137
+ quantity: z.ZodNumber;
1138
+ }, "strip", z.ZodTypeAny, {
1139
+ id: string;
1140
+ quantity: number;
1141
+ }, {
1142
+ id: string;
1143
+ quantity: number;
1144
+ }>>;
1145
+ boundaryDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1146
+ action: z.ZodEnum<["allow", "block", "redact", "mask", "escalate"]>;
1147
+ reasonCode: z.ZodString;
1148
+ reasonText: z.ZodString;
1149
+ policyId: z.ZodOptional<z.ZodString>;
1150
+ ruleId: z.ZodOptional<z.ZodString>;
1151
+ classification: z.ZodOptional<z.ZodString>;
1152
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1153
+ maskedFields: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1154
+ }, "strip", z.ZodTypeAny, {
1155
+ reasonCode: string;
1156
+ reasonText: string;
1157
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1158
+ tags: string[];
1159
+ maskedFields: string[];
1160
+ policyId?: string | undefined;
1161
+ ruleId?: string | undefined;
1162
+ classification?: string | undefined;
1163
+ }, {
1164
+ reasonCode: string;
1165
+ reasonText: string;
1166
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1167
+ policyId?: string | undefined;
1168
+ ruleId?: string | undefined;
1169
+ classification?: string | undefined;
1170
+ tags?: string[] | undefined;
1171
+ maskedFields?: string[] | undefined;
1172
+ }>>>;
1173
+ firewallDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1174
+ action: z.ZodEnum<["allow", "sanitize", "deny"]>;
1175
+ reasonCode: z.ZodString;
1176
+ reasonText: z.ZodString;
1177
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1178
+ ruleKey: z.ZodString;
1179
+ category: z.ZodEnum<["prompt_injection", "secret", "pii", "malicious_payload"]>;
1180
+ severity: z.ZodEnum<["low", "med", "high", "critical"]>;
1181
+ target: z.ZodEnum<["input", "output", "tool_call", "payload"]>;
1182
+ fieldPath: z.ZodString;
1183
+ matchPreview: z.ZodString;
1184
+ }, "strip", z.ZodTypeAny, {
1185
+ target: "input" | "payload" | "output" | "tool_call";
1186
+ severity: "low" | "high" | "critical" | "med";
1187
+ ruleKey: string;
1188
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1189
+ fieldPath: string;
1190
+ matchPreview: string;
1191
+ }, {
1192
+ target: "input" | "payload" | "output" | "tool_call";
1193
+ severity: "low" | "high" | "critical" | "med";
1194
+ ruleKey: string;
1195
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1196
+ fieldPath: string;
1197
+ matchPreview: string;
1198
+ }>, "many">>;
1199
+ redactions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1200
+ blockedTools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1201
+ blockedDomains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1202
+ sanitizedPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1203
+ score: z.ZodNumber;
1204
+ }, "strip", z.ZodTypeAny, {
1205
+ score: number;
1206
+ reasonCode: string;
1207
+ reasonText: string;
1208
+ action: "allow" | "deny" | "sanitize";
1209
+ findings: {
1210
+ target: "input" | "payload" | "output" | "tool_call";
1211
+ severity: "low" | "high" | "critical" | "med";
1212
+ ruleKey: string;
1213
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1214
+ fieldPath: string;
1215
+ matchPreview: string;
1216
+ }[];
1217
+ redactions: string[];
1218
+ blockedTools: string[];
1219
+ blockedDomains: string[];
1220
+ sanitizedPayload?: Record<string, unknown> | undefined;
1221
+ }, {
1222
+ score: number;
1223
+ reasonCode: string;
1224
+ reasonText: string;
1225
+ action: "allow" | "deny" | "sanitize";
1226
+ findings?: {
1227
+ target: "input" | "payload" | "output" | "tool_call";
1228
+ severity: "low" | "high" | "critical" | "med";
1229
+ ruleKey: string;
1230
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1231
+ fieldPath: string;
1232
+ matchPreview: string;
1233
+ }[] | undefined;
1234
+ redactions?: string[] | undefined;
1235
+ blockedTools?: string[] | undefined;
1236
+ blockedDomains?: string[] | undefined;
1237
+ sanitizedPayload?: Record<string, unknown> | undefined;
1238
+ }>>>;
1239
+ }, "strip", z.ZodTypeAny, {
1240
+ run: {
1241
+ id: string;
1242
+ workspaceId: string;
1243
+ workflowVersionId: string;
1244
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1245
+ correlationId: string;
1246
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1247
+ requestedBy: string;
1248
+ requestedAt: string;
1249
+ idempotencyKey?: string | null | undefined;
1250
+ startedAt?: string | null | undefined;
1251
+ completedAt?: string | null | undefined;
1252
+ slaPolicyId?: string | null | undefined;
1253
+ slaDueAt?: string | null | undefined;
1254
+ slaViolatedAt?: string | null | undefined;
1255
+ };
1256
+ approval?: {
1257
+ status: "approved" | "denied" | "pending";
1258
+ id: string;
1259
+ runId: string;
1260
+ requiredRole: string;
1261
+ createdAt: string;
1262
+ decidedAt?: string | null | undefined;
1263
+ decidedBy?: string | null | undefined;
1264
+ } | null | undefined;
1265
+ blocked?: boolean | undefined;
1266
+ policyDecisions?: {
1267
+ correlationId: string;
1268
+ mode: "monitor" | "enforce";
1269
+ decision: "allow" | "deny";
1270
+ policyId: string;
1271
+ ruleId: string;
1272
+ reasonCode: string;
1273
+ reasonText: string;
1274
+ trace: Record<string, unknown>;
1275
+ }[] | undefined;
1276
+ entitlementDecision?: {
1277
+ id: string;
1278
+ reasonCode: string;
1279
+ reasonText: string;
1280
+ entitled: boolean;
1281
+ } | undefined;
1282
+ usageEntry?: {
1283
+ id: string;
1284
+ quantity: number;
1285
+ } | undefined;
1286
+ boundaryDecision?: {
1287
+ reasonCode: string;
1288
+ reasonText: string;
1289
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1290
+ tags: string[];
1291
+ maskedFields: string[];
1292
+ policyId?: string | undefined;
1293
+ ruleId?: string | undefined;
1294
+ classification?: string | undefined;
1295
+ } | null | undefined;
1296
+ firewallDecision?: {
1297
+ score: number;
1298
+ reasonCode: string;
1299
+ reasonText: string;
1300
+ action: "allow" | "deny" | "sanitize";
1301
+ findings: {
1302
+ target: "input" | "payload" | "output" | "tool_call";
1303
+ severity: "low" | "high" | "critical" | "med";
1304
+ ruleKey: string;
1305
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1306
+ fieldPath: string;
1307
+ matchPreview: string;
1308
+ }[];
1309
+ redactions: string[];
1310
+ blockedTools: string[];
1311
+ blockedDomains: string[];
1312
+ sanitizedPayload?: Record<string, unknown> | undefined;
1313
+ } | null | undefined;
1314
+ }, {
1315
+ run: {
1316
+ id: string;
1317
+ workspaceId: string;
1318
+ workflowVersionId: string;
1319
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1320
+ correlationId: string;
1321
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1322
+ requestedBy: string;
1323
+ requestedAt: string;
1324
+ idempotencyKey?: string | null | undefined;
1325
+ startedAt?: string | null | undefined;
1326
+ completedAt?: string | null | undefined;
1327
+ slaPolicyId?: string | null | undefined;
1328
+ slaDueAt?: string | null | undefined;
1329
+ slaViolatedAt?: string | null | undefined;
1330
+ };
1331
+ approval?: {
1332
+ status: "approved" | "denied" | "pending";
1333
+ id: string;
1334
+ runId: string;
1335
+ requiredRole: string;
1336
+ createdAt: string;
1337
+ decidedAt?: string | null | undefined;
1338
+ decidedBy?: string | null | undefined;
1339
+ } | null | undefined;
1340
+ blocked?: boolean | undefined;
1341
+ policyDecisions?: {
1342
+ correlationId: string;
1343
+ mode: "monitor" | "enforce";
1344
+ decision: "allow" | "deny";
1345
+ policyId: string;
1346
+ ruleId: string;
1347
+ reasonCode: string;
1348
+ reasonText: string;
1349
+ trace: Record<string, unknown>;
1350
+ }[] | undefined;
1351
+ entitlementDecision?: {
1352
+ id: string;
1353
+ reasonCode: string;
1354
+ reasonText: string;
1355
+ entitled: boolean;
1356
+ } | undefined;
1357
+ usageEntry?: {
1358
+ id: string;
1359
+ quantity: number;
1360
+ } | undefined;
1361
+ boundaryDecision?: {
1362
+ reasonCode: string;
1363
+ reasonText: string;
1364
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1365
+ policyId?: string | undefined;
1366
+ ruleId?: string | undefined;
1367
+ classification?: string | undefined;
1368
+ tags?: string[] | undefined;
1369
+ maskedFields?: string[] | undefined;
1370
+ } | null | undefined;
1371
+ firewallDecision?: {
1372
+ score: number;
1373
+ reasonCode: string;
1374
+ reasonText: string;
1375
+ action: "allow" | "deny" | "sanitize";
1376
+ findings?: {
1377
+ target: "input" | "payload" | "output" | "tool_call";
1378
+ severity: "low" | "high" | "critical" | "med";
1379
+ ruleKey: string;
1380
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1381
+ fieldPath: string;
1382
+ matchPreview: string;
1383
+ }[] | undefined;
1384
+ redactions?: string[] | undefined;
1385
+ blockedTools?: string[] | undefined;
1386
+ blockedDomains?: string[] | undefined;
1387
+ sanitizedPayload?: Record<string, unknown> | undefined;
1388
+ } | null | undefined;
1389
+ }>>;
1390
+ meta: z.ZodObject<{
1391
+ requestId: z.ZodString;
1392
+ sessionId: z.ZodOptional<z.ZodString>;
1393
+ executionId: z.ZodOptional<z.ZodString>;
1394
+ lineageId: z.ZodOptional<z.ZodString>;
1395
+ policy: z.ZodOptional<z.ZodObject<{
1396
+ ref: z.ZodString;
1397
+ version: z.ZodString;
1398
+ }, "strip", z.ZodTypeAny, {
1399
+ version: string;
1400
+ ref: string;
1401
+ }, {
1402
+ version: string;
1403
+ ref: string;
1404
+ }>>;
1405
+ route: z.ZodOptional<z.ZodObject<{
1406
+ provider: z.ZodOptional<z.ZodString>;
1407
+ model: z.ZodOptional<z.ZodString>;
1408
+ region: z.ZodOptional<z.ZodString>;
1409
+ }, "strip", z.ZodTypeAny, {
1410
+ provider?: string | undefined;
1411
+ model?: string | undefined;
1412
+ region?: string | undefined;
1413
+ }, {
1414
+ provider?: string | undefined;
1415
+ model?: string | undefined;
1416
+ region?: string | undefined;
1417
+ }>>;
1418
+ risk: z.ZodOptional<z.ZodObject<{
1419
+ score: z.ZodOptional<z.ZodNumber>;
1420
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
1421
+ }, "strip", z.ZodTypeAny, {
1422
+ score?: number | undefined;
1423
+ decision?: "allow" | "deny" | "review" | undefined;
1424
+ }, {
1425
+ score?: number | undefined;
1426
+ decision?: "allow" | "deny" | "review" | undefined;
1427
+ }>>;
1428
+ timingMs: z.ZodObject<{
1429
+ total: z.ZodNumber;
1430
+ policy: z.ZodOptional<z.ZodNumber>;
1431
+ route: z.ZodOptional<z.ZodNumber>;
1432
+ tool: z.ZodOptional<z.ZodNumber>;
1433
+ }, "strip", z.ZodTypeAny, {
1434
+ total: number;
1435
+ policy?: number | undefined;
1436
+ route?: number | undefined;
1437
+ tool?: number | undefined;
1438
+ }, {
1439
+ total: number;
1440
+ policy?: number | undefined;
1441
+ route?: number | undefined;
1442
+ tool?: number | undefined;
1443
+ }>;
1444
+ }, "strip", z.ZodTypeAny, {
1445
+ requestId: string;
1446
+ timingMs: {
1447
+ total: number;
1448
+ policy?: number | undefined;
1449
+ route?: number | undefined;
1450
+ tool?: number | undefined;
1451
+ };
1452
+ policy?: {
1453
+ version: string;
1454
+ ref: string;
1455
+ } | undefined;
1456
+ route?: {
1457
+ provider?: string | undefined;
1458
+ model?: string | undefined;
1459
+ region?: string | undefined;
1460
+ } | undefined;
1461
+ sessionId?: string | undefined;
1462
+ executionId?: string | undefined;
1463
+ lineageId?: string | undefined;
1464
+ risk?: {
1465
+ score?: number | undefined;
1466
+ decision?: "allow" | "deny" | "review" | undefined;
1467
+ } | undefined;
1468
+ }, {
1469
+ requestId: string;
1470
+ timingMs: {
1471
+ total: number;
1472
+ policy?: number | undefined;
1473
+ route?: number | undefined;
1474
+ tool?: number | undefined;
1475
+ };
1476
+ policy?: {
1477
+ version: string;
1478
+ ref: string;
1479
+ } | undefined;
1480
+ route?: {
1481
+ provider?: string | undefined;
1482
+ model?: string | undefined;
1483
+ region?: string | undefined;
1484
+ } | undefined;
1485
+ sessionId?: string | undefined;
1486
+ executionId?: string | undefined;
1487
+ lineageId?: string | undefined;
1488
+ risk?: {
1489
+ score?: number | undefined;
1490
+ decision?: "allow" | "deny" | "review" | undefined;
1491
+ } | undefined;
1492
+ }>;
1493
+ error: z.ZodNullable<z.ZodObject<{
1494
+ code: z.ZodString;
1495
+ message: z.ZodString;
1496
+ status: z.ZodNumber;
1497
+ retryable: z.ZodBoolean;
1498
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1499
+ }, "strip", z.ZodTypeAny, {
1500
+ code: string;
1501
+ message: string;
1502
+ status: number;
1503
+ retryable: boolean;
1504
+ details?: Record<string, unknown> | undefined;
1505
+ }, {
1506
+ code: string;
1507
+ message: string;
1508
+ status: number;
1509
+ retryable: boolean;
1510
+ details?: Record<string, unknown> | undefined;
1511
+ }>>;
1512
+ }, "strip", z.ZodTypeAny, {
1513
+ error: {
1514
+ code: string;
1515
+ message: string;
1516
+ status: number;
1517
+ retryable: boolean;
1518
+ details?: Record<string, unknown> | undefined;
1519
+ } | null;
1520
+ ok: boolean;
1521
+ data: {
1522
+ run: {
1523
+ id: string;
1524
+ workspaceId: string;
1525
+ workflowVersionId: string;
1526
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1527
+ correlationId: string;
1528
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1529
+ requestedBy: string;
1530
+ requestedAt: string;
1531
+ idempotencyKey?: string | null | undefined;
1532
+ startedAt?: string | null | undefined;
1533
+ completedAt?: string | null | undefined;
1534
+ slaPolicyId?: string | null | undefined;
1535
+ slaDueAt?: string | null | undefined;
1536
+ slaViolatedAt?: string | null | undefined;
1537
+ };
1538
+ approval?: {
1539
+ status: "approved" | "denied" | "pending";
1540
+ id: string;
1541
+ runId: string;
1542
+ requiredRole: string;
1543
+ createdAt: string;
1544
+ decidedAt?: string | null | undefined;
1545
+ decidedBy?: string | null | undefined;
1546
+ } | null | undefined;
1547
+ blocked?: boolean | undefined;
1548
+ policyDecisions?: {
1549
+ correlationId: string;
1550
+ mode: "monitor" | "enforce";
1551
+ decision: "allow" | "deny";
1552
+ policyId: string;
1553
+ ruleId: string;
1554
+ reasonCode: string;
1555
+ reasonText: string;
1556
+ trace: Record<string, unknown>;
1557
+ }[] | undefined;
1558
+ entitlementDecision?: {
1559
+ id: string;
1560
+ reasonCode: string;
1561
+ reasonText: string;
1562
+ entitled: boolean;
1563
+ } | undefined;
1564
+ usageEntry?: {
1565
+ id: string;
1566
+ quantity: number;
1567
+ } | undefined;
1568
+ boundaryDecision?: {
1569
+ reasonCode: string;
1570
+ reasonText: string;
1571
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1572
+ tags: string[];
1573
+ maskedFields: string[];
1574
+ policyId?: string | undefined;
1575
+ ruleId?: string | undefined;
1576
+ classification?: string | undefined;
1577
+ } | null | undefined;
1578
+ firewallDecision?: {
1579
+ score: number;
1580
+ reasonCode: string;
1581
+ reasonText: string;
1582
+ action: "allow" | "deny" | "sanitize";
1583
+ findings: {
1584
+ target: "input" | "payload" | "output" | "tool_call";
1585
+ severity: "low" | "high" | "critical" | "med";
1586
+ ruleKey: string;
1587
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1588
+ fieldPath: string;
1589
+ matchPreview: string;
1590
+ }[];
1591
+ redactions: string[];
1592
+ blockedTools: string[];
1593
+ blockedDomains: string[];
1594
+ sanitizedPayload?: Record<string, unknown> | undefined;
1595
+ } | null | undefined;
1596
+ } | null;
1597
+ meta: {
1598
+ requestId: string;
1599
+ timingMs: {
1600
+ total: number;
1601
+ policy?: number | undefined;
1602
+ route?: number | undefined;
1603
+ tool?: number | undefined;
1604
+ };
1605
+ policy?: {
1606
+ version: string;
1607
+ ref: string;
1608
+ } | undefined;
1609
+ route?: {
1610
+ provider?: string | undefined;
1611
+ model?: string | undefined;
1612
+ region?: string | undefined;
1613
+ } | undefined;
1614
+ sessionId?: string | undefined;
1615
+ executionId?: string | undefined;
1616
+ lineageId?: string | undefined;
1617
+ risk?: {
1618
+ score?: number | undefined;
1619
+ decision?: "allow" | "deny" | "review" | undefined;
1620
+ } | undefined;
1621
+ };
1622
+ }, {
1623
+ error: {
1624
+ code: string;
1625
+ message: string;
1626
+ status: number;
1627
+ retryable: boolean;
1628
+ details?: Record<string, unknown> | undefined;
1629
+ } | null;
1630
+ ok: boolean;
1631
+ data: {
1632
+ run: {
1633
+ id: string;
1634
+ workspaceId: string;
1635
+ workflowVersionId: string;
1636
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1637
+ correlationId: string;
1638
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1639
+ requestedBy: string;
1640
+ requestedAt: string;
1641
+ idempotencyKey?: string | null | undefined;
1642
+ startedAt?: string | null | undefined;
1643
+ completedAt?: string | null | undefined;
1644
+ slaPolicyId?: string | null | undefined;
1645
+ slaDueAt?: string | null | undefined;
1646
+ slaViolatedAt?: string | null | undefined;
1647
+ };
1648
+ approval?: {
1649
+ status: "approved" | "denied" | "pending";
1650
+ id: string;
1651
+ runId: string;
1652
+ requiredRole: string;
1653
+ createdAt: string;
1654
+ decidedAt?: string | null | undefined;
1655
+ decidedBy?: string | null | undefined;
1656
+ } | null | undefined;
1657
+ blocked?: boolean | undefined;
1658
+ policyDecisions?: {
1659
+ correlationId: string;
1660
+ mode: "monitor" | "enforce";
1661
+ decision: "allow" | "deny";
1662
+ policyId: string;
1663
+ ruleId: string;
1664
+ reasonCode: string;
1665
+ reasonText: string;
1666
+ trace: Record<string, unknown>;
1667
+ }[] | undefined;
1668
+ entitlementDecision?: {
1669
+ id: string;
1670
+ reasonCode: string;
1671
+ reasonText: string;
1672
+ entitled: boolean;
1673
+ } | undefined;
1674
+ usageEntry?: {
1675
+ id: string;
1676
+ quantity: number;
1677
+ } | undefined;
1678
+ boundaryDecision?: {
1679
+ reasonCode: string;
1680
+ reasonText: string;
1681
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1682
+ policyId?: string | undefined;
1683
+ ruleId?: string | undefined;
1684
+ classification?: string | undefined;
1685
+ tags?: string[] | undefined;
1686
+ maskedFields?: string[] | undefined;
1687
+ } | null | undefined;
1688
+ firewallDecision?: {
1689
+ score: number;
1690
+ reasonCode: string;
1691
+ reasonText: string;
1692
+ action: "allow" | "deny" | "sanitize";
1693
+ findings?: {
1694
+ target: "input" | "payload" | "output" | "tool_call";
1695
+ severity: "low" | "high" | "critical" | "med";
1696
+ ruleKey: string;
1697
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1698
+ fieldPath: string;
1699
+ matchPreview: string;
1700
+ }[] | undefined;
1701
+ redactions?: string[] | undefined;
1702
+ blockedTools?: string[] | undefined;
1703
+ blockedDomains?: string[] | undefined;
1704
+ sanitizedPayload?: Record<string, unknown> | undefined;
1705
+ } | null | undefined;
1706
+ } | null;
1707
+ meta: {
1708
+ requestId: string;
1709
+ timingMs: {
1710
+ total: number;
1711
+ policy?: number | undefined;
1712
+ route?: number | undefined;
1713
+ tool?: number | undefined;
1714
+ };
1715
+ policy?: {
1716
+ version: string;
1717
+ ref: string;
1718
+ } | undefined;
1719
+ route?: {
1720
+ provider?: string | undefined;
1721
+ model?: string | undefined;
1722
+ region?: string | undefined;
1723
+ } | undefined;
1724
+ sessionId?: string | undefined;
1725
+ executionId?: string | undefined;
1726
+ lineageId?: string | undefined;
1727
+ risk?: {
1728
+ score?: number | undefined;
1729
+ decision?: "allow" | "deny" | "review" | undefined;
1730
+ } | undefined;
1731
+ };
1732
+ }>;
1733
+ declare const V4EphemeralExecuteDataSchema: z.ZodObject<{
1734
+ session: z.ZodObject<{
1735
+ sessionId: z.ZodString;
1736
+ workspaceId: z.ZodString;
1737
+ agent: z.ZodString;
1738
+ subject: z.ZodOptional<z.ZodString>;
1739
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1740
+ policy: z.ZodOptional<z.ZodObject<{
1741
+ ref: z.ZodString;
1742
+ version: z.ZodString;
1743
+ }, "strip", z.ZodTypeAny, {
1744
+ version: string;
1745
+ ref: string;
1746
+ }, {
1747
+ version: string;
1748
+ ref: string;
1749
+ }>>;
1750
+ route: z.ZodOptional<z.ZodObject<{
1751
+ provider: z.ZodOptional<z.ZodString>;
1752
+ model: z.ZodOptional<z.ZodString>;
1753
+ region: z.ZodOptional<z.ZodString>;
1754
+ }, "strip", z.ZodTypeAny, {
1755
+ provider?: string | undefined;
1756
+ model?: string | undefined;
1757
+ region?: string | undefined;
1758
+ }, {
1759
+ provider?: string | undefined;
1760
+ model?: string | undefined;
1761
+ region?: string | undefined;
1762
+ }>>;
1763
+ risk: z.ZodOptional<z.ZodObject<{
1764
+ score: z.ZodOptional<z.ZodNumber>;
1765
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
1766
+ }, "strip", z.ZodTypeAny, {
1767
+ score?: number | undefined;
1768
+ decision?: "allow" | "deny" | "review" | undefined;
1769
+ }, {
1770
+ score?: number | undefined;
1771
+ decision?: "allow" | "deny" | "review" | undefined;
1772
+ }>>;
1773
+ workflowVersionId: z.ZodOptional<z.ZodString>;
1774
+ createdAt: z.ZodString;
1775
+ expiresAt: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ sessionId: string;
1778
+ workspaceId: string;
1779
+ createdAt: string;
1780
+ agent: string;
1781
+ workflowVersionId?: string | undefined;
1782
+ policy?: {
1783
+ version: string;
1784
+ ref: string;
1785
+ } | undefined;
1786
+ route?: {
1787
+ provider?: string | undefined;
1788
+ model?: string | undefined;
1789
+ region?: string | undefined;
1790
+ } | undefined;
1791
+ risk?: {
1792
+ score?: number | undefined;
1793
+ decision?: "allow" | "deny" | "review" | undefined;
1794
+ } | undefined;
1795
+ subject?: string | undefined;
1796
+ metadata?: Record<string, unknown> | undefined;
1797
+ expiresAt?: string | undefined;
1798
+ }, {
1799
+ sessionId: string;
1800
+ workspaceId: string;
1801
+ createdAt: string;
1802
+ agent: string;
1803
+ workflowVersionId?: string | undefined;
1804
+ policy?: {
1805
+ version: string;
1806
+ ref: string;
1807
+ } | undefined;
1808
+ route?: {
1809
+ provider?: string | undefined;
1810
+ model?: string | undefined;
1811
+ region?: string | undefined;
1812
+ } | undefined;
1813
+ risk?: {
1814
+ score?: number | undefined;
1815
+ decision?: "allow" | "deny" | "review" | undefined;
1816
+ } | undefined;
1817
+ subject?: string | undefined;
1818
+ metadata?: Record<string, unknown> | undefined;
1819
+ expiresAt?: string | undefined;
1820
+ }>;
1821
+ execution: z.ZodObject<{
1822
+ run: z.ZodObject<{
1823
+ id: z.ZodString;
1824
+ workspaceId: z.ZodString;
1825
+ workflowVersionId: z.ZodString;
1826
+ state: z.ZodEnum<["queued", "running", "waiting_approval", "approved", "denied", "succeeded", "failed", "aborted", "timed_out", "canceled"]>;
1827
+ correlationId: z.ZodString;
1828
+ idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1829
+ triggerSource: z.ZodEnum<["ui", "api", "sdk", "cli", "hosted", "webhook"]>;
1830
+ requestedBy: z.ZodString;
1831
+ requestedAt: z.ZodString;
1832
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1833
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1834
+ slaPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1835
+ slaDueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1836
+ slaViolatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1837
+ }, "strip", z.ZodTypeAny, {
1838
+ id: string;
1839
+ workspaceId: string;
1840
+ workflowVersionId: string;
1841
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1842
+ correlationId: string;
1843
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1844
+ requestedBy: string;
1845
+ requestedAt: string;
1846
+ idempotencyKey?: string | null | undefined;
1847
+ startedAt?: string | null | undefined;
1848
+ completedAt?: string | null | undefined;
1849
+ slaPolicyId?: string | null | undefined;
1850
+ slaDueAt?: string | null | undefined;
1851
+ slaViolatedAt?: string | null | undefined;
1852
+ }, {
1853
+ id: string;
1854
+ workspaceId: string;
1855
+ workflowVersionId: string;
1856
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
1857
+ correlationId: string;
1858
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
1859
+ requestedBy: string;
1860
+ requestedAt: string;
1861
+ idempotencyKey?: string | null | undefined;
1862
+ startedAt?: string | null | undefined;
1863
+ completedAt?: string | null | undefined;
1864
+ slaPolicyId?: string | null | undefined;
1865
+ slaDueAt?: string | null | undefined;
1866
+ slaViolatedAt?: string | null | undefined;
1867
+ }>;
1868
+ approval: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1869
+ id: z.ZodString;
1870
+ runId: z.ZodString;
1871
+ requiredRole: z.ZodString;
1872
+ status: z.ZodEnum<["pending", "approved", "denied"]>;
1873
+ createdAt: z.ZodString;
1874
+ decidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1875
+ decidedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1876
+ }, "strip", z.ZodTypeAny, {
1877
+ status: "approved" | "denied" | "pending";
1878
+ id: string;
1879
+ runId: string;
1880
+ requiredRole: string;
1881
+ createdAt: string;
1882
+ decidedAt?: string | null | undefined;
1883
+ decidedBy?: string | null | undefined;
1884
+ }, {
1885
+ status: "approved" | "denied" | "pending";
1886
+ id: string;
1887
+ runId: string;
1888
+ requiredRole: string;
1889
+ createdAt: string;
1890
+ decidedAt?: string | null | undefined;
1891
+ decidedBy?: string | null | undefined;
1892
+ }>>>;
1893
+ blocked: z.ZodOptional<z.ZodBoolean>;
1894
+ policyDecisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1895
+ mode: z.ZodEnum<["monitor", "enforce"]>;
1896
+ decision: z.ZodEnum<["allow", "deny"]>;
1897
+ policyId: z.ZodString;
1898
+ ruleId: z.ZodString;
1899
+ reasonCode: z.ZodString;
1900
+ reasonText: z.ZodString;
1901
+ correlationId: z.ZodString;
1902
+ trace: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1903
+ }, "strip", z.ZodTypeAny, {
1904
+ correlationId: string;
1905
+ mode: "monitor" | "enforce";
1906
+ decision: "allow" | "deny";
1907
+ policyId: string;
1908
+ ruleId: string;
1909
+ reasonCode: string;
1910
+ reasonText: string;
1911
+ trace: Record<string, unknown>;
1912
+ }, {
1913
+ correlationId: string;
1914
+ mode: "monitor" | "enforce";
1915
+ decision: "allow" | "deny";
1916
+ policyId: string;
1917
+ ruleId: string;
1918
+ reasonCode: string;
1919
+ reasonText: string;
1920
+ trace: Record<string, unknown>;
1921
+ }>, "many">>;
1922
+ entitlementDecision: z.ZodOptional<z.ZodObject<{
1923
+ id: z.ZodString;
1924
+ reasonCode: z.ZodString;
1925
+ reasonText: z.ZodString;
1926
+ entitled: z.ZodBoolean;
1927
+ }, "strip", z.ZodTypeAny, {
1928
+ id: string;
1929
+ reasonCode: string;
1930
+ reasonText: string;
1931
+ entitled: boolean;
1932
+ }, {
1933
+ id: string;
1934
+ reasonCode: string;
1935
+ reasonText: string;
1936
+ entitled: boolean;
1937
+ }>>;
1938
+ usageEntry: z.ZodOptional<z.ZodObject<{
1939
+ id: z.ZodString;
1940
+ quantity: z.ZodNumber;
1941
+ }, "strip", z.ZodTypeAny, {
1942
+ id: string;
1943
+ quantity: number;
1944
+ }, {
1945
+ id: string;
1946
+ quantity: number;
1947
+ }>>;
1948
+ boundaryDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1949
+ action: z.ZodEnum<["allow", "block", "redact", "mask", "escalate"]>;
1950
+ reasonCode: z.ZodString;
1951
+ reasonText: z.ZodString;
1952
+ policyId: z.ZodOptional<z.ZodString>;
1953
+ ruleId: z.ZodOptional<z.ZodString>;
1954
+ classification: z.ZodOptional<z.ZodString>;
1955
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1956
+ maskedFields: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1957
+ }, "strip", z.ZodTypeAny, {
1958
+ reasonCode: string;
1959
+ reasonText: string;
1960
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1961
+ tags: string[];
1962
+ maskedFields: string[];
1963
+ policyId?: string | undefined;
1964
+ ruleId?: string | undefined;
1965
+ classification?: string | undefined;
1966
+ }, {
1967
+ reasonCode: string;
1968
+ reasonText: string;
1969
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
1970
+ policyId?: string | undefined;
1971
+ ruleId?: string | undefined;
1972
+ classification?: string | undefined;
1973
+ tags?: string[] | undefined;
1974
+ maskedFields?: string[] | undefined;
1975
+ }>>>;
1976
+ firewallDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1977
+ action: z.ZodEnum<["allow", "sanitize", "deny"]>;
1978
+ reasonCode: z.ZodString;
1979
+ reasonText: z.ZodString;
1980
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1981
+ ruleKey: z.ZodString;
1982
+ category: z.ZodEnum<["prompt_injection", "secret", "pii", "malicious_payload"]>;
1983
+ severity: z.ZodEnum<["low", "med", "high", "critical"]>;
1984
+ target: z.ZodEnum<["input", "output", "tool_call", "payload"]>;
1985
+ fieldPath: z.ZodString;
1986
+ matchPreview: z.ZodString;
1987
+ }, "strip", z.ZodTypeAny, {
1988
+ target: "input" | "payload" | "output" | "tool_call";
1989
+ severity: "low" | "high" | "critical" | "med";
1990
+ ruleKey: string;
1991
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1992
+ fieldPath: string;
1993
+ matchPreview: string;
1994
+ }, {
1995
+ target: "input" | "payload" | "output" | "tool_call";
1996
+ severity: "low" | "high" | "critical" | "med";
1997
+ ruleKey: string;
1998
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
1999
+ fieldPath: string;
2000
+ matchPreview: string;
2001
+ }>, "many">>;
2002
+ redactions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2003
+ blockedTools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2004
+ blockedDomains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2005
+ sanitizedPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2006
+ score: z.ZodNumber;
2007
+ }, "strip", z.ZodTypeAny, {
2008
+ score: number;
2009
+ reasonCode: string;
2010
+ reasonText: string;
2011
+ action: "allow" | "deny" | "sanitize";
2012
+ findings: {
2013
+ target: "input" | "payload" | "output" | "tool_call";
2014
+ severity: "low" | "high" | "critical" | "med";
2015
+ ruleKey: string;
2016
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2017
+ fieldPath: string;
2018
+ matchPreview: string;
2019
+ }[];
2020
+ redactions: string[];
2021
+ blockedTools: string[];
2022
+ blockedDomains: string[];
2023
+ sanitizedPayload?: Record<string, unknown> | undefined;
2024
+ }, {
2025
+ score: number;
2026
+ reasonCode: string;
2027
+ reasonText: string;
2028
+ action: "allow" | "deny" | "sanitize";
2029
+ findings?: {
2030
+ target: "input" | "payload" | "output" | "tool_call";
2031
+ severity: "low" | "high" | "critical" | "med";
2032
+ ruleKey: string;
2033
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2034
+ fieldPath: string;
2035
+ matchPreview: string;
2036
+ }[] | undefined;
2037
+ redactions?: string[] | undefined;
2038
+ blockedTools?: string[] | undefined;
2039
+ blockedDomains?: string[] | undefined;
2040
+ sanitizedPayload?: Record<string, unknown> | undefined;
2041
+ }>>>;
2042
+ }, "strip", z.ZodTypeAny, {
2043
+ run: {
2044
+ id: string;
2045
+ workspaceId: string;
2046
+ workflowVersionId: string;
2047
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2048
+ correlationId: string;
2049
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2050
+ requestedBy: string;
2051
+ requestedAt: string;
2052
+ idempotencyKey?: string | null | undefined;
2053
+ startedAt?: string | null | undefined;
2054
+ completedAt?: string | null | undefined;
2055
+ slaPolicyId?: string | null | undefined;
2056
+ slaDueAt?: string | null | undefined;
2057
+ slaViolatedAt?: string | null | undefined;
2058
+ };
2059
+ approval?: {
2060
+ status: "approved" | "denied" | "pending";
2061
+ id: string;
2062
+ runId: string;
2063
+ requiredRole: string;
2064
+ createdAt: string;
2065
+ decidedAt?: string | null | undefined;
2066
+ decidedBy?: string | null | undefined;
2067
+ } | null | undefined;
2068
+ blocked?: boolean | undefined;
2069
+ policyDecisions?: {
2070
+ correlationId: string;
2071
+ mode: "monitor" | "enforce";
2072
+ decision: "allow" | "deny";
2073
+ policyId: string;
2074
+ ruleId: string;
2075
+ reasonCode: string;
2076
+ reasonText: string;
2077
+ trace: Record<string, unknown>;
2078
+ }[] | undefined;
2079
+ entitlementDecision?: {
2080
+ id: string;
2081
+ reasonCode: string;
2082
+ reasonText: string;
2083
+ entitled: boolean;
2084
+ } | undefined;
2085
+ usageEntry?: {
2086
+ id: string;
2087
+ quantity: number;
2088
+ } | undefined;
2089
+ boundaryDecision?: {
2090
+ reasonCode: string;
2091
+ reasonText: string;
2092
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2093
+ tags: string[];
2094
+ maskedFields: string[];
2095
+ policyId?: string | undefined;
2096
+ ruleId?: string | undefined;
2097
+ classification?: string | undefined;
2098
+ } | null | undefined;
2099
+ firewallDecision?: {
2100
+ score: number;
2101
+ reasonCode: string;
2102
+ reasonText: string;
2103
+ action: "allow" | "deny" | "sanitize";
2104
+ findings: {
2105
+ target: "input" | "payload" | "output" | "tool_call";
2106
+ severity: "low" | "high" | "critical" | "med";
2107
+ ruleKey: string;
2108
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2109
+ fieldPath: string;
2110
+ matchPreview: string;
2111
+ }[];
2112
+ redactions: string[];
2113
+ blockedTools: string[];
2114
+ blockedDomains: string[];
2115
+ sanitizedPayload?: Record<string, unknown> | undefined;
2116
+ } | null | undefined;
2117
+ }, {
2118
+ run: {
2119
+ id: string;
2120
+ workspaceId: string;
2121
+ workflowVersionId: string;
2122
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2123
+ correlationId: string;
2124
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2125
+ requestedBy: string;
2126
+ requestedAt: string;
2127
+ idempotencyKey?: string | null | undefined;
2128
+ startedAt?: string | null | undefined;
2129
+ completedAt?: string | null | undefined;
2130
+ slaPolicyId?: string | null | undefined;
2131
+ slaDueAt?: string | null | undefined;
2132
+ slaViolatedAt?: string | null | undefined;
2133
+ };
2134
+ approval?: {
2135
+ status: "approved" | "denied" | "pending";
2136
+ id: string;
2137
+ runId: string;
2138
+ requiredRole: string;
2139
+ createdAt: string;
2140
+ decidedAt?: string | null | undefined;
2141
+ decidedBy?: string | null | undefined;
2142
+ } | null | undefined;
2143
+ blocked?: boolean | undefined;
2144
+ policyDecisions?: {
2145
+ correlationId: string;
2146
+ mode: "monitor" | "enforce";
2147
+ decision: "allow" | "deny";
2148
+ policyId: string;
2149
+ ruleId: string;
2150
+ reasonCode: string;
2151
+ reasonText: string;
2152
+ trace: Record<string, unknown>;
2153
+ }[] | undefined;
2154
+ entitlementDecision?: {
2155
+ id: string;
2156
+ reasonCode: string;
2157
+ reasonText: string;
2158
+ entitled: boolean;
2159
+ } | undefined;
2160
+ usageEntry?: {
2161
+ id: string;
2162
+ quantity: number;
2163
+ } | undefined;
2164
+ boundaryDecision?: {
2165
+ reasonCode: string;
2166
+ reasonText: string;
2167
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2168
+ policyId?: string | undefined;
2169
+ ruleId?: string | undefined;
2170
+ classification?: string | undefined;
2171
+ tags?: string[] | undefined;
2172
+ maskedFields?: string[] | undefined;
2173
+ } | null | undefined;
2174
+ firewallDecision?: {
2175
+ score: number;
2176
+ reasonCode: string;
2177
+ reasonText: string;
2178
+ action: "allow" | "deny" | "sanitize";
2179
+ findings?: {
2180
+ target: "input" | "payload" | "output" | "tool_call";
2181
+ severity: "low" | "high" | "critical" | "med";
2182
+ ruleKey: string;
2183
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2184
+ fieldPath: string;
2185
+ matchPreview: string;
2186
+ }[] | undefined;
2187
+ redactions?: string[] | undefined;
2188
+ blockedTools?: string[] | undefined;
2189
+ blockedDomains?: string[] | undefined;
2190
+ sanitizedPayload?: Record<string, unknown> | undefined;
2191
+ } | null | undefined;
2192
+ }>;
2193
+ }, "strip", z.ZodTypeAny, {
2194
+ session: {
2195
+ sessionId: string;
2196
+ workspaceId: string;
2197
+ createdAt: string;
2198
+ agent: string;
2199
+ workflowVersionId?: string | undefined;
2200
+ policy?: {
2201
+ version: string;
2202
+ ref: string;
2203
+ } | undefined;
2204
+ route?: {
2205
+ provider?: string | undefined;
2206
+ model?: string | undefined;
2207
+ region?: string | undefined;
2208
+ } | undefined;
2209
+ risk?: {
2210
+ score?: number | undefined;
2211
+ decision?: "allow" | "deny" | "review" | undefined;
2212
+ } | undefined;
2213
+ subject?: string | undefined;
2214
+ metadata?: Record<string, unknown> | undefined;
2215
+ expiresAt?: string | undefined;
2216
+ };
2217
+ execution: {
2218
+ run: {
2219
+ id: string;
2220
+ workspaceId: string;
2221
+ workflowVersionId: string;
2222
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2223
+ correlationId: string;
2224
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2225
+ requestedBy: string;
2226
+ requestedAt: string;
2227
+ idempotencyKey?: string | null | undefined;
2228
+ startedAt?: string | null | undefined;
2229
+ completedAt?: string | null | undefined;
2230
+ slaPolicyId?: string | null | undefined;
2231
+ slaDueAt?: string | null | undefined;
2232
+ slaViolatedAt?: string | null | undefined;
2233
+ };
2234
+ approval?: {
2235
+ status: "approved" | "denied" | "pending";
2236
+ id: string;
2237
+ runId: string;
2238
+ requiredRole: string;
2239
+ createdAt: string;
2240
+ decidedAt?: string | null | undefined;
2241
+ decidedBy?: string | null | undefined;
2242
+ } | null | undefined;
2243
+ blocked?: boolean | undefined;
2244
+ policyDecisions?: {
2245
+ correlationId: string;
2246
+ mode: "monitor" | "enforce";
2247
+ decision: "allow" | "deny";
2248
+ policyId: string;
2249
+ ruleId: string;
2250
+ reasonCode: string;
2251
+ reasonText: string;
2252
+ trace: Record<string, unknown>;
2253
+ }[] | undefined;
2254
+ entitlementDecision?: {
2255
+ id: string;
2256
+ reasonCode: string;
2257
+ reasonText: string;
2258
+ entitled: boolean;
2259
+ } | undefined;
2260
+ usageEntry?: {
2261
+ id: string;
2262
+ quantity: number;
2263
+ } | undefined;
2264
+ boundaryDecision?: {
2265
+ reasonCode: string;
2266
+ reasonText: string;
2267
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2268
+ tags: string[];
2269
+ maskedFields: string[];
2270
+ policyId?: string | undefined;
2271
+ ruleId?: string | undefined;
2272
+ classification?: string | undefined;
2273
+ } | null | undefined;
2274
+ firewallDecision?: {
2275
+ score: number;
2276
+ reasonCode: string;
2277
+ reasonText: string;
2278
+ action: "allow" | "deny" | "sanitize";
2279
+ findings: {
2280
+ target: "input" | "payload" | "output" | "tool_call";
2281
+ severity: "low" | "high" | "critical" | "med";
2282
+ ruleKey: string;
2283
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2284
+ fieldPath: string;
2285
+ matchPreview: string;
2286
+ }[];
2287
+ redactions: string[];
2288
+ blockedTools: string[];
2289
+ blockedDomains: string[];
2290
+ sanitizedPayload?: Record<string, unknown> | undefined;
2291
+ } | null | undefined;
2292
+ };
2293
+ }, {
2294
+ session: {
2295
+ sessionId: string;
2296
+ workspaceId: string;
2297
+ createdAt: string;
2298
+ agent: string;
2299
+ workflowVersionId?: string | undefined;
2300
+ policy?: {
2301
+ version: string;
2302
+ ref: string;
2303
+ } | undefined;
2304
+ route?: {
2305
+ provider?: string | undefined;
2306
+ model?: string | undefined;
2307
+ region?: string | undefined;
2308
+ } | undefined;
2309
+ risk?: {
2310
+ score?: number | undefined;
2311
+ decision?: "allow" | "deny" | "review" | undefined;
2312
+ } | undefined;
2313
+ subject?: string | undefined;
2314
+ metadata?: Record<string, unknown> | undefined;
2315
+ expiresAt?: string | undefined;
2316
+ };
2317
+ execution: {
2318
+ run: {
2319
+ id: string;
2320
+ workspaceId: string;
2321
+ workflowVersionId: string;
2322
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2323
+ correlationId: string;
2324
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2325
+ requestedBy: string;
2326
+ requestedAt: string;
2327
+ idempotencyKey?: string | null | undefined;
2328
+ startedAt?: string | null | undefined;
2329
+ completedAt?: string | null | undefined;
2330
+ slaPolicyId?: string | null | undefined;
2331
+ slaDueAt?: string | null | undefined;
2332
+ slaViolatedAt?: string | null | undefined;
2333
+ };
2334
+ approval?: {
2335
+ status: "approved" | "denied" | "pending";
2336
+ id: string;
2337
+ runId: string;
2338
+ requiredRole: string;
2339
+ createdAt: string;
2340
+ decidedAt?: string | null | undefined;
2341
+ decidedBy?: string | null | undefined;
2342
+ } | null | undefined;
2343
+ blocked?: boolean | undefined;
2344
+ policyDecisions?: {
2345
+ correlationId: string;
2346
+ mode: "monitor" | "enforce";
2347
+ decision: "allow" | "deny";
2348
+ policyId: string;
2349
+ ruleId: string;
2350
+ reasonCode: string;
2351
+ reasonText: string;
2352
+ trace: Record<string, unknown>;
2353
+ }[] | undefined;
2354
+ entitlementDecision?: {
2355
+ id: string;
2356
+ reasonCode: string;
2357
+ reasonText: string;
2358
+ entitled: boolean;
2359
+ } | undefined;
2360
+ usageEntry?: {
2361
+ id: string;
2362
+ quantity: number;
2363
+ } | undefined;
2364
+ boundaryDecision?: {
2365
+ reasonCode: string;
2366
+ reasonText: string;
2367
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2368
+ policyId?: string | undefined;
2369
+ ruleId?: string | undefined;
2370
+ classification?: string | undefined;
2371
+ tags?: string[] | undefined;
2372
+ maskedFields?: string[] | undefined;
2373
+ } | null | undefined;
2374
+ firewallDecision?: {
2375
+ score: number;
2376
+ reasonCode: string;
2377
+ reasonText: string;
2378
+ action: "allow" | "deny" | "sanitize";
2379
+ findings?: {
2380
+ target: "input" | "payload" | "output" | "tool_call";
2381
+ severity: "low" | "high" | "critical" | "med";
2382
+ ruleKey: string;
2383
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2384
+ fieldPath: string;
2385
+ matchPreview: string;
2386
+ }[] | undefined;
2387
+ redactions?: string[] | undefined;
2388
+ blockedTools?: string[] | undefined;
2389
+ blockedDomains?: string[] | undefined;
2390
+ sanitizedPayload?: Record<string, unknown> | undefined;
2391
+ } | null | undefined;
2392
+ };
2393
+ }>;
2394
+ declare const V4EphemeralExecutionResponseSchema: z.ZodObject<{
2395
+ ok: z.ZodBoolean;
2396
+ data: z.ZodNullable<z.ZodObject<{
2397
+ session: z.ZodObject<{
2398
+ sessionId: z.ZodString;
2399
+ workspaceId: z.ZodString;
2400
+ agent: z.ZodString;
2401
+ subject: z.ZodOptional<z.ZodString>;
2402
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2403
+ policy: z.ZodOptional<z.ZodObject<{
2404
+ ref: z.ZodString;
2405
+ version: z.ZodString;
2406
+ }, "strip", z.ZodTypeAny, {
2407
+ version: string;
2408
+ ref: string;
2409
+ }, {
2410
+ version: string;
2411
+ ref: string;
2412
+ }>>;
2413
+ route: z.ZodOptional<z.ZodObject<{
2414
+ provider: z.ZodOptional<z.ZodString>;
2415
+ model: z.ZodOptional<z.ZodString>;
2416
+ region: z.ZodOptional<z.ZodString>;
2417
+ }, "strip", z.ZodTypeAny, {
2418
+ provider?: string | undefined;
2419
+ model?: string | undefined;
2420
+ region?: string | undefined;
2421
+ }, {
2422
+ provider?: string | undefined;
2423
+ model?: string | undefined;
2424
+ region?: string | undefined;
2425
+ }>>;
2426
+ risk: z.ZodOptional<z.ZodObject<{
2427
+ score: z.ZodOptional<z.ZodNumber>;
2428
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
2429
+ }, "strip", z.ZodTypeAny, {
2430
+ score?: number | undefined;
2431
+ decision?: "allow" | "deny" | "review" | undefined;
2432
+ }, {
2433
+ score?: number | undefined;
2434
+ decision?: "allow" | "deny" | "review" | undefined;
2435
+ }>>;
2436
+ workflowVersionId: z.ZodOptional<z.ZodString>;
2437
+ createdAt: z.ZodString;
2438
+ expiresAt: z.ZodOptional<z.ZodString>;
2439
+ }, "strip", z.ZodTypeAny, {
2440
+ sessionId: string;
2441
+ workspaceId: string;
2442
+ createdAt: string;
2443
+ agent: string;
2444
+ workflowVersionId?: string | undefined;
2445
+ policy?: {
2446
+ version: string;
2447
+ ref: string;
2448
+ } | undefined;
2449
+ route?: {
2450
+ provider?: string | undefined;
2451
+ model?: string | undefined;
2452
+ region?: string | undefined;
2453
+ } | undefined;
2454
+ risk?: {
2455
+ score?: number | undefined;
2456
+ decision?: "allow" | "deny" | "review" | undefined;
2457
+ } | undefined;
2458
+ subject?: string | undefined;
2459
+ metadata?: Record<string, unknown> | undefined;
2460
+ expiresAt?: string | undefined;
2461
+ }, {
2462
+ sessionId: string;
2463
+ workspaceId: string;
2464
+ createdAt: string;
2465
+ agent: string;
2466
+ workflowVersionId?: string | undefined;
2467
+ policy?: {
2468
+ version: string;
2469
+ ref: string;
2470
+ } | undefined;
2471
+ route?: {
2472
+ provider?: string | undefined;
2473
+ model?: string | undefined;
2474
+ region?: string | undefined;
2475
+ } | undefined;
2476
+ risk?: {
2477
+ score?: number | undefined;
2478
+ decision?: "allow" | "deny" | "review" | undefined;
2479
+ } | undefined;
2480
+ subject?: string | undefined;
2481
+ metadata?: Record<string, unknown> | undefined;
2482
+ expiresAt?: string | undefined;
2483
+ }>;
2484
+ execution: z.ZodObject<{
2485
+ run: z.ZodObject<{
2486
+ id: z.ZodString;
2487
+ workspaceId: z.ZodString;
2488
+ workflowVersionId: z.ZodString;
2489
+ state: z.ZodEnum<["queued", "running", "waiting_approval", "approved", "denied", "succeeded", "failed", "aborted", "timed_out", "canceled"]>;
2490
+ correlationId: z.ZodString;
2491
+ idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2492
+ triggerSource: z.ZodEnum<["ui", "api", "sdk", "cli", "hosted", "webhook"]>;
2493
+ requestedBy: z.ZodString;
2494
+ requestedAt: z.ZodString;
2495
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2496
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2497
+ slaPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2498
+ slaDueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2499
+ slaViolatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2500
+ }, "strip", z.ZodTypeAny, {
2501
+ id: string;
2502
+ workspaceId: string;
2503
+ workflowVersionId: string;
2504
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2505
+ correlationId: string;
2506
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2507
+ requestedBy: string;
2508
+ requestedAt: string;
2509
+ idempotencyKey?: string | null | undefined;
2510
+ startedAt?: string | null | undefined;
2511
+ completedAt?: string | null | undefined;
2512
+ slaPolicyId?: string | null | undefined;
2513
+ slaDueAt?: string | null | undefined;
2514
+ slaViolatedAt?: string | null | undefined;
2515
+ }, {
2516
+ id: string;
2517
+ workspaceId: string;
2518
+ workflowVersionId: string;
2519
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2520
+ correlationId: string;
2521
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2522
+ requestedBy: string;
2523
+ requestedAt: string;
2524
+ idempotencyKey?: string | null | undefined;
2525
+ startedAt?: string | null | undefined;
2526
+ completedAt?: string | null | undefined;
2527
+ slaPolicyId?: string | null | undefined;
2528
+ slaDueAt?: string | null | undefined;
2529
+ slaViolatedAt?: string | null | undefined;
2530
+ }>;
2531
+ approval: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2532
+ id: z.ZodString;
2533
+ runId: z.ZodString;
2534
+ requiredRole: z.ZodString;
2535
+ status: z.ZodEnum<["pending", "approved", "denied"]>;
2536
+ createdAt: z.ZodString;
2537
+ decidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2538
+ decidedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2539
+ }, "strip", z.ZodTypeAny, {
2540
+ status: "approved" | "denied" | "pending";
2541
+ id: string;
2542
+ runId: string;
2543
+ requiredRole: string;
2544
+ createdAt: string;
2545
+ decidedAt?: string | null | undefined;
2546
+ decidedBy?: string | null | undefined;
2547
+ }, {
2548
+ status: "approved" | "denied" | "pending";
2549
+ id: string;
2550
+ runId: string;
2551
+ requiredRole: string;
2552
+ createdAt: string;
2553
+ decidedAt?: string | null | undefined;
2554
+ decidedBy?: string | null | undefined;
2555
+ }>>>;
2556
+ blocked: z.ZodOptional<z.ZodBoolean>;
2557
+ policyDecisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2558
+ mode: z.ZodEnum<["monitor", "enforce"]>;
2559
+ decision: z.ZodEnum<["allow", "deny"]>;
2560
+ policyId: z.ZodString;
2561
+ ruleId: z.ZodString;
2562
+ reasonCode: z.ZodString;
2563
+ reasonText: z.ZodString;
2564
+ correlationId: z.ZodString;
2565
+ trace: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2566
+ }, "strip", z.ZodTypeAny, {
2567
+ correlationId: string;
2568
+ mode: "monitor" | "enforce";
2569
+ decision: "allow" | "deny";
2570
+ policyId: string;
2571
+ ruleId: string;
2572
+ reasonCode: string;
2573
+ reasonText: string;
2574
+ trace: Record<string, unknown>;
2575
+ }, {
2576
+ correlationId: string;
2577
+ mode: "monitor" | "enforce";
2578
+ decision: "allow" | "deny";
2579
+ policyId: string;
2580
+ ruleId: string;
2581
+ reasonCode: string;
2582
+ reasonText: string;
2583
+ trace: Record<string, unknown>;
2584
+ }>, "many">>;
2585
+ entitlementDecision: z.ZodOptional<z.ZodObject<{
2586
+ id: z.ZodString;
2587
+ reasonCode: z.ZodString;
2588
+ reasonText: z.ZodString;
2589
+ entitled: z.ZodBoolean;
2590
+ }, "strip", z.ZodTypeAny, {
2591
+ id: string;
2592
+ reasonCode: string;
2593
+ reasonText: string;
2594
+ entitled: boolean;
2595
+ }, {
2596
+ id: string;
2597
+ reasonCode: string;
2598
+ reasonText: string;
2599
+ entitled: boolean;
2600
+ }>>;
2601
+ usageEntry: z.ZodOptional<z.ZodObject<{
2602
+ id: z.ZodString;
2603
+ quantity: z.ZodNumber;
2604
+ }, "strip", z.ZodTypeAny, {
2605
+ id: string;
2606
+ quantity: number;
2607
+ }, {
2608
+ id: string;
2609
+ quantity: number;
2610
+ }>>;
2611
+ boundaryDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2612
+ action: z.ZodEnum<["allow", "block", "redact", "mask", "escalate"]>;
2613
+ reasonCode: z.ZodString;
2614
+ reasonText: z.ZodString;
2615
+ policyId: z.ZodOptional<z.ZodString>;
2616
+ ruleId: z.ZodOptional<z.ZodString>;
2617
+ classification: z.ZodOptional<z.ZodString>;
2618
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2619
+ maskedFields: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2620
+ }, "strip", z.ZodTypeAny, {
2621
+ reasonCode: string;
2622
+ reasonText: string;
2623
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2624
+ tags: string[];
2625
+ maskedFields: string[];
2626
+ policyId?: string | undefined;
2627
+ ruleId?: string | undefined;
2628
+ classification?: string | undefined;
2629
+ }, {
2630
+ reasonCode: string;
2631
+ reasonText: string;
2632
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2633
+ policyId?: string | undefined;
2634
+ ruleId?: string | undefined;
2635
+ classification?: string | undefined;
2636
+ tags?: string[] | undefined;
2637
+ maskedFields?: string[] | undefined;
2638
+ }>>>;
2639
+ firewallDecision: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2640
+ action: z.ZodEnum<["allow", "sanitize", "deny"]>;
2641
+ reasonCode: z.ZodString;
2642
+ reasonText: z.ZodString;
2643
+ findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
2644
+ ruleKey: z.ZodString;
2645
+ category: z.ZodEnum<["prompt_injection", "secret", "pii", "malicious_payload"]>;
2646
+ severity: z.ZodEnum<["low", "med", "high", "critical"]>;
2647
+ target: z.ZodEnum<["input", "output", "tool_call", "payload"]>;
2648
+ fieldPath: z.ZodString;
2649
+ matchPreview: z.ZodString;
2650
+ }, "strip", z.ZodTypeAny, {
2651
+ target: "input" | "payload" | "output" | "tool_call";
2652
+ severity: "low" | "high" | "critical" | "med";
2653
+ ruleKey: string;
2654
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2655
+ fieldPath: string;
2656
+ matchPreview: string;
2657
+ }, {
2658
+ target: "input" | "payload" | "output" | "tool_call";
2659
+ severity: "low" | "high" | "critical" | "med";
2660
+ ruleKey: string;
2661
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2662
+ fieldPath: string;
2663
+ matchPreview: string;
2664
+ }>, "many">>;
2665
+ redactions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2666
+ blockedTools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2667
+ blockedDomains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2668
+ sanitizedPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2669
+ score: z.ZodNumber;
2670
+ }, "strip", z.ZodTypeAny, {
2671
+ score: number;
2672
+ reasonCode: string;
2673
+ reasonText: string;
2674
+ action: "allow" | "deny" | "sanitize";
2675
+ findings: {
2676
+ target: "input" | "payload" | "output" | "tool_call";
2677
+ severity: "low" | "high" | "critical" | "med";
2678
+ ruleKey: string;
2679
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2680
+ fieldPath: string;
2681
+ matchPreview: string;
2682
+ }[];
2683
+ redactions: string[];
2684
+ blockedTools: string[];
2685
+ blockedDomains: string[];
2686
+ sanitizedPayload?: Record<string, unknown> | undefined;
2687
+ }, {
2688
+ score: number;
2689
+ reasonCode: string;
2690
+ reasonText: string;
2691
+ action: "allow" | "deny" | "sanitize";
2692
+ findings?: {
2693
+ target: "input" | "payload" | "output" | "tool_call";
2694
+ severity: "low" | "high" | "critical" | "med";
2695
+ ruleKey: string;
2696
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2697
+ fieldPath: string;
2698
+ matchPreview: string;
2699
+ }[] | undefined;
2700
+ redactions?: string[] | undefined;
2701
+ blockedTools?: string[] | undefined;
2702
+ blockedDomains?: string[] | undefined;
2703
+ sanitizedPayload?: Record<string, unknown> | undefined;
2704
+ }>>>;
2705
+ }, "strip", z.ZodTypeAny, {
2706
+ run: {
2707
+ id: string;
2708
+ workspaceId: string;
2709
+ workflowVersionId: string;
2710
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2711
+ correlationId: string;
2712
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2713
+ requestedBy: string;
2714
+ requestedAt: string;
2715
+ idempotencyKey?: string | null | undefined;
2716
+ startedAt?: string | null | undefined;
2717
+ completedAt?: string | null | undefined;
2718
+ slaPolicyId?: string | null | undefined;
2719
+ slaDueAt?: string | null | undefined;
2720
+ slaViolatedAt?: string | null | undefined;
2721
+ };
2722
+ approval?: {
2723
+ status: "approved" | "denied" | "pending";
2724
+ id: string;
2725
+ runId: string;
2726
+ requiredRole: string;
2727
+ createdAt: string;
2728
+ decidedAt?: string | null | undefined;
2729
+ decidedBy?: string | null | undefined;
2730
+ } | null | undefined;
2731
+ blocked?: boolean | undefined;
2732
+ policyDecisions?: {
2733
+ correlationId: string;
2734
+ mode: "monitor" | "enforce";
2735
+ decision: "allow" | "deny";
2736
+ policyId: string;
2737
+ ruleId: string;
2738
+ reasonCode: string;
2739
+ reasonText: string;
2740
+ trace: Record<string, unknown>;
2741
+ }[] | undefined;
2742
+ entitlementDecision?: {
2743
+ id: string;
2744
+ reasonCode: string;
2745
+ reasonText: string;
2746
+ entitled: boolean;
2747
+ } | undefined;
2748
+ usageEntry?: {
2749
+ id: string;
2750
+ quantity: number;
2751
+ } | undefined;
2752
+ boundaryDecision?: {
2753
+ reasonCode: string;
2754
+ reasonText: string;
2755
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2756
+ tags: string[];
2757
+ maskedFields: string[];
2758
+ policyId?: string | undefined;
2759
+ ruleId?: string | undefined;
2760
+ classification?: string | undefined;
2761
+ } | null | undefined;
2762
+ firewallDecision?: {
2763
+ score: number;
2764
+ reasonCode: string;
2765
+ reasonText: string;
2766
+ action: "allow" | "deny" | "sanitize";
2767
+ findings: {
2768
+ target: "input" | "payload" | "output" | "tool_call";
2769
+ severity: "low" | "high" | "critical" | "med";
2770
+ ruleKey: string;
2771
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2772
+ fieldPath: string;
2773
+ matchPreview: string;
2774
+ }[];
2775
+ redactions: string[];
2776
+ blockedTools: string[];
2777
+ blockedDomains: string[];
2778
+ sanitizedPayload?: Record<string, unknown> | undefined;
2779
+ } | null | undefined;
2780
+ }, {
2781
+ run: {
2782
+ id: string;
2783
+ workspaceId: string;
2784
+ workflowVersionId: string;
2785
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2786
+ correlationId: string;
2787
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2788
+ requestedBy: string;
2789
+ requestedAt: string;
2790
+ idempotencyKey?: string | null | undefined;
2791
+ startedAt?: string | null | undefined;
2792
+ completedAt?: string | null | undefined;
2793
+ slaPolicyId?: string | null | undefined;
2794
+ slaDueAt?: string | null | undefined;
2795
+ slaViolatedAt?: string | null | undefined;
2796
+ };
2797
+ approval?: {
2798
+ status: "approved" | "denied" | "pending";
2799
+ id: string;
2800
+ runId: string;
2801
+ requiredRole: string;
2802
+ createdAt: string;
2803
+ decidedAt?: string | null | undefined;
2804
+ decidedBy?: string | null | undefined;
2805
+ } | null | undefined;
2806
+ blocked?: boolean | undefined;
2807
+ policyDecisions?: {
2808
+ correlationId: string;
2809
+ mode: "monitor" | "enforce";
2810
+ decision: "allow" | "deny";
2811
+ policyId: string;
2812
+ ruleId: string;
2813
+ reasonCode: string;
2814
+ reasonText: string;
2815
+ trace: Record<string, unknown>;
2816
+ }[] | undefined;
2817
+ entitlementDecision?: {
2818
+ id: string;
2819
+ reasonCode: string;
2820
+ reasonText: string;
2821
+ entitled: boolean;
2822
+ } | undefined;
2823
+ usageEntry?: {
2824
+ id: string;
2825
+ quantity: number;
2826
+ } | undefined;
2827
+ boundaryDecision?: {
2828
+ reasonCode: string;
2829
+ reasonText: string;
2830
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2831
+ policyId?: string | undefined;
2832
+ ruleId?: string | undefined;
2833
+ classification?: string | undefined;
2834
+ tags?: string[] | undefined;
2835
+ maskedFields?: string[] | undefined;
2836
+ } | null | undefined;
2837
+ firewallDecision?: {
2838
+ score: number;
2839
+ reasonCode: string;
2840
+ reasonText: string;
2841
+ action: "allow" | "deny" | "sanitize";
2842
+ findings?: {
2843
+ target: "input" | "payload" | "output" | "tool_call";
2844
+ severity: "low" | "high" | "critical" | "med";
2845
+ ruleKey: string;
2846
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2847
+ fieldPath: string;
2848
+ matchPreview: string;
2849
+ }[] | undefined;
2850
+ redactions?: string[] | undefined;
2851
+ blockedTools?: string[] | undefined;
2852
+ blockedDomains?: string[] | undefined;
2853
+ sanitizedPayload?: Record<string, unknown> | undefined;
2854
+ } | null | undefined;
2855
+ }>;
2856
+ }, "strip", z.ZodTypeAny, {
2857
+ session: {
2858
+ sessionId: string;
2859
+ workspaceId: string;
2860
+ createdAt: string;
2861
+ agent: string;
2862
+ workflowVersionId?: string | undefined;
2863
+ policy?: {
2864
+ version: string;
2865
+ ref: string;
2866
+ } | undefined;
2867
+ route?: {
2868
+ provider?: string | undefined;
2869
+ model?: string | undefined;
2870
+ region?: string | undefined;
2871
+ } | undefined;
2872
+ risk?: {
2873
+ score?: number | undefined;
2874
+ decision?: "allow" | "deny" | "review" | undefined;
2875
+ } | undefined;
2876
+ subject?: string | undefined;
2877
+ metadata?: Record<string, unknown> | undefined;
2878
+ expiresAt?: string | undefined;
2879
+ };
2880
+ execution: {
2881
+ run: {
2882
+ id: string;
2883
+ workspaceId: string;
2884
+ workflowVersionId: string;
2885
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2886
+ correlationId: string;
2887
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2888
+ requestedBy: string;
2889
+ requestedAt: string;
2890
+ idempotencyKey?: string | null | undefined;
2891
+ startedAt?: string | null | undefined;
2892
+ completedAt?: string | null | undefined;
2893
+ slaPolicyId?: string | null | undefined;
2894
+ slaDueAt?: string | null | undefined;
2895
+ slaViolatedAt?: string | null | undefined;
2896
+ };
2897
+ approval?: {
2898
+ status: "approved" | "denied" | "pending";
2899
+ id: string;
2900
+ runId: string;
2901
+ requiredRole: string;
2902
+ createdAt: string;
2903
+ decidedAt?: string | null | undefined;
2904
+ decidedBy?: string | null | undefined;
2905
+ } | null | undefined;
2906
+ blocked?: boolean | undefined;
2907
+ policyDecisions?: {
2908
+ correlationId: string;
2909
+ mode: "monitor" | "enforce";
2910
+ decision: "allow" | "deny";
2911
+ policyId: string;
2912
+ ruleId: string;
2913
+ reasonCode: string;
2914
+ reasonText: string;
2915
+ trace: Record<string, unknown>;
2916
+ }[] | undefined;
2917
+ entitlementDecision?: {
2918
+ id: string;
2919
+ reasonCode: string;
2920
+ reasonText: string;
2921
+ entitled: boolean;
2922
+ } | undefined;
2923
+ usageEntry?: {
2924
+ id: string;
2925
+ quantity: number;
2926
+ } | undefined;
2927
+ boundaryDecision?: {
2928
+ reasonCode: string;
2929
+ reasonText: string;
2930
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
2931
+ tags: string[];
2932
+ maskedFields: string[];
2933
+ policyId?: string | undefined;
2934
+ ruleId?: string | undefined;
2935
+ classification?: string | undefined;
2936
+ } | null | undefined;
2937
+ firewallDecision?: {
2938
+ score: number;
2939
+ reasonCode: string;
2940
+ reasonText: string;
2941
+ action: "allow" | "deny" | "sanitize";
2942
+ findings: {
2943
+ target: "input" | "payload" | "output" | "tool_call";
2944
+ severity: "low" | "high" | "critical" | "med";
2945
+ ruleKey: string;
2946
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
2947
+ fieldPath: string;
2948
+ matchPreview: string;
2949
+ }[];
2950
+ redactions: string[];
2951
+ blockedTools: string[];
2952
+ blockedDomains: string[];
2953
+ sanitizedPayload?: Record<string, unknown> | undefined;
2954
+ } | null | undefined;
2955
+ };
2956
+ }, {
2957
+ session: {
2958
+ sessionId: string;
2959
+ workspaceId: string;
2960
+ createdAt: string;
2961
+ agent: string;
2962
+ workflowVersionId?: string | undefined;
2963
+ policy?: {
2964
+ version: string;
2965
+ ref: string;
2966
+ } | undefined;
2967
+ route?: {
2968
+ provider?: string | undefined;
2969
+ model?: string | undefined;
2970
+ region?: string | undefined;
2971
+ } | undefined;
2972
+ risk?: {
2973
+ score?: number | undefined;
2974
+ decision?: "allow" | "deny" | "review" | undefined;
2975
+ } | undefined;
2976
+ subject?: string | undefined;
2977
+ metadata?: Record<string, unknown> | undefined;
2978
+ expiresAt?: string | undefined;
2979
+ };
2980
+ execution: {
2981
+ run: {
2982
+ id: string;
2983
+ workspaceId: string;
2984
+ workflowVersionId: string;
2985
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
2986
+ correlationId: string;
2987
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
2988
+ requestedBy: string;
2989
+ requestedAt: string;
2990
+ idempotencyKey?: string | null | undefined;
2991
+ startedAt?: string | null | undefined;
2992
+ completedAt?: string | null | undefined;
2993
+ slaPolicyId?: string | null | undefined;
2994
+ slaDueAt?: string | null | undefined;
2995
+ slaViolatedAt?: string | null | undefined;
2996
+ };
2997
+ approval?: {
2998
+ status: "approved" | "denied" | "pending";
2999
+ id: string;
3000
+ runId: string;
3001
+ requiredRole: string;
3002
+ createdAt: string;
3003
+ decidedAt?: string | null | undefined;
3004
+ decidedBy?: string | null | undefined;
3005
+ } | null | undefined;
3006
+ blocked?: boolean | undefined;
3007
+ policyDecisions?: {
3008
+ correlationId: string;
3009
+ mode: "monitor" | "enforce";
3010
+ decision: "allow" | "deny";
3011
+ policyId: string;
3012
+ ruleId: string;
3013
+ reasonCode: string;
3014
+ reasonText: string;
3015
+ trace: Record<string, unknown>;
3016
+ }[] | undefined;
3017
+ entitlementDecision?: {
3018
+ id: string;
3019
+ reasonCode: string;
3020
+ reasonText: string;
3021
+ entitled: boolean;
3022
+ } | undefined;
3023
+ usageEntry?: {
3024
+ id: string;
3025
+ quantity: number;
3026
+ } | undefined;
3027
+ boundaryDecision?: {
3028
+ reasonCode: string;
3029
+ reasonText: string;
3030
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
3031
+ policyId?: string | undefined;
3032
+ ruleId?: string | undefined;
3033
+ classification?: string | undefined;
3034
+ tags?: string[] | undefined;
3035
+ maskedFields?: string[] | undefined;
3036
+ } | null | undefined;
3037
+ firewallDecision?: {
3038
+ score: number;
3039
+ reasonCode: string;
3040
+ reasonText: string;
3041
+ action: "allow" | "deny" | "sanitize";
3042
+ findings?: {
3043
+ target: "input" | "payload" | "output" | "tool_call";
3044
+ severity: "low" | "high" | "critical" | "med";
3045
+ ruleKey: string;
3046
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
3047
+ fieldPath: string;
3048
+ matchPreview: string;
3049
+ }[] | undefined;
3050
+ redactions?: string[] | undefined;
3051
+ blockedTools?: string[] | undefined;
3052
+ blockedDomains?: string[] | undefined;
3053
+ sanitizedPayload?: Record<string, unknown> | undefined;
3054
+ } | null | undefined;
3055
+ };
3056
+ }>>;
3057
+ meta: z.ZodObject<{
3058
+ requestId: z.ZodString;
3059
+ sessionId: z.ZodOptional<z.ZodString>;
3060
+ executionId: z.ZodOptional<z.ZodString>;
3061
+ lineageId: z.ZodOptional<z.ZodString>;
3062
+ policy: z.ZodOptional<z.ZodObject<{
3063
+ ref: z.ZodString;
3064
+ version: z.ZodString;
3065
+ }, "strip", z.ZodTypeAny, {
3066
+ version: string;
3067
+ ref: string;
3068
+ }, {
3069
+ version: string;
3070
+ ref: string;
3071
+ }>>;
3072
+ route: z.ZodOptional<z.ZodObject<{
3073
+ provider: z.ZodOptional<z.ZodString>;
3074
+ model: z.ZodOptional<z.ZodString>;
3075
+ region: z.ZodOptional<z.ZodString>;
3076
+ }, "strip", z.ZodTypeAny, {
3077
+ provider?: string | undefined;
3078
+ model?: string | undefined;
3079
+ region?: string | undefined;
3080
+ }, {
3081
+ provider?: string | undefined;
3082
+ model?: string | undefined;
3083
+ region?: string | undefined;
3084
+ }>>;
3085
+ risk: z.ZodOptional<z.ZodObject<{
3086
+ score: z.ZodOptional<z.ZodNumber>;
3087
+ decision: z.ZodOptional<z.ZodEnum<["allow", "deny", "review"]>>;
3088
+ }, "strip", z.ZodTypeAny, {
3089
+ score?: number | undefined;
3090
+ decision?: "allow" | "deny" | "review" | undefined;
3091
+ }, {
3092
+ score?: number | undefined;
3093
+ decision?: "allow" | "deny" | "review" | undefined;
3094
+ }>>;
3095
+ timingMs: z.ZodObject<{
3096
+ total: z.ZodNumber;
3097
+ policy: z.ZodOptional<z.ZodNumber>;
3098
+ route: z.ZodOptional<z.ZodNumber>;
3099
+ tool: z.ZodOptional<z.ZodNumber>;
3100
+ }, "strip", z.ZodTypeAny, {
3101
+ total: number;
3102
+ policy?: number | undefined;
3103
+ route?: number | undefined;
3104
+ tool?: number | undefined;
3105
+ }, {
3106
+ total: number;
3107
+ policy?: number | undefined;
3108
+ route?: number | undefined;
3109
+ tool?: number | undefined;
3110
+ }>;
3111
+ }, "strip", z.ZodTypeAny, {
3112
+ requestId: string;
3113
+ timingMs: {
3114
+ total: number;
3115
+ policy?: number | undefined;
3116
+ route?: number | undefined;
3117
+ tool?: number | undefined;
3118
+ };
3119
+ policy?: {
3120
+ version: string;
3121
+ ref: string;
3122
+ } | undefined;
3123
+ route?: {
3124
+ provider?: string | undefined;
3125
+ model?: string | undefined;
3126
+ region?: string | undefined;
3127
+ } | undefined;
3128
+ sessionId?: string | undefined;
3129
+ executionId?: string | undefined;
3130
+ lineageId?: string | undefined;
3131
+ risk?: {
3132
+ score?: number | undefined;
3133
+ decision?: "allow" | "deny" | "review" | undefined;
3134
+ } | undefined;
3135
+ }, {
3136
+ requestId: string;
3137
+ timingMs: {
3138
+ total: number;
3139
+ policy?: number | undefined;
3140
+ route?: number | undefined;
3141
+ tool?: number | undefined;
3142
+ };
3143
+ policy?: {
3144
+ version: string;
3145
+ ref: string;
3146
+ } | undefined;
3147
+ route?: {
3148
+ provider?: string | undefined;
3149
+ model?: string | undefined;
3150
+ region?: string | undefined;
3151
+ } | undefined;
3152
+ sessionId?: string | undefined;
3153
+ executionId?: string | undefined;
3154
+ lineageId?: string | undefined;
3155
+ risk?: {
3156
+ score?: number | undefined;
3157
+ decision?: "allow" | "deny" | "review" | undefined;
3158
+ } | undefined;
3159
+ }>;
3160
+ error: z.ZodNullable<z.ZodObject<{
3161
+ code: z.ZodString;
3162
+ message: z.ZodString;
3163
+ status: z.ZodNumber;
3164
+ retryable: z.ZodBoolean;
3165
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3166
+ }, "strip", z.ZodTypeAny, {
3167
+ code: string;
3168
+ message: string;
3169
+ status: number;
3170
+ retryable: boolean;
3171
+ details?: Record<string, unknown> | undefined;
3172
+ }, {
3173
+ code: string;
3174
+ message: string;
3175
+ status: number;
3176
+ retryable: boolean;
3177
+ details?: Record<string, unknown> | undefined;
3178
+ }>>;
3179
+ }, "strip", z.ZodTypeAny, {
3180
+ error: {
3181
+ code: string;
3182
+ message: string;
3183
+ status: number;
3184
+ retryable: boolean;
3185
+ details?: Record<string, unknown> | undefined;
3186
+ } | null;
3187
+ ok: boolean;
3188
+ data: {
3189
+ session: {
3190
+ sessionId: string;
3191
+ workspaceId: string;
3192
+ createdAt: string;
3193
+ agent: string;
3194
+ workflowVersionId?: string | undefined;
3195
+ policy?: {
3196
+ version: string;
3197
+ ref: string;
3198
+ } | undefined;
3199
+ route?: {
3200
+ provider?: string | undefined;
3201
+ model?: string | undefined;
3202
+ region?: string | undefined;
3203
+ } | undefined;
3204
+ risk?: {
3205
+ score?: number | undefined;
3206
+ decision?: "allow" | "deny" | "review" | undefined;
3207
+ } | undefined;
3208
+ subject?: string | undefined;
3209
+ metadata?: Record<string, unknown> | undefined;
3210
+ expiresAt?: string | undefined;
3211
+ };
3212
+ execution: {
3213
+ run: {
3214
+ id: string;
3215
+ workspaceId: string;
3216
+ workflowVersionId: string;
3217
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3218
+ correlationId: string;
3219
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3220
+ requestedBy: string;
3221
+ requestedAt: string;
3222
+ idempotencyKey?: string | null | undefined;
3223
+ startedAt?: string | null | undefined;
3224
+ completedAt?: string | null | undefined;
3225
+ slaPolicyId?: string | null | undefined;
3226
+ slaDueAt?: string | null | undefined;
3227
+ slaViolatedAt?: string | null | undefined;
3228
+ };
3229
+ approval?: {
3230
+ status: "approved" | "denied" | "pending";
3231
+ id: string;
3232
+ runId: string;
3233
+ requiredRole: string;
3234
+ createdAt: string;
3235
+ decidedAt?: string | null | undefined;
3236
+ decidedBy?: string | null | undefined;
3237
+ } | null | undefined;
3238
+ blocked?: boolean | undefined;
3239
+ policyDecisions?: {
3240
+ correlationId: string;
3241
+ mode: "monitor" | "enforce";
3242
+ decision: "allow" | "deny";
3243
+ policyId: string;
3244
+ ruleId: string;
3245
+ reasonCode: string;
3246
+ reasonText: string;
3247
+ trace: Record<string, unknown>;
3248
+ }[] | undefined;
3249
+ entitlementDecision?: {
3250
+ id: string;
3251
+ reasonCode: string;
3252
+ reasonText: string;
3253
+ entitled: boolean;
3254
+ } | undefined;
3255
+ usageEntry?: {
3256
+ id: string;
3257
+ quantity: number;
3258
+ } | undefined;
3259
+ boundaryDecision?: {
3260
+ reasonCode: string;
3261
+ reasonText: string;
3262
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
3263
+ tags: string[];
3264
+ maskedFields: string[];
3265
+ policyId?: string | undefined;
3266
+ ruleId?: string | undefined;
3267
+ classification?: string | undefined;
3268
+ } | null | undefined;
3269
+ firewallDecision?: {
3270
+ score: number;
3271
+ reasonCode: string;
3272
+ reasonText: string;
3273
+ action: "allow" | "deny" | "sanitize";
3274
+ findings: {
3275
+ target: "input" | "payload" | "output" | "tool_call";
3276
+ severity: "low" | "high" | "critical" | "med";
3277
+ ruleKey: string;
3278
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
3279
+ fieldPath: string;
3280
+ matchPreview: string;
3281
+ }[];
3282
+ redactions: string[];
3283
+ blockedTools: string[];
3284
+ blockedDomains: string[];
3285
+ sanitizedPayload?: Record<string, unknown> | undefined;
3286
+ } | null | undefined;
3287
+ };
3288
+ } | null;
3289
+ meta: {
3290
+ requestId: string;
3291
+ timingMs: {
3292
+ total: number;
3293
+ policy?: number | undefined;
3294
+ route?: number | undefined;
3295
+ tool?: number | undefined;
3296
+ };
3297
+ policy?: {
3298
+ version: string;
3299
+ ref: string;
3300
+ } | undefined;
3301
+ route?: {
3302
+ provider?: string | undefined;
3303
+ model?: string | undefined;
3304
+ region?: string | undefined;
3305
+ } | undefined;
3306
+ sessionId?: string | undefined;
3307
+ executionId?: string | undefined;
3308
+ lineageId?: string | undefined;
3309
+ risk?: {
3310
+ score?: number | undefined;
3311
+ decision?: "allow" | "deny" | "review" | undefined;
3312
+ } | undefined;
3313
+ };
3314
+ }, {
3315
+ error: {
3316
+ code: string;
3317
+ message: string;
3318
+ status: number;
3319
+ retryable: boolean;
3320
+ details?: Record<string, unknown> | undefined;
3321
+ } | null;
3322
+ ok: boolean;
3323
+ data: {
3324
+ session: {
3325
+ sessionId: string;
3326
+ workspaceId: string;
3327
+ createdAt: string;
3328
+ agent: string;
3329
+ workflowVersionId?: string | undefined;
3330
+ policy?: {
3331
+ version: string;
3332
+ ref: string;
3333
+ } | undefined;
3334
+ route?: {
3335
+ provider?: string | undefined;
3336
+ model?: string | undefined;
3337
+ region?: string | undefined;
3338
+ } | undefined;
3339
+ risk?: {
3340
+ score?: number | undefined;
3341
+ decision?: "allow" | "deny" | "review" | undefined;
3342
+ } | undefined;
3343
+ subject?: string | undefined;
3344
+ metadata?: Record<string, unknown> | undefined;
3345
+ expiresAt?: string | undefined;
3346
+ };
3347
+ execution: {
3348
+ run: {
3349
+ id: string;
3350
+ workspaceId: string;
3351
+ workflowVersionId: string;
3352
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3353
+ correlationId: string;
3354
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3355
+ requestedBy: string;
3356
+ requestedAt: string;
3357
+ idempotencyKey?: string | null | undefined;
3358
+ startedAt?: string | null | undefined;
3359
+ completedAt?: string | null | undefined;
3360
+ slaPolicyId?: string | null | undefined;
3361
+ slaDueAt?: string | null | undefined;
3362
+ slaViolatedAt?: string | null | undefined;
3363
+ };
3364
+ approval?: {
3365
+ status: "approved" | "denied" | "pending";
3366
+ id: string;
3367
+ runId: string;
3368
+ requiredRole: string;
3369
+ createdAt: string;
3370
+ decidedAt?: string | null | undefined;
3371
+ decidedBy?: string | null | undefined;
3372
+ } | null | undefined;
3373
+ blocked?: boolean | undefined;
3374
+ policyDecisions?: {
3375
+ correlationId: string;
3376
+ mode: "monitor" | "enforce";
3377
+ decision: "allow" | "deny";
3378
+ policyId: string;
3379
+ ruleId: string;
3380
+ reasonCode: string;
3381
+ reasonText: string;
3382
+ trace: Record<string, unknown>;
3383
+ }[] | undefined;
3384
+ entitlementDecision?: {
3385
+ id: string;
3386
+ reasonCode: string;
3387
+ reasonText: string;
3388
+ entitled: boolean;
3389
+ } | undefined;
3390
+ usageEntry?: {
3391
+ id: string;
3392
+ quantity: number;
3393
+ } | undefined;
3394
+ boundaryDecision?: {
3395
+ reasonCode: string;
3396
+ reasonText: string;
3397
+ action: "allow" | "block" | "redact" | "mask" | "escalate";
3398
+ policyId?: string | undefined;
3399
+ ruleId?: string | undefined;
3400
+ classification?: string | undefined;
3401
+ tags?: string[] | undefined;
3402
+ maskedFields?: string[] | undefined;
3403
+ } | null | undefined;
3404
+ firewallDecision?: {
3405
+ score: number;
3406
+ reasonCode: string;
3407
+ reasonText: string;
3408
+ action: "allow" | "deny" | "sanitize";
3409
+ findings?: {
3410
+ target: "input" | "payload" | "output" | "tool_call";
3411
+ severity: "low" | "high" | "critical" | "med";
3412
+ ruleKey: string;
3413
+ category: "prompt_injection" | "secret" | "pii" | "malicious_payload";
3414
+ fieldPath: string;
3415
+ matchPreview: string;
3416
+ }[] | undefined;
3417
+ redactions?: string[] | undefined;
3418
+ blockedTools?: string[] | undefined;
3419
+ blockedDomains?: string[] | undefined;
3420
+ sanitizedPayload?: Record<string, unknown> | undefined;
3421
+ } | null | undefined;
3422
+ };
3423
+ } | null;
3424
+ meta: {
3425
+ requestId: string;
3426
+ timingMs: {
3427
+ total: number;
3428
+ policy?: number | undefined;
3429
+ route?: number | undefined;
3430
+ tool?: number | undefined;
3431
+ };
3432
+ policy?: {
3433
+ version: string;
3434
+ ref: string;
3435
+ } | undefined;
3436
+ route?: {
3437
+ provider?: string | undefined;
3438
+ model?: string | undefined;
3439
+ region?: string | undefined;
3440
+ } | undefined;
3441
+ sessionId?: string | undefined;
3442
+ executionId?: string | undefined;
3443
+ lineageId?: string | undefined;
3444
+ risk?: {
3445
+ score?: number | undefined;
3446
+ decision?: "allow" | "deny" | "review" | undefined;
3447
+ } | undefined;
3448
+ };
3449
+ }>;
3450
+ declare const RunEventsResponseSchema: z.ZodObject<{
3451
+ events: z.ZodArray<z.ZodObject<{
3452
+ id: z.ZodString;
3453
+ runId: z.ZodString;
3454
+ type: z.ZodString;
3455
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3456
+ createdAt: z.ZodString;
3457
+ }, "strip", z.ZodTypeAny, {
3458
+ type: string;
3459
+ id: string;
3460
+ runId: string;
3461
+ createdAt: string;
3462
+ payload: Record<string, unknown>;
3463
+ }, {
3464
+ type: string;
3465
+ id: string;
3466
+ runId: string;
3467
+ createdAt: string;
3468
+ payload: Record<string, unknown>;
3469
+ }>, "many">;
3470
+ }, "strip", z.ZodTypeAny, {
3471
+ events: {
3472
+ type: string;
3473
+ id: string;
3474
+ runId: string;
3475
+ createdAt: string;
3476
+ payload: Record<string, unknown>;
3477
+ }[];
3478
+ }, {
3479
+ events: {
3480
+ type: string;
3481
+ id: string;
3482
+ runId: string;
3483
+ createdAt: string;
3484
+ payload: Record<string, unknown>;
3485
+ }[];
3486
+ }>;
3487
+ declare const ApprovalsListSchema: z.ZodObject<{
3488
+ approvals: z.ZodArray<z.ZodObject<{
3489
+ approval: z.ZodObject<{
3490
+ id: z.ZodString;
3491
+ runId: z.ZodString;
3492
+ requiredRole: z.ZodString;
3493
+ status: z.ZodEnum<["pending", "approved", "denied"]>;
3494
+ createdAt: z.ZodString;
3495
+ decidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3496
+ decidedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3497
+ }, "strip", z.ZodTypeAny, {
3498
+ status: "approved" | "denied" | "pending";
3499
+ id: string;
3500
+ runId: string;
3501
+ requiredRole: string;
3502
+ createdAt: string;
3503
+ decidedAt?: string | null | undefined;
3504
+ decidedBy?: string | null | undefined;
3505
+ }, {
3506
+ status: "approved" | "denied" | "pending";
3507
+ id: string;
3508
+ runId: string;
3509
+ requiredRole: string;
3510
+ createdAt: string;
3511
+ decidedAt?: string | null | undefined;
3512
+ decidedBy?: string | null | undefined;
3513
+ }>;
3514
+ run: z.ZodObject<{
3515
+ id: z.ZodString;
3516
+ workspaceId: z.ZodString;
3517
+ workflowVersionId: z.ZodString;
3518
+ state: z.ZodEnum<["queued", "running", "waiting_approval", "approved", "denied", "succeeded", "failed", "aborted", "timed_out", "canceled"]>;
3519
+ correlationId: z.ZodString;
3520
+ idempotencyKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3521
+ triggerSource: z.ZodEnum<["ui", "api", "sdk", "cli", "hosted", "webhook"]>;
3522
+ requestedBy: z.ZodString;
3523
+ requestedAt: z.ZodString;
3524
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3525
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3526
+ slaPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3527
+ slaDueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3528
+ slaViolatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3529
+ }, "strip", z.ZodTypeAny, {
3530
+ id: string;
3531
+ workspaceId: string;
3532
+ workflowVersionId: string;
3533
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3534
+ correlationId: string;
3535
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3536
+ requestedBy: string;
3537
+ requestedAt: string;
3538
+ idempotencyKey?: string | null | undefined;
3539
+ startedAt?: string | null | undefined;
3540
+ completedAt?: string | null | undefined;
3541
+ slaPolicyId?: string | null | undefined;
3542
+ slaDueAt?: string | null | undefined;
3543
+ slaViolatedAt?: string | null | undefined;
3544
+ }, {
3545
+ id: string;
3546
+ workspaceId: string;
3547
+ workflowVersionId: string;
3548
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3549
+ correlationId: string;
3550
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3551
+ requestedBy: string;
3552
+ requestedAt: string;
3553
+ idempotencyKey?: string | null | undefined;
3554
+ startedAt?: string | null | undefined;
3555
+ completedAt?: string | null | undefined;
3556
+ slaPolicyId?: string | null | undefined;
3557
+ slaDueAt?: string | null | undefined;
3558
+ slaViolatedAt?: string | null | undefined;
3559
+ }>;
3560
+ }, "strip", z.ZodTypeAny, {
3561
+ run: {
3562
+ id: string;
3563
+ workspaceId: string;
3564
+ workflowVersionId: string;
3565
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3566
+ correlationId: string;
3567
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3568
+ requestedBy: string;
3569
+ requestedAt: string;
3570
+ idempotencyKey?: string | null | undefined;
3571
+ startedAt?: string | null | undefined;
3572
+ completedAt?: string | null | undefined;
3573
+ slaPolicyId?: string | null | undefined;
3574
+ slaDueAt?: string | null | undefined;
3575
+ slaViolatedAt?: string | null | undefined;
3576
+ };
3577
+ approval: {
3578
+ status: "approved" | "denied" | "pending";
3579
+ id: string;
3580
+ runId: string;
3581
+ requiredRole: string;
3582
+ createdAt: string;
3583
+ decidedAt?: string | null | undefined;
3584
+ decidedBy?: string | null | undefined;
3585
+ };
3586
+ }, {
3587
+ run: {
3588
+ id: string;
3589
+ workspaceId: string;
3590
+ workflowVersionId: string;
3591
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3592
+ correlationId: string;
3593
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3594
+ requestedBy: string;
3595
+ requestedAt: string;
3596
+ idempotencyKey?: string | null | undefined;
3597
+ startedAt?: string | null | undefined;
3598
+ completedAt?: string | null | undefined;
3599
+ slaPolicyId?: string | null | undefined;
3600
+ slaDueAt?: string | null | undefined;
3601
+ slaViolatedAt?: string | null | undefined;
3602
+ };
3603
+ approval: {
3604
+ status: "approved" | "denied" | "pending";
3605
+ id: string;
3606
+ runId: string;
3607
+ requiredRole: string;
3608
+ createdAt: string;
3609
+ decidedAt?: string | null | undefined;
3610
+ decidedBy?: string | null | undefined;
3611
+ };
3612
+ }>, "many">;
3613
+ }, "strip", z.ZodTypeAny, {
3614
+ approvals: {
3615
+ run: {
3616
+ id: string;
3617
+ workspaceId: string;
3618
+ workflowVersionId: string;
3619
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3620
+ correlationId: string;
3621
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3622
+ requestedBy: string;
3623
+ requestedAt: string;
3624
+ idempotencyKey?: string | null | undefined;
3625
+ startedAt?: string | null | undefined;
3626
+ completedAt?: string | null | undefined;
3627
+ slaPolicyId?: string | null | undefined;
3628
+ slaDueAt?: string | null | undefined;
3629
+ slaViolatedAt?: string | null | undefined;
3630
+ };
3631
+ approval: {
3632
+ status: "approved" | "denied" | "pending";
3633
+ id: string;
3634
+ runId: string;
3635
+ requiredRole: string;
3636
+ createdAt: string;
3637
+ decidedAt?: string | null | undefined;
3638
+ decidedBy?: string | null | undefined;
3639
+ };
3640
+ }[];
3641
+ }, {
3642
+ approvals: {
3643
+ run: {
3644
+ id: string;
3645
+ workspaceId: string;
3646
+ workflowVersionId: string;
3647
+ state: "aborted" | "queued" | "running" | "waiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "timed_out" | "canceled";
3648
+ correlationId: string;
3649
+ triggerSource: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3650
+ requestedBy: string;
3651
+ requestedAt: string;
3652
+ idempotencyKey?: string | null | undefined;
3653
+ startedAt?: string | null | undefined;
3654
+ completedAt?: string | null | undefined;
3655
+ slaPolicyId?: string | null | undefined;
3656
+ slaDueAt?: string | null | undefined;
3657
+ slaViolatedAt?: string | null | undefined;
3658
+ };
3659
+ approval: {
3660
+ status: "approved" | "denied" | "pending";
3661
+ id: string;
3662
+ runId: string;
3663
+ requiredRole: string;
3664
+ createdAt: string;
3665
+ decidedAt?: string | null | undefined;
3666
+ decidedBy?: string | null | undefined;
3667
+ };
3668
+ }[];
3669
+ }>;
3670
+ declare const DeployResponseSchema: z.ZodObject<{
3671
+ project: z.ZodObject<{
3672
+ id: z.ZodString;
3673
+ workspaceId: z.ZodString;
3674
+ name: z.ZodString;
3675
+ createdBy: z.ZodString;
3676
+ createdAt: z.ZodString;
3677
+ updatedAt: z.ZodString;
3678
+ }, "strip", z.ZodTypeAny, {
3679
+ id: string;
3680
+ workspaceId: string;
3681
+ createdAt: string;
3682
+ name: string;
3683
+ createdBy: string;
3684
+ updatedAt: string;
3685
+ }, {
3686
+ id: string;
3687
+ workspaceId: string;
3688
+ createdAt: string;
3689
+ name: string;
3690
+ createdBy: string;
3691
+ updatedAt: string;
3692
+ }>;
3693
+ workflow: z.ZodObject<{
3694
+ id: z.ZodString;
3695
+ projectId: z.ZodString;
3696
+ workspaceId: z.ZodString;
3697
+ name: z.ZodString;
3698
+ status: z.ZodEnum<["draft", "published", "archived"]>;
3699
+ createdBy: z.ZodString;
3700
+ createdAt: z.ZodString;
3701
+ updatedAt: z.ZodString;
3702
+ }, "strip", z.ZodTypeAny, {
3703
+ status: "draft" | "published" | "archived";
3704
+ id: string;
3705
+ workspaceId: string;
3706
+ createdAt: string;
3707
+ name: string;
3708
+ createdBy: string;
3709
+ updatedAt: string;
3710
+ projectId: string;
3711
+ }, {
3712
+ status: "draft" | "published" | "archived";
3713
+ id: string;
3714
+ workspaceId: string;
3715
+ createdAt: string;
3716
+ name: string;
3717
+ createdBy: string;
3718
+ updatedAt: string;
3719
+ projectId: string;
3720
+ }>;
3721
+ draft: z.ZodObject<{
3722
+ workflowId: z.ZodString;
3723
+ workspaceId: z.ZodString;
3724
+ version: z.ZodNumber;
3725
+ nodes: z.ZodArray<z.ZodUnknown, "many">;
3726
+ edges: z.ZodArray<z.ZodUnknown, "many">;
3727
+ viewport: z.ZodObject<{
3728
+ x: z.ZodNumber;
3729
+ y: z.ZodNumber;
3730
+ zoom: z.ZodNumber;
3731
+ }, "strip", z.ZodTypeAny, {
3732
+ x: number;
3733
+ y: number;
3734
+ zoom: number;
3735
+ }, {
3736
+ x: number;
3737
+ y: number;
3738
+ zoom: number;
3739
+ }>;
3740
+ updatedAt: z.ZodString;
3741
+ }, "strip", z.ZodTypeAny, {
3742
+ workspaceId: string;
3743
+ updatedAt: string;
3744
+ workflowId: string;
3745
+ version: number;
3746
+ nodes: unknown[];
3747
+ edges: unknown[];
3748
+ viewport: {
3749
+ x: number;
3750
+ y: number;
3751
+ zoom: number;
3752
+ };
3753
+ }, {
3754
+ workspaceId: string;
3755
+ updatedAt: string;
3756
+ workflowId: string;
3757
+ version: number;
3758
+ nodes: unknown[];
3759
+ edges: unknown[];
3760
+ viewport: {
3761
+ x: number;
3762
+ y: number;
3763
+ zoom: number;
3764
+ };
3765
+ }>;
3766
+ compile: z.ZodObject<{
3767
+ checksum: z.ZodString;
3768
+ mutationNodeIds: z.ZodArray<z.ZodString, "many">;
3769
+ compiledPlan: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3770
+ }, "strip", z.ZodTypeAny, {
3771
+ checksum: string;
3772
+ mutationNodeIds: string[];
3773
+ compiledPlan: Record<string, unknown>;
3774
+ }, {
3775
+ checksum: string;
3776
+ mutationNodeIds: string[];
3777
+ compiledPlan: Record<string, unknown>;
3778
+ }>;
3779
+ }, "strip", z.ZodTypeAny, {
3780
+ project: {
3781
+ id: string;
3782
+ workspaceId: string;
3783
+ createdAt: string;
3784
+ name: string;
3785
+ createdBy: string;
3786
+ updatedAt: string;
3787
+ };
3788
+ workflow: {
3789
+ status: "draft" | "published" | "archived";
3790
+ id: string;
3791
+ workspaceId: string;
3792
+ createdAt: string;
3793
+ name: string;
3794
+ createdBy: string;
3795
+ updatedAt: string;
3796
+ projectId: string;
3797
+ };
3798
+ draft: {
3799
+ workspaceId: string;
3800
+ updatedAt: string;
3801
+ workflowId: string;
3802
+ version: number;
3803
+ nodes: unknown[];
3804
+ edges: unknown[];
3805
+ viewport: {
3806
+ x: number;
3807
+ y: number;
3808
+ zoom: number;
3809
+ };
3810
+ };
3811
+ compile: {
3812
+ checksum: string;
3813
+ mutationNodeIds: string[];
3814
+ compiledPlan: Record<string, unknown>;
3815
+ };
3816
+ }, {
3817
+ project: {
3818
+ id: string;
3819
+ workspaceId: string;
3820
+ createdAt: string;
3821
+ name: string;
3822
+ createdBy: string;
3823
+ updatedAt: string;
3824
+ };
3825
+ workflow: {
3826
+ status: "draft" | "published" | "archived";
3827
+ id: string;
3828
+ workspaceId: string;
3829
+ createdAt: string;
3830
+ name: string;
3831
+ createdBy: string;
3832
+ updatedAt: string;
3833
+ projectId: string;
3834
+ };
3835
+ draft: {
3836
+ workspaceId: string;
3837
+ updatedAt: string;
3838
+ workflowId: string;
3839
+ version: number;
3840
+ nodes: unknown[];
3841
+ edges: unknown[];
3842
+ viewport: {
3843
+ x: number;
3844
+ y: number;
3845
+ zoom: number;
3846
+ };
3847
+ };
3848
+ compile: {
3849
+ checksum: string;
3850
+ mutationNodeIds: string[];
3851
+ compiledPlan: Record<string, unknown>;
3852
+ };
3853
+ }>;
3854
+ declare const ConnectorRecordSchema: z.ZodObject<{
3855
+ id: z.ZodString;
3856
+ workspaceId: z.ZodString;
3857
+ name: z.ZodString;
3858
+ connectorType: z.ZodString;
3859
+ status: z.ZodEnum<["active", "disabled"]>;
3860
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3861
+ createdBy: z.ZodString;
3862
+ createdAt: z.ZodString;
3863
+ updatedAt: z.ZodString;
3864
+ }, "strip", z.ZodTypeAny, {
3865
+ status: "active" | "disabled";
3866
+ id: string;
3867
+ workspaceId: string;
3868
+ createdAt: string;
3869
+ name: string;
3870
+ createdBy: string;
3871
+ updatedAt: string;
3872
+ connectorType: string;
3873
+ config: Record<string, unknown>;
3874
+ }, {
3875
+ status: "active" | "disabled";
3876
+ id: string;
3877
+ workspaceId: string;
3878
+ createdAt: string;
3879
+ name: string;
3880
+ createdBy: string;
3881
+ updatedAt: string;
3882
+ connectorType: string;
3883
+ config: Record<string, unknown>;
3884
+ }>;
3885
+ declare const WorkspaceSecretRecordSchema: z.ZodObject<{
3886
+ id: z.ZodString;
3887
+ workspaceId: z.ZodString;
3888
+ connectorId: z.ZodNullable<z.ZodString>;
3889
+ name: z.ZodString;
3890
+ keyVersion: z.ZodString;
3891
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3892
+ createdBy: z.ZodString;
3893
+ createdAt: z.ZodString;
3894
+ rotatedAt: z.ZodNullable<z.ZodString>;
3895
+ revokedAt: z.ZodNullable<z.ZodString>;
3896
+ maskedValue: z.ZodString;
3897
+ }, "strip", z.ZodTypeAny, {
3898
+ id: string;
3899
+ workspaceId: string;
3900
+ createdAt: string;
3901
+ metadata: Record<string, unknown>;
3902
+ name: string;
3903
+ createdBy: string;
3904
+ connectorId: string | null;
3905
+ keyVersion: string;
3906
+ rotatedAt: string | null;
3907
+ revokedAt: string | null;
3908
+ maskedValue: string;
3909
+ }, {
3910
+ id: string;
3911
+ workspaceId: string;
3912
+ createdAt: string;
3913
+ metadata: Record<string, unknown>;
3914
+ name: string;
3915
+ createdBy: string;
3916
+ connectorId: string | null;
3917
+ keyVersion: string;
3918
+ rotatedAt: string | null;
3919
+ revokedAt: string | null;
3920
+ maskedValue: string;
3921
+ }>;
3922
+ declare const WorkspaceWebhookRecordSchema: z.ZodObject<{
3923
+ id: z.ZodString;
3924
+ workspaceId: z.ZodString;
3925
+ connectorId: z.ZodNullable<z.ZodString>;
3926
+ name: z.ZodString;
3927
+ path: z.ZodString;
3928
+ targetWorkflowId: z.ZodString;
3929
+ status: z.ZodEnum<["active", "disabled"]>;
3930
+ eventFilter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3931
+ createdBy: z.ZodString;
3932
+ createdAt: z.ZodString;
3933
+ updatedAt: z.ZodString;
3934
+ lastReceivedAt: z.ZodNullable<z.ZodString>;
3935
+ revokedAt: z.ZodNullable<z.ZodString>;
3936
+ signingSecretConfigured: z.ZodBoolean;
3937
+ }, "strip", z.ZodTypeAny, {
3938
+ path: string;
3939
+ status: "active" | "disabled";
3940
+ id: string;
3941
+ workspaceId: string;
3942
+ createdAt: string;
3943
+ name: string;
3944
+ createdBy: string;
3945
+ updatedAt: string;
3946
+ connectorId: string | null;
3947
+ revokedAt: string | null;
3948
+ targetWorkflowId: string;
3949
+ eventFilter: Record<string, unknown>;
3950
+ lastReceivedAt: string | null;
3951
+ signingSecretConfigured: boolean;
3952
+ }, {
3953
+ path: string;
3954
+ status: "active" | "disabled";
3955
+ id: string;
3956
+ workspaceId: string;
3957
+ createdAt: string;
3958
+ name: string;
3959
+ createdBy: string;
3960
+ updatedAt: string;
3961
+ connectorId: string | null;
3962
+ revokedAt: string | null;
3963
+ targetWorkflowId: string;
3964
+ eventFilter: Record<string, unknown>;
3965
+ lastReceivedAt: string | null;
3966
+ signingSecretConfigured: boolean;
3967
+ }>;
3968
+ declare class DriftGateError extends Error {
3969
+ readonly code: string;
3970
+ readonly status: number;
3971
+ readonly correlationId?: string | undefined;
3972
+ readonly details?: unknown | undefined;
3973
+ constructor(code: string, message: string, status: number, correlationId?: string | undefined, details?: unknown | undefined);
3974
+ }
3975
+ type DriftGateClientOptions = {
3976
+ baseUrl: string;
3977
+ sessionToken?: string;
3978
+ apiKey?: string;
3979
+ fetchImpl?: typeof fetch;
3980
+ };
3981
+ type DriftGateRunInput = {
3982
+ workspaceId: string;
3983
+ workflowVersionId: string;
3984
+ requiresApproval?: boolean;
3985
+ requiredRole?: string;
3986
+ slaPolicyId?: string;
3987
+ idempotencyKey?: string;
3988
+ correlationId?: string;
3989
+ triggerSource?: "ui" | "api" | "sdk" | "cli" | "hosted" | "webhook";
3990
+ input?: Record<string, unknown>;
3991
+ };
3992
+ type DriftGateCanonicalMeta = z.infer<typeof CanonicalMetaSchema>;
3993
+ type DriftGateCanonicalError = z.infer<typeof CanonicalErrorSchema>;
3994
+ type DriftGateCanonicalErrorCode = (typeof REQUIRED_V4_ERROR_CODES)[number];
3995
+ type DriftGateCanonicalResponse<T> = {
3996
+ ok: boolean;
3997
+ data: T | null;
3998
+ meta: DriftGateCanonicalMeta;
3999
+ error: DriftGateCanonicalError | null;
4000
+ raw: unknown;
4001
+ };
4002
+ type DriftGateSessionStartInput = z.input<typeof V4SessionStartRequestSchema>;
4003
+ type DriftGateSessionExecuteInput = z.input<typeof V4ExecutionRequestSchema>;
4004
+ type DriftGateEphemeralExecuteInput = z.input<typeof V4SessionStartRequestSchema> & {
4005
+ input: Record<string, unknown>;
4006
+ };
4007
+ type DriftGateSessionStartEnvelope = z.infer<typeof V4SessionStartResponseSchema>;
4008
+ type DriftGateExecutionEnvelope = z.infer<typeof V4ExecutionResponseSchema>;
4009
+ type DriftGateEphemeralExecutionEnvelope = z.infer<typeof V4EphemeralExecutionResponseSchema>;
4010
+ type WaitForTerminalOptions = {
4011
+ intervalMs?: number;
4012
+ timeoutMs?: number;
4013
+ };
4014
+ type DeployWorkflowInput = {
4015
+ workspaceId: string;
4016
+ workflowYaml: string;
4017
+ projectId?: string;
4018
+ projectName?: string;
4019
+ workflowId?: string;
4020
+ workflowName?: string;
4021
+ };
4022
+ type ConnectorCreateInput = {
4023
+ name: string;
4024
+ connectorType: string;
4025
+ status?: "active" | "disabled";
4026
+ config?: Record<string, unknown>;
4027
+ };
4028
+ type ConnectorUpdateInput = {
4029
+ name?: string;
4030
+ connectorType?: string;
4031
+ status?: "active" | "disabled";
4032
+ config?: Record<string, unknown>;
4033
+ };
4034
+ type SecretCreateInput = {
4035
+ connectorId?: string | null;
4036
+ name: string;
4037
+ value: string;
4038
+ keyVersion?: string;
4039
+ metadata?: Record<string, unknown>;
4040
+ };
4041
+ type SecretUpdateInput = {
4042
+ connectorId?: string | null;
4043
+ name?: string;
4044
+ value?: string;
4045
+ keyVersion?: string;
4046
+ metadata?: Record<string, unknown>;
4047
+ };
4048
+ type WebhookExecutionOptions = {
4049
+ requiresApproval?: boolean;
4050
+ requiredRole?: string;
4051
+ slaPolicyId?: string;
4052
+ };
4053
+ type WebhookCreateInput = {
4054
+ connectorId?: string | null;
4055
+ name: string;
4056
+ path: string;
4057
+ targetWorkflowId: string;
4058
+ status?: "active" | "disabled";
4059
+ eventFilter?: Record<string, unknown>;
4060
+ execution?: WebhookExecutionOptions;
4061
+ signingSecret: string;
4062
+ };
4063
+ type WebhookUpdateInput = {
4064
+ connectorId?: string | null;
4065
+ name?: string;
4066
+ path?: string;
4067
+ targetWorkflowId?: string;
4068
+ status?: "active" | "disabled";
4069
+ eventFilter?: Record<string, unknown>;
4070
+ execution?: WebhookExecutionOptions;
4071
+ signingSecret?: string;
4072
+ };
4073
+ type EdgeInterceptorRegisterInput = Omit<EdgeInterceptorRegisterRequest, "workspaceId">;
4074
+ type FirewallInspectInput = Omit<FirewallInspectRequest, "workspaceId">;
4075
+ type EdgeInterceptorEnforcementMode = "monitor" | "enforce";
4076
+ type EdgeInterceptorDecision = {
4077
+ allowed: boolean;
4078
+ reasonCode: string;
4079
+ reasonText: string;
4080
+ requiredCapabilities: string[];
4081
+ grantedCapabilities: string[];
4082
+ };
4083
+ type EdgeInterceptorHooks = {
4084
+ beforeRun?: (input: DriftGateRunInput, decision: EdgeInterceptorDecision) => void | Promise<void>;
4085
+ onBlocked?: (input: DriftGateRunInput, decision: EdgeInterceptorDecision) => void | Promise<void>;
4086
+ afterRun?: (input: DriftGateRunInput, decision: EdgeInterceptorDecision, response: z.infer<typeof RunResponseSchema>) => void | Promise<void>;
4087
+ };
4088
+ type EdgeInterceptorEnableInput = {
4089
+ workspaceId: string;
4090
+ registration: EdgeInterceptorRegisterInput;
4091
+ enforcement?: EdgeInterceptorEnforcementMode;
4092
+ hooks?: EdgeInterceptorHooks;
4093
+ };
4094
+ declare class DriftGateSessionHandle {
4095
+ private readonly client;
4096
+ readonly session: z.infer<typeof V4SessionResourceSchema>;
4097
+ readonly startEnvelope: DriftGateCanonicalResponse<z.infer<typeof V4SessionStartDataSchema>>;
4098
+ constructor(client: DriftGateClient, session: z.infer<typeof V4SessionResourceSchema>, startEnvelope: DriftGateCanonicalResponse<z.infer<typeof V4SessionStartDataSchema>>);
4099
+ get sessionId(): string;
4100
+ get rawEnvelope(): unknown;
4101
+ execute(input: DriftGateSessionExecuteInput): Promise<DriftGateCanonicalResponse<z.infer<typeof RunResponseSchema>>>;
4102
+ }
4103
+ declare class DriftGateClient {
4104
+ private readonly baseUrl;
4105
+ private readonly sessionToken?;
4106
+ private readonly apiKey?;
4107
+ private readonly fetchImpl;
4108
+ private edgeInterceptorState;
4109
+ readonly session: {
4110
+ start: (input: DriftGateSessionStartInput) => Promise<DriftGateSessionHandle>;
4111
+ };
4112
+ readonly approvals: {
4113
+ list: (workspaceId: string, status?: "pending" | "approved" | "denied") => Promise<z.infer<typeof ApprovalsListSchema>["approvals"]>;
4114
+ approve: (approvalId: string) => Promise<z.infer<typeof RunResponseSchema>>;
4115
+ deny: (approvalId: string) => Promise<z.infer<typeof RunResponseSchema>>;
4116
+ };
4117
+ readonly connectors: {
4118
+ list: (workspaceId: string) => Promise<z.infer<typeof ConnectorRecordSchema>[]>;
4119
+ create: (workspaceId: string, input: ConnectorCreateInput) => Promise<z.infer<typeof ConnectorRecordSchema>>;
4120
+ update: (workspaceId: string, connectorId: string, input: ConnectorUpdateInput) => Promise<z.infer<typeof ConnectorRecordSchema>>;
4121
+ delete: (workspaceId: string, connectorId: string) => Promise<z.infer<typeof ConnectorRecordSchema>>;
4122
+ };
4123
+ readonly secrets: {
4124
+ list: (workspaceId: string) => Promise<z.infer<typeof WorkspaceSecretRecordSchema>[]>;
4125
+ create: (workspaceId: string, input: SecretCreateInput) => Promise<z.infer<typeof WorkspaceSecretRecordSchema>>;
4126
+ update: (workspaceId: string, secretId: string, input: SecretUpdateInput) => Promise<z.infer<typeof WorkspaceSecretRecordSchema>>;
4127
+ delete: (workspaceId: string, secretId: string) => Promise<z.infer<typeof WorkspaceSecretRecordSchema>>;
4128
+ };
4129
+ readonly webhooks: {
4130
+ list: (workspaceId: string) => Promise<z.infer<typeof WorkspaceWebhookRecordSchema>[]>;
4131
+ create: (workspaceId: string, input: WebhookCreateInput) => Promise<z.infer<typeof WorkspaceWebhookRecordSchema>>;
4132
+ update: (workspaceId: string, webhookId: string, input: WebhookUpdateInput) => Promise<z.infer<typeof WorkspaceWebhookRecordSchema>>;
4133
+ delete: (workspaceId: string, webhookId: string) => Promise<z.infer<typeof WorkspaceWebhookRecordSchema>>;
4134
+ };
4135
+ readonly edgeInterceptors: {
4136
+ list: (workspaceId: string) => Promise<EdgeInterceptorRegistration[]>;
4137
+ register: (workspaceId: string, input: EdgeInterceptorRegisterInput) => Promise<EdgeInterceptorRegistration>;
4138
+ setStatus: (workspaceId: string, registrationId: string, status: EdgeInterceptorStatus) => Promise<EdgeInterceptorRegistration>;
4139
+ };
4140
+ readonly firewall: {
4141
+ inspect: (workspaceId: string, input: FirewallInspectInput) => Promise<FirewallInspectResponse>;
4142
+ events: (workspaceId: string) => Promise<FirewallEvent[]>;
4143
+ };
4144
+ constructor(options: DriftGateClientOptions);
4145
+ executeSession(sessionId: string, input: DriftGateSessionExecuteInput): Promise<DriftGateCanonicalResponse<z.infer<typeof RunResponseSchema>>>;
4146
+ execute(input: DriftGateEphemeralExecuteInput): Promise<DriftGateCanonicalResponse<z.infer<typeof V4EphemeralExecuteDataSchema>>>;
4147
+ enableEdgeMode(input: EdgeInterceptorEnableInput): Promise<EdgeInterceptorRegistration>;
4148
+ disableEdgeMode(): void;
4149
+ run(input: DriftGateRunInput): Promise<z.infer<typeof RunResponseSchema>>;
4150
+ status(runId: string): Promise<z.infer<typeof RunResponseSchema>>;
4151
+ events(runId: string): Promise<z.infer<typeof RunEventsResponseSchema>["events"]>;
4152
+ waitForTerminal(runId: string, options?: WaitForTerminalOptions): Promise<z.infer<typeof RunResponseSchema>>;
4153
+ deployWorkflow(input: DeployWorkflowInput): Promise<z.infer<typeof DeployResponseSchema>>;
4154
+ publishWorkflow(workflowId: string, workflowYaml?: string): Promise<WorkflowVersion>;
4155
+ private evaluateEdgeDecision;
4156
+ private request;
4157
+ }
4158
+ type DriftGateRunResponse = z.infer<typeof RunResponseSchema>;
4159
+ type DriftGateRunEvent = z.infer<typeof RunEventsResponseSchema>["events"][number];
4160
+ type DriftGatePolicyDecision = PolicyDecision;
4161
+ type DriftGateEdgeInterceptorRegistration = EdgeInterceptorRegistration;
4162
+ type DriftGateEdgeInterceptorDecision = EdgeInterceptorDecision;
4163
+ type DriftGateFirewallInspectInput = FirewallInspectInput;
4164
+ type DriftGateFirewallInspectResponse = FirewallInspectResponse;
4165
+ type DriftGateFirewallEvent = FirewallEvent;
4166
+
4167
+ export { type ConnectorCreateInput, type ConnectorUpdateInput, type DeployWorkflowInput, type DriftGateCanonicalError, type DriftGateCanonicalErrorCode, type DriftGateCanonicalMeta, type DriftGateCanonicalResponse, DriftGateClient, type DriftGateClientOptions, type DriftGateEdgeInterceptorDecision, type DriftGateEdgeInterceptorRegistration, type DriftGateEphemeralExecuteInput, type DriftGateEphemeralExecutionEnvelope, DriftGateError, type DriftGateExecutionEnvelope, type DriftGateFirewallEvent, type DriftGateFirewallInspectInput, type DriftGateFirewallInspectResponse, type DriftGatePolicyDecision, type DriftGateRunEvent, type DriftGateRunInput, type DriftGateRunResponse, type DriftGateSessionExecuteInput, DriftGateSessionHandle, type DriftGateSessionStartEnvelope, type DriftGateSessionStartInput, type EdgeInterceptorDecision, type EdgeInterceptorEnableInput, type EdgeInterceptorEnforcementMode, type EdgeInterceptorHooks, type EdgeInterceptorRegisterInput, type FirewallInspectInput, type SecretCreateInput, type SecretUpdateInput, type WaitForTerminalOptions, type WebhookCreateInput, type WebhookExecutionOptions, type WebhookUpdateInput };