@pstdio/pocketcoder-sdk 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -14,16 +14,56 @@ declare function splitAttachmentManifest(content: string): {
14
14
  attachments: AttachmentDescriptor[] | null;
15
15
  };
16
16
  //#endregion
17
+ //#region ../contracts/src/attachments/input-reference.d.ts
18
+ declare const InputObjectReferenceSchema: z.ZodObject<{
19
+ workspaceId: z.ZodUUID;
20
+ fileId: z.ZodUUID;
21
+ objectVersion: z.ZodString;
22
+ name: z.ZodString;
23
+ mediaType: z.ZodString;
24
+ sizeBytes: z.ZodNumber;
25
+ digest: z.ZodString;
26
+ visibility: z.ZodEnum<{
27
+ ready: "ready";
28
+ expired: "expired";
29
+ unavailable: "unavailable";
30
+ }>;
31
+ }, z.core.$strict>;
32
+ type InputObjectReference = z.infer<typeof InputObjectReferenceSchema>;
33
+ declare const AcceptedInputManifestSchema: z.ZodObject<{
34
+ workspaceId: z.ZodUUID;
35
+ incarnationId: z.ZodString;
36
+ digest: z.ZodString;
37
+ objects: z.ZodArray<z.ZodObject<{
38
+ workspaceId: z.ZodUUID;
39
+ fileId: z.ZodUUID;
40
+ objectVersion: z.ZodString;
41
+ name: z.ZodString;
42
+ mediaType: z.ZodString;
43
+ sizeBytes: z.ZodNumber;
44
+ digest: z.ZodString;
45
+ visibility: z.ZodEnum<{
46
+ ready: "ready";
47
+ expired: "expired";
48
+ unavailable: "unavailable";
49
+ }>;
50
+ }, z.core.$strict>>;
51
+ }, z.core.$strict>;
52
+ type AcceptedInputManifest = z.infer<typeof AcceptedInputManifestSchema>;
53
+ //#endregion
17
54
  //#region ../contracts/src/auth/keys.d.ts
18
55
  declare const KeyIssueRequestSchema: z.ZodObject<{
19
56
  request_id: z.ZodString;
20
57
  scopes: z.ZodArray<z.ZodEnum<{
21
58
  "templates:read": "templates:read";
59
+ "templates:write": "templates:write";
60
+ "secrets:write": "secrets:write";
22
61
  "workspaces:create": "workspaces:create";
23
62
  "workspaces:read": "workspaces:read";
24
63
  "workspaces:cancel": "workspaces:cancel";
25
64
  "workspaces:purge": "workspaces:purge";
26
65
  "workspaces:recover": "workspaces:recover";
66
+ "principals:admin": "principals:admin";
27
67
  "keys:read": "keys:read";
28
68
  "keys:write": "keys:write";
29
69
  "workspaces:preserve": "workspaces:preserve";
@@ -32,8 +72,12 @@ declare const KeyIssueRequestSchema: z.ZodObject<{
32
72
  "checkpoints:delete": "checkpoints:delete";
33
73
  "outputs:read": "outputs:read";
34
74
  "conversations:read": "conversations:read";
75
+ "conversations:write": "conversations:write";
35
76
  "conversations:delete": "conversations:delete";
36
77
  "services:relay": "services:relay";
78
+ "previews:open": "previews:open";
79
+ "display:view": "display:view";
80
+ "display:control": "display:control";
37
81
  "attachments:write": "attachments:write";
38
82
  "logs:read": "logs:read";
39
83
  "network:read": "network:read";
@@ -41,14 +85,23 @@ declare const KeyIssueRequestSchema: z.ZodObject<{
41
85
  "terminal:read": "terminal:read";
42
86
  admin: "admin";
43
87
  }>>;
88
+ templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ managed_principal_ids: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
44
90
  expires_at: z.ZodISODateTime;
45
91
  }, z.core.$strict>;
46
92
  type KeyIssueRequest = z.infer<typeof KeyIssueRequestSchema>;
93
+ declare const KeyRotateRequestSchema: z.ZodObject<{
94
+ expires_at: z.ZodOptional<z.ZodISODateTime>;
95
+ request_id: z.ZodString;
96
+ }, z.core.$strict>;
97
+ type KeyRotateRequest = z.infer<typeof KeyRotateRequestSchema>;
47
98
  declare const KeyResourceSchema: z.ZodObject<{
48
99
  id: z.ZodUUID;
49
100
  principal_id: z.ZodUUID;
50
101
  scopes: z.ZodArray<z.ZodString>;
51
102
  effective_scopes: z.ZodArray<z.ZodString>;
103
+ templates: z.ZodNullable<z.ZodArray<z.ZodString>>;
104
+ effective_templates: z.ZodArray<z.ZodString>;
52
105
  managed_principal_ids: z.ZodArray<z.ZodUUID>;
53
106
  issuance_request_id: z.ZodNullable<z.ZodString>;
54
107
  created_at: z.ZodISODateTime;
@@ -63,6 +116,8 @@ declare const KeyIssueResponseSchema: z.ZodObject<{
63
116
  principal_id: z.ZodUUID;
64
117
  scopes: z.ZodArray<z.ZodString>;
65
118
  effective_scopes: z.ZodArray<z.ZodString>;
119
+ templates: z.ZodNullable<z.ZodArray<z.ZodString>>;
120
+ effective_templates: z.ZodArray<z.ZodString>;
66
121
  managed_principal_ids: z.ZodArray<z.ZodUUID>;
67
122
  issuance_request_id: z.ZodNullable<z.ZodString>;
68
123
  created_at: z.ZodISODateTime;
@@ -79,6 +134,8 @@ declare const KeyListResponseSchema: z.ZodObject<{
79
134
  principal_id: z.ZodUUID;
80
135
  scopes: z.ZodArray<z.ZodString>;
81
136
  effective_scopes: z.ZodArray<z.ZodString>;
137
+ templates: z.ZodNullable<z.ZodArray<z.ZodString>>;
138
+ effective_templates: z.ZodArray<z.ZodString>;
82
139
  managed_principal_ids: z.ZodArray<z.ZodUUID>;
83
140
  issuance_request_id: z.ZodNullable<z.ZodString>;
84
141
  created_at: z.ZodISODateTime;
@@ -90,19 +147,105 @@ declare const KeyListResponseSchema: z.ZodObject<{
90
147
  }, z.core.$strip>;
91
148
  type KeyListResponse = z.infer<typeof KeyListResponseSchema>;
92
149
  //#endregion
150
+ //#region ../contracts/src/auth/principals.d.ts
151
+ declare const PrincipalCreateRequestSchema: z.ZodObject<{
152
+ scopes: z.ZodArray<z.ZodEnum<{
153
+ "templates:read": "templates:read";
154
+ "templates:write": "templates:write";
155
+ "secrets:write": "secrets:write";
156
+ "workspaces:create": "workspaces:create";
157
+ "workspaces:read": "workspaces:read";
158
+ "workspaces:cancel": "workspaces:cancel";
159
+ "workspaces:purge": "workspaces:purge";
160
+ "workspaces:recover": "workspaces:recover";
161
+ "principals:admin": "principals:admin";
162
+ "keys:read": "keys:read";
163
+ "keys:write": "keys:write";
164
+ "workspaces:preserve": "workspaces:preserve";
165
+ "workspaces:restore": "workspaces:restore";
166
+ "checkpoints:read": "checkpoints:read";
167
+ "checkpoints:delete": "checkpoints:delete";
168
+ "outputs:read": "outputs:read";
169
+ "conversations:read": "conversations:read";
170
+ "conversations:write": "conversations:write";
171
+ "conversations:delete": "conversations:delete";
172
+ "services:relay": "services:relay";
173
+ "previews:open": "previews:open";
174
+ "display:view": "display:view";
175
+ "display:control": "display:control";
176
+ "attachments:write": "attachments:write";
177
+ "logs:read": "logs:read";
178
+ "network:read": "network:read";
179
+ "terminal:attach": "terminal:attach";
180
+ "terminal:read": "terminal:read";
181
+ admin: "admin";
182
+ }>>;
183
+ templates: z.ZodArray<z.ZodString>;
184
+ name: z.ZodString;
185
+ }, z.core.$strict>;
186
+ type PrincipalCreateRequest = z.infer<typeof PrincipalCreateRequestSchema>;
187
+ declare const PrincipalResourceSchema: z.ZodObject<{
188
+ id: z.ZodUUID;
189
+ name: z.ZodString;
190
+ scopes: z.ZodArray<z.ZodString>;
191
+ templates: z.ZodArray<z.ZodString>;
192
+ disabled_at: z.ZodNullable<z.ZodISODateTime>;
193
+ created_at: z.ZodISODateTime;
194
+ }, z.core.$strip>;
195
+ type PrincipalResource = z.infer<typeof PrincipalResourceSchema>;
196
+ declare const PrincipalUpdateRequestSchema: z.ZodObject<{
197
+ scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
198
+ "templates:read": "templates:read";
199
+ "templates:write": "templates:write";
200
+ "secrets:write": "secrets:write";
201
+ "workspaces:create": "workspaces:create";
202
+ "workspaces:read": "workspaces:read";
203
+ "workspaces:cancel": "workspaces:cancel";
204
+ "workspaces:purge": "workspaces:purge";
205
+ "workspaces:recover": "workspaces:recover";
206
+ "principals:admin": "principals:admin";
207
+ "keys:read": "keys:read";
208
+ "keys:write": "keys:write";
209
+ "workspaces:preserve": "workspaces:preserve";
210
+ "workspaces:restore": "workspaces:restore";
211
+ "checkpoints:read": "checkpoints:read";
212
+ "checkpoints:delete": "checkpoints:delete";
213
+ "outputs:read": "outputs:read";
214
+ "conversations:read": "conversations:read";
215
+ "conversations:write": "conversations:write";
216
+ "conversations:delete": "conversations:delete";
217
+ "services:relay": "services:relay";
218
+ "previews:open": "previews:open";
219
+ "display:view": "display:view";
220
+ "display:control": "display:control";
221
+ "attachments:write": "attachments:write";
222
+ "logs:read": "logs:read";
223
+ "network:read": "network:read";
224
+ "terminal:attach": "terminal:attach";
225
+ "terminal:read": "terminal:read";
226
+ admin: "admin";
227
+ }>>>;
228
+ templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ disabled: z.ZodOptional<z.ZodBoolean>;
230
+ }, z.core.$strict>;
231
+ type PrincipalUpdateRequest = z.infer<typeof PrincipalUpdateRequestSchema>;
232
+ //#endregion
93
233
  //#region ../contracts/src/common/errors.d.ts
94
234
  declare const ERROR_CODES: {
95
235
  readonly "auth.invalid_key": 401;
96
236
  readonly "auth.missing_scope": 403;
97
237
  readonly "auth.disabled_principal": 403;
98
238
  readonly "principal.not_found": 404;
239
+ readonly "principal.name_conflict": 409;
99
240
  readonly "key.not_found": 404;
241
+ readonly "request.body_too_large": 413;
100
242
  readonly "validation.invalid": 400;
101
243
  readonly "idempotency.conflict": 409;
102
244
  readonly "capacity.queue_full": 429;
103
245
  readonly "capacity.waiters_full": 429;
104
246
  readonly "template.not_found": 404;
105
247
  readonly "template.version_not_found": 404;
248
+ readonly "template.version_immutable": 409;
106
249
  readonly "template.not_authorized": 403;
107
250
  readonly "workspace.not_found": 404;
108
251
  readonly "workspace.external_id_conflict": 409;
@@ -117,6 +260,10 @@ declare const ERROR_CODES: {
117
260
  readonly "workspace.persistence_not_enabled": 409;
118
261
  readonly "workspace.preserving": 409;
119
262
  readonly "checkpoint.not_found": 404;
263
+ readonly "checkpoint.unsupported": 409;
264
+ readonly "artifact.not_found": 404;
265
+ readonly "artifact.workspace_active": 409;
266
+ readonly "artifact.too_large": 413;
120
267
  readonly "checkpoint.not_ready": 409;
121
268
  readonly "checkpoint.none_ready": 409;
122
269
  readonly "checkpoint.corrupt": 409;
@@ -126,29 +273,108 @@ declare const ERROR_CODES: {
126
273
  readonly "restore.image_unavailable": 409;
127
274
  readonly "restore.incompatible": 409;
128
275
  readonly "resume.unsupported": 409;
276
+ readonly "conversation.not_found": 404;
129
277
  readonly "conversation.expired": 410;
130
278
  readonly "conversation.deleted": 410;
131
279
  readonly "operation.conflict": 409;
132
280
  readonly "source.not_allowed": 422;
133
281
  readonly "source.invalid_revision": 422;
134
282
  readonly "secret.unavailable": 503;
283
+ readonly "secret.not_found": 404;
135
284
  readonly "storage.capacity_exhausted": 507;
136
285
  readonly "relay.body_too_large": 413;
137
286
  readonly "relay.route_not_allowed": 422;
138
287
  readonly "relay.streaming_unsupported": 409;
139
288
  readonly "relay.deadline_exceeded": 504;
140
289
  readonly "relay.upstream_error": 502;
290
+ readonly "agent.interrupt_unsupported": 409;
141
291
  readonly "attachment.invalid": 400;
142
292
  readonly "attachment.too_large": 413;
143
293
  readonly "attachment.not_found": 404;
144
294
  readonly "attachment.conflict": 409;
145
295
  readonly "attachment.unsupported": 409;
146
296
  readonly "attachment.interrupted": 503;
297
+ readonly "maintenance.active": 503;
298
+ readonly "maintenance.timeout": 503;
299
+ readonly "backup.failed": 409;
300
+ readonly "journal.pending": 503;
301
+ readonly "account.purged": 409;
302
+ readonly "account.purge_pending": 503;
303
+ readonly "recovery.required": 503;
304
+ readonly "recovery.failed": 409;
147
305
  readonly "internal.error": 500;
148
306
  };
149
307
  type ErrorCode = keyof typeof ERROR_CODES;
150
308
  //#endregion
151
309
  //#region ../contracts/src/conversations/conversation.d.ts
310
+ declare const ConversationMessageInputSchema: z.ZodObject<{
311
+ message_id: z.ZodString;
312
+ role: z.ZodEnum<{
313
+ user: "user";
314
+ assistant: "assistant";
315
+ system: "system";
316
+ tool: "tool";
317
+ }>;
318
+ content: z.ZodString;
319
+ occurred_at: z.ZodISODateTime;
320
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
321
+ identity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
322
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
323
+ authority: z.ZodEnum<{
324
+ external: "external";
325
+ generic: "generic";
326
+ }>;
327
+ conversation_id: z.ZodUUID;
328
+ request_id: z.ZodUUID;
329
+ turn_id: z.ZodUUID;
330
+ request_fingerprint: z.ZodString;
331
+ event_id: z.ZodUUID;
332
+ message_id: z.ZodString;
333
+ sequence: z.ZodNumber;
334
+ revision: z.ZodNumber;
335
+ fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
336
+ type: z.ZodLiteral<"intermediate">;
337
+ }, z.core.$strip>, z.ZodObject<{
338
+ type: z.ZodLiteral<"final_response">;
339
+ }, z.core.$strip>, z.ZodObject<{
340
+ type: z.ZodLiteral<"tool_only">;
341
+ }, z.core.$strip>, z.ZodObject<{
342
+ type: z.ZodLiteral<"activity_started">;
343
+ activity_id: z.ZodUUID;
344
+ kind: z.ZodEnum<{
345
+ workspace: "workspace";
346
+ tool: "tool";
347
+ attachment: "attachment";
348
+ retrieval: "retrieval";
349
+ }>;
350
+ label: z.ZodString;
351
+ started_at: z.ZodNullable<z.ZodISODateTime>;
352
+ action: z.ZodOptional<z.ZodString>;
353
+ subject: z.ZodOptional<z.ZodString>;
354
+ }, z.core.$strip>, z.ZodObject<{
355
+ type: z.ZodLiteral<"activity_finished">;
356
+ activity_id: z.ZodUUID;
357
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
358
+ outcome: z.ZodEnum<{
359
+ failed: "failed";
360
+ canceled: "canceled";
361
+ completed: "completed";
362
+ interrupted: "interrupted";
363
+ }>;
364
+ }, z.core.$strip>, z.ZodObject<{
365
+ type: z.ZodLiteral<"turn_terminal">;
366
+ outcome: z.ZodEnum<{
367
+ failed: "failed";
368
+ canceled: "canceled";
369
+ completed: "completed";
370
+ interrupted: "interrupted";
371
+ lost: "lost";
372
+ }>;
373
+ reason: z.ZodOptional<z.ZodString>;
374
+ }, z.core.$strip>], "type">>;
375
+ }, z.core.$strip>>>;
376
+ }, z.core.$strip>;
377
+ type ConversationMessageInput = z.infer<typeof ConversationMessageInputSchema>;
152
378
  declare const ConversationMessageResourceSchema: z.ZodObject<{
153
379
  message_id: z.ZodString;
154
380
  role: z.ZodEnum<{
@@ -161,26 +387,199 @@ declare const ConversationMessageResourceSchema: z.ZodObject<{
161
387
  occurred_at: z.ZodISODateTime;
162
388
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
163
389
  seq: z.ZodNumber;
390
+ identity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
391
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
392
+ authority: z.ZodEnum<{
393
+ external: "external";
394
+ generic: "generic";
395
+ }>;
396
+ conversation_id: z.ZodUUID;
397
+ request_id: z.ZodUUID;
398
+ turn_id: z.ZodUUID;
399
+ request_fingerprint: z.ZodString;
400
+ event_id: z.ZodUUID;
401
+ message_id: z.ZodString;
402
+ sequence: z.ZodNumber;
403
+ revision: z.ZodNumber;
404
+ fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
405
+ type: z.ZodLiteral<"intermediate">;
406
+ }, z.core.$strip>, z.ZodObject<{
407
+ type: z.ZodLiteral<"final_response">;
408
+ }, z.core.$strip>, z.ZodObject<{
409
+ type: z.ZodLiteral<"tool_only">;
410
+ }, z.core.$strip>, z.ZodObject<{
411
+ type: z.ZodLiteral<"activity_started">;
412
+ activity_id: z.ZodUUID;
413
+ kind: z.ZodEnum<{
414
+ workspace: "workspace";
415
+ tool: "tool";
416
+ attachment: "attachment";
417
+ retrieval: "retrieval";
418
+ }>;
419
+ label: z.ZodString;
420
+ started_at: z.ZodNullable<z.ZodISODateTime>;
421
+ action: z.ZodOptional<z.ZodString>;
422
+ subject: z.ZodOptional<z.ZodString>;
423
+ }, z.core.$strip>, z.ZodObject<{
424
+ type: z.ZodLiteral<"activity_finished">;
425
+ activity_id: z.ZodUUID;
426
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
427
+ outcome: z.ZodEnum<{
428
+ failed: "failed";
429
+ canceled: "canceled";
430
+ completed: "completed";
431
+ interrupted: "interrupted";
432
+ }>;
433
+ }, z.core.$strip>, z.ZodObject<{
434
+ type: z.ZodLiteral<"turn_terminal">;
435
+ outcome: z.ZodEnum<{
436
+ failed: "failed";
437
+ canceled: "canceled";
438
+ completed: "completed";
439
+ interrupted: "interrupted";
440
+ lost: "lost";
441
+ }>;
442
+ reason: z.ZodOptional<z.ZodString>;
443
+ }, z.core.$strip>], "type">>;
444
+ }, z.core.$strip>>>;
164
445
  }, z.core.$strip>;
165
446
  type ConversationMessageResource = z.infer<typeof ConversationMessageResourceSchema>;
166
447
  //#endregion
448
+ //#region ../contracts/src/conversations/identity.d.ts
449
+ declare const ConversationRequestIdentitySchema: z.ZodObject<{
450
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
451
+ authority: z.ZodEnum<{
452
+ external: "external";
453
+ generic: "generic";
454
+ }>;
455
+ conversation_id: z.ZodUUID;
456
+ request_id: z.ZodUUID;
457
+ turn_id: z.ZodUUID;
458
+ request_fingerprint: z.ZodString;
459
+ }, z.core.$strip>;
460
+ type ConversationRequestIdentity = z.infer<typeof ConversationRequestIdentitySchema>;
461
+ declare const ConversationMessageIdentitySchema: z.ZodObject<{
462
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
463
+ authority: z.ZodEnum<{
464
+ external: "external";
465
+ generic: "generic";
466
+ }>;
467
+ conversation_id: z.ZodUUID;
468
+ request_id: z.ZodUUID;
469
+ turn_id: z.ZodUUID;
470
+ request_fingerprint: z.ZodString;
471
+ event_id: z.ZodUUID;
472
+ message_id: z.ZodString;
473
+ sequence: z.ZodNumber;
474
+ revision: z.ZodNumber;
475
+ fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
476
+ type: z.ZodLiteral<"intermediate">;
477
+ }, z.core.$strip>, z.ZodObject<{
478
+ type: z.ZodLiteral<"final_response">;
479
+ }, z.core.$strip>, z.ZodObject<{
480
+ type: z.ZodLiteral<"tool_only">;
481
+ }, z.core.$strip>, z.ZodObject<{
482
+ type: z.ZodLiteral<"activity_started">;
483
+ activity_id: z.ZodUUID;
484
+ kind: z.ZodEnum<{
485
+ workspace: "workspace";
486
+ tool: "tool";
487
+ attachment: "attachment";
488
+ retrieval: "retrieval";
489
+ }>;
490
+ label: z.ZodString;
491
+ started_at: z.ZodNullable<z.ZodISODateTime>;
492
+ action: z.ZodOptional<z.ZodString>;
493
+ subject: z.ZodOptional<z.ZodString>;
494
+ }, z.core.$strip>, z.ZodObject<{
495
+ type: z.ZodLiteral<"activity_finished">;
496
+ activity_id: z.ZodUUID;
497
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
498
+ outcome: z.ZodEnum<{
499
+ failed: "failed";
500
+ canceled: "canceled";
501
+ completed: "completed";
502
+ interrupted: "interrupted";
503
+ }>;
504
+ }, z.core.$strip>, z.ZodObject<{
505
+ type: z.ZodLiteral<"turn_terminal">;
506
+ outcome: z.ZodEnum<{
507
+ failed: "failed";
508
+ canceled: "canceled";
509
+ completed: "completed";
510
+ interrupted: "interrupted";
511
+ lost: "lost";
512
+ }>;
513
+ reason: z.ZodOptional<z.ZodString>;
514
+ }, z.core.$strip>], "type">>;
515
+ }, z.core.$strip>;
516
+ type ConversationMessageIdentity = z.infer<typeof ConversationMessageIdentitySchema>;
517
+ //#endregion
518
+ //#region ../contracts/src/displays/display.d.ts
519
+ declare const BrowserActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
520
+ action: z.ZodLiteral<"navigate">;
521
+ url: z.ZodString;
522
+ }, z.core.$strict>, z.ZodObject<{
523
+ action: z.ZodLiteral<"click">;
524
+ x: z.ZodNumber;
525
+ y: z.ZodNumber;
526
+ }, z.core.$strict>, z.ZodObject<{
527
+ action: z.ZodLiteral<"text">;
528
+ text: z.ZodString;
529
+ }, z.core.$strict>, z.ZodObject<{
530
+ action: z.ZodLiteral<"key">;
531
+ key: z.ZodEnum<{
532
+ Enter: "Enter";
533
+ Tab: "Tab";
534
+ Backspace: "Backspace";
535
+ Delete: "Delete";
536
+ Escape: "Escape";
537
+ ArrowLeft: "ArrowLeft";
538
+ ArrowRight: "ArrowRight";
539
+ ArrowUp: "ArrowUp";
540
+ ArrowDown: "ArrowDown";
541
+ Home: "Home";
542
+ End: "End";
543
+ PageUp: "PageUp";
544
+ PageDown: "PageDown";
545
+ }>;
546
+ }, z.core.$strict>, z.ZodObject<{
547
+ action: z.ZodLiteral<"scroll">;
548
+ x: z.ZodNumber;
549
+ y: z.ZodNumber;
550
+ deltaY: z.ZodNumber;
551
+ }, z.core.$strict>], "action">;
552
+ type BrowserAction = z.infer<typeof BrowserActionSchema>;
553
+ //#endregion
554
+ //#region ../contracts/src/displays/screenshot.d.ts
555
+ declare const ScreenshotResourceSchema: z.ZodObject<{
556
+ kind: z.ZodLiteral<"screenshot">;
557
+ id: z.ZodUUID;
558
+ workspace_id: z.ZodUUID;
559
+ content_type: z.ZodLiteral<"image/png">;
560
+ bytes: z.ZodNumber;
561
+ digest: z.ZodString;
562
+ expires_at: z.ZodISODateTime;
563
+ }, z.core.$strict>;
564
+ type ScreenshotResource = z.infer<typeof ScreenshotResourceSchema>;
565
+ //#endregion
167
566
  //#region ../contracts/src/network/network.d.ts
168
567
  declare const NetworkEventSchema: z.ZodObject<{
568
+ method: z.ZodDefault<z.ZodNullable<z.ZodString>>;
169
569
  path: z.ZodDefault<z.ZodNullable<z.ZodString>>;
570
+ reason: z.ZodString;
170
571
  occurred_at: z.ZodISODateTime;
171
- decision: z.ZodEnum<{
172
- allow: "allow";
173
- deny: "deny";
174
- }>;
175
572
  transport: z.ZodEnum<{
176
573
  http: "http";
177
574
  https: "https";
178
575
  }>;
179
- host: z.ZodString;
180
576
  port: z.ZodNumber;
181
- method: z.ZodDefault<z.ZodNullable<z.ZodString>>;
577
+ decision: z.ZodEnum<{
578
+ allow: "allow";
579
+ deny: "deny";
580
+ }>;
581
+ host: z.ZodString;
182
582
  matched_rule: z.ZodDefault<z.ZodNullable<z.ZodString>>;
183
- reason: z.ZodString;
184
583
  seq: z.ZodNumber;
185
584
  workspace_id: z.ZodUUID;
186
585
  source_session_id: z.ZodUUID;
@@ -188,6 +587,52 @@ declare const NetworkEventSchema: z.ZodObject<{
188
587
  }, z.core.$strip>;
189
588
  type NetworkEvent = z.infer<typeof NetworkEventSchema>;
190
589
  //#endregion
590
+ //#region ../contracts/src/outputs/export-reference.d.ts
591
+ declare const ExportObjectReferenceSchema: z.ZodObject<{
592
+ objectId: z.ZodUUID;
593
+ objectVersion: z.ZodString;
594
+ name: z.ZodString;
595
+ sizeBytes: z.ZodNumber;
596
+ mediaType: z.ZodString;
597
+ digest: z.ZodString;
598
+ }, z.core.$strict>;
599
+ type ExportObjectReference = z.infer<typeof ExportObjectReferenceSchema>;
600
+ declare const WorkloadExportReferenceSchema: z.ZodObject<{
601
+ exportId: z.ZodUUID;
602
+ execution: z.ZodObject<{
603
+ workspaceId: z.ZodUUID;
604
+ incarnationId: z.ZodString;
605
+ owner: z.ZodEnum<{
606
+ process: "process";
607
+ "conversation-request": "conversation-request";
608
+ }>;
609
+ requestId: z.ZodUUID;
610
+ }, z.core.$strict>;
611
+ manifestDigest: z.ZodString;
612
+ completeness: z.ZodEnum<{
613
+ lost: "lost";
614
+ complete: "complete";
615
+ partial: "partial";
616
+ }>;
617
+ publication: z.ZodEnum<{
618
+ expired: "expired";
619
+ unavailable: "unavailable";
620
+ published: "published";
621
+ }>;
622
+ objects: z.ZodArray<z.ZodObject<{
623
+ objectId: z.ZodUUID;
624
+ objectVersion: z.ZodString;
625
+ name: z.ZodString;
626
+ sizeBytes: z.ZodNumber;
627
+ mediaType: z.ZodString;
628
+ digest: z.ZodString;
629
+ }, z.core.$strict>>;
630
+ errors: z.ZodArray<z.ZodString>;
631
+ publishedAt: z.ZodISODateTime;
632
+ expiresAt: z.ZodISODateTime;
633
+ }, z.core.$strict>;
634
+ type WorkloadExportReference = z.infer<typeof WorkloadExportReferenceSchema>;
635
+ //#endregion
191
636
  //#region ../contracts/src/persistence/persistence.d.ts
192
637
  declare const CHECKPOINT_STATES: readonly ["creating", "ready", "failed", "deleting", "deleted"];
193
638
  type CheckpointState = (typeof CHECKPOINT_STATES)[number];
@@ -201,11 +646,11 @@ declare const CheckpointResourceSchema: z.ZodObject<{
201
646
  id: z.ZodUUID;
202
647
  workspace_id: z.ZodUUID;
203
648
  state: z.ZodEnum<{
649
+ deleted: "deleted";
204
650
  creating: "creating";
205
651
  ready: "ready";
206
652
  failed: "failed";
207
653
  deleting: "deleting";
208
- deleted: "deleted";
209
654
  }>;
210
655
  reason_code: z.ZodNullable<z.ZodString>;
211
656
  template: z.ZodObject<{
@@ -219,9 +664,9 @@ declare const CheckpointResourceSchema: z.ZodObject<{
219
664
  file_count: z.ZodNullable<z.ZodNumber>;
220
665
  mounts: z.ZodArray<z.ZodString>;
221
666
  conversation_restore: z.ZodEnum<{
667
+ unknown: "unknown";
222
668
  supported: "supported";
223
669
  filesystem_only: "filesystem_only";
224
- unknown: "unknown";
225
670
  }>;
226
671
  label: z.ZodNullable<z.ZodString>;
227
672
  created_at: z.ZodISODateTime;
@@ -232,8 +677,8 @@ type CheckpointResource = z.infer<typeof CheckpointResourceSchema>;
232
677
  declare const OperationResourceSchema: z.ZodObject<{
233
678
  id: z.ZodUUID;
234
679
  kind: z.ZodEnum<{
235
- restore: "restore";
236
680
  preserve: "preserve";
681
+ restore: "restore";
237
682
  verify: "verify";
238
683
  delete: "delete";
239
684
  purge: "purge";
@@ -265,6 +710,17 @@ declare const RestoreRequestSchema: z.ZodObject<{
265
710
  }, z.core.$strip>;
266
711
  type RestoreRequest = z.infer<typeof RestoreRequestSchema>;
267
712
  //#endregion
713
+ //#region ../contracts/src/previews/view-session.d.ts
714
+ declare const ViewSessionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
715
+ mode: z.ZodLiteral<"local">;
716
+ }, z.core.$strict>, z.ZodObject<{
717
+ mode: z.ZodLiteral<"top_level">;
718
+ }, z.core.$strict>, z.ZodObject<{
719
+ mode: z.ZodLiteral<"embedded">;
720
+ parentOrigin: z.ZodString;
721
+ }, z.core.$strict>], "mode">;
722
+ type ViewSessionOptions = z.infer<typeof ViewSessionSchema>;
723
+ //#endregion
268
724
  //#region ../contracts/src/protocol/api.d.ts
269
725
  declare const OutputResourceSchema: z.ZodObject<{
270
726
  seq: z.ZodNumber;
@@ -279,6 +735,13 @@ declare const WORKSPACE_STATES: readonly ["queued", "provisioning", "connected",
279
735
  type WorkspaceState = (typeof WORKSPACE_STATES)[number];
280
736
  declare const AGENT_STATES: readonly ["unknown", "running", "stable"];
281
737
  type AgentState = (typeof AGENT_STATES)[number];
738
+ declare const AgentInterruptResponseSchema: z.ZodObject<{
739
+ status: z.ZodEnum<{
740
+ requested: "requested";
741
+ idle: "idle";
742
+ }>;
743
+ }, z.core.$strip>;
744
+ type AgentInterruptResponse = z.infer<typeof AgentInterruptResponseSchema>;
282
745
  declare const WorkspaceCreateRequestSchema: z.ZodObject<{
283
746
  external_id: z.ZodString;
284
747
  template: z.ZodObject<{
@@ -302,20 +765,31 @@ declare const WorkspaceResourceSchema: z.ZodObject<{
302
765
  version: z.ZodString;
303
766
  digest: z.ZodString;
304
767
  }, z.core.$strip>;
768
+ agent: z.ZodNullable<z.ZodObject<{
769
+ type: z.ZodString;
770
+ model: z.ZodNullable<z.ZodString>;
771
+ }, z.core.$strip>>;
305
772
  state: z.ZodEnum<{
773
+ ready: "ready";
774
+ failed: "failed";
775
+ succeeded: "succeeded";
306
776
  queued: "queued";
307
777
  provisioning: "provisioning";
308
778
  connected: "connected";
309
- ready: "ready";
310
779
  preserving: "preserving";
311
780
  terminating: "terminating";
312
- succeeded: "succeeded";
313
- failed: "failed";
314
781
  canceled: "canceled";
315
782
  expired: "expired";
316
783
  preserved: "preserved";
317
784
  }>;
318
785
  reason_code: z.ZodNullable<z.ZodEnum<{
786
+ admission_global_capacity: "admission_global_capacity";
787
+ admission_principal_capacity: "admission_principal_capacity";
788
+ admission_template_capacity: "admission_template_capacity";
789
+ admission_policy_global_capacity: "admission_policy_global_capacity";
790
+ admission_actor_capacity: "admission_actor_capacity";
791
+ admission_denied: "admission_denied";
792
+ admission_unavailable: "admission_unavailable";
319
793
  child_exit_success: "child_exit_success";
320
794
  child_exit_failure: "child_exit_failure";
321
795
  setup_failed: "setup_failed";
@@ -403,6 +877,13 @@ declare const WorkspaceResourceSchema: z.ZodObject<{
403
877
  outputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
404
878
  failure: z.ZodNullable<z.ZodObject<{
405
879
  reason_code: z.ZodEnum<{
880
+ admission_global_capacity: "admission_global_capacity";
881
+ admission_principal_capacity: "admission_principal_capacity";
882
+ admission_template_capacity: "admission_template_capacity";
883
+ admission_policy_global_capacity: "admission_policy_global_capacity";
884
+ admission_actor_capacity: "admission_actor_capacity";
885
+ admission_denied: "admission_denied";
886
+ admission_unavailable: "admission_unavailable";
406
887
  child_exit_success: "child_exit_success";
407
888
  child_exit_failure: "child_exit_failure";
408
889
  setup_failed: "setup_failed";
@@ -442,6 +923,10 @@ declare const TemplateListItemSchema: z.ZodObject<{
442
923
  name: z.ZodString;
443
924
  version: z.ZodString;
444
925
  digest: z.ZodString;
926
+ agent: z.ZodNullable<z.ZodObject<{
927
+ type: z.ZodString;
928
+ model: z.ZodNullable<z.ZodString>;
929
+ }, z.core.$strip>>;
445
930
  description: z.ZodOptional<z.ZodString>;
446
931
  status: z.ZodEnum<{
447
932
  active: "active";
@@ -460,6 +945,1262 @@ declare const LogChunkSchema: z.ZodObject<{
460
945
  }, z.core.$strip>;
461
946
  type LogChunk = z.infer<typeof LogChunkSchema>;
462
947
  //#endregion
948
+ //#region ../contracts/src/templates/workload-input-schema.d.ts
949
+ type WorkloadInputProperty = {
950
+ type: "string" | "number" | "integer" | "boolean" | "null";
951
+ } | {
952
+ type: "array";
953
+ items: WorkloadInputProperty;
954
+ } | WorkloadInputObject;
955
+ interface WorkloadInputObject {
956
+ type: "object";
957
+ properties: Record<string, WorkloadInputProperty>;
958
+ required: string[];
959
+ additionalProperties: false;
960
+ }
961
+ //#endregion
962
+ //#region ../contracts/src/templates/workload-template.d.ts
963
+ declare const WorkloadOperationSchema: z.ZodObject<{
964
+ adapter: z.ZodString;
965
+ inputSchema: z.ZodObject<{
966
+ type: z.ZodLiteral<"object">;
967
+ properties: z.ZodRecord<z.ZodString, z.ZodType<WorkloadInputProperty, unknown, z.core.$ZodTypeInternals<WorkloadInputProperty, unknown>>>;
968
+ required: z.ZodDefault<z.ZodArray<z.ZodString>>;
969
+ additionalProperties: z.ZodLiteral<false>;
970
+ }, z.core.$strict>;
971
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
972
+ "ready-without-task": "ready-without-task";
973
+ "live-inputs": "live-inputs";
974
+ "immutable-inputs": "immutable-inputs";
975
+ "serial-operations": "serial-operations";
976
+ "retained-exports": "retained-exports";
977
+ "explicit-start": "explicit-start";
978
+ "exact-exit": "exact-exit";
979
+ "targeted-cancel": "targeted-cancel";
980
+ "stop-before-export": "stop-before-export";
981
+ "request-lookup": "request-lookup";
982
+ "deduplicated-accept": "deduplicated-accept";
983
+ "explicit-publication": "explicit-publication";
984
+ "workspace-services": "workspace-services";
985
+ "revocable-preview-grants": "revocable-preview-grants";
986
+ "workspace-cancel": "workspace-cancel";
987
+ "unknown-outcome": "unknown-outcome";
988
+ }>>;
989
+ outputRoots: z.ZodArray<z.ZodString>;
990
+ }, z.core.$strict>;
991
+ type WorkloadOperation = z.infer<typeof WorkloadOperationSchema>;
992
+ declare const WorkloadTemplateBaseSchema: z.ZodObject<{
993
+ apiVersion: z.ZodLiteral<"pocketcoder.dev/v1">;
994
+ kind: z.ZodLiteral<"Template">;
995
+ metadata: z.ZodObject<{
996
+ name: z.ZodString;
997
+ description: z.ZodOptional<z.ZodString>;
998
+ }, z.core.$strict>;
999
+ spec: z.ZodObject<{
1000
+ version: z.ZodString;
1001
+ image: z.ZodString;
1002
+ runtime: z.ZodObject<{
1003
+ digest: z.ZodString;
1004
+ protocol: z.ZodLiteral<"pocketcoder.workload/v1">;
1005
+ }, z.core.$strict>;
1006
+ profile: z.ZodEnum<{
1007
+ "finite-process": "finite-process";
1008
+ "cloud-interactive": "cloud-interactive";
1009
+ service: "service";
1010
+ }>;
1011
+ adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
1012
+ kind: z.ZodEnum<{
1013
+ agentapi: "agentapi";
1014
+ service: "service";
1015
+ process: "process";
1016
+ pi: "pi";
1017
+ }>;
1018
+ digest: z.ZodString;
1019
+ protocol: z.ZodString;
1020
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
1021
+ cwd: z.ZodOptional<z.ZodString>;
1022
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1023
+ service: z.ZodOptional<z.ZodString>;
1024
+ }, z.core.$strict>>;
1025
+ operations: z.ZodRecord<z.ZodString, z.ZodObject<{
1026
+ adapter: z.ZodString;
1027
+ inputSchema: z.ZodObject<{
1028
+ type: z.ZodLiteral<"object">;
1029
+ properties: z.ZodRecord<z.ZodString, z.ZodType<WorkloadInputProperty, unknown, z.core.$ZodTypeInternals<WorkloadInputProperty, unknown>>>;
1030
+ required: z.ZodDefault<z.ZodArray<z.ZodString>>;
1031
+ additionalProperties: z.ZodLiteral<false>;
1032
+ }, z.core.$strict>;
1033
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
1034
+ "ready-without-task": "ready-without-task";
1035
+ "live-inputs": "live-inputs";
1036
+ "immutable-inputs": "immutable-inputs";
1037
+ "serial-operations": "serial-operations";
1038
+ "retained-exports": "retained-exports";
1039
+ "explicit-start": "explicit-start";
1040
+ "exact-exit": "exact-exit";
1041
+ "targeted-cancel": "targeted-cancel";
1042
+ "stop-before-export": "stop-before-export";
1043
+ "request-lookup": "request-lookup";
1044
+ "deduplicated-accept": "deduplicated-accept";
1045
+ "explicit-publication": "explicit-publication";
1046
+ "workspace-services": "workspace-services";
1047
+ "revocable-preview-grants": "revocable-preview-grants";
1048
+ "workspace-cancel": "workspace-cancel";
1049
+ "unknown-outcome": "unknown-outcome";
1050
+ }>>;
1051
+ outputRoots: z.ZodArray<z.ZodString>;
1052
+ }, z.core.$strict>>;
1053
+ services: z.ZodRecord<z.ZodString, z.ZodObject<{
1054
+ baseUrl: z.ZodString;
1055
+ required: z.ZodDefault<z.ZodBoolean>;
1056
+ healthPath: z.ZodDefault<z.ZodString>;
1057
+ routes: z.ZodArray<z.ZodObject<{
1058
+ method: z.ZodEnum<{
1059
+ POST: "POST";
1060
+ DELETE: "DELETE";
1061
+ GET: "GET";
1062
+ PUT: "PUT";
1063
+ PATCH: "PATCH";
1064
+ }>;
1065
+ path: z.ZodString;
1066
+ query: z.ZodDefault<z.ZodArray<z.ZodString>>;
1067
+ responseMode: z.ZodDefault<z.ZodEnum<{
1068
+ buffered: "buffered";
1069
+ stream: "stream";
1070
+ }>>;
1071
+ maxRequestBytes: z.ZodDefault<z.ZodNumber>;
1072
+ maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1073
+ deadlineSeconds: z.ZodDefault<z.ZodNumber>;
1074
+ }, z.core.$strip>>;
1075
+ process: z.ZodOptional<z.ZodObject<{
1076
+ command: z.ZodArray<z.ZodString>;
1077
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1078
+ cwd: z.ZodOptional<z.ZodString>;
1079
+ }, z.core.$strict>>;
1080
+ }, z.core.$strict>>;
1081
+ previews: z.ZodRecord<z.ZodString, z.ZodObject<{
1082
+ port: z.ZodNumber;
1083
+ }, z.core.$strict>>;
1084
+ credentialSlots: z.ZodRecord<z.ZodString, z.ZodObject<{
1085
+ policyRef: z.ZodString;
1086
+ policyVersion: z.ZodString;
1087
+ binding: z.ZodEnum<{
1088
+ "fixed-scope": "fixed-scope";
1089
+ "post-create-grant": "post-create-grant";
1090
+ }>;
1091
+ delivery: z.ZodLiteral<"workspace-expiring-file">;
1092
+ maxLeaseSeconds: z.ZodNumber;
1093
+ }, z.core.$strict>>;
1094
+ resources: z.ZodObject<{
1095
+ cpu: z.ZodString;
1096
+ memory: z.ZodString;
1097
+ ephemeralStorage: z.ZodOptional<z.ZodString>;
1098
+ }, z.core.$strict>;
1099
+ network: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
1100
+ mode: z.ZodLiteral<"unrestricted">;
1101
+ }, z.core.$strip>, z.ZodObject<{
1102
+ mode: z.ZodLiteral<"restricted">;
1103
+ allow: z.ZodDefault<z.ZodArray<z.ZodObject<{
1104
+ domain: z.ZodString;
1105
+ ports: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
1106
+ allowPrivate: z.ZodDefault<z.ZodBoolean>;
1107
+ }, z.core.$strip>>>;
1108
+ }, z.core.$strip>], "mode">>;
1109
+ security: z.ZodObject<{
1110
+ uid: z.ZodDefault<z.ZodNumber>;
1111
+ gid: z.ZodDefault<z.ZodNumber>;
1112
+ readOnlyRoot: z.ZodDefault<z.ZodBoolean>;
1113
+ writableMemoryPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1114
+ dropCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
1115
+ allowPrivilegeEscalation: z.ZodDefault<z.ZodLiteral<false>>;
1116
+ seccomp: z.ZodDefault<z.ZodLiteral<"RuntimeDefault">>;
1117
+ }, z.core.$strict>;
1118
+ limits: z.ZodObject<{
1119
+ deadlineSeconds: z.ZodNumber;
1120
+ finalizationSeconds: z.ZodNumber;
1121
+ inputFileBytes: z.ZodNumber;
1122
+ stagedInputBytes: z.ZodNumber;
1123
+ inputFiles: z.ZodNumber;
1124
+ inFlightTransfers: z.ZodNumber;
1125
+ exportBytes: z.ZodNumber;
1126
+ exportFiles: z.ZodNumber;
1127
+ unreferencedInputRetentionSeconds: z.ZodNumber;
1128
+ exportRetentionSeconds: z.ZodNumber;
1129
+ }, z.core.$strict>;
1130
+ lifecycle: z.ZodOptional<z.ZodObject<{
1131
+ persistence: z.ZodPrefault<z.ZodObject<{
1132
+ mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1133
+ name: z.ZodString;
1134
+ target: z.ZodString;
1135
+ maxBytes: z.ZodNumber;
1136
+ maxFiles: z.ZodNumber;
1137
+ }, z.core.$strip>>>;
1138
+ conversationRestore: z.ZodDefault<z.ZodEnum<{
1139
+ unknown: "unknown";
1140
+ supported: "supported";
1141
+ filesystem_only: "filesystem_only";
1142
+ }>>;
1143
+ conversationRetention: z.ZodDefault<z.ZodString>;
1144
+ sessionCompatibility: z.ZodOptional<z.ZodString>;
1145
+ checkpoint: z.ZodPrefault<z.ZodObject<{
1146
+ onIdle: z.ZodDefault<z.ZodEnum<{
1147
+ preserve: "preserve";
1148
+ destroy: "destroy";
1149
+ }>>;
1150
+ onDeadline: z.ZodDefault<z.ZodEnum<{
1151
+ preserve: "preserve";
1152
+ destroy: "destroy";
1153
+ }>>;
1154
+ onCleanExit: z.ZodDefault<z.ZodEnum<{
1155
+ preserve: "preserve";
1156
+ destroy: "destroy";
1157
+ }>>;
1158
+ onFailure: z.ZodDefault<z.ZodEnum<{
1159
+ preserve: "preserve";
1160
+ destroy: "destroy";
1161
+ "retain-for-recovery": "retain-for-recovery";
1162
+ }>>;
1163
+ retention: z.ZodDefault<z.ZodString>;
1164
+ }, z.core.$strip>>;
1165
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1166
+ name: z.ZodString;
1167
+ mount: z.ZodString;
1168
+ pattern: z.ZodString;
1169
+ maxBytes: z.ZodDefault<z.ZodNumber>;
1170
+ }, z.core.$strip>>>;
1171
+ }, z.core.$strip>>;
1172
+ checkpointHook: z.ZodOptional<z.ZodObject<{
1173
+ command: z.ZodArray<z.ZodString>;
1174
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1175
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1176
+ cwd: z.ZodOptional<z.ZodString>;
1177
+ }, z.core.$strip>>;
1178
+ timeouts: z.ZodOptional<z.ZodObject<{
1179
+ start: z.ZodDefault<z.ZodString>;
1180
+ maxAge: z.ZodDefault<z.ZodString>;
1181
+ idle: z.ZodDefault<z.ZodString>;
1182
+ disconnectGrace: z.ZodDefault<z.ZodString>;
1183
+ terminateGrace: z.ZodDefault<z.ZodString>;
1184
+ }, z.core.$strip>>;
1185
+ maxLaunchInputBytes: z.ZodDefault<z.ZodNumber>;
1186
+ }, z.core.$strict>>;
1187
+ }, z.core.$strict>;
1188
+ }, z.core.$strict>;
1189
+ type WorkloadTemplate = z.infer<typeof WorkloadTemplateBaseSchema>;
1190
+ declare const WorkloadTemplateSnapshotSchema: z.ZodObject<{
1191
+ format: z.ZodLiteral<"pocketcoder.dev/v1">;
1192
+ name: z.ZodString;
1193
+ version: z.ZodString;
1194
+ digest: z.ZodString;
1195
+ manifest: z.ZodObject<{
1196
+ apiVersion: z.ZodLiteral<"pocketcoder.dev/v1">;
1197
+ kind: z.ZodLiteral<"Template">;
1198
+ metadata: z.ZodObject<{
1199
+ name: z.ZodString;
1200
+ description: z.ZodOptional<z.ZodString>;
1201
+ }, z.core.$strict>;
1202
+ spec: z.ZodObject<{
1203
+ version: z.ZodString;
1204
+ image: z.ZodString;
1205
+ runtime: z.ZodObject<{
1206
+ digest: z.ZodString;
1207
+ protocol: z.ZodLiteral<"pocketcoder.workload/v1">;
1208
+ }, z.core.$strict>;
1209
+ profile: z.ZodEnum<{
1210
+ "finite-process": "finite-process";
1211
+ "cloud-interactive": "cloud-interactive";
1212
+ service: "service";
1213
+ }>;
1214
+ adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
1215
+ kind: z.ZodEnum<{
1216
+ agentapi: "agentapi";
1217
+ service: "service";
1218
+ process: "process";
1219
+ pi: "pi";
1220
+ }>;
1221
+ digest: z.ZodString;
1222
+ protocol: z.ZodString;
1223
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
1224
+ cwd: z.ZodOptional<z.ZodString>;
1225
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1226
+ service: z.ZodOptional<z.ZodString>;
1227
+ }, z.core.$strict>>;
1228
+ operations: z.ZodRecord<z.ZodString, z.ZodObject<{
1229
+ adapter: z.ZodString;
1230
+ inputSchema: z.ZodObject<{
1231
+ type: z.ZodLiteral<"object">;
1232
+ properties: z.ZodRecord<z.ZodString, z.ZodType<WorkloadInputProperty, unknown, z.core.$ZodTypeInternals<WorkloadInputProperty, unknown>>>;
1233
+ required: z.ZodDefault<z.ZodArray<z.ZodString>>;
1234
+ additionalProperties: z.ZodLiteral<false>;
1235
+ }, z.core.$strict>;
1236
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
1237
+ "ready-without-task": "ready-without-task";
1238
+ "live-inputs": "live-inputs";
1239
+ "immutable-inputs": "immutable-inputs";
1240
+ "serial-operations": "serial-operations";
1241
+ "retained-exports": "retained-exports";
1242
+ "explicit-start": "explicit-start";
1243
+ "exact-exit": "exact-exit";
1244
+ "targeted-cancel": "targeted-cancel";
1245
+ "stop-before-export": "stop-before-export";
1246
+ "request-lookup": "request-lookup";
1247
+ "deduplicated-accept": "deduplicated-accept";
1248
+ "explicit-publication": "explicit-publication";
1249
+ "workspace-services": "workspace-services";
1250
+ "revocable-preview-grants": "revocable-preview-grants";
1251
+ "workspace-cancel": "workspace-cancel";
1252
+ "unknown-outcome": "unknown-outcome";
1253
+ }>>;
1254
+ outputRoots: z.ZodArray<z.ZodString>;
1255
+ }, z.core.$strict>>;
1256
+ services: z.ZodRecord<z.ZodString, z.ZodObject<{
1257
+ baseUrl: z.ZodString;
1258
+ required: z.ZodDefault<z.ZodBoolean>;
1259
+ healthPath: z.ZodDefault<z.ZodString>;
1260
+ routes: z.ZodArray<z.ZodObject<{
1261
+ method: z.ZodEnum<{
1262
+ POST: "POST";
1263
+ DELETE: "DELETE";
1264
+ GET: "GET";
1265
+ PUT: "PUT";
1266
+ PATCH: "PATCH";
1267
+ }>;
1268
+ path: z.ZodString;
1269
+ query: z.ZodDefault<z.ZodArray<z.ZodString>>;
1270
+ responseMode: z.ZodDefault<z.ZodEnum<{
1271
+ buffered: "buffered";
1272
+ stream: "stream";
1273
+ }>>;
1274
+ maxRequestBytes: z.ZodDefault<z.ZodNumber>;
1275
+ maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1276
+ deadlineSeconds: z.ZodDefault<z.ZodNumber>;
1277
+ }, z.core.$strip>>;
1278
+ process: z.ZodOptional<z.ZodObject<{
1279
+ command: z.ZodArray<z.ZodString>;
1280
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1281
+ cwd: z.ZodOptional<z.ZodString>;
1282
+ }, z.core.$strict>>;
1283
+ }, z.core.$strict>>;
1284
+ previews: z.ZodRecord<z.ZodString, z.ZodObject<{
1285
+ port: z.ZodNumber;
1286
+ }, z.core.$strict>>;
1287
+ credentialSlots: z.ZodRecord<z.ZodString, z.ZodObject<{
1288
+ policyRef: z.ZodString;
1289
+ policyVersion: z.ZodString;
1290
+ binding: z.ZodEnum<{
1291
+ "fixed-scope": "fixed-scope";
1292
+ "post-create-grant": "post-create-grant";
1293
+ }>;
1294
+ delivery: z.ZodLiteral<"workspace-expiring-file">;
1295
+ maxLeaseSeconds: z.ZodNumber;
1296
+ }, z.core.$strict>>;
1297
+ resources: z.ZodObject<{
1298
+ cpu: z.ZodString;
1299
+ memory: z.ZodString;
1300
+ ephemeralStorage: z.ZodOptional<z.ZodString>;
1301
+ }, z.core.$strict>;
1302
+ network: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
1303
+ mode: z.ZodLiteral<"unrestricted">;
1304
+ }, z.core.$strip>, z.ZodObject<{
1305
+ mode: z.ZodLiteral<"restricted">;
1306
+ allow: z.ZodDefault<z.ZodArray<z.ZodObject<{
1307
+ domain: z.ZodString;
1308
+ ports: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
1309
+ allowPrivate: z.ZodDefault<z.ZodBoolean>;
1310
+ }, z.core.$strip>>>;
1311
+ }, z.core.$strip>], "mode">>;
1312
+ security: z.ZodObject<{
1313
+ uid: z.ZodDefault<z.ZodNumber>;
1314
+ gid: z.ZodDefault<z.ZodNumber>;
1315
+ readOnlyRoot: z.ZodDefault<z.ZodBoolean>;
1316
+ writableMemoryPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1317
+ dropCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
1318
+ allowPrivilegeEscalation: z.ZodDefault<z.ZodLiteral<false>>;
1319
+ seccomp: z.ZodDefault<z.ZodLiteral<"RuntimeDefault">>;
1320
+ }, z.core.$strict>;
1321
+ limits: z.ZodObject<{
1322
+ deadlineSeconds: z.ZodNumber;
1323
+ finalizationSeconds: z.ZodNumber;
1324
+ inputFileBytes: z.ZodNumber;
1325
+ stagedInputBytes: z.ZodNumber;
1326
+ inputFiles: z.ZodNumber;
1327
+ inFlightTransfers: z.ZodNumber;
1328
+ exportBytes: z.ZodNumber;
1329
+ exportFiles: z.ZodNumber;
1330
+ unreferencedInputRetentionSeconds: z.ZodNumber;
1331
+ exportRetentionSeconds: z.ZodNumber;
1332
+ }, z.core.$strict>;
1333
+ lifecycle: z.ZodOptional<z.ZodObject<{
1334
+ persistence: z.ZodPrefault<z.ZodObject<{
1335
+ mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1336
+ name: z.ZodString;
1337
+ target: z.ZodString;
1338
+ maxBytes: z.ZodNumber;
1339
+ maxFiles: z.ZodNumber;
1340
+ }, z.core.$strip>>>;
1341
+ conversationRestore: z.ZodDefault<z.ZodEnum<{
1342
+ unknown: "unknown";
1343
+ supported: "supported";
1344
+ filesystem_only: "filesystem_only";
1345
+ }>>;
1346
+ conversationRetention: z.ZodDefault<z.ZodString>;
1347
+ sessionCompatibility: z.ZodOptional<z.ZodString>;
1348
+ checkpoint: z.ZodPrefault<z.ZodObject<{
1349
+ onIdle: z.ZodDefault<z.ZodEnum<{
1350
+ preserve: "preserve";
1351
+ destroy: "destroy";
1352
+ }>>;
1353
+ onDeadline: z.ZodDefault<z.ZodEnum<{
1354
+ preserve: "preserve";
1355
+ destroy: "destroy";
1356
+ }>>;
1357
+ onCleanExit: z.ZodDefault<z.ZodEnum<{
1358
+ preserve: "preserve";
1359
+ destroy: "destroy";
1360
+ }>>;
1361
+ onFailure: z.ZodDefault<z.ZodEnum<{
1362
+ preserve: "preserve";
1363
+ destroy: "destroy";
1364
+ "retain-for-recovery": "retain-for-recovery";
1365
+ }>>;
1366
+ retention: z.ZodDefault<z.ZodString>;
1367
+ }, z.core.$strip>>;
1368
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1369
+ name: z.ZodString;
1370
+ mount: z.ZodString;
1371
+ pattern: z.ZodString;
1372
+ maxBytes: z.ZodDefault<z.ZodNumber>;
1373
+ }, z.core.$strip>>>;
1374
+ }, z.core.$strip>>;
1375
+ checkpointHook: z.ZodOptional<z.ZodObject<{
1376
+ command: z.ZodArray<z.ZodString>;
1377
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1378
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1379
+ cwd: z.ZodOptional<z.ZodString>;
1380
+ }, z.core.$strip>>;
1381
+ timeouts: z.ZodOptional<z.ZodObject<{
1382
+ start: z.ZodDefault<z.ZodString>;
1383
+ maxAge: z.ZodDefault<z.ZodString>;
1384
+ idle: z.ZodDefault<z.ZodString>;
1385
+ disconnectGrace: z.ZodDefault<z.ZodString>;
1386
+ terminateGrace: z.ZodDefault<z.ZodString>;
1387
+ }, z.core.$strip>>;
1388
+ maxLaunchInputBytes: z.ZodDefault<z.ZodNumber>;
1389
+ }, z.core.$strict>>;
1390
+ }, z.core.$strict>;
1391
+ }, z.core.$strict>;
1392
+ }, z.core.$strict>;
1393
+ type WorkloadTemplateSnapshot = z.infer<typeof WorkloadTemplateSnapshotSchema>;
1394
+ //#endregion
1395
+ //#region ../contracts/src/secrets/credential-slot.d.ts
1396
+ declare const CredentialSlotSchema: z.ZodObject<{
1397
+ policyRef: z.ZodString;
1398
+ policyVersion: z.ZodString;
1399
+ binding: z.ZodEnum<{
1400
+ "fixed-scope": "fixed-scope";
1401
+ "post-create-grant": "post-create-grant";
1402
+ }>;
1403
+ delivery: z.ZodLiteral<"workspace-expiring-file">;
1404
+ maxLeaseSeconds: z.ZodNumber;
1405
+ }, z.core.$strict>;
1406
+ type CredentialSlot = z.infer<typeof CredentialSlotSchema>;
1407
+ //#endregion
1408
+ //#region ../contracts/src/secrets/secret.d.ts
1409
+ declare const SecretPutRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1410
+ type: z.ZodLiteral<"setup-issuer">;
1411
+ value: z.ZodObject<{
1412
+ url: z.ZodURL;
1413
+ authorization: z.ZodString;
1414
+ policy: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1415
+ }, z.core.$strict>;
1416
+ }, z.core.$strict>, z.ZodObject<{
1417
+ type: z.ZodLiteral<"runtime-issuer">;
1418
+ value: z.ZodObject<{
1419
+ url: z.ZodURL;
1420
+ authorization: z.ZodString;
1421
+ policy: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1422
+ }, z.core.$strict>;
1423
+ }, z.core.$strict>, z.ZodObject<{
1424
+ type: z.ZodLiteral<"registry">;
1425
+ value: z.ZodObject<{
1426
+ server: z.ZodString;
1427
+ username: z.ZodString;
1428
+ password: z.ZodString;
1429
+ }, z.core.$strict>;
1430
+ }, z.core.$strict>], "type">;
1431
+ type SecretPutRequest = z.infer<typeof SecretPutRequestSchema>;
1432
+ declare const SecretResourceSchema: z.ZodObject<{
1433
+ name: z.ZodString;
1434
+ type: z.ZodEnum<{
1435
+ "setup-issuer": "setup-issuer";
1436
+ "runtime-issuer": "runtime-issuer";
1437
+ registry: "registry";
1438
+ }>;
1439
+ updated_at: z.ZodISODateTime;
1440
+ retired_at: z.ZodNullable<z.ZodISODateTime>;
1441
+ }, z.core.$strict>;
1442
+ type SecretResource = z.infer<typeof SecretResourceSchema>;
1443
+ //#endregion
1444
+ //#region ../contracts/src/templates/template-alpha-schema.d.ts
1445
+ declare const HarnessSchema: z.ZodObject<{
1446
+ command: z.ZodArray<z.ZodString>;
1447
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1448
+ cwd: z.ZodOptional<z.ZodString>;
1449
+ }, z.core.$strip>;
1450
+ declare const AgentSchema: z.ZodObject<{
1451
+ command: z.ZodArray<z.ZodString>;
1452
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1453
+ cwd: z.ZodOptional<z.ZodString>;
1454
+ model: z.ZodOptional<z.ZodString>;
1455
+ type: z.ZodDefault<z.ZodString>;
1456
+ transport: z.ZodDefault<z.ZodEnum<{
1457
+ pty: "pty";
1458
+ acp: "acp";
1459
+ }>>;
1460
+ termWidth: z.ZodOptional<z.ZodNumber>;
1461
+ stateFile: z.ZodOptional<z.ZodString>;
1462
+ interruptKeys: z.ZodOptional<z.ZodString>;
1463
+ }, z.core.$strip>;
1464
+ declare const ServiceSchema: z.ZodObject<{
1465
+ baseUrl: z.ZodString;
1466
+ required: z.ZodDefault<z.ZodBoolean>;
1467
+ healthPath: z.ZodDefault<z.ZodString>;
1468
+ routes: z.ZodArray<z.ZodObject<{
1469
+ method: z.ZodEnum<{
1470
+ POST: "POST";
1471
+ DELETE: "DELETE";
1472
+ GET: "GET";
1473
+ PUT: "PUT";
1474
+ PATCH: "PATCH";
1475
+ }>;
1476
+ path: z.ZodString;
1477
+ query: z.ZodDefault<z.ZodArray<z.ZodString>>;
1478
+ responseMode: z.ZodDefault<z.ZodEnum<{
1479
+ buffered: "buffered";
1480
+ stream: "stream";
1481
+ }>>;
1482
+ maxRequestBytes: z.ZodDefault<z.ZodNumber>;
1483
+ maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1484
+ deadlineSeconds: z.ZodDefault<z.ZodNumber>;
1485
+ }, z.core.$strip>>;
1486
+ }, z.core.$strip>;
1487
+ declare const CheckpointHookSchema: z.ZodObject<{
1488
+ command: z.ZodArray<z.ZodString>;
1489
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1490
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1491
+ cwd: z.ZodOptional<z.ZodString>;
1492
+ }, z.core.$strip>;
1493
+ declare const TemplateSpecInputSchema: z.ZodObject<{
1494
+ version: z.ZodString;
1495
+ image: z.ZodString;
1496
+ imagePullSecret: z.ZodOptional<z.ZodString>;
1497
+ command: z.ZodDefault<z.ZodArray<z.ZodString>>;
1498
+ setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
1499
+ name: z.ZodString;
1500
+ command: z.ZodArray<z.ZodString>;
1501
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1502
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1503
+ cwd: z.ZodOptional<z.ZodString>;
1504
+ runOn: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1505
+ restore: "restore";
1506
+ create: "create";
1507
+ }>>>;
1508
+ }, z.core.$strip>>>;
1509
+ agent: z.ZodOptional<z.ZodObject<{
1510
+ command: z.ZodArray<z.ZodString>;
1511
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1512
+ cwd: z.ZodOptional<z.ZodString>;
1513
+ model: z.ZodOptional<z.ZodString>;
1514
+ type: z.ZodDefault<z.ZodString>;
1515
+ transport: z.ZodDefault<z.ZodEnum<{
1516
+ pty: "pty";
1517
+ acp: "acp";
1518
+ }>>;
1519
+ termWidth: z.ZodOptional<z.ZodNumber>;
1520
+ stateFile: z.ZodOptional<z.ZodString>;
1521
+ interruptKeys: z.ZodOptional<z.ZodString>;
1522
+ }, z.core.$strip>>;
1523
+ harness: z.ZodOptional<z.ZodObject<{
1524
+ command: z.ZodArray<z.ZodString>;
1525
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1526
+ cwd: z.ZodOptional<z.ZodString>;
1527
+ }, z.core.$strip>>;
1528
+ terminal: z.ZodOptional<z.ZodObject<{
1529
+ command: z.ZodArray<z.ZodString>;
1530
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1531
+ cwd: z.ZodOptional<z.ZodString>;
1532
+ maxSessions: z.ZodDefault<z.ZodNumber>;
1533
+ idleTimeout: z.ZodDefault<z.ZodString>;
1534
+ }, z.core.$strip>>;
1535
+ previews: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1536
+ port: z.ZodNumber;
1537
+ }, z.core.$strict>>>;
1538
+ display: z.ZodOptional<z.ZodObject<{
1539
+ mode: z.ZodEnum<{
1540
+ desktop: "desktop";
1541
+ browser: "browser";
1542
+ }>;
1543
+ }, z.core.$strict>>;
1544
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1545
+ resources: z.ZodObject<{
1546
+ cpu: z.ZodString;
1547
+ memory: z.ZodString;
1548
+ ephemeralStorage: z.ZodOptional<z.ZodString>;
1549
+ }, z.core.$strip>;
1550
+ timeouts: z.ZodPrefault<z.ZodObject<{
1551
+ start: z.ZodDefault<z.ZodString>;
1552
+ maxAge: z.ZodDefault<z.ZodString>;
1553
+ idle: z.ZodDefault<z.ZodString>;
1554
+ disconnectGrace: z.ZodDefault<z.ZodString>;
1555
+ terminateGrace: z.ZodDefault<z.ZodString>;
1556
+ }, z.core.$strip>>;
1557
+ services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1558
+ baseUrl: z.ZodString;
1559
+ required: z.ZodDefault<z.ZodBoolean>;
1560
+ healthPath: z.ZodDefault<z.ZodString>;
1561
+ routes: z.ZodArray<z.ZodObject<{
1562
+ method: z.ZodEnum<{
1563
+ POST: "POST";
1564
+ DELETE: "DELETE";
1565
+ GET: "GET";
1566
+ PUT: "PUT";
1567
+ PATCH: "PATCH";
1568
+ }>;
1569
+ path: z.ZodString;
1570
+ query: z.ZodDefault<z.ZodArray<z.ZodString>>;
1571
+ responseMode: z.ZodDefault<z.ZodEnum<{
1572
+ buffered: "buffered";
1573
+ stream: "stream";
1574
+ }>>;
1575
+ maxRequestBytes: z.ZodDefault<z.ZodNumber>;
1576
+ maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1577
+ deadlineSeconds: z.ZodDefault<z.ZodNumber>;
1578
+ }, z.core.$strip>>;
1579
+ }, z.core.$strip>>>;
1580
+ security: z.ZodPrefault<z.ZodObject<{
1581
+ uid: z.ZodDefault<z.ZodNumber>;
1582
+ gid: z.ZodDefault<z.ZodNumber>;
1583
+ readOnlyRoot: z.ZodDefault<z.ZodBoolean>;
1584
+ writableMemoryPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1585
+ dropCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
1586
+ allowPrivilegeEscalation: z.ZodDefault<z.ZodLiteral<false>>;
1587
+ seccomp: z.ZodDefault<z.ZodLiteral<"RuntimeDefault">>;
1588
+ }, z.core.$strip>>;
1589
+ network: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
1590
+ mode: z.ZodLiteral<"unrestricted">;
1591
+ }, z.core.$strip>, z.ZodObject<{
1592
+ mode: z.ZodLiteral<"restricted">;
1593
+ allow: z.ZodDefault<z.ZodArray<z.ZodObject<{
1594
+ domain: z.ZodString;
1595
+ ports: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
1596
+ allowPrivate: z.ZodDefault<z.ZodBoolean>;
1597
+ }, z.core.$strip>>>;
1598
+ }, z.core.$strip>], "mode">>;
1599
+ maxLaunchInputBytes: z.ZodDefault<z.ZodNumber>;
1600
+ compat: z.ZodDefault<z.ZodObject<{
1601
+ agent: z.ZodOptional<z.ZodString>;
1602
+ agentapi: z.ZodOptional<z.ZodString>;
1603
+ }, z.core.$strip>>;
1604
+ persistence: z.ZodPrefault<z.ZodObject<{
1605
+ mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1606
+ name: z.ZodString;
1607
+ target: z.ZodString;
1608
+ maxBytes: z.ZodNumber;
1609
+ maxFiles: z.ZodNumber;
1610
+ }, z.core.$strip>>>;
1611
+ conversationRestore: z.ZodDefault<z.ZodEnum<{
1612
+ unknown: "unknown";
1613
+ supported: "supported";
1614
+ filesystem_only: "filesystem_only";
1615
+ }>>;
1616
+ conversationRetention: z.ZodDefault<z.ZodString>;
1617
+ sessionCompatibility: z.ZodOptional<z.ZodString>;
1618
+ checkpoint: z.ZodPrefault<z.ZodObject<{
1619
+ onIdle: z.ZodDefault<z.ZodEnum<{
1620
+ preserve: "preserve";
1621
+ destroy: "destroy";
1622
+ }>>;
1623
+ onDeadline: z.ZodDefault<z.ZodEnum<{
1624
+ preserve: "preserve";
1625
+ destroy: "destroy";
1626
+ }>>;
1627
+ onCleanExit: z.ZodDefault<z.ZodEnum<{
1628
+ preserve: "preserve";
1629
+ destroy: "destroy";
1630
+ }>>;
1631
+ onFailure: z.ZodDefault<z.ZodEnum<{
1632
+ preserve: "preserve";
1633
+ destroy: "destroy";
1634
+ "retain-for-recovery": "retain-for-recovery";
1635
+ }>>;
1636
+ retention: z.ZodDefault<z.ZodString>;
1637
+ }, z.core.$strip>>;
1638
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1639
+ name: z.ZodString;
1640
+ mount: z.ZodString;
1641
+ pattern: z.ZodString;
1642
+ maxBytes: z.ZodDefault<z.ZodNumber>;
1643
+ }, z.core.$strip>>>;
1644
+ }, z.core.$strip>>;
1645
+ source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1646
+ kind: z.ZodLiteral<"git">;
1647
+ destinationMount: z.ZodString;
1648
+ repositories: z.ZodRecord<z.ZodString, z.ZodObject<{
1649
+ url: z.ZodURL;
1650
+ credential: z.ZodOptional<z.ZodString>;
1651
+ }, z.core.$strip>>;
1652
+ allowedRevision: z.ZodDefault<z.ZodLiteral<"branch-tag-or-commit">>;
1653
+ }, z.core.$strip>>>;
1654
+ checkpointHook: z.ZodOptional<z.ZodObject<{
1655
+ command: z.ZodArray<z.ZodString>;
1656
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1657
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1658
+ cwd: z.ZodOptional<z.ZodString>;
1659
+ }, z.core.$strip>>;
1660
+ outputs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1661
+ type: z.ZodLiteral<"gitSha">;
1662
+ }, z.core.$strip>, z.ZodObject<{
1663
+ type: z.ZodLiteral<"string">;
1664
+ maxLength: z.ZodDefault<z.ZodNumber>;
1665
+ }, z.core.$strip>, z.ZodObject<{
1666
+ type: z.ZodLiteral<"httpsUrl">;
1667
+ maxLength: z.ZodDefault<z.ZodNumber>;
1668
+ }, z.core.$strip>], "type">>>;
1669
+ }, z.core.$strip>;
1670
+ type TemplateSpecCommon = Omit<z.infer<typeof TemplateSpecInputSchema>, "agent" | "harness" | "services" | "checkpointHook">;
1671
+ type Agent = z.infer<typeof AgentSchema>;
1672
+ type Harness = z.infer<typeof HarnessSchema>;
1673
+ type CheckpointHook = z.infer<typeof CheckpointHookSchema>;
1674
+ type TemplateService = z.infer<typeof ServiceSchema>;
1675
+ declare const TemplateManifestBaseSchema: z.ZodObject<{
1676
+ apiVersion: z.ZodLiteral<"pocketcoder.dev/v1alpha1">;
1677
+ kind: z.ZodLiteral<"Template">;
1678
+ metadata: z.ZodObject<{
1679
+ name: z.ZodString;
1680
+ description: z.ZodOptional<z.ZodString>;
1681
+ }, z.core.$strip>;
1682
+ spec: z.ZodPipe<z.ZodObject<{
1683
+ version: z.ZodString;
1684
+ image: z.ZodString;
1685
+ imagePullSecret: z.ZodOptional<z.ZodString>;
1686
+ command: z.ZodDefault<z.ZodArray<z.ZodString>>;
1687
+ setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
1688
+ name: z.ZodString;
1689
+ command: z.ZodArray<z.ZodString>;
1690
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1691
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1692
+ cwd: z.ZodOptional<z.ZodString>;
1693
+ runOn: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1694
+ restore: "restore";
1695
+ create: "create";
1696
+ }>>>;
1697
+ }, z.core.$strip>>>;
1698
+ agent: z.ZodOptional<z.ZodObject<{
1699
+ command: z.ZodArray<z.ZodString>;
1700
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1701
+ cwd: z.ZodOptional<z.ZodString>;
1702
+ model: z.ZodOptional<z.ZodString>;
1703
+ type: z.ZodDefault<z.ZodString>;
1704
+ transport: z.ZodDefault<z.ZodEnum<{
1705
+ pty: "pty";
1706
+ acp: "acp";
1707
+ }>>;
1708
+ termWidth: z.ZodOptional<z.ZodNumber>;
1709
+ stateFile: z.ZodOptional<z.ZodString>;
1710
+ interruptKeys: z.ZodOptional<z.ZodString>;
1711
+ }, z.core.$strip>>;
1712
+ harness: z.ZodOptional<z.ZodObject<{
1713
+ command: z.ZodArray<z.ZodString>;
1714
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1715
+ cwd: z.ZodOptional<z.ZodString>;
1716
+ }, z.core.$strip>>;
1717
+ terminal: z.ZodOptional<z.ZodObject<{
1718
+ command: z.ZodArray<z.ZodString>;
1719
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1720
+ cwd: z.ZodOptional<z.ZodString>;
1721
+ maxSessions: z.ZodDefault<z.ZodNumber>;
1722
+ idleTimeout: z.ZodDefault<z.ZodString>;
1723
+ }, z.core.$strip>>;
1724
+ previews: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1725
+ port: z.ZodNumber;
1726
+ }, z.core.$strict>>>;
1727
+ display: z.ZodOptional<z.ZodObject<{
1728
+ mode: z.ZodEnum<{
1729
+ desktop: "desktop";
1730
+ browser: "browser";
1731
+ }>;
1732
+ }, z.core.$strict>>;
1733
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1734
+ resources: z.ZodObject<{
1735
+ cpu: z.ZodString;
1736
+ memory: z.ZodString;
1737
+ ephemeralStorage: z.ZodOptional<z.ZodString>;
1738
+ }, z.core.$strip>;
1739
+ timeouts: z.ZodPrefault<z.ZodObject<{
1740
+ start: z.ZodDefault<z.ZodString>;
1741
+ maxAge: z.ZodDefault<z.ZodString>;
1742
+ idle: z.ZodDefault<z.ZodString>;
1743
+ disconnectGrace: z.ZodDefault<z.ZodString>;
1744
+ terminateGrace: z.ZodDefault<z.ZodString>;
1745
+ }, z.core.$strip>>;
1746
+ services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1747
+ baseUrl: z.ZodString;
1748
+ required: z.ZodDefault<z.ZodBoolean>;
1749
+ healthPath: z.ZodDefault<z.ZodString>;
1750
+ routes: z.ZodArray<z.ZodObject<{
1751
+ method: z.ZodEnum<{
1752
+ POST: "POST";
1753
+ DELETE: "DELETE";
1754
+ GET: "GET";
1755
+ PUT: "PUT";
1756
+ PATCH: "PATCH";
1757
+ }>;
1758
+ path: z.ZodString;
1759
+ query: z.ZodDefault<z.ZodArray<z.ZodString>>;
1760
+ responseMode: z.ZodDefault<z.ZodEnum<{
1761
+ buffered: "buffered";
1762
+ stream: "stream";
1763
+ }>>;
1764
+ maxRequestBytes: z.ZodDefault<z.ZodNumber>;
1765
+ maxResponseBytes: z.ZodDefault<z.ZodNumber>;
1766
+ deadlineSeconds: z.ZodDefault<z.ZodNumber>;
1767
+ }, z.core.$strip>>;
1768
+ }, z.core.$strip>>>;
1769
+ security: z.ZodPrefault<z.ZodObject<{
1770
+ uid: z.ZodDefault<z.ZodNumber>;
1771
+ gid: z.ZodDefault<z.ZodNumber>;
1772
+ readOnlyRoot: z.ZodDefault<z.ZodBoolean>;
1773
+ writableMemoryPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
1774
+ dropCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
1775
+ allowPrivilegeEscalation: z.ZodDefault<z.ZodLiteral<false>>;
1776
+ seccomp: z.ZodDefault<z.ZodLiteral<"RuntimeDefault">>;
1777
+ }, z.core.$strip>>;
1778
+ network: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
1779
+ mode: z.ZodLiteral<"unrestricted">;
1780
+ }, z.core.$strip>, z.ZodObject<{
1781
+ mode: z.ZodLiteral<"restricted">;
1782
+ allow: z.ZodDefault<z.ZodArray<z.ZodObject<{
1783
+ domain: z.ZodString;
1784
+ ports: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
1785
+ allowPrivate: z.ZodDefault<z.ZodBoolean>;
1786
+ }, z.core.$strip>>>;
1787
+ }, z.core.$strip>], "mode">>;
1788
+ maxLaunchInputBytes: z.ZodDefault<z.ZodNumber>;
1789
+ compat: z.ZodDefault<z.ZodObject<{
1790
+ agent: z.ZodOptional<z.ZodString>;
1791
+ agentapi: z.ZodOptional<z.ZodString>;
1792
+ }, z.core.$strip>>;
1793
+ persistence: z.ZodPrefault<z.ZodObject<{
1794
+ mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1795
+ name: z.ZodString;
1796
+ target: z.ZodString;
1797
+ maxBytes: z.ZodNumber;
1798
+ maxFiles: z.ZodNumber;
1799
+ }, z.core.$strip>>>;
1800
+ conversationRestore: z.ZodDefault<z.ZodEnum<{
1801
+ unknown: "unknown";
1802
+ supported: "supported";
1803
+ filesystem_only: "filesystem_only";
1804
+ }>>;
1805
+ conversationRetention: z.ZodDefault<z.ZodString>;
1806
+ sessionCompatibility: z.ZodOptional<z.ZodString>;
1807
+ checkpoint: z.ZodPrefault<z.ZodObject<{
1808
+ onIdle: z.ZodDefault<z.ZodEnum<{
1809
+ preserve: "preserve";
1810
+ destroy: "destroy";
1811
+ }>>;
1812
+ onDeadline: z.ZodDefault<z.ZodEnum<{
1813
+ preserve: "preserve";
1814
+ destroy: "destroy";
1815
+ }>>;
1816
+ onCleanExit: z.ZodDefault<z.ZodEnum<{
1817
+ preserve: "preserve";
1818
+ destroy: "destroy";
1819
+ }>>;
1820
+ onFailure: z.ZodDefault<z.ZodEnum<{
1821
+ preserve: "preserve";
1822
+ destroy: "destroy";
1823
+ "retain-for-recovery": "retain-for-recovery";
1824
+ }>>;
1825
+ retention: z.ZodDefault<z.ZodString>;
1826
+ }, z.core.$strip>>;
1827
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1828
+ name: z.ZodString;
1829
+ mount: z.ZodString;
1830
+ pattern: z.ZodString;
1831
+ maxBytes: z.ZodDefault<z.ZodNumber>;
1832
+ }, z.core.$strip>>>;
1833
+ }, z.core.$strip>>;
1834
+ source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1835
+ kind: z.ZodLiteral<"git">;
1836
+ destinationMount: z.ZodString;
1837
+ repositories: z.ZodRecord<z.ZodString, z.ZodObject<{
1838
+ url: z.ZodURL;
1839
+ credential: z.ZodOptional<z.ZodString>;
1840
+ }, z.core.$strip>>;
1841
+ allowedRevision: z.ZodDefault<z.ZodLiteral<"branch-tag-or-commit">>;
1842
+ }, z.core.$strip>>>;
1843
+ checkpointHook: z.ZodOptional<z.ZodObject<{
1844
+ command: z.ZodArray<z.ZodString>;
1845
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1846
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1847
+ cwd: z.ZodOptional<z.ZodString>;
1848
+ }, z.core.$strip>>;
1849
+ outputs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1850
+ type: z.ZodLiteral<"gitSha">;
1851
+ }, z.core.$strip>, z.ZodObject<{
1852
+ type: z.ZodLiteral<"string">;
1853
+ maxLength: z.ZodDefault<z.ZodNumber>;
1854
+ }, z.core.$strip>, z.ZodObject<{
1855
+ type: z.ZodLiteral<"httpsUrl">;
1856
+ maxLength: z.ZodDefault<z.ZodNumber>;
1857
+ }, z.core.$strip>], "type">>>;
1858
+ }, z.core.$strip>, z.ZodTransform<(TemplateSpecCommon & {
1859
+ agent: Agent;
1860
+ harness?: never;
1861
+ services?: never;
1862
+ checkpointHook?: never;
1863
+ }) | (TemplateSpecCommon & {
1864
+ agent?: never;
1865
+ harness: Harness;
1866
+ services: Record<string, TemplateService>;
1867
+ checkpointHook?: CheckpointHook;
1868
+ }), {
1869
+ version: string;
1870
+ image: string;
1871
+ command: string[];
1872
+ setup: {
1873
+ name: string;
1874
+ command: string[];
1875
+ timeoutSeconds: number;
1876
+ env: Record<string, string>;
1877
+ runOn: ("restore" | "create")[];
1878
+ cwd?: string | undefined;
1879
+ }[];
1880
+ env: Record<string, string>;
1881
+ resources: {
1882
+ cpu: string;
1883
+ memory: string;
1884
+ ephemeralStorage?: string | undefined;
1885
+ };
1886
+ timeouts: {
1887
+ start: string;
1888
+ maxAge: string;
1889
+ idle: string;
1890
+ disconnectGrace: string;
1891
+ terminateGrace: string;
1892
+ };
1893
+ security: {
1894
+ uid: number;
1895
+ gid: number;
1896
+ readOnlyRoot: boolean;
1897
+ writableMemoryPaths: string[];
1898
+ dropCapabilities: string[];
1899
+ allowPrivilegeEscalation: false;
1900
+ seccomp: "RuntimeDefault";
1901
+ };
1902
+ network: {
1903
+ mode: "unrestricted";
1904
+ } | {
1905
+ mode: "restricted";
1906
+ allow: {
1907
+ domain: string;
1908
+ ports: number[];
1909
+ allowPrivate: boolean;
1910
+ }[];
1911
+ };
1912
+ maxLaunchInputBytes: number;
1913
+ compat: {
1914
+ agent?: string | undefined;
1915
+ agentapi?: string | undefined;
1916
+ };
1917
+ persistence: {
1918
+ mounts: {
1919
+ name: string;
1920
+ target: string;
1921
+ maxBytes: number;
1922
+ maxFiles: number;
1923
+ }[];
1924
+ conversationRestore: "unknown" | "supported" | "filesystem_only";
1925
+ conversationRetention: string;
1926
+ checkpoint: {
1927
+ onIdle: "preserve" | "destroy";
1928
+ onDeadline: "preserve" | "destroy";
1929
+ onCleanExit: "preserve" | "destroy";
1930
+ onFailure: "preserve" | "destroy" | "retain-for-recovery";
1931
+ retention: string;
1932
+ };
1933
+ sessionCompatibility?: string | undefined;
1934
+ artifacts?: {
1935
+ name: string;
1936
+ mount: string;
1937
+ pattern: string;
1938
+ maxBytes: number;
1939
+ }[] | undefined;
1940
+ };
1941
+ source: {
1942
+ kind: "git";
1943
+ destinationMount: string;
1944
+ repositories: Record<string, {
1945
+ url: string;
1946
+ credential?: string | undefined;
1947
+ }>;
1948
+ allowedRevision: "branch-tag-or-commit";
1949
+ } | null;
1950
+ outputs: Record<string, {
1951
+ type: "gitSha";
1952
+ } | {
1953
+ type: "string";
1954
+ maxLength: number;
1955
+ } | {
1956
+ type: "httpsUrl";
1957
+ maxLength: number;
1958
+ }>;
1959
+ imagePullSecret?: string | undefined;
1960
+ agent?: {
1961
+ command: string[];
1962
+ env: Record<string, string>;
1963
+ type: string;
1964
+ transport: "pty" | "acp";
1965
+ cwd?: string | undefined;
1966
+ model?: string | undefined;
1967
+ termWidth?: number | undefined;
1968
+ stateFile?: string | undefined;
1969
+ interruptKeys?: string | undefined;
1970
+ } | undefined;
1971
+ harness?: {
1972
+ command: string[];
1973
+ env: Record<string, string>;
1974
+ cwd?: string | undefined;
1975
+ } | undefined;
1976
+ terminal?: {
1977
+ command: string[];
1978
+ env: Record<string, string>;
1979
+ maxSessions: number;
1980
+ idleTimeout: string;
1981
+ cwd?: string | undefined;
1982
+ } | undefined;
1983
+ previews?: Record<string, {
1984
+ port: number;
1985
+ }> | undefined;
1986
+ display?: {
1987
+ mode: "desktop" | "browser";
1988
+ } | undefined;
1989
+ services?: Record<string, {
1990
+ baseUrl: string;
1991
+ required: boolean;
1992
+ healthPath: string;
1993
+ routes: {
1994
+ method: "POST" | "DELETE" | "GET" | "PUT" | "PATCH";
1995
+ path: string;
1996
+ query: string[];
1997
+ responseMode: "buffered" | "stream";
1998
+ maxRequestBytes: number;
1999
+ maxResponseBytes: number;
2000
+ deadlineSeconds: number;
2001
+ }[];
2002
+ }> | undefined;
2003
+ checkpointHook?: {
2004
+ command: string[];
2005
+ timeoutSeconds: number;
2006
+ env: Record<string, string>;
2007
+ cwd?: string | undefined;
2008
+ } | undefined;
2009
+ }>>;
2010
+ }, z.core.$strip>;
2011
+ type TemplateManifest = z.infer<typeof TemplateManifestBaseSchema>;
2012
+ //#endregion
2013
+ //#region ../contracts/src/templates/workload-admission.d.ts
2014
+ declare const WorkloadDeploymentSchema: z.ZodObject<{
2015
+ workspaceId: z.ZodUUID;
2016
+ incarnationId: z.ZodString;
2017
+ profiles: z.ZodArray<z.ZodEnum<{
2018
+ "finite-process": "finite-process";
2019
+ "cloud-interactive": "cloud-interactive";
2020
+ service: "service";
2021
+ }>>;
2022
+ storageProfiles: z.ZodArray<z.ZodEnum<{
2023
+ "controller-readonly/v1": "controller-readonly/v1";
2024
+ "shared-writer-readonly/v1": "shared-writer-readonly/v1";
2025
+ }>>;
2026
+ ceilings: z.ZodObject<{
2027
+ deadlineSeconds: z.ZodNumber;
2028
+ finalizationSeconds: z.ZodNumber;
2029
+ inputFileBytes: z.ZodNumber;
2030
+ stagedInputBytes: z.ZodNumber;
2031
+ inputFiles: z.ZodNumber;
2032
+ inFlightTransfers: z.ZodNumber;
2033
+ exportBytes: z.ZodNumber;
2034
+ exportFiles: z.ZodNumber;
2035
+ unreferencedInputRetentionSeconds: z.ZodNumber;
2036
+ exportRetentionSeconds: z.ZodNumber;
2037
+ }, z.core.$strict>;
2038
+ now: z.ZodISODateTime;
2039
+ expiresAt: z.ZodISODateTime;
2040
+ installed: z.ZodOptional<z.ZodObject<{
2041
+ workspaceId: z.ZodUUID;
2042
+ incarnationId: z.ZodString;
2043
+ templateDigest: z.ZodString;
2044
+ image: z.ZodString;
2045
+ runtime: z.ZodObject<{
2046
+ digest: z.ZodString;
2047
+ protocol: z.ZodLiteral<"pocketcoder.workload/v1">;
2048
+ }, z.core.$strict>;
2049
+ storage: z.ZodObject<{
2050
+ identity: z.ZodString;
2051
+ profile: z.ZodEnum<{
2052
+ "controller-readonly/v1": "controller-readonly/v1";
2053
+ "shared-writer-readonly/v1": "shared-writer-readonly/v1";
2054
+ }>;
2055
+ }, z.core.$strict>;
2056
+ capabilities: z.ZodArray<z.ZodEnum<{
2057
+ "ready-without-task": "ready-without-task";
2058
+ "live-inputs": "live-inputs";
2059
+ "immutable-inputs": "immutable-inputs";
2060
+ "serial-operations": "serial-operations";
2061
+ "retained-exports": "retained-exports";
2062
+ "explicit-start": "explicit-start";
2063
+ "exact-exit": "exact-exit";
2064
+ "targeted-cancel": "targeted-cancel";
2065
+ "stop-before-export": "stop-before-export";
2066
+ "request-lookup": "request-lookup";
2067
+ "deduplicated-accept": "deduplicated-accept";
2068
+ "explicit-publication": "explicit-publication";
2069
+ "workspace-services": "workspace-services";
2070
+ "revocable-preview-grants": "revocable-preview-grants";
2071
+ "workspace-cancel": "workspace-cancel";
2072
+ "unknown-outcome": "unknown-outcome";
2073
+ }>>;
2074
+ adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
2075
+ kind: z.ZodEnum<{
2076
+ agentapi: "agentapi";
2077
+ service: "service";
2078
+ process: "process";
2079
+ pi: "pi";
2080
+ }>;
2081
+ digest: z.ZodString;
2082
+ protocol: z.ZodString;
2083
+ capabilities: z.ZodArray<z.ZodEnum<{
2084
+ "ready-without-task": "ready-without-task";
2085
+ "live-inputs": "live-inputs";
2086
+ "immutable-inputs": "immutable-inputs";
2087
+ "serial-operations": "serial-operations";
2088
+ "retained-exports": "retained-exports";
2089
+ "explicit-start": "explicit-start";
2090
+ "exact-exit": "exact-exit";
2091
+ "targeted-cancel": "targeted-cancel";
2092
+ "stop-before-export": "stop-before-export";
2093
+ "request-lookup": "request-lookup";
2094
+ "deduplicated-accept": "deduplicated-accept";
2095
+ "explicit-publication": "explicit-publication";
2096
+ "workspace-services": "workspace-services";
2097
+ "revocable-preview-grants": "revocable-preview-grants";
2098
+ "workspace-cancel": "workspace-cancel";
2099
+ "unknown-outcome": "unknown-outcome";
2100
+ }>>;
2101
+ }, z.core.$strict>>;
2102
+ }, z.core.$strict>>;
2103
+ }, z.core.$strict>;
2104
+ type WorkloadDeployment = z.infer<typeof WorkloadDeploymentSchema>;
2105
+ //#endregion
2106
+ //#region ../contracts/src/templates/workload-capabilities.d.ts
2107
+ declare const WorkloadCapabilitySchema: z.ZodEnum<{
2108
+ "ready-without-task": "ready-without-task";
2109
+ "live-inputs": "live-inputs";
2110
+ "immutable-inputs": "immutable-inputs";
2111
+ "serial-operations": "serial-operations";
2112
+ "retained-exports": "retained-exports";
2113
+ "explicit-start": "explicit-start";
2114
+ "exact-exit": "exact-exit";
2115
+ "targeted-cancel": "targeted-cancel";
2116
+ "stop-before-export": "stop-before-export";
2117
+ "request-lookup": "request-lookup";
2118
+ "deduplicated-accept": "deduplicated-accept";
2119
+ "explicit-publication": "explicit-publication";
2120
+ "workspace-services": "workspace-services";
2121
+ "revocable-preview-grants": "revocable-preview-grants";
2122
+ "workspace-cancel": "workspace-cancel";
2123
+ "unknown-outcome": "unknown-outcome";
2124
+ }>;
2125
+ type WorkloadCapability = z.infer<typeof WorkloadCapabilitySchema>;
2126
+ declare const WorkloadLimitsSchema: z.ZodObject<{
2127
+ deadlineSeconds: z.ZodNumber;
2128
+ finalizationSeconds: z.ZodNumber;
2129
+ inputFileBytes: z.ZodNumber;
2130
+ stagedInputBytes: z.ZodNumber;
2131
+ inputFiles: z.ZodNumber;
2132
+ inFlightTransfers: z.ZodNumber;
2133
+ exportBytes: z.ZodNumber;
2134
+ exportFiles: z.ZodNumber;
2135
+ unreferencedInputRetentionSeconds: z.ZodNumber;
2136
+ exportRetentionSeconds: z.ZodNumber;
2137
+ }, z.core.$strict>;
2138
+ type WorkloadLimits = z.infer<typeof WorkloadLimitsSchema>;
2139
+ declare const InstalledWorkloadSchema: z.ZodObject<{
2140
+ workspaceId: z.ZodUUID;
2141
+ incarnationId: z.ZodString;
2142
+ templateDigest: z.ZodString;
2143
+ image: z.ZodString;
2144
+ runtime: z.ZodObject<{
2145
+ digest: z.ZodString;
2146
+ protocol: z.ZodLiteral<"pocketcoder.workload/v1">;
2147
+ }, z.core.$strict>;
2148
+ storage: z.ZodObject<{
2149
+ identity: z.ZodString;
2150
+ profile: z.ZodEnum<{
2151
+ "controller-readonly/v1": "controller-readonly/v1";
2152
+ "shared-writer-readonly/v1": "shared-writer-readonly/v1";
2153
+ }>;
2154
+ }, z.core.$strict>;
2155
+ capabilities: z.ZodArray<z.ZodEnum<{
2156
+ "ready-without-task": "ready-without-task";
2157
+ "live-inputs": "live-inputs";
2158
+ "immutable-inputs": "immutable-inputs";
2159
+ "serial-operations": "serial-operations";
2160
+ "retained-exports": "retained-exports";
2161
+ "explicit-start": "explicit-start";
2162
+ "exact-exit": "exact-exit";
2163
+ "targeted-cancel": "targeted-cancel";
2164
+ "stop-before-export": "stop-before-export";
2165
+ "request-lookup": "request-lookup";
2166
+ "deduplicated-accept": "deduplicated-accept";
2167
+ "explicit-publication": "explicit-publication";
2168
+ "workspace-services": "workspace-services";
2169
+ "revocable-preview-grants": "revocable-preview-grants";
2170
+ "workspace-cancel": "workspace-cancel";
2171
+ "unknown-outcome": "unknown-outcome";
2172
+ }>>;
2173
+ adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
2174
+ kind: z.ZodEnum<{
2175
+ agentapi: "agentapi";
2176
+ service: "service";
2177
+ process: "process";
2178
+ pi: "pi";
2179
+ }>;
2180
+ digest: z.ZodString;
2181
+ protocol: z.ZodString;
2182
+ capabilities: z.ZodArray<z.ZodEnum<{
2183
+ "ready-without-task": "ready-without-task";
2184
+ "live-inputs": "live-inputs";
2185
+ "immutable-inputs": "immutable-inputs";
2186
+ "serial-operations": "serial-operations";
2187
+ "retained-exports": "retained-exports";
2188
+ "explicit-start": "explicit-start";
2189
+ "exact-exit": "exact-exit";
2190
+ "targeted-cancel": "targeted-cancel";
2191
+ "stop-before-export": "stop-before-export";
2192
+ "request-lookup": "request-lookup";
2193
+ "deduplicated-accept": "deduplicated-accept";
2194
+ "explicit-publication": "explicit-publication";
2195
+ "workspace-services": "workspace-services";
2196
+ "revocable-preview-grants": "revocable-preview-grants";
2197
+ "workspace-cancel": "workspace-cancel";
2198
+ "unknown-outcome": "unknown-outcome";
2199
+ }>>;
2200
+ }, z.core.$strict>>;
2201
+ }, z.core.$strict>;
2202
+ type InstalledWorkload = z.infer<typeof InstalledWorkloadSchema>;
2203
+ //#endregion
463
2204
  //#region ../contracts/src/terminals/terminal.d.ts
464
2205
  declare const ServerTerminalMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
465
2206
  type: z.ZodLiteral<"opened">;
@@ -471,10 +2212,10 @@ declare const ServerTerminalMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
471
2212
  }, z.core.$strip>, z.ZodObject<{
472
2213
  type: z.ZodLiteral<"closed">;
473
2214
  reason: z.ZodEnum<{
2215
+ idle: "idle";
474
2216
  checkpoint: "checkpoint";
475
- workspace_ended: "workspace_ended";
476
2217
  exit: "exit";
477
- idle: "idle";
2218
+ workspace_ended: "workspace_ended";
478
2219
  agent_detached: "agent_detached";
479
2220
  }>;
480
2221
  exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -493,10 +2234,10 @@ declare const TerminalSessionSchema: z.ZodObject<{
493
2234
  closed_at: z.ZodNullable<z.ZodISODateTime>;
494
2235
  duration_ms: z.ZodNullable<z.ZodNumber>;
495
2236
  close_reason: z.ZodNullable<z.ZodEnum<{
2237
+ idle: "idle";
496
2238
  checkpoint: "checkpoint";
497
- workspace_ended: "workspace_ended";
498
2239
  exit: "exit";
499
- idle: "idle";
2240
+ workspace_ended: "workspace_ended";
500
2241
  agent_detached: "agent_detached";
501
2242
  client_closed: "client_closed";
502
2243
  }>>;
@@ -507,6 +2248,73 @@ declare const TerminalSessionSchema: z.ZodObject<{
507
2248
  type ServerTerminalMessage = z.infer<typeof ServerTerminalMessageSchema>;
508
2249
  type TerminalSession = z.infer<typeof TerminalSessionSchema>;
509
2250
  //#endregion
2251
+ //#region ../contracts/src/workspaces/workload-operation.d.ts
2252
+ declare const WorkloadExecutionReferenceSchema: z.ZodObject<{
2253
+ workspaceId: z.ZodUUID;
2254
+ incarnationId: z.ZodString;
2255
+ owner: z.ZodEnum<{
2256
+ process: "process";
2257
+ "conversation-request": "conversation-request";
2258
+ }>;
2259
+ requestId: z.ZodUUID;
2260
+ }, z.core.$strict>;
2261
+ type WorkloadExecutionReference = z.infer<typeof WorkloadExecutionReferenceSchema>;
2262
+ declare const WorkloadAcceptanceSchema: z.ZodObject<{
2263
+ execution: z.ZodObject<{
2264
+ workspaceId: z.ZodUUID;
2265
+ incarnationId: z.ZodString;
2266
+ owner: z.ZodEnum<{
2267
+ process: "process";
2268
+ "conversation-request": "conversation-request";
2269
+ }>;
2270
+ requestId: z.ZodUUID;
2271
+ }, z.core.$strict>;
2272
+ callerPrincipalId: z.ZodUUID;
2273
+ templateDigest: z.ZodString;
2274
+ adapterDigest: z.ZodString;
2275
+ operation: z.ZodString;
2276
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
2277
+ inputs: z.ZodObject<{
2278
+ workspaceId: z.ZodUUID;
2279
+ incarnationId: z.ZodString;
2280
+ digest: z.ZodString;
2281
+ objects: z.ZodArray<z.ZodObject<{
2282
+ workspaceId: z.ZodUUID;
2283
+ fileId: z.ZodUUID;
2284
+ objectVersion: z.ZodString;
2285
+ name: z.ZodString;
2286
+ mediaType: z.ZodString;
2287
+ sizeBytes: z.ZodNumber;
2288
+ digest: z.ZodString;
2289
+ visibility: z.ZodEnum<{
2290
+ ready: "ready";
2291
+ expired: "expired";
2292
+ unavailable: "unavailable";
2293
+ }>;
2294
+ }, z.core.$strict>>;
2295
+ }, z.core.$strict>;
2296
+ bindingSetDigest: z.ZodString;
2297
+ fingerprint: z.ZodString;
2298
+ }, z.core.$strict>;
2299
+ type WorkloadAcceptance = z.infer<typeof WorkloadAcceptanceSchema>;
2300
+ declare const WorkloadCancelSchema: z.ZodObject<{
2301
+ execution: z.ZodObject<{
2302
+ workspaceId: z.ZodUUID;
2303
+ incarnationId: z.ZodString;
2304
+ owner: z.ZodEnum<{
2305
+ process: "process";
2306
+ "conversation-request": "conversation-request";
2307
+ }>;
2308
+ requestId: z.ZodUUID;
2309
+ }, z.core.$strict>;
2310
+ cancelId: z.ZodUUID;
2311
+ scope: z.ZodEnum<{
2312
+ workspace: "workspace";
2313
+ operation: "operation";
2314
+ }>;
2315
+ }, z.core.$strict>;
2316
+ type WorkloadCancel = z.infer<typeof WorkloadCancelSchema>;
2317
+ //#endregion
510
2318
  //#region src/transport/transport.d.ts
511
2319
  type FetchLike = typeof fetch;
512
2320
  type WebSocketFactory = (url: string, headers: Record<string, string>) => WebSocket;
@@ -531,6 +2339,7 @@ declare class PocketCoderTransport {
531
2339
  constructor(config: PocketCoderClientConfig, fetchImpl?: FetchLike);
532
2340
  webSocket(path: string): WebSocket;
533
2341
  raw(path: string, init?: RequestInit): Promise<Response>;
2342
+ stream(path: string, signal?: AbortSignal): Promise<Response>;
534
2343
  request<T>(path: string, schema: z.ZodType<T>, init?: RequestInit): Promise<T>;
535
2344
  }
536
2345
  //#endregion
@@ -594,8 +2403,12 @@ declare class WorkspacesApi {
594
2403
  version: string;
595
2404
  digest: string;
596
2405
  };
597
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
598
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2406
+ agent: {
2407
+ type: string;
2408
+ model: string | null;
2409
+ } | null;
2410
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2411
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
599
2412
  agent_state: "unknown" | "running" | "stable";
600
2413
  change_cursor: number;
601
2414
  provider_kind: string | null;
@@ -630,7 +2443,7 @@ declare class WorkspacesApi {
630
2443
  };
631
2444
  outputs: Record<string, unknown>;
632
2445
  failure: {
633
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2446
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
634
2447
  log_tail: string;
635
2448
  log_tail_truncated: boolean;
636
2449
  last_log_seq: number | null;
@@ -644,8 +2457,12 @@ declare class WorkspacesApi {
644
2457
  version: string;
645
2458
  digest: string;
646
2459
  };
647
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
648
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2460
+ agent: {
2461
+ type: string;
2462
+ model: string | null;
2463
+ } | null;
2464
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2465
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
649
2466
  agent_state: "unknown" | "running" | "stable";
650
2467
  change_cursor: number;
651
2468
  provider_kind: string | null;
@@ -680,7 +2497,7 @@ declare class WorkspacesApi {
680
2497
  };
681
2498
  outputs: Record<string, unknown>;
682
2499
  failure: {
683
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2500
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
684
2501
  log_tail: string;
685
2502
  log_tail_truncated: boolean;
686
2503
  last_log_seq: number | null;
@@ -694,8 +2511,12 @@ declare class WorkspacesApi {
694
2511
  version: string;
695
2512
  digest: string;
696
2513
  };
697
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
698
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2514
+ agent: {
2515
+ type: string;
2516
+ model: string | null;
2517
+ } | null;
2518
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2519
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
699
2520
  agent_state: "unknown" | "running" | "stable";
700
2521
  change_cursor: number;
701
2522
  provider_kind: string | null;
@@ -730,7 +2551,7 @@ declare class WorkspacesApi {
730
2551
  };
731
2552
  outputs: Record<string, unknown>;
732
2553
  failure: {
733
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2554
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
734
2555
  log_tail: string;
735
2556
  log_tail_truncated: boolean;
736
2557
  last_log_seq: number | null;
@@ -744,8 +2565,12 @@ declare class WorkspacesApi {
744
2565
  version: string;
745
2566
  digest: string;
746
2567
  };
747
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
748
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2568
+ agent: {
2569
+ type: string;
2570
+ model: string | null;
2571
+ } | null;
2572
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2573
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
749
2574
  agent_state: "unknown" | "running" | "stable";
750
2575
  change_cursor: number;
751
2576
  provider_kind: string | null;
@@ -780,7 +2605,7 @@ declare class WorkspacesApi {
780
2605
  };
781
2606
  outputs: Record<string, unknown>;
782
2607
  failure: {
783
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2608
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
784
2609
  log_tail: string;
785
2610
  log_tail_truncated: boolean;
786
2611
  last_log_seq: number | null;
@@ -794,8 +2619,12 @@ declare class WorkspacesApi {
794
2619
  version: string;
795
2620
  digest: string;
796
2621
  };
797
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
798
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2622
+ agent: {
2623
+ type: string;
2624
+ model: string | null;
2625
+ } | null;
2626
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2627
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
799
2628
  agent_state: "unknown" | "running" | "stable";
800
2629
  change_cursor: number;
801
2630
  provider_kind: string | null;
@@ -830,7 +2659,7 @@ declare class WorkspacesApi {
830
2659
  };
831
2660
  outputs: Record<string, unknown>;
832
2661
  failure: {
833
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2662
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
834
2663
  log_tail: string;
835
2664
  log_tail_truncated: boolean;
836
2665
  last_log_seq: number | null;
@@ -847,8 +2676,12 @@ declare class WorkspacesApi {
847
2676
  version: string;
848
2677
  digest: string;
849
2678
  };
850
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
851
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2679
+ agent: {
2680
+ type: string;
2681
+ model: string | null;
2682
+ } | null;
2683
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2684
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
852
2685
  agent_state: "unknown" | "running" | "stable";
853
2686
  change_cursor: number;
854
2687
  provider_kind: string | null;
@@ -883,7 +2716,7 @@ declare class WorkspacesApi {
883
2716
  };
884
2717
  outputs: Record<string, unknown>;
885
2718
  failure: {
886
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2719
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
887
2720
  log_tail: string;
888
2721
  log_tail_truncated: boolean;
889
2722
  last_log_seq: number | null;
@@ -900,8 +2733,12 @@ declare class WorkspacesApi {
900
2733
  version: string;
901
2734
  digest: string;
902
2735
  };
903
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
904
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2736
+ agent: {
2737
+ type: string;
2738
+ model: string | null;
2739
+ } | null;
2740
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2741
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
905
2742
  agent_state: "unknown" | "running" | "stable";
906
2743
  change_cursor: number;
907
2744
  provider_kind: string | null;
@@ -936,7 +2773,7 @@ declare class WorkspacesApi {
936
2773
  };
937
2774
  outputs: Record<string, unknown>;
938
2775
  failure: {
939
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2776
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
940
2777
  log_tail: string;
941
2778
  log_tail_truncated: boolean;
942
2779
  last_log_seq: number | null;
@@ -950,8 +2787,12 @@ declare class WorkspacesApi {
950
2787
  version: string;
951
2788
  digest: string;
952
2789
  };
953
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
954
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2790
+ agent: {
2791
+ type: string;
2792
+ model: string | null;
2793
+ } | null;
2794
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2795
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
955
2796
  agent_state: "unknown" | "running" | "stable";
956
2797
  change_cursor: number;
957
2798
  provider_kind: string | null;
@@ -986,7 +2827,7 @@ declare class WorkspacesApi {
986
2827
  };
987
2828
  outputs: Record<string, unknown>;
988
2829
  failure: {
989
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2830
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
990
2831
  log_tail: string;
991
2832
  log_tail_truncated: boolean;
992
2833
  last_log_seq: number | null;
@@ -1001,8 +2842,12 @@ declare class WorkspacesApi {
1001
2842
  version: string;
1002
2843
  digest: string;
1003
2844
  };
1004
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
1005
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2845
+ agent: {
2846
+ type: string;
2847
+ model: string | null;
2848
+ } | null;
2849
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2850
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
1006
2851
  agent_state: "unknown" | "running" | "stable";
1007
2852
  change_cursor: number;
1008
2853
  provider_kind: string | null;
@@ -1037,7 +2882,7 @@ declare class WorkspacesApi {
1037
2882
  };
1038
2883
  outputs: Record<string, unknown>;
1039
2884
  failure: {
1040
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2885
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
1041
2886
  log_tail: string;
1042
2887
  log_tail_truncated: boolean;
1043
2888
  last_log_seq: number | null;
@@ -1046,7 +2891,7 @@ declare class WorkspacesApi {
1046
2891
  checkpoint: {
1047
2892
  id: string;
1048
2893
  workspace_id: string;
1049
- state: "deleted" | "ready" | "failed" | "creating" | "deleting";
2894
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
1050
2895
  reason_code: string | null;
1051
2896
  template: {
1052
2897
  name: string;
@@ -1067,7 +2912,7 @@ declare class WorkspacesApi {
1067
2912
  operation: {
1068
2913
  id: string;
1069
2914
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1070
- state: "succeeded" | "failed" | "running" | "pending";
2915
+ state: "failed" | "pending" | "running" | "succeeded";
1071
2916
  workspace_id: string | null;
1072
2917
  checkpoint_id: string | null;
1073
2918
  result_workspace_id: string | null;
@@ -1080,7 +2925,7 @@ declare class WorkspacesApi {
1080
2925
  purge(id: string, key: string, options?: RequestOptions): Promise<{
1081
2926
  id: string;
1082
2927
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1083
- state: "succeeded" | "failed" | "running" | "pending";
2928
+ state: "failed" | "pending" | "running" | "succeeded";
1084
2929
  workspace_id: string | null;
1085
2930
  checkpoint_id: string | null;
1086
2931
  result_workspace_id: string | null;
@@ -1098,8 +2943,12 @@ declare class WorkspacesApi {
1098
2943
  version: string;
1099
2944
  digest: string;
1100
2945
  };
1101
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
1102
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
2946
+ agent: {
2947
+ type: string;
2948
+ model: string | null;
2949
+ } | null;
2950
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
2951
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
1103
2952
  agent_state: "unknown" | "running" | "stable";
1104
2953
  change_cursor: number;
1105
2954
  provider_kind: string | null;
@@ -1134,7 +2983,7 @@ declare class WorkspacesApi {
1134
2983
  };
1135
2984
  outputs: Record<string, unknown>;
1136
2985
  failure: {
1137
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
2986
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
1138
2987
  log_tail: string;
1139
2988
  log_tail_truncated: boolean;
1140
2989
  last_log_seq: number | null;
@@ -1143,7 +2992,7 @@ declare class WorkspacesApi {
1143
2992
  operation: {
1144
2993
  id: string;
1145
2994
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1146
- state: "succeeded" | "failed" | "running" | "pending";
2995
+ state: "failed" | "pending" | "running" | "succeeded";
1147
2996
  workspace_id: string | null;
1148
2997
  checkpoint_id: string | null;
1149
2998
  result_workspace_id: string | null;
@@ -1162,8 +3011,12 @@ declare class WorkspacesApi {
1162
3011
  version: string;
1163
3012
  digest: string;
1164
3013
  };
1165
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
1166
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
3014
+ agent: {
3015
+ type: string;
3016
+ model: string | null;
3017
+ } | null;
3018
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
3019
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
1167
3020
  agent_state: "unknown" | "running" | "stable";
1168
3021
  change_cursor: number;
1169
3022
  provider_kind: string | null;
@@ -1198,7 +3051,7 @@ declare class WorkspacesApi {
1198
3051
  };
1199
3052
  outputs: Record<string, unknown>;
1200
3053
  failure: {
1201
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
3054
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
1202
3055
  log_tail: string;
1203
3056
  log_tail_truncated: boolean;
1204
3057
  last_log_seq: number | null;
@@ -1207,7 +3060,7 @@ declare class WorkspacesApi {
1207
3060
  operation: {
1208
3061
  id: string;
1209
3062
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1210
- state: "succeeded" | "failed" | "running" | "pending";
3063
+ state: "failed" | "pending" | "running" | "succeeded";
1211
3064
  workspace_id: string | null;
1212
3065
  checkpoint_id: string | null;
1213
3066
  result_workspace_id: string | null;
@@ -1226,6 +3079,23 @@ declare class WorkspacesApi {
1226
3079
  private jsonOperation;
1227
3080
  }
1228
3081
  //#endregion
3082
+ //#region src/resources/agent/agent.d.ts
3083
+ interface AgentMessageInput {
3084
+ content: string;
3085
+ attachmentIds?: string[];
3086
+ signal?: AbortSignal;
3087
+ readyTimeoutMs?: number;
3088
+ }
3089
+ declare class AgentApi {
3090
+ private readonly transport;
3091
+ private readonly workspaces;
3092
+ constructor(transport: PocketCoderTransport, workspaces: WorkspacesApi);
3093
+ sendMessage(workspaceId: string, input: AgentMessageInput): Promise<void>;
3094
+ interrupt(workspaceId: string, options?: RequestOptions): Promise<{
3095
+ status: "requested" | "idle";
3096
+ }>;
3097
+ }
3098
+ //#endregion
1229
3099
  //#region src/resources/attachments/attachments.d.ts
1230
3100
  type UploadBody = NonNullable<RequestInit["body"]>;
1231
3101
  interface AttachmentUploadInput {
@@ -1234,25 +3104,14 @@ interface AttachmentUploadInput {
1234
3104
  mediaType?: string;
1235
3105
  body: UploadBody;
1236
3106
  sizeBytes: number;
3107
+ sha256?: string;
1237
3108
  signal?: AbortSignal;
1238
3109
  onProgress?: (uploadedBytes: number, totalBytes: number) => void;
1239
3110
  }
1240
- interface AgentMessageInput {
1241
- content: string;
1242
- attachmentIds?: string[];
1243
- signal?: AbortSignal;
1244
- readyTimeoutMs?: number;
1245
- }
1246
3111
  declare class AttachmentsApi {
1247
3112
  private readonly transport;
1248
3113
  constructor(transport: PocketCoderTransport);
1249
- upload(workspaceId: string, input: AttachmentUploadInput): Promise<AttachmentDescriptor>;
1250
- }
1251
- declare class AgentApi {
1252
- private readonly transport;
1253
- private readonly workspaces;
1254
- constructor(transport: PocketCoderTransport, workspaces: WorkspacesApi);
1255
- sendMessage(workspaceId: string, input: AgentMessageInput): Promise<void>;
3114
+ upload(workspaceId: string, input: AttachmentUploadInput): Promise<InputObjectReference>;
1256
3115
  }
1257
3116
  //#endregion
1258
3117
  //#region src/transport/common.d.ts
@@ -1274,7 +3133,7 @@ declare class CheckpointsApi {
1274
3133
  }, options?: RequestOptions): Promise<Page<{
1275
3134
  id: string;
1276
3135
  workspace_id: string;
1277
- state: "deleted" | "ready" | "failed" | "creating" | "deleting";
3136
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
1278
3137
  reason_code: string | null;
1279
3138
  template: {
1280
3139
  name: string;
@@ -1295,7 +3154,7 @@ declare class CheckpointsApi {
1295
3154
  get(id: string, options?: RequestOptions): Promise<{
1296
3155
  id: string;
1297
3156
  workspace_id: string;
1298
- state: "deleted" | "ready" | "failed" | "creating" | "deleting";
3157
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
1299
3158
  reason_code: string | null;
1300
3159
  template: {
1301
3160
  name: string;
@@ -1316,7 +3175,7 @@ declare class CheckpointsApi {
1316
3175
  verify(id: string, key: string, options?: RequestOptions): Promise<{
1317
3176
  id: string;
1318
3177
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1319
- state: "succeeded" | "failed" | "running" | "pending";
3178
+ state: "failed" | "pending" | "running" | "succeeded";
1320
3179
  workspace_id: string | null;
1321
3180
  checkpoint_id: string | null;
1322
3181
  result_workspace_id: string | null;
@@ -1328,7 +3187,7 @@ declare class CheckpointsApi {
1328
3187
  delete(id: string, key: string, options?: RequestOptions): Promise<{
1329
3188
  id: string;
1330
3189
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1331
- state: "succeeded" | "failed" | "running" | "pending";
3190
+ state: "failed" | "pending" | "running" | "succeeded";
1332
3191
  workspace_id: string | null;
1333
3192
  checkpoint_id: string | null;
1334
3193
  result_workspace_id: string | null;
@@ -1346,8 +3205,12 @@ declare class CheckpointsApi {
1346
3205
  version: string;
1347
3206
  digest: string;
1348
3207
  };
1349
- state: "queued" | "provisioning" | "connected" | "ready" | "preserving" | "terminating" | "succeeded" | "failed" | "canceled" | "expired" | "preserved";
1350
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
3208
+ agent: {
3209
+ type: string;
3210
+ model: string | null;
3211
+ } | null;
3212
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
3213
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed" | null;
1351
3214
  agent_state: "unknown" | "running" | "stable";
1352
3215
  change_cursor: number;
1353
3216
  provider_kind: string | null;
@@ -1382,7 +3245,7 @@ declare class CheckpointsApi {
1382
3245
  };
1383
3246
  outputs: Record<string, unknown>;
1384
3247
  failure: {
1385
- reason_code: "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
3248
+ reason_code: "admission_global_capacity" | "admission_principal_capacity" | "admission_template_capacity" | "admission_policy_global_capacity" | "admission_actor_capacity" | "admission_denied" | "admission_unavailable" | "child_exit_success" | "child_exit_failure" | "setup_failed" | "bootstrap_failed" | "registration_timeout" | "health_failed" | "child_crash" | "provider_lost" | "disconnect_timeout" | "canceled_by_caller" | "deadline_expired" | "idle_expired" | "queue_timeout" | "launch_failed" | "preserve_requested" | "preserved_by_policy" | "checkpoint_created" | "checkpoint_failed" | "checkpoint_corrupt" | "checkpoint_quota_exceeded" | "checkpoint_storage_lost" | "restore_requested" | "restore_failed" | "image_unavailable" | "source_resolution_failed" | "secret_resolution_failed" | "operation_conflict" | "network_policy_failed";
1386
3249
  log_tail: string;
1387
3250
  log_tail_truncated: boolean;
1388
3251
  last_log_seq: number | null;
@@ -1391,7 +3254,7 @@ declare class CheckpointsApi {
1391
3254
  operation: {
1392
3255
  id: string;
1393
3256
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1394
- state: "succeeded" | "failed" | "running" | "pending";
3257
+ state: "failed" | "pending" | "running" | "succeeded";
1395
3258
  workspace_id: string | null;
1396
3259
  checkpoint_id: string | null;
1397
3260
  result_workspace_id: string | null;
@@ -1409,7 +3272,7 @@ declare class OperationsApi {
1409
3272
  get(id: string, options?: RequestOptions): Promise<{
1410
3273
  id: string;
1411
3274
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1412
- state: "succeeded" | "failed" | "running" | "pending";
3275
+ state: "failed" | "pending" | "running" | "succeeded";
1413
3276
  workspace_id: string | null;
1414
3277
  checkpoint_id: string | null;
1415
3278
  result_workspace_id: string | null;
@@ -1422,18 +3285,208 @@ declare class OperationsApi {
1422
3285
  //#endregion
1423
3286
  //#region src/resources/conversations/conversations.d.ts
1424
3287
  type ConversationMessage = ConversationMessageResource;
1425
- type ConversationPage = Page<ConversationMessageResource>;
3288
+ type ConversationPage = Awaited<ReturnType<ConversationsApi["list"]>>;
1426
3289
  declare class ConversationsApi {
1427
3290
  private readonly transport;
1428
3291
  constructor(transport: PocketCoderTransport);
1429
- list(id: string, query?: CursorListQuery, options?: RequestOptions): Promise<Page<{
1430
- message_id: string;
1431
- role: "user" | "assistant" | "system" | "tool";
1432
- content: string;
1433
- occurred_at: string;
1434
- metadata: Record<string, string>;
1435
- seq: number;
1436
- }>>;
3292
+ list(id: string, query?: CursorListQuery, options?: RequestOptions): Promise<{
3293
+ protocol: {
3294
+ schema: "pocketcoder.conversation/v2";
3295
+ request_identity_authorities: ("external" | "generic")[];
3296
+ producer_capabilities: null;
3297
+ } | null;
3298
+ retention: {
3299
+ status: "retained";
3300
+ expires_at: string | null;
3301
+ };
3302
+ items: {
3303
+ message_id: string;
3304
+ role: "user" | "assistant" | "system" | "tool";
3305
+ content: string;
3306
+ occurred_at: string;
3307
+ metadata: Record<string, string>;
3308
+ seq: number;
3309
+ identity: {
3310
+ schema: "pocketcoder.conversation/v2";
3311
+ authority: "external" | "generic";
3312
+ conversation_id: string;
3313
+ request_id: string;
3314
+ turn_id: string;
3315
+ request_fingerprint: string;
3316
+ event_id: string;
3317
+ message_id: string;
3318
+ sequence: number;
3319
+ revision: number;
3320
+ fact?: {
3321
+ type: "intermediate";
3322
+ } | {
3323
+ type: "final_response";
3324
+ } | {
3325
+ type: "tool_only";
3326
+ } | {
3327
+ type: "activity_started";
3328
+ activity_id: string;
3329
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
3330
+ label: string;
3331
+ started_at: string | null;
3332
+ action?: string | undefined;
3333
+ subject?: string | undefined;
3334
+ } | {
3335
+ type: "activity_finished";
3336
+ activity_id: string;
3337
+ ended_at: string | null;
3338
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
3339
+ } | {
3340
+ type: "turn_terminal";
3341
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
3342
+ reason?: string | undefined;
3343
+ } | undefined;
3344
+ } | null;
3345
+ }[];
3346
+ nextCursor: string | null;
3347
+ }>;
3348
+ acceptRequest(id: string, identity: ConversationRequestIdentity, options?: RequestOptions): Promise<{
3349
+ kind: "accepted" | "replayed";
3350
+ identity: {
3351
+ schema: "pocketcoder.conversation/v2";
3352
+ authority: "external" | "generic";
3353
+ conversation_id: string;
3354
+ request_id: string;
3355
+ turn_id: string;
3356
+ request_fingerprint: string;
3357
+ };
3358
+ accepted_at: string;
3359
+ }>;
3360
+ listConversations(id: string, options?: RequestOptions): Promise<{
3361
+ conversation_id: string | null;
3362
+ workspace_id: string;
3363
+ legacy: boolean;
3364
+ status: "deleted" | "expired" | "retained";
3365
+ message_count: number;
3366
+ turn_count: number;
3367
+ last_activity_at: string;
3368
+ expires_at: string | null;
3369
+ }[]>;
3370
+ read(id: string, conversationId: string, query?: CursorListQuery, options?: RequestOptions): Promise<{
3371
+ conversation: {
3372
+ conversation_id: string | null;
3373
+ workspace_id: string;
3374
+ legacy: boolean;
3375
+ status: "deleted" | "expired" | "retained";
3376
+ message_count: number;
3377
+ turn_count: number;
3378
+ last_activity_at: string;
3379
+ expires_at: string | null;
3380
+ };
3381
+ protocol: {
3382
+ schema: "pocketcoder.conversation/v2";
3383
+ request_identity_authorities: ("external" | "generic")[];
3384
+ producer_capabilities: null;
3385
+ };
3386
+ items: {
3387
+ message_id: string;
3388
+ role: "user" | "assistant" | "system" | "tool";
3389
+ content: string;
3390
+ occurred_at: string;
3391
+ metadata: Record<string, string>;
3392
+ seq: number;
3393
+ identity: {
3394
+ schema: "pocketcoder.conversation/v2";
3395
+ authority: "external" | "generic";
3396
+ conversation_id: string;
3397
+ request_id: string;
3398
+ turn_id: string;
3399
+ request_fingerprint: string;
3400
+ event_id: string;
3401
+ message_id: string;
3402
+ sequence: number;
3403
+ revision: number;
3404
+ fact?: {
3405
+ type: "intermediate";
3406
+ } | {
3407
+ type: "final_response";
3408
+ } | {
3409
+ type: "tool_only";
3410
+ } | {
3411
+ type: "activity_started";
3412
+ activity_id: string;
3413
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
3414
+ label: string;
3415
+ started_at: string | null;
3416
+ action?: string | undefined;
3417
+ subject?: string | undefined;
3418
+ } | {
3419
+ type: "activity_finished";
3420
+ activity_id: string;
3421
+ ended_at: string | null;
3422
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
3423
+ } | {
3424
+ type: "turn_terminal";
3425
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
3426
+ reason?: string | undefined;
3427
+ } | undefined;
3428
+ } | null;
3429
+ }[];
3430
+ nextCursor: string | null;
3431
+ }>;
3432
+ delete(id: string, conversationId: string, options?: RequestOptions): Promise<void>;
3433
+ live(id: string, options?: {
3434
+ conversationId?: string;
3435
+ signal?: AbortSignal;
3436
+ }): AsyncGenerator<{
3437
+ type: "turn";
3438
+ conversation_id: string;
3439
+ turn_id: string;
3440
+ messages: {
3441
+ metadata: Record<string, string>;
3442
+ message_id: string;
3443
+ role: "user" | "assistant" | "system" | "tool";
3444
+ content: string;
3445
+ occurred_at: string;
3446
+ identity: {
3447
+ schema: "pocketcoder.conversation/v2";
3448
+ authority: "external" | "generic";
3449
+ conversation_id: string;
3450
+ request_id: string;
3451
+ turn_id: string;
3452
+ request_fingerprint: string;
3453
+ event_id: string;
3454
+ message_id: string;
3455
+ sequence: number;
3456
+ revision: number;
3457
+ fact?: {
3458
+ type: "intermediate";
3459
+ } | {
3460
+ type: "final_response";
3461
+ } | {
3462
+ type: "tool_only";
3463
+ } | {
3464
+ type: "activity_started";
3465
+ activity_id: string;
3466
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
3467
+ label: string;
3468
+ started_at: string | null;
3469
+ action?: string | undefined;
3470
+ subject?: string | undefined;
3471
+ } | {
3472
+ type: "activity_finished";
3473
+ activity_id: string;
3474
+ ended_at: string | null;
3475
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
3476
+ } | {
3477
+ type: "turn_terminal";
3478
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
3479
+ reason?: string | undefined;
3480
+ } | undefined;
3481
+ } | null;
3482
+ }[];
3483
+ } | {
3484
+ type: "committed";
3485
+ conversation_id: string | null;
3486
+ turn_id: string | null;
3487
+ status: "message" | "failed" | "canceled" | "completed" | "interrupted" | "lost" | "legacy";
3488
+ last_seq: number;
3489
+ }, void, any>;
1437
3490
  }
1438
3491
  //#endregion
1439
3492
  //#region src/resources/diagnostics/diagnostics.d.ts
@@ -1454,9 +3507,32 @@ declare class NetworkEventsApi extends WorkspaceCursorApi<NetworkEvent> {
1454
3507
  constructor(transport: PocketCoderTransport);
1455
3508
  }
1456
3509
  declare class OutputsApi extends WorkspaceCursorApi<OutputResource> {
3510
+ private readonly binaryTransport;
3511
+ download(workspaceId: string, outputId: string, options?: RequestOptions): Promise<Response>;
1457
3512
  constructor(transport: PocketCoderTransport);
1458
3513
  }
1459
3514
  //#endregion
3515
+ //#region src/resources/displays/displays.d.ts
3516
+ declare class DisplaysApi {
3517
+ private readonly transport;
3518
+ constructor(transport: PocketCoderTransport);
3519
+ capture(workspaceId: string, options?: RequestOptions): Promise<{
3520
+ kind: "screenshot";
3521
+ id: string;
3522
+ workspace_id: string;
3523
+ content_type: "image/png";
3524
+ bytes: number;
3525
+ digest: string;
3526
+ expires_at: string;
3527
+ }>;
3528
+ open(workspaceId: string, control?: boolean, options?: RequestOptions & {
3529
+ session?: ViewSessionOptions;
3530
+ }): Promise<{
3531
+ url: string;
3532
+ expires_at: string;
3533
+ }>;
3534
+ }
3535
+ //#endregion
1460
3536
  //#region src/resources/keys/keys.d.ts
1461
3537
  interface KeyListQuery {
1462
3538
  limit?: number;
@@ -1472,6 +3548,8 @@ declare class KeysApi {
1472
3548
  principal_id: string;
1473
3549
  scopes: string[];
1474
3550
  effective_scopes: string[];
3551
+ templates: string[] | null;
3552
+ effective_templates: string[];
1475
3553
  managed_principal_ids: string[];
1476
3554
  issuance_request_id: string | null;
1477
3555
  created_at: string;
@@ -1486,6 +3564,8 @@ declare class KeysApi {
1486
3564
  principal_id: string;
1487
3565
  scopes: string[];
1488
3566
  effective_scopes: string[];
3567
+ templates: string[] | null;
3568
+ effective_templates: string[];
1489
3569
  managed_principal_ids: string[];
1490
3570
  issuance_request_id: string | null;
1491
3571
  created_at: string;
@@ -1493,12 +3573,50 @@ declare class KeysApi {
1493
3573
  revoked_at: string | null;
1494
3574
  last_used_at: string | null;
1495
3575
  }, void, unknown>;
3576
+ expiring(query?: {
3577
+ withinHours?: number;
3578
+ }, options?: RequestOptions): Promise<{
3579
+ items: {
3580
+ id: string;
3581
+ principal_id: string;
3582
+ scopes: string[];
3583
+ effective_scopes: string[];
3584
+ templates: string[] | null;
3585
+ effective_templates: string[];
3586
+ managed_principal_ids: string[];
3587
+ issuance_request_id: string | null;
3588
+ created_at: string;
3589
+ expires_at: string | null;
3590
+ revoked_at: string | null;
3591
+ last_used_at: string | null;
3592
+ principal_name: string;
3593
+ }[];
3594
+ }>;
1496
3595
  issue(principalId: string, input: KeyIssueRequest, options?: RequestOptions): Promise<{
1497
3596
  key: {
1498
3597
  id: string;
1499
3598
  principal_id: string;
1500
3599
  scopes: string[];
1501
3600
  effective_scopes: string[];
3601
+ templates: string[] | null;
3602
+ effective_templates: string[];
3603
+ managed_principal_ids: string[];
3604
+ issuance_request_id: string | null;
3605
+ created_at: string;
3606
+ expires_at: string | null;
3607
+ revoked_at: string | null;
3608
+ last_used_at: string | null;
3609
+ };
3610
+ token: string | null;
3611
+ }>;
3612
+ rotate(principalId: string, keyId: string, input: KeyRotateRequest, options?: RequestOptions): Promise<{
3613
+ key: {
3614
+ id: string;
3615
+ principal_id: string;
3616
+ scopes: string[];
3617
+ effective_scopes: string[];
3618
+ templates: string[] | null;
3619
+ effective_templates: string[];
1502
3620
  managed_principal_ids: string[];
1503
3621
  issuance_request_id: string | null;
1504
3622
  created_at: string;
@@ -1521,7 +3639,7 @@ declare class RecoveryApi {
1521
3639
  purge(principalId: string, workspaceId: string, executionKey: string, options?: RequestOptions): Promise<{
1522
3640
  id: string;
1523
3641
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1524
- state: "succeeded" | "failed" | "running" | "pending";
3642
+ state: "failed" | "pending" | "running" | "succeeded";
1525
3643
  workspace_id: string | null;
1526
3644
  checkpoint_id: string | null;
1527
3645
  result_workspace_id: string | null;
@@ -1533,7 +3651,7 @@ declare class RecoveryApi {
1533
3651
  operation(principalId: string, operationId: string, options?: RequestOptions): Promise<{
1534
3652
  id: string;
1535
3653
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
1536
- state: "succeeded" | "failed" | "running" | "pending";
3654
+ state: "failed" | "pending" | "running" | "succeeded";
1537
3655
  workspace_id: string | null;
1538
3656
  checkpoint_id: string | null;
1539
3657
  result_workspace_id: string | null;
@@ -1544,6 +3662,86 @@ declare class RecoveryApi {
1544
3662
  }>;
1545
3663
  }
1546
3664
  //#endregion
3665
+ //#region src/resources/previews/previews.d.ts
3666
+ declare class PreviewsApi {
3667
+ private readonly transport;
3668
+ constructor(transport: PocketCoderTransport);
3669
+ list(workspaceId: string, options?: RequestOptions): Promise<{
3670
+ name: string;
3671
+ port: number;
3672
+ }[]>;
3673
+ open(workspaceId: string, name: string, options?: RequestOptions & {
3674
+ session?: ViewSessionOptions;
3675
+ }): Promise<{
3676
+ url: string;
3677
+ expires_at: string;
3678
+ }>;
3679
+ }
3680
+ //#endregion
3681
+ //#region src/resources/principals/principals.d.ts
3682
+ declare class PrincipalsApi {
3683
+ private readonly transport;
3684
+ constructor(transport: PocketCoderTransport);
3685
+ list(options?: RequestOptions): Promise<{
3686
+ items: {
3687
+ id: string;
3688
+ name: string;
3689
+ scopes: string[];
3690
+ templates: string[];
3691
+ disabled_at: string | null;
3692
+ created_at: string;
3693
+ }[];
3694
+ }>;
3695
+ get(principalId: string, options?: RequestOptions): Promise<{
3696
+ id: string;
3697
+ name: string;
3698
+ scopes: string[];
3699
+ templates: string[];
3700
+ disabled_at: string | null;
3701
+ created_at: string;
3702
+ }>;
3703
+ create(input: PrincipalCreateRequest, options?: RequestOptions): Promise<{
3704
+ id: string;
3705
+ name: string;
3706
+ scopes: string[];
3707
+ templates: string[];
3708
+ disabled_at: string | null;
3709
+ created_at: string;
3710
+ }>;
3711
+ update(principalId: string, input: PrincipalUpdateRequest, options?: RequestOptions): Promise<{
3712
+ id: string;
3713
+ name: string;
3714
+ scopes: string[];
3715
+ templates: string[];
3716
+ disabled_at: string | null;
3717
+ created_at: string;
3718
+ }>;
3719
+ }
3720
+ //#endregion
3721
+ //#region src/resources/secrets/secrets.d.ts
3722
+ declare class SecretsApi {
3723
+ private readonly transport;
3724
+ constructor(transport: PocketCoderTransport);
3725
+ put(name: string, input: SecretPutRequest, options?: RequestOptions): Promise<{
3726
+ name: string;
3727
+ type: "setup-issuer" | "runtime-issuer" | "registry";
3728
+ updated_at: string;
3729
+ retired_at: string | null;
3730
+ }>;
3731
+ list(options?: RequestOptions): Promise<{
3732
+ name: string;
3733
+ type: "setup-issuer" | "runtime-issuer" | "registry";
3734
+ updated_at: string;
3735
+ retired_at: string | null;
3736
+ }[]>;
3737
+ retire(name: string, options?: RequestOptions): Promise<{
3738
+ name: string;
3739
+ type: "setup-issuer" | "runtime-issuer" | "registry";
3740
+ updated_at: string;
3741
+ retired_at: string | null;
3742
+ }>;
3743
+ }
3744
+ //#endregion
1547
3745
  //#region src/resources/templates/templates.d.ts
1548
3746
  type TemplateSummary = TemplateListItem;
1549
3747
  declare class TemplatesApi {
@@ -1553,6 +3751,10 @@ declare class TemplatesApi {
1553
3751
  name: string;
1554
3752
  version: string;
1555
3753
  digest: string;
3754
+ agent: {
3755
+ type: string;
3756
+ model: string | null;
3757
+ } | null;
1556
3758
  status: "active" | "available" | "retired";
1557
3759
  description?: string | undefined;
1558
3760
  }>>;
@@ -1560,9 +3762,35 @@ declare class TemplatesApi {
1560
3762
  name: string;
1561
3763
  version: string;
1562
3764
  digest: string;
3765
+ agent: {
3766
+ type: string;
3767
+ model: string | null;
3768
+ } | null;
1563
3769
  status: "active" | "available" | "retired";
1564
3770
  description?: string | undefined;
1565
3771
  }[]>;
3772
+ publish(manifest: TemplateManifest | WorkloadTemplate, options?: RequestOptions): Promise<{
3773
+ name: string;
3774
+ version: string;
3775
+ digest: string;
3776
+ agent: {
3777
+ type: string;
3778
+ model: string | null;
3779
+ } | null;
3780
+ status: "active" | "available" | "retired";
3781
+ description?: string | undefined;
3782
+ }>;
3783
+ retire(name: string, version: string, options?: RequestOptions): Promise<{
3784
+ name: string;
3785
+ version: string;
3786
+ digest: string;
3787
+ agent: {
3788
+ type: string;
3789
+ model: string | null;
3790
+ } | null;
3791
+ status: "active" | "available" | "retired";
3792
+ description?: string | undefined;
3793
+ }>;
1566
3794
  }
1567
3795
  //#endregion
1568
3796
  //#region src/resources/terminals/terminals.d.ts
@@ -1605,8 +3833,11 @@ declare class TerminalsApi {
1605
3833
  //#region src/client.d.ts
1606
3834
  declare class PocketCoderClient {
1607
3835
  private readonly transport;
3836
+ readonly secrets: SecretsApi;
1608
3837
  readonly templates: TemplatesApi;
1609
3838
  readonly workspaces: WorkspacesApi;
3839
+ readonly previews: PreviewsApi;
3840
+ readonly displays: DisplaysApi;
1610
3841
  readonly attachments: AttachmentsApi;
1611
3842
  readonly agent: AgentApi;
1612
3843
  readonly conversations: ConversationsApi;
@@ -1617,6 +3848,7 @@ declare class PocketCoderClient {
1617
3848
  readonly outputs: OutputsApi;
1618
3849
  readonly administration: AdministrationApi;
1619
3850
  readonly terminals: TerminalsApi;
3851
+ readonly principals: PrincipalsApi;
1620
3852
  readonly keys: KeysApi;
1621
3853
  readonly recovery: RecoveryApi;
1622
3854
  constructor(config: PocketCoderClientConfig, fetchImpl?: typeof fetch);
@@ -1691,4 +3923,4 @@ declare class AgentNotReadyError extends Error {
1691
3923
  }
1692
3924
  declare function isPocketCoderErrorCode(value: unknown): value is ErrorCode;
1693
3925
  //#endregion
1694
- export { AdministrationApi, AgentApi, type AgentMessageInput, AgentNotReadyError, type AttachmentDescriptor, type AttachmentUploadInput, AttachmentsApi, type CheckpointResource, type CheckpointState, CheckpointsApi, type ClientErrorCode, ConversationGoneError, type ConversationMessage, type ConversationPage, ConversationsApi, type CursorListQuery, type KeyIssueRequest, type KeyIssueResponse, type KeyListQuery, type KeyListResponse, type KeyResource, KeysApi, type LogChunk, LogsApi, type NetworkEvent, NetworkEventsApi, type OperationKind, type OperationResource, type OperationState, OperationsApi, type OutputResource, OutputsApi, type Page, PocketCoderClient, type PocketCoderClientConfig, PocketCoderError, type PreserveRequest, RecoveryApi, type RequestOptions, type ResolveWorkspaceTurnOptions, type ResolvedWorkspaceTurn, type RestoreRequest, type ResumeWorkspaceContext, type ServerTerminalMessage, type StorageState, TERMINAL_WORKSPACE_STATES, type TemplateSummary, TemplatesApi, type TerminalConnectOptions, TerminalConnection, type TerminalSession, TerminalsApi, type WebSocketFactory, type WorkspaceCreateInput, type WorkspaceListQuery, type WorkspaceResource, type WorkspaceState, type WorkspaceSummary, WorkspaceTerminalError, WorkspaceTurnResolutionError, type WorkspaceTurnResolutionErrorCode, WorkspaceTurnResolver, type WorkspaceTurnResolverOptions, WorkspacesApi, isPocketCoderErrorCode, splitAttachmentManifest };
3926
+ export { type AcceptedInputManifest, AdministrationApi, AgentApi, type AgentInterruptResponse, type AgentMessageInput, AgentNotReadyError, type AttachmentDescriptor, type AttachmentUploadInput, AttachmentsApi, type BrowserAction, type CheckpointResource, type CheckpointState, CheckpointsApi, type ClientErrorCode, ConversationGoneError, type ConversationMessage, type ConversationMessageIdentity, type ConversationMessageInput, type ConversationPage, type ConversationRequestIdentity, ConversationsApi, type CredentialSlot, type CursorListQuery, type ExportObjectReference, type InputObjectReference, type InstalledWorkload, type KeyIssueRequest, type KeyIssueResponse, type KeyListQuery, type KeyListResponse, type KeyResource, KeysApi, type LogChunk, LogsApi, type NetworkEvent, NetworkEventsApi, type OperationKind, type OperationResource, type OperationState, OperationsApi, type OutputResource, OutputsApi, type Page, PocketCoderClient, type PocketCoderClientConfig, PocketCoderError, type PreserveRequest, type PrincipalCreateRequest, type PrincipalResource, type PrincipalUpdateRequest, PrincipalsApi, RecoveryApi, type RequestOptions, type ResolveWorkspaceTurnOptions, type ResolvedWorkspaceTurn, type RestoreRequest, type ResumeWorkspaceContext, type ScreenshotResource, type SecretPutRequest, type SecretResource, SecretsApi, type ServerTerminalMessage, type StorageState, TERMINAL_WORKSPACE_STATES, type TemplateSummary, TemplatesApi, type TerminalConnectOptions, TerminalConnection, type TerminalSession, TerminalsApi, type ViewSessionOptions, type WebSocketFactory, type WorkloadAcceptance, type WorkloadCancel, type WorkloadCapability, type WorkloadDeployment, type WorkloadExecutionReference, type WorkloadExportReference, type WorkloadInputObject, type WorkloadInputProperty, type WorkloadLimits, type WorkloadOperation, type WorkloadTemplate, type WorkloadTemplateSnapshot, type WorkspaceCreateInput, type WorkspaceListQuery, type WorkspaceResource, type WorkspaceState, type WorkspaceSummary, WorkspaceTerminalError, WorkspaceTurnResolutionError, type WorkspaceTurnResolutionErrorCode, WorkspaceTurnResolver, type WorkspaceTurnResolverOptions, WorkspacesApi, isPocketCoderErrorCode, splitAttachmentManifest };