@nylorun/core 0.7.0-beta → 0.9.0-beta

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +249 -0
  2. package/dist/compatibility.d.ts +42 -4
  3. package/dist/compatibility.js +65 -3
  4. package/dist/contracts.d.ts +2165 -328
  5. package/dist/contracts.js +1246 -100
  6. package/dist/define.d.ts +13 -5
  7. package/dist/define.js +7 -2
  8. package/dist/definition/assemble.js +16 -14
  9. package/dist/definition/bind-tool.js +1 -0
  10. package/dist/definition/bound.d.ts +2 -0
  11. package/dist/definition/builder.d.ts +116 -16
  12. package/dist/definition/builder.js +330 -53
  13. package/dist/definition/capability.d.ts +55 -0
  14. package/dist/definition/capability.js +104 -0
  15. package/dist/definition/declaration.js +6 -2
  16. package/dist/definition/delegate.d.ts +25 -4
  17. package/dist/definition/delegate.js +34 -6
  18. package/dist/definition/flow/compile.d.ts +23 -0
  19. package/dist/definition/flow/compile.js +274 -0
  20. package/dist/definition/flow/from.d.ts +11 -0
  21. package/dist/definition/flow/from.js +78 -0
  22. package/dist/definition/flow/index.d.ts +11 -0
  23. package/dist/definition/flow/index.js +11 -0
  24. package/dist/definition/flow/paths.d.ts +60 -0
  25. package/dist/definition/flow/paths.js +90 -0
  26. package/dist/definition/flow/spec.d.ts +66 -0
  27. package/dist/definition/flow/spec.js +130 -0
  28. package/dist/definition/flow/types.d.ts +157 -0
  29. package/dist/definition/flow/types.js +1 -0
  30. package/dist/definition/from.js +5 -1
  31. package/dist/definition/helpers.d.ts +1 -16
  32. package/dist/definition/helpers.js +1 -30
  33. package/dist/definition/mcp.d.ts +37 -0
  34. package/dist/definition/mcp.js +81 -0
  35. package/dist/definition/model-failure.d.ts +4 -0
  36. package/dist/definition/model-failure.js +22 -0
  37. package/dist/definition/sandbox-capability.d.ts +12 -0
  38. package/dist/definition/sandbox-capability.js +33 -0
  39. package/dist/definition/schema.js +3 -0
  40. package/dist/definition/workflow/build.d.ts +3 -13
  41. package/dist/definition/workflow/build.js +3 -25
  42. package/dist/definition/workflow/chain.js +0 -1
  43. package/dist/definition/workflow/loop.js +2 -4
  44. package/dist/definition/workflow/map.js +0 -1
  45. package/dist/definition/workflow/parallel.js +0 -1
  46. package/dist/definition/workflow/runnable.d.ts +13 -5
  47. package/dist/definition/workflow/runnable.js +11 -41
  48. package/dist/definition/workflow/switch.js +0 -2
  49. package/dist/errors.d.ts +3 -1
  50. package/dist/types/manifest.d.ts +4 -2
  51. package/dist/types/middleware.d.ts +1 -3
  52. package/dist/types/model.d.ts +32 -1
  53. package/dist/types/observe.d.ts +7 -1
  54. package/dist/types/tool.d.ts +6 -0
  55. package/dist/types/transcript.d.ts +14 -1
  56. package/dist/types/workflow.d.ts +72 -3
  57. package/dist/utils/deprecate.d.ts +3 -0
  58. package/dist/utils/deprecate.js +25 -0
  59. package/dist/utils/sandbox.d.ts +0 -4
  60. package/dist/utils/sandbox.js +0 -16
  61. package/package.json +1 -1
@@ -27,6 +27,38 @@ export declare const CredentialSelectionSchema: z.ZodObject<{
27
27
  credentialId: z.ZodString;
28
28
  }, z.core.$strict>;
29
29
  export type CredentialSelection = z.infer<typeof CredentialSelectionSchema>;
30
+ /**
31
+ * A sandbox defined when a session is opened. No `network.allow` means no egress. The Runtime
32
+ * checks it against the Tenant's limits and pins the result on the session.
33
+ */
34
+ export declare const SandboxInlineRequestSchema: z.ZodObject<{
35
+ image: z.ZodOptional<z.ZodString>;
36
+ network: z.ZodOptional<z.ZodObject<{
37
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
38
+ }, z.core.$strict>>;
39
+ resources: z.ZodOptional<z.ZodObject<{
40
+ cpus: z.ZodOptional<z.ZodNumber>;
41
+ memory: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strict>>;
43
+ }, z.core.$strict>;
44
+ export type SandboxInlineRequest = z.infer<typeof SandboxInlineRequestSchema>;
45
+ /**
46
+ * `PutSessionRequest.sandbox`: `false` for none, `{ session }` to share another session's
47
+ * sandbox, or an inline sandbox. Omitted means the Tenant's default.
48
+ */
49
+ export declare const SandboxRequestSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
50
+ session: z.ZodString;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ image: z.ZodOptional<z.ZodString>;
53
+ network: z.ZodOptional<z.ZodObject<{
54
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ }, z.core.$strict>>;
56
+ resources: z.ZodOptional<z.ZodObject<{
57
+ cpus: z.ZodOptional<z.ZodNumber>;
58
+ memory: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strict>>;
60
+ }, z.core.$strict>]>;
61
+ export type SandboxRequest = z.infer<typeof SandboxRequestSchema>;
30
62
  export declare const PutSessionRequestSchema: z.ZodObject<{
31
63
  requestId: z.ZodString;
32
64
  agentId: z.ZodString;
@@ -37,10 +69,75 @@ export declare const PutSessionRequestSchema: z.ZodObject<{
37
69
  serverName: z.ZodString;
38
70
  credentialId: z.ZodString;
39
71
  }, z.core.$strict>>>;
40
- sandbox: z.ZodOptional<z.ZodObject<{
72
+ sandbox: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
41
73
  session: z.ZodString;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ image: z.ZodOptional<z.ZodString>;
76
+ network: z.ZodOptional<z.ZodObject<{
77
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ }, z.core.$strict>>;
79
+ resources: z.ZodOptional<z.ZodObject<{
80
+ cpus: z.ZodOptional<z.ZodNumber>;
81
+ memory: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strict>>;
83
+ }, z.core.$strict>]>>;
84
+ }, z.core.$strict>;
85
+ /**
86
+ * A Tenant's sandbox configuration (Tenant setting `sandbox.config`): what a session gets when
87
+ * it names no sandbox, and the limits every session's sandbox must fit.
88
+ */
89
+ export declare const TenantSandboxConfigSchema: z.ZodObject<{
90
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"virtual">, z.ZodObject<{
91
+ image: z.ZodOptional<z.ZodString>;
92
+ network: z.ZodOptional<z.ZodObject<{
93
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ }, z.core.$strict>>;
95
+ resources: z.ZodOptional<z.ZodObject<{
96
+ cpus: z.ZodOptional<z.ZodNumber>;
97
+ memory: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ }, z.core.$strict>]>>;
100
+ limits: z.ZodOptional<z.ZodObject<{
101
+ network: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
+ resources: z.ZodOptional<z.ZodObject<{
103
+ cpus: z.ZodOptional<z.ZodNumber>;
104
+ memory: z.ZodOptional<z.ZodString>;
105
+ }, z.core.$strict>>;
106
+ defaultResources: z.ZodOptional<z.ZodObject<{
107
+ cpus: z.ZodOptional<z.ZodNumber>;
108
+ memory: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strict>>;
110
+ idle: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strict>>;
112
+ }, z.core.$strict>;
113
+ export type TenantSandboxConfig = z.infer<typeof TenantSandboxConfigSchema>;
114
+ /** `PUT /v1/tenant/sandbox`: replaces the Tenant's sandbox configuration. */
115
+ export declare const PutTenantSandboxRequestSchema: z.ZodObject<{
116
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"virtual">, z.ZodObject<{
117
+ image: z.ZodOptional<z.ZodString>;
118
+ network: z.ZodOptional<z.ZodObject<{
119
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
+ }, z.core.$strict>>;
121
+ resources: z.ZodOptional<z.ZodObject<{
122
+ cpus: z.ZodOptional<z.ZodNumber>;
123
+ memory: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strict>>;
125
+ }, z.core.$strict>]>>;
126
+ limits: z.ZodOptional<z.ZodObject<{
127
+ network: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
+ resources: z.ZodOptional<z.ZodObject<{
129
+ cpus: z.ZodOptional<z.ZodNumber>;
130
+ memory: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$strict>>;
132
+ defaultResources: z.ZodOptional<z.ZodObject<{
133
+ cpus: z.ZodOptional<z.ZodNumber>;
134
+ memory: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strict>>;
136
+ idle: z.ZodOptional<z.ZodString>;
42
137
  }, z.core.$strict>>;
138
+ requestId: z.ZodOptional<z.ZodString>;
43
139
  }, z.core.$strict>;
140
+ export type PutTenantSandboxRequest = z.infer<typeof PutTenantSandboxRequestSchema>;
44
141
  export type PutSessionRequest = z.infer<typeof PutSessionRequestSchema>;
45
142
  export declare const CreateVaultRequestSchema: z.ZodObject<{
46
143
  requestId: z.ZodString;
@@ -93,12 +190,30 @@ export declare const RotateCredentialRequestSchema: z.ZodObject<{
93
190
  }, z.core.$strict>], "type">;
94
191
  }, z.core.$strict>;
95
192
  export type RotateCredentialRequest = z.infer<typeof RotateCredentialRequestSchema>;
193
+ /**
194
+ * What the Runtime cannot learn from a custom OpenAI-compatible endpoint (Model Calls §7):
195
+ * its context window and output limit, whether it reasons, and pi-ai `compat` settings
196
+ * (`thinkingFormat`, `thinkingTokenBudgetField`, `chatTemplateKwargs`, …).
197
+ */
198
+ export declare const CustomModelSettingsSchema: z.ZodObject<{
199
+ contextWindow: z.ZodOptional<z.ZodNumber>;
200
+ maxTokens: z.ZodOptional<z.ZodNumber>;
201
+ reasoning: z.ZodOptional<z.ZodBoolean>;
202
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
203
+ }, z.core.$strict>;
204
+ export type CustomModelSettings = z.infer<typeof CustomModelSettingsSchema>;
96
205
  export declare const PutHostModelRequestSchema: z.ZodObject<{
97
206
  requestId: z.ZodString;
98
207
  idempotencyKey: z.ZodString;
99
208
  provider: z.ZodString;
100
209
  model: z.ZodString;
101
210
  baseUrl: z.ZodOptional<z.ZodString>;
211
+ settings: z.ZodOptional<z.ZodObject<{
212
+ contextWindow: z.ZodOptional<z.ZodNumber>;
213
+ maxTokens: z.ZodOptional<z.ZodNumber>;
214
+ reasoning: z.ZodOptional<z.ZodBoolean>;
215
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
216
+ }, z.core.$strict>>;
102
217
  auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
103
218
  type: z.ZodLiteral<"api_key">;
104
219
  key: z.ZodString;
@@ -119,6 +234,7 @@ export type HostModelView = {
119
234
  readonly model: string;
120
235
  readonly authType: "api_key" | "oauth";
121
236
  readonly baseUrl?: string;
237
+ readonly settings?: CustomModelSettings;
122
238
  };
123
239
  export declare const SelectHostModelRequestSchema: z.ZodObject<{
124
240
  requestId: z.ZodString;
@@ -128,34 +244,31 @@ export declare const SelectHostModelRequestSchema: z.ZodObject<{
128
244
  baseUrl: z.ZodOptional<z.ZodString>;
129
245
  }, z.core.$strict>;
130
246
  export type SelectHostModelRequest = z.infer<typeof SelectHostModelRequestSchema>;
131
- export type HostModelProviderInfo = {
132
- readonly id: string;
133
- readonly name: string;
134
- readonly model: string;
135
- readonly authType: "api_key" | "oauth";
136
- readonly baseUrl?: string;
137
- readonly lastUpdated: string;
138
- readonly active: boolean;
139
- };
140
- export interface VaultInfo {
141
- readonly id: string;
142
- readonly name: string;
143
- readonly ownerUserId: string;
144
- readonly metadata?: Readonly<Record<string, string>>;
145
- readonly createdAt: string;
146
- }
147
- export interface CredentialInfo {
148
- readonly id: string;
149
- readonly vaultId: string;
150
- readonly name: string;
151
- readonly type: "bearer" | "oauth";
152
- readonly binding: {
153
- readonly url: string;
154
- };
155
- readonly expiresAt?: string;
156
- readonly createdAt: string;
157
- readonly rotatedAt?: string;
158
- }
247
+ export type HostModelProviderInfo = z.infer<typeof HostModelProviderInfoSchema>;
248
+ export declare const VaultInfoSchema: z.ZodObject<{
249
+ id: z.ZodString;
250
+ name: z.ZodString;
251
+ ownerUserId: z.ZodString;
252
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
253
+ createdAt: z.ZodString;
254
+ }, z.core.$strict>;
255
+ export type VaultInfo = z.infer<typeof VaultInfoSchema>;
256
+ export declare const CredentialInfoSchema: z.ZodObject<{
257
+ id: z.ZodString;
258
+ vaultId: z.ZodString;
259
+ name: z.ZodString;
260
+ type: z.ZodEnum<{
261
+ bearer: "bearer";
262
+ oauth: "oauth";
263
+ }>;
264
+ binding: z.ZodObject<{
265
+ url: z.ZodString;
266
+ }, z.core.$strict>;
267
+ expiresAt: z.ZodOptional<z.ZodString>;
268
+ createdAt: z.ZodString;
269
+ rotatedAt: z.ZodOptional<z.ZodString>;
270
+ }, z.core.$strict>;
271
+ export type CredentialInfo = z.infer<typeof CredentialInfoSchema>;
159
272
  /** Exactly one of `content` or `data`. Optional `manifest` for per-turn agent patches. */
160
273
  export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
161
274
  requestId: z.ZodString;
@@ -175,18 +288,6 @@ export declare const ActionOutcomeSchema: z.ZodObject<{
175
288
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
176
289
  }, z.core.$strict>;
177
290
  export type ActionOutcome = z.infer<typeof ActionOutcomeSchema>;
178
- export declare const ActionResultCommandSchema: z.ZodObject<{
179
- requestId: z.ZodString;
180
- idempotencyKey: z.ZodString;
181
- type: z.ZodLiteral<"action_result">;
182
- actionId: z.ZodString;
183
- claimId: z.ZodString;
184
- generation: z.ZodNumber;
185
- outcome: z.ZodObject<{
186
- value: z.ZodUnknown;
187
- statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
188
- }, z.core.$strict>;
189
- }, z.core.$strict>;
190
291
  export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
191
292
  requestId: z.ZodString;
192
293
  idempotencyKey: z.ZodString;
@@ -216,17 +317,6 @@ export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
216
317
  idempotencyKey: z.ZodString;
217
318
  type: z.ZodLiteral<"cancel">;
218
319
  reason: z.ZodOptional<z.ZodString>;
219
- }, z.core.$strict>, z.ZodObject<{
220
- requestId: z.ZodString;
221
- idempotencyKey: z.ZodString;
222
- type: z.ZodLiteral<"action_result">;
223
- actionId: z.ZodString;
224
- claimId: z.ZodString;
225
- generation: z.ZodNumber;
226
- outcome: z.ZodObject<{
227
- value: z.ZodUnknown;
228
- statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
229
- }, z.core.$strict>;
230
320
  }, z.core.$strict>]>;
231
321
  export declare const SessionEventBodySchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
232
322
  requestId: z.ZodString;
@@ -257,46 +347,166 @@ export declare const SessionEventBodySchema: z.ZodUnion<readonly [z.ZodUnion<rea
257
347
  idempotencyKey: z.ZodString;
258
348
  type: z.ZodLiteral<"cancel">;
259
349
  reason: z.ZodOptional<z.ZodString>;
260
- }, z.core.$strict>, z.ZodObject<{
261
- requestId: z.ZodString;
262
- idempotencyKey: z.ZodString;
263
- type: z.ZodLiteral<"action_result">;
264
- actionId: z.ZodString;
265
- claimId: z.ZodString;
266
- generation: z.ZodNumber;
267
- outcome: z.ZodObject<{
268
- value: z.ZodUnknown;
269
- statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
270
- }, z.core.$strict>;
271
350
  }, z.core.$strict>]>;
272
351
  export type SessionCommand = z.infer<typeof SessionCommandSchema>;
273
352
  export type SessionEventBody = SessionCommand;
274
353
  export type MessageEventBody = z.infer<typeof MessageEventBodySchema>;
275
- export declare const LiveEventSchema: z.ZodObject<{
354
+ /** The envelope every session event carries (`nylorun.event/2`, Durable Streams §9.5). */
355
+ export declare const EVENT_SCHEMA = "nylorun.event/2";
356
+ /** Who wrote an event. v1 writes `loop` (the engine) and `api` (commands and results). */
357
+ export declare const EventSourceKindSchema: z.ZodEnum<{
358
+ api: "api";
359
+ controller: "controller";
360
+ edge: "edge";
361
+ "egress-gate": "egress-gate";
362
+ evidence: "evidence";
363
+ harness: "harness";
364
+ human: "human";
365
+ init: "init";
366
+ loop: "loop";
367
+ "model-gate": "model-gate";
368
+ operator: "operator";
369
+ sandboxd: "sandboxd";
370
+ supervisor: "supervisor";
371
+ "tool-gate": "tool-gate";
372
+ }>;
373
+ export type EventSourceKind = z.infer<typeof EventSourceKindSchema>;
374
+ /** How far an event can be trusted, by who could forge it. v1 writes `observed` only. */
375
+ export declare const EvidenceClassSchema: z.ZodEnum<{
376
+ asserted: "asserted";
377
+ attested: "attested";
378
+ claimed: "claimed";
379
+ measured: "measured";
380
+ observed: "observed";
381
+ }>;
382
+ export type EvidenceClass = z.infer<typeof EvidenceClassSchema>;
383
+ /**
384
+ * The envelope fields. Not strict: a client strips fields it does not know, so the envelope
385
+ * can grow without a protocol bump.
386
+ */
387
+ declare const eventEnvelope: {
388
+ schema: z.ZodLiteral<"nylorun.event/2">;
276
389
  eventId: z.ZodString;
390
+ tenantId: z.ZodString;
277
391
  sessionId: z.ZodString;
392
+ /** The run the event belongs to; null until runs exist. */
393
+ runId: z.ZodNullable<z.ZodString>;
394
+ turnId: z.ZodNullable<z.ZodString>;
395
+ /** The session's restore incarnation; 0 until restores exist. */
396
+ incarnation: z.ZodNumber;
397
+ /** The session's ownership epoch when the event was written. */
398
+ epoch: z.ZodNumber;
399
+ /** Position in the session's log, from 0, in commit order. */
400
+ seq: z.ZodNumber;
401
+ /** `base64url(sessionId:seq)`: resume from here with `Last-Event-ID` or `?cursor=`. */
402
+ cursor: z.ZodString;
403
+ /** When the event was written (ISO 8601). */
404
+ time: z.ZodString;
405
+ /** The version of the event type's payload schema. */
406
+ schemaVersion: z.ZodNumber;
407
+ source: z.ZodObject<{
408
+ kind: z.ZodEnum<{
409
+ api: "api";
410
+ controller: "controller";
411
+ edge: "edge";
412
+ "egress-gate": "egress-gate";
413
+ evidence: "evidence";
414
+ harness: "harness";
415
+ human: "human";
416
+ init: "init";
417
+ loop: "loop";
418
+ "model-gate": "model-gate";
419
+ operator: "operator";
420
+ sandboxd: "sandboxd";
421
+ supervisor: "supervisor";
422
+ "tool-gate": "tool-gate";
423
+ }>;
424
+ id: z.ZodString;
425
+ }, z.core.$strip>;
426
+ evidence: z.ZodEnum<{
427
+ asserted: "asserted";
428
+ attested: "attested";
429
+ claimed: "claimed";
430
+ measured: "measured";
431
+ observed: "observed";
432
+ }>;
433
+ trace: z.ZodOptional<z.ZodObject<{
434
+ traceId: z.ZodString;
435
+ spanId: z.ZodString;
436
+ parentSpanId: z.ZodOptional<z.ZodString>;
437
+ }, z.core.$strip>>;
438
+ visibility: z.ZodEnum<{
439
+ internal: "internal";
440
+ public: "public";
441
+ restricted: "restricted";
442
+ }>;
443
+ retention: z.ZodEnum<{
444
+ full: "full";
445
+ metadata: "metadata";
446
+ }>;
447
+ };
448
+ /**
449
+ * Any session event: the envelope with an open `type` and `payload`. Clients read an event of
450
+ * a type they do not know as this; `SessionEventSchema` types the known ones.
451
+ */
452
+ export declare const LiveEventSchema: z.ZodObject<{
453
+ schema: z.ZodLiteral<"nylorun.event/2">;
454
+ eventId: z.ZodString;
278
455
  tenantId: z.ZodString;
456
+ sessionId: z.ZodString;
457
+ runId: z.ZodNullable<z.ZodString>;
279
458
  turnId: z.ZodNullable<z.ZodString>;
459
+ incarnation: z.ZodNumber;
460
+ epoch: z.ZodNumber;
461
+ seq: z.ZodNumber;
280
462
  cursor: z.ZodString;
281
- createdAt: z.ZodString;
463
+ time: z.ZodString;
464
+ schemaVersion: z.ZodNumber;
465
+ source: z.ZodObject<{
466
+ kind: z.ZodEnum<{
467
+ api: "api";
468
+ controller: "controller";
469
+ edge: "edge";
470
+ "egress-gate": "egress-gate";
471
+ evidence: "evidence";
472
+ harness: "harness";
473
+ human: "human";
474
+ init: "init";
475
+ loop: "loop";
476
+ "model-gate": "model-gate";
477
+ operator: "operator";
478
+ sandboxd: "sandboxd";
479
+ supervisor: "supervisor";
480
+ "tool-gate": "tool-gate";
481
+ }>;
482
+ id: z.ZodString;
483
+ }, z.core.$strip>;
484
+ evidence: z.ZodEnum<{
485
+ asserted: "asserted";
486
+ attested: "attested";
487
+ claimed: "claimed";
488
+ measured: "measured";
489
+ observed: "observed";
490
+ }>;
491
+ trace: z.ZodOptional<z.ZodObject<{
492
+ traceId: z.ZodString;
493
+ spanId: z.ZodString;
494
+ parentSpanId: z.ZodOptional<z.ZodString>;
495
+ }, z.core.$strip>>;
496
+ visibility: z.ZodEnum<{
497
+ internal: "internal";
498
+ public: "public";
499
+ restricted: "restricted";
500
+ }>;
501
+ retention: z.ZodEnum<{
502
+ full: "full";
503
+ metadata: "metadata";
504
+ }>;
282
505
  type: z.ZodString;
283
506
  payload: z.ZodUnknown;
284
- }, z.core.$strict>;
285
- export type LiveEvent = z.infer<typeof LiveEventSchema>;
286
- export declare const SessionItemsResponseSchema: z.ZodObject<{
287
- items: z.ZodArray<z.ZodObject<{
288
- eventId: z.ZodString;
289
- sessionId: z.ZodString;
290
- tenantId: z.ZodString;
291
- turnId: z.ZodNullable<z.ZodString>;
292
- cursor: z.ZodString;
293
- createdAt: z.ZodString;
294
- type: z.ZodString;
295
- payload: z.ZodUnknown;
296
- }, z.core.$strict>>;
297
- cursor: z.ZodNullable<z.ZodString>;
298
507
  }, z.core.$strip>;
299
- export type SessionItemsResponse = z.infer<typeof SessionItemsResponseSchema>;
508
+ /** Any session event (`SessionEvent` when its type is known). */
509
+ export type LiveEvent = z.infer<typeof LiveEventSchema>;
300
510
  export declare const AcceptedResponseSchema: z.ZodObject<{
301
511
  status: z.ZodLiteral<"accepted">;
302
512
  turnId: z.ZodNullable<z.ZodString>;
@@ -311,12 +521,18 @@ export declare const RejectedResponseSchema: z.ZodObject<{
311
521
  connection_missing: "connection_missing";
312
522
  host_rejected: "host_rejected";
313
523
  incompatible_host: "incompatible_host";
524
+ internal_error: "internal_error";
525
+ invalid_request: "invalid_request";
526
+ limit_exceeded: "limit_exceeded";
314
527
  not_found: "not_found";
315
528
  origin_rejected: "origin_rejected";
316
529
  protocol_unsupported: "protocol_unsupported";
530
+ request_rejected: "request_rejected";
317
531
  scope_required: "scope_required";
318
532
  subject_invalid: "subject_invalid";
533
+ subject_required: "subject_required";
319
534
  tenant_conflict: "tenant_conflict";
535
+ token_expired: "token_expired";
320
536
  unsupported_media_type: "unsupported_media_type";
321
537
  }>;
322
538
  message: z.ZodString;
@@ -355,14 +571,13 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
355
571
  context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
356
572
  status: z.ZodEnum<{
357
573
  cancelled: "cancelled";
358
- claimed: "claimed";
359
574
  completed: "completed";
575
+ delivering: "delivering";
360
576
  pending: "pending";
361
577
  uncertain: "uncertain";
362
578
  }>;
363
579
  generation: z.ZodNumber;
364
- claimId: z.ZodNullable<z.ZodString>;
365
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
580
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
366
581
  agent: z.ZodOptional<z.ZodObject<{
367
582
  id: z.ZodString;
368
583
  path: z.ZodString;
@@ -384,14 +599,13 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
384
599
  context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
385
600
  status: z.ZodEnum<{
386
601
  cancelled: "cancelled";
387
- claimed: "claimed";
388
602
  completed: "completed";
603
+ delivering: "delivering";
389
604
  pending: "pending";
390
605
  uncertain: "uncertain";
391
606
  }>;
392
607
  generation: z.ZodNumber;
393
- claimId: z.ZodNullable<z.ZodString>;
394
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
608
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
395
609
  agent: z.ZodOptional<z.ZodObject<{
396
610
  id: z.ZodString;
397
611
  path: z.ZodString;
@@ -413,14 +627,13 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
413
627
  context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
414
628
  status: z.ZodEnum<{
415
629
  cancelled: "cancelled";
416
- claimed: "claimed";
417
630
  completed: "completed";
631
+ delivering: "delivering";
418
632
  pending: "pending";
419
633
  uncertain: "uncertain";
420
634
  }>;
421
635
  generation: z.ZodNumber;
422
- claimId: z.ZodNullable<z.ZodString>;
423
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
636
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
424
637
  agent: z.ZodOptional<z.ZodObject<{
425
638
  id: z.ZodString;
426
639
  path: z.ZodString;
@@ -449,14 +662,13 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
449
662
  context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
450
663
  status: z.ZodEnum<{
451
664
  cancelled: "cancelled";
452
- claimed: "claimed";
453
665
  completed: "completed";
666
+ delivering: "delivering";
454
667
  pending: "pending";
455
668
  uncertain: "uncertain";
456
669
  }>;
457
670
  generation: z.ZodNumber;
458
- claimId: z.ZodNullable<z.ZodString>;
459
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
671
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
460
672
  agent: z.ZodOptional<z.ZodObject<{
461
673
  id: z.ZodString;
462
674
  path: z.ZodString;
@@ -476,14 +688,13 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
476
688
  context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
477
689
  status: z.ZodEnum<{
478
690
  cancelled: "cancelled";
479
- claimed: "claimed";
480
691
  completed: "completed";
692
+ delivering: "delivering";
481
693
  pending: "pending";
482
694
  uncertain: "uncertain";
483
695
  }>;
484
696
  generation: z.ZodNumber;
485
- claimId: z.ZodNullable<z.ZodString>;
486
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
697
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
487
698
  agent: z.ZodOptional<z.ZodObject<{
488
699
  id: z.ZodString;
489
700
  path: z.ZodString;
@@ -494,7 +705,10 @@ export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
494
705
  key: z.ZodString;
495
706
  }, z.core.$strict>]>;
496
707
  export type Action = z.infer<typeof ActionSchema>;
497
- /** `message.assistant`: one completed model step. `invocationId` is the model call's. */
708
+ /**
709
+ * `message.assistant`: one completed model step. `invocationId` is the model call's.
710
+ * `model`, `finishReason` and `usage` are present when the provider reported them.
711
+ */
498
712
  export declare const AssistantMessagePayloadSchema: z.ZodObject<{
499
713
  agent: z.ZodOptional<z.ZodObject<{
500
714
  id: z.ZodString;
@@ -503,12 +717,51 @@ export declare const AssistantMessagePayloadSchema: z.ZodObject<{
503
717
  }, z.core.$loose>>;
504
718
  invocationId: z.ZodString;
505
719
  text: z.ZodString;
720
+ model: z.ZodOptional<z.ZodObject<{
721
+ provider: z.ZodString;
722
+ model: z.ZodString;
723
+ }, z.core.$loose>>;
724
+ finishReason: z.ZodOptional<z.ZodString>;
725
+ usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
506
726
  toolCalls: z.ZodArray<z.ZodObject<{
507
727
  callId: z.ZodString;
508
728
  name: z.ZodString;
509
729
  input: z.ZodUnknown;
510
730
  }, z.core.$loose>>;
511
731
  }, z.core.$loose>;
732
+ /**
733
+ * `model.failed`: a model call that failed in a known way (Model Calls §6.4). The turn
734
+ * then fails with `model.<code>`, or recovers.
735
+ */
736
+ export declare const ModelFailedPayloadSchema: z.ZodObject<{
737
+ agent: z.ZodOptional<z.ZodObject<{
738
+ id: z.ZodString;
739
+ path: z.ZodString;
740
+ delegationId: z.ZodOptional<z.ZodString>;
741
+ }, z.core.$loose>>;
742
+ invocationId: z.ZodOptional<z.ZodString>;
743
+ code: z.ZodString;
744
+ message: z.ZodString;
745
+ retryable: z.ZodBoolean;
746
+ }, z.core.$loose>;
747
+ /**
748
+ * `context.compacted`: the engine summarized older history to fit the model's window
749
+ * (Model Calls §8). Token counts are estimates.
750
+ */
751
+ export declare const ContextCompactedPayloadSchema: z.ZodObject<{
752
+ agent: z.ZodOptional<z.ZodObject<{
753
+ id: z.ZodString;
754
+ path: z.ZodString;
755
+ delegationId: z.ZodOptional<z.ZodString>;
756
+ }, z.core.$loose>>;
757
+ invocationId: z.ZodOptional<z.ZodString>;
758
+ trigger: z.ZodEnum<{
759
+ overflow: "overflow";
760
+ threshold: "threshold";
761
+ }>;
762
+ tokensBefore: z.ZodNumber;
763
+ tokensAfter: z.ZodNumber;
764
+ }, z.core.$loose>;
512
765
  /** `tool.completed`: an MCP or sandbox tool the Runtime ran. `error` for a tool error. */
513
766
  export declare const ToolCompletedPayloadSchema: z.ZodObject<{
514
767
  agent: z.ZodOptional<z.ZodObject<{
@@ -535,6 +788,8 @@ export declare const ActionPendingPayloadSchema: z.ZodObject<{
535
788
  actionId: z.ZodString;
536
789
  kind: z.ZodString;
537
790
  toolName: z.ZodOptional<z.ZodString>;
791
+ path: z.ZodOptional<z.ZodString>;
792
+ key: z.ZodOptional<z.ZodString>;
538
793
  callId: z.ZodOptional<z.ZodString>;
539
794
  invocationId: z.ZodOptional<z.ZodString>;
540
795
  input: z.ZodUnknown;
@@ -548,6 +803,8 @@ export declare const ActionCompletedPayloadSchema: z.ZodObject<{
548
803
  actionId: z.ZodString;
549
804
  kind: z.ZodString;
550
805
  toolName: z.ZodOptional<z.ZodString>;
806
+ path: z.ZodOptional<z.ZodString>;
807
+ key: z.ZodOptional<z.ZodString>;
551
808
  callId: z.ZodOptional<z.ZodString>;
552
809
  invocationId: z.ZodOptional<z.ZodString>;
553
810
  result: z.ZodUnknown;
@@ -606,12 +863,43 @@ declare const TRANSCRIPT_PAYLOADS: {
606
863
  }, z.core.$loose>>;
607
864
  invocationId: z.ZodString;
608
865
  text: z.ZodString;
866
+ model: z.ZodOptional<z.ZodObject<{
867
+ provider: z.ZodString;
868
+ model: z.ZodString;
869
+ }, z.core.$loose>>;
870
+ finishReason: z.ZodOptional<z.ZodString>;
871
+ usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
609
872
  toolCalls: z.ZodArray<z.ZodObject<{
610
873
  callId: z.ZodString;
611
874
  name: z.ZodString;
612
875
  input: z.ZodUnknown;
613
876
  }, z.core.$loose>>;
614
877
  }, z.core.$loose>;
878
+ readonly "model.failed": z.ZodObject<{
879
+ agent: z.ZodOptional<z.ZodObject<{
880
+ id: z.ZodString;
881
+ path: z.ZodString;
882
+ delegationId: z.ZodOptional<z.ZodString>;
883
+ }, z.core.$loose>>;
884
+ invocationId: z.ZodOptional<z.ZodString>;
885
+ code: z.ZodString;
886
+ message: z.ZodString;
887
+ retryable: z.ZodBoolean;
888
+ }, z.core.$loose>;
889
+ readonly "context.compacted": z.ZodObject<{
890
+ agent: z.ZodOptional<z.ZodObject<{
891
+ id: z.ZodString;
892
+ path: z.ZodString;
893
+ delegationId: z.ZodOptional<z.ZodString>;
894
+ }, z.core.$loose>>;
895
+ invocationId: z.ZodOptional<z.ZodString>;
896
+ trigger: z.ZodEnum<{
897
+ overflow: "overflow";
898
+ threshold: "threshold";
899
+ }>;
900
+ tokensBefore: z.ZodNumber;
901
+ tokensAfter: z.ZodNumber;
902
+ }, z.core.$loose>;
615
903
  readonly "tool.completed": z.ZodObject<{
616
904
  agent: z.ZodOptional<z.ZodObject<{
617
905
  id: z.ZodString;
@@ -637,6 +925,8 @@ declare const TRANSCRIPT_PAYLOADS: {
637
925
  actionId: z.ZodString;
638
926
  kind: z.ZodString;
639
927
  toolName: z.ZodOptional<z.ZodString>;
928
+ path: z.ZodOptional<z.ZodString>;
929
+ key: z.ZodOptional<z.ZodString>;
640
930
  callId: z.ZodOptional<z.ZodString>;
641
931
  invocationId: z.ZodOptional<z.ZodString>;
642
932
  input: z.ZodUnknown;
@@ -650,6 +940,8 @@ declare const TRANSCRIPT_PAYLOADS: {
650
940
  actionId: z.ZodString;
651
941
  kind: z.ZodString;
652
942
  toolName: z.ZodOptional<z.ZodString>;
943
+ path: z.ZodOptional<z.ZodString>;
944
+ key: z.ZodOptional<z.ZodString>;
653
945
  callId: z.ZodOptional<z.ZodString>;
654
946
  invocationId: z.ZodOptional<z.ZodString>;
655
947
  result: z.ZodUnknown;
@@ -708,227 +1000,508 @@ declare const TRANSCRIPT_PAYLOADS: {
708
1000
  };
709
1001
  export type TranscriptEventType = keyof typeof TRANSCRIPT_PAYLOADS;
710
1002
  export declare const TRANSCRIPT_EVENT_TYPES: readonly TranscriptEventType[];
711
- export type TranscriptEvent = {
712
- [K in TranscriptEventType]: Omit<LiveEvent, "type" | "payload"> & {
713
- type: K;
714
- payload: z.infer<(typeof TRANSCRIPT_PAYLOADS)[K]>;
715
- };
716
- }[TranscriptEventType];
717
- /** Types a transcript event's payload; `undefined` for other types or a malformed payload. */
718
- export declare function parseTranscriptEvent(event: LiveEvent): TranscriptEvent | undefined;
719
- export declare const ActionClaimRequestSchema: z.ZodObject<{
1003
+ /** `command.message`: the message a client sent, as accepted. */
1004
+ export declare const CommandMessagePayloadSchema: z.ZodObject<{
720
1005
  requestId: z.ZodString;
721
- implementationVersion: z.ZodString;
722
- }, z.core.$strict>;
723
- export declare const ActionHeartbeatRequestSchema: z.ZodObject<{
1006
+ idempotencyKey: z.ZodString;
1007
+ type: z.ZodLiteral<"message">;
1008
+ content: z.ZodOptional<z.ZodString>;
1009
+ data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1010
+ manifest: z.ZodOptional<z.ZodUnknown>;
1011
+ }, z.core.$loose>;
1012
+ /** `command.approve`: an answer to an approval interaction. */
1013
+ export declare const CommandApprovePayloadSchema: z.ZodObject<{
724
1014
  requestId: z.ZodString;
725
- claimId: z.ZodString;
726
- generation: z.ZodNumber;
727
- }, z.core.$strict>;
728
- export declare const ActionClaimResponseSchema: z.ZodObject<{
729
- action: z.ZodUnion<readonly [z.ZodObject<{
730
- actionId: z.ZodString;
731
- sessionId: z.ZodString;
732
- turnId: z.ZodString;
733
- agentId: z.ZodString;
734
- manifestHash: z.ZodString;
735
- implementationVersion: z.ZodString;
736
- input: z.ZodUnknown;
737
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
738
- status: z.ZodEnum<{
739
- cancelled: "cancelled";
740
- claimed: "claimed";
741
- completed: "completed";
742
- pending: "pending";
743
- uncertain: "uncertain";
744
- }>;
745
- generation: z.ZodNumber;
746
- claimId: z.ZodNullable<z.ZodString>;
747
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
748
- agent: z.ZodOptional<z.ZodObject<{
749
- id: z.ZodString;
750
- path: z.ZodString;
751
- delegationId: z.ZodOptional<z.ZodString>;
752
- }, z.core.$strict>>;
753
- kind: z.ZodLiteral<"tool">;
754
- capabilityId: z.ZodString;
755
- toolName: z.ZodString;
756
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
757
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
758
- }, z.core.$strict>, z.ZodObject<{
759
- actionId: z.ZodString;
760
- sessionId: z.ZodString;
761
- turnId: z.ZodString;
762
- agentId: z.ZodString;
763
- manifestHash: z.ZodString;
764
- implementationVersion: z.ZodString;
765
- input: z.ZodUnknown;
766
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
767
- status: z.ZodEnum<{
768
- cancelled: "cancelled";
769
- claimed: "claimed";
770
- completed: "completed";
771
- pending: "pending";
772
- uncertain: "uncertain";
773
- }>;
774
- generation: z.ZodNumber;
775
- claimId: z.ZodNullable<z.ZodString>;
776
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
777
- agent: z.ZodOptional<z.ZodObject<{
778
- id: z.ZodString;
779
- path: z.ZodString;
780
- delegationId: z.ZodOptional<z.ZodString>;
781
- }, z.core.$strict>>;
782
- kind: z.ZodLiteral<"tool">;
1015
+ idempotencyKey: z.ZodString;
1016
+ type: z.ZodLiteral<"approve">;
1017
+ interactionId: z.ZodString;
1018
+ approved: z.ZodBoolean;
1019
+ }, z.core.$loose>;
1020
+ /** `command.respond`: an answer to an input interaction. */
1021
+ export declare const CommandRespondPayloadSchema: z.ZodObject<{
1022
+ requestId: z.ZodString;
1023
+ idempotencyKey: z.ZodString;
1024
+ type: z.ZodLiteral<"respond">;
1025
+ interactionId: z.ZodString;
1026
+ value: z.ZodUnknown;
1027
+ }, z.core.$loose>;
1028
+ /** `action.delivered`: the Runtime sent an Action to its endpoint. */
1029
+ export declare const ActionDeliveredPayloadSchema: z.ZodObject<{
1030
+ agent: z.ZodOptional<z.ZodObject<{
1031
+ id: z.ZodString;
783
1032
  path: z.ZodString;
784
- key: z.ZodString;
785
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
786
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
787
- }, z.core.$strict>, z.ZodObject<{
788
- actionId: z.ZodString;
789
- sessionId: z.ZodString;
790
- turnId: z.ZodString;
791
- agentId: z.ZodString;
792
- manifestHash: z.ZodString;
793
- implementationVersion: z.ZodString;
794
- input: z.ZodUnknown;
795
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
796
- status: z.ZodEnum<{
797
- cancelled: "cancelled";
798
- claimed: "claimed";
799
- completed: "completed";
800
- pending: "pending";
801
- uncertain: "uncertain";
802
- }>;
803
- generation: z.ZodNumber;
804
- claimId: z.ZodNullable<z.ZodString>;
805
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
806
- agent: z.ZodOptional<z.ZodObject<{
807
- id: z.ZodString;
808
- path: z.ZodString;
809
- delegationId: z.ZodOptional<z.ZodString>;
810
- }, z.core.$strict>>;
811
- kind: z.ZodLiteral<"hook">;
812
- hook: z.ZodObject<{
813
- at: z.ZodEnum<{
814
- after: "after";
815
- before: "before";
1033
+ delegationId: z.ZodOptional<z.ZodString>;
1034
+ }, z.core.$loose>>;
1035
+ actionId: z.ZodString;
1036
+ generation: z.ZodNumber;
1037
+ }, z.core.$loose>;
1038
+ /** `action.delivery_failed`: a delivery did not reach its endpoint, or was refused; it is retried. */
1039
+ export declare const ActionDeliveryFailedPayloadSchema: z.ZodObject<{
1040
+ actionId: z.ZodString;
1041
+ generation: z.ZodNumber;
1042
+ reason: z.ZodString;
1043
+ message: z.ZodOptional<z.ZodString>;
1044
+ retryInMs: z.ZodNumber;
1045
+ }, z.core.$loose>;
1046
+ /** `sandbox.state`: the session's sandbox changed state. */
1047
+ export declare const SandboxStatePayloadSchema: z.ZodObject<{
1048
+ state: z.ZodEnum<{
1049
+ creating: "creating";
1050
+ running: "running";
1051
+ stopped: "stopped";
1052
+ }>;
1053
+ backend: z.ZodString;
1054
+ isolation: z.ZodOptional<z.ZodString>;
1055
+ image: z.ZodOptional<z.ZodString>;
1056
+ network: z.ZodOptional<z.ZodUnknown>;
1057
+ reattach: z.ZodOptional<z.ZodBoolean>;
1058
+ lost: z.ZodOptional<z.ZodBoolean>;
1059
+ note: z.ZodOptional<z.ZodString>;
1060
+ error: z.ZodOptional<z.ZodString>;
1061
+ }, z.core.$loose>;
1062
+ /** `sandbox.exec`: one sandbox tool call finished. */
1063
+ export declare const SandboxExecPayloadSchema: z.ZodObject<{
1064
+ tool: z.ZodString;
1065
+ command: z.ZodOptional<z.ZodString>;
1066
+ outcome: z.ZodString;
1067
+ code: z.ZodOptional<z.ZodString>;
1068
+ durationMs: z.ZodNumber;
1069
+ }, z.core.$loose>;
1070
+ /** `node.started`: a workflow node that runs an Action started. */
1071
+ export declare const NodeStartedPayloadSchema: z.ZodObject<{
1072
+ path: z.ZodString;
1073
+ kind: z.ZodString;
1074
+ key: z.ZodString;
1075
+ iterations: z.ZodOptional<z.ZodString>;
1076
+ }, z.core.$loose>;
1077
+ /** `node.agent`: a workflow node runs as a linked agent session. */
1078
+ export declare const NodeAgentPayloadSchema: z.ZodObject<{
1079
+ path: z.ZodString;
1080
+ iterations: z.ZodOptional<z.ZodString>;
1081
+ sessionId: z.ZodString;
1082
+ turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1083
+ }, z.core.$loose>;
1084
+ /** `loop.iteration`: a Loop started its `n`th agent turn. */
1085
+ export declare const LoopIterationPayloadSchema: z.ZodObject<{
1086
+ path: z.ZodString;
1087
+ n: z.ZodNumber;
1088
+ sessionId: z.ZodOptional<z.ZodString>;
1089
+ turnId: z.ZodOptional<z.ZodString>;
1090
+ manifestHash: z.ZodOptional<z.ZodString>;
1091
+ }, z.core.$loose>;
1092
+ /** `loop.verified`: a Loop's verifier judged iteration `n`. */
1093
+ export declare const LoopVerifiedPayloadSchema: z.ZodObject<{
1094
+ path: z.ZodString;
1095
+ n: z.ZodNumber;
1096
+ pass: z.ZodBoolean;
1097
+ feedback: z.ZodOptional<z.ZodString>;
1098
+ data: z.ZodOptional<z.ZodUnknown>;
1099
+ }, z.core.$loose>;
1100
+ /** `loop.decided`: a Loop's decide step chose to iterate again (`input`) or finish (`output`). */
1101
+ export declare const LoopDecidedPayloadSchema: z.ZodObject<{
1102
+ path: z.ZodString;
1103
+ n: z.ZodNumber;
1104
+ next: z.ZodEnum<{
1105
+ input: "input";
1106
+ output: "output";
1107
+ }>;
1108
+ patched: z.ZodBoolean;
1109
+ }, z.core.$loose>;
1110
+ /**
1111
+ * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1112
+ * payload schema version and who writes it. A type not listed here cannot be written.
1113
+ *
1114
+ * Evolution: new types and new optional payload fields are additive (clients ignore types
1115
+ * they do not know, and payloads pass unknown fields through). A breaking payload change is a
1116
+ * new type or a protocol version, never an edit in place.
1117
+ */
1118
+ export declare const EVENT_CATALOG: {
1119
+ readonly "command.message": {
1120
+ readonly payload: z.ZodObject<{
1121
+ requestId: z.ZodString;
1122
+ idempotencyKey: z.ZodString;
1123
+ type: z.ZodLiteral<"message">;
1124
+ content: z.ZodOptional<z.ZodString>;
1125
+ data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1126
+ manifest: z.ZodOptional<z.ZodUnknown>;
1127
+ }, z.core.$loose>;
1128
+ readonly source: "api";
1129
+ readonly version: 1;
1130
+ };
1131
+ readonly "command.approve": {
1132
+ readonly payload: z.ZodObject<{
1133
+ requestId: z.ZodString;
1134
+ idempotencyKey: z.ZodString;
1135
+ type: z.ZodLiteral<"approve">;
1136
+ interactionId: z.ZodString;
1137
+ approved: z.ZodBoolean;
1138
+ }, z.core.$loose>;
1139
+ readonly source: "api";
1140
+ readonly version: 1;
1141
+ };
1142
+ readonly "command.respond": {
1143
+ readonly payload: z.ZodObject<{
1144
+ requestId: z.ZodString;
1145
+ idempotencyKey: z.ZodString;
1146
+ type: z.ZodLiteral<"respond">;
1147
+ interactionId: z.ZodString;
1148
+ value: z.ZodUnknown;
1149
+ }, z.core.$loose>;
1150
+ readonly source: "api";
1151
+ readonly version: 1;
1152
+ };
1153
+ readonly "turn.completed": {
1154
+ readonly payload: z.ZodObject<{
1155
+ output: z.ZodUnknown;
1156
+ }, z.core.$loose>;
1157
+ readonly source: "loop";
1158
+ readonly version: 1;
1159
+ };
1160
+ readonly "turn.paused": {
1161
+ readonly payload: z.ZodObject<{
1162
+ interactions: z.ZodArray<z.ZodObject<{
1163
+ invocationId: z.ZodString;
1164
+ interaction: z.ZodObject<{
1165
+ id: z.ZodString;
1166
+ kind: z.ZodString;
1167
+ }, z.core.$loose>;
1168
+ status: z.ZodOptional<z.ZodString>;
1169
+ }, z.core.$loose>>;
1170
+ }, z.core.$loose>;
1171
+ readonly source: "loop";
1172
+ readonly version: 1;
1173
+ };
1174
+ readonly "turn.failed": {
1175
+ readonly payload: z.ZodObject<{
1176
+ error: z.ZodOptional<z.ZodObject<{
1177
+ code: z.ZodOptional<z.ZodString>;
1178
+ message: z.ZodOptional<z.ZodString>;
1179
+ }, z.core.$loose>>;
1180
+ message: z.ZodOptional<z.ZodString>;
1181
+ }, z.core.$loose>;
1182
+ readonly source: "loop";
1183
+ readonly version: 1;
1184
+ };
1185
+ readonly "turn.cancelled": {
1186
+ readonly payload: z.ZodObject<{
1187
+ reason: z.ZodOptional<z.ZodString>;
1188
+ }, z.core.$loose>;
1189
+ readonly source: "api";
1190
+ readonly version: 1;
1191
+ };
1192
+ readonly "message.assistant": {
1193
+ readonly payload: z.ZodObject<{
1194
+ agent: z.ZodOptional<z.ZodObject<{
1195
+ id: z.ZodString;
1196
+ path: z.ZodString;
1197
+ delegationId: z.ZodOptional<z.ZodString>;
1198
+ }, z.core.$loose>>;
1199
+ invocationId: z.ZodString;
1200
+ text: z.ZodString;
1201
+ model: z.ZodOptional<z.ZodObject<{
1202
+ provider: z.ZodString;
1203
+ model: z.ZodString;
1204
+ }, z.core.$loose>>;
1205
+ finishReason: z.ZodOptional<z.ZodString>;
1206
+ usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1207
+ toolCalls: z.ZodArray<z.ZodObject<{
1208
+ callId: z.ZodString;
1209
+ name: z.ZodString;
1210
+ input: z.ZodUnknown;
1211
+ }, z.core.$loose>>;
1212
+ }, z.core.$loose>;
1213
+ readonly source: "loop";
1214
+ readonly version: 1;
1215
+ };
1216
+ readonly "model.failed": {
1217
+ readonly payload: z.ZodObject<{
1218
+ agent: z.ZodOptional<z.ZodObject<{
1219
+ id: z.ZodString;
1220
+ path: z.ZodString;
1221
+ delegationId: z.ZodOptional<z.ZodString>;
1222
+ }, z.core.$loose>>;
1223
+ invocationId: z.ZodOptional<z.ZodString>;
1224
+ code: z.ZodString;
1225
+ message: z.ZodString;
1226
+ retryable: z.ZodBoolean;
1227
+ }, z.core.$loose>;
1228
+ readonly source: "loop";
1229
+ readonly version: 1;
1230
+ };
1231
+ readonly "context.compacted": {
1232
+ readonly payload: z.ZodObject<{
1233
+ agent: z.ZodOptional<z.ZodObject<{
1234
+ id: z.ZodString;
1235
+ path: z.ZodString;
1236
+ delegationId: z.ZodOptional<z.ZodString>;
1237
+ }, z.core.$loose>>;
1238
+ invocationId: z.ZodOptional<z.ZodString>;
1239
+ trigger: z.ZodEnum<{
1240
+ overflow: "overflow";
1241
+ threshold: "threshold";
816
1242
  }>;
817
- scope: z.ZodEnum<{
818
- step: "step";
819
- turn: "turn";
1243
+ tokensBefore: z.ZodNumber;
1244
+ tokensAfter: z.ZodNumber;
1245
+ }, z.core.$loose>;
1246
+ readonly source: "loop";
1247
+ readonly version: 1;
1248
+ };
1249
+ readonly "tool.completed": {
1250
+ readonly payload: z.ZodObject<{
1251
+ agent: z.ZodOptional<z.ZodObject<{
1252
+ id: z.ZodString;
1253
+ path: z.ZodString;
1254
+ delegationId: z.ZodOptional<z.ZodString>;
1255
+ }, z.core.$loose>>;
1256
+ callId: z.ZodString;
1257
+ invocationId: z.ZodString;
1258
+ capabilityId: z.ZodString;
1259
+ toolName: z.ZodString;
1260
+ output: z.ZodOptional<z.ZodUnknown>;
1261
+ error: z.ZodOptional<z.ZodObject<{
1262
+ code: z.ZodString;
1263
+ message: z.ZodString;
1264
+ }, z.core.$loose>>;
1265
+ }, z.core.$loose>;
1266
+ readonly source: "loop";
1267
+ readonly version: 1;
1268
+ };
1269
+ readonly "action.pending": {
1270
+ readonly payload: z.ZodObject<{
1271
+ agent: z.ZodOptional<z.ZodObject<{
1272
+ id: z.ZodString;
1273
+ path: z.ZodString;
1274
+ delegationId: z.ZodOptional<z.ZodString>;
1275
+ }, z.core.$loose>>;
1276
+ actionId: z.ZodString;
1277
+ kind: z.ZodString;
1278
+ toolName: z.ZodOptional<z.ZodString>;
1279
+ path: z.ZodOptional<z.ZodString>;
1280
+ key: z.ZodOptional<z.ZodString>;
1281
+ callId: z.ZodOptional<z.ZodString>;
1282
+ invocationId: z.ZodOptional<z.ZodString>;
1283
+ input: z.ZodUnknown;
1284
+ }, z.core.$loose>;
1285
+ readonly source: "loop";
1286
+ readonly version: 1;
1287
+ };
1288
+ readonly "action.delivered": {
1289
+ readonly payload: z.ZodObject<{
1290
+ agent: z.ZodOptional<z.ZodObject<{
1291
+ id: z.ZodString;
1292
+ path: z.ZodString;
1293
+ delegationId: z.ZodOptional<z.ZodString>;
1294
+ }, z.core.$loose>>;
1295
+ actionId: z.ZodString;
1296
+ generation: z.ZodNumber;
1297
+ }, z.core.$loose>;
1298
+ readonly source: "loop";
1299
+ readonly version: 1;
1300
+ };
1301
+ readonly "action.delivery_failed": {
1302
+ readonly payload: z.ZodObject<{
1303
+ actionId: z.ZodString;
1304
+ generation: z.ZodNumber;
1305
+ reason: z.ZodString;
1306
+ message: z.ZodOptional<z.ZodString>;
1307
+ retryInMs: z.ZodNumber;
1308
+ }, z.core.$loose>;
1309
+ readonly source: "loop";
1310
+ readonly version: 1;
1311
+ };
1312
+ readonly "action.completed": {
1313
+ readonly payload: z.ZodObject<{
1314
+ agent: z.ZodOptional<z.ZodObject<{
1315
+ id: z.ZodString;
1316
+ path: z.ZodString;
1317
+ delegationId: z.ZodOptional<z.ZodString>;
1318
+ }, z.core.$loose>>;
1319
+ actionId: z.ZodString;
1320
+ kind: z.ZodString;
1321
+ toolName: z.ZodOptional<z.ZodString>;
1322
+ path: z.ZodOptional<z.ZodString>;
1323
+ key: z.ZodOptional<z.ZodString>;
1324
+ callId: z.ZodOptional<z.ZodString>;
1325
+ invocationId: z.ZodOptional<z.ZodString>;
1326
+ result: z.ZodUnknown;
1327
+ }, z.core.$loose>;
1328
+ readonly source: "api";
1329
+ readonly version: 1;
1330
+ };
1331
+ readonly "action.uncertain": {
1332
+ readonly payload: z.ZodObject<{
1333
+ agent: z.ZodOptional<z.ZodObject<{
1334
+ id: z.ZodString;
1335
+ path: z.ZodString;
1336
+ delegationId: z.ZodOptional<z.ZodString>;
1337
+ }, z.core.$loose>>;
1338
+ actionId: z.ZodString;
1339
+ }, z.core.$loose>;
1340
+ readonly source: "loop";
1341
+ readonly version: 1;
1342
+ };
1343
+ readonly "effect.uncertain": {
1344
+ readonly payload: z.ZodObject<{
1345
+ effectId: z.ZodString;
1346
+ message: z.ZodOptional<z.ZodString>;
1347
+ }, z.core.$loose>;
1348
+ readonly source: "loop";
1349
+ readonly version: 1;
1350
+ };
1351
+ readonly "delegation.started": {
1352
+ readonly payload: z.ZodObject<{
1353
+ agent: z.ZodObject<{
1354
+ id: z.ZodString;
1355
+ path: z.ZodString;
1356
+ delegationId: z.ZodOptional<z.ZodString>;
1357
+ }, z.core.$loose>;
1358
+ callId: z.ZodOptional<z.ZodString>;
1359
+ }, z.core.$loose>;
1360
+ readonly source: "loop";
1361
+ readonly version: 1;
1362
+ };
1363
+ readonly "delegation.completed": {
1364
+ readonly payload: z.ZodObject<{
1365
+ agent: z.ZodObject<{
1366
+ id: z.ZodString;
1367
+ path: z.ZodString;
1368
+ delegationId: z.ZodOptional<z.ZodString>;
1369
+ }, z.core.$loose>;
1370
+ callId: z.ZodOptional<z.ZodString>;
1371
+ }, z.core.$loose>;
1372
+ readonly source: "loop";
1373
+ readonly version: 1;
1374
+ };
1375
+ readonly "sandbox.state": {
1376
+ readonly payload: z.ZodObject<{
1377
+ state: z.ZodEnum<{
1378
+ creating: "creating";
1379
+ running: "running";
1380
+ stopped: "stopped";
820
1381
  }>;
821
- capabilityIds: z.ZodArray<z.ZodString>;
822
- }, z.core.$strict>;
823
- }, z.core.$strict>, z.ZodObject<{
824
- actionId: z.ZodString;
825
- sessionId: z.ZodString;
826
- turnId: z.ZodString;
827
- agentId: z.ZodString;
828
- manifestHash: z.ZodString;
829
- implementationVersion: z.ZodString;
830
- input: z.ZodUnknown;
831
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
832
- status: z.ZodEnum<{
833
- cancelled: "cancelled";
834
- claimed: "claimed";
835
- completed: "completed";
836
- pending: "pending";
837
- uncertain: "uncertain";
838
- }>;
839
- generation: z.ZodNumber;
840
- claimId: z.ZodNullable<z.ZodString>;
841
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
842
- agent: z.ZodOptional<z.ZodObject<{
843
- id: z.ZodString;
1382
+ backend: z.ZodString;
1383
+ isolation: z.ZodOptional<z.ZodString>;
1384
+ image: z.ZodOptional<z.ZodString>;
1385
+ network: z.ZodOptional<z.ZodUnknown>;
1386
+ reattach: z.ZodOptional<z.ZodBoolean>;
1387
+ lost: z.ZodOptional<z.ZodBoolean>;
1388
+ note: z.ZodOptional<z.ZodString>;
1389
+ error: z.ZodOptional<z.ZodString>;
1390
+ }, z.core.$loose>;
1391
+ readonly source: "loop";
1392
+ readonly version: 1;
1393
+ };
1394
+ readonly "sandbox.exec": {
1395
+ readonly payload: z.ZodObject<{
1396
+ tool: z.ZodString;
1397
+ command: z.ZodOptional<z.ZodString>;
1398
+ outcome: z.ZodString;
1399
+ code: z.ZodOptional<z.ZodString>;
1400
+ durationMs: z.ZodNumber;
1401
+ }, z.core.$loose>;
1402
+ readonly source: "loop";
1403
+ readonly version: 1;
1404
+ };
1405
+ readonly "node.started": {
1406
+ readonly payload: z.ZodObject<{
844
1407
  path: z.ZodString;
845
- delegationId: z.ZodOptional<z.ZodString>;
846
- }, z.core.$strict>>;
847
- kind: z.ZodLiteral<"fn">;
848
- path: z.ZodString;
849
- key: z.ZodString;
850
- }, z.core.$strict>, z.ZodObject<{
851
- actionId: z.ZodString;
852
- sessionId: z.ZodString;
853
- turnId: z.ZodString;
854
- agentId: z.ZodString;
855
- manifestHash: z.ZodString;
856
- implementationVersion: z.ZodString;
857
- input: z.ZodUnknown;
858
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
859
- status: z.ZodEnum<{
860
- cancelled: "cancelled";
861
- claimed: "claimed";
862
- completed: "completed";
863
- pending: "pending";
864
- uncertain: "uncertain";
865
- }>;
866
- generation: z.ZodNumber;
867
- claimId: z.ZodNullable<z.ZodString>;
868
- leaseExpiresAt: z.ZodNullable<z.ZodString>;
869
- agent: z.ZodOptional<z.ZodObject<{
870
- id: z.ZodString;
1408
+ kind: z.ZodString;
1409
+ key: z.ZodString;
1410
+ iterations: z.ZodOptional<z.ZodString>;
1411
+ }, z.core.$loose>;
1412
+ readonly source: "loop";
1413
+ readonly version: 1;
1414
+ };
1415
+ readonly "node.agent": {
1416
+ readonly payload: z.ZodObject<{
871
1417
  path: z.ZodString;
872
- delegationId: z.ZodOptional<z.ZodString>;
873
- }, z.core.$strict>>;
874
- kind: z.ZodLiteral<"verify">;
875
- path: z.ZodString;
876
- key: z.ZodString;
877
- }, z.core.$strict>]>;
878
- claimId: z.ZodString;
879
- generation: z.ZodNumber;
880
- leaseExpiresAt: z.ZodString;
881
- }, z.core.$strip>;
882
- export type ActionClaim = z.infer<typeof ActionClaimResponseSchema>;
883
- export interface ExecutorScope {
884
- readonly agentId: string;
885
- readonly manifestHash?: string;
886
- readonly implementationVersion: string;
887
- }
888
- export declare const ExecutorNotificationSchema: z.ZodObject<{
889
- type: z.ZodLiteral<"work_available">;
890
- }, z.core.$strip>;
891
- export declare const ExecutorRegistrationSchema: z.ZodObject<{
892
- agentId: z.ZodString;
893
- implementationVersion: z.ZodString;
894
- manifestHash: z.ZodOptional<z.ZodString>;
895
- token: z.ZodString;
896
- }, z.core.$strict>;
897
- export declare const RegisterExecutorsRequestSchema: z.ZodObject<{
898
- executors: z.ZodArray<z.ZodObject<{
899
- agentId: z.ZodString;
900
- implementationVersion: z.ZodString;
901
- manifestHash: z.ZodOptional<z.ZodString>;
902
- token: z.ZodString;
903
- }, z.core.$strict>>;
904
- }, z.core.$strict>;
905
- export declare const RegisterExecutorsResponseSchema: z.ZodObject<{
906
- executors: z.ZodArray<z.ZodObject<{
907
- agentId: z.ZodString;
908
- implementationVersion: z.ZodString;
909
- rotated: z.ZodBoolean;
910
- replacedBy: z.ZodOptional<z.ZodLiteral<"different-credential">>;
911
- }, z.core.$strip>>;
912
- }, z.core.$strip>;
913
- export declare const ExecutorSummarySchema: z.ZodObject<{
914
- agentId: z.ZodString;
915
- implementationVersion: z.ZodString;
916
- manifestHash: z.ZodOptional<z.ZodString>;
917
- connected: z.ZodBoolean;
918
- updatedAt: z.ZodString;
919
- }, z.core.$strip>;
920
- export declare const ListExecutorsResponseSchema: z.ZodObject<{
921
- executors: z.ZodArray<z.ZodObject<{
922
- agentId: z.ZodString;
923
- implementationVersion: z.ZodString;
924
- manifestHash: z.ZodOptional<z.ZodString>;
925
- connected: z.ZodBoolean;
926
- updatedAt: z.ZodString;
927
- }, z.core.$strip>>;
1418
+ iterations: z.ZodOptional<z.ZodString>;
1419
+ sessionId: z.ZodString;
1420
+ turnId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1421
+ }, z.core.$loose>;
1422
+ readonly source: "loop";
1423
+ readonly version: 1;
1424
+ };
1425
+ readonly "loop.iteration": {
1426
+ readonly payload: z.ZodObject<{
1427
+ path: z.ZodString;
1428
+ n: z.ZodNumber;
1429
+ sessionId: z.ZodOptional<z.ZodString>;
1430
+ turnId: z.ZodOptional<z.ZodString>;
1431
+ manifestHash: z.ZodOptional<z.ZodString>;
1432
+ }, z.core.$loose>;
1433
+ readonly source: "loop";
1434
+ readonly version: 1;
1435
+ };
1436
+ readonly "loop.verified": {
1437
+ readonly payload: z.ZodObject<{
1438
+ path: z.ZodString;
1439
+ n: z.ZodNumber;
1440
+ pass: z.ZodBoolean;
1441
+ feedback: z.ZodOptional<z.ZodString>;
1442
+ data: z.ZodOptional<z.ZodUnknown>;
1443
+ }, z.core.$loose>;
1444
+ readonly source: "api";
1445
+ readonly version: 1;
1446
+ };
1447
+ readonly "loop.decided": {
1448
+ readonly payload: z.ZodObject<{
1449
+ path: z.ZodString;
1450
+ n: z.ZodNumber;
1451
+ next: z.ZodEnum<{
1452
+ input: "input";
1453
+ output: "output";
1454
+ }>;
1455
+ patched: z.ZodBoolean;
1456
+ }, z.core.$loose>;
1457
+ readonly source: "api";
1458
+ readonly version: 1;
1459
+ };
1460
+ };
1461
+ export type EventType = keyof typeof EVENT_CATALOG;
1462
+ export declare const EVENT_TYPES: readonly EventType[];
1463
+ /** Drops the index signatures `passthrough` adds, so plain interfaces are assignable. */
1464
+ type Closed<T> = T extends readonly (infer U)[] ? Closed<U>[] : T extends object ? {
1465
+ [K in keyof T as string extends K ? never : K]: Closed<T[K]>;
1466
+ } : T;
1467
+ /**
1468
+ * The payload a writer passes for an event of `type` (checked again at runtime against the
1469
+ * catalog, unknown fields included).
1470
+ */
1471
+ export type EventPayload<T extends EventType> = Closed<z.input<(typeof EVENT_CATALOG)[T]["payload"]>>;
1472
+ export declare function isEventType(type: string): type is EventType;
1473
+ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
1474
+ type: z.ZodLiteral<T>;
1475
+ payload: (typeof EVENT_CATALOG)[T]["payload"];
1476
+ }>;
1477
+ /** One schema per event type, keyed by type (the OpenAPI components). */
1478
+ export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
1479
+ /** A session event of a known type, discriminated on `type`. */
1480
+ export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">;
1481
+ export type SessionEvent = {
1482
+ [T in EventType]: z.infer<EventSchemaOf<T>>;
1483
+ }[EventType];
1484
+ /** The session event of type `T`. */
1485
+ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
1486
+ type: T;
1487
+ }>;
1488
+ /**
1489
+ * Reads one event from the wire: typed when its type is in the catalog and it matches, else
1490
+ * the bare envelope (a newer Runtime's type, which a client ignores). Throws only when even
1491
+ * the envelope does not match.
1492
+ */
1493
+ export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
1494
+ export declare const SessionItemsResponseSchema: z.ZodObject<{
1495
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
1496
+ cursor: z.ZodNullable<z.ZodString>;
928
1497
  }, z.core.$strip>;
929
- export type ExecutorRegistration = z.infer<typeof ExecutorRegistrationSchema>;
930
- export type RegisterExecutorsResponse = z.infer<typeof RegisterExecutorsResponseSchema>;
931
- export type ExecutorSummary = z.infer<typeof ExecutorSummarySchema>;
1498
+ export type SessionItemsResponse = {
1499
+ items: (SessionEvent | LiveEvent)[];
1500
+ cursor: string | null;
1501
+ };
1502
+ export type TranscriptEvent = SessionEventOf<TranscriptEventType>;
1503
+ /** Types a transcript event's payload; `undefined` for other types or a malformed payload. */
1504
+ export declare function parseTranscriptEvent(event: LiveEvent): TranscriptEvent | undefined;
932
1505
  export declare const ProtocolRangeSchema: z.ZodObject<{
933
1506
  min: z.ZodNumber;
934
1507
  max: z.ZodNumber;
@@ -1047,13 +1620,31 @@ export declare const AdminTenantStatusSchema: z.ZodObject<{
1047
1620
  }, z.core.$strict>>;
1048
1621
  }, z.core.$strict>;
1049
1622
  export type AdminTenantStatus = z.infer<typeof AdminTenantStatusSchema>;
1623
+ /** A stream relay's state (Durable Streams §7). */
1624
+ export declare const StreamRelayStatusSchema: z.ZodObject<{
1625
+ active: z.ZodBoolean;
1626
+ pendingTxs: z.ZodNumber;
1627
+ pendingRows: z.ZodNumber;
1628
+ confirmed: z.ZodNullable<z.ZodString>;
1629
+ reconciliations: z.ZodNumber;
1630
+ lastError: z.ZodNullable<z.ZodString>;
1631
+ lagBytes: z.ZodOptional<z.ZodNumber>;
1632
+ }, z.core.$strict>;
1633
+ export type StreamRelayStatus = z.infer<typeof StreamRelayStatusSchema>;
1050
1634
  export declare const HostAggregateSchema: z.ZodObject<{
1051
1635
  runningSessions: z.ZodNumber;
1052
- connectedExecutors: z.ZodNumber;
1636
+ inFlightDeliveries: z.ZodNumber;
1053
1637
  pendingActions: z.ZodNumber;
1054
1638
  uncertainEffects: z.ZodNumber;
1055
- outboxDepth: z.ZodOptional<z.ZodNumber>;
1056
- relayLagMs: z.ZodOptional<z.ZodNumber>;
1639
+ relay: z.ZodOptional<z.ZodObject<{
1640
+ active: z.ZodBoolean;
1641
+ pendingTxs: z.ZodNumber;
1642
+ pendingRows: z.ZodNumber;
1643
+ confirmed: z.ZodNullable<z.ZodString>;
1644
+ reconciliations: z.ZodNumber;
1645
+ lastError: z.ZodNullable<z.ZodString>;
1646
+ lagBytes: z.ZodOptional<z.ZodNumber>;
1647
+ }, z.core.$strict>>;
1057
1648
  }, z.core.$strict>;
1058
1649
  export type HostAggregate = z.infer<typeof HostAggregateSchema>;
1059
1650
  export declare const AdminHostStatusSchema: z.ZodObject<{
@@ -1083,11 +1674,18 @@ export declare const AdminHostStatusSchema: z.ZodObject<{
1083
1674
  }, z.core.$strict>>;
1084
1675
  aggregate: z.ZodObject<{
1085
1676
  runningSessions: z.ZodNumber;
1086
- connectedExecutors: z.ZodNumber;
1677
+ inFlightDeliveries: z.ZodNumber;
1087
1678
  pendingActions: z.ZodNumber;
1088
1679
  uncertainEffects: z.ZodNumber;
1089
- outboxDepth: z.ZodOptional<z.ZodNumber>;
1090
- relayLagMs: z.ZodOptional<z.ZodNumber>;
1680
+ relay: z.ZodOptional<z.ZodObject<{
1681
+ active: z.ZodBoolean;
1682
+ pendingTxs: z.ZodNumber;
1683
+ pendingRows: z.ZodNumber;
1684
+ confirmed: z.ZodNullable<z.ZodString>;
1685
+ reconciliations: z.ZodNumber;
1686
+ lastError: z.ZodNullable<z.ZodString>;
1687
+ lagBytes: z.ZodOptional<z.ZodNumber>;
1688
+ }, z.core.$strict>>;
1091
1689
  }, z.core.$strict>;
1092
1690
  }, z.core.$strict>;
1093
1691
  export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
@@ -1117,11 +1715,18 @@ export declare const AdminStatusSchema: z.ZodObject<{
1117
1715
  }, z.core.$strict>>;
1118
1716
  aggregate: z.ZodObject<{
1119
1717
  runningSessions: z.ZodNumber;
1120
- connectedExecutors: z.ZodNumber;
1718
+ inFlightDeliveries: z.ZodNumber;
1121
1719
  pendingActions: z.ZodNumber;
1122
1720
  uncertainEffects: z.ZodNumber;
1123
- outboxDepth: z.ZodOptional<z.ZodNumber>;
1124
- relayLagMs: z.ZodOptional<z.ZodNumber>;
1721
+ relay: z.ZodOptional<z.ZodObject<{
1722
+ active: z.ZodBoolean;
1723
+ pendingTxs: z.ZodNumber;
1724
+ pendingRows: z.ZodNumber;
1725
+ confirmed: z.ZodNullable<z.ZodString>;
1726
+ reconciliations: z.ZodNumber;
1727
+ lastError: z.ZodNullable<z.ZodString>;
1728
+ lagBytes: z.ZodOptional<z.ZodNumber>;
1729
+ }, z.core.$strict>>;
1125
1730
  }, z.core.$strict>;
1126
1731
  host: z.ZodOptional<z.ZodObject<{
1127
1732
  hostId: z.ZodString;
@@ -1154,6 +1759,12 @@ export declare const HostModelViewSchema: z.ZodUnion<readonly [z.ZodObject<{
1154
1759
  oauth: "oauth";
1155
1760
  }>;
1156
1761
  baseUrl: z.ZodOptional<z.ZodString>;
1762
+ settings: z.ZodOptional<z.ZodObject<{
1763
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1764
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1765
+ reasoning: z.ZodOptional<z.ZodBoolean>;
1766
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1767
+ }, z.core.$strict>>;
1157
1768
  }, z.core.$strict>]>;
1158
1769
  export declare const TenantStatusSchema: z.ZodObject<{
1159
1770
  tenant: z.ZodObject<{
@@ -1168,7 +1779,7 @@ export declare const TenantStatusSchema: z.ZodObject<{
1168
1779
  store: z.ZodBoolean;
1169
1780
  scheduler: z.ZodBoolean;
1170
1781
  model: z.ZodBoolean;
1171
- executors: z.ZodBoolean;
1782
+ endpoints: z.ZodBoolean;
1172
1783
  schema: z.ZodBoolean;
1173
1784
  }, z.core.$strict>;
1174
1785
  model: z.ZodUnion<readonly [z.ZodObject<{
@@ -1182,11 +1793,17 @@ export declare const TenantStatusSchema: z.ZodObject<{
1182
1793
  oauth: "oauth";
1183
1794
  }>;
1184
1795
  baseUrl: z.ZodOptional<z.ZodString>;
1796
+ settings: z.ZodOptional<z.ZodObject<{
1797
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1798
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1799
+ reasoning: z.ZodOptional<z.ZodBoolean>;
1800
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1801
+ }, z.core.$strict>>;
1185
1802
  }, z.core.$strict>]>;
1186
1803
  agents: z.ZodArray<z.ZodObject<{
1187
1804
  agentId: z.ZodString;
1188
1805
  registered: z.ZodBoolean;
1189
- connected: z.ZodBoolean;
1806
+ endpoint: z.ZodBoolean;
1190
1807
  }, z.core.$strict>>;
1191
1808
  counts: z.ZodObject<{
1192
1809
  sessions: z.ZodNumber;
@@ -1218,27 +1835,61 @@ export declare const TenantStatusSchema: z.ZodObject<{
1218
1835
  failures: z.ZodNumber;
1219
1836
  lastError: z.ZodNullable<z.ZodString>;
1220
1837
  }, z.core.$strict>;
1221
- outbox: z.ZodObject<{
1222
- depth: z.ZodNumber;
1223
- oldestAgeMs: z.ZodNullable<z.ZodNumber>;
1224
- }, z.core.$strict>;
1225
- relayLagMs: z.ZodNumber;
1226
- collectionPending: z.ZodBoolean;
1838
+ generation: z.ZodNumber;
1839
+ relay: z.ZodNullable<z.ZodObject<{
1840
+ active: z.ZodBoolean;
1841
+ pendingTxs: z.ZodNumber;
1842
+ pendingRows: z.ZodNumber;
1843
+ confirmed: z.ZodNullable<z.ZodString>;
1844
+ reconciliations: z.ZodNumber;
1845
+ lastError: z.ZodNullable<z.ZodString>;
1846
+ lagBytes: z.ZodOptional<z.ZodNumber>;
1847
+ }, z.core.$strict>>;
1227
1848
  }, z.core.$strict>>;
1228
1849
  }, z.core.$strict>;
1229
1850
  export type TenantStatus = z.infer<typeof TenantStatusSchema>;
1230
1851
  export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
1231
1852
  requestId: z.ZodString;
1232
1853
  sandbox: z.ZodOptional<z.ZodObject<{
1233
- backend: z.ZodEnum<{
1854
+ backend: z.ZodOptional<z.ZodEnum<{
1234
1855
  auto: "auto";
1235
1856
  virtual: "virtual";
1236
- }>;
1857
+ }>>;
1858
+ config: z.ZodOptional<z.ZodObject<{
1859
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"virtual">, z.ZodObject<{
1860
+ image: z.ZodOptional<z.ZodString>;
1861
+ network: z.ZodOptional<z.ZodObject<{
1862
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
1863
+ }, z.core.$strict>>;
1864
+ resources: z.ZodOptional<z.ZodObject<{
1865
+ cpus: z.ZodOptional<z.ZodNumber>;
1866
+ memory: z.ZodOptional<z.ZodString>;
1867
+ }, z.core.$strict>>;
1868
+ }, z.core.$strict>]>>;
1869
+ limits: z.ZodOptional<z.ZodObject<{
1870
+ network: z.ZodOptional<z.ZodArray<z.ZodString>>;
1871
+ resources: z.ZodOptional<z.ZodObject<{
1872
+ cpus: z.ZodOptional<z.ZodNumber>;
1873
+ memory: z.ZodOptional<z.ZodString>;
1874
+ }, z.core.$strict>>;
1875
+ defaultResources: z.ZodOptional<z.ZodObject<{
1876
+ cpus: z.ZodOptional<z.ZodNumber>;
1877
+ memory: z.ZodOptional<z.ZodString>;
1878
+ }, z.core.$strict>>;
1879
+ idle: z.ZodOptional<z.ZodString>;
1880
+ }, z.core.$strict>>;
1881
+ }, z.core.$strict>>;
1237
1882
  }, z.core.$strict>>;
1238
1883
  model: z.ZodOptional<z.ZodObject<{
1239
1884
  provider: z.ZodString;
1240
1885
  model: z.ZodString;
1241
1886
  baseUrl: z.ZodOptional<z.ZodString>;
1887
+ settings: z.ZodOptional<z.ZodObject<{
1888
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1889
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1890
+ reasoning: z.ZodOptional<z.ZodBoolean>;
1891
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1892
+ }, z.core.$strict>>;
1242
1893
  auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
1243
1894
  type: z.ZodLiteral<"api_key">;
1244
1895
  key: z.ZodString;
@@ -1278,6 +1929,8 @@ export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
1278
1929
  */
1279
1930
  export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "vaults:own", "tenant:settings"];
1280
1931
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
1932
+ /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
1933
+ export declare function isSubject(value: unknown): value is string;
1281
1934
  /**
1282
1935
  * Validates `Nylorun-Subject` and `Nylorun-Scopes`. Returns the subject and its scopes, or a
1283
1936
  * message naming what is wrong. Scopes are required: the Runtime never grants a default.
@@ -1290,3 +1943,1187 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
1290
1943
  ok: false;
1291
1944
  message: string;
1292
1945
  };
1946
+ /** Scopes a subject token may carry: never `agents:write` or `tenant:settings`. */
1947
+ export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "vaults:own"];
1948
+ export type TokenScope = (typeof TOKEN_SCOPES)[number];
1949
+ /** The JWT `typ` of a subject token (RFC 8725 explicit typing). */
1950
+ export declare const SUBJECT_TOKEN_TYPE = "nylorun-subject+jwt";
1951
+ /** The `aud` of every subject token. */
1952
+ export declare const SUBJECT_TOKEN_AUDIENCE = "nylorun";
1953
+ /** The `iss` of a Tenant's subject tokens. */
1954
+ export declare function subjectTokenIssuer(tenantId: string): string;
1955
+ /** Token lifetimes, in seconds. */
1956
+ export declare const TOKEN_TTL_MIN_SECONDS = 60;
1957
+ export declare const TOKEN_TTL_MAX_SECONDS = 900;
1958
+ export declare const TOKEN_TTL_DEFAULT_SECONDS = 600;
1959
+ /** A role's name in the access policy; `anon` is reserved for publishable keys. */
1960
+ export declare const ROLE_NAME_PATTERN: RegExp;
1961
+ export declare const RoleLimitsSchema: z.ZodObject<{
1962
+ turnsPerHour: z.ZodOptional<z.ZodNumber>;
1963
+ concurrentTurns: z.ZodOptional<z.ZodNumber>;
1964
+ }, z.core.$strict>;
1965
+ export type RoleLimits = z.infer<typeof RoleLimitsSchema>;
1966
+ export declare const AccessRoleSchema: z.ZodObject<{
1967
+ scopes: z.ZodArray<z.ZodEnum<{
1968
+ "agents:read": "agents:read";
1969
+ "sessions:own": "sessions:own";
1970
+ "vaults:own": "vaults:own";
1971
+ }>>;
1972
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
1973
+ limits: z.ZodOptional<z.ZodObject<{
1974
+ turnsPerHour: z.ZodOptional<z.ZodNumber>;
1975
+ concurrentTurns: z.ZodOptional<z.ZodNumber>;
1976
+ }, z.core.$strict>>;
1977
+ }, z.core.$strict>;
1978
+ export type AccessRole = z.infer<typeof AccessRoleSchema>;
1979
+ /**
1980
+ * The Tenant's access policy: what each role may do with a subject token, what a publishable
1981
+ * key grants alone (`anon`), and how long tokens live. Without roles nothing can be minted.
1982
+ */
1983
+ export declare const AccessPolicySchema: z.ZodObject<{
1984
+ version: z.ZodLiteral<1>;
1985
+ roles: z.ZodRecord<z.ZodString, z.ZodObject<{
1986
+ scopes: z.ZodArray<z.ZodEnum<{
1987
+ "agents:read": "agents:read";
1988
+ "sessions:own": "sessions:own";
1989
+ "vaults:own": "vaults:own";
1990
+ }>>;
1991
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
1992
+ limits: z.ZodOptional<z.ZodObject<{
1993
+ turnsPerHour: z.ZodOptional<z.ZodNumber>;
1994
+ concurrentTurns: z.ZodOptional<z.ZodNumber>;
1995
+ }, z.core.$strict>>;
1996
+ }, z.core.$strict>>;
1997
+ anon: z.ZodObject<{
1998
+ scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
1999
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2000
+ }, z.core.$strict>;
2001
+ tokens: z.ZodObject<{
2002
+ maxTtlSeconds: z.ZodNumber;
2003
+ }, z.core.$strict>;
2004
+ }, z.core.$strict>;
2005
+ export type AccessPolicy = z.infer<typeof AccessPolicySchema>;
2006
+ /** The policy of a Tenant that never set one: no roles, nothing for `anon`. */
2007
+ export declare const DEFAULT_ACCESS_POLICY: AccessPolicy;
2008
+ export declare const PutAccessPolicyRequestSchema: z.ZodObject<{
2009
+ requestId: z.ZodString;
2010
+ policy: z.ZodObject<{
2011
+ version: z.ZodLiteral<1>;
2012
+ roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2013
+ scopes: z.ZodArray<z.ZodEnum<{
2014
+ "agents:read": "agents:read";
2015
+ "sessions:own": "sessions:own";
2016
+ "vaults:own": "vaults:own";
2017
+ }>>;
2018
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2019
+ limits: z.ZodOptional<z.ZodObject<{
2020
+ turnsPerHour: z.ZodOptional<z.ZodNumber>;
2021
+ concurrentTurns: z.ZodOptional<z.ZodNumber>;
2022
+ }, z.core.$strict>>;
2023
+ }, z.core.$strict>>;
2024
+ anon: z.ZodObject<{
2025
+ scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2026
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2027
+ }, z.core.$strict>;
2028
+ tokens: z.ZodObject<{
2029
+ maxTtlSeconds: z.ZodNumber;
2030
+ }, z.core.$strict>;
2031
+ }, z.core.$strict>;
2032
+ }, z.core.$strict>;
2033
+ export type PutAccessPolicyRequest = z.infer<typeof PutAccessPolicyRequestSchema>;
2034
+ export declare const CreateTokenRequestSchema: z.ZodObject<{
2035
+ requestId: z.ZodString;
2036
+ subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2037
+ role: z.ZodString;
2038
+ scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2039
+ "agents:read": "agents:read";
2040
+ "sessions:own": "sessions:own";
2041
+ "vaults:own": "vaults:own";
2042
+ }>>>;
2043
+ agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2044
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
2045
+ }, z.core.$strict>;
2046
+ export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
2047
+ export declare const CreateTokenResponseSchema: z.ZodObject<{
2048
+ token: z.ZodString;
2049
+ expiresAt: z.ZodString;
2050
+ subject: z.ZodString;
2051
+ role: z.ZodString;
2052
+ scopes: z.ZodArray<z.ZodEnum<{
2053
+ "agents:read": "agents:read";
2054
+ "sessions:own": "sessions:own";
2055
+ "vaults:own": "vaults:own";
2056
+ }>>;
2057
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2058
+ keyId: z.ZodString;
2059
+ }, z.core.$strict>;
2060
+ export type CreateTokenResponse = z.infer<typeof CreateTokenResponseSchema>;
2061
+ export declare const SIGNING_KEY_STATES: readonly ["standby", "current", "previous", "revoked"];
2062
+ export type SigningKeyState = (typeof SIGNING_KEY_STATES)[number];
2063
+ /** A public JSON Web Key as the JWKS publishes it. */
2064
+ export declare const PublicJwkSchema: z.ZodObject<{
2065
+ kty: z.ZodLiteral<"EC">;
2066
+ crv: z.ZodLiteral<"P-256">;
2067
+ x: z.ZodString;
2068
+ y: z.ZodString;
2069
+ kid: z.ZodString;
2070
+ alg: z.ZodLiteral<"ES256">;
2071
+ use: z.ZodLiteral<"sig">;
2072
+ }, z.core.$strict>;
2073
+ export type PublicJwk = z.infer<typeof PublicJwkSchema>;
2074
+ export declare const SigningKeyViewSchema: z.ZodObject<{
2075
+ id: z.ZodString;
2076
+ state: z.ZodEnum<{
2077
+ current: "current";
2078
+ previous: "previous";
2079
+ revoked: "revoked";
2080
+ standby: "standby";
2081
+ }>;
2082
+ alg: z.ZodLiteral<"ES256">;
2083
+ publicKey: z.ZodObject<{
2084
+ kty: z.ZodLiteral<"EC">;
2085
+ crv: z.ZodLiteral<"P-256">;
2086
+ x: z.ZodString;
2087
+ y: z.ZodString;
2088
+ kid: z.ZodString;
2089
+ alg: z.ZodLiteral<"ES256">;
2090
+ use: z.ZodLiteral<"sig">;
2091
+ }, z.core.$strict>;
2092
+ createdAt: z.ZodString;
2093
+ activatedAt: z.ZodNullable<z.ZodString>;
2094
+ retiredAt: z.ZodNullable<z.ZodString>;
2095
+ revokedAt: z.ZodNullable<z.ZodString>;
2096
+ }, z.core.$strict>;
2097
+ export type SigningKeyView = z.infer<typeof SigningKeyViewSchema>;
2098
+ export declare const SigningKeyListSchema: z.ZodObject<{
2099
+ keys: z.ZodArray<z.ZodObject<{
2100
+ id: z.ZodString;
2101
+ state: z.ZodEnum<{
2102
+ current: "current";
2103
+ previous: "previous";
2104
+ revoked: "revoked";
2105
+ standby: "standby";
2106
+ }>;
2107
+ alg: z.ZodLiteral<"ES256">;
2108
+ publicKey: z.ZodObject<{
2109
+ kty: z.ZodLiteral<"EC">;
2110
+ crv: z.ZodLiteral<"P-256">;
2111
+ x: z.ZodString;
2112
+ y: z.ZodString;
2113
+ kid: z.ZodString;
2114
+ alg: z.ZodLiteral<"ES256">;
2115
+ use: z.ZodLiteral<"sig">;
2116
+ }, z.core.$strict>;
2117
+ createdAt: z.ZodString;
2118
+ activatedAt: z.ZodNullable<z.ZodString>;
2119
+ retiredAt: z.ZodNullable<z.ZodString>;
2120
+ revokedAt: z.ZodNullable<z.ZodString>;
2121
+ }, z.core.$strict>>;
2122
+ }, z.core.$strict>;
2123
+ export declare const JwksSchema: z.ZodObject<{
2124
+ keys: z.ZodArray<z.ZodObject<{
2125
+ kty: z.ZodLiteral<"EC">;
2126
+ crv: z.ZodLiteral<"P-256">;
2127
+ x: z.ZodString;
2128
+ y: z.ZodString;
2129
+ kid: z.ZodString;
2130
+ alg: z.ZodLiteral<"ES256">;
2131
+ use: z.ZodLiteral<"sig">;
2132
+ }, z.core.$strict>>;
2133
+ }, z.core.$strict>;
2134
+ export type Jwks = z.infer<typeof JwksSchema>;
2135
+ export declare const RotateSigningKeysRequestSchema: z.ZodObject<{
2136
+ requestId: z.ZodString;
2137
+ force: z.ZodOptional<z.ZodBoolean>;
2138
+ }, z.core.$strict>;
2139
+ export declare const RevokeSigningKeyRequestSchema: z.ZodObject<{
2140
+ requestId: z.ZodString;
2141
+ }, z.core.$strict>;
2142
+ export declare const RevokeSubjectRequestSchema: z.ZodObject<{
2143
+ requestId: z.ZodString;
2144
+ subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2145
+ }, z.core.$strict>;
2146
+ export type RevokeSubjectRequest = z.infer<typeof RevokeSubjectRequestSchema>;
2147
+ export declare const RevokeSubjectResponseSchema: z.ZodObject<{
2148
+ subject: z.ZodString;
2149
+ epoch: z.ZodNumber;
2150
+ }, z.core.$strict>;
2151
+ /** The claims of a subject token, as the Runtime writes them. */
2152
+ export interface SubjectTokenClaims {
2153
+ iss: string;
2154
+ aud: string;
2155
+ /** Tenant id. */
2156
+ tnt: string;
2157
+ sub: string;
2158
+ role: string;
2159
+ /** Space-separated token scopes. */
2160
+ scp: string;
2161
+ /** The agents the mint narrowed the role to; absent when not narrowed. */
2162
+ agt?: string[];
2163
+ /** The subject's revocation epoch when minted. */
2164
+ epc: number;
2165
+ iat: number;
2166
+ exp: number;
2167
+ jti: string;
2168
+ }
2169
+ /** Loopback origins with any port, for development: `http://localhost:*`, `http://127.0.0.1:*`. */
2170
+ export declare const LOOPBACK_ORIGIN_WILDCARDS: readonly ["http://localhost:*", "http://127.0.0.1:*"];
2171
+ /** True for a serialized web origin: `scheme://host[:port]`, lowercase, no path. */
2172
+ export declare function isSerializedOrigin(value: string): boolean;
2173
+ /** An origin allowlist entry: an exact origin or a loopback wildcard. */
2174
+ export declare const OriginEntrySchema: z.ZodString;
2175
+ /** True when `origin` (a request's `Origin`) is allowed by `origins`. */
2176
+ export declare function originAllowed(origins: readonly string[], origin: string): boolean;
2177
+ export declare const PublishableKeySchema: z.ZodObject<{
2178
+ id: z.ZodString;
2179
+ name: z.ZodString;
2180
+ key: z.ZodString;
2181
+ origins: z.ZodArray<z.ZodString>;
2182
+ createdAt: z.ZodString;
2183
+ revokedAt: z.ZodNullable<z.ZodString>;
2184
+ }, z.core.$strict>;
2185
+ export type PublishableKey = z.infer<typeof PublishableKeySchema>;
2186
+ export declare const CreatePublishableKeyRequestSchema: z.ZodObject<{
2187
+ requestId: z.ZodString;
2188
+ name: z.ZodString;
2189
+ origins: z.ZodArray<z.ZodString>;
2190
+ }, z.core.$strict>;
2191
+ export type CreatePublishableKeyRequest = z.infer<typeof CreatePublishableKeyRequestSchema>;
2192
+ export declare const UpdatePublishableKeyRequestSchema: z.ZodObject<{
2193
+ requestId: z.ZodString;
2194
+ origins: z.ZodArray<z.ZodString>;
2195
+ }, z.core.$strict>;
2196
+ /** `GET /v1/agents` with an application key: every definition, manifest included. */
2197
+ export declare const AgentDefinitionViewSchema: z.ZodObject<{
2198
+ agentId: z.ZodString;
2199
+ manifest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2200
+ manifestHash: z.ZodString;
2201
+ implementationVersion: z.ZodString;
2202
+ }, z.core.$strict>;
2203
+ export type AgentDefinitionView = z.infer<typeof AgentDefinitionViewSchema>;
2204
+ export declare const ListAgentsResponseSchema: z.ZodObject<{
2205
+ agents: z.ZodArray<z.ZodObject<{
2206
+ agentId: z.ZodString;
2207
+ manifest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2208
+ manifestHash: z.ZodString;
2209
+ implementationVersion: z.ZodString;
2210
+ }, z.core.$strict>>;
2211
+ }, z.core.$strict>;
2212
+ export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>;
2213
+ /** `GET /v1/agents` with a subject token or publishable key: the allowed agents' names only. */
2214
+ export declare const PublicAgentSchema: z.ZodObject<{
2215
+ agentId: z.ZodString;
2216
+ name: z.ZodOptional<z.ZodString>;
2217
+ description: z.ZodOptional<z.ZodString>;
2218
+ }, z.core.$strict>;
2219
+ export type PublicAgent = z.infer<typeof PublicAgentSchema>;
2220
+ export declare const ListPublicAgentsResponseSchema: z.ZodObject<{
2221
+ agents: z.ZodArray<z.ZodObject<{
2222
+ agentId: z.ZodString;
2223
+ name: z.ZodOptional<z.ZodString>;
2224
+ description: z.ZodOptional<z.ZodString>;
2225
+ }, z.core.$strict>>;
2226
+ }, z.core.$strict>;
2227
+ export type ListPublicAgentsResponse = z.infer<typeof ListPublicAgentsResponseSchema>;
2228
+ export declare const PutAgentResponseSchema: z.ZodObject<{
2229
+ agentId: z.ZodString;
2230
+ manifestHash: z.ZodString;
2231
+ implementationVersion: z.ZodString;
2232
+ }, z.core.$strict>;
2233
+ export type PutAgentResponse = z.infer<typeof PutAgentResponseSchema>;
2234
+ export declare const SESSION_STATUSES: readonly ["idle", "runnable", "running", "waiting", "paused", "uncertain", "completed", "failed", "cancelled"];
2235
+ export declare const SessionSummarySchema: z.ZodObject<{
2236
+ id: z.ZodString;
2237
+ agentId: z.ZodString;
2238
+ ownerUserId: z.ZodString;
2239
+ status: z.ZodEnum<{
2240
+ cancelled: "cancelled";
2241
+ completed: "completed";
2242
+ failed: "failed";
2243
+ idle: "idle";
2244
+ paused: "paused";
2245
+ runnable: "runnable";
2246
+ running: "running";
2247
+ uncertain: "uncertain";
2248
+ waiting: "waiting";
2249
+ }>;
2250
+ activeTurnId: z.ZodNullable<z.ZodString>;
2251
+ }, z.core.$strict>;
2252
+ export type SessionSummary = z.infer<typeof SessionSummarySchema>;
2253
+ export declare const ListSessionsResponseSchema: z.ZodObject<{
2254
+ sessions: z.ZodArray<z.ZodObject<{
2255
+ id: z.ZodString;
2256
+ agentId: z.ZodString;
2257
+ ownerUserId: z.ZodString;
2258
+ status: z.ZodEnum<{
2259
+ cancelled: "cancelled";
2260
+ completed: "completed";
2261
+ failed: "failed";
2262
+ idle: "idle";
2263
+ paused: "paused";
2264
+ runnable: "runnable";
2265
+ running: "running";
2266
+ uncertain: "uncertain";
2267
+ waiting: "waiting";
2268
+ }>;
2269
+ activeTurnId: z.ZodNullable<z.ZodString>;
2270
+ }, z.core.$strict>>;
2271
+ }, z.core.$strict>;
2272
+ export type ListSessionsResponse = z.infer<typeof ListSessionsResponseSchema>;
2273
+ /** `PUT` and `GET /v1/sessions/:id`. */
2274
+ export declare const SessionViewSchema: z.ZodObject<{
2275
+ id: z.ZodString;
2276
+ agentId: z.ZodString;
2277
+ ownerUserId: z.ZodString;
2278
+ manifestHash: z.ZodString;
2279
+ implementationVersion: z.ZodString;
2280
+ status: z.ZodEnum<{
2281
+ cancelled: "cancelled";
2282
+ completed: "completed";
2283
+ failed: "failed";
2284
+ idle: "idle";
2285
+ paused: "paused";
2286
+ runnable: "runnable";
2287
+ running: "running";
2288
+ uncertain: "uncertain";
2289
+ waiting: "waiting";
2290
+ }>;
2291
+ activeTurnId: z.ZodNullable<z.ZodString>;
2292
+ vaultIds: z.ZodArray<z.ZodString>;
2293
+ credentialSelections: z.ZodArray<z.ZodObject<{
2294
+ serverName: z.ZodString;
2295
+ credentialId: z.ZodString;
2296
+ }, z.core.$strict>>;
2297
+ sandboxOwnerId: z.ZodNullable<z.ZodString>;
2298
+ sandbox: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2299
+ sandboxSource: z.ZodOptional<z.ZodEnum<{
2300
+ default: "default";
2301
+ inline: "inline";
2302
+ shared: "shared";
2303
+ }>>;
2304
+ mcpSnapshot: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2305
+ mcpDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2306
+ waits: z.ZodOptional<z.ZodUnknown>;
2307
+ error: z.ZodOptional<z.ZodString>;
2308
+ actions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2309
+ actionId: z.ZodString;
2310
+ sessionId: z.ZodString;
2311
+ turnId: z.ZodString;
2312
+ agentId: z.ZodString;
2313
+ manifestHash: z.ZodString;
2314
+ implementationVersion: z.ZodString;
2315
+ input: z.ZodUnknown;
2316
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2317
+ status: z.ZodEnum<{
2318
+ cancelled: "cancelled";
2319
+ completed: "completed";
2320
+ delivering: "delivering";
2321
+ pending: "pending";
2322
+ uncertain: "uncertain";
2323
+ }>;
2324
+ generation: z.ZodNumber;
2325
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2326
+ agent: z.ZodOptional<z.ZodObject<{
2327
+ id: z.ZodString;
2328
+ path: z.ZodString;
2329
+ delegationId: z.ZodOptional<z.ZodString>;
2330
+ }, z.core.$strict>>;
2331
+ kind: z.ZodLiteral<"tool">;
2332
+ capabilityId: z.ZodString;
2333
+ toolName: z.ZodString;
2334
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2335
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2336
+ }, z.core.$strict>, z.ZodObject<{
2337
+ actionId: z.ZodString;
2338
+ sessionId: z.ZodString;
2339
+ turnId: z.ZodString;
2340
+ agentId: z.ZodString;
2341
+ manifestHash: z.ZodString;
2342
+ implementationVersion: z.ZodString;
2343
+ input: z.ZodUnknown;
2344
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2345
+ status: z.ZodEnum<{
2346
+ cancelled: "cancelled";
2347
+ completed: "completed";
2348
+ delivering: "delivering";
2349
+ pending: "pending";
2350
+ uncertain: "uncertain";
2351
+ }>;
2352
+ generation: z.ZodNumber;
2353
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2354
+ agent: z.ZodOptional<z.ZodObject<{
2355
+ id: z.ZodString;
2356
+ path: z.ZodString;
2357
+ delegationId: z.ZodOptional<z.ZodString>;
2358
+ }, z.core.$strict>>;
2359
+ kind: z.ZodLiteral<"tool">;
2360
+ path: z.ZodString;
2361
+ key: z.ZodString;
2362
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2363
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2364
+ }, z.core.$strict>, z.ZodObject<{
2365
+ actionId: z.ZodString;
2366
+ sessionId: z.ZodString;
2367
+ turnId: z.ZodString;
2368
+ agentId: z.ZodString;
2369
+ manifestHash: z.ZodString;
2370
+ implementationVersion: z.ZodString;
2371
+ input: z.ZodUnknown;
2372
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2373
+ status: z.ZodEnum<{
2374
+ cancelled: "cancelled";
2375
+ completed: "completed";
2376
+ delivering: "delivering";
2377
+ pending: "pending";
2378
+ uncertain: "uncertain";
2379
+ }>;
2380
+ generation: z.ZodNumber;
2381
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2382
+ agent: z.ZodOptional<z.ZodObject<{
2383
+ id: z.ZodString;
2384
+ path: z.ZodString;
2385
+ delegationId: z.ZodOptional<z.ZodString>;
2386
+ }, z.core.$strict>>;
2387
+ kind: z.ZodLiteral<"hook">;
2388
+ hook: z.ZodObject<{
2389
+ at: z.ZodEnum<{
2390
+ after: "after";
2391
+ before: "before";
2392
+ }>;
2393
+ scope: z.ZodEnum<{
2394
+ step: "step";
2395
+ turn: "turn";
2396
+ }>;
2397
+ capabilityIds: z.ZodArray<z.ZodString>;
2398
+ }, z.core.$strict>;
2399
+ }, z.core.$strict>, z.ZodObject<{
2400
+ actionId: z.ZodString;
2401
+ sessionId: z.ZodString;
2402
+ turnId: z.ZodString;
2403
+ agentId: z.ZodString;
2404
+ manifestHash: z.ZodString;
2405
+ implementationVersion: z.ZodString;
2406
+ input: z.ZodUnknown;
2407
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2408
+ status: z.ZodEnum<{
2409
+ cancelled: "cancelled";
2410
+ completed: "completed";
2411
+ delivering: "delivering";
2412
+ pending: "pending";
2413
+ uncertain: "uncertain";
2414
+ }>;
2415
+ generation: z.ZodNumber;
2416
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2417
+ agent: z.ZodOptional<z.ZodObject<{
2418
+ id: z.ZodString;
2419
+ path: z.ZodString;
2420
+ delegationId: z.ZodOptional<z.ZodString>;
2421
+ }, z.core.$strict>>;
2422
+ kind: z.ZodLiteral<"fn">;
2423
+ path: z.ZodString;
2424
+ key: z.ZodString;
2425
+ }, z.core.$strict>, z.ZodObject<{
2426
+ actionId: z.ZodString;
2427
+ sessionId: z.ZodString;
2428
+ turnId: z.ZodString;
2429
+ agentId: z.ZodString;
2430
+ manifestHash: z.ZodString;
2431
+ implementationVersion: z.ZodString;
2432
+ input: z.ZodUnknown;
2433
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2434
+ status: z.ZodEnum<{
2435
+ cancelled: "cancelled";
2436
+ completed: "completed";
2437
+ delivering: "delivering";
2438
+ pending: "pending";
2439
+ uncertain: "uncertain";
2440
+ }>;
2441
+ generation: z.ZodNumber;
2442
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2443
+ agent: z.ZodOptional<z.ZodObject<{
2444
+ id: z.ZodString;
2445
+ path: z.ZodString;
2446
+ delegationId: z.ZodOptional<z.ZodString>;
2447
+ }, z.core.$strict>>;
2448
+ kind: z.ZodLiteral<"verify">;
2449
+ path: z.ZodString;
2450
+ key: z.ZodString;
2451
+ }, z.core.$strict>]>>;
2452
+ uncertainEffects: z.ZodArray<z.ZodObject<{
2453
+ effectId: z.ZodString;
2454
+ turnId: z.ZodString;
2455
+ kind: z.ZodString;
2456
+ error: z.ZodUnknown;
2457
+ }, z.core.$strict>>;
2458
+ }, z.core.$strict>;
2459
+ export type SessionView = z.infer<typeof SessionViewSchema>;
2460
+ /** A sandbox tool call's answer (`POST …/sandbox/:tool`): its output, or why it failed. */
2461
+ export declare const SandboxToolOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2462
+ kind: z.ZodLiteral<"completed">;
2463
+ output: z.ZodUnknown;
2464
+ }, z.core.$strict>, z.ZodObject<{
2465
+ kind: z.ZodLiteral<"failed">;
2466
+ code: z.ZodString;
2467
+ message: z.ZodString;
2468
+ }, z.core.$strict>], "kind">;
2469
+ export type SandboxToolOutcome = z.infer<typeof SandboxToolOutcomeSchema>;
2470
+ export declare const ResetTenantResponseSchema: z.ZodObject<{
2471
+ ok: z.ZodLiteral<true>;
2472
+ }, z.core.$strict>;
2473
+ export type ResetTenantResponse = z.infer<typeof ResetTenantResponseSchema>;
2474
+ /** `GET /v1/tenant/models`: public provider and model names, no credentials. */
2475
+ export declare const HostModelCatalogSchema: z.ZodObject<{
2476
+ providers: z.ZodArray<z.ZodObject<{
2477
+ id: z.ZodString;
2478
+ name: z.ZodString;
2479
+ models: z.ZodArray<z.ZodObject<{
2480
+ id: z.ZodString;
2481
+ name: z.ZodString;
2482
+ }, z.core.$strict>>;
2483
+ }, z.core.$strict>>;
2484
+ }, z.core.$strict>;
2485
+ export type HostModelCatalog = z.infer<typeof HostModelCatalogSchema>;
2486
+ export declare const HostModelProviderInfoSchema: z.ZodObject<{
2487
+ id: z.ZodString;
2488
+ name: z.ZodString;
2489
+ model: z.ZodString;
2490
+ authType: z.ZodEnum<{
2491
+ api_key: "api_key";
2492
+ oauth: "oauth";
2493
+ }>;
2494
+ baseUrl: z.ZodOptional<z.ZodString>;
2495
+ settings: z.ZodOptional<z.ZodObject<{
2496
+ contextWindow: z.ZodOptional<z.ZodNumber>;
2497
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2498
+ reasoning: z.ZodOptional<z.ZodBoolean>;
2499
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2500
+ }, z.core.$strict>>;
2501
+ lastUpdated: z.ZodString;
2502
+ active: z.ZodBoolean;
2503
+ }, z.core.$strict>;
2504
+ export declare const ListProvidersResponseSchema: z.ZodObject<{
2505
+ providers: z.ZodArray<z.ZodObject<{
2506
+ id: z.ZodString;
2507
+ name: z.ZodString;
2508
+ model: z.ZodString;
2509
+ authType: z.ZodEnum<{
2510
+ api_key: "api_key";
2511
+ oauth: "oauth";
2512
+ }>;
2513
+ baseUrl: z.ZodOptional<z.ZodString>;
2514
+ settings: z.ZodOptional<z.ZodObject<{
2515
+ contextWindow: z.ZodOptional<z.ZodNumber>;
2516
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2517
+ reasoning: z.ZodOptional<z.ZodBoolean>;
2518
+ compat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2519
+ }, z.core.$strict>>;
2520
+ lastUpdated: z.ZodString;
2521
+ active: z.ZodBoolean;
2522
+ }, z.core.$strict>>;
2523
+ }, z.core.$strict>;
2524
+ export type ListProvidersResponse = z.infer<typeof ListProvidersResponseSchema>;
2525
+ /** A Tenant's sandbox configuration with every default applied (sizes in MiB). */
2526
+ export declare const EffectiveSandboxConfigSchema: z.ZodObject<{
2527
+ default: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"virtual">, z.ZodObject<{
2528
+ image: z.ZodOptional<z.ZodString>;
2529
+ network: z.ZodOptional<z.ZodObject<{
2530
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
2531
+ }, z.core.$strict>>;
2532
+ resources: z.ZodOptional<z.ZodObject<{
2533
+ cpus: z.ZodOptional<z.ZodNumber>;
2534
+ memory: z.ZodOptional<z.ZodString>;
2535
+ }, z.core.$strict>>;
2536
+ }, z.core.$strict>]>;
2537
+ limits: z.ZodObject<{
2538
+ network: z.ZodArray<z.ZodString>;
2539
+ resources: z.ZodObject<{
2540
+ cpus: z.ZodNumber;
2541
+ memoryMiB: z.ZodNumber;
2542
+ }, z.core.$strict>;
2543
+ defaultResources: z.ZodObject<{
2544
+ cpus: z.ZodNumber;
2545
+ memoryMiB: z.ZodNumber;
2546
+ }, z.core.$strict>;
2547
+ idle: z.ZodString;
2548
+ }, z.core.$strict>;
2549
+ }, z.core.$strict>;
2550
+ export type EffectiveSandboxConfig = z.infer<typeof EffectiveSandboxConfigSchema>;
2551
+ /** `GET` and `PUT /v1/tenant/sandbox`: the backend chosen, and the configuration in force. */
2552
+ export declare const TenantSandboxViewSchema: z.ZodObject<{
2553
+ preference: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodEnum<{
2554
+ virtual: "virtual";
2555
+ }>]>;
2556
+ backend: z.ZodNullable<z.ZodEnum<{
2557
+ virtual: "virtual";
2558
+ }>>;
2559
+ isolation: z.ZodNullable<z.ZodEnum<{
2560
+ container: "container";
2561
+ process: "process";
2562
+ }>>;
2563
+ reason: z.ZodString;
2564
+ probes: z.ZodArray<z.ZodObject<{
2565
+ name: z.ZodEnum<{
2566
+ virtual: "virtual";
2567
+ }>;
2568
+ available: z.ZodBoolean;
2569
+ isolation: z.ZodEnum<{
2570
+ container: "container";
2571
+ process: "process";
2572
+ }>;
2573
+ reason: z.ZodOptional<z.ZodString>;
2574
+ version: z.ZodOptional<z.ZodString>;
2575
+ }, z.core.$strict>>;
2576
+ defaultImage: z.ZodString;
2577
+ config: z.ZodObject<{
2578
+ default: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"virtual">, z.ZodObject<{
2579
+ image: z.ZodOptional<z.ZodString>;
2580
+ network: z.ZodOptional<z.ZodObject<{
2581
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
2582
+ }, z.core.$strict>>;
2583
+ resources: z.ZodOptional<z.ZodObject<{
2584
+ cpus: z.ZodOptional<z.ZodNumber>;
2585
+ memory: z.ZodOptional<z.ZodString>;
2586
+ }, z.core.$strict>>;
2587
+ }, z.core.$strict>]>;
2588
+ limits: z.ZodObject<{
2589
+ network: z.ZodArray<z.ZodString>;
2590
+ resources: z.ZodObject<{
2591
+ cpus: z.ZodNumber;
2592
+ memoryMiB: z.ZodNumber;
2593
+ }, z.core.$strict>;
2594
+ defaultResources: z.ZodObject<{
2595
+ cpus: z.ZodNumber;
2596
+ memoryMiB: z.ZodNumber;
2597
+ }, z.core.$strict>;
2598
+ idle: z.ZodString;
2599
+ }, z.core.$strict>;
2600
+ }, z.core.$strict>;
2601
+ }, z.core.$strict>;
2602
+ export type TenantSandboxView = z.infer<typeof TenantSandboxViewSchema>;
2603
+ export declare const ListVaultsResponseSchema: z.ZodObject<{
2604
+ vaults: z.ZodArray<z.ZodObject<{
2605
+ id: z.ZodString;
2606
+ name: z.ZodString;
2607
+ ownerUserId: z.ZodString;
2608
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2609
+ createdAt: z.ZodString;
2610
+ }, z.core.$strict>>;
2611
+ }, z.core.$strict>;
2612
+ export type ListVaultsResponse = z.infer<typeof ListVaultsResponseSchema>;
2613
+ export declare const ListCredentialsResponseSchema: z.ZodObject<{
2614
+ credentials: z.ZodArray<z.ZodObject<{
2615
+ id: z.ZodString;
2616
+ vaultId: z.ZodString;
2617
+ name: z.ZodString;
2618
+ type: z.ZodEnum<{
2619
+ bearer: "bearer";
2620
+ oauth: "oauth";
2621
+ }>;
2622
+ binding: z.ZodObject<{
2623
+ url: z.ZodString;
2624
+ }, z.core.$strict>;
2625
+ expiresAt: z.ZodOptional<z.ZodString>;
2626
+ createdAt: z.ZodString;
2627
+ rotatedAt: z.ZodOptional<z.ZodString>;
2628
+ }, z.core.$strict>>;
2629
+ }, z.core.$strict>;
2630
+ export type ListCredentialsResponse = z.infer<typeof ListCredentialsResponseSchema>;
2631
+ /** A deleted vault or credential. */
2632
+ export declare const DeletedResponseSchema: z.ZodObject<{
2633
+ id: z.ZodString;
2634
+ }, z.core.$strict>;
2635
+ export type DeletedResponse = z.infer<typeof DeletedResponseSchema>;
2636
+ export declare const AccessPolicyResponseSchema: z.ZodObject<{
2637
+ policy: z.ZodObject<{
2638
+ version: z.ZodLiteral<1>;
2639
+ roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2640
+ scopes: z.ZodArray<z.ZodEnum<{
2641
+ "agents:read": "agents:read";
2642
+ "sessions:own": "sessions:own";
2643
+ "vaults:own": "vaults:own";
2644
+ }>>;
2645
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2646
+ limits: z.ZodOptional<z.ZodObject<{
2647
+ turnsPerHour: z.ZodOptional<z.ZodNumber>;
2648
+ concurrentTurns: z.ZodOptional<z.ZodNumber>;
2649
+ }, z.core.$strict>>;
2650
+ }, z.core.$strict>>;
2651
+ anon: z.ZodObject<{
2652
+ scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2653
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2654
+ }, z.core.$strict>;
2655
+ tokens: z.ZodObject<{
2656
+ maxTtlSeconds: z.ZodNumber;
2657
+ }, z.core.$strict>;
2658
+ }, z.core.$strict>;
2659
+ }, z.core.$strict>;
2660
+ export type AccessPolicyResponse = z.infer<typeof AccessPolicyResponseSchema>;
2661
+ export declare const ListPublishableKeysResponseSchema: z.ZodObject<{
2662
+ keys: z.ZodArray<z.ZodObject<{
2663
+ id: z.ZodString;
2664
+ name: z.ZodString;
2665
+ key: z.ZodString;
2666
+ origins: z.ZodArray<z.ZodString>;
2667
+ createdAt: z.ZodString;
2668
+ revokedAt: z.ZodNullable<z.ZodString>;
2669
+ }, z.core.$strict>>;
2670
+ }, z.core.$strict>;
2671
+ export type ListPublishableKeysResponse = z.infer<typeof ListPublishableKeysResponseSchema>;
2672
+ export declare const AdminTenantListSchema: z.ZodArray<z.ZodObject<{
2673
+ id: z.ZodString;
2674
+ name: z.ZodNullable<z.ZodString>;
2675
+ state: z.ZodEnum<{
2676
+ open: "open";
2677
+ quarantined: "quarantined";
2678
+ }>;
2679
+ envelope: z.ZodNullable<z.ZodObject<{
2680
+ id: z.ZodString;
2681
+ name: z.ZodString;
2682
+ createdAt: z.ZodString;
2683
+ updatedAt: z.ZodString;
2684
+ schemaVersion: z.ZodNumber;
2685
+ }, z.core.$strict>>;
2686
+ }, z.core.$strict>>;
2687
+ export declare const HostShutdownResponseSchema: z.ZodObject<{
2688
+ status: z.ZodLiteral<"shutting_down">;
2689
+ }, z.core.$strict>;
2690
+ /** The last frame of a session stream the Runtime ends: `event: nylorun.closed`. */
2691
+ export declare const StreamClosedFrameSchema: z.ZodObject<{
2692
+ reason: z.ZodEnum<{
2693
+ revoked: "revoked";
2694
+ token_expired: "token_expired";
2695
+ }>;
2696
+ }, z.core.$strict>;
2697
+ export type StreamClosedFrame = z.infer<typeof StreamClosedFrameSchema>;
2698
+ /**
2699
+ * The `code` of an AG-UI `RUN_ERROR` the Runtime sends: a rejection's code, or `session_busy`
2700
+ * (another turn is running) or `runtime_error` (the Runtime failed). Never an HTTP body's code.
2701
+ */
2702
+ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
2703
+ active_work: "active_work";
2704
+ connection_missing: "connection_missing";
2705
+ host_rejected: "host_rejected";
2706
+ incompatible_host: "incompatible_host";
2707
+ internal_error: "internal_error";
2708
+ invalid_request: "invalid_request";
2709
+ limit_exceeded: "limit_exceeded";
2710
+ not_found: "not_found";
2711
+ origin_rejected: "origin_rejected";
2712
+ protocol_unsupported: "protocol_unsupported";
2713
+ request_rejected: "request_rejected";
2714
+ runtime_error: "runtime_error";
2715
+ scope_required: "scope_required";
2716
+ session_busy: "session_busy";
2717
+ subject_invalid: "subject_invalid";
2718
+ subject_required: "subject_required";
2719
+ tenant_conflict: "tenant_conflict";
2720
+ token_expired: "token_expired";
2721
+ unsupported_media_type: "unsupported_media_type";
2722
+ }>;
2723
+ export type AgUiRunErrorCode = z.infer<typeof AgUiRunErrorCodeSchema>;
2724
+ /** The JWT `typ` of a delivery token (RFC 8725 explicit typing). */
2725
+ export declare const DELIVERY_TOKEN_TYPE = "nylorun-delivery+jwt";
2726
+ /**
2727
+ * A delivery token lives no longer than a subject token: rotating signing keys revokes the
2728
+ * previous key once the longest token it may have signed has expired.
2729
+ */
2730
+ export declare const DELIVERY_TOKEN_MAX_TTL_SECONDS = 900;
2731
+ /** Inline delivery timeouts, in milliseconds. The maximum keeps a token within its lifetime. */
2732
+ export declare const ENDPOINT_TIMEOUT_DEFAULT_MS = 60000;
2733
+ export declare const ENDPOINT_TIMEOUT_MAX_MS: number;
2734
+ /** In-flight deliveries per endpoint when the registration does not say. */
2735
+ export declare const ENDPOINT_MAX_CONCURRENT_DEFAULT = 16;
2736
+ /** One agent's or workflow's Action endpoint, as the application registers it. */
2737
+ export declare const EndpointRegistrationSchema: z.ZodObject<{
2738
+ agentId: z.ZodString;
2739
+ url: z.ZodString;
2740
+ implementationVersion: z.ZodString;
2741
+ manifestHash: z.ZodOptional<z.ZodString>;
2742
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2743
+ maxConcurrent: z.ZodOptional<z.ZodNumber>;
2744
+ }, z.core.$strict>;
2745
+ export type EndpointRegistration = z.infer<typeof EndpointRegistrationSchema>;
2746
+ export declare const PutEndpointsRequestSchema: z.ZodObject<{
2747
+ endpoints: z.ZodArray<z.ZodObject<{
2748
+ agentId: z.ZodString;
2749
+ url: z.ZodString;
2750
+ implementationVersion: z.ZodString;
2751
+ manifestHash: z.ZodOptional<z.ZodString>;
2752
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2753
+ maxConcurrent: z.ZodOptional<z.ZodNumber>;
2754
+ }, z.core.$strict>>;
2755
+ }, z.core.$strict>;
2756
+ export type PutEndpointsRequest = z.infer<typeof PutEndpointsRequestSchema>;
2757
+ /** What recent deliveries and the last ping say about an endpoint. */
2758
+ export declare const EndpointHealthSchema: z.ZodObject<{
2759
+ lastDeliveryAt: z.ZodOptional<z.ZodString>;
2760
+ lastSuccessAt: z.ZodOptional<z.ZodString>;
2761
+ lastError: z.ZodOptional<z.ZodObject<{
2762
+ code: z.ZodString;
2763
+ message: z.ZodString;
2764
+ }, z.core.$strip>>;
2765
+ consecutiveFailures: z.ZodNumber;
2766
+ served: z.ZodOptional<z.ZodObject<{
2767
+ implementationVersion: z.ZodString;
2768
+ manifestHash: z.ZodOptional<z.ZodString>;
2769
+ }, z.core.$strict>>;
2770
+ }, z.core.$strict>;
2771
+ export type EndpointHealth = z.infer<typeof EndpointHealthSchema>;
2772
+ export declare const EndpointSchema: z.ZodObject<{
2773
+ agentId: z.ZodString;
2774
+ url: z.ZodString;
2775
+ implementationVersion: z.ZodString;
2776
+ manifestHash: z.ZodOptional<z.ZodString>;
2777
+ timeoutMs: z.ZodNumber;
2778
+ maxConcurrent: z.ZodNumber;
2779
+ health: z.ZodObject<{
2780
+ lastDeliveryAt: z.ZodOptional<z.ZodString>;
2781
+ lastSuccessAt: z.ZodOptional<z.ZodString>;
2782
+ lastError: z.ZodOptional<z.ZodObject<{
2783
+ code: z.ZodString;
2784
+ message: z.ZodString;
2785
+ }, z.core.$strip>>;
2786
+ consecutiveFailures: z.ZodNumber;
2787
+ served: z.ZodOptional<z.ZodObject<{
2788
+ implementationVersion: z.ZodString;
2789
+ manifestHash: z.ZodOptional<z.ZodString>;
2790
+ }, z.core.$strict>>;
2791
+ }, z.core.$strict>;
2792
+ updatedAt: z.ZodString;
2793
+ }, z.core.$strict>;
2794
+ export type Endpoint = z.infer<typeof EndpointSchema>;
2795
+ export declare const ListEndpointsResponseSchema: z.ZodObject<{
2796
+ endpoints: z.ZodArray<z.ZodObject<{
2797
+ agentId: z.ZodString;
2798
+ url: z.ZodString;
2799
+ implementationVersion: z.ZodString;
2800
+ manifestHash: z.ZodOptional<z.ZodString>;
2801
+ timeoutMs: z.ZodNumber;
2802
+ maxConcurrent: z.ZodNumber;
2803
+ health: z.ZodObject<{
2804
+ lastDeliveryAt: z.ZodOptional<z.ZodString>;
2805
+ lastSuccessAt: z.ZodOptional<z.ZodString>;
2806
+ lastError: z.ZodOptional<z.ZodObject<{
2807
+ code: z.ZodString;
2808
+ message: z.ZodString;
2809
+ }, z.core.$strip>>;
2810
+ consecutiveFailures: z.ZodNumber;
2811
+ served: z.ZodOptional<z.ZodObject<{
2812
+ implementationVersion: z.ZodString;
2813
+ manifestHash: z.ZodOptional<z.ZodString>;
2814
+ }, z.core.$strict>>;
2815
+ }, z.core.$strict>;
2816
+ updatedAt: z.ZodString;
2817
+ }, z.core.$strict>>;
2818
+ }, z.core.$strict>;
2819
+ export type ListEndpointsResponse = z.infer<typeof ListEndpointsResponseSchema>;
2820
+ export declare const DeleteEndpointResponseSchema: z.ZodObject<{
2821
+ agentId: z.ZodString;
2822
+ deleted: z.ZodLiteral<true>;
2823
+ }, z.core.$strict>;
2824
+ export type DeleteEndpointResponse = z.infer<typeof DeleteEndpointResponseSchema>;
2825
+ /** The body the Runtime POSTs to an Action endpoint. */
2826
+ export declare const ActionDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2827
+ type: z.ZodLiteral<"action">;
2828
+ action: z.ZodUnion<readonly [z.ZodObject<{
2829
+ actionId: z.ZodString;
2830
+ sessionId: z.ZodString;
2831
+ turnId: z.ZodString;
2832
+ agentId: z.ZodString;
2833
+ manifestHash: z.ZodString;
2834
+ implementationVersion: z.ZodString;
2835
+ input: z.ZodUnknown;
2836
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2837
+ status: z.ZodEnum<{
2838
+ cancelled: "cancelled";
2839
+ completed: "completed";
2840
+ delivering: "delivering";
2841
+ pending: "pending";
2842
+ uncertain: "uncertain";
2843
+ }>;
2844
+ generation: z.ZodNumber;
2845
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2846
+ agent: z.ZodOptional<z.ZodObject<{
2847
+ id: z.ZodString;
2848
+ path: z.ZodString;
2849
+ delegationId: z.ZodOptional<z.ZodString>;
2850
+ }, z.core.$strict>>;
2851
+ kind: z.ZodLiteral<"tool">;
2852
+ capabilityId: z.ZodString;
2853
+ toolName: z.ZodString;
2854
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2855
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2856
+ }, z.core.$strict>, z.ZodObject<{
2857
+ actionId: z.ZodString;
2858
+ sessionId: z.ZodString;
2859
+ turnId: z.ZodString;
2860
+ agentId: z.ZodString;
2861
+ manifestHash: z.ZodString;
2862
+ implementationVersion: z.ZodString;
2863
+ input: z.ZodUnknown;
2864
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2865
+ status: z.ZodEnum<{
2866
+ cancelled: "cancelled";
2867
+ completed: "completed";
2868
+ delivering: "delivering";
2869
+ pending: "pending";
2870
+ uncertain: "uncertain";
2871
+ }>;
2872
+ generation: z.ZodNumber;
2873
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2874
+ agent: z.ZodOptional<z.ZodObject<{
2875
+ id: z.ZodString;
2876
+ path: z.ZodString;
2877
+ delegationId: z.ZodOptional<z.ZodString>;
2878
+ }, z.core.$strict>>;
2879
+ kind: z.ZodLiteral<"tool">;
2880
+ path: z.ZodString;
2881
+ key: z.ZodString;
2882
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2883
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2884
+ }, z.core.$strict>, z.ZodObject<{
2885
+ actionId: z.ZodString;
2886
+ sessionId: z.ZodString;
2887
+ turnId: z.ZodString;
2888
+ agentId: z.ZodString;
2889
+ manifestHash: z.ZodString;
2890
+ implementationVersion: z.ZodString;
2891
+ input: z.ZodUnknown;
2892
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2893
+ status: z.ZodEnum<{
2894
+ cancelled: "cancelled";
2895
+ completed: "completed";
2896
+ delivering: "delivering";
2897
+ pending: "pending";
2898
+ uncertain: "uncertain";
2899
+ }>;
2900
+ generation: z.ZodNumber;
2901
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2902
+ agent: z.ZodOptional<z.ZodObject<{
2903
+ id: z.ZodString;
2904
+ path: z.ZodString;
2905
+ delegationId: z.ZodOptional<z.ZodString>;
2906
+ }, z.core.$strict>>;
2907
+ kind: z.ZodLiteral<"hook">;
2908
+ hook: z.ZodObject<{
2909
+ at: z.ZodEnum<{
2910
+ after: "after";
2911
+ before: "before";
2912
+ }>;
2913
+ scope: z.ZodEnum<{
2914
+ step: "step";
2915
+ turn: "turn";
2916
+ }>;
2917
+ capabilityIds: z.ZodArray<z.ZodString>;
2918
+ }, z.core.$strict>;
2919
+ }, z.core.$strict>, z.ZodObject<{
2920
+ actionId: z.ZodString;
2921
+ sessionId: z.ZodString;
2922
+ turnId: z.ZodString;
2923
+ agentId: z.ZodString;
2924
+ manifestHash: z.ZodString;
2925
+ implementationVersion: z.ZodString;
2926
+ input: z.ZodUnknown;
2927
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2928
+ status: z.ZodEnum<{
2929
+ cancelled: "cancelled";
2930
+ completed: "completed";
2931
+ delivering: "delivering";
2932
+ pending: "pending";
2933
+ uncertain: "uncertain";
2934
+ }>;
2935
+ generation: z.ZodNumber;
2936
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2937
+ agent: z.ZodOptional<z.ZodObject<{
2938
+ id: z.ZodString;
2939
+ path: z.ZodString;
2940
+ delegationId: z.ZodOptional<z.ZodString>;
2941
+ }, z.core.$strict>>;
2942
+ kind: z.ZodLiteral<"fn">;
2943
+ path: z.ZodString;
2944
+ key: z.ZodString;
2945
+ }, z.core.$strict>, z.ZodObject<{
2946
+ actionId: z.ZodString;
2947
+ sessionId: z.ZodString;
2948
+ turnId: z.ZodString;
2949
+ agentId: z.ZodString;
2950
+ manifestHash: z.ZodString;
2951
+ implementationVersion: z.ZodString;
2952
+ input: z.ZodUnknown;
2953
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2954
+ status: z.ZodEnum<{
2955
+ cancelled: "cancelled";
2956
+ completed: "completed";
2957
+ delivering: "delivering";
2958
+ pending: "pending";
2959
+ uncertain: "uncertain";
2960
+ }>;
2961
+ generation: z.ZodNumber;
2962
+ deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2963
+ agent: z.ZodOptional<z.ZodObject<{
2964
+ id: z.ZodString;
2965
+ path: z.ZodString;
2966
+ delegationId: z.ZodOptional<z.ZodString>;
2967
+ }, z.core.$strict>>;
2968
+ kind: z.ZodLiteral<"verify">;
2969
+ path: z.ZodString;
2970
+ key: z.ZodString;
2971
+ }, z.core.$strict>]>;
2972
+ sandbox: z.ZodBoolean;
2973
+ }, z.core.$strict>, z.ZodObject<{
2974
+ type: z.ZodLiteral<"ping">;
2975
+ agentId: z.ZodString;
2976
+ manifestHash: z.ZodOptional<z.ZodString>;
2977
+ }, z.core.$strict>], "type">;
2978
+ export type ActionDelivery = z.infer<typeof ActionDeliverySchema>;
2979
+ /** An Action endpoint's answer to a ping. */
2980
+ export declare const EndpointPingResponseSchema: z.ZodObject<{
2981
+ agentId: z.ZodString;
2982
+ implementationVersion: z.ZodString;
2983
+ manifestHash: z.ZodOptional<z.ZodString>;
2984
+ }, z.core.$strip>;
2985
+ export type EndpointPingResponse = z.infer<typeof EndpointPingResponseSchema>;
2986
+ /** The answer to a background delivery's heartbeat: a fresh token and the new deadline. */
2987
+ export declare const DeliveryHeartbeatResponseSchema: z.ZodObject<{
2988
+ token: z.ZodString;
2989
+ deadlineAt: z.ZodString;
2990
+ }, z.core.$strip>;
2991
+ export type DeliveryHeartbeatResponse = z.infer<typeof DeliveryHeartbeatResponseSchema>;
2992
+ /**
2993
+ * The receipt of a background result (`POST /v1/actions/:id/result`): a session command's
2994
+ * receipt without `requestId`, since the result carries none. The same result again returns it.
2995
+ */
2996
+ export declare const ActionResultReceiptSchema: z.ZodObject<{
2997
+ status: z.ZodLiteral<"accepted">;
2998
+ turnId: z.ZodNullable<z.ZodString>;
2999
+ cursor: z.ZodNullable<z.ZodString>;
3000
+ }, z.core.$strip>;
3001
+ export type ActionResultReceipt = z.infer<typeof ActionResultReceiptSchema>;
3002
+ /** `POST /_studio/login-tokens` body. No `tenant` mints a Host-wide token (the CLI's `{}`). */
3003
+ export declare const StudioLoginTokenRequestSchema: z.ZodObject<{
3004
+ tenant: z.ZodOptional<z.ZodString>;
3005
+ subject: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
3006
+ }, z.core.$strict>;
3007
+ export type StudioLoginTokenRequest = z.infer<typeof StudioLoginTokenRequestSchema>;
3008
+ export declare const StudioLoginTokenResponseSchema: z.ZodObject<{
3009
+ token: z.ZodString;
3010
+ url: z.ZodString;
3011
+ expiresAt: z.ZodString;
3012
+ tenant: z.ZodNullable<z.ZodString>;
3013
+ subject: z.ZodNullable<z.ZodString>;
3014
+ }, z.core.$strip>;
3015
+ export type StudioLoginTokenResponse = z.infer<typeof StudioLoginTokenResponseSchema>;
3016
+ /** `POST /_studio/sessions` body: the login token an embedder passed in `init`. */
3017
+ export declare const StudioSessionRequestSchema: z.ZodObject<{
3018
+ token: z.ZodString;
3019
+ }, z.core.$strict>;
3020
+ export type StudioSessionRequest = z.infer<typeof StudioSessionRequestSchema>;
3021
+ export declare const StudioSessionResponseSchema: z.ZodObject<{
3022
+ sessionToken: z.ZodString;
3023
+ tenant: z.ZodNullable<z.ZodString>;
3024
+ subject: z.ZodNullable<z.ZodString>;
3025
+ expiresAt: z.ZodString;
3026
+ }, z.core.$strip>;
3027
+ export type StudioSessionResponse = z.infer<typeof StudioSessionResponseSchema>;
3028
+ /** Message protocol versions this release speaks. */
3029
+ export declare const STUDIO_EMBED_PROTOCOLS: readonly [1];
3030
+ export declare const STUDIO_EMBED_MESSAGE_TYPE = "nylorun.studio";
3031
+ /** The embedder's theme. Unknown keys are dropped, not rejected. */
3032
+ export declare const StudioThemeSchema: z.ZodObject<{
3033
+ mode: z.ZodEnum<{
3034
+ dark: "dark";
3035
+ light: "light";
3036
+ }>;
3037
+ accent: z.ZodOptional<z.ZodString>;
3038
+ background: z.ZodOptional<z.ZodString>;
3039
+ foreground: z.ZodOptional<z.ZodString>;
3040
+ }, z.core.$strip>;
3041
+ export type StudioTheme = z.infer<typeof StudioThemeSchema>;
3042
+ /** Every message between an embedder and Studio (Studio design §8.8). */
3043
+ export declare const StudioEmbedMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3044
+ type: z.ZodLiteral<"nylorun.studio">;
3045
+ protocol: z.ZodNumber;
3046
+ kind: z.ZodLiteral<"ready">;
3047
+ protocols: z.ZodArray<z.ZodNumber>;
3048
+ studioVersion: z.ZodString;
3049
+ }, z.core.$strip>, z.ZodObject<{
3050
+ type: z.ZodLiteral<"nylorun.studio">;
3051
+ protocol: z.ZodNumber;
3052
+ kind: z.ZodLiteral<"init">;
3053
+ token: z.ZodString;
3054
+ theme: z.ZodOptional<z.ZodObject<{
3055
+ mode: z.ZodEnum<{
3056
+ dark: "dark";
3057
+ light: "light";
3058
+ }>;
3059
+ accent: z.ZodOptional<z.ZodString>;
3060
+ background: z.ZodOptional<z.ZodString>;
3061
+ foreground: z.ZodOptional<z.ZodString>;
3062
+ }, z.core.$strip>>;
3063
+ route: z.ZodOptional<z.ZodString>;
3064
+ }, z.core.$strip>, z.ZodObject<{
3065
+ type: z.ZodLiteral<"nylorun.studio">;
3066
+ protocol: z.ZodNumber;
3067
+ kind: z.ZodLiteral<"token.refresh">;
3068
+ token: z.ZodString;
3069
+ }, z.core.$strip>, z.ZodObject<{
3070
+ type: z.ZodLiteral<"nylorun.studio">;
3071
+ protocol: z.ZodNumber;
3072
+ kind: z.ZodLiteral<"theme.changed">;
3073
+ theme: z.ZodObject<{
3074
+ mode: z.ZodEnum<{
3075
+ dark: "dark";
3076
+ light: "light";
3077
+ }>;
3078
+ accent: z.ZodOptional<z.ZodString>;
3079
+ background: z.ZodOptional<z.ZodString>;
3080
+ foreground: z.ZodOptional<z.ZodString>;
3081
+ }, z.core.$strip>;
3082
+ }, z.core.$strip>, z.ZodObject<{
3083
+ type: z.ZodLiteral<"nylorun.studio">;
3084
+ protocol: z.ZodNumber;
3085
+ kind: z.ZodLiteral<"navigate">;
3086
+ route: z.ZodString;
3087
+ }, z.core.$strip>, z.ZodObject<{
3088
+ type: z.ZodLiteral<"nylorun.studio">;
3089
+ protocol: z.ZodNumber;
3090
+ kind: z.ZodLiteral<"session">;
3091
+ tenant: z.ZodNullable<z.ZodString>;
3092
+ subject: z.ZodNullable<z.ZodString>;
3093
+ expiresAt: z.ZodString;
3094
+ }, z.core.$strip>, z.ZodObject<{
3095
+ type: z.ZodLiteral<"nylorun.studio">;
3096
+ protocol: z.ZodNumber;
3097
+ kind: z.ZodLiteral<"token.expiring">;
3098
+ expiresAt: z.ZodNullable<z.ZodString>;
3099
+ }, z.core.$strip>, z.ZodObject<{
3100
+ type: z.ZodLiteral<"nylorun.studio">;
3101
+ protocol: z.ZodNumber;
3102
+ kind: z.ZodLiteral<"route.changed">;
3103
+ route: z.ZodString;
3104
+ }, z.core.$strip>, z.ZodObject<{
3105
+ type: z.ZodLiteral<"nylorun.studio">;
3106
+ protocol: z.ZodNumber;
3107
+ kind: z.ZodLiteral<"open.external">;
3108
+ url: z.ZodString;
3109
+ }, z.core.$strip>, z.ZodObject<{
3110
+ type: z.ZodLiteral<"nylorun.studio">;
3111
+ protocol: z.ZodNumber;
3112
+ kind: z.ZodLiteral<"open.babai">;
3113
+ sessionId: z.ZodString;
3114
+ }, z.core.$strip>, z.ZodObject<{
3115
+ type: z.ZodLiteral<"nylorun.studio">;
3116
+ protocol: z.ZodNumber;
3117
+ kind: z.ZodLiteral<"error">;
3118
+ code: z.ZodString;
3119
+ message: z.ZodString;
3120
+ }, z.core.$strip>], "kind">;
3121
+ export type StudioEmbedMessage = z.infer<typeof StudioEmbedMessageSchema>;
3122
+ export type StudioEmbedKind = StudioEmbedMessage["kind"];
3123
+ /** True for one exact embedder origin: `https://…`, `http://…` or `<custom>://host[:port]`. */
3124
+ export declare function isFrameAncestor(value: string): boolean;
3125
+ /**
3126
+ * Parses `NYLORUN_STUDIO_FRAME_ANCESTORS`: exact origins separated by whitespace. Wildcards,
3127
+ * keywords, scheme-only entries and paths are refused with the entry named. Empty gives `[]`.
3128
+ */
3129
+ export declare function parseFrameAncestors(value: string): string[];