@nylorun/core 0.11.0-beta → 0.13.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.
@@ -42,11 +42,293 @@ export declare const SandboxInlineRequestSchema: z.ZodObject<{
42
42
  }, z.core.$strict>>;
43
43
  }, z.core.$strict>;
44
44
  export type SandboxInlineRequest = z.infer<typeof SandboxInlineRequestSchema>;
45
+ export declare const SANDBOX_ID_MAX_LENGTH = 200;
46
+ export declare function isSandboxId(value: unknown): value is string;
47
+ /** A sandbox grant: an exact sandbox id, or a prefix ending in `/*` (`team-a/*`). */
48
+ export declare function isSandboxGrant(value: unknown): value is string;
45
49
  /**
46
- * `PutSessionRequest.sandbox`: `false` for none, `{ session }` to share another session's
47
- * sandbox, or an inline sandbox. Omitted means the Tenant's default.
50
+ * Whether `grants` (a token caller's sandbox grants) reach sandbox `id`: an exact entry, or a prefix
51
+ * entry `p/*` for any id below `p/`. No grants reach no sandbox.
52
+ */
53
+ export declare function sandboxGranted(grants: readonly string[] | undefined, id: string): boolean;
54
+ export declare const SandboxIdSchema: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
55
+ export declare const SandboxGrantSchema: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
56
+ /** `virtual`: a just-bash workspace, no cluster (F7.1). `pod`: an agent-sandbox pod (F7.2). */
57
+ export declare const SANDBOX_KINDS: readonly ["virtual", "pod"];
58
+ export type SandboxKind = (typeof SANDBOX_KINDS)[number];
59
+ export declare const SANDBOX_LABELS_MAX = 32;
60
+ /** The developer's own key-value pairs; the Runtime stores and filters them, never reads them. */
61
+ export declare const SandboxLabelsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
62
+ export type SandboxLabels = z.infer<typeof SandboxLabelsSchema>;
63
+ /**
64
+ * `PUT /v1/sandboxes/{sandboxId}`: creates the sandbox, or finds the one with this id. The spec
65
+ * (`kind`, `image`, `network`, `resources`, `storage`) is checked against the Tenant's limits
66
+ * and fixed once the sandbox exists; `labels`, when sent, replace the sandbox's labels.
67
+ *
68
+ * Kind `pod` (Host feature `sandbox-pods`) is created at once on the Tenant's cluster. A `PUT`
69
+ * on an existing pod sandbox also starts it again when it was stopped, and one with a
70
+ * `lifecycle.ttl` other than its own sets a new expiry (counted from its creation), which
71
+ * revives an expired sandbox.
72
+ */
73
+ export declare const PutSandboxRequestSchema: z.ZodObject<{
74
+ requestId: z.ZodOptional<z.ZodString>;
75
+ kind: z.ZodOptional<z.ZodEnum<{
76
+ pod: "pod";
77
+ virtual: "virtual";
78
+ }>>;
79
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
80
+ image: z.ZodOptional<z.ZodString>;
81
+ network: z.ZodOptional<z.ZodObject<{
82
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
83
+ }, z.core.$strict>>;
84
+ resources: z.ZodOptional<z.ZodObject<{
85
+ cpus: z.ZodOptional<z.ZodNumber>;
86
+ memory: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strict>>;
88
+ storage: z.ZodOptional<z.ZodString>;
89
+ lifecycle: z.ZodOptional<z.ZodObject<{
90
+ ttl: z.ZodOptional<z.ZodString>;
91
+ }, z.core.$strict>>;
92
+ }, z.core.$strict>;
93
+ export type PutSandboxRequest = z.infer<typeof PutSandboxRequestSchema>;
94
+ /** A session attached to a sandbox, as the sandbox's view lists it. */
95
+ export declare const SandboxSessionSchema: z.ZodObject<{
96
+ id: z.ZodString;
97
+ activeTurnId: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strict>;
99
+ /** What the Runtime wants of a pod sandbox (`desired`) and what it last saw (`observed`). */
100
+ export declare const SANDBOX_POD_DESIRED: readonly ["running", "suspended", "deleted"];
101
+ export declare const SANDBOX_POD_OBSERVED: readonly ["creating", "running", "suspended", "expired", "lost", "failed", "deleting"];
102
+ export type SandboxPodDesired = (typeof SANDBOX_POD_DESIRED)[number];
103
+ export type SandboxPodObserved = (typeof SANDBOX_POD_OBSERVED)[number];
104
+ export declare const SandboxPodViewSchema: z.ZodObject<{
105
+ desired: z.ZodEnum<{
106
+ deleted: "deleted";
107
+ running: "running";
108
+ suspended: "suspended";
109
+ }>;
110
+ observed: z.ZodEnum<{
111
+ creating: "creating";
112
+ deleting: "deleting";
113
+ expired: "expired";
114
+ failed: "failed";
115
+ lost: "lost";
116
+ running: "running";
117
+ suspended: "suspended";
118
+ }>;
119
+ volumeGeneration: z.ZodNumber;
120
+ hostEpoch: z.ZodNumber;
121
+ expiresAt: z.ZodOptional<z.ZodString>;
122
+ reason: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strict>;
124
+ export type SandboxPodView = z.infer<typeof SandboxPodViewSchema>;
125
+ /** `PUT` and `GET /v1/sandboxes/{sandboxId}`. */
126
+ export declare const SandboxViewSchema: z.ZodObject<{
127
+ id: z.ZodString;
128
+ kind: z.ZodEnum<{
129
+ pod: "pod";
130
+ virtual: "virtual";
131
+ }>;
132
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
133
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
134
+ state: z.ZodEnum<{
135
+ creating: "creating";
136
+ ready: "ready";
137
+ running: "running";
138
+ stopped: "stopped";
139
+ }>;
140
+ pod: z.ZodOptional<z.ZodObject<{
141
+ desired: z.ZodEnum<{
142
+ deleted: "deleted";
143
+ running: "running";
144
+ suspended: "suspended";
145
+ }>;
146
+ observed: z.ZodEnum<{
147
+ creating: "creating";
148
+ deleting: "deleting";
149
+ expired: "expired";
150
+ failed: "failed";
151
+ lost: "lost";
152
+ running: "running";
153
+ suspended: "suspended";
154
+ }>;
155
+ volumeGeneration: z.ZodNumber;
156
+ hostEpoch: z.ZodNumber;
157
+ expiresAt: z.ZodOptional<z.ZodString>;
158
+ reason: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strict>>;
160
+ sessions: z.ZodArray<z.ZodObject<{
161
+ id: z.ZodString;
162
+ activeTurnId: z.ZodNullable<z.ZodString>;
163
+ }, z.core.$strict>>;
164
+ createdAt: z.ZodString;
165
+ updatedAt: z.ZodString;
166
+ }, z.core.$strict>;
167
+ export type SandboxView = z.infer<typeof SandboxViewSchema>;
168
+ export declare const ListSandboxesResponseSchema: z.ZodObject<{
169
+ sandboxes: z.ZodArray<z.ZodObject<{
170
+ id: z.ZodString;
171
+ kind: z.ZodEnum<{
172
+ pod: "pod";
173
+ virtual: "virtual";
174
+ }>;
175
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
176
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
177
+ state: z.ZodEnum<{
178
+ creating: "creating";
179
+ ready: "ready";
180
+ running: "running";
181
+ stopped: "stopped";
182
+ }>;
183
+ pod: z.ZodOptional<z.ZodObject<{
184
+ desired: z.ZodEnum<{
185
+ deleted: "deleted";
186
+ running: "running";
187
+ suspended: "suspended";
188
+ }>;
189
+ observed: z.ZodEnum<{
190
+ creating: "creating";
191
+ deleting: "deleting";
192
+ expired: "expired";
193
+ failed: "failed";
194
+ lost: "lost";
195
+ running: "running";
196
+ suspended: "suspended";
197
+ }>;
198
+ volumeGeneration: z.ZodNumber;
199
+ hostEpoch: z.ZodNumber;
200
+ expiresAt: z.ZodOptional<z.ZodString>;
201
+ reason: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>>;
203
+ sessions: z.ZodArray<z.ZodObject<{
204
+ id: z.ZodString;
205
+ activeTurnId: z.ZodNullable<z.ZodString>;
206
+ }, z.core.$strict>>;
207
+ createdAt: z.ZodString;
208
+ updatedAt: z.ZodString;
209
+ }, z.core.$strict>>;
210
+ }, z.core.$strict>;
211
+ export type ListSandboxesResponse = z.infer<typeof ListSandboxesResponseSchema>;
212
+ export declare const DeleteSandboxResponseSchema: z.ZodObject<{
213
+ id: z.ZodString;
214
+ deleted: z.ZodBoolean;
215
+ }, z.core.$strict>;
216
+ export type DeleteSandboxResponse = z.infer<typeof DeleteSandboxResponseSchema>;
217
+ /** The schema id of a sandbox's lifecycle events (its stream in the record). */
218
+ export declare const SANDBOX_EVENT_SCHEMA = "nylorun.sandbox-event/1";
219
+ export declare const SANDBOX_EVENT_TYPES: readonly ["sandbox.created", "sandbox.attached", "sandbox.detached", "sandbox.deleted", "sandbox.running", "sandbox.suspended", "sandbox.expired", "sandbox.relaunched", "sandbox.lost", "sandbox.reset", "sandbox.failed"];
220
+ export type SandboxEventType = (typeof SANDBOX_EVENT_TYPES)[number];
221
+ /** The payload of each sandbox lifecycle event. */
222
+ export declare const SANDBOX_EVENT_PAYLOADS: {
223
+ readonly "sandbox.created": z.ZodObject<{
224
+ kind: z.ZodEnum<{
225
+ pod: "pod";
226
+ virtual: "virtual";
227
+ }>;
228
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
229
+ }, z.core.$loose>;
230
+ readonly "sandbox.attached": z.ZodObject<{
231
+ sessionId: z.ZodString;
232
+ }, z.core.$loose>;
233
+ readonly "sandbox.detached": z.ZodObject<{
234
+ sessionId: z.ZodString;
235
+ reason: z.ZodEnum<{
236
+ reset: "reset";
237
+ }>;
238
+ }, z.core.$loose>;
239
+ readonly "sandbox.deleted": z.ZodObject<{}, z.core.$loose>;
240
+ /** A pod joined and serves the sandbox. */
241
+ readonly "sandbox.running": z.ZodObject<{
242
+ hostEpoch: z.ZodNumber;
243
+ }, z.core.$loose>;
244
+ /** Stopped (`POST .../stop`, or idle): the volume is kept; the next turn starts it again. */
245
+ readonly "sandbox.suspended": z.ZodObject<{
246
+ reason: z.ZodEnum<{
247
+ idle: "idle";
248
+ stop: "stop";
249
+ }>;
250
+ }, z.core.$loose>;
251
+ /** Its TTL passed: turns are refused until a `PUT` sets a longer TTL. */
252
+ readonly "sandbox.expired": z.ZodObject<{
253
+ onExpiry: z.ZodEnum<{
254
+ delete: "delete";
255
+ retain: "retain";
256
+ }>;
257
+ }, z.core.$loose>;
258
+ /** Its pod was replaced (same volume): the old pod's host token no longer works. */
259
+ readonly "sandbox.relaunched": z.ZodObject<{
260
+ hostEpoch: z.ZodNumber;
261
+ }, z.core.$loose>;
262
+ /** Its volume or node is gone: turns are refused until a reset. */
263
+ readonly "sandbox.lost": z.ZodObject<{
264
+ reason: z.ZodString;
265
+ }, z.core.$loose>;
266
+ /** Reset: a new pod on a new, empty volume. */
267
+ readonly "sandbox.reset": z.ZodObject<{
268
+ volumeGeneration: z.ZodNumber;
269
+ }, z.core.$loose>;
270
+ /** The pod did not become ready. */
271
+ readonly "sandbox.failed": z.ZodObject<{
272
+ reason: z.ZodString;
273
+ }, z.core.$loose>;
274
+ };
275
+ export type SandboxEventPayload<T extends SandboxEventType> = z.infer<(typeof SANDBOX_EVENT_PAYLOADS)[T]>;
276
+ /** One lifecycle event on a sandbox's stream, numbered from 0. */
277
+ export declare const SandboxEventSchema: z.ZodObject<{
278
+ schema: z.ZodLiteral<"nylorun.sandbox-event/1">;
279
+ eventId: z.ZodString;
280
+ tenantId: z.ZodString;
281
+ sandboxId: z.ZodString;
282
+ seq: z.ZodNumber;
283
+ time: z.ZodString;
284
+ type: z.ZodEnum<{
285
+ "sandbox.attached": "sandbox.attached";
286
+ "sandbox.created": "sandbox.created";
287
+ "sandbox.deleted": "sandbox.deleted";
288
+ "sandbox.detached": "sandbox.detached";
289
+ "sandbox.expired": "sandbox.expired";
290
+ "sandbox.failed": "sandbox.failed";
291
+ "sandbox.lost": "sandbox.lost";
292
+ "sandbox.relaunched": "sandbox.relaunched";
293
+ "sandbox.reset": "sandbox.reset";
294
+ "sandbox.running": "sandbox.running";
295
+ "sandbox.suspended": "sandbox.suspended";
296
+ }>;
297
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
298
+ }, z.core.$strict>;
299
+ export type SandboxEvent = z.infer<typeof SandboxEventSchema>;
300
+ export declare const ListSandboxEventsResponseSchema: z.ZodObject<{
301
+ events: z.ZodArray<z.ZodObject<{
302
+ schema: z.ZodLiteral<"nylorun.sandbox-event/1">;
303
+ eventId: z.ZodString;
304
+ tenantId: z.ZodString;
305
+ sandboxId: z.ZodString;
306
+ seq: z.ZodNumber;
307
+ time: z.ZodString;
308
+ type: z.ZodEnum<{
309
+ "sandbox.attached": "sandbox.attached";
310
+ "sandbox.created": "sandbox.created";
311
+ "sandbox.deleted": "sandbox.deleted";
312
+ "sandbox.detached": "sandbox.detached";
313
+ "sandbox.expired": "sandbox.expired";
314
+ "sandbox.failed": "sandbox.failed";
315
+ "sandbox.lost": "sandbox.lost";
316
+ "sandbox.relaunched": "sandbox.relaunched";
317
+ "sandbox.reset": "sandbox.reset";
318
+ "sandbox.running": "sandbox.running";
319
+ "sandbox.suspended": "sandbox.suspended";
320
+ }>;
321
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
322
+ }, z.core.$strict>>;
323
+ }, z.core.$strict>;
324
+ /**
325
+ * `PutSessionRequest.sandbox`: `false` for none, `{ id }` to attach a sandbox resource (Host
326
+ * feature `sandboxes`), `{ session }` to share another session's sandbox, or an inline sandbox.
327
+ * Omitted means the Tenant's default.
48
328
  */
49
329
  export declare const SandboxRequestSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
330
+ id: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
331
+ }, z.core.$strict>, z.ZodObject<{
50
332
  session: z.ZodString;
51
333
  }, z.core.$strict>, z.ZodObject<{
52
334
  image: z.ZodOptional<z.ZodString>;
@@ -70,6 +352,8 @@ export declare const PutSessionRequestSchema: z.ZodObject<{
70
352
  credentialId: z.ZodString;
71
353
  }, z.core.$strict>>>;
72
354
  sandbox: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
355
+ id: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
356
+ }, z.core.$strict>, z.ZodObject<{
73
357
  session: z.ZodString;
74
358
  }, z.core.$strict>, z.ZodObject<{
75
359
  image: z.ZodOptional<z.ZodString>;
@@ -82,6 +366,9 @@ export declare const PutSessionRequestSchema: z.ZodObject<{
82
366
  }, z.core.$strict>>;
83
367
  }, z.core.$strict>]>>;
84
368
  }, z.core.$strict>;
369
+ /** The hosts a harness can run on (blueprint D38). */
370
+ export declare const SANDBOX_PLACEMENT_HOSTS: readonly ["harness-container", "sandbox"];
371
+ export type SandboxPlacementHost = (typeof SANDBOX_PLACEMENT_HOSTS)[number];
85
372
  /**
86
373
  * A Tenant's sandbox configuration (Tenant setting `sandbox.config`): what a session gets when
87
374
  * it names no sandbox, and the limits every session's sandbox must fit.
@@ -108,7 +395,22 @@ export declare const TenantSandboxConfigSchema: z.ZodObject<{
108
395
  memory: z.ZodOptional<z.ZodString>;
109
396
  }, z.core.$strict>>;
110
397
  idle: z.ZodOptional<z.ZodString>;
398
+ sandboxes: z.ZodOptional<z.ZodNumber>;
399
+ ttl: z.ZodOptional<z.ZodString>;
111
400
  }, z.core.$strict>>;
401
+ lifecycle: z.ZodOptional<z.ZodObject<{
402
+ onExpiry: z.ZodOptional<z.ZodEnum<{
403
+ delete: "delete";
404
+ retain: "retain";
405
+ }>>;
406
+ stopGrace: z.ZodOptional<z.ZodString>;
407
+ }, z.core.$strict>>;
408
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
409
+ hosts: z.ZodArray<z.ZodEnum<{
410
+ "harness-container": "harness-container";
411
+ sandbox: "sandbox";
412
+ }>>;
413
+ }, z.core.$strict>>>;
112
414
  }, z.core.$strict>;
113
415
  export type TenantSandboxConfig = z.infer<typeof TenantSandboxConfigSchema>;
114
416
  /** `PUT /v1/tenant/sandbox`: replaces the Tenant's sandbox configuration. */
@@ -134,16 +436,37 @@ export declare const PutTenantSandboxRequestSchema: z.ZodObject<{
134
436
  memory: z.ZodOptional<z.ZodString>;
135
437
  }, z.core.$strict>>;
136
438
  idle: z.ZodOptional<z.ZodString>;
439
+ sandboxes: z.ZodOptional<z.ZodNumber>;
440
+ ttl: z.ZodOptional<z.ZodString>;
137
441
  }, z.core.$strict>>;
442
+ lifecycle: z.ZodOptional<z.ZodObject<{
443
+ onExpiry: z.ZodOptional<z.ZodEnum<{
444
+ delete: "delete";
445
+ retain: "retain";
446
+ }>>;
447
+ stopGrace: z.ZodOptional<z.ZodString>;
448
+ }, z.core.$strict>>;
449
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
450
+ hosts: z.ZodArray<z.ZodEnum<{
451
+ "harness-container": "harness-container";
452
+ sandbox: "sandbox";
453
+ }>>;
454
+ }, z.core.$strict>>>;
138
455
  requestId: z.ZodOptional<z.ZodString>;
139
456
  }, z.core.$strict>;
140
457
  export type PutTenantSandboxRequest = z.infer<typeof PutTenantSandboxRequestSchema>;
141
458
  export type PutSessionRequest = z.infer<typeof PutSessionRequestSchema>;
459
+ /** The owner of every installation vault (`scope: "installation"`); a reserved subject. */
460
+ export declare const INSTALLATION_OWNER = "installation";
142
461
  export declare const CreateVaultRequestSchema: z.ZodObject<{
143
462
  requestId: z.ZodString;
144
463
  idempotencyKey: z.ZodString;
145
464
  name: z.ZodString;
146
- ownerUserId: z.ZodString;
465
+ scope: z.ZodOptional<z.ZodEnum<{
466
+ installation: "installation";
467
+ user: "user";
468
+ }>>;
469
+ ownerUserId: z.ZodOptional<z.ZodString>;
147
470
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
148
471
  }, z.core.$strict>;
149
472
  export type CreateVaultRequest = z.infer<typeof CreateVaultRequestSchema>;
@@ -269,7 +592,26 @@ export declare const CredentialInfoSchema: z.ZodObject<{
269
592
  rotatedAt: z.ZodOptional<z.ZodString>;
270
593
  }, z.core.$strict>;
271
594
  export type CredentialInfo = z.infer<typeof CredentialInfoSchema>;
272
- /** Exactly one of `content` or `data`. Optional `manifest` for per-turn agent patches. */
595
+ /** The most parts one message may carry (protocol 6). */
596
+ export declare const MAX_MESSAGE_PARTS = 32;
597
+ /**
598
+ * One part of a user message (protocol 6): text, or a file by artifact id. A file part without
599
+ * `version` means the artifact's latest version when the message is accepted; the Runtime pins
600
+ * it then. The model reads an image as an image, a text file as text, and refuses other files.
601
+ */
602
+ export declare const MessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
603
+ type: z.ZodLiteral<"text">;
604
+ text: z.ZodString;
605
+ }, z.core.$strict>, z.ZodObject<{
606
+ type: z.ZodLiteral<"file">;
607
+ artifactId: z.ZodString;
608
+ version: z.ZodOptional<z.ZodNumber>;
609
+ }, z.core.$strict>], "type">;
610
+ export type MessagePart = z.infer<typeof MessagePartSchema>;
611
+ /**
612
+ * Exactly one of `content`, `data` or `parts` (protocol 6). Optional `manifest` for per-turn
613
+ * agent patches.
614
+ */
273
615
  export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
274
616
  requestId: z.ZodString;
275
617
  idempotencyKey: z.ZodString;
@@ -282,6 +624,19 @@ export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
282
624
  type: z.ZodLiteral<"message">;
283
625
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
284
626
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
627
+ }, z.core.$strict>, z.ZodObject<{
628
+ requestId: z.ZodString;
629
+ idempotencyKey: z.ZodString;
630
+ type: z.ZodLiteral<"message">;
631
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
632
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
633
+ type: z.ZodLiteral<"text">;
634
+ text: z.ZodString;
635
+ }, z.core.$strict>, z.ZodObject<{
636
+ type: z.ZodLiteral<"file">;
637
+ artifactId: z.ZodString;
638
+ version: z.ZodOptional<z.ZodNumber>;
639
+ }, z.core.$strict>], "type">>;
285
640
  }, z.core.$strict>]>;
286
641
  export declare const ActionOutcomeSchema: z.ZodObject<{
287
642
  value: z.ZodUnknown;
@@ -300,6 +655,19 @@ export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
300
655
  type: z.ZodLiteral<"message">;
301
656
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
302
657
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
658
+ }, z.core.$strict>, z.ZodObject<{
659
+ requestId: z.ZodString;
660
+ idempotencyKey: z.ZodString;
661
+ type: z.ZodLiteral<"message">;
662
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
663
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
664
+ type: z.ZodLiteral<"text">;
665
+ text: z.ZodString;
666
+ }, z.core.$strict>, z.ZodObject<{
667
+ type: z.ZodLiteral<"file">;
668
+ artifactId: z.ZodString;
669
+ version: z.ZodOptional<z.ZodNumber>;
670
+ }, z.core.$strict>], "type">>;
303
671
  }, z.core.$strict>]>, z.ZodObject<{
304
672
  requestId: z.ZodString;
305
673
  idempotencyKey: z.ZodString;
@@ -330,6 +698,19 @@ export declare const SessionEventBodySchema: z.ZodUnion<readonly [z.ZodUnion<rea
330
698
  type: z.ZodLiteral<"message">;
331
699
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
332
700
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
701
+ }, z.core.$strict>, z.ZodObject<{
702
+ requestId: z.ZodString;
703
+ idempotencyKey: z.ZodString;
704
+ type: z.ZodLiteral<"message">;
705
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
706
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
707
+ type: z.ZodLiteral<"text">;
708
+ text: z.ZodString;
709
+ }, z.core.$strict>, z.ZodObject<{
710
+ type: z.ZodLiteral<"file">;
711
+ artifactId: z.ZodString;
712
+ version: z.ZodOptional<z.ZodNumber>;
713
+ }, z.core.$strict>], "type">>;
333
714
  }, z.core.$strict>]>, z.ZodObject<{
334
715
  requestId: z.ZodString;
335
716
  idempotencyKey: z.ZodString;
@@ -522,11 +903,21 @@ export declare const RejectedResponseSchema: z.ZodObject<{
522
903
  incompatible_host: "incompatible_host";
523
904
  internal_error: "internal_error";
524
905
  invalid_request: "invalid_request";
906
+ issuer_unavailable: "issuer_unavailable";
525
907
  limit_exceeded: "limit_exceeded";
526
908
  not_found: "not_found";
909
+ oauth_client_required: "oauth_client_required";
910
+ oauth_failed: "oauth_failed";
911
+ oauth_state_invalid: "oauth_state_invalid";
527
912
  origin_rejected: "origin_rejected";
913
+ placement_refused: "placement_refused";
528
914
  protocol_unsupported: "protocol_unsupported";
529
915
  request_rejected: "request_rejected";
916
+ sandbox_busy: "sandbox_busy";
917
+ sandbox_expired: "sandbox_expired";
918
+ sandbox_lost: "sandbox_lost";
919
+ sandbox_not_granted: "sandbox_not_granted";
920
+ sandbox_unavailable: "sandbox_unavailable";
530
921
  scope_required: "scope_required";
531
922
  subject_invalid: "subject_invalid";
532
923
  subject_required: "subject_required";
@@ -1005,6 +1396,14 @@ export declare const CommandMessagePayloadSchema: z.ZodObject<{
1005
1396
  type: z.ZodLiteral<"message">;
1006
1397
  content: z.ZodOptional<z.ZodString>;
1007
1398
  data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1399
+ parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1400
+ type: z.ZodLiteral<"text">;
1401
+ text: z.ZodString;
1402
+ }, z.core.$strict>, z.ZodObject<{
1403
+ type: z.ZodLiteral<"file">;
1404
+ artifactId: z.ZodString;
1405
+ version: z.ZodOptional<z.ZodNumber>;
1406
+ }, z.core.$strict>], "type">>>;
1008
1407
  manifest: z.ZodOptional<z.ZodUnknown>;
1009
1408
  }, z.core.$loose>;
1010
1409
  /** `command.approve`: an answer to an approval interaction. */
@@ -1057,6 +1456,13 @@ export declare const SandboxStatePayloadSchema: z.ZodObject<{
1057
1456
  note: z.ZodOptional<z.ZodString>;
1058
1457
  error: z.ZodOptional<z.ZodString>;
1059
1458
  }, z.core.$loose>;
1459
+ /**
1460
+ * `sandbox.attached`: the session was opened on a sandbox resource (`sandbox: { id }`). The
1461
+ * sandbox's own stream records the same attachment.
1462
+ */
1463
+ export declare const SandboxAttachedPayloadSchema: z.ZodObject<{
1464
+ sandboxId: z.ZodString;
1465
+ }, z.core.$loose>;
1060
1466
  /** `sandbox.exec`: one sandbox tool call finished. */
1061
1467
  export declare const SandboxExecPayloadSchema: z.ZodObject<{
1062
1468
  tool: z.ZodString;
@@ -1118,6 +1524,88 @@ export declare const TranscriptUpdatedPayloadSchema: z.ZodObject<{
1118
1524
  entries: z.ZodArray<z.ZodUnknown>;
1119
1525
  length: z.ZodNumber;
1120
1526
  }, z.core.$loose>;
1527
+ /**
1528
+ * Where an artifact version's bytes came from: a client's upload, our engine's `save_artifact`,
1529
+ * or the turn-end export of a sandbox's outputs (F8.2), whose listing and bytes the harness
1530
+ * holding the workspace supplied.
1531
+ */
1532
+ export declare const ArtifactSourceSchema: z.ZodEnum<{
1533
+ engine: "engine";
1534
+ export: "export";
1535
+ upload: "upload";
1536
+ }>;
1537
+ export type ArtifactSource = z.infer<typeof ArtifactSourceSchema>;
1538
+ /**
1539
+ * What an artifact holds: one file, or a folder (F8.2), whose versions are manifests of paths to
1540
+ * content-addressed files.
1541
+ */
1542
+ export declare const ArtifactKindSchema: z.ZodEnum<{
1543
+ file: "file";
1544
+ folder: "folder";
1545
+ }>;
1546
+ export type ArtifactKind = z.infer<typeof ArtifactKindSchema>;
1547
+ /**
1548
+ * `artifact.created` and `artifact.version.created` (protocol 6): a file or folder artifact of the
1549
+ * session, or a new version of one, committed. Ids, sizes and hashes, never bytes. A folder's
1550
+ * `size` is the sum of its files' and its `sha256` is its manifest's.
1551
+ */
1552
+ export declare const ArtifactVersionPayloadSchema: z.ZodObject<{
1553
+ artifactId: z.ZodString;
1554
+ kind: z.ZodEnum<{
1555
+ file: "file";
1556
+ folder: "folder";
1557
+ }>;
1558
+ name: z.ZodString;
1559
+ contentType: z.ZodString;
1560
+ version: z.ZodNumber;
1561
+ size: z.ZodNumber;
1562
+ sha256: z.ZodString;
1563
+ source: z.ZodEnum<{
1564
+ engine: "engine";
1565
+ export: "export";
1566
+ upload: "upload";
1567
+ }>;
1568
+ callId: z.ZodOptional<z.ZodString>;
1569
+ fileCount: z.ZodOptional<z.ZodNumber>;
1570
+ claimed: z.ZodOptional<z.ZodBoolean>;
1571
+ }, z.core.$loose>;
1572
+ /** `artifact.deleted`: the artifact and every version of it are gone. */
1573
+ export declare const ArtifactDeletedPayloadSchema: z.ZodObject<{
1574
+ artifactId: z.ZodString;
1575
+ name: z.ZodString;
1576
+ }, z.core.$loose>;
1577
+ /** Why a turn-end export stored nothing although the sandbox had outputs (F8.2). */
1578
+ export declare const ArtifactExportSkipReasonSchema: z.ZodEnum<{
1579
+ file_too_large: "file_too_large";
1580
+ tenant_total: "tenant_total";
1581
+ too_large: "too_large";
1582
+ too_many_files: "too_many_files";
1583
+ }>;
1584
+ export type ArtifactExportSkipReason = z.infer<typeof ArtifactExportSkipReasonSchema>;
1585
+ /**
1586
+ * `artifact.export.skipped`: the turn's outputs were past a limit, so no folder version was
1587
+ * written. The turn itself completed.
1588
+ */
1589
+ export declare const ArtifactExportSkippedPayloadSchema: z.ZodObject<{
1590
+ name: z.ZodString;
1591
+ reason: z.ZodEnum<{
1592
+ file_too_large: "file_too_large";
1593
+ tenant_total: "tenant_total";
1594
+ too_large: "too_large";
1595
+ too_many_files: "too_many_files";
1596
+ }>;
1597
+ message: z.ZodString;
1598
+ limit: z.ZodOptional<z.ZodNumber>;
1599
+ path: z.ZodOptional<z.ZodString>;
1600
+ }, z.core.$loose>;
1601
+ /**
1602
+ * `artifact.export.failed`: the turn-end export could not finish (the sandbox or the Object store
1603
+ * failed). The turn itself completed; the next turn exports again.
1604
+ */
1605
+ export declare const ArtifactExportFailedPayloadSchema: z.ZodObject<{
1606
+ name: z.ZodString;
1607
+ message: z.ZodString;
1608
+ }, z.core.$loose>;
1121
1609
  /**
1122
1610
  * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1123
1611
  * payload schema version and who writes it. A type not listed here cannot be written. A type
@@ -1136,6 +1624,14 @@ export declare const EVENT_CATALOG: {
1136
1624
  type: z.ZodLiteral<"message">;
1137
1625
  content: z.ZodOptional<z.ZodString>;
1138
1626
  data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1627
+ parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1628
+ type: z.ZodLiteral<"text">;
1629
+ text: z.ZodString;
1630
+ }, z.core.$strict>, z.ZodObject<{
1631
+ type: z.ZodLiteral<"file">;
1632
+ artifactId: z.ZodString;
1633
+ version: z.ZodOptional<z.ZodNumber>;
1634
+ }, z.core.$strict>], "type">>>;
1139
1635
  manifest: z.ZodOptional<z.ZodUnknown>;
1140
1636
  }, z.core.$loose>;
1141
1637
  readonly source: "api";
@@ -1415,6 +1911,13 @@ export declare const EVENT_CATALOG: {
1415
1911
  readonly source: "loop";
1416
1912
  readonly version: 1;
1417
1913
  };
1914
+ readonly "sandbox.attached": {
1915
+ readonly payload: z.ZodObject<{
1916
+ sandboxId: z.ZodString;
1917
+ }, z.core.$loose>;
1918
+ readonly source: "api";
1919
+ readonly version: 1;
1920
+ };
1418
1921
  readonly "node.started": {
1419
1922
  readonly payload: z.ZodObject<{
1420
1923
  path: z.ZodString;
@@ -1470,6 +1973,86 @@ export declare const EVENT_CATALOG: {
1470
1973
  readonly source: "api";
1471
1974
  readonly version: 1;
1472
1975
  };
1976
+ readonly "artifact.created": {
1977
+ readonly payload: z.ZodObject<{
1978
+ artifactId: z.ZodString;
1979
+ kind: z.ZodEnum<{
1980
+ file: "file";
1981
+ folder: "folder";
1982
+ }>;
1983
+ name: z.ZodString;
1984
+ contentType: z.ZodString;
1985
+ version: z.ZodNumber;
1986
+ size: z.ZodNumber;
1987
+ sha256: z.ZodString;
1988
+ source: z.ZodEnum<{
1989
+ engine: "engine";
1990
+ export: "export";
1991
+ upload: "upload";
1992
+ }>;
1993
+ callId: z.ZodOptional<z.ZodString>;
1994
+ fileCount: z.ZodOptional<z.ZodNumber>;
1995
+ claimed: z.ZodOptional<z.ZodBoolean>;
1996
+ }, z.core.$loose>;
1997
+ readonly source: "api";
1998
+ readonly version: 1;
1999
+ };
2000
+ readonly "artifact.version.created": {
2001
+ readonly payload: z.ZodObject<{
2002
+ artifactId: z.ZodString;
2003
+ kind: z.ZodEnum<{
2004
+ file: "file";
2005
+ folder: "folder";
2006
+ }>;
2007
+ name: z.ZodString;
2008
+ contentType: z.ZodString;
2009
+ version: z.ZodNumber;
2010
+ size: z.ZodNumber;
2011
+ sha256: z.ZodString;
2012
+ source: z.ZodEnum<{
2013
+ engine: "engine";
2014
+ export: "export";
2015
+ upload: "upload";
2016
+ }>;
2017
+ callId: z.ZodOptional<z.ZodString>;
2018
+ fileCount: z.ZodOptional<z.ZodNumber>;
2019
+ claimed: z.ZodOptional<z.ZodBoolean>;
2020
+ }, z.core.$loose>;
2021
+ readonly source: "api";
2022
+ readonly version: 1;
2023
+ };
2024
+ readonly "artifact.deleted": {
2025
+ readonly payload: z.ZodObject<{
2026
+ artifactId: z.ZodString;
2027
+ name: z.ZodString;
2028
+ }, z.core.$loose>;
2029
+ readonly source: "api";
2030
+ readonly version: 1;
2031
+ };
2032
+ readonly "artifact.export.skipped": {
2033
+ readonly payload: z.ZodObject<{
2034
+ name: z.ZodString;
2035
+ reason: z.ZodEnum<{
2036
+ file_too_large: "file_too_large";
2037
+ tenant_total: "tenant_total";
2038
+ too_large: "too_large";
2039
+ too_many_files: "too_many_files";
2040
+ }>;
2041
+ message: z.ZodString;
2042
+ limit: z.ZodOptional<z.ZodNumber>;
2043
+ path: z.ZodOptional<z.ZodString>;
2044
+ }, z.core.$loose>;
2045
+ readonly source: "api";
2046
+ readonly version: 1;
2047
+ };
2048
+ readonly "artifact.export.failed": {
2049
+ readonly payload: z.ZodObject<{
2050
+ name: z.ZodString;
2051
+ message: z.ZodString;
2052
+ }, z.core.$loose>;
2053
+ readonly source: "api";
2054
+ readonly version: 1;
2055
+ };
1473
2056
  readonly "transcript.updated": {
1474
2057
  readonly payload: z.ZodObject<{
1475
2058
  keep: z.ZodNumber;
@@ -1500,7 +2083,7 @@ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
1500
2083
  /** One schema per event type, keyed by type (the OpenAPI components). */
1501
2084
  export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
1502
2085
  /** A session event of a known type, discriminated on `type`. */
1503
- 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" | "transcript.updated" | "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" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">;
2086
+ export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "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.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "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.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">;
1504
2087
  export type SessionEvent = {
1505
2088
  [T in EventType]: z.infer<EventSchemaOf<T>>;
1506
2089
  }[EventType];
@@ -1515,7 +2098,7 @@ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
1515
2098
  */
1516
2099
  export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
1517
2100
  export declare const SessionItemsResponseSchema: z.ZodObject<{
1518
- 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" | "transcript.updated" | "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" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
2101
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "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.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "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.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
1519
2102
  cursor: z.ZodNullable<z.ZodString>;
1520
2103
  }, z.core.$strip>;
1521
2104
  export type SessionItemsResponse = {
@@ -1637,6 +2220,20 @@ export declare const StreamRelayStatusSchema: z.ZodObject<{
1637
2220
  lagBytes: z.ZodOptional<z.ZodNumber>;
1638
2221
  }, z.core.$strict>;
1639
2222
  export type StreamRelayStatus = z.infer<typeof StreamRelayStatusSchema>;
2223
+ /**
2224
+ * The Tenant's harnesses (F6.2): `in-process` runs one in core's process; `remote` waits for
2225
+ * harnesses on the Harness API listener. `workspace` says one that serves the Tenant's
2226
+ * workspaces is connected.
2227
+ */
2228
+ export declare const HarnessStatusSchema: z.ZodObject<{
2229
+ mode: z.ZodEnum<{
2230
+ "in-process": "in-process";
2231
+ remote: "remote";
2232
+ }>;
2233
+ connected: z.ZodNumber;
2234
+ workspace: z.ZodBoolean;
2235
+ }, z.core.$strict>;
2236
+ export type HarnessStatus = z.infer<typeof HarnessStatusSchema>;
1640
2237
  export declare const HostAggregateSchema: z.ZodObject<{
1641
2238
  runningSessions: z.ZodNumber;
1642
2239
  inFlightDeliveries: z.ZodNumber;
@@ -1651,6 +2248,14 @@ export declare const HostAggregateSchema: z.ZodObject<{
1651
2248
  lastError: z.ZodNullable<z.ZodString>;
1652
2249
  lagBytes: z.ZodOptional<z.ZodNumber>;
1653
2250
  }, z.core.$strict>>;
2251
+ harness: z.ZodOptional<z.ZodObject<{
2252
+ mode: z.ZodEnum<{
2253
+ "in-process": "in-process";
2254
+ remote: "remote";
2255
+ }>;
2256
+ connected: z.ZodNumber;
2257
+ workspace: z.ZodBoolean;
2258
+ }, z.core.$strict>>;
1654
2259
  }, z.core.$strict>;
1655
2260
  export type HostAggregate = z.infer<typeof HostAggregateSchema>;
1656
2261
  export declare const AdminHostStatusSchema: z.ZodObject<{
@@ -1706,6 +2311,14 @@ export declare const AdminHostStatusSchema: z.ZodObject<{
1706
2311
  lastError: z.ZodNullable<z.ZodString>;
1707
2312
  lagBytes: z.ZodOptional<z.ZodNumber>;
1708
2313
  }, z.core.$strict>>;
2314
+ harness: z.ZodOptional<z.ZodObject<{
2315
+ mode: z.ZodEnum<{
2316
+ "in-process": "in-process";
2317
+ remote: "remote";
2318
+ }>;
2319
+ connected: z.ZodNumber;
2320
+ workspace: z.ZodBoolean;
2321
+ }, z.core.$strict>>;
1709
2322
  }, z.core.$strict>;
1710
2323
  }, z.core.$strict>;
1711
2324
  export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
@@ -1761,6 +2374,14 @@ export declare const AdminStatusSchema: z.ZodObject<{
1761
2374
  lastError: z.ZodNullable<z.ZodString>;
1762
2375
  lagBytes: z.ZodOptional<z.ZodNumber>;
1763
2376
  }, z.core.$strict>>;
2377
+ harness: z.ZodOptional<z.ZodObject<{
2378
+ mode: z.ZodEnum<{
2379
+ "in-process": "in-process";
2380
+ remote: "remote";
2381
+ }>;
2382
+ connected: z.ZodNumber;
2383
+ workspace: z.ZodBoolean;
2384
+ }, z.core.$strict>>;
1764
2385
  }, z.core.$strict>;
1765
2386
  host: z.ZodOptional<z.ZodObject<{
1766
2387
  hostId: z.ZodString;
@@ -1769,6 +2390,40 @@ export declare const AdminStatusSchema: z.ZodObject<{
1769
2390
  }, z.core.$strict>>;
1770
2391
  }, z.core.$strict>;
1771
2392
  export type AdminStatus = z.infer<typeof AdminStatusSchema>;
2393
+ /**
2394
+ * An operator key (Host feature `operator-keys`): a revocable application key of the Tenant,
2395
+ * named by its id (`APPLICATION_KEY_ID_PATTERN`). The Runtime keeps only its hash.
2396
+ */
2397
+ export declare const OperatorKeySchema: z.ZodObject<{
2398
+ id: z.ZodString;
2399
+ role: z.ZodString;
2400
+ createdAt: z.ZodString;
2401
+ }, z.core.$strict>;
2402
+ export type OperatorKey = z.infer<typeof OperatorKeySchema>;
2403
+ /** `GET /v1/admin/keys`: every key of the Tenant (Studio's and derived ones too), by id. */
2404
+ export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
2405
+ keys: z.ZodArray<z.ZodObject<{
2406
+ id: z.ZodString;
2407
+ role: z.ZodString;
2408
+ createdAt: z.ZodString;
2409
+ }, z.core.$strict>>;
2410
+ }, z.core.$strict>;
2411
+ export type ListOperatorKeysResponse = z.infer<typeof ListOperatorKeysResponseSchema>;
2412
+ /** `PUT /v1/admin/keys/{id}`: the new key, shown this once; `rotated` when it replaced one. */
2413
+ export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
2414
+ id: z.ZodString;
2415
+ role: z.ZodString;
2416
+ createdAt: z.ZodString;
2417
+ key: z.ZodString;
2418
+ rotated: z.ZodBoolean;
2419
+ }, z.core.$strict>;
2420
+ export type PutOperatorKeyResponse = z.infer<typeof PutOperatorKeyResponseSchema>;
2421
+ /** `DELETE /v1/admin/keys/{id}`: the key no longer authenticates. */
2422
+ export declare const DeleteOperatorKeyResponseSchema: z.ZodObject<{
2423
+ id: z.ZodString;
2424
+ deleted: z.ZodLiteral<true>;
2425
+ }, z.core.$strict>;
2426
+ export type DeleteOperatorKeyResponse = z.infer<typeof DeleteOperatorKeyResponseSchema>;
1772
2427
  /**
1773
2428
  * `.nylorun/link.json`: the installation a Project uses. Format 3 names the local `tenant`
1774
2429
  * that `nylorun start` created or attached; `tenantId` is information only, since nothing in a
@@ -1856,6 +2511,14 @@ export declare const TenantStatusSchema: z.ZodObject<{
1856
2511
  backend: z.ZodNullable<z.ZodString>;
1857
2512
  retained: z.ZodNumber;
1858
2513
  }, z.core.$strict>;
2514
+ harness: z.ZodOptional<z.ZodObject<{
2515
+ mode: z.ZodEnum<{
2516
+ "in-process": "in-process";
2517
+ remote: "remote";
2518
+ }>;
2519
+ connected: z.ZodNumber;
2520
+ workspace: z.ZodBoolean;
2521
+ }, z.core.$strict>>;
1859
2522
  execution: z.ZodOptional<z.ZodObject<{
1860
2523
  stuckInvocations: z.ZodArray<z.ZodObject<{
1861
2524
  id: z.ZodString;
@@ -1918,7 +2581,22 @@ export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
1918
2581
  memory: z.ZodOptional<z.ZodString>;
1919
2582
  }, z.core.$strict>>;
1920
2583
  idle: z.ZodOptional<z.ZodString>;
2584
+ sandboxes: z.ZodOptional<z.ZodNumber>;
2585
+ ttl: z.ZodOptional<z.ZodString>;
2586
+ }, z.core.$strict>>;
2587
+ lifecycle: z.ZodOptional<z.ZodObject<{
2588
+ onExpiry: z.ZodOptional<z.ZodEnum<{
2589
+ delete: "delete";
2590
+ retain: "retain";
2591
+ }>>;
2592
+ stopGrace: z.ZodOptional<z.ZodString>;
1921
2593
  }, z.core.$strict>>;
2594
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2595
+ hosts: z.ZodArray<z.ZodEnum<{
2596
+ "harness-container": "harness-container";
2597
+ sandbox: "sandbox";
2598
+ }>>;
2599
+ }, z.core.$strict>>>;
1922
2600
  }, z.core.$strict>>;
1923
2601
  }, z.core.$strict>>;
1924
2602
  model: z.ZodOptional<z.ZodObject<{
@@ -1965,10 +2643,12 @@ export declare const ResetTenantRequestSchema: z.ZodObject<{
1965
2643
  export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
1966
2644
  /**
1967
2645
  * Acting for a subject (Host feature `subject-headers`): what an application principal may
1968
- * narrow a request to. `sessions:own` and `vaults:own` reach only the subject's own sessions
1969
- * and vaults; the others reach Tenant-wide resources.
2646
+ * narrow a request to. `sessions:own` reaches only the subject's own sessions; the others reach
2647
+ * Tenant-wide resources. `sandboxes:write` creates and deletes sandboxes (Host feature
2648
+ * `sandboxes`); a token caller's reach only the ids its sandbox grants name. Vaults are the
2649
+ * installation's, managed by application keys acting for no one (protocol 7).
1970
2650
  */
1971
- export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "vaults:own", "tenant:settings"];
2651
+ export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "tenant:settings", "sandboxes:write"];
1972
2652
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
1973
2653
  /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
1974
2654
  export declare function isSubject(value: unknown): value is string;
@@ -1984,121 +2664,25 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
1984
2664
  ok: false;
1985
2665
  message: string;
1986
2666
  };
1987
- /** Scopes a subject token may carry: never `agents:write` or `tenant:settings`. */
1988
- export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "vaults:own"];
2667
+ /**
2668
+ * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write` or
2669
+ * `tenant:settings`.
2670
+ */
2671
+ export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write"];
2672
+ /** The most sandbox grants one token caller carries. */
2673
+ export declare const TOKEN_SANDBOX_GRANTS_MAX = 16;
1989
2674
  export type TokenScope = (typeof TOKEN_SCOPES)[number];
1990
- /** The JWT `typ` of a subject token (RFC 8725 explicit typing). */
1991
- export declare const SUBJECT_TOKEN_TYPE = "nylorun-subject+jwt";
1992
- /** The `aud` of every subject token. */
1993
- export declare const SUBJECT_TOKEN_AUDIENCE = "nylorun";
1994
- /** The `iss` of a Tenant's subject tokens. */
1995
- export declare function subjectTokenIssuer(tenantId: string): string;
1996
- /** Token lifetimes, in seconds. */
1997
- export declare const TOKEN_TTL_MIN_SECONDS = 60;
2675
+ /**
2676
+ * The longest a token the Runtime signs itself lives, in seconds (delivery tokens, capability
2677
+ * links): rotating signing keys revokes the previous key once the longest token it may have
2678
+ * signed has expired.
2679
+ */
1998
2680
  export declare const TOKEN_TTL_MAX_SECONDS = 900;
1999
- export declare const TOKEN_TTL_DEFAULT_SECONDS = 600;
2000
- /** A role's name in the access policy; `anon` is reserved for publishable keys. */
2001
- export declare const ROLE_NAME_PATTERN: RegExp;
2002
- export declare const RoleLimitsSchema: z.ZodObject<{
2003
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2004
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2005
- }, z.core.$strict>;
2006
- export type RoleLimits = z.infer<typeof RoleLimitsSchema>;
2007
- export declare const AccessRoleSchema: z.ZodObject<{
2008
- scopes: z.ZodArray<z.ZodEnum<{
2009
- "agents:read": "agents:read";
2010
- "sessions:own": "sessions:own";
2011
- "vaults:own": "vaults:own";
2012
- }>>;
2013
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2014
- limits: z.ZodOptional<z.ZodObject<{
2015
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2016
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2017
- }, z.core.$strict>>;
2018
- }, z.core.$strict>;
2019
- export type AccessRole = z.infer<typeof AccessRoleSchema>;
2020
2681
  /**
2021
- * The Tenant's access policy: what each role may do with a subject token, what a publishable
2022
- * key grants alone (`anon`), and how long tokens live. Without roles nothing can be minted.
2682
+ * The `iss` of every token a Tenant's Runtime signs itself: delivery tokens, capability links,
2683
+ * run, host and egress tokens.
2023
2684
  */
2024
- export declare const AccessPolicySchema: z.ZodObject<{
2025
- version: z.ZodLiteral<1>;
2026
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2027
- scopes: z.ZodArray<z.ZodEnum<{
2028
- "agents:read": "agents:read";
2029
- "sessions:own": "sessions:own";
2030
- "vaults:own": "vaults:own";
2031
- }>>;
2032
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2033
- limits: z.ZodOptional<z.ZodObject<{
2034
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2035
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2036
- }, z.core.$strict>>;
2037
- }, z.core.$strict>>;
2038
- anon: z.ZodObject<{
2039
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2040
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2041
- }, z.core.$strict>;
2042
- tokens: z.ZodObject<{
2043
- maxTtlSeconds: z.ZodNumber;
2044
- }, z.core.$strict>;
2045
- }, z.core.$strict>;
2046
- export type AccessPolicy = z.infer<typeof AccessPolicySchema>;
2047
- /** The policy of a Tenant that never set one: no roles, nothing for `anon`. */
2048
- export declare const DEFAULT_ACCESS_POLICY: AccessPolicy;
2049
- export declare const PutAccessPolicyRequestSchema: z.ZodObject<{
2050
- requestId: z.ZodString;
2051
- policy: z.ZodObject<{
2052
- version: z.ZodLiteral<1>;
2053
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2054
- scopes: z.ZodArray<z.ZodEnum<{
2055
- "agents:read": "agents:read";
2056
- "sessions:own": "sessions:own";
2057
- "vaults:own": "vaults:own";
2058
- }>>;
2059
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2060
- limits: z.ZodOptional<z.ZodObject<{
2061
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2062
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2063
- }, z.core.$strict>>;
2064
- }, z.core.$strict>>;
2065
- anon: z.ZodObject<{
2066
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2067
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2068
- }, z.core.$strict>;
2069
- tokens: z.ZodObject<{
2070
- maxTtlSeconds: z.ZodNumber;
2071
- }, z.core.$strict>;
2072
- }, z.core.$strict>;
2073
- }, z.core.$strict>;
2074
- export type PutAccessPolicyRequest = z.infer<typeof PutAccessPolicyRequestSchema>;
2075
- export declare const CreateTokenRequestSchema: z.ZodObject<{
2076
- requestId: z.ZodString;
2077
- subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2078
- role: z.ZodString;
2079
- scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2080
- "agents:read": "agents:read";
2081
- "sessions:own": "sessions:own";
2082
- "vaults:own": "vaults:own";
2083
- }>>>;
2084
- agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2085
- ttlSeconds: z.ZodOptional<z.ZodNumber>;
2086
- }, z.core.$strict>;
2087
- export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
2088
- export declare const CreateTokenResponseSchema: z.ZodObject<{
2089
- token: z.ZodString;
2090
- expiresAt: z.ZodString;
2091
- subject: z.ZodString;
2092
- role: z.ZodString;
2093
- scopes: z.ZodArray<z.ZodEnum<{
2094
- "agents:read": "agents:read";
2095
- "sessions:own": "sessions:own";
2096
- "vaults:own": "vaults:own";
2097
- }>>;
2098
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2099
- keyId: z.ZodString;
2100
- }, z.core.$strict>;
2101
- export type CreateTokenResponse = z.infer<typeof CreateTokenResponseSchema>;
2685
+ export declare function tenantTokenIssuer(tenantId: string): string;
2102
2686
  export declare const SIGNING_KEY_STATES: readonly ["standby", "current", "previous", "revoked"];
2103
2687
  export type SigningKeyState = (typeof SIGNING_KEY_STATES)[number];
2104
2688
  /** A public JSON Web Key as the JWKS publishes it. */
@@ -2180,60 +2764,45 @@ export declare const RotateSigningKeysRequestSchema: z.ZodObject<{
2180
2764
  export declare const RevokeSigningKeyRequestSchema: z.ZodObject<{
2181
2765
  requestId: z.ZodString;
2182
2766
  }, z.core.$strict>;
2183
- export declare const RevokeSubjectRequestSchema: z.ZodObject<{
2184
- requestId: z.ZodString;
2185
- subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2186
- }, z.core.$strict>;
2187
- export type RevokeSubjectRequest = z.infer<typeof RevokeSubjectRequestSchema>;
2188
- export declare const RevokeSubjectResponseSchema: z.ZodObject<{
2189
- subject: z.ZodString;
2190
- epoch: z.ZodNumber;
2767
+ /**
2768
+ * Scopes a trusted issuer's tokens may carry (`allowedScopes` in the identity file): the
2769
+ * token scopes, and `studio`, an operator scope no Runtime route requires (Studio
2770
+ * admits a person who holds it, Tenant-wide).
2771
+ */
2772
+ export declare const ISSUER_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write", "studio"];
2773
+ export type IssuerScope = (typeof ISSUER_SCOPES)[number];
2774
+ /** Every scope a caller can hold: the subject scopes, and an issuer token's `studio`. */
2775
+ export declare const CALLER_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "tenant:settings", "sandboxes:write", "studio"];
2776
+ export type CallerScope = (typeof CALLER_SCOPES)[number];
2777
+ /**
2778
+ * `GET /v1/me`: who the Runtime takes the caller to be, for any credential.
2779
+ *
2780
+ * - `via` is how the caller authenticated: `application:<principalId>` (an application key,
2781
+ * acting as itself), `subject` (an application key acting for `Nylorun-Subject`) or
2782
+ * `issuer:<name>` (a token from the identity file's issuer `name`).
2783
+ * - `subject` is the person the request acts for; absent for an application key alone.
2784
+ * - `scopes`: what the caller holds. An application key alone holds every subject scope.
2785
+ * - `agents`: the agents it may reach, `*` for all.
2786
+ * - `sandboxes`: the sandbox grants of a token caller (empty reaches none); absent for an
2787
+ * application key, alone or acting for a subject, which no grant limits.
2788
+ */
2789
+ export declare const MeResponseSchema: z.ZodObject<{
2790
+ subject: z.ZodOptional<z.ZodString>;
2791
+ scopes: z.ZodArray<z.ZodEnum<{
2792
+ "agents:read": "agents:read";
2793
+ "agents:write": "agents:write";
2794
+ "sandboxes:write": "sandboxes:write";
2795
+ "sessions:own": "sessions:own";
2796
+ studio: "studio";
2797
+ "tenant:settings": "tenant:settings";
2798
+ }>>;
2799
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2800
+ sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2801
+ via: z.ZodString;
2191
2802
  }, z.core.$strict>;
2192
- /** The claims of a subject token, as the Runtime writes them. */
2193
- export interface SubjectTokenClaims {
2194
- iss: string;
2195
- aud: string;
2196
- /** Tenant id. */
2197
- tnt: string;
2198
- sub: string;
2199
- role: string;
2200
- /** Space-separated token scopes. */
2201
- scp: string;
2202
- /** The agents the mint narrowed the role to; absent when not narrowed. */
2203
- agt?: string[];
2204
- /** The subject's revocation epoch when minted. */
2205
- epc: number;
2206
- iat: number;
2207
- exp: number;
2208
- jti: string;
2209
- }
2210
- /** Loopback origins with any port, for development: `http://localhost:*`, `http://127.0.0.1:*`. */
2211
- export declare const LOOPBACK_ORIGIN_WILDCARDS: readonly ["http://localhost:*", "http://127.0.0.1:*"];
2803
+ export type MeResponse = z.infer<typeof MeResponseSchema>;
2212
2804
  /** True for a serialized web origin: `scheme://host[:port]`, lowercase, no path. */
2213
2805
  export declare function isSerializedOrigin(value: string): boolean;
2214
- /** An origin allowlist entry: an exact origin or a loopback wildcard. */
2215
- export declare const OriginEntrySchema: z.ZodString;
2216
- /** True when `origin` (a request's `Origin`) is allowed by `origins`. */
2217
- export declare function originAllowed(origins: readonly string[], origin: string): boolean;
2218
- export declare const PublishableKeySchema: z.ZodObject<{
2219
- id: z.ZodString;
2220
- name: z.ZodString;
2221
- key: z.ZodString;
2222
- origins: z.ZodArray<z.ZodString>;
2223
- createdAt: z.ZodString;
2224
- revokedAt: z.ZodNullable<z.ZodString>;
2225
- }, z.core.$strict>;
2226
- export type PublishableKey = z.infer<typeof PublishableKeySchema>;
2227
- export declare const CreatePublishableKeyRequestSchema: z.ZodObject<{
2228
- requestId: z.ZodString;
2229
- name: z.ZodString;
2230
- origins: z.ZodArray<z.ZodString>;
2231
- }, z.core.$strict>;
2232
- export type CreatePublishableKeyRequest = z.infer<typeof CreatePublishableKeyRequestSchema>;
2233
- export declare const UpdatePublishableKeyRequestSchema: z.ZodObject<{
2234
- requestId: z.ZodString;
2235
- origins: z.ZodArray<z.ZodString>;
2236
- }, z.core.$strict>;
2237
2806
  /** `GET /v1/agents` with an application key: every definition, manifest included. */
2238
2807
  export declare const AgentDefinitionViewSchema: z.ZodObject<{
2239
2808
  agentId: z.ZodString;
@@ -2251,7 +2820,7 @@ export declare const ListAgentsResponseSchema: z.ZodObject<{
2251
2820
  }, z.core.$strict>>;
2252
2821
  }, z.core.$strict>;
2253
2822
  export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>;
2254
- /** `GET /v1/agents` with a subject token or publishable key: the allowed agents' names only. */
2823
+ /** `GET /v1/agents` with a token caller's credential: the allowed agents' names only. */
2255
2824
  export declare const PublicAgentSchema: z.ZodObject<{
2256
2825
  agentId: z.ZodString;
2257
2826
  name: z.ZodOptional<z.ZodString>;
@@ -2336,10 +2905,12 @@ export declare const SessionViewSchema: z.ZodObject<{
2336
2905
  credentialId: z.ZodString;
2337
2906
  }, z.core.$strict>>;
2338
2907
  sandboxOwnerId: z.ZodNullable<z.ZodString>;
2908
+ sandboxId: z.ZodOptional<z.ZodString>;
2339
2909
  sandbox: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2340
2910
  sandboxSource: z.ZodOptional<z.ZodEnum<{
2341
2911
  default: "default";
2342
2912
  inline: "inline";
2913
+ sandbox: "sandbox";
2343
2914
  shared: "shared";
2344
2915
  }>>;
2345
2916
  mcpSnapshot: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -2586,15 +3157,32 @@ export declare const EffectiveSandboxConfigSchema: z.ZodObject<{
2586
3157
  memoryMiB: z.ZodNumber;
2587
3158
  }, z.core.$strict>;
2588
3159
  idle: z.ZodString;
3160
+ sandboxes: z.ZodOptional<z.ZodNumber>;
3161
+ ttl: z.ZodOptional<z.ZodString>;
2589
3162
  }, z.core.$strict>;
3163
+ lifecycle: z.ZodOptional<z.ZodObject<{
3164
+ onExpiry: z.ZodEnum<{
3165
+ delete: "delete";
3166
+ retain: "retain";
3167
+ }>;
3168
+ stopGrace: z.ZodString;
3169
+ }, z.core.$strict>>;
3170
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3171
+ hosts: z.ZodArray<z.ZodEnum<{
3172
+ "harness-container": "harness-container";
3173
+ sandbox: "sandbox";
3174
+ }>>;
3175
+ }, z.core.$strict>>>;
2590
3176
  }, z.core.$strict>;
2591
3177
  export type EffectiveSandboxConfig = z.infer<typeof EffectiveSandboxConfigSchema>;
2592
3178
  /** `GET` and `PUT /v1/tenant/sandbox`: the backend chosen, and the configuration in force. */
2593
3179
  export declare const TenantSandboxViewSchema: z.ZodObject<{
2594
3180
  preference: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodEnum<{
3181
+ local: "local";
2595
3182
  virtual: "virtual";
2596
3183
  }>]>;
2597
3184
  backend: z.ZodNullable<z.ZodEnum<{
3185
+ local: "local";
2598
3186
  virtual: "virtual";
2599
3187
  }>>;
2600
3188
  isolation: z.ZodNullable<z.ZodEnum<{
@@ -2604,6 +3192,7 @@ export declare const TenantSandboxViewSchema: z.ZodObject<{
2604
3192
  reason: z.ZodString;
2605
3193
  probes: z.ZodArray<z.ZodObject<{
2606
3194
  name: z.ZodEnum<{
3195
+ local: "local";
2607
3196
  virtual: "virtual";
2608
3197
  }>;
2609
3198
  available: z.ZodBoolean;
@@ -2637,8 +3226,33 @@ export declare const TenantSandboxViewSchema: z.ZodObject<{
2637
3226
  memoryMiB: z.ZodNumber;
2638
3227
  }, z.core.$strict>;
2639
3228
  idle: z.ZodString;
3229
+ sandboxes: z.ZodOptional<z.ZodNumber>;
3230
+ ttl: z.ZodOptional<z.ZodString>;
2640
3231
  }, z.core.$strict>;
3232
+ lifecycle: z.ZodOptional<z.ZodObject<{
3233
+ onExpiry: z.ZodEnum<{
3234
+ delete: "delete";
3235
+ retain: "retain";
3236
+ }>;
3237
+ stopGrace: z.ZodString;
3238
+ }, z.core.$strict>>;
3239
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3240
+ hosts: z.ZodArray<z.ZodEnum<{
3241
+ "harness-container": "harness-container";
3242
+ sandbox: "sandbox";
3243
+ }>>;
3244
+ }, z.core.$strict>>>;
2641
3245
  }, z.core.$strict>;
3246
+ cluster: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3247
+ namespace: z.ZodString;
3248
+ context: z.ZodString;
3249
+ ready: z.ZodBoolean;
3250
+ controllerVersion: z.ZodOptional<z.ZodString>;
3251
+ networkPolicy: z.ZodOptional<z.ZodObject<{
3252
+ enforced: z.ZodBoolean;
3253
+ probedAt: z.ZodOptional<z.ZodString>;
3254
+ }, z.core.$strip>>;
3255
+ }, z.core.$strip>>>;
2642
3256
  }, z.core.$strict>;
2643
3257
  export type TenantSandboxView = z.infer<typeof TenantSandboxViewSchema>;
2644
3258
  /** What a usage total or a budget covers: the whole Tenant, one agent, or one turn. */
@@ -2766,54 +3380,38 @@ export declare const ListCredentialsResponseSchema: z.ZodObject<{
2766
3380
  }, z.core.$strict>>;
2767
3381
  }, z.core.$strict>;
2768
3382
  export type ListCredentialsResponse = z.infer<typeof ListCredentialsResponseSchema>;
3383
+ /**
3384
+ * `POST /v1/vaults/{vaultId}/oauth/start` (F9 C2): sign the installation in to the remote MCP
3385
+ * server at `url`, declared as `server`, and store its OAuth credential in the installation vault.
3386
+ * `clientId` names a client registered with the authorization server; without one the Runtime
3387
+ * registers itself (RFC 7591) when the server allows it.
3388
+ */
3389
+ export declare const StartOAuthRequestSchema: z.ZodObject<{
3390
+ url: z.ZodString;
3391
+ server: z.ZodString;
3392
+ clientId: z.ZodOptional<z.ZodString>;
3393
+ }, z.core.$strict>;
3394
+ export type StartOAuthRequest = z.infer<typeof StartOAuthRequestSchema>;
3395
+ /** Where to send the browser, and until when the sign-in can finish. */
3396
+ export declare const StartOAuthResponseSchema: z.ZodObject<{
3397
+ authorizeUrl: z.ZodString;
3398
+ expiresAt: z.ZodString;
3399
+ }, z.core.$strict>;
3400
+ export type StartOAuthResponse = z.infer<typeof StartOAuthResponseSchema>;
2769
3401
  /** A deleted vault or credential. */
2770
3402
  export declare const DeletedResponseSchema: z.ZodObject<{
2771
3403
  id: z.ZodString;
2772
3404
  }, z.core.$strict>;
2773
3405
  export type DeletedResponse = z.infer<typeof DeletedResponseSchema>;
2774
- export declare const AccessPolicyResponseSchema: z.ZodObject<{
2775
- policy: z.ZodObject<{
2776
- version: z.ZodLiteral<1>;
2777
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2778
- scopes: z.ZodArray<z.ZodEnum<{
2779
- "agents:read": "agents:read";
2780
- "sessions:own": "sessions:own";
2781
- "vaults:own": "vaults:own";
2782
- }>>;
2783
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2784
- limits: z.ZodOptional<z.ZodObject<{
2785
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2786
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2787
- }, z.core.$strict>>;
2788
- }, z.core.$strict>>;
2789
- anon: z.ZodObject<{
2790
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2791
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2792
- }, z.core.$strict>;
2793
- tokens: z.ZodObject<{
2794
- maxTtlSeconds: z.ZodNumber;
2795
- }, z.core.$strict>;
2796
- }, z.core.$strict>;
2797
- }, z.core.$strict>;
2798
- export type AccessPolicyResponse = z.infer<typeof AccessPolicyResponseSchema>;
2799
- export declare const ListPublishableKeysResponseSchema: z.ZodObject<{
2800
- keys: z.ZodArray<z.ZodObject<{
2801
- id: z.ZodString;
2802
- name: z.ZodString;
2803
- key: z.ZodString;
2804
- origins: z.ZodArray<z.ZodString>;
2805
- createdAt: z.ZodString;
2806
- revokedAt: z.ZodNullable<z.ZodString>;
2807
- }, z.core.$strict>>;
2808
- }, z.core.$strict>;
2809
- export type ListPublishableKeysResponse = z.infer<typeof ListPublishableKeysResponseSchema>;
2810
3406
  export declare const HostShutdownResponseSchema: z.ZodObject<{
2811
3407
  status: z.ZodLiteral<"shutting_down">;
2812
3408
  }, z.core.$strict>;
2813
- /** The last frame of a session stream the Runtime ends: `event: nylorun.closed`. */
3409
+ /**
3410
+ * The last frame of a session stream the Runtime ends: `event: nylorun.closed`, when the
3411
+ * token caller's token expires.
3412
+ */
2814
3413
  export declare const StreamClosedFrameSchema: z.ZodObject<{
2815
3414
  reason: z.ZodEnum<{
2816
- revoked: "revoked";
2817
3415
  token_expired: "token_expired";
2818
3416
  }>;
2819
3417
  }, z.core.$strict>;
@@ -2828,12 +3426,22 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
2828
3426
  incompatible_host: "incompatible_host";
2829
3427
  internal_error: "internal_error";
2830
3428
  invalid_request: "invalid_request";
3429
+ issuer_unavailable: "issuer_unavailable";
2831
3430
  limit_exceeded: "limit_exceeded";
2832
3431
  not_found: "not_found";
3432
+ oauth_client_required: "oauth_client_required";
3433
+ oauth_failed: "oauth_failed";
3434
+ oauth_state_invalid: "oauth_state_invalid";
2833
3435
  origin_rejected: "origin_rejected";
3436
+ placement_refused: "placement_refused";
2834
3437
  protocol_unsupported: "protocol_unsupported";
2835
3438
  request_rejected: "request_rejected";
2836
3439
  runtime_error: "runtime_error";
3440
+ sandbox_busy: "sandbox_busy";
3441
+ sandbox_expired: "sandbox_expired";
3442
+ sandbox_lost: "sandbox_lost";
3443
+ sandbox_not_granted: "sandbox_not_granted";
3444
+ sandbox_unavailable: "sandbox_unavailable";
2837
3445
  scope_required: "scope_required";
2838
3446
  session_busy: "session_busy";
2839
3447
  subject_invalid: "subject_invalid";
@@ -2844,10 +3452,7 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
2844
3452
  export type AgUiRunErrorCode = z.infer<typeof AgUiRunErrorCodeSchema>;
2845
3453
  /** The JWT `typ` of a delivery token (RFC 8725 explicit typing). */
2846
3454
  export declare const DELIVERY_TOKEN_TYPE = "nylorun-delivery+jwt";
2847
- /**
2848
- * A delivery token lives no longer than a subject token: rotating signing keys revokes the
2849
- * previous key once the longest token it may have signed has expired.
2850
- */
3455
+ /** A delivery token lives no longer than any token the Runtime signs (`TOKEN_TTL_MAX_SECONDS`). */
2851
3456
  export declare const DELIVERY_TOKEN_MAX_TTL_SECONDS = 900;
2852
3457
  /** Inline delivery timeouts, in milliseconds. The maximum keeps a token within its lifetime. */
2853
3458
  export declare const ENDPOINT_TIMEOUT_DEFAULT_MS = 60000;
@@ -3230,7 +3835,7 @@ export declare const StudioEmbedMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObj
3230
3835
  }, z.core.$strip>, z.ZodObject<{
3231
3836
  type: z.ZodLiteral<"nylorun.studio">;
3232
3837
  protocol: z.ZodNumber;
3233
- kind: z.ZodLiteral<"open.babai">;
3838
+ kind: z.ZodLiteral<"open.session">;
3234
3839
  sessionId: z.ZodString;
3235
3840
  }, z.core.$strip>, z.ZodObject<{
3236
3841
  type: z.ZodLiteral<"nylorun.studio">;
@@ -3248,3 +3853,261 @@ export declare function isFrameAncestor(value: string): boolean;
3248
3853
  * keywords, scheme-only entries and paths are refused with the entry named. Empty gives `[]`.
3249
3854
  */
3250
3855
  export declare function parseFrameAncestors(value: string): string[];
3856
+ /** The JWT `typ` of a capability link's token (RFC 8725 explicit typing). */
3857
+ export declare const ARTIFACT_LINK_TOKEN_TYPE = "nylorun-artifact+jwt";
3858
+ /** A capability link lives no longer than any token the Runtime signs (`TOKEN_TTL_MAX_SECONDS`). */
3859
+ export declare const ARTIFACT_LINK_MAX_TTL_SECONDS = 900;
3860
+ export declare const ARTIFACT_LINK_DEFAULT_TTL_SECONDS = 300;
3861
+ /** A Tenant's limits when it sets none: 100 MiB per file, 10 GiB in all. */
3862
+ export declare const ARTIFACT_FILE_BYTES_DEFAULT: number;
3863
+ export declare const ARTIFACT_TOTAL_BYTES_DEFAULT: number;
3864
+ /** The longest artifact name, in characters. */
3865
+ export declare const ARTIFACT_NAME_MAX = 255;
3866
+ /** The longest path of a file in a folder artifact, in characters. */
3867
+ export declare const ARTIFACT_PATH_MAX = 1024;
3868
+ /** Labels: up to 32, keys 1–63 characters, values up to 256. */
3869
+ export declare const ArtifactLabelsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
3870
+ /**
3871
+ * One version of an artifact: immutable once it exists. A folder version's `size` is the sum of
3872
+ * its files' sizes and its `sha256` is its manifest's.
3873
+ */
3874
+ export declare const ArtifactVersionViewSchema: z.ZodObject<{
3875
+ version: z.ZodNumber;
3876
+ size: z.ZodNumber;
3877
+ sha256: z.ZodString;
3878
+ contentType: z.ZodString;
3879
+ source: z.ZodEnum<{
3880
+ engine: "engine";
3881
+ export: "export";
3882
+ upload: "upload";
3883
+ }>;
3884
+ createdAt: z.ZodString;
3885
+ }, z.core.$strict>;
3886
+ export type ArtifactVersionView = z.infer<typeof ArtifactVersionViewSchema>;
3887
+ /**
3888
+ * An artifact: an id, a name and numbered versions, its bytes in the Object store. A file's
3889
+ * version is its bytes; a folder's (F8.2) is a manifest of paths to content-addressed files.
3890
+ */
3891
+ export declare const ArtifactViewSchema: z.ZodObject<{
3892
+ artifactId: z.ZodString;
3893
+ kind: z.ZodEnum<{
3894
+ file: "file";
3895
+ folder: "folder";
3896
+ }>;
3897
+ name: z.ZodString;
3898
+ contentType: z.ZodString;
3899
+ sessionId: z.ZodOptional<z.ZodString>;
3900
+ latestVersion: z.ZodNumber;
3901
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3902
+ createdAt: z.ZodString;
3903
+ updatedAt: z.ZodString;
3904
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3905
+ version: z.ZodNumber;
3906
+ size: z.ZodNumber;
3907
+ sha256: z.ZodString;
3908
+ contentType: z.ZodString;
3909
+ source: z.ZodEnum<{
3910
+ engine: "engine";
3911
+ export: "export";
3912
+ upload: "upload";
3913
+ }>;
3914
+ createdAt: z.ZodString;
3915
+ }, z.core.$strict>>>;
3916
+ }, z.core.$strict>;
3917
+ export type ArtifactView = z.infer<typeof ArtifactViewSchema>;
3918
+ export declare const ListArtifactsResponseSchema: z.ZodObject<{
3919
+ artifacts: z.ZodArray<z.ZodObject<{
3920
+ artifactId: z.ZodString;
3921
+ kind: z.ZodEnum<{
3922
+ file: "file";
3923
+ folder: "folder";
3924
+ }>;
3925
+ name: z.ZodString;
3926
+ contentType: z.ZodString;
3927
+ sessionId: z.ZodOptional<z.ZodString>;
3928
+ latestVersion: z.ZodNumber;
3929
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3930
+ createdAt: z.ZodString;
3931
+ updatedAt: z.ZodString;
3932
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3933
+ version: z.ZodNumber;
3934
+ size: z.ZodNumber;
3935
+ sha256: z.ZodString;
3936
+ contentType: z.ZodString;
3937
+ source: z.ZodEnum<{
3938
+ engine: "engine";
3939
+ export: "export";
3940
+ upload: "upload";
3941
+ }>;
3942
+ createdAt: z.ZodString;
3943
+ }, z.core.$strict>>>;
3944
+ }, z.core.$strict>>;
3945
+ }, z.core.$strict>;
3946
+ export type ListArtifactsResponse = z.infer<typeof ListArtifactsResponseSchema>;
3947
+ /** What an upload answers: the artifact, and the version the upload created. */
3948
+ export declare const UploadArtifactResponseSchema: z.ZodObject<{
3949
+ artifact: z.ZodObject<{
3950
+ artifactId: z.ZodString;
3951
+ kind: z.ZodEnum<{
3952
+ file: "file";
3953
+ folder: "folder";
3954
+ }>;
3955
+ name: z.ZodString;
3956
+ contentType: z.ZodString;
3957
+ sessionId: z.ZodOptional<z.ZodString>;
3958
+ latestVersion: z.ZodNumber;
3959
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3960
+ createdAt: z.ZodString;
3961
+ updatedAt: z.ZodString;
3962
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3963
+ version: z.ZodNumber;
3964
+ size: z.ZodNumber;
3965
+ sha256: z.ZodString;
3966
+ contentType: z.ZodString;
3967
+ source: z.ZodEnum<{
3968
+ engine: "engine";
3969
+ export: "export";
3970
+ upload: "upload";
3971
+ }>;
3972
+ createdAt: z.ZodString;
3973
+ }, z.core.$strict>>>;
3974
+ }, z.core.$strict>;
3975
+ version: z.ZodObject<{
3976
+ version: z.ZodNumber;
3977
+ size: z.ZodNumber;
3978
+ sha256: z.ZodString;
3979
+ contentType: z.ZodString;
3980
+ source: z.ZodEnum<{
3981
+ engine: "engine";
3982
+ export: "export";
3983
+ upload: "upload";
3984
+ }>;
3985
+ createdAt: z.ZodString;
3986
+ }, z.core.$strict>;
3987
+ }, z.core.$strict>;
3988
+ export type UploadArtifactResponse = z.infer<typeof UploadArtifactResponseSchema>;
3989
+ export declare const DeleteArtifactResponseSchema: z.ZodObject<{
3990
+ artifactId: z.ZodString;
3991
+ deleted: z.ZodBoolean;
3992
+ }, z.core.$strict>;
3993
+ export type DeleteArtifactResponse = z.infer<typeof DeleteArtifactResponseSchema>;
3994
+ /** `POST /v1/artifacts/{id}/links`: a capability link to one version. */
3995
+ export declare const CreateArtifactLinkRequestSchema: z.ZodObject<{
3996
+ requestId: z.ZodOptional<z.ZodString>;
3997
+ version: z.ZodOptional<z.ZodNumber>;
3998
+ expiresIn: z.ZodOptional<z.ZodNumber>;
3999
+ file: z.ZodOptional<z.ZodString>;
4000
+ }, z.core.$strict>;
4001
+ export type CreateArtifactLinkRequest = z.infer<typeof CreateArtifactLinkRequestSchema>;
4002
+ /** A capability link: `GET` its path on the Runtime with no credential, until it expires. */
4003
+ export declare const ArtifactLinkSchema: z.ZodObject<{
4004
+ path: z.ZodString;
4005
+ artifactId: z.ZodString;
4006
+ version: z.ZodNumber;
4007
+ file: z.ZodOptional<z.ZodString>;
4008
+ expiresAt: z.ZodString;
4009
+ }, z.core.$strict>;
4010
+ export type ArtifactLink = z.infer<typeof ArtifactLinkSchema>;
4011
+ /** The media type of a folder artifact and of its manifests. */
4012
+ export declare const FOLDER_CONTENT_TYPE = "application/vnd.nylorun.folder+json";
4013
+ /** The manifest format a folder version is stored as. */
4014
+ export declare const FOLDER_MANIFEST_FORMAT = "nylorun.folder.v1";
4015
+ /** The folder artifact a session's turn-end export writes, one per session. */
4016
+ export declare const OUTPUTS_ARTIFACT_NAME = "outputs";
4017
+ /** The most files one turn-end export stores; past it the export is skipped. */
4018
+ export declare const EXPORT_MAX_FILES = 10000;
4019
+ /** The most bytes one turn-end export stores (before dedupe); past it the export is skipped. */
4020
+ export declare const EXPORT_MAX_BYTES: number;
4021
+ /** One file of a folder: its path in the folder (`/`-separated, relative), size, hash and type. */
4022
+ export declare const FolderEntrySchema: z.ZodObject<{
4023
+ path: z.ZodString;
4024
+ size: z.ZodNumber;
4025
+ sha256: z.ZodString;
4026
+ contentType: z.ZodString;
4027
+ }, z.core.$strict>;
4028
+ export type FolderEntry = z.infer<typeof FolderEntrySchema>;
4029
+ /**
4030
+ * A folder version as stored: the files, sorted by path, each naming its content-addressed
4031
+ * bytes by SHA-256. The one manifest format for folders, reused by P5's snapshots.
4032
+ */
4033
+ export declare const FolderManifestSchema: z.ZodObject<{
4034
+ format: z.ZodLiteral<"nylorun.folder.v1">;
4035
+ entries: z.ZodArray<z.ZodObject<{
4036
+ path: z.ZodString;
4037
+ size: z.ZodNumber;
4038
+ sha256: z.ZodString;
4039
+ contentType: z.ZodString;
4040
+ }, z.core.$strict>>;
4041
+ }, z.core.$strict>;
4042
+ export type FolderManifest = z.infer<typeof FolderManifestSchema>;
4043
+ /** `GET /v1/artifacts/{id}/versions/{n|latest}/tree`: a folder version's files. */
4044
+ export declare const ArtifactTreeSchema: z.ZodObject<{
4045
+ artifactId: z.ZodString;
4046
+ version: z.ZodNumber;
4047
+ entries: z.ZodArray<z.ZodObject<{
4048
+ path: z.ZodString;
4049
+ size: z.ZodNumber;
4050
+ sha256: z.ZodString;
4051
+ contentType: z.ZodString;
4052
+ }, z.core.$strict>>;
4053
+ }, z.core.$strict>;
4054
+ export type ArtifactTree = z.infer<typeof ArtifactTreeSchema>;
4055
+ /** `GET /v1/artifacts/{id}/versions/{n|latest}/diff?from=m`: what changed between two versions. */
4056
+ export declare const ArtifactDiffSchema: z.ZodObject<{
4057
+ artifactId: z.ZodString;
4058
+ from: z.ZodOptional<z.ZodNumber>;
4059
+ to: z.ZodNumber;
4060
+ added: z.ZodArray<z.ZodObject<{
4061
+ path: z.ZodString;
4062
+ size: z.ZodNumber;
4063
+ sha256: z.ZodString;
4064
+ contentType: z.ZodString;
4065
+ }, z.core.$strict>>;
4066
+ removed: z.ZodArray<z.ZodObject<{
4067
+ path: z.ZodString;
4068
+ size: z.ZodNumber;
4069
+ sha256: z.ZodString;
4070
+ contentType: z.ZodString;
4071
+ }, z.core.$strict>>;
4072
+ changed: z.ZodArray<z.ZodObject<{
4073
+ path: z.ZodString;
4074
+ from: z.ZodObject<{
4075
+ path: z.ZodString;
4076
+ size: z.ZodNumber;
4077
+ sha256: z.ZodString;
4078
+ contentType: z.ZodString;
4079
+ }, z.core.$strict>;
4080
+ to: z.ZodObject<{
4081
+ path: z.ZodString;
4082
+ size: z.ZodNumber;
4083
+ sha256: z.ZodString;
4084
+ contentType: z.ZodString;
4085
+ }, z.core.$strict>;
4086
+ }, z.core.$strict>>;
4087
+ }, z.core.$strict>;
4088
+ export type ArtifactDiff = z.infer<typeof ArtifactDiffSchema>;
4089
+ /** A Tenant's artifact limits, stored as Tenant setting `artifacts.config`. */
4090
+ export declare const TenantArtifactsConfigSchema: z.ZodObject<{
4091
+ limits: z.ZodOptional<z.ZodObject<{
4092
+ fileBytes: z.ZodOptional<z.ZodNumber>;
4093
+ totalBytes: z.ZodOptional<z.ZodNumber>;
4094
+ }, z.core.$strict>>;
4095
+ }, z.core.$strict>;
4096
+ export type TenantArtifactsConfig = z.infer<typeof TenantArtifactsConfigSchema>;
4097
+ /** `PUT /v1/tenant/artifacts`: replaces the Tenant's artifact configuration. */
4098
+ export declare const PutTenantArtifactsRequestSchema: z.ZodObject<{
4099
+ limits: z.ZodOptional<z.ZodObject<{
4100
+ fileBytes: z.ZodOptional<z.ZodNumber>;
4101
+ totalBytes: z.ZodOptional<z.ZodNumber>;
4102
+ }, z.core.$strict>>;
4103
+ requestId: z.ZodOptional<z.ZodString>;
4104
+ }, z.core.$strict>;
4105
+ export type PutTenantArtifactsRequest = z.infer<typeof PutTenantArtifactsRequestSchema>;
4106
+ export declare const TenantArtifactsViewSchema: z.ZodObject<{
4107
+ limits: z.ZodObject<{
4108
+ fileBytes: z.ZodNumber;
4109
+ totalBytes: z.ZodNumber;
4110
+ }, z.core.$strict>;
4111
+ usedBytes: z.ZodNumber;
4112
+ }, z.core.$strict>;
4113
+ export type TenantArtifactsView = z.infer<typeof TenantArtifactsViewSchema>;