@nylorun/core 0.10.0-beta → 0.12.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
+ /** An `sbx` entry: 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 subject token's `sbx`) 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>;
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>;
111
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,7 +436,22 @@ 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>;
@@ -269,7 +586,26 @@ export declare const CredentialInfoSchema: z.ZodObject<{
269
586
  rotatedAt: z.ZodOptional<z.ZodString>;
270
587
  }, z.core.$strict>;
271
588
  export type CredentialInfo = z.infer<typeof CredentialInfoSchema>;
272
- /** Exactly one of `content` or `data`. Optional `manifest` for per-turn agent patches. */
589
+ /** The most parts one message may carry (protocol 6). */
590
+ export declare const MAX_MESSAGE_PARTS = 32;
591
+ /**
592
+ * One part of a user message (protocol 6): text, or a file by artifact id. A file part without
593
+ * `version` means the artifact's latest version when the message is accepted; the Runtime pins
594
+ * it then. The model reads an image as an image, a text file as text, and refuses other files.
595
+ */
596
+ export declare const MessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
597
+ type: z.ZodLiteral<"text">;
598
+ text: z.ZodString;
599
+ }, z.core.$strict>, z.ZodObject<{
600
+ type: z.ZodLiteral<"file">;
601
+ artifactId: z.ZodString;
602
+ version: z.ZodOptional<z.ZodNumber>;
603
+ }, z.core.$strict>], "type">;
604
+ export type MessagePart = z.infer<typeof MessagePartSchema>;
605
+ /**
606
+ * Exactly one of `content`, `data` or `parts` (protocol 6). Optional `manifest` for per-turn
607
+ * agent patches.
608
+ */
273
609
  export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
274
610
  requestId: z.ZodString;
275
611
  idempotencyKey: z.ZodString;
@@ -282,6 +618,19 @@ export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
282
618
  type: z.ZodLiteral<"message">;
283
619
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
284
620
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
621
+ }, z.core.$strict>, z.ZodObject<{
622
+ requestId: z.ZodString;
623
+ idempotencyKey: z.ZodString;
624
+ type: z.ZodLiteral<"message">;
625
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
626
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
627
+ type: z.ZodLiteral<"text">;
628
+ text: z.ZodString;
629
+ }, z.core.$strict>, z.ZodObject<{
630
+ type: z.ZodLiteral<"file">;
631
+ artifactId: z.ZodString;
632
+ version: z.ZodOptional<z.ZodNumber>;
633
+ }, z.core.$strict>], "type">>;
285
634
  }, z.core.$strict>]>;
286
635
  export declare const ActionOutcomeSchema: z.ZodObject<{
287
636
  value: z.ZodUnknown;
@@ -300,6 +649,19 @@ export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
300
649
  type: z.ZodLiteral<"message">;
301
650
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
302
651
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
652
+ }, z.core.$strict>, z.ZodObject<{
653
+ requestId: z.ZodString;
654
+ idempotencyKey: z.ZodString;
655
+ type: z.ZodLiteral<"message">;
656
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
657
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
658
+ type: z.ZodLiteral<"text">;
659
+ text: z.ZodString;
660
+ }, z.core.$strict>, z.ZodObject<{
661
+ type: z.ZodLiteral<"file">;
662
+ artifactId: z.ZodString;
663
+ version: z.ZodOptional<z.ZodNumber>;
664
+ }, z.core.$strict>], "type">>;
303
665
  }, z.core.$strict>]>, z.ZodObject<{
304
666
  requestId: z.ZodString;
305
667
  idempotencyKey: z.ZodString;
@@ -330,6 +692,19 @@ export declare const SessionEventBodySchema: z.ZodUnion<readonly [z.ZodUnion<rea
330
692
  type: z.ZodLiteral<"message">;
331
693
  manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
332
694
  data: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
695
+ }, z.core.$strict>, z.ZodObject<{
696
+ requestId: z.ZodString;
697
+ idempotencyKey: z.ZodString;
698
+ type: z.ZodLiteral<"message">;
699
+ manifest: z.ZodOptional<z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>>;
700
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
701
+ type: z.ZodLiteral<"text">;
702
+ text: z.ZodString;
703
+ }, z.core.$strict>, z.ZodObject<{
704
+ type: z.ZodLiteral<"file">;
705
+ artifactId: z.ZodString;
706
+ version: z.ZodOptional<z.ZodNumber>;
707
+ }, z.core.$strict>], "type">>;
333
708
  }, z.core.$strict>]>, z.ZodObject<{
334
709
  requestId: z.ZodString;
335
710
  idempotencyKey: z.ZodString;
@@ -525,8 +900,14 @@ export declare const RejectedResponseSchema: z.ZodObject<{
525
900
  limit_exceeded: "limit_exceeded";
526
901
  not_found: "not_found";
527
902
  origin_rejected: "origin_rejected";
903
+ placement_refused: "placement_refused";
528
904
  protocol_unsupported: "protocol_unsupported";
529
905
  request_rejected: "request_rejected";
906
+ sandbox_busy: "sandbox_busy";
907
+ sandbox_expired: "sandbox_expired";
908
+ sandbox_lost: "sandbox_lost";
909
+ sandbox_not_granted: "sandbox_not_granted";
910
+ sandbox_unavailable: "sandbox_unavailable";
530
911
  scope_required: "scope_required";
531
912
  subject_invalid: "subject_invalid";
532
913
  subject_required: "subject_required";
@@ -1005,6 +1386,14 @@ export declare const CommandMessagePayloadSchema: z.ZodObject<{
1005
1386
  type: z.ZodLiteral<"message">;
1006
1387
  content: z.ZodOptional<z.ZodString>;
1007
1388
  data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1389
+ parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1390
+ type: z.ZodLiteral<"text">;
1391
+ text: z.ZodString;
1392
+ }, z.core.$strict>, z.ZodObject<{
1393
+ type: z.ZodLiteral<"file">;
1394
+ artifactId: z.ZodString;
1395
+ version: z.ZodOptional<z.ZodNumber>;
1396
+ }, z.core.$strict>], "type">>>;
1008
1397
  manifest: z.ZodOptional<z.ZodUnknown>;
1009
1398
  }, z.core.$loose>;
1010
1399
  /** `command.approve`: an answer to an approval interaction. */
@@ -1057,6 +1446,13 @@ export declare const SandboxStatePayloadSchema: z.ZodObject<{
1057
1446
  note: z.ZodOptional<z.ZodString>;
1058
1447
  error: z.ZodOptional<z.ZodString>;
1059
1448
  }, z.core.$loose>;
1449
+ /**
1450
+ * `sandbox.attached`: the session was opened on a sandbox resource (`sandbox: { id }`). The
1451
+ * sandbox's own stream records the same attachment.
1452
+ */
1453
+ export declare const SandboxAttachedPayloadSchema: z.ZodObject<{
1454
+ sandboxId: z.ZodString;
1455
+ }, z.core.$loose>;
1060
1456
  /** `sandbox.exec`: one sandbox tool call finished. */
1061
1457
  export declare const SandboxExecPayloadSchema: z.ZodObject<{
1062
1458
  tool: z.ZodString;
@@ -1118,6 +1514,88 @@ export declare const TranscriptUpdatedPayloadSchema: z.ZodObject<{
1118
1514
  entries: z.ZodArray<z.ZodUnknown>;
1119
1515
  length: z.ZodNumber;
1120
1516
  }, z.core.$loose>;
1517
+ /**
1518
+ * Where an artifact version's bytes came from: a client's upload, our engine's `save_artifact`,
1519
+ * or the turn-end export of a sandbox's outputs (F8.2), whose listing and bytes the harness
1520
+ * holding the workspace supplied.
1521
+ */
1522
+ export declare const ArtifactSourceSchema: z.ZodEnum<{
1523
+ engine: "engine";
1524
+ export: "export";
1525
+ upload: "upload";
1526
+ }>;
1527
+ export type ArtifactSource = z.infer<typeof ArtifactSourceSchema>;
1528
+ /**
1529
+ * What an artifact holds: one file, or a folder (F8.2), whose versions are manifests of paths to
1530
+ * content-addressed files.
1531
+ */
1532
+ export declare const ArtifactKindSchema: z.ZodEnum<{
1533
+ file: "file";
1534
+ folder: "folder";
1535
+ }>;
1536
+ export type ArtifactKind = z.infer<typeof ArtifactKindSchema>;
1537
+ /**
1538
+ * `artifact.created` and `artifact.version.created` (protocol 6): a file or folder artifact of the
1539
+ * session, or a new version of one, committed. Ids, sizes and hashes, never bytes. A folder's
1540
+ * `size` is the sum of its files' and its `sha256` is its manifest's.
1541
+ */
1542
+ export declare const ArtifactVersionPayloadSchema: z.ZodObject<{
1543
+ artifactId: z.ZodString;
1544
+ kind: z.ZodEnum<{
1545
+ file: "file";
1546
+ folder: "folder";
1547
+ }>;
1548
+ name: z.ZodString;
1549
+ contentType: z.ZodString;
1550
+ version: z.ZodNumber;
1551
+ size: z.ZodNumber;
1552
+ sha256: z.ZodString;
1553
+ source: z.ZodEnum<{
1554
+ engine: "engine";
1555
+ export: "export";
1556
+ upload: "upload";
1557
+ }>;
1558
+ callId: z.ZodOptional<z.ZodString>;
1559
+ fileCount: z.ZodOptional<z.ZodNumber>;
1560
+ claimed: z.ZodOptional<z.ZodBoolean>;
1561
+ }, z.core.$loose>;
1562
+ /** `artifact.deleted`: the artifact and every version of it are gone. */
1563
+ export declare const ArtifactDeletedPayloadSchema: z.ZodObject<{
1564
+ artifactId: z.ZodString;
1565
+ name: z.ZodString;
1566
+ }, z.core.$loose>;
1567
+ /** Why a turn-end export stored nothing although the sandbox had outputs (F8.2). */
1568
+ export declare const ArtifactExportSkipReasonSchema: z.ZodEnum<{
1569
+ file_too_large: "file_too_large";
1570
+ tenant_total: "tenant_total";
1571
+ too_large: "too_large";
1572
+ too_many_files: "too_many_files";
1573
+ }>;
1574
+ export type ArtifactExportSkipReason = z.infer<typeof ArtifactExportSkipReasonSchema>;
1575
+ /**
1576
+ * `artifact.export.skipped`: the turn's outputs were past a limit, so no folder version was
1577
+ * written. The turn itself completed.
1578
+ */
1579
+ export declare const ArtifactExportSkippedPayloadSchema: z.ZodObject<{
1580
+ name: z.ZodString;
1581
+ reason: z.ZodEnum<{
1582
+ file_too_large: "file_too_large";
1583
+ tenant_total: "tenant_total";
1584
+ too_large: "too_large";
1585
+ too_many_files: "too_many_files";
1586
+ }>;
1587
+ message: z.ZodString;
1588
+ limit: z.ZodOptional<z.ZodNumber>;
1589
+ path: z.ZodOptional<z.ZodString>;
1590
+ }, z.core.$loose>;
1591
+ /**
1592
+ * `artifact.export.failed`: the turn-end export could not finish (the sandbox or the Object store
1593
+ * failed). The turn itself completed; the next turn exports again.
1594
+ */
1595
+ export declare const ArtifactExportFailedPayloadSchema: z.ZodObject<{
1596
+ name: z.ZodString;
1597
+ message: z.ZodString;
1598
+ }, z.core.$loose>;
1121
1599
  /**
1122
1600
  * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1123
1601
  * payload schema version and who writes it. A type not listed here cannot be written. A type
@@ -1136,6 +1614,14 @@ export declare const EVENT_CATALOG: {
1136
1614
  type: z.ZodLiteral<"message">;
1137
1615
  content: z.ZodOptional<z.ZodString>;
1138
1616
  data: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1617
+ parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1618
+ type: z.ZodLiteral<"text">;
1619
+ text: z.ZodString;
1620
+ }, z.core.$strict>, z.ZodObject<{
1621
+ type: z.ZodLiteral<"file">;
1622
+ artifactId: z.ZodString;
1623
+ version: z.ZodOptional<z.ZodNumber>;
1624
+ }, z.core.$strict>], "type">>>;
1139
1625
  manifest: z.ZodOptional<z.ZodUnknown>;
1140
1626
  }, z.core.$loose>;
1141
1627
  readonly source: "api";
@@ -1415,6 +1901,13 @@ export declare const EVENT_CATALOG: {
1415
1901
  readonly source: "loop";
1416
1902
  readonly version: 1;
1417
1903
  };
1904
+ readonly "sandbox.attached": {
1905
+ readonly payload: z.ZodObject<{
1906
+ sandboxId: z.ZodString;
1907
+ }, z.core.$loose>;
1908
+ readonly source: "api";
1909
+ readonly version: 1;
1910
+ };
1418
1911
  readonly "node.started": {
1419
1912
  readonly payload: z.ZodObject<{
1420
1913
  path: z.ZodString;
@@ -1470,6 +1963,86 @@ export declare const EVENT_CATALOG: {
1470
1963
  readonly source: "api";
1471
1964
  readonly version: 1;
1472
1965
  };
1966
+ readonly "artifact.created": {
1967
+ readonly payload: z.ZodObject<{
1968
+ artifactId: z.ZodString;
1969
+ kind: z.ZodEnum<{
1970
+ file: "file";
1971
+ folder: "folder";
1972
+ }>;
1973
+ name: z.ZodString;
1974
+ contentType: z.ZodString;
1975
+ version: z.ZodNumber;
1976
+ size: z.ZodNumber;
1977
+ sha256: z.ZodString;
1978
+ source: z.ZodEnum<{
1979
+ engine: "engine";
1980
+ export: "export";
1981
+ upload: "upload";
1982
+ }>;
1983
+ callId: z.ZodOptional<z.ZodString>;
1984
+ fileCount: z.ZodOptional<z.ZodNumber>;
1985
+ claimed: z.ZodOptional<z.ZodBoolean>;
1986
+ }, z.core.$loose>;
1987
+ readonly source: "api";
1988
+ readonly version: 1;
1989
+ };
1990
+ readonly "artifact.version.created": {
1991
+ readonly payload: z.ZodObject<{
1992
+ artifactId: z.ZodString;
1993
+ kind: z.ZodEnum<{
1994
+ file: "file";
1995
+ folder: "folder";
1996
+ }>;
1997
+ name: z.ZodString;
1998
+ contentType: z.ZodString;
1999
+ version: z.ZodNumber;
2000
+ size: z.ZodNumber;
2001
+ sha256: z.ZodString;
2002
+ source: z.ZodEnum<{
2003
+ engine: "engine";
2004
+ export: "export";
2005
+ upload: "upload";
2006
+ }>;
2007
+ callId: z.ZodOptional<z.ZodString>;
2008
+ fileCount: z.ZodOptional<z.ZodNumber>;
2009
+ claimed: z.ZodOptional<z.ZodBoolean>;
2010
+ }, z.core.$loose>;
2011
+ readonly source: "api";
2012
+ readonly version: 1;
2013
+ };
2014
+ readonly "artifact.deleted": {
2015
+ readonly payload: z.ZodObject<{
2016
+ artifactId: z.ZodString;
2017
+ name: z.ZodString;
2018
+ }, z.core.$loose>;
2019
+ readonly source: "api";
2020
+ readonly version: 1;
2021
+ };
2022
+ readonly "artifact.export.skipped": {
2023
+ readonly payload: z.ZodObject<{
2024
+ name: z.ZodString;
2025
+ reason: z.ZodEnum<{
2026
+ file_too_large: "file_too_large";
2027
+ tenant_total: "tenant_total";
2028
+ too_large: "too_large";
2029
+ too_many_files: "too_many_files";
2030
+ }>;
2031
+ message: z.ZodString;
2032
+ limit: z.ZodOptional<z.ZodNumber>;
2033
+ path: z.ZodOptional<z.ZodString>;
2034
+ }, z.core.$loose>;
2035
+ readonly source: "api";
2036
+ readonly version: 1;
2037
+ };
2038
+ readonly "artifact.export.failed": {
2039
+ readonly payload: z.ZodObject<{
2040
+ name: z.ZodString;
2041
+ message: z.ZodString;
2042
+ }, z.core.$loose>;
2043
+ readonly source: "api";
2044
+ readonly version: 1;
2045
+ };
1473
2046
  readonly "transcript.updated": {
1474
2047
  readonly payload: z.ZodObject<{
1475
2048
  keep: z.ZodNumber;
@@ -1500,7 +2073,7 @@ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
1500
2073
  /** One schema per event type, keyed by type (the OpenAPI components). */
1501
2074
  export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
1502
2075
  /** 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">;
2076
+ 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
2077
  export type SessionEvent = {
1505
2078
  [T in EventType]: z.infer<EventSchemaOf<T>>;
1506
2079
  }[EventType];
@@ -1515,7 +2088,7 @@ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
1515
2088
  */
1516
2089
  export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
1517
2090
  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">>;
2091
+ 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
2092
  cursor: z.ZodNullable<z.ZodString>;
1520
2093
  }, z.core.$strip>;
1521
2094
  export type SessionItemsResponse = {
@@ -1637,6 +2210,20 @@ export declare const StreamRelayStatusSchema: z.ZodObject<{
1637
2210
  lagBytes: z.ZodOptional<z.ZodNumber>;
1638
2211
  }, z.core.$strict>;
1639
2212
  export type StreamRelayStatus = z.infer<typeof StreamRelayStatusSchema>;
2213
+ /**
2214
+ * The Tenant's harnesses (F6.2): `in-process` runs one in core's process; `remote` waits for
2215
+ * harnesses on the Harness API listener. `workspace` says one that serves the Tenant's
2216
+ * workspaces is connected.
2217
+ */
2218
+ export declare const HarnessStatusSchema: z.ZodObject<{
2219
+ mode: z.ZodEnum<{
2220
+ "in-process": "in-process";
2221
+ remote: "remote";
2222
+ }>;
2223
+ connected: z.ZodNumber;
2224
+ workspace: z.ZodBoolean;
2225
+ }, z.core.$strict>;
2226
+ export type HarnessStatus = z.infer<typeof HarnessStatusSchema>;
1640
2227
  export declare const HostAggregateSchema: z.ZodObject<{
1641
2228
  runningSessions: z.ZodNumber;
1642
2229
  inFlightDeliveries: z.ZodNumber;
@@ -1651,6 +2238,14 @@ export declare const HostAggregateSchema: z.ZodObject<{
1651
2238
  lastError: z.ZodNullable<z.ZodString>;
1652
2239
  lagBytes: z.ZodOptional<z.ZodNumber>;
1653
2240
  }, z.core.$strict>>;
2241
+ harness: z.ZodOptional<z.ZodObject<{
2242
+ mode: z.ZodEnum<{
2243
+ "in-process": "in-process";
2244
+ remote: "remote";
2245
+ }>;
2246
+ connected: z.ZodNumber;
2247
+ workspace: z.ZodBoolean;
2248
+ }, z.core.$strict>>;
1654
2249
  }, z.core.$strict>;
1655
2250
  export type HostAggregate = z.infer<typeof HostAggregateSchema>;
1656
2251
  export declare const AdminHostStatusSchema: z.ZodObject<{
@@ -1706,6 +2301,14 @@ export declare const AdminHostStatusSchema: z.ZodObject<{
1706
2301
  lastError: z.ZodNullable<z.ZodString>;
1707
2302
  lagBytes: z.ZodOptional<z.ZodNumber>;
1708
2303
  }, z.core.$strict>>;
2304
+ harness: z.ZodOptional<z.ZodObject<{
2305
+ mode: z.ZodEnum<{
2306
+ "in-process": "in-process";
2307
+ remote: "remote";
2308
+ }>;
2309
+ connected: z.ZodNumber;
2310
+ workspace: z.ZodBoolean;
2311
+ }, z.core.$strict>>;
1709
2312
  }, z.core.$strict>;
1710
2313
  }, z.core.$strict>;
1711
2314
  export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
@@ -1761,6 +2364,14 @@ export declare const AdminStatusSchema: z.ZodObject<{
1761
2364
  lastError: z.ZodNullable<z.ZodString>;
1762
2365
  lagBytes: z.ZodOptional<z.ZodNumber>;
1763
2366
  }, z.core.$strict>>;
2367
+ harness: z.ZodOptional<z.ZodObject<{
2368
+ mode: z.ZodEnum<{
2369
+ "in-process": "in-process";
2370
+ remote: "remote";
2371
+ }>;
2372
+ connected: z.ZodNumber;
2373
+ workspace: z.ZodBoolean;
2374
+ }, z.core.$strict>>;
1764
2375
  }, z.core.$strict>;
1765
2376
  host: z.ZodOptional<z.ZodObject<{
1766
2377
  hostId: z.ZodString;
@@ -1770,14 +2381,14 @@ export declare const AdminStatusSchema: z.ZodObject<{
1770
2381
  }, z.core.$strict>;
1771
2382
  export type AdminStatus = z.infer<typeof AdminStatusSchema>;
1772
2383
  /**
1773
- * `.nylorun/link.json`: the installation a Project uses. Format 2 (one Tenant per
1774
- * installation) names the local `stack` that `nylorun start` created or attached; `tenantId`
1775
- * is information only, since nothing in a request selects a Tenant. Formats 0 and 1 named a
1776
- * Tenant on a multi-Tenant Host of an older Runtime.
2384
+ * `.nylorun/link.json`: the installation a Project uses. Format 3 names the local `tenant`
2385
+ * that `nylorun start` created or attached; `tenantId` is information only, since nothing in a
2386
+ * request selects a Tenant. Formats 0–2 are from older releases; they parse so readers can say
2387
+ * why they refuse them.
1777
2388
  */
1778
2389
  export declare const ProjectLinkFileSchema: z.ZodObject<{
1779
- format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
1780
- stack: z.ZodOptional<z.ZodString>;
2390
+ format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
2391
+ tenant: z.ZodOptional<z.ZodString>;
1781
2392
  hostUrl: z.ZodString;
1782
2393
  hostId: z.ZodString;
1783
2394
  tenantId: z.ZodOptional<z.ZodString>;
@@ -1856,6 +2467,14 @@ export declare const TenantStatusSchema: z.ZodObject<{
1856
2467
  backend: z.ZodNullable<z.ZodString>;
1857
2468
  retained: z.ZodNumber;
1858
2469
  }, z.core.$strict>;
2470
+ harness: z.ZodOptional<z.ZodObject<{
2471
+ mode: z.ZodEnum<{
2472
+ "in-process": "in-process";
2473
+ remote: "remote";
2474
+ }>;
2475
+ connected: z.ZodNumber;
2476
+ workspace: z.ZodBoolean;
2477
+ }, z.core.$strict>>;
1859
2478
  execution: z.ZodOptional<z.ZodObject<{
1860
2479
  stuckInvocations: z.ZodArray<z.ZodObject<{
1861
2480
  id: z.ZodString;
@@ -1918,7 +2537,22 @@ export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
1918
2537
  memory: z.ZodOptional<z.ZodString>;
1919
2538
  }, z.core.$strict>>;
1920
2539
  idle: z.ZodOptional<z.ZodString>;
2540
+ sandboxes: z.ZodOptional<z.ZodNumber>;
2541
+ ttl: z.ZodOptional<z.ZodString>;
1921
2542
  }, z.core.$strict>>;
2543
+ lifecycle: z.ZodOptional<z.ZodObject<{
2544
+ onExpiry: z.ZodOptional<z.ZodEnum<{
2545
+ delete: "delete";
2546
+ retain: "retain";
2547
+ }>>;
2548
+ stopGrace: z.ZodOptional<z.ZodString>;
2549
+ }, z.core.$strict>>;
2550
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2551
+ hosts: z.ZodArray<z.ZodEnum<{
2552
+ "harness-container": "harness-container";
2553
+ sandbox: "sandbox";
2554
+ }>>;
2555
+ }, z.core.$strict>>>;
1922
2556
  }, z.core.$strict>>;
1923
2557
  }, z.core.$strict>>;
1924
2558
  model: z.ZodOptional<z.ZodObject<{
@@ -1966,9 +2600,10 @@ export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
1966
2600
  /**
1967
2601
  * Acting for a subject (Host feature `subject-headers`): what an application principal may
1968
2602
  * 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.
2603
+ * and vaults; the others reach Tenant-wide resources. `sandboxes:write` creates and deletes
2604
+ * sandboxes (Host feature `sandboxes`); a subject token's reach only the ids its `sbx` grants.
1970
2605
  */
1971
- export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "vaults:own", "tenant:settings"];
2606
+ export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "vaults:own", "tenant:settings", "sandboxes:write"];
1972
2607
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
1973
2608
  /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
1974
2609
  export declare function isSubject(value: unknown): value is string;
@@ -1985,7 +2620,9 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
1985
2620
  message: string;
1986
2621
  };
1987
2622
  /** 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"];
2623
+ export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "vaults:own", "sandboxes:write"];
2624
+ /** The most `sandboxes` grants one subject token carries (it is capped at 4 KiB). */
2625
+ export declare const TOKEN_SANDBOX_GRANTS_MAX = 16;
1989
2626
  export type TokenScope = (typeof TOKEN_SCOPES)[number];
1990
2627
  /** The JWT `typ` of a subject token (RFC 8725 explicit typing). */
1991
2628
  export declare const SUBJECT_TOKEN_TYPE = "nylorun-subject+jwt";
@@ -2007,6 +2644,7 @@ export type RoleLimits = z.infer<typeof RoleLimitsSchema>;
2007
2644
  export declare const AccessRoleSchema: z.ZodObject<{
2008
2645
  scopes: z.ZodArray<z.ZodEnum<{
2009
2646
  "agents:read": "agents:read";
2647
+ "sandboxes:write": "sandboxes:write";
2010
2648
  "sessions:own": "sessions:own";
2011
2649
  "vaults:own": "vaults:own";
2012
2650
  }>>;
@@ -2026,6 +2664,7 @@ export declare const AccessPolicySchema: z.ZodObject<{
2026
2664
  roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2027
2665
  scopes: z.ZodArray<z.ZodEnum<{
2028
2666
  "agents:read": "agents:read";
2667
+ "sandboxes:write": "sandboxes:write";
2029
2668
  "sessions:own": "sessions:own";
2030
2669
  "vaults:own": "vaults:own";
2031
2670
  }>>;
@@ -2053,6 +2692,7 @@ export declare const PutAccessPolicyRequestSchema: z.ZodObject<{
2053
2692
  roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2054
2693
  scopes: z.ZodArray<z.ZodEnum<{
2055
2694
  "agents:read": "agents:read";
2695
+ "sandboxes:write": "sandboxes:write";
2056
2696
  "sessions:own": "sessions:own";
2057
2697
  "vaults:own": "vaults:own";
2058
2698
  }>>;
@@ -2078,10 +2718,12 @@ export declare const CreateTokenRequestSchema: z.ZodObject<{
2078
2718
  role: z.ZodString;
2079
2719
  scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2080
2720
  "agents:read": "agents:read";
2721
+ "sandboxes:write": "sandboxes:write";
2081
2722
  "sessions:own": "sessions:own";
2082
2723
  "vaults:own": "vaults:own";
2083
2724
  }>>>;
2084
2725
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2726
+ sandboxes: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>>;
2085
2727
  ttlSeconds: z.ZodOptional<z.ZodNumber>;
2086
2728
  }, z.core.$strict>;
2087
2729
  export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
@@ -2092,10 +2734,12 @@ export declare const CreateTokenResponseSchema: z.ZodObject<{
2092
2734
  role: z.ZodString;
2093
2735
  scopes: z.ZodArray<z.ZodEnum<{
2094
2736
  "agents:read": "agents:read";
2737
+ "sandboxes:write": "sandboxes:write";
2095
2738
  "sessions:own": "sessions:own";
2096
2739
  "vaults:own": "vaults:own";
2097
2740
  }>>;
2098
2741
  agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2742
+ sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2099
2743
  keyId: z.ZodString;
2100
2744
  }, z.core.$strict>;
2101
2745
  export type CreateTokenResponse = z.infer<typeof CreateTokenResponseSchema>;
@@ -2201,6 +2845,8 @@ export interface SubjectTokenClaims {
2201
2845
  scp: string;
2202
2846
  /** The agents the mint narrowed the role to; absent when not narrowed. */
2203
2847
  agt?: string[];
2848
+ /** The sandboxes the token reaches: exact ids, or prefixes ending in `/*`. */
2849
+ sbx?: string[];
2204
2850
  /** The subject's revocation epoch when minted. */
2205
2851
  epc: number;
2206
2852
  iat: number;
@@ -2336,10 +2982,12 @@ export declare const SessionViewSchema: z.ZodObject<{
2336
2982
  credentialId: z.ZodString;
2337
2983
  }, z.core.$strict>>;
2338
2984
  sandboxOwnerId: z.ZodNullable<z.ZodString>;
2985
+ sandboxId: z.ZodOptional<z.ZodString>;
2339
2986
  sandbox: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2340
2987
  sandboxSource: z.ZodOptional<z.ZodEnum<{
2341
2988
  default: "default";
2342
2989
  inline: "inline";
2990
+ sandbox: "sandbox";
2343
2991
  shared: "shared";
2344
2992
  }>>;
2345
2993
  mcpSnapshot: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -2586,15 +3234,32 @@ export declare const EffectiveSandboxConfigSchema: z.ZodObject<{
2586
3234
  memoryMiB: z.ZodNumber;
2587
3235
  }, z.core.$strict>;
2588
3236
  idle: z.ZodString;
3237
+ sandboxes: z.ZodOptional<z.ZodNumber>;
3238
+ ttl: z.ZodOptional<z.ZodString>;
2589
3239
  }, z.core.$strict>;
3240
+ lifecycle: z.ZodOptional<z.ZodObject<{
3241
+ onExpiry: z.ZodEnum<{
3242
+ delete: "delete";
3243
+ retain: "retain";
3244
+ }>;
3245
+ stopGrace: z.ZodString;
3246
+ }, z.core.$strict>>;
3247
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3248
+ hosts: z.ZodArray<z.ZodEnum<{
3249
+ "harness-container": "harness-container";
3250
+ sandbox: "sandbox";
3251
+ }>>;
3252
+ }, z.core.$strict>>>;
2590
3253
  }, z.core.$strict>;
2591
3254
  export type EffectiveSandboxConfig = z.infer<typeof EffectiveSandboxConfigSchema>;
2592
3255
  /** `GET` and `PUT /v1/tenant/sandbox`: the backend chosen, and the configuration in force. */
2593
3256
  export declare const TenantSandboxViewSchema: z.ZodObject<{
2594
3257
  preference: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodEnum<{
3258
+ local: "local";
2595
3259
  virtual: "virtual";
2596
3260
  }>]>;
2597
3261
  backend: z.ZodNullable<z.ZodEnum<{
3262
+ local: "local";
2598
3263
  virtual: "virtual";
2599
3264
  }>>;
2600
3265
  isolation: z.ZodNullable<z.ZodEnum<{
@@ -2604,6 +3269,7 @@ export declare const TenantSandboxViewSchema: z.ZodObject<{
2604
3269
  reason: z.ZodString;
2605
3270
  probes: z.ZodArray<z.ZodObject<{
2606
3271
  name: z.ZodEnum<{
3272
+ local: "local";
2607
3273
  virtual: "virtual";
2608
3274
  }>;
2609
3275
  available: z.ZodBoolean;
@@ -2637,8 +3303,33 @@ export declare const TenantSandboxViewSchema: z.ZodObject<{
2637
3303
  memoryMiB: z.ZodNumber;
2638
3304
  }, z.core.$strict>;
2639
3305
  idle: z.ZodString;
3306
+ sandboxes: z.ZodOptional<z.ZodNumber>;
3307
+ ttl: z.ZodOptional<z.ZodString>;
2640
3308
  }, z.core.$strict>;
3309
+ lifecycle: z.ZodOptional<z.ZodObject<{
3310
+ onExpiry: z.ZodEnum<{
3311
+ delete: "delete";
3312
+ retain: "retain";
3313
+ }>;
3314
+ stopGrace: z.ZodString;
3315
+ }, z.core.$strict>>;
3316
+ placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3317
+ hosts: z.ZodArray<z.ZodEnum<{
3318
+ "harness-container": "harness-container";
3319
+ sandbox: "sandbox";
3320
+ }>>;
3321
+ }, z.core.$strict>>>;
2641
3322
  }, z.core.$strict>;
3323
+ cluster: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3324
+ namespace: z.ZodString;
3325
+ context: z.ZodString;
3326
+ ready: z.ZodBoolean;
3327
+ controllerVersion: z.ZodOptional<z.ZodString>;
3328
+ networkPolicy: z.ZodOptional<z.ZodObject<{
3329
+ enforced: z.ZodBoolean;
3330
+ probedAt: z.ZodOptional<z.ZodString>;
3331
+ }, z.core.$strip>>;
3332
+ }, z.core.$strip>>>;
2642
3333
  }, z.core.$strict>;
2643
3334
  export type TenantSandboxView = z.infer<typeof TenantSandboxViewSchema>;
2644
3335
  /** What a usage total or a budget covers: the whole Tenant, one agent, or one turn. */
@@ -2777,6 +3468,7 @@ export declare const AccessPolicyResponseSchema: z.ZodObject<{
2777
3468
  roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2778
3469
  scopes: z.ZodArray<z.ZodEnum<{
2779
3470
  "agents:read": "agents:read";
3471
+ "sandboxes:write": "sandboxes:write";
2780
3472
  "sessions:own": "sessions:own";
2781
3473
  "vaults:own": "vaults:own";
2782
3474
  }>>;
@@ -2831,9 +3523,15 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
2831
3523
  limit_exceeded: "limit_exceeded";
2832
3524
  not_found: "not_found";
2833
3525
  origin_rejected: "origin_rejected";
3526
+ placement_refused: "placement_refused";
2834
3527
  protocol_unsupported: "protocol_unsupported";
2835
3528
  request_rejected: "request_rejected";
2836
3529
  runtime_error: "runtime_error";
3530
+ sandbox_busy: "sandbox_busy";
3531
+ sandbox_expired: "sandbox_expired";
3532
+ sandbox_lost: "sandbox_lost";
3533
+ sandbox_not_granted: "sandbox_not_granted";
3534
+ sandbox_unavailable: "sandbox_unavailable";
2837
3535
  scope_required: "scope_required";
2838
3536
  session_busy: "session_busy";
2839
3537
  subject_invalid: "subject_invalid";
@@ -3248,3 +3946,264 @@ export declare function isFrameAncestor(value: string): boolean;
3248
3946
  * keywords, scheme-only entries and paths are refused with the entry named. Empty gives `[]`.
3249
3947
  */
3250
3948
  export declare function parseFrameAncestors(value: string): string[];
3949
+ /** The JWT `typ` of a capability link's token (RFC 8725 explicit typing). */
3950
+ export declare const ARTIFACT_LINK_TOKEN_TYPE = "nylorun-artifact+jwt";
3951
+ /**
3952
+ * A capability link lives no longer than a subject token: rotating signing keys revokes the
3953
+ * previous key once the longest token it may have signed has expired.
3954
+ */
3955
+ export declare const ARTIFACT_LINK_MAX_TTL_SECONDS = 900;
3956
+ export declare const ARTIFACT_LINK_DEFAULT_TTL_SECONDS = 300;
3957
+ /** A Tenant's limits when it sets none: 100 MiB per file, 10 GiB in all. */
3958
+ export declare const ARTIFACT_FILE_BYTES_DEFAULT: number;
3959
+ export declare const ARTIFACT_TOTAL_BYTES_DEFAULT: number;
3960
+ /** The longest artifact name, in characters. */
3961
+ export declare const ARTIFACT_NAME_MAX = 255;
3962
+ /** The longest path of a file in a folder artifact, in characters. */
3963
+ export declare const ARTIFACT_PATH_MAX = 1024;
3964
+ /** Labels: up to 32, keys 1–63 characters, values up to 256. */
3965
+ export declare const ArtifactLabelsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
3966
+ /**
3967
+ * One version of an artifact: immutable once it exists. A folder version's `size` is the sum of
3968
+ * its files' sizes and its `sha256` is its manifest's.
3969
+ */
3970
+ export declare const ArtifactVersionViewSchema: z.ZodObject<{
3971
+ version: z.ZodNumber;
3972
+ size: z.ZodNumber;
3973
+ sha256: z.ZodString;
3974
+ contentType: z.ZodString;
3975
+ source: z.ZodEnum<{
3976
+ engine: "engine";
3977
+ export: "export";
3978
+ upload: "upload";
3979
+ }>;
3980
+ createdAt: z.ZodString;
3981
+ }, z.core.$strict>;
3982
+ export type ArtifactVersionView = z.infer<typeof ArtifactVersionViewSchema>;
3983
+ /**
3984
+ * An artifact: an id, a name and numbered versions, its bytes in the Object store. A file's
3985
+ * version is its bytes; a folder's (F8.2) is a manifest of paths to content-addressed files.
3986
+ */
3987
+ export declare const ArtifactViewSchema: z.ZodObject<{
3988
+ artifactId: z.ZodString;
3989
+ kind: z.ZodEnum<{
3990
+ file: "file";
3991
+ folder: "folder";
3992
+ }>;
3993
+ name: z.ZodString;
3994
+ contentType: z.ZodString;
3995
+ sessionId: z.ZodOptional<z.ZodString>;
3996
+ latestVersion: z.ZodNumber;
3997
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3998
+ createdAt: z.ZodString;
3999
+ updatedAt: z.ZodString;
4000
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4001
+ version: z.ZodNumber;
4002
+ size: z.ZodNumber;
4003
+ sha256: z.ZodString;
4004
+ contentType: z.ZodString;
4005
+ source: z.ZodEnum<{
4006
+ engine: "engine";
4007
+ export: "export";
4008
+ upload: "upload";
4009
+ }>;
4010
+ createdAt: z.ZodString;
4011
+ }, z.core.$strict>>>;
4012
+ }, z.core.$strict>;
4013
+ export type ArtifactView = z.infer<typeof ArtifactViewSchema>;
4014
+ export declare const ListArtifactsResponseSchema: z.ZodObject<{
4015
+ artifacts: z.ZodArray<z.ZodObject<{
4016
+ artifactId: z.ZodString;
4017
+ kind: z.ZodEnum<{
4018
+ file: "file";
4019
+ folder: "folder";
4020
+ }>;
4021
+ name: z.ZodString;
4022
+ contentType: z.ZodString;
4023
+ sessionId: z.ZodOptional<z.ZodString>;
4024
+ latestVersion: z.ZodNumber;
4025
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4026
+ createdAt: z.ZodString;
4027
+ updatedAt: z.ZodString;
4028
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4029
+ version: z.ZodNumber;
4030
+ size: z.ZodNumber;
4031
+ sha256: z.ZodString;
4032
+ contentType: z.ZodString;
4033
+ source: z.ZodEnum<{
4034
+ engine: "engine";
4035
+ export: "export";
4036
+ upload: "upload";
4037
+ }>;
4038
+ createdAt: z.ZodString;
4039
+ }, z.core.$strict>>>;
4040
+ }, z.core.$strict>>;
4041
+ }, z.core.$strict>;
4042
+ export type ListArtifactsResponse = z.infer<typeof ListArtifactsResponseSchema>;
4043
+ /** What an upload answers: the artifact, and the version the upload created. */
4044
+ export declare const UploadArtifactResponseSchema: z.ZodObject<{
4045
+ artifact: z.ZodObject<{
4046
+ artifactId: z.ZodString;
4047
+ kind: z.ZodEnum<{
4048
+ file: "file";
4049
+ folder: "folder";
4050
+ }>;
4051
+ name: z.ZodString;
4052
+ contentType: z.ZodString;
4053
+ sessionId: z.ZodOptional<z.ZodString>;
4054
+ latestVersion: z.ZodNumber;
4055
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4056
+ createdAt: z.ZodString;
4057
+ updatedAt: z.ZodString;
4058
+ versions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4059
+ version: z.ZodNumber;
4060
+ size: z.ZodNumber;
4061
+ sha256: z.ZodString;
4062
+ contentType: z.ZodString;
4063
+ source: z.ZodEnum<{
4064
+ engine: "engine";
4065
+ export: "export";
4066
+ upload: "upload";
4067
+ }>;
4068
+ createdAt: z.ZodString;
4069
+ }, z.core.$strict>>>;
4070
+ }, z.core.$strict>;
4071
+ version: z.ZodObject<{
4072
+ version: z.ZodNumber;
4073
+ size: z.ZodNumber;
4074
+ sha256: z.ZodString;
4075
+ contentType: z.ZodString;
4076
+ source: z.ZodEnum<{
4077
+ engine: "engine";
4078
+ export: "export";
4079
+ upload: "upload";
4080
+ }>;
4081
+ createdAt: z.ZodString;
4082
+ }, z.core.$strict>;
4083
+ }, z.core.$strict>;
4084
+ export type UploadArtifactResponse = z.infer<typeof UploadArtifactResponseSchema>;
4085
+ export declare const DeleteArtifactResponseSchema: z.ZodObject<{
4086
+ artifactId: z.ZodString;
4087
+ deleted: z.ZodBoolean;
4088
+ }, z.core.$strict>;
4089
+ export type DeleteArtifactResponse = z.infer<typeof DeleteArtifactResponseSchema>;
4090
+ /** `POST /v1/artifacts/{id}/links`: a capability link to one version. */
4091
+ export declare const CreateArtifactLinkRequestSchema: z.ZodObject<{
4092
+ requestId: z.ZodOptional<z.ZodString>;
4093
+ version: z.ZodOptional<z.ZodNumber>;
4094
+ expiresIn: z.ZodOptional<z.ZodNumber>;
4095
+ file: z.ZodOptional<z.ZodString>;
4096
+ }, z.core.$strict>;
4097
+ export type CreateArtifactLinkRequest = z.infer<typeof CreateArtifactLinkRequestSchema>;
4098
+ /** A capability link: `GET` its path on the Runtime with no credential, until it expires. */
4099
+ export declare const ArtifactLinkSchema: z.ZodObject<{
4100
+ path: z.ZodString;
4101
+ artifactId: z.ZodString;
4102
+ version: z.ZodNumber;
4103
+ file: z.ZodOptional<z.ZodString>;
4104
+ expiresAt: z.ZodString;
4105
+ }, z.core.$strict>;
4106
+ export type ArtifactLink = z.infer<typeof ArtifactLinkSchema>;
4107
+ /** The media type of a folder artifact and of its manifests. */
4108
+ export declare const FOLDER_CONTENT_TYPE = "application/vnd.nylorun.folder+json";
4109
+ /** The manifest format a folder version is stored as. */
4110
+ export declare const FOLDER_MANIFEST_FORMAT = "nylorun.folder.v1";
4111
+ /** The folder artifact a session's turn-end export writes, one per session. */
4112
+ export declare const OUTPUTS_ARTIFACT_NAME = "outputs";
4113
+ /** The most files one turn-end export stores; past it the export is skipped. */
4114
+ export declare const EXPORT_MAX_FILES = 10000;
4115
+ /** The most bytes one turn-end export stores (before dedupe); past it the export is skipped. */
4116
+ export declare const EXPORT_MAX_BYTES: number;
4117
+ /** One file of a folder: its path in the folder (`/`-separated, relative), size, hash and type. */
4118
+ export declare const FolderEntrySchema: z.ZodObject<{
4119
+ path: z.ZodString;
4120
+ size: z.ZodNumber;
4121
+ sha256: z.ZodString;
4122
+ contentType: z.ZodString;
4123
+ }, z.core.$strict>;
4124
+ export type FolderEntry = z.infer<typeof FolderEntrySchema>;
4125
+ /**
4126
+ * A folder version as stored: the files, sorted by path, each naming its content-addressed
4127
+ * bytes by SHA-256. The one manifest format for folders, reused by P5's snapshots.
4128
+ */
4129
+ export declare const FolderManifestSchema: z.ZodObject<{
4130
+ format: z.ZodLiteral<"nylorun.folder.v1">;
4131
+ entries: z.ZodArray<z.ZodObject<{
4132
+ path: z.ZodString;
4133
+ size: z.ZodNumber;
4134
+ sha256: z.ZodString;
4135
+ contentType: z.ZodString;
4136
+ }, z.core.$strict>>;
4137
+ }, z.core.$strict>;
4138
+ export type FolderManifest = z.infer<typeof FolderManifestSchema>;
4139
+ /** `GET /v1/artifacts/{id}/versions/{n|latest}/tree`: a folder version's files. */
4140
+ export declare const ArtifactTreeSchema: z.ZodObject<{
4141
+ artifactId: z.ZodString;
4142
+ version: z.ZodNumber;
4143
+ entries: z.ZodArray<z.ZodObject<{
4144
+ path: z.ZodString;
4145
+ size: z.ZodNumber;
4146
+ sha256: z.ZodString;
4147
+ contentType: z.ZodString;
4148
+ }, z.core.$strict>>;
4149
+ }, z.core.$strict>;
4150
+ export type ArtifactTree = z.infer<typeof ArtifactTreeSchema>;
4151
+ /** `GET /v1/artifacts/{id}/versions/{n|latest}/diff?from=m`: what changed between two versions. */
4152
+ export declare const ArtifactDiffSchema: z.ZodObject<{
4153
+ artifactId: z.ZodString;
4154
+ from: z.ZodOptional<z.ZodNumber>;
4155
+ to: z.ZodNumber;
4156
+ added: z.ZodArray<z.ZodObject<{
4157
+ path: z.ZodString;
4158
+ size: z.ZodNumber;
4159
+ sha256: z.ZodString;
4160
+ contentType: z.ZodString;
4161
+ }, z.core.$strict>>;
4162
+ removed: z.ZodArray<z.ZodObject<{
4163
+ path: z.ZodString;
4164
+ size: z.ZodNumber;
4165
+ sha256: z.ZodString;
4166
+ contentType: z.ZodString;
4167
+ }, z.core.$strict>>;
4168
+ changed: z.ZodArray<z.ZodObject<{
4169
+ path: z.ZodString;
4170
+ from: z.ZodObject<{
4171
+ path: z.ZodString;
4172
+ size: z.ZodNumber;
4173
+ sha256: z.ZodString;
4174
+ contentType: z.ZodString;
4175
+ }, z.core.$strict>;
4176
+ to: z.ZodObject<{
4177
+ path: z.ZodString;
4178
+ size: z.ZodNumber;
4179
+ sha256: z.ZodString;
4180
+ contentType: z.ZodString;
4181
+ }, z.core.$strict>;
4182
+ }, z.core.$strict>>;
4183
+ }, z.core.$strict>;
4184
+ export type ArtifactDiff = z.infer<typeof ArtifactDiffSchema>;
4185
+ /** A Tenant's artifact limits, stored as Tenant setting `artifacts.config`. */
4186
+ export declare const TenantArtifactsConfigSchema: z.ZodObject<{
4187
+ limits: z.ZodOptional<z.ZodObject<{
4188
+ fileBytes: z.ZodOptional<z.ZodNumber>;
4189
+ totalBytes: z.ZodOptional<z.ZodNumber>;
4190
+ }, z.core.$strict>>;
4191
+ }, z.core.$strict>;
4192
+ export type TenantArtifactsConfig = z.infer<typeof TenantArtifactsConfigSchema>;
4193
+ /** `PUT /v1/tenant/artifacts`: replaces the Tenant's artifact configuration. */
4194
+ export declare const PutTenantArtifactsRequestSchema: z.ZodObject<{
4195
+ limits: z.ZodOptional<z.ZodObject<{
4196
+ fileBytes: z.ZodOptional<z.ZodNumber>;
4197
+ totalBytes: z.ZodOptional<z.ZodNumber>;
4198
+ }, z.core.$strict>>;
4199
+ requestId: z.ZodOptional<z.ZodString>;
4200
+ }, z.core.$strict>;
4201
+ export type PutTenantArtifactsRequest = z.infer<typeof PutTenantArtifactsRequestSchema>;
4202
+ export declare const TenantArtifactsViewSchema: z.ZodObject<{
4203
+ limits: z.ZodObject<{
4204
+ fileBytes: z.ZodNumber;
4205
+ totalBytes: z.ZodNumber;
4206
+ }, z.core.$strict>;
4207
+ usedBytes: z.ZodNumber;
4208
+ }, z.core.$strict>;
4209
+ export type TenantArtifactsView = z.infer<typeof TenantArtifactsViewSchema>;