@pstdio/pocketcoder-sdk 0.9.0 → 0.11.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.
Files changed (4) hide show
  1. package/README.md +19 -18
  2. package/dist/index.d.ts +1347 -2149
  3. package/dist/index.js +164 -206
  4. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -21,8 +21,8 @@ declare const InputObjectReferenceSchema: z.ZodObject<{
21
21
  sizeBytes: z.ZodNumber;
22
22
  digest: z.ZodString;
23
23
  visibility: z.ZodEnum<{
24
- expired: "expired";
25
24
  ready: "ready";
25
+ expired: "expired";
26
26
  unavailable: "unavailable";
27
27
  }>;
28
28
  }, z.core.$strict>;
@@ -41,8 +41,8 @@ declare const AcceptedInputManifestSchema: z.ZodObject<{
41
41
  sizeBytes: z.ZodNumber;
42
42
  digest: z.ZodString;
43
43
  visibility: z.ZodEnum<{
44
- expired: "expired";
45
44
  ready: "ready";
45
+ expired: "expired";
46
46
  unavailable: "unavailable";
47
47
  }>;
48
48
  }, z.core.$strict>>;
@@ -83,8 +83,6 @@ declare const KeyIssueRequestSchema: z.ZodObject<{
83
83
  "terminal:read": "terminal:read";
84
84
  "sessions:read": "sessions:read";
85
85
  "sessions:write": "sessions:write";
86
- "budgets:read": "budgets:read";
87
- "budgets:admin": "budgets:admin";
88
86
  admin: "admin";
89
87
  }>>;
90
88
  templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -93,8 +91,8 @@ declare const KeyIssueRequestSchema: z.ZodObject<{
93
91
  }, z.core.$strict>;
94
92
  type KeyIssueRequest = z.infer<typeof KeyIssueRequestSchema>;
95
93
  declare const KeyRotateRequestSchema: z.ZodObject<{
96
- request_id: z.ZodString;
97
94
  expires_at: z.ZodOptional<z.ZodISODateTime>;
95
+ request_id: z.ZodString;
98
96
  }, z.core.$strict>;
99
97
  type KeyRotateRequest = z.infer<typeof KeyRotateRequestSchema>;
100
98
  declare const KeyResourceSchema: z.ZodObject<{
@@ -182,8 +180,6 @@ declare const PrincipalCreateRequestSchema: z.ZodObject<{
182
180
  "terminal:read": "terminal:read";
183
181
  "sessions:read": "sessions:read";
184
182
  "sessions:write": "sessions:write";
185
- "budgets:read": "budgets:read";
186
- "budgets:admin": "budgets:admin";
187
183
  admin: "admin";
188
184
  }>>;
189
185
  templates: z.ZodArray<z.ZodString>;
@@ -231,8 +227,6 @@ declare const PrincipalUpdateRequestSchema: z.ZodObject<{
231
227
  "terminal:read": "terminal:read";
232
228
  "sessions:read": "sessions:read";
233
229
  "sessions:write": "sessions:write";
234
- "budgets:read": "budgets:read";
235
- "budgets:admin": "budgets:admin";
236
230
  admin: "admin";
237
231
  }>>>;
238
232
  templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -345,11 +339,11 @@ declare const ConversationMessageInputSchema: z.ZodObject<{
345
339
  call_id: z.ZodString;
346
340
  name: z.ZodString;
347
341
  status: z.ZodEnum<{
342
+ failed: "failed";
348
343
  pending: "pending";
349
344
  running: "running";
350
- completed: "completed";
351
- failed: "failed";
352
345
  canceled: "canceled";
346
+ completed: "completed";
353
347
  }>;
354
348
  input: z.ZodJSONSchema;
355
349
  output: z.ZodOptional<z.ZodJSONSchema>;
@@ -393,9 +387,9 @@ declare const ConversationMessageInputSchema: z.ZodObject<{
393
387
  type: z.ZodLiteral<"activity_started">;
394
388
  activity_id: z.ZodUUID;
395
389
  kind: z.ZodEnum<{
390
+ workspace: "workspace";
396
391
  tool: "tool";
397
392
  attachment: "attachment";
398
- workspace: "workspace";
399
393
  retrieval: "retrieval";
400
394
  }>;
401
395
  label: z.ZodString;
@@ -407,17 +401,17 @@ declare const ConversationMessageInputSchema: z.ZodObject<{
407
401
  activity_id: z.ZodUUID;
408
402
  ended_at: z.ZodNullable<z.ZodISODateTime>;
409
403
  outcome: z.ZodEnum<{
410
- completed: "completed";
411
404
  failed: "failed";
412
405
  canceled: "canceled";
406
+ completed: "completed";
413
407
  interrupted: "interrupted";
414
408
  }>;
415
409
  }, z.core.$strip>, z.ZodObject<{
416
410
  type: z.ZodLiteral<"turn_terminal">;
417
411
  outcome: z.ZodEnum<{
418
- completed: "completed";
419
412
  failed: "failed";
420
413
  canceled: "canceled";
414
+ completed: "completed";
421
415
  interrupted: "interrupted";
422
416
  lost: "lost";
423
417
  }>;
@@ -443,11 +437,11 @@ declare const ConversationMessageResourceSchema: z.ZodObject<{
443
437
  call_id: z.ZodString;
444
438
  name: z.ZodString;
445
439
  status: z.ZodEnum<{
440
+ failed: "failed";
446
441
  pending: "pending";
447
442
  running: "running";
448
- completed: "completed";
449
- failed: "failed";
450
443
  canceled: "canceled";
444
+ completed: "completed";
451
445
  }>;
452
446
  input: z.ZodJSONSchema;
453
447
  output: z.ZodOptional<z.ZodJSONSchema>;
@@ -492,9 +486,9 @@ declare const ConversationMessageResourceSchema: z.ZodObject<{
492
486
  type: z.ZodLiteral<"activity_started">;
493
487
  activity_id: z.ZodUUID;
494
488
  kind: z.ZodEnum<{
489
+ workspace: "workspace";
495
490
  tool: "tool";
496
491
  attachment: "attachment";
497
- workspace: "workspace";
498
492
  retrieval: "retrieval";
499
493
  }>;
500
494
  label: z.ZodString;
@@ -506,17 +500,17 @@ declare const ConversationMessageResourceSchema: z.ZodObject<{
506
500
  activity_id: z.ZodUUID;
507
501
  ended_at: z.ZodNullable<z.ZodISODateTime>;
508
502
  outcome: z.ZodEnum<{
509
- completed: "completed";
510
503
  failed: "failed";
511
504
  canceled: "canceled";
505
+ completed: "completed";
512
506
  interrupted: "interrupted";
513
507
  }>;
514
508
  }, z.core.$strip>, z.ZodObject<{
515
509
  type: z.ZodLiteral<"turn_terminal">;
516
510
  outcome: z.ZodEnum<{
517
- completed: "completed";
518
511
  failed: "failed";
519
512
  canceled: "canceled";
513
+ completed: "completed";
520
514
  interrupted: "interrupted";
521
515
  lost: "lost";
522
516
  }>;
@@ -533,8 +527,8 @@ declare const ConversationSummarySchema: z.ZodObject<{
533
527
  legacy: z.ZodBoolean;
534
528
  status: z.ZodEnum<{
535
529
  deleted: "deleted";
536
- retained: "retained";
537
530
  expired: "expired";
531
+ retained: "retained";
538
532
  }>;
539
533
  message_count: z.ZodNumber;
540
534
  turn_count: z.ZodNumber;
@@ -580,9 +574,9 @@ declare const ConversationMessageIdentitySchema: z.ZodObject<{
580
574
  type: z.ZodLiteral<"activity_started">;
581
575
  activity_id: z.ZodUUID;
582
576
  kind: z.ZodEnum<{
577
+ workspace: "workspace";
583
578
  tool: "tool";
584
579
  attachment: "attachment";
585
- workspace: "workspace";
586
580
  retrieval: "retrieval";
587
581
  }>;
588
582
  label: z.ZodString;
@@ -594,17 +588,17 @@ declare const ConversationMessageIdentitySchema: z.ZodObject<{
594
588
  activity_id: z.ZodUUID;
595
589
  ended_at: z.ZodNullable<z.ZodISODateTime>;
596
590
  outcome: z.ZodEnum<{
597
- completed: "completed";
598
591
  failed: "failed";
599
592
  canceled: "canceled";
593
+ completed: "completed";
600
594
  interrupted: "interrupted";
601
595
  }>;
602
596
  }, z.core.$strip>, z.ZodObject<{
603
597
  type: z.ZodLiteral<"turn_terminal">;
604
598
  outcome: z.ZodEnum<{
605
- completed: "completed";
606
599
  failed: "failed";
607
600
  canceled: "canceled";
601
+ completed: "completed";
608
602
  interrupted: "interrupted";
609
603
  lost: "lost";
610
604
  }>;
@@ -622,11 +616,11 @@ declare const ConversationPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
622
616
  call_id: z.ZodString;
623
617
  name: z.ZodString;
624
618
  status: z.ZodEnum<{
619
+ failed: "failed";
625
620
  pending: "pending";
626
621
  running: "running";
627
- completed: "completed";
628
- failed: "failed";
629
622
  canceled: "canceled";
623
+ completed: "completed";
630
624
  }>;
631
625
  input: z.ZodJSONSchema;
632
626
  output: z.ZodOptional<z.ZodJSONSchema>;
@@ -696,10 +690,10 @@ type ScreenshotResource = z.infer<typeof ScreenshotResourceSchema>;
696
690
  //#endregion
697
691
  //#region ../contracts/src/network/network.d.ts
698
692
  declare const NetworkEventSchema: z.ZodObject<{
699
- method: z.ZodDefault<z.ZodNullable<z.ZodString>>;
700
693
  path: z.ZodDefault<z.ZodNullable<z.ZodString>>;
701
- occurred_at: z.ZodISODateTime;
694
+ method: z.ZodDefault<z.ZodNullable<z.ZodString>>;
702
695
  reason: z.ZodString;
696
+ occurred_at: z.ZodISODateTime;
703
697
  port: z.ZodNumber;
704
698
  decision: z.ZodEnum<{
705
699
  allow: "allow";
@@ -741,9 +735,9 @@ declare const WorkloadExportReferenceSchema: z.ZodObject<{
741
735
  }, z.core.$strict>;
742
736
  manifestDigest: z.ZodString;
743
737
  completeness: z.ZodEnum<{
744
- lost: "lost";
745
738
  complete: "complete";
746
739
  partial: "partial";
740
+ lost: "lost";
747
741
  }>;
748
742
  cleanupState: z.ZodOptional<z.ZodEnum<{
749
743
  pending: "pending";
@@ -752,8 +746,8 @@ declare const WorkloadExportReferenceSchema: z.ZodObject<{
752
746
  }>>;
753
747
  publication: z.ZodEnum<{
754
748
  expired: "expired";
755
- unavailable: "unavailable";
756
749
  published: "published";
750
+ unavailable: "unavailable";
757
751
  }>;
758
752
  objects: z.ZodArray<z.ZodObject<{
759
753
  objectId: z.ZodUUID;
@@ -783,9 +777,9 @@ declare const CheckpointResourceSchema: z.ZodObject<{
783
777
  workspace_id: z.ZodUUID;
784
778
  state: z.ZodEnum<{
785
779
  deleted: "deleted";
786
- failed: "failed";
787
- ready: "ready";
788
780
  creating: "creating";
781
+ ready: "ready";
782
+ failed: "failed";
789
783
  deleting: "deleting";
790
784
  }>;
791
785
  reason_code: z.ZodNullable<z.ZodString>;
@@ -820,9 +814,9 @@ declare const OperationResourceSchema: z.ZodObject<{
820
814
  purge: "purge";
821
815
  }>;
822
816
  state: z.ZodEnum<{
817
+ failed: "failed";
823
818
  pending: "pending";
824
819
  running: "running";
825
- failed: "failed";
826
820
  succeeded: "succeeded";
827
821
  }>;
828
822
  workspace_id: z.ZodNullable<z.ZodUUID>;
@@ -894,16 +888,16 @@ declare const WorkspaceResourceSchema: z.ZodObject<{
894
888
  digest: z.ZodString;
895
889
  }, z.core.$strip>;
896
890
  state: z.ZodEnum<{
897
- failed: "failed";
898
- canceled: "canceled";
899
- expired: "expired";
900
891
  ready: "ready";
901
- provisioning: "provisioning";
892
+ failed: "failed";
902
893
  succeeded: "succeeded";
903
894
  queued: "queued";
895
+ provisioning: "provisioning";
904
896
  connected: "connected";
905
897
  preserving: "preserving";
906
898
  terminating: "terminating";
899
+ canceled: "canceled";
900
+ expired: "expired";
907
901
  preserved: "preserved";
908
902
  }>;
909
903
  reason_code: z.ZodNullable<z.ZodEnum<{
@@ -957,8 +951,8 @@ declare const WorkspaceResourceSchema: z.ZodObject<{
957
951
  }>>;
958
952
  network: z.ZodObject<{
959
953
  state: z.ZodEnum<{
960
- ready: "ready";
961
954
  disabled: "disabled";
955
+ ready: "ready";
962
956
  starting: "starting";
963
957
  degraded: "degraded";
964
958
  }>;
@@ -1112,6 +1106,7 @@ declare const WorkloadOperationSchema: z.ZodObject<{
1112
1106
  "workspace-cancel": "workspace-cancel";
1113
1107
  "unknown-outcome": "unknown-outcome";
1114
1108
  "parallel-conversations": "parallel-conversations";
1109
+ "history-seed": "history-seed";
1115
1110
  }>>;
1116
1111
  outputRoots: z.ZodArray<z.ZodString>;
1117
1112
  }, z.core.$strict>;
@@ -1175,6 +1170,7 @@ declare const WorkloadTemplateBaseSchema: z.ZodObject<{
1175
1170
  "workspace-cancel": "workspace-cancel";
1176
1171
  "unknown-outcome": "unknown-outcome";
1177
1172
  "parallel-conversations": "parallel-conversations";
1173
+ "history-seed": "history-seed";
1178
1174
  }>>;
1179
1175
  outputRoots: z.ZodArray<z.ZodString>;
1180
1176
  }, z.core.$strict>>;
@@ -1184,11 +1180,11 @@ declare const WorkloadTemplateBaseSchema: z.ZodObject<{
1184
1180
  healthPath: z.ZodDefault<z.ZodString>;
1185
1181
  routes: z.ZodArray<z.ZodObject<{
1186
1182
  method: z.ZodEnum<{
1183
+ POST: "POST";
1184
+ PATCH: "PATCH";
1187
1185
  PUT: "PUT";
1188
1186
  DELETE: "DELETE";
1189
- POST: "POST";
1190
1187
  GET: "GET";
1191
- PATCH: "PATCH";
1192
1188
  }>;
1193
1189
  path: z.ZodString;
1194
1190
  query: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1380,6 +1376,7 @@ declare const WorkloadTemplateSnapshotSchema: z.ZodObject<{
1380
1376
  "workspace-cancel": "workspace-cancel";
1381
1377
  "unknown-outcome": "unknown-outcome";
1382
1378
  "parallel-conversations": "parallel-conversations";
1379
+ "history-seed": "history-seed";
1383
1380
  }>>;
1384
1381
  outputRoots: z.ZodArray<z.ZodString>;
1385
1382
  }, z.core.$strict>>;
@@ -1389,11 +1386,11 @@ declare const WorkloadTemplateSnapshotSchema: z.ZodObject<{
1389
1386
  healthPath: z.ZodDefault<z.ZodString>;
1390
1387
  routes: z.ZodArray<z.ZodObject<{
1391
1388
  method: z.ZodEnum<{
1389
+ POST: "POST";
1390
+ PATCH: "PATCH";
1392
1391
  PUT: "PUT";
1393
1392
  DELETE: "DELETE";
1394
- POST: "POST";
1395
1393
  GET: "GET";
1396
- PATCH: "PATCH";
1397
1394
  }>;
1398
1395
  path: z.ZodString;
1399
1396
  query: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1572,50 +1569,7 @@ declare const SecretResourceSchema: z.ZodObject<{
1572
1569
  }, z.core.$strict>;
1573
1570
  type SecretResource = z.infer<typeof SecretResourceSchema>;
1574
1571
  //#endregion
1575
- //#region ../contracts/src/budgets/policy.d.ts
1576
- declare const BudgetPolicyWriteSchema: z.ZodObject<{
1577
- scopeId: z.ZodUUID;
1578
- revision: z.ZodNumber;
1579
- period: z.ZodEnum<{
1580
- utc_day: "utc_day";
1581
- utc_month: "utc_month";
1582
- }>;
1583
- limits: z.ZodObject<{
1584
- workspaceStarts: z.ZodNullable<z.ZodNumber>;
1585
- maxActiveWorkspaces: z.ZodNullable<z.ZodNumber>;
1586
- maxRunningRequestsPerSession: z.ZodLiteral<1>;
1587
- maxChatProcessesPerWorkspace: z.ZodNumber;
1588
- }, z.core.$strict>;
1589
- }, z.core.$strict>;
1590
- type BudgetPolicyWrite = z.infer<typeof BudgetPolicyWriteSchema>;
1591
- declare const BudgetPolicySchema: z.ZodObject<{
1592
- scopeId: z.ZodUUID;
1593
- revision: z.ZodNumber;
1594
- period: z.ZodEnum<{
1595
- utc_day: "utc_day";
1596
- utc_month: "utc_month";
1597
- }>;
1598
- limits: z.ZodObject<{
1599
- workspaceStarts: z.ZodNullable<z.ZodNumber>;
1600
- maxActiveWorkspaces: z.ZodNullable<z.ZodNumber>;
1601
- maxRunningRequestsPerSession: z.ZodLiteral<1>;
1602
- maxChatProcessesPerWorkspace: z.ZodNumber;
1603
- }, z.core.$strict>;
1604
- effectiveAt: z.ZodISODateTime;
1605
- }, z.core.$strict>;
1606
- type BudgetPolicy = z.infer<typeof BudgetPolicySchema>;
1607
- //#endregion
1608
1572
  //#region ../contracts/src/budgets/usage.d.ts
1609
- declare const BudgetUsageSchema: z.ZodObject<{
1610
- scopeId: z.ZodUUID;
1611
- policyRevision: z.ZodNumber;
1612
- periodStart: z.ZodISODateTime;
1613
- periodEnd: z.ZodISODateTime;
1614
- workspaceStarts: z.ZodNumber;
1615
- activeWorkspaces: z.ZodNumber;
1616
- asOf: z.ZodISODateTime;
1617
- }, z.core.$strict>;
1618
- type BudgetUsage = z.infer<typeof BudgetUsageSchema>;
1619
1573
  declare const CleanupReceiptSchema: z.ZodUnion<readonly [z.ZodObject<{
1620
1574
  workspaceId: z.ZodUUID;
1621
1575
  generationId: z.ZodString;
@@ -1668,8 +1622,8 @@ declare const ServiceReceiptSchema: z.ZodObject<{
1668
1622
  attemptId: z.ZodNullable<z.ZodUUID>;
1669
1623
  state: z.ZodEnum<{
1670
1624
  running: "running";
1671
- lost: "lost";
1672
1625
  starting: "starting";
1626
+ lost: "lost";
1673
1627
  exited: "exited";
1674
1628
  stopped: "stopped";
1675
1629
  }>;
@@ -1703,8 +1657,8 @@ declare const CollectionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
1703
1657
  }>;
1704
1658
  availability: z.ZodEnum<{
1705
1659
  expired: "expired";
1706
- unavailable: "unavailable";
1707
1660
  published: "published";
1661
+ unavailable: "unavailable";
1708
1662
  }>;
1709
1663
  expiresAt: z.ZodISODateTime;
1710
1664
  }, z.core.$strict>>;
@@ -1741,8 +1695,8 @@ declare const CollectionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
1741
1695
  }>;
1742
1696
  availability: z.ZodEnum<{
1743
1697
  expired: "expired";
1744
- unavailable: "unavailable";
1745
1698
  published: "published";
1699
+ unavailable: "unavailable";
1746
1700
  }>;
1747
1701
  expiresAt: z.ZodISODateTime;
1748
1702
  }, z.core.$strict>>;
@@ -1754,9 +1708,9 @@ declare const CollectionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
1754
1708
  }>;
1755
1709
  state: z.ZodLiteral<"settled">;
1756
1710
  completeness: z.ZodEnum<{
1757
- lost: "lost";
1758
1711
  complete: "complete";
1759
1712
  partial: "partial";
1713
+ lost: "lost";
1760
1714
  }>;
1761
1715
  manifestDigest: z.ZodString;
1762
1716
  settledAt: z.ZodISODateTime;
@@ -1764,44 +1718,63 @@ declare const CollectionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
1764
1718
  }, z.core.$strict>]>;
1765
1719
  type CollectionResult = z.infer<typeof CollectionResultSchema>;
1766
1720
  //#endregion
1767
- //#region ../contracts/src/sessions/event.d.ts
1768
- declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1769
- eventId: z.ZodUUID;
1770
- cursor: z.ZodString;
1771
- sessionId: z.ZodUUID;
1772
- sequence: z.ZodNumber;
1773
- revision: z.ZodNumber;
1774
- occurredAt: z.ZodNullable<z.ZodISODateTime>;
1775
- recordedAt: z.ZodISODateTime;
1776
- kind: z.ZodLiteral<"session.updated">;
1777
- requestId: z.ZodNull;
1778
- data: z.ZodObject<{
1779
- sessionId: z.ZodUUID;
1780
- profileId: z.ZodUUID;
1781
- profileRevision: z.ZodNumber;
1782
- revision: z.ZodNumber;
1783
- state: z.ZodEnum<{
1721
+ //#region ../contracts/src/sessions/conversation.d.ts
1722
+ declare const SessionMessageSchema: z.ZodObject<{
1723
+ messageId: z.ZodString;
1724
+ requestId: z.ZodUUID;
1725
+ turnId: z.ZodUUID;
1726
+ role: z.ZodEnum<{
1727
+ user: "user";
1728
+ assistant: "assistant";
1729
+ system: "system";
1730
+ tool: "tool";
1731
+ }>;
1732
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1733
+ type: z.ZodLiteral<"text">;
1734
+ text: z.ZodString;
1735
+ }, z.core.$strict>, z.ZodObject<{
1736
+ type: z.ZodLiteral<"tool">;
1737
+ call_id: z.ZodString;
1738
+ name: z.ZodString;
1739
+ status: z.ZodEnum<{
1784
1740
  failed: "failed";
1741
+ pending: "pending";
1742
+ running: "running";
1743
+ canceled: "canceled";
1744
+ completed: "completed";
1745
+ }>;
1746
+ input: z.ZodJSONSchema;
1747
+ output: z.ZodOptional<z.ZodJSONSchema>;
1748
+ output_text: z.ZodOptional<z.ZodString>;
1749
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1750
+ ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1751
+ }, z.core.$strict>, z.ZodObject<{
1752
+ type: z.ZodLiteral<"error">;
1753
+ code: z.ZodString;
1754
+ message: z.ZodString;
1755
+ }, z.core.$strict>, z.ZodObject<{
1756
+ type: z.ZodLiteral<"file">;
1757
+ file_id: z.ZodUUID;
1758
+ name: z.ZodString;
1759
+ media_type: z.ZodString;
1760
+ size_bytes: z.ZodNumber;
1761
+ }, z.core.$strict>], "type">>;
1762
+ final: z.ZodBoolean;
1763
+ occurredAt: z.ZodISODateTime;
1764
+ }, z.core.$strip>;
1765
+ type SessionMessage = z.infer<typeof SessionMessageSchema>;
1766
+ declare const SessionConversationSchema: z.ZodObject<{
1767
+ session: z.ZodObject<{
1768
+ state: z.ZodEnum<{
1785
1769
  ready: "ready";
1770
+ failed: "failed";
1786
1771
  provisioning: "provisioning";
1787
1772
  suspended: "suspended";
1788
1773
  closed: "closed";
1789
1774
  }>;
1790
1775
  reasonCode: z.ZodNullable<z.ZodString>;
1791
- createdAt: z.ZodISODateTime;
1792
- updatedAt: z.ZodISODateTime;
1793
1776
  }, z.core.$strict>;
1794
- }, z.core.$strict>, z.ZodObject<{
1795
- eventId: z.ZodUUID;
1796
- cursor: z.ZodString;
1797
- sessionId: z.ZodUUID;
1798
- sequence: z.ZodNumber;
1799
- revision: z.ZodNumber;
1800
- occurredAt: z.ZodNullable<z.ZodISODateTime>;
1801
- recordedAt: z.ZodISODateTime;
1802
- kind: z.ZodLiteral<"request.updated">;
1803
- requestId: z.ZodUUID;
1804
- data: z.ZodUnion<readonly [z.ZodObject<{
1777
+ requests: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1805
1778
  sessionId: z.ZodUUID;
1806
1779
  requestId: z.ZodUUID;
1807
1780
  turnId: z.ZodUUID;
@@ -1831,8 +1804,8 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1831
1804
  }>;
1832
1805
  availability: z.ZodEnum<{
1833
1806
  expired: "expired";
1834
- unavailable: "unavailable";
1835
1807
  published: "published";
1808
+ unavailable: "unavailable";
1836
1809
  }>;
1837
1810
  expiresAt: z.ZodISODateTime;
1838
1811
  }, z.core.$strict>>;
@@ -1869,8 +1842,8 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1869
1842
  }>;
1870
1843
  availability: z.ZodEnum<{
1871
1844
  expired: "expired";
1872
- unavailable: "unavailable";
1873
1845
  published: "published";
1846
+ unavailable: "unavailable";
1874
1847
  }>;
1875
1848
  expiresAt: z.ZodISODateTime;
1876
1849
  }, z.core.$strict>>;
@@ -1882,9 +1855,9 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1882
1855
  }>;
1883
1856
  state: z.ZodLiteral<"settled">;
1884
1857
  completeness: z.ZodEnum<{
1885
- lost: "lost";
1886
1858
  complete: "complete";
1887
1859
  partial: "partial";
1860
+ lost: "lost";
1888
1861
  }>;
1889
1862
  manifestDigest: z.ZodString;
1890
1863
  settledAt: z.ZodISODateTime;
@@ -1893,9 +1866,9 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1893
1866
  finalResponse: z.ZodNullable<z.ZodString>;
1894
1867
  state: z.ZodLiteral<"terminal">;
1895
1868
  outcome: z.ZodEnum<{
1896
- completed: "completed";
1897
1869
  failed: "failed";
1898
1870
  canceled: "canceled";
1871
+ completed: "completed";
1899
1872
  interrupted: "interrupted";
1900
1873
  lost: "lost";
1901
1874
  }>;
@@ -1928,8 +1901,8 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1928
1901
  }>;
1929
1902
  availability: z.ZodEnum<{
1930
1903
  expired: "expired";
1931
- unavailable: "unavailable";
1932
1904
  published: "published";
1905
+ unavailable: "unavailable";
1933
1906
  }>;
1934
1907
  expiresAt: z.ZodISODateTime;
1935
1908
  }, z.core.$strict>>;
@@ -1966,8 +1939,8 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1966
1939
  }>;
1967
1940
  availability: z.ZodEnum<{
1968
1941
  expired: "expired";
1969
- unavailable: "unavailable";
1970
1942
  published: "published";
1943
+ unavailable: "unavailable";
1971
1944
  }>;
1972
1945
  expiresAt: z.ZodISODateTime;
1973
1946
  }, z.core.$strict>>;
@@ -1979,9 +1952,9 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1979
1952
  }>;
1980
1953
  state: z.ZodLiteral<"settled">;
1981
1954
  completeness: z.ZodEnum<{
1982
- lost: "lost";
1983
1955
  complete: "complete";
1984
1956
  partial: "partial";
1957
+ lost: "lost";
1985
1958
  }>;
1986
1959
  manifestDigest: z.ZodString;
1987
1960
  settledAt: z.ZodISODateTime;
@@ -1996,8 +1969,57 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1996
1969
  }>;
1997
1970
  outcome: z.ZodNull;
1998
1971
  endedAt: z.ZodNull;
1999
- }, z.core.$strict>]>;
2000
- }, z.core.$strict>, z.ZodObject<{
1972
+ }, z.core.$strict>]>>;
1973
+ messages: z.ZodArray<z.ZodObject<{
1974
+ messageId: z.ZodString;
1975
+ requestId: z.ZodUUID;
1976
+ turnId: z.ZodUUID;
1977
+ role: z.ZodEnum<{
1978
+ user: "user";
1979
+ assistant: "assistant";
1980
+ system: "system";
1981
+ tool: "tool";
1982
+ }>;
1983
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1984
+ type: z.ZodLiteral<"text">;
1985
+ text: z.ZodString;
1986
+ }, z.core.$strict>, z.ZodObject<{
1987
+ type: z.ZodLiteral<"tool">;
1988
+ call_id: z.ZodString;
1989
+ name: z.ZodString;
1990
+ status: z.ZodEnum<{
1991
+ failed: "failed";
1992
+ pending: "pending";
1993
+ running: "running";
1994
+ canceled: "canceled";
1995
+ completed: "completed";
1996
+ }>;
1997
+ input: z.ZodJSONSchema;
1998
+ output: z.ZodOptional<z.ZodJSONSchema>;
1999
+ output_text: z.ZodOptional<z.ZodString>;
2000
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2001
+ ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2002
+ }, z.core.$strict>, z.ZodObject<{
2003
+ type: z.ZodLiteral<"error">;
2004
+ code: z.ZodString;
2005
+ message: z.ZodString;
2006
+ }, z.core.$strict>, z.ZodObject<{
2007
+ type: z.ZodLiteral<"file">;
2008
+ file_id: z.ZodUUID;
2009
+ name: z.ZodString;
2010
+ media_type: z.ZodString;
2011
+ size_bytes: z.ZodNumber;
2012
+ }, z.core.$strict>], "type">>;
2013
+ final: z.ZodBoolean;
2014
+ occurredAt: z.ZodISODateTime;
2015
+ }, z.core.$strip>>;
2016
+ cursor: z.ZodString;
2017
+ reset: z.ZodBoolean;
2018
+ }, z.core.$strip>;
2019
+ type SessionConversation = z.infer<typeof SessionConversationSchema>;
2020
+ //#endregion
2021
+ //#region ../contracts/src/sessions/event.d.ts
2022
+ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2001
2023
  eventId: z.ZodUUID;
2002
2024
  cursor: z.ZodString;
2003
2025
  sessionId: z.ZodUUID;
@@ -2005,273 +2027,242 @@ declare const RuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2005
2027
  revision: z.ZodNumber;
2006
2028
  occurredAt: z.ZodNullable<z.ZodISODateTime>;
2007
2029
  recordedAt: z.ZodISODateTime;
2008
- kind: z.ZodLiteral<"output.published">;
2009
- requestId: z.ZodUUID;
2030
+ kind: z.ZodLiteral<"session.updated">;
2031
+ requestId: z.ZodNull;
2010
2032
  data: z.ZodObject<{
2011
- exportId: z.ZodUUID;
2012
2033
  sessionId: z.ZodUUID;
2013
- requestId: z.ZodUUID;
2014
- versionId: z.ZodUUID;
2015
- sha256: z.ZodString;
2016
- name: z.ZodString;
2017
- mediaType: z.ZodString;
2018
- sizeBytes: z.ZodNumber;
2019
- completeness: z.ZodEnum<{
2020
- complete: "complete";
2021
- partial: "partial";
2022
- }>;
2023
- availability: z.ZodEnum<{
2024
- expired: "expired";
2025
- unavailable: "unavailable";
2026
- published: "published";
2027
- }>;
2028
- expiresAt: z.ZodISODateTime;
2029
- }, z.core.$strict>;
2030
- }, z.core.$strict>], "kind">;
2031
- type RuntimeEvent = z.infer<typeof RuntimeEventSchema>;
2032
- declare const ErrorSchema: z.ZodObject<{
2033
- error: z.ZodObject<{
2034
- code: z.ZodString;
2035
- message: z.ZodString;
2036
- retry: z.ZodEnum<{
2037
- never: "never";
2038
- same_identity: "same_identity";
2039
- after_capacity_change: "after_capacity_change";
2040
- reconcile: "reconcile";
2034
+ profile: z.ZodString;
2035
+ owner: z.ZodString;
2036
+ group: z.ZodString;
2037
+ revision: z.ZodNumber;
2038
+ state: z.ZodEnum<{
2039
+ ready: "ready";
2040
+ failed: "failed";
2041
+ provisioning: "provisioning";
2042
+ suspended: "suspended";
2043
+ closed: "closed";
2041
2044
  }>;
2042
- retryAfterSeconds: z.ZodNullable<z.ZodNumber>;
2043
- requestId: z.ZodNullable<z.ZodUUID>;
2045
+ reasonCode: z.ZodNullable<z.ZodString>;
2046
+ createdAt: z.ZodISODateTime;
2047
+ updatedAt: z.ZodISODateTime;
2044
2048
  }, z.core.$strict>;
2045
- }, z.core.$strict>;
2046
- type ManagedError = z.infer<typeof ErrorSchema>;
2047
- //#endregion
2048
- //#region ../contracts/src/sessions/files.d.ts
2049
- declare const MAX_SESSION_FILE_REFERENCES = 1000;
2050
- declare const InputReferenceSchema: z.ZodObject<{
2051
- inputId: z.ZodUUID;
2052
- versionId: z.ZodUUID;
2053
- sha256: z.ZodString;
2054
- name: z.ZodString;
2055
- mediaType: z.ZodString;
2056
- sizeBytes: z.ZodNumber;
2057
- }, z.core.$strict>;
2058
- type InputReference = z.infer<typeof InputReferenceSchema>;
2059
- declare const InputUploadSchema: z.ZodObject<{
2060
- inputId: z.ZodUUID;
2061
- name: z.ZodString;
2062
- mediaType: z.ZodString;
2063
- sizeBytes: z.ZodNumber;
2064
- sha256: z.ZodString;
2065
- }, z.core.$strict>;
2066
- type InputUpload = z.infer<typeof InputUploadSchema>;
2067
- declare const InputObjectSchema: z.ZodObject<{
2068
- sessionId: z.ZodUUID;
2069
- reference: z.ZodObject<{
2070
- inputId: z.ZodUUID;
2071
- versionId: z.ZodUUID;
2072
- sha256: z.ZodString;
2073
- name: z.ZodString;
2074
- mediaType: z.ZodString;
2075
- sizeBytes: z.ZodNumber;
2076
- }, z.core.$strict>;
2077
- state: z.ZodEnum<{
2078
- expired: "expired";
2079
- ready: "ready";
2080
- uploading: "uploading";
2081
- rejected: "rejected";
2082
- }>;
2083
- expiresAt: z.ZodISODateTime;
2084
- }, z.core.$strict>;
2085
- type InputObject = z.infer<typeof InputObjectSchema>;
2086
- declare const ExportObjectSchema: z.ZodObject<{
2087
- exportId: z.ZodUUID;
2049
+ }, z.core.$strict>, z.ZodObject<{
2050
+ eventId: z.ZodUUID;
2051
+ cursor: z.ZodString;
2088
2052
  sessionId: z.ZodUUID;
2053
+ sequence: z.ZodNumber;
2054
+ revision: z.ZodNumber;
2055
+ occurredAt: z.ZodNullable<z.ZodISODateTime>;
2056
+ recordedAt: z.ZodISODateTime;
2057
+ kind: z.ZodLiteral<"request.updated">;
2089
2058
  requestId: z.ZodUUID;
2090
- versionId: z.ZodUUID;
2091
- sha256: z.ZodString;
2092
- name: z.ZodString;
2093
- mediaType: z.ZodString;
2094
- sizeBytes: z.ZodNumber;
2095
- completeness: z.ZodEnum<{
2096
- complete: "complete";
2097
- partial: "partial";
2098
- }>;
2099
- availability: z.ZodEnum<{
2100
- expired: "expired";
2101
- unavailable: "unavailable";
2102
- published: "published";
2103
- }>;
2104
- expiresAt: z.ZodISODateTime;
2105
- }, z.core.$strict>;
2106
- type ExportObject = z.infer<typeof ExportObjectSchema>;
2107
- //#endregion
2108
- //#region ../contracts/src/sessions/fingerprint.d.ts
2109
- declare const LogicalRequestInputSchema: z.ZodObject<{
2110
- requestId: z.ZodUUID;
2111
- message: z.ZodString;
2112
- attachments: z.ZodArray<z.ZodObject<{
2113
- inputId: z.ZodUUID;
2114
- versionId: z.ZodUUID;
2115
- sha256: z.ZodString;
2116
- name: z.ZodString;
2117
- mediaType: z.ZodString;
2118
- sizeBytes: z.ZodNumber;
2119
- }, z.core.$strict>>;
2120
- dispatchDeadline: z.ZodISODateTime;
2121
- sessionId: z.ZodUUID;
2122
- profileId: z.ZodUUID;
2123
- profileRevision: z.ZodNumber;
2124
- }, z.core.$strict>;
2125
- type LogicalRequestInput = z.infer<typeof LogicalRequestInputSchema>;
2126
- declare function fingerprintRequest(input: unknown): string;
2127
- //#endregion
2128
- //#region ../contracts/src/sessions/pages.d.ts
2129
- declare const ManagedHistoryQuerySchema: z.ZodObject<{
2130
- cursor: z.ZodOptional<z.ZodString>;
2131
- limit: z.ZodOptional<z.ZodNumber>;
2132
- }, z.core.$strict>;
2133
- declare const ManagedHistoryPageSchema: z.ZodObject<{
2134
- records: z.ZodArray<z.ZodObject<{
2135
- schema: z.ZodLiteral<"pocketcoder.conversation-record/v1">;
2136
- turn_id: z.ZodNullable<z.ZodUUID>;
2137
- request: z.ZodNullable<z.ZodObject<{
2138
- schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
2139
- authority: z.ZodEnum<{
2140
- external: "external";
2141
- generic: "generic";
2059
+ data: z.ZodUnion<readonly [z.ZodObject<{
2060
+ sessionId: z.ZodUUID;
2061
+ requestId: z.ZodUUID;
2062
+ turnId: z.ZodUUID;
2063
+ inputFingerprint: z.ZodString;
2064
+ revision: z.ZodNumber;
2065
+ reasonCode: z.ZodNullable<z.ZodString>;
2066
+ acceptedAt: z.ZodISODateTime;
2067
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
2068
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
2069
+ dispatchDeadline: z.ZodISODateTime;
2070
+ collection: z.ZodUnion<readonly [z.ZodObject<{
2071
+ sessionId: z.ZodUUID;
2072
+ requestId: z.ZodUUID;
2073
+ revision: z.ZodNumber;
2074
+ objects: z.ZodArray<z.ZodObject<{
2075
+ exportId: z.ZodUUID;
2076
+ sessionId: z.ZodUUID;
2077
+ requestId: z.ZodUUID;
2078
+ versionId: z.ZodUUID;
2079
+ sha256: z.ZodString;
2080
+ name: z.ZodString;
2081
+ mediaType: z.ZodString;
2082
+ sizeBytes: z.ZodNumber;
2083
+ completeness: z.ZodEnum<{
2084
+ complete: "complete";
2085
+ partial: "partial";
2086
+ }>;
2087
+ availability: z.ZodEnum<{
2088
+ expired: "expired";
2089
+ published: "published";
2090
+ unavailable: "unavailable";
2091
+ }>;
2092
+ expiresAt: z.ZodISODateTime;
2093
+ }, z.core.$strict>>;
2094
+ errors: z.ZodArray<z.ZodString>;
2095
+ cleanupState: z.ZodEnum<{
2096
+ pending: "pending";
2097
+ complete: "complete";
2098
+ not_required: "not_required";
2142
2099
  }>;
2143
- conversation_id: z.ZodUUID;
2144
- request_id: z.ZodUUID;
2145
- turn_id: z.ZodUUID;
2146
- request_fingerprint: z.ZodString;
2147
- }, z.core.$strip>>;
2148
- status: z.ZodEnum<{
2149
- message: "message";
2150
- completed: "completed";
2100
+ state: z.ZodEnum<{
2101
+ pending: "pending";
2102
+ finalizing: "finalizing";
2103
+ }>;
2104
+ completeness: z.ZodNull;
2105
+ manifestDigest: z.ZodNull;
2106
+ settledAt: z.ZodNull;
2107
+ expiresAt: z.ZodNull;
2108
+ }, z.core.$strict>, z.ZodObject<{
2109
+ sessionId: z.ZodUUID;
2110
+ requestId: z.ZodUUID;
2111
+ revision: z.ZodNumber;
2112
+ objects: z.ZodArray<z.ZodObject<{
2113
+ exportId: z.ZodUUID;
2114
+ sessionId: z.ZodUUID;
2115
+ requestId: z.ZodUUID;
2116
+ versionId: z.ZodUUID;
2117
+ sha256: z.ZodString;
2118
+ name: z.ZodString;
2119
+ mediaType: z.ZodString;
2120
+ sizeBytes: z.ZodNumber;
2121
+ completeness: z.ZodEnum<{
2122
+ complete: "complete";
2123
+ partial: "partial";
2124
+ }>;
2125
+ availability: z.ZodEnum<{
2126
+ expired: "expired";
2127
+ published: "published";
2128
+ unavailable: "unavailable";
2129
+ }>;
2130
+ expiresAt: z.ZodISODateTime;
2131
+ }, z.core.$strict>>;
2132
+ errors: z.ZodArray<z.ZodString>;
2133
+ cleanupState: z.ZodEnum<{
2134
+ pending: "pending";
2135
+ complete: "complete";
2136
+ not_required: "not_required";
2137
+ }>;
2138
+ state: z.ZodLiteral<"settled">;
2139
+ completeness: z.ZodEnum<{
2140
+ complete: "complete";
2141
+ partial: "partial";
2142
+ lost: "lost";
2143
+ }>;
2144
+ manifestDigest: z.ZodString;
2145
+ settledAt: z.ZodISODateTime;
2146
+ expiresAt: z.ZodISODateTime;
2147
+ }, z.core.$strict>]>;
2148
+ finalResponse: z.ZodNullable<z.ZodString>;
2149
+ state: z.ZodLiteral<"terminal">;
2150
+ outcome: z.ZodEnum<{
2151
2151
  failed: "failed";
2152
2152
  canceled: "canceled";
2153
+ completed: "completed";
2153
2154
  interrupted: "interrupted";
2154
2155
  lost: "lost";
2155
- legacy: "legacy";
2156
2156
  }>;
2157
- reason: z.ZodNullable<z.ZodString>;
2158
- messages: z.ZodArray<z.ZodObject<{
2159
- message_id: z.ZodString;
2160
- role: z.ZodEnum<{
2161
- user: "user";
2162
- assistant: "assistant";
2163
- system: "system";
2164
- tool: "tool";
2165
- }>;
2166
- content: z.ZodString;
2167
- parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2168
- type: z.ZodLiteral<"text">;
2169
- text: z.ZodString;
2170
- }, z.core.$strict>, z.ZodObject<{
2171
- type: z.ZodLiteral<"tool">;
2172
- call_id: z.ZodString;
2173
- name: z.ZodString;
2174
- status: z.ZodEnum<{
2175
- pending: "pending";
2176
- running: "running";
2177
- completed: "completed";
2178
- failed: "failed";
2179
- canceled: "canceled";
2180
- }>;
2181
- input: z.ZodJSONSchema;
2182
- output: z.ZodOptional<z.ZodJSONSchema>;
2183
- output_text: z.ZodOptional<z.ZodString>;
2184
- started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2185
- ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2186
- }, z.core.$strict>, z.ZodObject<{
2187
- type: z.ZodLiteral<"error">;
2188
- code: z.ZodString;
2189
- message: z.ZodString;
2190
- }, z.core.$strict>, z.ZodObject<{
2191
- type: z.ZodLiteral<"file">;
2192
- file_id: z.ZodUUID;
2157
+ }, z.core.$strict>, z.ZodObject<{
2158
+ sessionId: z.ZodUUID;
2159
+ requestId: z.ZodUUID;
2160
+ turnId: z.ZodUUID;
2161
+ inputFingerprint: z.ZodString;
2162
+ revision: z.ZodNumber;
2163
+ reasonCode: z.ZodNullable<z.ZodString>;
2164
+ acceptedAt: z.ZodISODateTime;
2165
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
2166
+ dispatchDeadline: z.ZodISODateTime;
2167
+ collection: z.ZodUnion<readonly [z.ZodObject<{
2168
+ sessionId: z.ZodUUID;
2169
+ requestId: z.ZodUUID;
2170
+ revision: z.ZodNumber;
2171
+ objects: z.ZodArray<z.ZodObject<{
2172
+ exportId: z.ZodUUID;
2173
+ sessionId: z.ZodUUID;
2174
+ requestId: z.ZodUUID;
2175
+ versionId: z.ZodUUID;
2176
+ sha256: z.ZodString;
2193
2177
  name: z.ZodString;
2194
- media_type: z.ZodString;
2195
- size_bytes: z.ZodNumber;
2196
- }, z.core.$strict>], "type">>>;
2197
- occurred_at: z.ZodISODateTime;
2198
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2199
- seq: z.ZodNumber;
2200
- identity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2201
- schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
2202
- authority: z.ZodEnum<{
2203
- external: "external";
2204
- generic: "generic";
2178
+ mediaType: z.ZodString;
2179
+ sizeBytes: z.ZodNumber;
2180
+ completeness: z.ZodEnum<{
2181
+ complete: "complete";
2182
+ partial: "partial";
2205
2183
  }>;
2206
- conversation_id: z.ZodUUID;
2207
- request_id: z.ZodUUID;
2208
- turn_id: z.ZodUUID;
2209
- request_fingerprint: z.ZodString;
2210
- event_id: z.ZodUUID;
2211
- message_id: z.ZodString;
2212
- sequence: z.ZodNumber;
2213
- revision: z.ZodNumber;
2214
- fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2215
- type: z.ZodLiteral<"intermediate">;
2216
- }, z.core.$strip>, z.ZodObject<{
2217
- type: z.ZodLiteral<"final_response">;
2218
- }, z.core.$strip>, z.ZodObject<{
2219
- type: z.ZodLiteral<"tool_only">;
2220
- }, z.core.$strip>, z.ZodObject<{
2221
- type: z.ZodLiteral<"activity_started">;
2222
- activity_id: z.ZodUUID;
2223
- kind: z.ZodEnum<{
2224
- tool: "tool";
2225
- attachment: "attachment";
2226
- workspace: "workspace";
2227
- retrieval: "retrieval";
2228
- }>;
2229
- label: z.ZodString;
2230
- started_at: z.ZodNullable<z.ZodISODateTime>;
2231
- action: z.ZodOptional<z.ZodString>;
2232
- subject: z.ZodOptional<z.ZodString>;
2233
- }, z.core.$strip>, z.ZodObject<{
2234
- type: z.ZodLiteral<"activity_finished">;
2235
- activity_id: z.ZodUUID;
2236
- ended_at: z.ZodNullable<z.ZodISODateTime>;
2237
- outcome: z.ZodEnum<{
2238
- completed: "completed";
2239
- failed: "failed";
2240
- canceled: "canceled";
2241
- interrupted: "interrupted";
2242
- }>;
2243
- }, z.core.$strip>, z.ZodObject<{
2244
- type: z.ZodLiteral<"turn_terminal">;
2245
- outcome: z.ZodEnum<{
2246
- completed: "completed";
2247
- failed: "failed";
2248
- canceled: "canceled";
2249
- interrupted: "interrupted";
2250
- lost: "lost";
2251
- }>;
2252
- reason: z.ZodOptional<z.ZodString>;
2253
- }, z.core.$strip>], "type">>;
2254
- }, z.core.$strip>>>;
2255
- }, z.core.$strip>>;
2256
- activities: z.ZodArray<z.ZodObject<{
2257
- activity_id: z.ZodUUID;
2258
- kind: z.ZodString;
2259
- label: z.ZodString;
2260
- action: z.ZodNullable<z.ZodString>;
2261
- subject: z.ZodNullable<z.ZodString>;
2262
- started_at: z.ZodNullable<z.ZodISODateTime>;
2263
- ended_at: z.ZodNullable<z.ZodISODateTime>;
2264
- outcome: z.ZodNullable<z.ZodString>;
2265
- }, z.core.$strip>>;
2266
- final_response: z.ZodNullable<z.ZodString>;
2267
- started_at: z.ZodNullable<z.ZodISODateTime>;
2268
- ended_at: z.ZodNullable<z.ZodISODateTime>;
2269
- }, z.core.$strip>>;
2270
- nextCursor: z.ZodNullable<z.ZodString>;
2271
- eventCursor: z.ZodString;
2272
- }, z.core.$strict>;
2273
- declare const ManagedExportPageSchema: z.ZodObject<{
2274
- items: z.ZodArray<z.ZodObject<{
2184
+ availability: z.ZodEnum<{
2185
+ expired: "expired";
2186
+ published: "published";
2187
+ unavailable: "unavailable";
2188
+ }>;
2189
+ expiresAt: z.ZodISODateTime;
2190
+ }, z.core.$strict>>;
2191
+ errors: z.ZodArray<z.ZodString>;
2192
+ cleanupState: z.ZodEnum<{
2193
+ pending: "pending";
2194
+ complete: "complete";
2195
+ not_required: "not_required";
2196
+ }>;
2197
+ state: z.ZodEnum<{
2198
+ pending: "pending";
2199
+ finalizing: "finalizing";
2200
+ }>;
2201
+ completeness: z.ZodNull;
2202
+ manifestDigest: z.ZodNull;
2203
+ settledAt: z.ZodNull;
2204
+ expiresAt: z.ZodNull;
2205
+ }, z.core.$strict>, z.ZodObject<{
2206
+ sessionId: z.ZodUUID;
2207
+ requestId: z.ZodUUID;
2208
+ revision: z.ZodNumber;
2209
+ objects: z.ZodArray<z.ZodObject<{
2210
+ exportId: z.ZodUUID;
2211
+ sessionId: z.ZodUUID;
2212
+ requestId: z.ZodUUID;
2213
+ versionId: z.ZodUUID;
2214
+ sha256: z.ZodString;
2215
+ name: z.ZodString;
2216
+ mediaType: z.ZodString;
2217
+ sizeBytes: z.ZodNumber;
2218
+ completeness: z.ZodEnum<{
2219
+ complete: "complete";
2220
+ partial: "partial";
2221
+ }>;
2222
+ availability: z.ZodEnum<{
2223
+ expired: "expired";
2224
+ published: "published";
2225
+ unavailable: "unavailable";
2226
+ }>;
2227
+ expiresAt: z.ZodISODateTime;
2228
+ }, z.core.$strict>>;
2229
+ errors: z.ZodArray<z.ZodString>;
2230
+ cleanupState: z.ZodEnum<{
2231
+ pending: "pending";
2232
+ complete: "complete";
2233
+ not_required: "not_required";
2234
+ }>;
2235
+ state: z.ZodLiteral<"settled">;
2236
+ completeness: z.ZodEnum<{
2237
+ complete: "complete";
2238
+ partial: "partial";
2239
+ lost: "lost";
2240
+ }>;
2241
+ manifestDigest: z.ZodString;
2242
+ settledAt: z.ZodISODateTime;
2243
+ expiresAt: z.ZodISODateTime;
2244
+ }, z.core.$strict>]>;
2245
+ finalResponse: z.ZodNullable<z.ZodString>;
2246
+ state: z.ZodEnum<{
2247
+ running: "running";
2248
+ accepted: "accepted";
2249
+ waiting: "waiting";
2250
+ checking_outcome: "checking_outcome";
2251
+ }>;
2252
+ outcome: z.ZodNull;
2253
+ endedAt: z.ZodNull;
2254
+ }, z.core.$strict>]>;
2255
+ }, z.core.$strict>, z.ZodObject<{
2256
+ eventId: z.ZodUUID;
2257
+ cursor: z.ZodString;
2258
+ sessionId: z.ZodUUID;
2259
+ sequence: z.ZodNumber;
2260
+ revision: z.ZodNumber;
2261
+ occurredAt: z.ZodNullable<z.ZodISODateTime>;
2262
+ recordedAt: z.ZodISODateTime;
2263
+ kind: z.ZodLiteral<"output.published">;
2264
+ requestId: z.ZodUUID;
2265
+ data: z.ZodObject<{
2275
2266
  exportId: z.ZodUUID;
2276
2267
  sessionId: z.ZodUUID;
2277
2268
  requestId: z.ZodUUID;
@@ -2286,954 +2277,400 @@ declare const ManagedExportPageSchema: z.ZodObject<{
2286
2277
  }>;
2287
2278
  availability: z.ZodEnum<{
2288
2279
  expired: "expired";
2289
- unavailable: "unavailable";
2290
2280
  published: "published";
2281
+ unavailable: "unavailable";
2291
2282
  }>;
2292
2283
  expiresAt: z.ZodISODateTime;
2293
- }, z.core.$strict>>;
2294
- nextCursor: z.ZodNullable<z.ZodString>;
2284
+ }, z.core.$strict>;
2285
+ }, z.core.$strict>], "kind">;
2286
+ type RuntimeEvent = z.infer<typeof RuntimeEventSchema>;
2287
+ declare const ErrorSchema: z.ZodObject<{
2288
+ error: z.ZodObject<{
2289
+ code: z.ZodString;
2290
+ message: z.ZodString;
2291
+ retry: z.ZodEnum<{
2292
+ never: "never";
2293
+ same_identity: "same_identity";
2294
+ after_capacity_change: "after_capacity_change";
2295
+ reconcile: "reconcile";
2296
+ }>;
2297
+ retryAfterSeconds: z.ZodNullable<z.ZodNumber>;
2298
+ requestId: z.ZodNullable<z.ZodUUID>;
2299
+ }, z.core.$strict>;
2295
2300
  }, z.core.$strict>;
2296
- type HistoryPage = z.infer<typeof ManagedHistoryPageSchema>;
2301
+ type ManagedError = z.infer<typeof ErrorSchema>;
2297
2302
  //#endregion
2298
- //#region ../contracts/src/sessions/profile.d.ts
2299
- declare const ExecutionProfileSchema: z.ZodObject<{
2300
- profileId: z.ZodUUID;
2301
- revision: z.ZodNumber;
2302
- isolationScopeId: z.ZodUUID;
2303
- budgetScopeIds: z.ZodArray<z.ZodUUID>;
2304
- templateDigest: z.ZodString;
2305
- credentialBindingId: z.ZodNullable<z.ZodUUID>;
2303
+ //#region ../contracts/src/sessions/files.d.ts
2304
+ declare const MAX_SESSION_FILE_REFERENCES = 1000;
2305
+ declare const InputReferenceSchema: z.ZodObject<{
2306
+ inputId: z.ZodUUID;
2307
+ versionId: z.ZodUUID;
2308
+ sha256: z.ZodString;
2309
+ name: z.ZodString;
2310
+ mediaType: z.ZodString;
2311
+ sizeBytes: z.ZodNumber;
2306
2312
  }, z.core.$strict>;
2307
- type ExecutionProfile = z.infer<typeof ExecutionProfileSchema>;
2308
- declare const SessionCreateSchema: z.ZodObject<{
2309
- sessionId: z.ZodUUID;
2310
- profileId: z.ZodUUID;
2311
- profileRevision: z.ZodNumber;
2313
+ type InputReference = z.infer<typeof InputReferenceSchema>;
2314
+ declare const InputUploadSchema: z.ZodObject<{
2315
+ inputId: z.ZodUUID;
2316
+ name: z.ZodString;
2317
+ mediaType: z.ZodString;
2318
+ sizeBytes: z.ZodNumber;
2319
+ sha256: z.ZodString;
2312
2320
  }, z.core.$strict>;
2313
- type SessionCreate = z.infer<typeof SessionCreateSchema>;
2314
- declare const SessionSchema: z.ZodObject<{
2321
+ type InputUpload = z.infer<typeof InputUploadSchema>;
2322
+ declare const InputObjectSchema: z.ZodObject<{
2315
2323
  sessionId: z.ZodUUID;
2316
- profileId: z.ZodUUID;
2317
- profileRevision: z.ZodNumber;
2318
- revision: z.ZodNumber;
2319
- state: z.ZodEnum<{
2320
- failed: "failed";
2321
- ready: "ready";
2322
- provisioning: "provisioning";
2323
- suspended: "suspended";
2324
- closed: "closed";
2325
- }>;
2326
- reasonCode: z.ZodNullable<z.ZodString>;
2327
- createdAt: z.ZodISODateTime;
2328
- updatedAt: z.ZodISODateTime;
2329
- }, z.core.$strict>;
2330
- type Session = z.infer<typeof SessionSchema>;
2331
- //#endregion
2332
- //#region ../contracts/src/sessions/placement.d.ts
2333
- declare function managedPlacement(principalId: string, sessionId: string, input: ExecutionProfile): {
2334
- mode: string;
2335
- key: string;
2336
- };
2337
- declare const MANAGED_SESSION_METADATA = "pocketcoder.managed-session";
2338
- //#endregion
2339
- //#region ../contracts/src/sessions/request.d.ts
2340
- declare const RequestInputSchema: z.ZodObject<{
2341
- requestId: z.ZodUUID;
2342
- message: z.ZodString;
2343
- attachments: z.ZodArray<z.ZodObject<{
2324
+ reference: z.ZodObject<{
2344
2325
  inputId: z.ZodUUID;
2345
2326
  versionId: z.ZodUUID;
2346
2327
  sha256: z.ZodString;
2347
2328
  name: z.ZodString;
2348
2329
  mediaType: z.ZodString;
2349
2330
  sizeBytes: z.ZodNumber;
2350
- }, z.core.$strict>>;
2351
- dispatchDeadline: z.ZodISODateTime;
2331
+ }, z.core.$strict>;
2332
+ state: z.ZodEnum<{
2333
+ ready: "ready";
2334
+ expired: "expired";
2335
+ uploading: "uploading";
2336
+ rejected: "rejected";
2337
+ }>;
2338
+ expiresAt: z.ZodISODateTime;
2352
2339
  }, z.core.$strict>;
2353
- type RequestInput = z.infer<typeof RequestInputSchema>;
2354
- declare const RequestSchema: z.ZodUnion<readonly [z.ZodObject<{
2340
+ type InputObject = z.infer<typeof InputObjectSchema>;
2341
+ declare const ExportObjectSchema: z.ZodObject<{
2342
+ exportId: z.ZodUUID;
2355
2343
  sessionId: z.ZodUUID;
2356
2344
  requestId: z.ZodUUID;
2357
- turnId: z.ZodUUID;
2358
- inputFingerprint: z.ZodString;
2359
- revision: z.ZodNumber;
2360
- reasonCode: z.ZodNullable<z.ZodString>;
2361
- acceptedAt: z.ZodISODateTime;
2362
- startedAt: z.ZodNullable<z.ZodISODateTime>;
2363
- endedAt: z.ZodNullable<z.ZodISODateTime>;
2364
- dispatchDeadline: z.ZodISODateTime;
2365
- collection: z.ZodUnion<readonly [z.ZodObject<{
2366
- sessionId: z.ZodUUID;
2367
- requestId: z.ZodUUID;
2368
- revision: z.ZodNumber;
2369
- objects: z.ZodArray<z.ZodObject<{
2370
- exportId: z.ZodUUID;
2371
- sessionId: z.ZodUUID;
2372
- requestId: z.ZodUUID;
2373
- versionId: z.ZodUUID;
2374
- sha256: z.ZodString;
2375
- name: z.ZodString;
2376
- mediaType: z.ZodString;
2377
- sizeBytes: z.ZodNumber;
2378
- completeness: z.ZodEnum<{
2379
- complete: "complete";
2380
- partial: "partial";
2381
- }>;
2382
- availability: z.ZodEnum<{
2383
- expired: "expired";
2384
- unavailable: "unavailable";
2385
- published: "published";
2386
- }>;
2387
- expiresAt: z.ZodISODateTime;
2388
- }, z.core.$strict>>;
2389
- errors: z.ZodArray<z.ZodString>;
2390
- cleanupState: z.ZodEnum<{
2391
- pending: "pending";
2392
- complete: "complete";
2393
- not_required: "not_required";
2394
- }>;
2395
- state: z.ZodEnum<{
2396
- pending: "pending";
2397
- finalizing: "finalizing";
2398
- }>;
2399
- completeness: z.ZodNull;
2400
- manifestDigest: z.ZodNull;
2401
- settledAt: z.ZodNull;
2402
- expiresAt: z.ZodNull;
2403
- }, z.core.$strict>, z.ZodObject<{
2404
- sessionId: z.ZodUUID;
2405
- requestId: z.ZodUUID;
2406
- revision: z.ZodNumber;
2407
- objects: z.ZodArray<z.ZodObject<{
2408
- exportId: z.ZodUUID;
2409
- sessionId: z.ZodUUID;
2410
- requestId: z.ZodUUID;
2411
- versionId: z.ZodUUID;
2412
- sha256: z.ZodString;
2413
- name: z.ZodString;
2414
- mediaType: z.ZodString;
2415
- sizeBytes: z.ZodNumber;
2416
- completeness: z.ZodEnum<{
2417
- complete: "complete";
2418
- partial: "partial";
2419
- }>;
2420
- availability: z.ZodEnum<{
2421
- expired: "expired";
2422
- unavailable: "unavailable";
2423
- published: "published";
2424
- }>;
2425
- expiresAt: z.ZodISODateTime;
2426
- }, z.core.$strict>>;
2427
- errors: z.ZodArray<z.ZodString>;
2428
- cleanupState: z.ZodEnum<{
2429
- pending: "pending";
2430
- complete: "complete";
2431
- not_required: "not_required";
2432
- }>;
2433
- state: z.ZodLiteral<"settled">;
2434
- completeness: z.ZodEnum<{
2435
- lost: "lost";
2436
- complete: "complete";
2437
- partial: "partial";
2438
- }>;
2439
- manifestDigest: z.ZodString;
2440
- settledAt: z.ZodISODateTime;
2441
- expiresAt: z.ZodISODateTime;
2442
- }, z.core.$strict>]>;
2443
- finalResponse: z.ZodNullable<z.ZodString>;
2444
- state: z.ZodLiteral<"terminal">;
2445
- outcome: z.ZodEnum<{
2446
- completed: "completed";
2447
- failed: "failed";
2448
- canceled: "canceled";
2449
- interrupted: "interrupted";
2450
- lost: "lost";
2451
- }>;
2452
- }, z.core.$strict>, z.ZodObject<{
2453
- sessionId: z.ZodUUID;
2454
- requestId: z.ZodUUID;
2455
- turnId: z.ZodUUID;
2456
- inputFingerprint: z.ZodString;
2457
- revision: z.ZodNumber;
2458
- reasonCode: z.ZodNullable<z.ZodString>;
2459
- acceptedAt: z.ZodISODateTime;
2460
- startedAt: z.ZodNullable<z.ZodISODateTime>;
2461
- dispatchDeadline: z.ZodISODateTime;
2462
- collection: z.ZodUnion<readonly [z.ZodObject<{
2463
- sessionId: z.ZodUUID;
2464
- requestId: z.ZodUUID;
2465
- revision: z.ZodNumber;
2466
- objects: z.ZodArray<z.ZodObject<{
2467
- exportId: z.ZodUUID;
2468
- sessionId: z.ZodUUID;
2469
- requestId: z.ZodUUID;
2470
- versionId: z.ZodUUID;
2471
- sha256: z.ZodString;
2472
- name: z.ZodString;
2473
- mediaType: z.ZodString;
2474
- sizeBytes: z.ZodNumber;
2475
- completeness: z.ZodEnum<{
2476
- complete: "complete";
2477
- partial: "partial";
2478
- }>;
2479
- availability: z.ZodEnum<{
2480
- expired: "expired";
2481
- unavailable: "unavailable";
2482
- published: "published";
2483
- }>;
2484
- expiresAt: z.ZodISODateTime;
2485
- }, z.core.$strict>>;
2486
- errors: z.ZodArray<z.ZodString>;
2487
- cleanupState: z.ZodEnum<{
2488
- pending: "pending";
2489
- complete: "complete";
2490
- not_required: "not_required";
2491
- }>;
2492
- state: z.ZodEnum<{
2493
- pending: "pending";
2494
- finalizing: "finalizing";
2495
- }>;
2496
- completeness: z.ZodNull;
2497
- manifestDigest: z.ZodNull;
2498
- settledAt: z.ZodNull;
2499
- expiresAt: z.ZodNull;
2500
- }, z.core.$strict>, z.ZodObject<{
2501
- sessionId: z.ZodUUID;
2502
- requestId: z.ZodUUID;
2503
- revision: z.ZodNumber;
2504
- objects: z.ZodArray<z.ZodObject<{
2505
- exportId: z.ZodUUID;
2506
- sessionId: z.ZodUUID;
2507
- requestId: z.ZodUUID;
2508
- versionId: z.ZodUUID;
2509
- sha256: z.ZodString;
2510
- name: z.ZodString;
2511
- mediaType: z.ZodString;
2512
- sizeBytes: z.ZodNumber;
2513
- completeness: z.ZodEnum<{
2514
- complete: "complete";
2515
- partial: "partial";
2516
- }>;
2517
- availability: z.ZodEnum<{
2518
- expired: "expired";
2519
- unavailable: "unavailable";
2520
- published: "published";
2521
- }>;
2522
- expiresAt: z.ZodISODateTime;
2523
- }, z.core.$strict>>;
2524
- errors: z.ZodArray<z.ZodString>;
2525
- cleanupState: z.ZodEnum<{
2526
- pending: "pending";
2527
- complete: "complete";
2528
- not_required: "not_required";
2529
- }>;
2530
- state: z.ZodLiteral<"settled">;
2531
- completeness: z.ZodEnum<{
2532
- lost: "lost";
2533
- complete: "complete";
2534
- partial: "partial";
2535
- }>;
2536
- manifestDigest: z.ZodString;
2537
- settledAt: z.ZodISODateTime;
2538
- expiresAt: z.ZodISODateTime;
2539
- }, z.core.$strict>]>;
2540
- finalResponse: z.ZodNullable<z.ZodString>;
2541
- state: z.ZodEnum<{
2542
- running: "running";
2543
- accepted: "accepted";
2544
- waiting: "waiting";
2545
- checking_outcome: "checking_outcome";
2546
- }>;
2547
- outcome: z.ZodNull;
2548
- endedAt: z.ZodNull;
2549
- }, z.core.$strict>]>;
2550
- type Request = z.infer<typeof RequestSchema>;
2551
- declare const CancelCommandSchema: z.ZodObject<{
2552
- cancelId: z.ZodUUID;
2553
- }, z.core.$strict>;
2554
- type CancelCommand = z.infer<typeof CancelCommandSchema>;
2555
- declare const CancelReceiptSchema: z.ZodUnion<readonly [z.ZodObject<{
2556
- sessionId: z.ZodUUID;
2557
- cancelId: z.ZodUUID;
2558
- state: z.ZodEnum<{
2559
- pending: "pending";
2560
- completed: "completed";
2561
- }>;
2562
- acceptedAt: z.ZodISODateTime;
2563
- completedAt: z.ZodNullable<z.ZodISODateTime>;
2564
- cancelDeadline: z.ZodISODateTime;
2565
- scope: z.ZodLiteral<"request">;
2566
- requestId: z.ZodUUID;
2567
- }, z.core.$strict>, z.ZodObject<{
2568
- sessionId: z.ZodUUID;
2569
- cancelId: z.ZodUUID;
2570
- state: z.ZodEnum<{
2571
- pending: "pending";
2572
- completed: "completed";
2573
- }>;
2574
- acceptedAt: z.ZodISODateTime;
2575
- completedAt: z.ZodNullable<z.ZodISODateTime>;
2576
- cancelDeadline: z.ZodISODateTime;
2577
- scope: z.ZodLiteral<"session">;
2578
- requestId: z.ZodNull;
2579
- }, z.core.$strict>]>;
2580
- type CancelReceipt = z.infer<typeof CancelReceiptSchema>;
2581
- //#endregion
2582
- //#region ../contracts/src/sessions/schemas.d.ts
2583
- declare const MANAGED_CONTRACT_REVISION: "pocketcoder.managed/v1";
2584
- declare const managedSchemas: {
2585
- ExecutionProfile: z.ZodObject<{
2586
- profileId: z.ZodUUID;
2587
- revision: z.ZodNumber;
2588
- isolationScopeId: z.ZodUUID;
2589
- budgetScopeIds: z.ZodArray<z.ZodUUID>;
2590
- templateDigest: z.ZodString;
2591
- credentialBindingId: z.ZodNullable<z.ZodUUID>;
2592
- }, z.core.$strict>;
2593
- BudgetScopeGrant: z.ZodObject<{
2594
- principalId: z.ZodUUID;
2595
- installation: z.ZodBoolean;
2596
- }, z.core.$strict>;
2597
- CredentialBinding: z.ZodObject<{
2598
- bindingId: z.ZodUUID;
2599
- principalId: z.ZodUUID;
2600
- secretName: z.ZodString;
2601
- secretVersionId: z.ZodOptional<z.ZodUUID>;
2602
- slots: z.ZodArray<z.ZodString>;
2603
- authorityExpiresAt: z.ZodISODateTime;
2604
- }, z.core.$strict>;
2605
- SessionCreate: z.ZodObject<{
2606
- sessionId: z.ZodUUID;
2607
- profileId: z.ZodUUID;
2608
- profileRevision: z.ZodNumber;
2609
- }, z.core.$strict>;
2610
- Session: z.ZodObject<{
2611
- sessionId: z.ZodUUID;
2612
- profileId: z.ZodUUID;
2613
- profileRevision: z.ZodNumber;
2614
- revision: z.ZodNumber;
2615
- state: z.ZodEnum<{
2616
- failed: "failed";
2617
- ready: "ready";
2618
- provisioning: "provisioning";
2619
- suspended: "suspended";
2620
- closed: "closed";
2621
- }>;
2622
- reasonCode: z.ZodNullable<z.ZodString>;
2623
- createdAt: z.ZodISODateTime;
2624
- updatedAt: z.ZodISODateTime;
2625
- }, z.core.$strict>;
2626
- InputReference: z.ZodObject<{
2627
- inputId: z.ZodUUID;
2628
- versionId: z.ZodUUID;
2629
- sha256: z.ZodString;
2630
- name: z.ZodString;
2631
- mediaType: z.ZodString;
2632
- sizeBytes: z.ZodNumber;
2633
- }, z.core.$strict>;
2634
- InputUpload: z.ZodObject<{
2635
- inputId: z.ZodUUID;
2636
- name: z.ZodString;
2637
- mediaType: z.ZodString;
2638
- sizeBytes: z.ZodNumber;
2639
- sha256: z.ZodString;
2640
- }, z.core.$strict>;
2641
- InputObject: z.ZodObject<{
2642
- sessionId: z.ZodUUID;
2643
- reference: z.ZodObject<{
2644
- inputId: z.ZodUUID;
2645
- versionId: z.ZodUUID;
2646
- sha256: z.ZodString;
2647
- name: z.ZodString;
2648
- mediaType: z.ZodString;
2649
- sizeBytes: z.ZodNumber;
2650
- }, z.core.$strict>;
2651
- state: z.ZodEnum<{
2652
- expired: "expired";
2653
- ready: "ready";
2654
- uploading: "uploading";
2655
- rejected: "rejected";
2656
- }>;
2657
- expiresAt: z.ZodISODateTime;
2658
- }, z.core.$strict>;
2659
- ExportObject: z.ZodObject<{
2660
- exportId: z.ZodUUID;
2661
- sessionId: z.ZodUUID;
2662
- requestId: z.ZodUUID;
2663
- versionId: z.ZodUUID;
2664
- sha256: z.ZodString;
2665
- name: z.ZodString;
2666
- mediaType: z.ZodString;
2667
- sizeBytes: z.ZodNumber;
2668
- completeness: z.ZodEnum<{
2669
- complete: "complete";
2670
- partial: "partial";
2671
- }>;
2672
- availability: z.ZodEnum<{
2673
- expired: "expired";
2674
- unavailable: "unavailable";
2675
- published: "published";
2676
- }>;
2677
- expiresAt: z.ZodISODateTime;
2678
- }, z.core.$strict>;
2679
- CollectionResult: z.ZodUnion<readonly [z.ZodObject<{
2680
- sessionId: z.ZodUUID;
2681
- requestId: z.ZodUUID;
2682
- revision: z.ZodNumber;
2683
- objects: z.ZodArray<z.ZodObject<{
2684
- exportId: z.ZodUUID;
2685
- sessionId: z.ZodUUID;
2686
- requestId: z.ZodUUID;
2687
- versionId: z.ZodUUID;
2688
- sha256: z.ZodString;
2689
- name: z.ZodString;
2690
- mediaType: z.ZodString;
2691
- sizeBytes: z.ZodNumber;
2692
- completeness: z.ZodEnum<{
2693
- complete: "complete";
2694
- partial: "partial";
2695
- }>;
2696
- availability: z.ZodEnum<{
2697
- expired: "expired";
2698
- unavailable: "unavailable";
2699
- published: "published";
2700
- }>;
2701
- expiresAt: z.ZodISODateTime;
2702
- }, z.core.$strict>>;
2703
- errors: z.ZodArray<z.ZodString>;
2704
- cleanupState: z.ZodEnum<{
2705
- pending: "pending";
2706
- complete: "complete";
2707
- not_required: "not_required";
2708
- }>;
2709
- state: z.ZodEnum<{
2710
- pending: "pending";
2711
- finalizing: "finalizing";
2712
- }>;
2713
- completeness: z.ZodNull;
2714
- manifestDigest: z.ZodNull;
2715
- settledAt: z.ZodNull;
2716
- expiresAt: z.ZodNull;
2717
- }, z.core.$strict>, z.ZodObject<{
2718
- sessionId: z.ZodUUID;
2719
- requestId: z.ZodUUID;
2720
- revision: z.ZodNumber;
2721
- objects: z.ZodArray<z.ZodObject<{
2722
- exportId: z.ZodUUID;
2723
- sessionId: z.ZodUUID;
2724
- requestId: z.ZodUUID;
2725
- versionId: z.ZodUUID;
2726
- sha256: z.ZodString;
2727
- name: z.ZodString;
2728
- mediaType: z.ZodString;
2729
- sizeBytes: z.ZodNumber;
2730
- completeness: z.ZodEnum<{
2731
- complete: "complete";
2732
- partial: "partial";
2733
- }>;
2734
- availability: z.ZodEnum<{
2735
- expired: "expired";
2736
- unavailable: "unavailable";
2737
- published: "published";
2738
- }>;
2739
- expiresAt: z.ZodISODateTime;
2740
- }, z.core.$strict>>;
2741
- errors: z.ZodArray<z.ZodString>;
2742
- cleanupState: z.ZodEnum<{
2743
- pending: "pending";
2744
- complete: "complete";
2745
- not_required: "not_required";
2746
- }>;
2747
- state: z.ZodLiteral<"settled">;
2748
- completeness: z.ZodEnum<{
2749
- lost: "lost";
2750
- complete: "complete";
2751
- partial: "partial";
2752
- }>;
2753
- manifestDigest: z.ZodString;
2754
- settledAt: z.ZodISODateTime;
2755
- expiresAt: z.ZodISODateTime;
2756
- }, z.core.$strict>]>;
2757
- RequestInput: z.ZodObject<{
2758
- requestId: z.ZodUUID;
2759
- message: z.ZodString;
2760
- attachments: z.ZodArray<z.ZodObject<{
2761
- inputId: z.ZodUUID;
2762
- versionId: z.ZodUUID;
2763
- sha256: z.ZodString;
2764
- name: z.ZodString;
2765
- mediaType: z.ZodString;
2766
- sizeBytes: z.ZodNumber;
2767
- }, z.core.$strict>>;
2768
- dispatchDeadline: z.ZodISODateTime;
2769
- }, z.core.$strict>;
2770
- Request: z.ZodUnion<readonly [z.ZodObject<{
2771
- sessionId: z.ZodUUID;
2772
- requestId: z.ZodUUID;
2773
- turnId: z.ZodUUID;
2774
- inputFingerprint: z.ZodString;
2775
- revision: z.ZodNumber;
2776
- reasonCode: z.ZodNullable<z.ZodString>;
2777
- acceptedAt: z.ZodISODateTime;
2778
- startedAt: z.ZodNullable<z.ZodISODateTime>;
2779
- endedAt: z.ZodNullable<z.ZodISODateTime>;
2780
- dispatchDeadline: z.ZodISODateTime;
2781
- collection: z.ZodUnion<readonly [z.ZodObject<{
2782
- sessionId: z.ZodUUID;
2783
- requestId: z.ZodUUID;
2784
- revision: z.ZodNumber;
2785
- objects: z.ZodArray<z.ZodObject<{
2786
- exportId: z.ZodUUID;
2787
- sessionId: z.ZodUUID;
2788
- requestId: z.ZodUUID;
2789
- versionId: z.ZodUUID;
2790
- sha256: z.ZodString;
2791
- name: z.ZodString;
2792
- mediaType: z.ZodString;
2793
- sizeBytes: z.ZodNumber;
2794
- completeness: z.ZodEnum<{
2795
- complete: "complete";
2796
- partial: "partial";
2797
- }>;
2798
- availability: z.ZodEnum<{
2799
- expired: "expired";
2800
- unavailable: "unavailable";
2801
- published: "published";
2802
- }>;
2803
- expiresAt: z.ZodISODateTime;
2804
- }, z.core.$strict>>;
2805
- errors: z.ZodArray<z.ZodString>;
2806
- cleanupState: z.ZodEnum<{
2807
- pending: "pending";
2808
- complete: "complete";
2809
- not_required: "not_required";
2810
- }>;
2811
- state: z.ZodEnum<{
2812
- pending: "pending";
2813
- finalizing: "finalizing";
2814
- }>;
2815
- completeness: z.ZodNull;
2816
- manifestDigest: z.ZodNull;
2817
- settledAt: z.ZodNull;
2818
- expiresAt: z.ZodNull;
2819
- }, z.core.$strict>, z.ZodObject<{
2820
- sessionId: z.ZodUUID;
2821
- requestId: z.ZodUUID;
2822
- revision: z.ZodNumber;
2823
- objects: z.ZodArray<z.ZodObject<{
2824
- exportId: z.ZodUUID;
2825
- sessionId: z.ZodUUID;
2826
- requestId: z.ZodUUID;
2827
- versionId: z.ZodUUID;
2828
- sha256: z.ZodString;
2829
- name: z.ZodString;
2830
- mediaType: z.ZodString;
2831
- sizeBytes: z.ZodNumber;
2832
- completeness: z.ZodEnum<{
2833
- complete: "complete";
2834
- partial: "partial";
2835
- }>;
2836
- availability: z.ZodEnum<{
2837
- expired: "expired";
2838
- unavailable: "unavailable";
2839
- published: "published";
2840
- }>;
2841
- expiresAt: z.ZodISODateTime;
2842
- }, z.core.$strict>>;
2843
- errors: z.ZodArray<z.ZodString>;
2844
- cleanupState: z.ZodEnum<{
2845
- pending: "pending";
2846
- complete: "complete";
2847
- not_required: "not_required";
2848
- }>;
2849
- state: z.ZodLiteral<"settled">;
2850
- completeness: z.ZodEnum<{
2851
- lost: "lost";
2852
- complete: "complete";
2853
- partial: "partial";
2345
+ versionId: z.ZodUUID;
2346
+ sha256: z.ZodString;
2347
+ name: z.ZodString;
2348
+ mediaType: z.ZodString;
2349
+ sizeBytes: z.ZodNumber;
2350
+ completeness: z.ZodEnum<{
2351
+ complete: "complete";
2352
+ partial: "partial";
2353
+ }>;
2354
+ availability: z.ZodEnum<{
2355
+ expired: "expired";
2356
+ published: "published";
2357
+ unavailable: "unavailable";
2358
+ }>;
2359
+ expiresAt: z.ZodISODateTime;
2360
+ }, z.core.$strict>;
2361
+ type ExportObject = z.infer<typeof ExportObjectSchema>;
2362
+ //#endregion
2363
+ //#region ../contracts/src/sessions/fingerprint.d.ts
2364
+ declare function fingerprintRequest(input: unknown): string;
2365
+ //#endregion
2366
+ //#region ../contracts/src/sessions/issuer.d.ts
2367
+ declare const IssuerUrlSchema: z.ZodURL;
2368
+ declare const SessionIssuerSchema: z.ZodObject<{
2369
+ url: z.ZodURL;
2370
+ tokenFile: z.ZodString;
2371
+ policy: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
2372
+ revoke: z.ZodDefault<z.ZodBoolean>;
2373
+ }, z.core.$strict>;
2374
+ type SessionIssuer = z.infer<typeof SessionIssuerSchema>;
2375
+ //#endregion
2376
+ //#region ../contracts/src/sessions/pages.d.ts
2377
+ declare const ManagedHistoryQuerySchema: z.ZodObject<{
2378
+ cursor: z.ZodOptional<z.ZodString>;
2379
+ limit: z.ZodOptional<z.ZodNumber>;
2380
+ }, z.core.$strict>;
2381
+ declare const ManagedHistoryPageSchema: z.ZodObject<{
2382
+ records: z.ZodArray<z.ZodObject<{
2383
+ schema: z.ZodLiteral<"pocketcoder.conversation-record/v1">;
2384
+ turn_id: z.ZodNullable<z.ZodUUID>;
2385
+ request: z.ZodNullable<z.ZodObject<{
2386
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
2387
+ authority: z.ZodEnum<{
2388
+ external: "external";
2389
+ generic: "generic";
2854
2390
  }>;
2855
- manifestDigest: z.ZodString;
2856
- settledAt: z.ZodISODateTime;
2857
- expiresAt: z.ZodISODateTime;
2858
- }, z.core.$strict>]>;
2859
- finalResponse: z.ZodNullable<z.ZodString>;
2860
- state: z.ZodLiteral<"terminal">;
2861
- outcome: z.ZodEnum<{
2862
- completed: "completed";
2391
+ conversation_id: z.ZodUUID;
2392
+ request_id: z.ZodUUID;
2393
+ turn_id: z.ZodUUID;
2394
+ request_fingerprint: z.ZodString;
2395
+ }, z.core.$strip>>;
2396
+ status: z.ZodEnum<{
2397
+ message: "message";
2863
2398
  failed: "failed";
2864
2399
  canceled: "canceled";
2400
+ completed: "completed";
2865
2401
  interrupted: "interrupted";
2866
2402
  lost: "lost";
2403
+ legacy: "legacy";
2867
2404
  }>;
2868
- }, z.core.$strict>, z.ZodObject<{
2869
- sessionId: z.ZodUUID;
2870
- requestId: z.ZodUUID;
2871
- turnId: z.ZodUUID;
2872
- inputFingerprint: z.ZodString;
2873
- revision: z.ZodNumber;
2874
- reasonCode: z.ZodNullable<z.ZodString>;
2875
- acceptedAt: z.ZodISODateTime;
2876
- startedAt: z.ZodNullable<z.ZodISODateTime>;
2877
- dispatchDeadline: z.ZodISODateTime;
2878
- collection: z.ZodUnion<readonly [z.ZodObject<{
2879
- sessionId: z.ZodUUID;
2880
- requestId: z.ZodUUID;
2881
- revision: z.ZodNumber;
2882
- objects: z.ZodArray<z.ZodObject<{
2883
- exportId: z.ZodUUID;
2884
- sessionId: z.ZodUUID;
2885
- requestId: z.ZodUUID;
2886
- versionId: z.ZodUUID;
2887
- sha256: z.ZodString;
2888
- name: z.ZodString;
2889
- mediaType: z.ZodString;
2890
- sizeBytes: z.ZodNumber;
2891
- completeness: z.ZodEnum<{
2892
- complete: "complete";
2893
- partial: "partial";
2894
- }>;
2895
- availability: z.ZodEnum<{
2896
- expired: "expired";
2897
- unavailable: "unavailable";
2898
- published: "published";
2899
- }>;
2900
- expiresAt: z.ZodISODateTime;
2901
- }, z.core.$strict>>;
2902
- errors: z.ZodArray<z.ZodString>;
2903
- cleanupState: z.ZodEnum<{
2904
- pending: "pending";
2905
- complete: "complete";
2906
- not_required: "not_required";
2907
- }>;
2908
- state: z.ZodEnum<{
2909
- pending: "pending";
2910
- finalizing: "finalizing";
2911
- }>;
2912
- completeness: z.ZodNull;
2913
- manifestDigest: z.ZodNull;
2914
- settledAt: z.ZodNull;
2915
- expiresAt: z.ZodNull;
2916
- }, z.core.$strict>, z.ZodObject<{
2917
- sessionId: z.ZodUUID;
2918
- requestId: z.ZodUUID;
2919
- revision: z.ZodNumber;
2920
- objects: z.ZodArray<z.ZodObject<{
2921
- exportId: z.ZodUUID;
2922
- sessionId: z.ZodUUID;
2923
- requestId: z.ZodUUID;
2924
- versionId: z.ZodUUID;
2925
- sha256: z.ZodString;
2926
- name: z.ZodString;
2927
- mediaType: z.ZodString;
2928
- sizeBytes: z.ZodNumber;
2929
- completeness: z.ZodEnum<{
2930
- complete: "complete";
2931
- partial: "partial";
2932
- }>;
2933
- availability: z.ZodEnum<{
2934
- expired: "expired";
2935
- unavailable: "unavailable";
2936
- published: "published";
2937
- }>;
2938
- expiresAt: z.ZodISODateTime;
2939
- }, z.core.$strict>>;
2940
- errors: z.ZodArray<z.ZodString>;
2941
- cleanupState: z.ZodEnum<{
2942
- pending: "pending";
2943
- complete: "complete";
2944
- not_required: "not_required";
2945
- }>;
2946
- state: z.ZodLiteral<"settled">;
2947
- completeness: z.ZodEnum<{
2948
- lost: "lost";
2949
- complete: "complete";
2950
- partial: "partial";
2951
- }>;
2952
- manifestDigest: z.ZodString;
2953
- settledAt: z.ZodISODateTime;
2954
- expiresAt: z.ZodISODateTime;
2955
- }, z.core.$strict>]>;
2956
- finalResponse: z.ZodNullable<z.ZodString>;
2957
- state: z.ZodEnum<{
2958
- running: "running";
2959
- accepted: "accepted";
2960
- waiting: "waiting";
2961
- checking_outcome: "checking_outcome";
2962
- }>;
2963
- outcome: z.ZodNull;
2964
- endedAt: z.ZodNull;
2965
- }, z.core.$strict>]>;
2966
- CancelCommand: z.ZodObject<{
2967
- cancelId: z.ZodUUID;
2968
- }, z.core.$strict>;
2969
- CancelReceipt: z.ZodUnion<readonly [z.ZodObject<{
2970
- sessionId: z.ZodUUID;
2971
- cancelId: z.ZodUUID;
2972
- state: z.ZodEnum<{
2973
- pending: "pending";
2974
- completed: "completed";
2975
- }>;
2976
- acceptedAt: z.ZodISODateTime;
2977
- completedAt: z.ZodNullable<z.ZodISODateTime>;
2978
- cancelDeadline: z.ZodISODateTime;
2979
- scope: z.ZodLiteral<"request">;
2980
- requestId: z.ZodUUID;
2981
- }, z.core.$strict>, z.ZodObject<{
2982
- sessionId: z.ZodUUID;
2983
- cancelId: z.ZodUUID;
2984
- state: z.ZodEnum<{
2985
- pending: "pending";
2986
- completed: "completed";
2987
- }>;
2988
- acceptedAt: z.ZodISODateTime;
2989
- completedAt: z.ZodNullable<z.ZodISODateTime>;
2990
- cancelDeadline: z.ZodISODateTime;
2991
- scope: z.ZodLiteral<"session">;
2992
- requestId: z.ZodNull;
2993
- }, z.core.$strict>]>;
2994
- RuntimeEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
2995
- eventId: z.ZodUUID;
2996
- cursor: z.ZodString;
2997
- sessionId: z.ZodUUID;
2998
- sequence: z.ZodNumber;
2999
- revision: z.ZodNumber;
3000
- occurredAt: z.ZodNullable<z.ZodISODateTime>;
3001
- recordedAt: z.ZodISODateTime;
3002
- kind: z.ZodLiteral<"session.updated">;
3003
- requestId: z.ZodNull;
3004
- data: z.ZodObject<{
3005
- sessionId: z.ZodUUID;
3006
- profileId: z.ZodUUID;
3007
- profileRevision: z.ZodNumber;
3008
- revision: z.ZodNumber;
3009
- state: z.ZodEnum<{
3010
- failed: "failed";
3011
- ready: "ready";
3012
- provisioning: "provisioning";
3013
- suspended: "suspended";
3014
- closed: "closed";
2405
+ reason: z.ZodNullable<z.ZodString>;
2406
+ messages: z.ZodArray<z.ZodObject<{
2407
+ message_id: z.ZodString;
2408
+ role: z.ZodEnum<{
2409
+ user: "user";
2410
+ assistant: "assistant";
2411
+ system: "system";
2412
+ tool: "tool";
3015
2413
  }>;
3016
- reasonCode: z.ZodNullable<z.ZodString>;
3017
- createdAt: z.ZodISODateTime;
3018
- updatedAt: z.ZodISODateTime;
3019
- }, z.core.$strict>;
3020
- }, z.core.$strict>, z.ZodObject<{
3021
- eventId: z.ZodUUID;
3022
- cursor: z.ZodString;
3023
- sessionId: z.ZodUUID;
3024
- sequence: z.ZodNumber;
3025
- revision: z.ZodNumber;
3026
- occurredAt: z.ZodNullable<z.ZodISODateTime>;
3027
- recordedAt: z.ZodISODateTime;
3028
- kind: z.ZodLiteral<"request.updated">;
3029
- requestId: z.ZodUUID;
3030
- data: z.ZodUnion<readonly [z.ZodObject<{
3031
- sessionId: z.ZodUUID;
3032
- requestId: z.ZodUUID;
3033
- turnId: z.ZodUUID;
3034
- inputFingerprint: z.ZodString;
3035
- revision: z.ZodNumber;
3036
- reasonCode: z.ZodNullable<z.ZodString>;
3037
- acceptedAt: z.ZodISODateTime;
3038
- startedAt: z.ZodNullable<z.ZodISODateTime>;
3039
- endedAt: z.ZodNullable<z.ZodISODateTime>;
3040
- dispatchDeadline: z.ZodISODateTime;
3041
- collection: z.ZodUnion<readonly [z.ZodObject<{
3042
- sessionId: z.ZodUUID;
3043
- requestId: z.ZodUUID;
3044
- revision: z.ZodNumber;
3045
- objects: z.ZodArray<z.ZodObject<{
3046
- exportId: z.ZodUUID;
3047
- sessionId: z.ZodUUID;
3048
- requestId: z.ZodUUID;
3049
- versionId: z.ZodUUID;
3050
- sha256: z.ZodString;
3051
- name: z.ZodString;
3052
- mediaType: z.ZodString;
3053
- sizeBytes: z.ZodNumber;
3054
- completeness: z.ZodEnum<{
3055
- complete: "complete";
3056
- partial: "partial";
3057
- }>;
3058
- availability: z.ZodEnum<{
3059
- expired: "expired";
3060
- unavailable: "unavailable";
3061
- published: "published";
3062
- }>;
3063
- expiresAt: z.ZodISODateTime;
3064
- }, z.core.$strict>>;
3065
- errors: z.ZodArray<z.ZodString>;
3066
- cleanupState: z.ZodEnum<{
3067
- pending: "pending";
3068
- complete: "complete";
3069
- not_required: "not_required";
3070
- }>;
3071
- state: z.ZodEnum<{
3072
- pending: "pending";
3073
- finalizing: "finalizing";
3074
- }>;
3075
- completeness: z.ZodNull;
3076
- manifestDigest: z.ZodNull;
3077
- settledAt: z.ZodNull;
3078
- expiresAt: z.ZodNull;
2414
+ content: z.ZodString;
2415
+ parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2416
+ type: z.ZodLiteral<"text">;
2417
+ text: z.ZodString;
3079
2418
  }, z.core.$strict>, z.ZodObject<{
3080
- sessionId: z.ZodUUID;
3081
- requestId: z.ZodUUID;
3082
- revision: z.ZodNumber;
3083
- objects: z.ZodArray<z.ZodObject<{
3084
- exportId: z.ZodUUID;
3085
- sessionId: z.ZodUUID;
3086
- requestId: z.ZodUUID;
3087
- versionId: z.ZodUUID;
3088
- sha256: z.ZodString;
3089
- name: z.ZodString;
3090
- mediaType: z.ZodString;
3091
- sizeBytes: z.ZodNumber;
3092
- completeness: z.ZodEnum<{
3093
- complete: "complete";
3094
- partial: "partial";
3095
- }>;
3096
- availability: z.ZodEnum<{
3097
- expired: "expired";
3098
- unavailable: "unavailable";
3099
- published: "published";
3100
- }>;
3101
- expiresAt: z.ZodISODateTime;
3102
- }, z.core.$strict>>;
3103
- errors: z.ZodArray<z.ZodString>;
3104
- cleanupState: z.ZodEnum<{
2419
+ type: z.ZodLiteral<"tool">;
2420
+ call_id: z.ZodString;
2421
+ name: z.ZodString;
2422
+ status: z.ZodEnum<{
2423
+ failed: "failed";
3105
2424
  pending: "pending";
3106
- complete: "complete";
3107
- not_required: "not_required";
2425
+ running: "running";
2426
+ canceled: "canceled";
2427
+ completed: "completed";
3108
2428
  }>;
3109
- state: z.ZodLiteral<"settled">;
3110
- completeness: z.ZodEnum<{
3111
- lost: "lost";
3112
- complete: "complete";
3113
- partial: "partial";
2429
+ input: z.ZodJSONSchema;
2430
+ output: z.ZodOptional<z.ZodJSONSchema>;
2431
+ output_text: z.ZodOptional<z.ZodString>;
2432
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2433
+ ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
2434
+ }, z.core.$strict>, z.ZodObject<{
2435
+ type: z.ZodLiteral<"error">;
2436
+ code: z.ZodString;
2437
+ message: z.ZodString;
2438
+ }, z.core.$strict>, z.ZodObject<{
2439
+ type: z.ZodLiteral<"file">;
2440
+ file_id: z.ZodUUID;
2441
+ name: z.ZodString;
2442
+ media_type: z.ZodString;
2443
+ size_bytes: z.ZodNumber;
2444
+ }, z.core.$strict>], "type">>>;
2445
+ occurred_at: z.ZodISODateTime;
2446
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2447
+ seq: z.ZodNumber;
2448
+ identity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2449
+ schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
2450
+ authority: z.ZodEnum<{
2451
+ external: "external";
2452
+ generic: "generic";
3114
2453
  }>;
3115
- manifestDigest: z.ZodString;
3116
- settledAt: z.ZodISODateTime;
3117
- expiresAt: z.ZodISODateTime;
3118
- }, z.core.$strict>]>;
3119
- finalResponse: z.ZodNullable<z.ZodString>;
3120
- state: z.ZodLiteral<"terminal">;
3121
- outcome: z.ZodEnum<{
3122
- completed: "completed";
3123
- failed: "failed";
3124
- canceled: "canceled";
3125
- interrupted: "interrupted";
3126
- lost: "lost";
3127
- }>;
3128
- }, z.core.$strict>, z.ZodObject<{
3129
- sessionId: z.ZodUUID;
3130
- requestId: z.ZodUUID;
3131
- turnId: z.ZodUUID;
3132
- inputFingerprint: z.ZodString;
3133
- revision: z.ZodNumber;
3134
- reasonCode: z.ZodNullable<z.ZodString>;
3135
- acceptedAt: z.ZodISODateTime;
3136
- startedAt: z.ZodNullable<z.ZodISODateTime>;
3137
- dispatchDeadline: z.ZodISODateTime;
3138
- collection: z.ZodUnion<readonly [z.ZodObject<{
3139
- sessionId: z.ZodUUID;
3140
- requestId: z.ZodUUID;
2454
+ conversation_id: z.ZodUUID;
2455
+ request_id: z.ZodUUID;
2456
+ turn_id: z.ZodUUID;
2457
+ request_fingerprint: z.ZodString;
2458
+ event_id: z.ZodUUID;
2459
+ message_id: z.ZodString;
2460
+ sequence: z.ZodNumber;
3141
2461
  revision: z.ZodNumber;
3142
- objects: z.ZodArray<z.ZodObject<{
3143
- exportId: z.ZodUUID;
3144
- sessionId: z.ZodUUID;
3145
- requestId: z.ZodUUID;
3146
- versionId: z.ZodUUID;
3147
- sha256: z.ZodString;
3148
- name: z.ZodString;
3149
- mediaType: z.ZodString;
3150
- sizeBytes: z.ZodNumber;
3151
- completeness: z.ZodEnum<{
3152
- complete: "complete";
3153
- partial: "partial";
3154
- }>;
3155
- availability: z.ZodEnum<{
3156
- expired: "expired";
3157
- unavailable: "unavailable";
3158
- published: "published";
2462
+ fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2463
+ type: z.ZodLiteral<"intermediate">;
2464
+ }, z.core.$strip>, z.ZodObject<{
2465
+ type: z.ZodLiteral<"final_response">;
2466
+ }, z.core.$strip>, z.ZodObject<{
2467
+ type: z.ZodLiteral<"tool_only">;
2468
+ }, z.core.$strip>, z.ZodObject<{
2469
+ type: z.ZodLiteral<"activity_started">;
2470
+ activity_id: z.ZodUUID;
2471
+ kind: z.ZodEnum<{
2472
+ workspace: "workspace";
2473
+ tool: "tool";
2474
+ attachment: "attachment";
2475
+ retrieval: "retrieval";
3159
2476
  }>;
3160
- expiresAt: z.ZodISODateTime;
3161
- }, z.core.$strict>>;
3162
- errors: z.ZodArray<z.ZodString>;
3163
- cleanupState: z.ZodEnum<{
3164
- pending: "pending";
3165
- complete: "complete";
3166
- not_required: "not_required";
3167
- }>;
3168
- state: z.ZodEnum<{
3169
- pending: "pending";
3170
- finalizing: "finalizing";
3171
- }>;
3172
- completeness: z.ZodNull;
3173
- manifestDigest: z.ZodNull;
3174
- settledAt: z.ZodNull;
3175
- expiresAt: z.ZodNull;
3176
- }, z.core.$strict>, z.ZodObject<{
3177
- sessionId: z.ZodUUID;
3178
- requestId: z.ZodUUID;
3179
- revision: z.ZodNumber;
3180
- objects: z.ZodArray<z.ZodObject<{
3181
- exportId: z.ZodUUID;
3182
- sessionId: z.ZodUUID;
3183
- requestId: z.ZodUUID;
3184
- versionId: z.ZodUUID;
3185
- sha256: z.ZodString;
3186
- name: z.ZodString;
3187
- mediaType: z.ZodString;
3188
- sizeBytes: z.ZodNumber;
3189
- completeness: z.ZodEnum<{
3190
- complete: "complete";
3191
- partial: "partial";
2477
+ label: z.ZodString;
2478
+ started_at: z.ZodNullable<z.ZodISODateTime>;
2479
+ action: z.ZodOptional<z.ZodString>;
2480
+ subject: z.ZodOptional<z.ZodString>;
2481
+ }, z.core.$strip>, z.ZodObject<{
2482
+ type: z.ZodLiteral<"activity_finished">;
2483
+ activity_id: z.ZodUUID;
2484
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
2485
+ outcome: z.ZodEnum<{
2486
+ failed: "failed";
2487
+ canceled: "canceled";
2488
+ completed: "completed";
2489
+ interrupted: "interrupted";
3192
2490
  }>;
3193
- availability: z.ZodEnum<{
3194
- expired: "expired";
3195
- unavailable: "unavailable";
3196
- published: "published";
2491
+ }, z.core.$strip>, z.ZodObject<{
2492
+ type: z.ZodLiteral<"turn_terminal">;
2493
+ outcome: z.ZodEnum<{
2494
+ failed: "failed";
2495
+ canceled: "canceled";
2496
+ completed: "completed";
2497
+ interrupted: "interrupted";
2498
+ lost: "lost";
3197
2499
  }>;
3198
- expiresAt: z.ZodISODateTime;
3199
- }, z.core.$strict>>;
3200
- errors: z.ZodArray<z.ZodString>;
3201
- cleanupState: z.ZodEnum<{
3202
- pending: "pending";
3203
- complete: "complete";
3204
- not_required: "not_required";
3205
- }>;
3206
- state: z.ZodLiteral<"settled">;
3207
- completeness: z.ZodEnum<{
3208
- lost: "lost";
3209
- complete: "complete";
3210
- partial: "partial";
3211
- }>;
3212
- manifestDigest: z.ZodString;
3213
- settledAt: z.ZodISODateTime;
3214
- expiresAt: z.ZodISODateTime;
3215
- }, z.core.$strict>]>;
3216
- finalResponse: z.ZodNullable<z.ZodString>;
3217
- state: z.ZodEnum<{
3218
- running: "running";
3219
- accepted: "accepted";
3220
- waiting: "waiting";
3221
- checking_outcome: "checking_outcome";
2500
+ reason: z.ZodOptional<z.ZodString>;
2501
+ }, z.core.$strip>], "type">>;
2502
+ }, z.core.$strip>>>;
2503
+ }, z.core.$strip>>;
2504
+ activities: z.ZodArray<z.ZodObject<{
2505
+ activity_id: z.ZodUUID;
2506
+ kind: z.ZodString;
2507
+ label: z.ZodString;
2508
+ action: z.ZodNullable<z.ZodString>;
2509
+ subject: z.ZodNullable<z.ZodString>;
2510
+ started_at: z.ZodNullable<z.ZodISODateTime>;
2511
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
2512
+ outcome: z.ZodNullable<z.ZodString>;
2513
+ }, z.core.$strip>>;
2514
+ final_response: z.ZodNullable<z.ZodString>;
2515
+ started_at: z.ZodNullable<z.ZodISODateTime>;
2516
+ ended_at: z.ZodNullable<z.ZodISODateTime>;
2517
+ }, z.core.$strip>>;
2518
+ nextCursor: z.ZodNullable<z.ZodString>;
2519
+ eventCursor: z.ZodString;
2520
+ }, z.core.$strict>;
2521
+ declare const ManagedExportPageSchema: z.ZodObject<{
2522
+ items: z.ZodArray<z.ZodObject<{
2523
+ exportId: z.ZodUUID;
2524
+ sessionId: z.ZodUUID;
2525
+ requestId: z.ZodUUID;
2526
+ versionId: z.ZodUUID;
2527
+ sha256: z.ZodString;
2528
+ name: z.ZodString;
2529
+ mediaType: z.ZodString;
2530
+ sizeBytes: z.ZodNumber;
2531
+ completeness: z.ZodEnum<{
2532
+ complete: "complete";
2533
+ partial: "partial";
2534
+ }>;
2535
+ availability: z.ZodEnum<{
2536
+ expired: "expired";
2537
+ published: "published";
2538
+ unavailable: "unavailable";
2539
+ }>;
2540
+ expiresAt: z.ZodISODateTime;
2541
+ }, z.core.$strict>>;
2542
+ nextCursor: z.ZodNullable<z.ZodString>;
2543
+ }, z.core.$strict>;
2544
+ type HistoryPage = z.infer<typeof ManagedHistoryPageSchema>;
2545
+ //#endregion
2546
+ //#region ../contracts/src/sessions/profile.d.ts
2547
+ declare const ProfileNameSchema: z.ZodString;
2548
+ declare const ProfileConfigSchema: z.ZodObject<{
2549
+ template: z.ZodString;
2550
+ templateVersion: z.ZodOptional<z.ZodString>;
2551
+ issuer: z.ZodOptional<z.ZodString>;
2552
+ placement: z.ZodDefault<z.ZodEnum<{
2553
+ exclusive: "exclusive";
2554
+ shared: "shared";
2555
+ }>>;
2556
+ limits: z.ZodDefault<z.ZodObject<{
2557
+ workspacesPerOwner: z.ZodDefault<z.ZodNumber>;
2558
+ sessionsPerWorkspace: z.ZodDefault<z.ZodNumber>;
2559
+ }, z.core.$strict>>;
2560
+ dispatchDeadlineSeconds: z.ZodDefault<z.ZodNumber>;
2561
+ }, z.core.$strict>;
2562
+ type ProfileConfig = z.infer<typeof ProfileConfigSchema>;
2563
+ declare const SessionProfileSchema: z.ZodObject<{
2564
+ template: z.ZodString;
2565
+ issuer: z.ZodOptional<z.ZodString>;
2566
+ placement: z.ZodDefault<z.ZodEnum<{
2567
+ exclusive: "exclusive";
2568
+ shared: "shared";
2569
+ }>>;
2570
+ limits: z.ZodDefault<z.ZodObject<{
2571
+ workspacesPerOwner: z.ZodDefault<z.ZodNumber>;
2572
+ sessionsPerWorkspace: z.ZodDefault<z.ZodNumber>;
2573
+ }, z.core.$strict>>;
2574
+ dispatchDeadlineSeconds: z.ZodDefault<z.ZodNumber>;
2575
+ name: z.ZodString;
2576
+ templateVersion: z.ZodNullable<z.ZodString>;
2577
+ disabled: z.ZodBoolean;
2578
+ }, z.core.$strict>;
2579
+ type SessionProfile = z.infer<typeof SessionProfileSchema>;
2580
+ declare const SessionCreateSchema: z.ZodObject<{
2581
+ sessionId: z.ZodUUID;
2582
+ profile: z.ZodString;
2583
+ owner: z.ZodString;
2584
+ group: z.ZodOptional<z.ZodString>;
2585
+ }, z.core.$strict>;
2586
+ type SessionCreate = z.infer<typeof SessionCreateSchema>;
2587
+ declare const SessionSchema: z.ZodObject<{
2588
+ sessionId: z.ZodUUID;
2589
+ profile: z.ZodString;
2590
+ owner: z.ZodString;
2591
+ group: z.ZodString;
2592
+ revision: z.ZodNumber;
2593
+ state: z.ZodEnum<{
2594
+ ready: "ready";
2595
+ failed: "failed";
2596
+ provisioning: "provisioning";
2597
+ suspended: "suspended";
2598
+ closed: "closed";
2599
+ }>;
2600
+ reasonCode: z.ZodNullable<z.ZodString>;
2601
+ createdAt: z.ZodISODateTime;
2602
+ updatedAt: z.ZodISODateTime;
2603
+ }, z.core.$strict>;
2604
+ type Session = z.infer<typeof SessionSchema>;
2605
+ //#endregion
2606
+ //#region ../contracts/src/sessions/placement.d.ts
2607
+ declare function managedPlacement(principalId: string, session: Pick<Session, "sessionId" | "profile" | "owner" | "group">, profile: SessionProfile): {
2608
+ mode: "exclusive" | "shared";
2609
+ key: string;
2610
+ };
2611
+ declare const MANAGED_SESSION_METADATA = "pocketcoder.managed-session";
2612
+ //#endregion
2613
+ //#region ../contracts/src/sessions/request.d.ts
2614
+ declare const RequestInputSchema: z.ZodObject<{
2615
+ requestId: z.ZodUUID;
2616
+ message: z.ZodString;
2617
+ attachments: z.ZodDefault<z.ZodArray<z.ZodUUID>>;
2618
+ }, z.core.$strict>;
2619
+ type RequestInput = z.infer<typeof RequestInputSchema>;
2620
+ declare const RequestSchema: z.ZodUnion<readonly [z.ZodObject<{
2621
+ sessionId: z.ZodUUID;
2622
+ requestId: z.ZodUUID;
2623
+ turnId: z.ZodUUID;
2624
+ inputFingerprint: z.ZodString;
2625
+ revision: z.ZodNumber;
2626
+ reasonCode: z.ZodNullable<z.ZodString>;
2627
+ acceptedAt: z.ZodISODateTime;
2628
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
2629
+ endedAt: z.ZodNullable<z.ZodISODateTime>;
2630
+ dispatchDeadline: z.ZodISODateTime;
2631
+ collection: z.ZodUnion<readonly [z.ZodObject<{
2632
+ sessionId: z.ZodUUID;
2633
+ requestId: z.ZodUUID;
2634
+ revision: z.ZodNumber;
2635
+ objects: z.ZodArray<z.ZodObject<{
2636
+ exportId: z.ZodUUID;
2637
+ sessionId: z.ZodUUID;
2638
+ requestId: z.ZodUUID;
2639
+ versionId: z.ZodUUID;
2640
+ sha256: z.ZodString;
2641
+ name: z.ZodString;
2642
+ mediaType: z.ZodString;
2643
+ sizeBytes: z.ZodNumber;
2644
+ completeness: z.ZodEnum<{
2645
+ complete: "complete";
2646
+ partial: "partial";
3222
2647
  }>;
3223
- outcome: z.ZodNull;
3224
- endedAt: z.ZodNull;
3225
- }, z.core.$strict>]>;
2648
+ availability: z.ZodEnum<{
2649
+ expired: "expired";
2650
+ published: "published";
2651
+ unavailable: "unavailable";
2652
+ }>;
2653
+ expiresAt: z.ZodISODateTime;
2654
+ }, z.core.$strict>>;
2655
+ errors: z.ZodArray<z.ZodString>;
2656
+ cleanupState: z.ZodEnum<{
2657
+ pending: "pending";
2658
+ complete: "complete";
2659
+ not_required: "not_required";
2660
+ }>;
2661
+ state: z.ZodEnum<{
2662
+ pending: "pending";
2663
+ finalizing: "finalizing";
2664
+ }>;
2665
+ completeness: z.ZodNull;
2666
+ manifestDigest: z.ZodNull;
2667
+ settledAt: z.ZodNull;
2668
+ expiresAt: z.ZodNull;
3226
2669
  }, z.core.$strict>, z.ZodObject<{
3227
- eventId: z.ZodUUID;
3228
- cursor: z.ZodString;
3229
2670
  sessionId: z.ZodUUID;
3230
- sequence: z.ZodNumber;
3231
- revision: z.ZodNumber;
3232
- occurredAt: z.ZodNullable<z.ZodISODateTime>;
3233
- recordedAt: z.ZodISODateTime;
3234
- kind: z.ZodLiteral<"output.published">;
3235
2671
  requestId: z.ZodUUID;
3236
- data: z.ZodObject<{
2672
+ revision: z.ZodNumber;
2673
+ objects: z.ZodArray<z.ZodObject<{
3237
2674
  exportId: z.ZodUUID;
3238
2675
  sessionId: z.ZodUUID;
3239
2676
  requestId: z.ZodUUID;
@@ -3248,436 +2685,89 @@ declare const managedSchemas: {
3248
2685
  }>;
3249
2686
  availability: z.ZodEnum<{
3250
2687
  expired: "expired";
3251
- unavailable: "unavailable";
3252
2688
  published: "published";
2689
+ unavailable: "unavailable";
3253
2690
  }>;
3254
2691
  expiresAt: z.ZodISODateTime;
3255
- }, z.core.$strict>;
3256
- }, z.core.$strict>], "kind">;
3257
- Error: z.ZodObject<{
3258
- error: z.ZodObject<{
3259
- code: z.ZodString;
3260
- message: z.ZodString;
3261
- retry: z.ZodEnum<{
3262
- never: "never";
3263
- same_identity: "same_identity";
3264
- after_capacity_change: "after_capacity_change";
3265
- reconcile: "reconcile";
2692
+ }, z.core.$strict>>;
2693
+ errors: z.ZodArray<z.ZodString>;
2694
+ cleanupState: z.ZodEnum<{
2695
+ pending: "pending";
2696
+ complete: "complete";
2697
+ not_required: "not_required";
2698
+ }>;
2699
+ state: z.ZodLiteral<"settled">;
2700
+ completeness: z.ZodEnum<{
2701
+ complete: "complete";
2702
+ partial: "partial";
2703
+ lost: "lost";
2704
+ }>;
2705
+ manifestDigest: z.ZodString;
2706
+ settledAt: z.ZodISODateTime;
2707
+ expiresAt: z.ZodISODateTime;
2708
+ }, z.core.$strict>]>;
2709
+ finalResponse: z.ZodNullable<z.ZodString>;
2710
+ state: z.ZodLiteral<"terminal">;
2711
+ outcome: z.ZodEnum<{
2712
+ failed: "failed";
2713
+ canceled: "canceled";
2714
+ completed: "completed";
2715
+ interrupted: "interrupted";
2716
+ lost: "lost";
2717
+ }>;
2718
+ }, z.core.$strict>, z.ZodObject<{
2719
+ sessionId: z.ZodUUID;
2720
+ requestId: z.ZodUUID;
2721
+ turnId: z.ZodUUID;
2722
+ inputFingerprint: z.ZodString;
2723
+ revision: z.ZodNumber;
2724
+ reasonCode: z.ZodNullable<z.ZodString>;
2725
+ acceptedAt: z.ZodISODateTime;
2726
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
2727
+ dispatchDeadline: z.ZodISODateTime;
2728
+ collection: z.ZodUnion<readonly [z.ZodObject<{
2729
+ sessionId: z.ZodUUID;
2730
+ requestId: z.ZodUUID;
2731
+ revision: z.ZodNumber;
2732
+ objects: z.ZodArray<z.ZodObject<{
2733
+ exportId: z.ZodUUID;
2734
+ sessionId: z.ZodUUID;
2735
+ requestId: z.ZodUUID;
2736
+ versionId: z.ZodUUID;
2737
+ sha256: z.ZodString;
2738
+ name: z.ZodString;
2739
+ mediaType: z.ZodString;
2740
+ sizeBytes: z.ZodNumber;
2741
+ completeness: z.ZodEnum<{
2742
+ complete: "complete";
2743
+ partial: "partial";
3266
2744
  }>;
3267
- retryAfterSeconds: z.ZodNullable<z.ZodNumber>;
3268
- requestId: z.ZodNullable<z.ZodUUID>;
3269
- }, z.core.$strict>;
3270
- }, z.core.$strict>;
3271
- WireError: z.ZodObject<{
3272
- error: z.ZodObject<{
3273
- code: z.ZodEnum<{
3274
- "auth.invalid_key": "auth.invalid_key";
3275
- "auth.missing_scope": "auth.missing_scope";
3276
- "auth.disabled_principal": "auth.disabled_principal";
3277
- "principal.not_found": "principal.not_found";
3278
- "principal.name_conflict": "principal.name_conflict";
3279
- "key.not_found": "key.not_found";
3280
- "request.body_too_large": "request.body_too_large";
3281
- "request.not_found": "request.not_found";
3282
- "validation.invalid": "validation.invalid";
3283
- "idempotency.conflict": "idempotency.conflict";
3284
- "capacity.queue_full": "capacity.queue_full";
3285
- "capacity.waiters_full": "capacity.waiters_full";
3286
- "template.not_found": "template.not_found";
3287
- "template.version_not_found": "template.version_not_found";
3288
- "template.version_immutable": "template.version_immutable";
3289
- "template.not_authorized": "template.not_authorized";
3290
- "workspace.not_found": "workspace.not_found";
3291
- "workspace.external_id_conflict": "workspace.external_id_conflict";
3292
- "workspace.not_ready": "workspace.not_ready";
3293
- "workspace.terminal": "workspace.terminal";
3294
- "workspace.disconnected": "workspace.disconnected";
3295
- "terminal.not_declared": "terminal.not_declared";
3296
- "terminal.session_limit": "terminal.session_limit";
3297
- "terminal.session_not_found": "terminal.session_not_found";
3298
- "terminal.session_closed": "terminal.session_closed";
3299
- "terminal.protocol_unsupported": "terminal.protocol_unsupported";
3300
- "workspace.persistence_not_enabled": "workspace.persistence_not_enabled";
3301
- "workspace.preserving": "workspace.preserving";
3302
- "checkpoint.not_found": "checkpoint.not_found";
3303
- "checkpoint.unsupported": "checkpoint.unsupported";
3304
- "artifact.not_found": "artifact.not_found";
3305
- "artifact.workspace_active": "artifact.workspace_active";
3306
- "artifact.too_large": "artifact.too_large";
3307
- "checkpoint.not_ready": "checkpoint.not_ready";
3308
- "checkpoint.none_ready": "checkpoint.none_ready";
3309
- "checkpoint.corrupt": "checkpoint.corrupt";
3310
- "checkpoint.quota_exceeded": "checkpoint.quota_exceeded";
3311
- "checkpoint.in_use": "checkpoint.in_use";
3312
- "restore.template_not_authorized": "restore.template_not_authorized";
3313
- "restore.image_unavailable": "restore.image_unavailable";
3314
- "restore.incompatible": "restore.incompatible";
3315
- "resume.unsupported": "resume.unsupported";
3316
- "conversation.not_found": "conversation.not_found";
3317
- "conversation.expired": "conversation.expired";
3318
- "conversation.deleted": "conversation.deleted";
3319
- "operation.conflict": "operation.conflict";
3320
- "source.not_allowed": "source.not_allowed";
3321
- "source.invalid_revision": "source.invalid_revision";
3322
- "secret.unavailable": "secret.unavailable";
3323
- "secret.not_found": "secret.not_found";
3324
- "storage.capacity_exhausted": "storage.capacity_exhausted";
3325
- "relay.body_too_large": "relay.body_too_large";
3326
- "relay.route_not_allowed": "relay.route_not_allowed";
3327
- "relay.streaming_unsupported": "relay.streaming_unsupported";
3328
- "relay.deadline_exceeded": "relay.deadline_exceeded";
3329
- "relay.upstream_error": "relay.upstream_error";
3330
- "agent.interrupt_unsupported": "agent.interrupt_unsupported";
3331
- "attachment.invalid": "attachment.invalid";
3332
- "attachment.too_large": "attachment.too_large";
3333
- "attachment.not_found": "attachment.not_found";
3334
- "attachment.conflict": "attachment.conflict";
3335
- "attachment.unsupported": "attachment.unsupported";
3336
- "attachment.interrupted": "attachment.interrupted";
3337
- "maintenance.active": "maintenance.active";
3338
- "maintenance.timeout": "maintenance.timeout";
3339
- "backup.failed": "backup.failed";
3340
- "journal.pending": "journal.pending";
3341
- "account.purged": "account.purged";
3342
- "account.purge_pending": "account.purge_pending";
3343
- "recovery.required": "recovery.required";
3344
- "recovery.failed": "recovery.failed";
3345
- "session.not_found": "session.not_found";
3346
- "session.closed": "session.closed";
3347
- "profile.not_found": "profile.not_found";
3348
- "budget.not_found": "budget.not_found";
3349
- "budget.exhausted": "budget.exhausted";
3350
- "budget.conflict": "budget.conflict";
3351
- "revision.stale": "revision.stale";
3352
- "events.cursor_invalid": "events.cursor_invalid";
3353
- "events.cursor_expired": "events.cursor_expired";
3354
- "runtime.unavailable": "runtime.unavailable";
3355
- "internal.error": "internal.error";
2745
+ availability: z.ZodEnum<{
2746
+ expired: "expired";
2747
+ published: "published";
2748
+ unavailable: "unavailable";
3356
2749
  }>;
3357
- message: z.ZodString;
3358
- request_id: z.ZodString;
3359
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3360
- }, z.core.$strip>;
3361
- }, z.core.$strip>;
3362
- BudgetPolicy: z.ZodObject<{
3363
- scopeId: z.ZodUUID;
3364
- revision: z.ZodNumber;
3365
- period: z.ZodEnum<{
3366
- utc_day: "utc_day";
3367
- utc_month: "utc_month";
2750
+ expiresAt: z.ZodISODateTime;
2751
+ }, z.core.$strict>>;
2752
+ errors: z.ZodArray<z.ZodString>;
2753
+ cleanupState: z.ZodEnum<{
2754
+ pending: "pending";
2755
+ complete: "complete";
2756
+ not_required: "not_required";
3368
2757
  }>;
3369
- limits: z.ZodObject<{
3370
- workspaceStarts: z.ZodNullable<z.ZodNumber>;
3371
- maxActiveWorkspaces: z.ZodNullable<z.ZodNumber>;
3372
- maxRunningRequestsPerSession: z.ZodLiteral<1>;
3373
- maxChatProcessesPerWorkspace: z.ZodNumber;
3374
- }, z.core.$strict>;
3375
- effectiveAt: z.ZodISODateTime;
3376
- }, z.core.$strict>;
3377
- BudgetPolicyWrite: z.ZodObject<{
3378
- scopeId: z.ZodUUID;
3379
- revision: z.ZodNumber;
3380
- period: z.ZodEnum<{
3381
- utc_day: "utc_day";
3382
- utc_month: "utc_month";
2758
+ state: z.ZodEnum<{
2759
+ pending: "pending";
2760
+ finalizing: "finalizing";
3383
2761
  }>;
3384
- limits: z.ZodObject<{
3385
- workspaceStarts: z.ZodNullable<z.ZodNumber>;
3386
- maxActiveWorkspaces: z.ZodNullable<z.ZodNumber>;
3387
- maxRunningRequestsPerSession: z.ZodLiteral<1>;
3388
- maxChatProcessesPerWorkspace: z.ZodNumber;
3389
- }, z.core.$strict>;
3390
- }, z.core.$strict>;
3391
- BudgetUsage: z.ZodObject<{
3392
- scopeId: z.ZodUUID;
3393
- policyRevision: z.ZodNumber;
3394
- periodStart: z.ZodISODateTime;
3395
- periodEnd: z.ZodISODateTime;
3396
- workspaceStarts: z.ZodNumber;
3397
- activeWorkspaces: z.ZodNumber;
3398
- asOf: z.ZodISODateTime;
3399
- }, z.core.$strict>;
3400
- CleanupReceipt: z.ZodUnion<readonly [z.ZodObject<{
3401
- workspaceId: z.ZodUUID;
3402
- generationId: z.ZodString;
3403
- revision: z.ZodNumber;
3404
- observedAt: z.ZodISODateTime;
3405
- state: z.ZodLiteral<"pending">;
3406
- basis: z.ZodNull;
3407
- capacityReleasedAt: z.ZodNull;
2762
+ completeness: z.ZodNull;
2763
+ manifestDigest: z.ZodNull;
2764
+ settledAt: z.ZodNull;
2765
+ expiresAt: z.ZodNull;
3408
2766
  }, z.core.$strict>, z.ZodObject<{
3409
- workspaceId: z.ZodUUID;
3410
- generationId: z.ZodString;
2767
+ sessionId: z.ZodUUID;
2768
+ requestId: z.ZodUUID;
3411
2769
  revision: z.ZodNumber;
3412
- observedAt: z.ZodISODateTime;
3413
- capacityReleasedAt: z.ZodNullable<z.ZodISODateTime>;
3414
- state: z.ZodLiteral<"proved">;
3415
- basis: z.ZodEnum<{
3416
- never_launched: "never_launched";
3417
- processes_exited: "processes_exited";
3418
- provider_fenced: "provider_fenced";
3419
- }>;
3420
- }, z.core.$strict>]>;
3421
- HistoryPage: z.ZodObject<{
3422
- records: z.ZodArray<z.ZodObject<{
3423
- schema: z.ZodLiteral<"pocketcoder.conversation-record/v1">;
3424
- turn_id: z.ZodNullable<z.ZodUUID>;
3425
- request: z.ZodNullable<z.ZodObject<{
3426
- schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
3427
- authority: z.ZodEnum<{
3428
- external: "external";
3429
- generic: "generic";
3430
- }>;
3431
- conversation_id: z.ZodUUID;
3432
- request_id: z.ZodUUID;
3433
- turn_id: z.ZodUUID;
3434
- request_fingerprint: z.ZodString;
3435
- }, z.core.$strip>>;
3436
- status: z.ZodEnum<{
3437
- message: "message";
3438
- completed: "completed";
3439
- failed: "failed";
3440
- canceled: "canceled";
3441
- interrupted: "interrupted";
3442
- lost: "lost";
3443
- legacy: "legacy";
3444
- }>;
3445
- reason: z.ZodNullable<z.ZodString>;
3446
- messages: z.ZodArray<z.ZodObject<{
3447
- message_id: z.ZodString;
3448
- role: z.ZodEnum<{
3449
- user: "user";
3450
- assistant: "assistant";
3451
- system: "system";
3452
- tool: "tool";
3453
- }>;
3454
- content: z.ZodString;
3455
- parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
3456
- type: z.ZodLiteral<"text">;
3457
- text: z.ZodString;
3458
- }, z.core.$strict>, z.ZodObject<{
3459
- type: z.ZodLiteral<"tool">;
3460
- call_id: z.ZodString;
3461
- name: z.ZodString;
3462
- status: z.ZodEnum<{
3463
- pending: "pending";
3464
- running: "running";
3465
- completed: "completed";
3466
- failed: "failed";
3467
- canceled: "canceled";
3468
- }>;
3469
- input: z.ZodJSONSchema;
3470
- output: z.ZodOptional<z.ZodJSONSchema>;
3471
- output_text: z.ZodOptional<z.ZodString>;
3472
- started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
3473
- ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
3474
- }, z.core.$strict>, z.ZodObject<{
3475
- type: z.ZodLiteral<"error">;
3476
- code: z.ZodString;
3477
- message: z.ZodString;
3478
- }, z.core.$strict>, z.ZodObject<{
3479
- type: z.ZodLiteral<"file">;
3480
- file_id: z.ZodUUID;
3481
- name: z.ZodString;
3482
- media_type: z.ZodString;
3483
- size_bytes: z.ZodNumber;
3484
- }, z.core.$strict>], "type">>>;
3485
- occurred_at: z.ZodISODateTime;
3486
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
3487
- seq: z.ZodNumber;
3488
- identity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3489
- schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
3490
- authority: z.ZodEnum<{
3491
- external: "external";
3492
- generic: "generic";
3493
- }>;
3494
- conversation_id: z.ZodUUID;
3495
- request_id: z.ZodUUID;
3496
- turn_id: z.ZodUUID;
3497
- request_fingerprint: z.ZodString;
3498
- event_id: z.ZodUUID;
3499
- message_id: z.ZodString;
3500
- sequence: z.ZodNumber;
3501
- revision: z.ZodNumber;
3502
- fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3503
- type: z.ZodLiteral<"intermediate">;
3504
- }, z.core.$strip>, z.ZodObject<{
3505
- type: z.ZodLiteral<"final_response">;
3506
- }, z.core.$strip>, z.ZodObject<{
3507
- type: z.ZodLiteral<"tool_only">;
3508
- }, z.core.$strip>, z.ZodObject<{
3509
- type: z.ZodLiteral<"activity_started">;
3510
- activity_id: z.ZodUUID;
3511
- kind: z.ZodEnum<{
3512
- tool: "tool";
3513
- attachment: "attachment";
3514
- workspace: "workspace";
3515
- retrieval: "retrieval";
3516
- }>;
3517
- label: z.ZodString;
3518
- started_at: z.ZodNullable<z.ZodISODateTime>;
3519
- action: z.ZodOptional<z.ZodString>;
3520
- subject: z.ZodOptional<z.ZodString>;
3521
- }, z.core.$strip>, z.ZodObject<{
3522
- type: z.ZodLiteral<"activity_finished">;
3523
- activity_id: z.ZodUUID;
3524
- ended_at: z.ZodNullable<z.ZodISODateTime>;
3525
- outcome: z.ZodEnum<{
3526
- completed: "completed";
3527
- failed: "failed";
3528
- canceled: "canceled";
3529
- interrupted: "interrupted";
3530
- }>;
3531
- }, z.core.$strip>, z.ZodObject<{
3532
- type: z.ZodLiteral<"turn_terminal">;
3533
- outcome: z.ZodEnum<{
3534
- completed: "completed";
3535
- failed: "failed";
3536
- canceled: "canceled";
3537
- interrupted: "interrupted";
3538
- lost: "lost";
3539
- }>;
3540
- reason: z.ZodOptional<z.ZodString>;
3541
- }, z.core.$strip>], "type">>;
3542
- }, z.core.$strip>>>;
3543
- }, z.core.$strip>>;
3544
- activities: z.ZodArray<z.ZodObject<{
3545
- activity_id: z.ZodUUID;
3546
- kind: z.ZodString;
3547
- label: z.ZodString;
3548
- action: z.ZodNullable<z.ZodString>;
3549
- subject: z.ZodNullable<z.ZodString>;
3550
- started_at: z.ZodNullable<z.ZodISODateTime>;
3551
- ended_at: z.ZodNullable<z.ZodISODateTime>;
3552
- outcome: z.ZodNullable<z.ZodString>;
3553
- }, z.core.$strip>>;
3554
- final_response: z.ZodNullable<z.ZodString>;
3555
- started_at: z.ZodNullable<z.ZodISODateTime>;
3556
- ended_at: z.ZodNullable<z.ZodISODateTime>;
3557
- }, z.core.$strip>>;
3558
- nextCursor: z.ZodNullable<z.ZodString>;
3559
- eventCursor: z.ZodString;
3560
- }, z.core.$strict>;
3561
- OpenTurns: z.ZodObject<{
3562
- turns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
3563
- type: z.ZodLiteral<"turn">;
3564
- conversation_id: z.ZodUUID;
3565
- turn_id: z.ZodUUID;
3566
- messages: z.ZodArray<z.ZodObject<{
3567
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
3568
- message_id: z.ZodString;
3569
- role: z.ZodEnum<{
3570
- user: "user";
3571
- assistant: "assistant";
3572
- system: "system";
3573
- tool: "tool";
3574
- }>;
3575
- content: z.ZodString;
3576
- parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
3577
- type: z.ZodLiteral<"text">;
3578
- text: z.ZodString;
3579
- }, z.core.$strict>, z.ZodObject<{
3580
- type: z.ZodLiteral<"tool">;
3581
- call_id: z.ZodString;
3582
- name: z.ZodString;
3583
- status: z.ZodEnum<{
3584
- pending: "pending";
3585
- running: "running";
3586
- completed: "completed";
3587
- failed: "failed";
3588
- canceled: "canceled";
3589
- }>;
3590
- input: z.ZodJSONSchema;
3591
- output: z.ZodOptional<z.ZodJSONSchema>;
3592
- output_text: z.ZodOptional<z.ZodString>;
3593
- started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
3594
- ended_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
3595
- }, z.core.$strict>, z.ZodObject<{
3596
- type: z.ZodLiteral<"error">;
3597
- code: z.ZodString;
3598
- message: z.ZodString;
3599
- }, z.core.$strict>, z.ZodObject<{
3600
- type: z.ZodLiteral<"file">;
3601
- file_id: z.ZodUUID;
3602
- name: z.ZodString;
3603
- media_type: z.ZodString;
3604
- size_bytes: z.ZodNumber;
3605
- }, z.core.$strict>], "type">>>;
3606
- occurred_at: z.ZodISODateTime;
3607
- identity: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3608
- schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
3609
- authority: z.ZodEnum<{
3610
- external: "external";
3611
- generic: "generic";
3612
- }>;
3613
- conversation_id: z.ZodUUID;
3614
- request_id: z.ZodUUID;
3615
- turn_id: z.ZodUUID;
3616
- request_fingerprint: z.ZodString;
3617
- event_id: z.ZodUUID;
3618
- message_id: z.ZodString;
3619
- sequence: z.ZodNumber;
3620
- revision: z.ZodNumber;
3621
- fact: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3622
- type: z.ZodLiteral<"intermediate">;
3623
- }, z.core.$strip>, z.ZodObject<{
3624
- type: z.ZodLiteral<"final_response">;
3625
- }, z.core.$strip>, z.ZodObject<{
3626
- type: z.ZodLiteral<"tool_only">;
3627
- }, z.core.$strip>, z.ZodObject<{
3628
- type: z.ZodLiteral<"activity_started">;
3629
- activity_id: z.ZodUUID;
3630
- kind: z.ZodEnum<{
3631
- tool: "tool";
3632
- attachment: "attachment";
3633
- workspace: "workspace";
3634
- retrieval: "retrieval";
3635
- }>;
3636
- label: z.ZodString;
3637
- started_at: z.ZodNullable<z.ZodISODateTime>;
3638
- action: z.ZodOptional<z.ZodString>;
3639
- subject: z.ZodOptional<z.ZodString>;
3640
- }, z.core.$strip>, z.ZodObject<{
3641
- type: z.ZodLiteral<"activity_finished">;
3642
- activity_id: z.ZodUUID;
3643
- ended_at: z.ZodNullable<z.ZodISODateTime>;
3644
- outcome: z.ZodEnum<{
3645
- completed: "completed";
3646
- failed: "failed";
3647
- canceled: "canceled";
3648
- interrupted: "interrupted";
3649
- }>;
3650
- }, z.core.$strip>, z.ZodObject<{
3651
- type: z.ZodLiteral<"turn_terminal">;
3652
- outcome: z.ZodEnum<{
3653
- completed: "completed";
3654
- failed: "failed";
3655
- canceled: "canceled";
3656
- interrupted: "interrupted";
3657
- lost: "lost";
3658
- }>;
3659
- reason: z.ZodOptional<z.ZodString>;
3660
- }, z.core.$strip>], "type">>;
3661
- }, z.core.$strip>>>;
3662
- }, z.core.$strip>>;
3663
- }, z.core.$strip>, z.ZodObject<{
3664
- type: z.ZodLiteral<"committed">;
3665
- conversation_id: z.ZodNullable<z.ZodUUID>;
3666
- turn_id: z.ZodNullable<z.ZodUUID>;
3667
- status: z.ZodEnum<{
3668
- message: "message";
3669
- completed: "completed";
3670
- failed: "failed";
3671
- canceled: "canceled";
3672
- interrupted: "interrupted";
3673
- lost: "lost";
3674
- legacy: "legacy";
3675
- }>;
3676
- last_seq: z.ZodNumber;
3677
- }, z.core.$strip>], "type">>;
3678
- }, z.core.$strip>;
3679
- ExportPage: z.ZodObject<{
3680
- items: z.ZodArray<z.ZodObject<{
2770
+ objects: z.ZodArray<z.ZodObject<{
3681
2771
  exportId: z.ZodUUID;
3682
2772
  sessionId: z.ZodUUID;
3683
2773
  requestId: z.ZodUUID;
@@ -3692,55 +2782,60 @@ declare const managedSchemas: {
3692
2782
  }>;
3693
2783
  availability: z.ZodEnum<{
3694
2784
  expired: "expired";
3695
- unavailable: "unavailable";
3696
2785
  published: "published";
2786
+ unavailable: "unavailable";
3697
2787
  }>;
3698
2788
  expiresAt: z.ZodISODateTime;
3699
2789
  }, z.core.$strict>>;
3700
- nextCursor: z.ZodNullable<z.ZodString>;
3701
- }, z.core.$strict>;
3702
- ServiceStart: z.ZodObject<{
3703
- startId: z.ZodUUID;
3704
- }, z.core.$strict>;
3705
- ServiceReceipt: z.ZodObject<{
3706
- workspaceId: z.ZodUUID;
3707
- incarnationId: z.ZodString;
3708
- name: z.ZodString;
3709
- startId: z.ZodNullable<z.ZodUUID>;
3710
- attemptId: z.ZodNullable<z.ZodUUID>;
3711
- state: z.ZodEnum<{
3712
- running: "running";
3713
- lost: "lost";
3714
- starting: "starting";
3715
- exited: "exited";
3716
- stopped: "stopped";
2790
+ errors: z.ZodArray<z.ZodString>;
2791
+ cleanupState: z.ZodEnum<{
2792
+ pending: "pending";
2793
+ complete: "complete";
2794
+ not_required: "not_required";
3717
2795
  }>;
3718
- pid: z.ZodNullable<z.ZodNumber>;
3719
- exitCode: z.ZodNullable<z.ZodNumber>;
3720
- listener: z.ZodEnum<{
3721
- unknown: "unknown";
3722
- healthy: "healthy";
3723
- unhealthy: "unhealthy";
2796
+ state: z.ZodLiteral<"settled">;
2797
+ completeness: z.ZodEnum<{
2798
+ complete: "complete";
2799
+ partial: "partial";
2800
+ lost: "lost";
3724
2801
  }>;
3725
- }, z.core.$strict>;
3726
- LifetimeExtension: z.ZodObject<{
3727
- extensionId: z.ZodUUID;
3728
- expectedRevision: z.ZodNumber;
3729
- deadlineAt: z.ZodISODateTime;
3730
- }, z.core.$strict>;
3731
- LifetimeReceipt: z.ZodObject<{
3732
- extensionId: z.ZodUUID;
3733
- expectedRevision: z.ZodNumber;
3734
- deadlineAt: z.ZodISODateTime;
3735
- workspaceId: z.ZodUUID;
3736
- revision: z.ZodNumber;
3737
- ceilingAt: z.ZodISODateTime;
3738
- }, z.core.$strict>;
3739
- QueueLimits: z.ZodObject<{
3740
- requests: z.ZodNumber;
3741
- bytes: z.ZodNumber;
3742
- }, z.core.$strict>;
3743
- };
2802
+ manifestDigest: z.ZodString;
2803
+ settledAt: z.ZodISODateTime;
2804
+ expiresAt: z.ZodISODateTime;
2805
+ }, z.core.$strict>]>;
2806
+ finalResponse: z.ZodNullable<z.ZodString>;
2807
+ state: z.ZodEnum<{
2808
+ running: "running";
2809
+ accepted: "accepted";
2810
+ waiting: "waiting";
2811
+ checking_outcome: "checking_outcome";
2812
+ }>;
2813
+ outcome: z.ZodNull;
2814
+ endedAt: z.ZodNull;
2815
+ }, z.core.$strict>]>;
2816
+ type Request = z.infer<typeof RequestSchema>;
2817
+ declare const CancelReceiptSchema: z.ZodUnion<readonly [z.ZodObject<{
2818
+ sessionId: z.ZodUUID;
2819
+ state: z.ZodEnum<{
2820
+ pending: "pending";
2821
+ completed: "completed";
2822
+ }>;
2823
+ acceptedAt: z.ZodISODateTime;
2824
+ completedAt: z.ZodNullable<z.ZodISODateTime>;
2825
+ scope: z.ZodLiteral<"request">;
2826
+ requestId: z.ZodUUID;
2827
+ }, z.core.$strict>, z.ZodObject<{
2828
+ sessionId: z.ZodUUID;
2829
+ state: z.ZodEnum<{
2830
+ pending: "pending";
2831
+ completed: "completed";
2832
+ }>;
2833
+ acceptedAt: z.ZodISODateTime;
2834
+ completedAt: z.ZodNullable<z.ZodISODateTime>;
2835
+ scope: z.ZodLiteral<"session">;
2836
+ requestId: z.ZodNull;
2837
+ }, z.core.$strict>]>;
2838
+ type CancelReceipt = z.infer<typeof CancelReceiptSchema>;
3744
2839
  //#endregion
3745
2840
  //#region ../contracts/src/sessions/states.d.ts
3746
2841
  declare const canTransitionRequest: (from: Request["state"], to: Request["state"]) => boolean;
@@ -3751,7 +2846,7 @@ declare const ManagedQueueLimitsSchema: z.ZodObject<{
3751
2846
  }, z.core.$strict>;
3752
2847
  type ManagedQueueLimits = z.infer<typeof ManagedQueueLimitsSchema>;
3753
2848
  declare namespace index_d_exports {
3754
- export { BudgetPolicy, BudgetPolicySchema, BudgetPolicyWrite, BudgetPolicyWriteSchema, BudgetUsage, BudgetUsageSchema, CancelCommand, CancelCommandSchema, CancelReceipt, CancelReceiptSchema, CleanupReceipt, CleanupReceiptSchema, CollectionResult, CollectionResultSchema, ErrorSchema, ExecutionProfile, ExecutionProfileSchema, ExportObject, ExportObjectSchema, HistoryPage, InputObject, InputObjectSchema, InputReference, InputReferenceSchema, InputUpload, InputUploadSchema, LifetimeExtension, LifetimeExtensionSchema, LifetimeReceipt, LifetimeReceiptSchema, LogicalRequestInput, LogicalRequestInputSchema, MANAGED_CONTRACT_REVISION, MANAGED_SESSION_METADATA, MAX_SESSION_FILE_REFERENCES, ManagedError, ManagedExportPageSchema, ManagedHistoryPageSchema, ManagedHistoryQuerySchema, ManagedQueueLimits, ManagedQueueLimitsSchema, Request, RequestInput, RequestInputSchema, RequestSchema, RuntimeEvent, RuntimeEventSchema, ServiceReceipt, ServiceReceiptSchema, ServiceStartSchema, Session, SessionCreate, SessionCreateSchema, SessionSchema, canTransitionRequest, canTransitionSession, fingerprintRequest, managedPlacement, managedSchemas };
2849
+ export { CancelReceipt, CancelReceiptSchema, CleanupReceipt, CleanupReceiptSchema, CollectionResult, CollectionResultSchema, ErrorSchema, ExportObject, ExportObjectSchema, HistoryPage, InputObject, InputObjectSchema, InputReference, InputReferenceSchema, InputUpload, InputUploadSchema, IssuerUrlSchema, LifetimeExtension, LifetimeExtensionSchema, LifetimeReceipt, LifetimeReceiptSchema, MANAGED_SESSION_METADATA, MAX_SESSION_FILE_REFERENCES, ManagedError, ManagedExportPageSchema, ManagedHistoryPageSchema, ManagedHistoryQuerySchema, ManagedQueueLimits, ManagedQueueLimitsSchema, ProfileConfig, ProfileConfigSchema, ProfileNameSchema, Request, RequestInput, RequestInputSchema, RequestSchema, RuntimeEvent, RuntimeEventSchema, ServiceReceipt, ServiceReceiptSchema, ServiceStartSchema, Session, SessionConversation, SessionConversationSchema, SessionCreate, SessionCreateSchema, SessionIssuer, SessionIssuerSchema, SessionMessage, SessionMessageSchema, SessionProfile, SessionProfileSchema, SessionSchema, canTransitionRequest, canTransitionSession, fingerprintRequest, managedPlacement };
3755
2850
  }
3756
2851
  //#endregion
3757
2852
  //#region ../contracts/src/templates/template-alpha-schema.d.ts
@@ -3903,11 +2998,11 @@ declare const TemplateManifestBaseSchema: z.ZodObject<{
3903
2998
  healthPath: z.ZodDefault<z.ZodString>;
3904
2999
  routes: z.ZodArray<z.ZodObject<{
3905
3000
  method: z.ZodEnum<{
3001
+ POST: "POST";
3002
+ PATCH: "PATCH";
3906
3003
  PUT: "PUT";
3907
3004
  DELETE: "DELETE";
3908
- POST: "POST";
3909
3005
  GET: "GET";
3910
- PATCH: "PATCH";
3911
3006
  }>;
3912
3007
  path: z.ZodString;
3913
3008
  query: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -3968,7 +3063,7 @@ declare function sessionTemplate(input: {
3968
3063
  required: string[];
3969
3064
  additionalProperties: false;
3970
3065
  };
3971
- requiredCapabilities: ("ready-without-task" | "live-inputs" | "immutable-inputs" | "serial-operations" | "retained-exports" | "explicit-start" | "exact-exit" | "targeted-cancel" | "stop-before-export" | "request-lookup" | "deduplicated-accept" | "explicit-publication" | "workspace-services" | "revocable-preview-grants" | "workspace-cancel" | "unknown-outcome" | "parallel-conversations")[];
3066
+ requiredCapabilities: ("ready-without-task" | "live-inputs" | "immutable-inputs" | "serial-operations" | "retained-exports" | "explicit-start" | "exact-exit" | "targeted-cancel" | "stop-before-export" | "request-lookup" | "deduplicated-accept" | "explicit-publication" | "workspace-services" | "revocable-preview-grants" | "workspace-cancel" | "unknown-outcome" | "parallel-conversations" | "history-seed")[];
3972
3067
  outputRoots: string[];
3973
3068
  }>;
3974
3069
  services: Record<string, {
@@ -3976,7 +3071,7 @@ declare function sessionTemplate(input: {
3976
3071
  required: boolean;
3977
3072
  healthPath: string;
3978
3073
  routes: {
3979
- method: "PUT" | "DELETE" | "POST" | "GET" | "PATCH";
3074
+ method: "POST" | "PATCH" | "PUT" | "DELETE" | "GET";
3980
3075
  path: string;
3981
3076
  query: string[];
3982
3077
  responseMode: "buffered" | "stream";
@@ -4142,6 +3237,7 @@ declare const WorkloadDeploymentSchema: z.ZodObject<{
4142
3237
  "workspace-cancel": "workspace-cancel";
4143
3238
  "unknown-outcome": "unknown-outcome";
4144
3239
  "parallel-conversations": "parallel-conversations";
3240
+ "history-seed": "history-seed";
4145
3241
  }>>;
4146
3242
  adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
4147
3243
  kind: z.ZodEnum<{
@@ -4169,6 +3265,7 @@ declare const WorkloadDeploymentSchema: z.ZodObject<{
4169
3265
  "workspace-cancel": "workspace-cancel";
4170
3266
  "unknown-outcome": "unknown-outcome";
4171
3267
  "parallel-conversations": "parallel-conversations";
3268
+ "history-seed": "history-seed";
4172
3269
  }>>;
4173
3270
  }, z.core.$strict>>;
4174
3271
  }, z.core.$strict>>;
@@ -4194,6 +3291,7 @@ declare const WorkloadCapabilitySchema: z.ZodEnum<{
4194
3291
  "workspace-cancel": "workspace-cancel";
4195
3292
  "unknown-outcome": "unknown-outcome";
4196
3293
  "parallel-conversations": "parallel-conversations";
3294
+ "history-seed": "history-seed";
4197
3295
  }>;
4198
3296
  type WorkloadCapability = z.infer<typeof WorkloadCapabilitySchema>;
4199
3297
  declare const WorkloadLimitsSchema: z.ZodObject<{
@@ -4243,6 +3341,7 @@ declare const InstalledWorkloadSchema: z.ZodObject<{
4243
3341
  "workspace-cancel": "workspace-cancel";
4244
3342
  "unknown-outcome": "unknown-outcome";
4245
3343
  "parallel-conversations": "parallel-conversations";
3344
+ "history-seed": "history-seed";
4246
3345
  }>>;
4247
3346
  adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
4248
3347
  kind: z.ZodEnum<{
@@ -4270,6 +3369,7 @@ declare const InstalledWorkloadSchema: z.ZodObject<{
4270
3369
  "workspace-cancel": "workspace-cancel";
4271
3370
  "unknown-outcome": "unknown-outcome";
4272
3371
  "parallel-conversations": "parallel-conversations";
3372
+ "history-seed": "history-seed";
4273
3373
  }>>;
4274
3374
  }, z.core.$strict>>;
4275
3375
  }, z.core.$strict>;
@@ -4286,8 +3386,8 @@ declare const ServerTerminalMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
4286
3386
  }, z.core.$strip>, z.ZodObject<{
4287
3387
  type: z.ZodLiteral<"closed">;
4288
3388
  reason: z.ZodEnum<{
4289
- idle: "idle";
4290
3389
  checkpoint: "checkpoint";
3390
+ idle: "idle";
4291
3391
  exit: "exit";
4292
3392
  workspace_ended: "workspace_ended";
4293
3393
  agent_detached: "agent_detached";
@@ -4308,8 +3408,8 @@ declare const TerminalSessionSchema: z.ZodObject<{
4308
3408
  closed_at: z.ZodNullable<z.ZodISODateTime>;
4309
3409
  duration_ms: z.ZodNullable<z.ZodNumber>;
4310
3410
  close_reason: z.ZodNullable<z.ZodEnum<{
4311
- idle: "idle";
4312
3411
  checkpoint: "checkpoint";
3412
+ idle: "idle";
4313
3413
  exit: "exit";
4314
3414
  workspace_ended: "workspace_ended";
4315
3415
  agent_detached: "agent_detached";
@@ -4337,8 +3437,8 @@ declare const WorkspaceRequestSchema: z.ZodObject<{
4337
3437
  sizeBytes: z.ZodNumber;
4338
3438
  digest: z.ZodString;
4339
3439
  visibility: z.ZodEnum<{
4340
- expired: "expired";
4341
3440
  ready: "ready";
3441
+ expired: "expired";
4342
3442
  unavailable: "unavailable";
4343
3443
  }>;
4344
3444
  }, z.core.$strict>>;
@@ -4385,8 +3485,8 @@ declare const WorkloadAcceptanceSchema: z.ZodObject<{
4385
3485
  sizeBytes: z.ZodNumber;
4386
3486
  digest: z.ZodString;
4387
3487
  visibility: z.ZodEnum<{
4388
- expired: "expired";
4389
3488
  ready: "ready";
3489
+ expired: "expired";
4390
3490
  unavailable: "unavailable";
4391
3491
  }>;
4392
3492
  }, z.core.$strict>>;
@@ -4444,8 +3544,8 @@ declare const ExecutionRecordSchema: z.ZodObject<{
4444
3544
  sizeBytes: z.ZodNumber;
4445
3545
  digest: z.ZodString;
4446
3546
  visibility: z.ZodEnum<{
4447
- expired: "expired";
4448
3547
  ready: "ready";
3548
+ expired: "expired";
4449
3549
  unavailable: "unavailable";
4450
3550
  }>;
4451
3551
  }, z.core.$strict>>;
@@ -4453,6 +3553,13 @@ declare const ExecutionRecordSchema: z.ZodObject<{
4453
3553
  bindingSetDigest: z.ZodString;
4454
3554
  fingerprint: z.ZodString;
4455
3555
  }, z.core.$strict>;
3556
+ priorMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
3557
+ role: z.ZodEnum<{
3558
+ user: "user";
3559
+ assistant: "assistant";
3560
+ }>;
3561
+ content: z.ZodString;
3562
+ }, z.core.$strip>>>;
4456
3563
  conversationIdentity: z.ZodNullable<z.ZodObject<{
4457
3564
  schema: z.ZodLiteral<"pocketcoder.conversation/v2">;
4458
3565
  authority: z.ZodEnum<{
@@ -4502,9 +3609,9 @@ declare const ExecutionRecordSchema: z.ZodObject<{
4502
3609
  }, z.core.$strict>;
4503
3610
  manifestDigest: z.ZodString;
4504
3611
  completeness: z.ZodEnum<{
4505
- lost: "lost";
4506
3612
  complete: "complete";
4507
3613
  partial: "partial";
3614
+ lost: "lost";
4508
3615
  }>;
4509
3616
  cleanupState: z.ZodOptional<z.ZodEnum<{
4510
3617
  pending: "pending";
@@ -4513,8 +3620,8 @@ declare const ExecutionRecordSchema: z.ZodObject<{
4513
3620
  }>>;
4514
3621
  publication: z.ZodEnum<{
4515
3622
  expired: "expired";
4516
- unavailable: "unavailable";
4517
3623
  published: "published";
3624
+ unavailable: "unavailable";
4518
3625
  }>;
4519
3626
  objects: z.ZodArray<z.ZodObject<{
4520
3627
  objectId: z.ZodUUID;
@@ -4608,57 +3715,6 @@ declare class AttachmentsApi {
4608
3715
  upload(workspaceId: string, input: AttachmentUploadInput): Promise<InputObjectReference>;
4609
3716
  }
4610
3717
  //#endregion
4611
- //#region src/resources/budgets/budgets.d.ts
4612
- type BudgetScopeGrant = z.infer<typeof managedSchemas.BudgetScopeGrant>;
4613
- type CredentialBinding = z.infer<typeof managedSchemas.CredentialBinding>;
4614
- declare class ManagedAuthorityApi {
4615
- private readonly transport;
4616
- constructor(transport: PocketCoderTransport);
4617
- grantScope(scopeId: string, grant: BudgetScopeGrant, options?: RequestOptions): Promise<void>;
4618
- putPolicy(policy: BudgetPolicyWrite, expectedRevision: number | null, options?: RequestOptions): Promise<{
4619
- scopeId: string;
4620
- revision: number;
4621
- period: "utc_day" | "utc_month";
4622
- limits: {
4623
- workspaceStarts: number | null;
4624
- maxActiveWorkspaces: number | null;
4625
- maxRunningRequestsPerSession: 1;
4626
- maxChatProcessesPerWorkspace: number;
4627
- };
4628
- effectiveAt: string;
4629
- }>;
4630
- getPolicy(scopeId: string, options?: RequestOptions): Promise<{
4631
- scopeId: string;
4632
- revision: number;
4633
- period: "utc_day" | "utc_month";
4634
- limits: {
4635
- workspaceStarts: number | null;
4636
- maxActiveWorkspaces: number | null;
4637
- maxRunningRequestsPerSession: 1;
4638
- maxChatProcessesPerWorkspace: number;
4639
- };
4640
- effectiveAt: string;
4641
- }>;
4642
- usage(scopeId: string, options?: RequestOptions): Promise<{
4643
- scopeId: string;
4644
- policyRevision: number;
4645
- periodStart: string;
4646
- periodEnd: string;
4647
- workspaceStarts: number;
4648
- activeWorkspaces: number;
4649
- asOf: string;
4650
- }>;
4651
- putProfile(principalId: string, profile: ExecutionProfile, options?: RequestOptions): Promise<{
4652
- profileId: string;
4653
- revision: number;
4654
- isolationScopeId: string;
4655
- budgetScopeIds: string[];
4656
- templateDigest: string;
4657
- credentialBindingId: string | null;
4658
- }>;
4659
- putCredentialBinding(binding: CredentialBinding, options?: RequestOptions): Promise<void>;
4660
- }
4661
- //#endregion
4662
3718
  //#region src/transport/common.d.ts
4663
3719
  interface Page<T> {
4664
3720
  items: T[];
@@ -4678,7 +3734,7 @@ declare class CheckpointsApi {
4678
3734
  }, options?: RequestOptions): Promise<Page<{
4679
3735
  id: string;
4680
3736
  workspace_id: string;
4681
- state: "deleted" | "failed" | "ready" | "creating" | "deleting";
3737
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
4682
3738
  reason_code: string | null;
4683
3739
  template: {
4684
3740
  name: string;
@@ -4699,7 +3755,7 @@ declare class CheckpointsApi {
4699
3755
  get(id: string, options?: RequestOptions): Promise<{
4700
3756
  id: string;
4701
3757
  workspace_id: string;
4702
- state: "deleted" | "failed" | "ready" | "creating" | "deleting";
3758
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
4703
3759
  reason_code: string | null;
4704
3760
  template: {
4705
3761
  name: string;
@@ -4720,7 +3776,7 @@ declare class CheckpointsApi {
4720
3776
  verify(id: string, key: string, options?: RequestOptions): Promise<{
4721
3777
  id: string;
4722
3778
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
4723
- state: "pending" | "running" | "failed" | "succeeded";
3779
+ state: "failed" | "pending" | "running" | "succeeded";
4724
3780
  workspace_id: string | null;
4725
3781
  checkpoint_id: string | null;
4726
3782
  result_workspace_id: string | null;
@@ -4732,7 +3788,7 @@ declare class CheckpointsApi {
4732
3788
  delete(id: string, key: string, options?: RequestOptions): Promise<{
4733
3789
  id: string;
4734
3790
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
4735
- state: "pending" | "running" | "failed" | "succeeded";
3791
+ state: "failed" | "pending" | "running" | "succeeded";
4736
3792
  workspace_id: string | null;
4737
3793
  checkpoint_id: string | null;
4738
3794
  result_workspace_id: string | null;
@@ -4750,14 +3806,14 @@ declare class CheckpointsApi {
4750
3806
  version: string;
4751
3807
  digest: string;
4752
3808
  };
4753
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
3809
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
4754
3810
  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" | "launch_refused" | "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;
4755
3811
  agent_state: "unknown" | "running" | "stable";
4756
3812
  change_cursor: number;
4757
3813
  provider_kind: string | null;
4758
3814
  provisioning_mode: "cold" | "warm" | null;
4759
3815
  network: {
4760
- state: "ready" | "disabled" | "starting" | "degraded";
3816
+ state: "disabled" | "ready" | "starting" | "degraded";
4761
3817
  };
4762
3818
  health: Record<string, string>;
4763
3819
  created_at: string;
@@ -4799,7 +3855,7 @@ declare class CheckpointsApi {
4799
3855
  operation: {
4800
3856
  id: string;
4801
3857
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
4802
- state: "pending" | "running" | "failed" | "succeeded";
3858
+ state: "failed" | "pending" | "running" | "succeeded";
4803
3859
  workspace_id: string | null;
4804
3860
  checkpoint_id: string | null;
4805
3861
  result_workspace_id: string | null;
@@ -4817,7 +3873,7 @@ declare class OperationsApi {
4817
3873
  get(id: string, options?: RequestOptions): Promise<{
4818
3874
  id: string;
4819
3875
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
4820
- state: "pending" | "running" | "failed" | "succeeded";
3876
+ state: "failed" | "pending" | "running" | "succeeded";
4821
3877
  workspace_id: string | null;
4822
3878
  checkpoint_id: string | null;
4823
3879
  result_workspace_id: string | null;
@@ -4871,7 +3927,7 @@ declare class ConversationsApi {
4871
3927
  } | {
4872
3928
  type: "activity_started";
4873
3929
  activity_id: string;
4874
- kind: "tool" | "attachment" | "workspace" | "retrieval";
3930
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
4875
3931
  label: string;
4876
3932
  started_at: string | null;
4877
3933
  action?: string | undefined;
@@ -4880,10 +3936,10 @@ declare class ConversationsApi {
4880
3936
  type: "activity_finished";
4881
3937
  activity_id: string;
4882
3938
  ended_at: string | null;
4883
- outcome: "completed" | "failed" | "canceled" | "interrupted";
3939
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
4884
3940
  } | {
4885
3941
  type: "turn_terminal";
4886
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
3942
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
4887
3943
  reason?: string | undefined;
4888
3944
  } | undefined;
4889
3945
  } | null;
@@ -4894,7 +3950,7 @@ declare class ConversationsApi {
4894
3950
  type: "tool";
4895
3951
  call_id: string;
4896
3952
  name: string;
4897
- status: "pending" | "running" | "completed" | "failed" | "canceled";
3953
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
4898
3954
  input: z.core.util.JSONType;
4899
3955
  output?: z.core.util.JSONType | undefined;
4900
3956
  output_text?: string | undefined;
@@ -4930,7 +3986,7 @@ declare class ConversationsApi {
4930
3986
  conversation_id: string | null;
4931
3987
  workspace_id: string;
4932
3988
  legacy: boolean;
4933
- status: "deleted" | "retained" | "expired";
3989
+ status: "deleted" | "expired" | "retained";
4934
3990
  message_count: number;
4935
3991
  turn_count: number;
4936
3992
  last_activity_at: string;
@@ -4941,7 +3997,7 @@ declare class ConversationsApi {
4941
3997
  conversation_id: string | null;
4942
3998
  workspace_id: string;
4943
3999
  legacy: boolean;
4944
- status: "deleted" | "retained" | "expired";
4000
+ status: "deleted" | "expired" | "retained";
4945
4001
  message_count: number;
4946
4002
  turn_count: number;
4947
4003
  last_activity_at: string;
@@ -4979,7 +4035,7 @@ declare class ConversationsApi {
4979
4035
  } | {
4980
4036
  type: "activity_started";
4981
4037
  activity_id: string;
4982
- kind: "tool" | "attachment" | "workspace" | "retrieval";
4038
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
4983
4039
  label: string;
4984
4040
  started_at: string | null;
4985
4041
  action?: string | undefined;
@@ -4988,10 +4044,10 @@ declare class ConversationsApi {
4988
4044
  type: "activity_finished";
4989
4045
  activity_id: string;
4990
4046
  ended_at: string | null;
4991
- outcome: "completed" | "failed" | "canceled" | "interrupted";
4047
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
4992
4048
  } | {
4993
4049
  type: "turn_terminal";
4994
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
4050
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
4995
4051
  reason?: string | undefined;
4996
4052
  } | undefined;
4997
4053
  } | null;
@@ -5002,7 +4058,7 @@ declare class ConversationsApi {
5002
4058
  type: "tool";
5003
4059
  call_id: string;
5004
4060
  name: string;
5005
- status: "pending" | "running" | "completed" | "failed" | "canceled";
4061
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
5006
4062
  input: z.core.util.JSONType;
5007
4063
  output?: z.core.util.JSONType | undefined;
5008
4064
  output_text?: string | undefined;
@@ -5056,7 +4112,7 @@ declare class ConversationsApi {
5056
4112
  } | {
5057
4113
  type: "activity_started";
5058
4114
  activity_id: string;
5059
- kind: "tool" | "attachment" | "workspace" | "retrieval";
4115
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
5060
4116
  label: string;
5061
4117
  started_at: string | null;
5062
4118
  action?: string | undefined;
@@ -5065,10 +4121,10 @@ declare class ConversationsApi {
5065
4121
  type: "activity_finished";
5066
4122
  activity_id: string;
5067
4123
  ended_at: string | null;
5068
- outcome: "completed" | "failed" | "canceled" | "interrupted";
4124
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
5069
4125
  } | {
5070
4126
  type: "turn_terminal";
5071
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
4127
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
5072
4128
  reason?: string | undefined;
5073
4129
  } | undefined;
5074
4130
  } | null;
@@ -5079,7 +4135,7 @@ declare class ConversationsApi {
5079
4135
  type: "tool";
5080
4136
  call_id: string;
5081
4137
  name: string;
5082
- status: "pending" | "running" | "completed" | "failed" | "canceled";
4138
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
5083
4139
  input: z.core.util.JSONType;
5084
4140
  output?: z.core.util.JSONType | undefined;
5085
4141
  output_text?: string | undefined;
@@ -5101,7 +4157,7 @@ declare class ConversationsApi {
5101
4157
  type: "committed";
5102
4158
  conversation_id: string | null;
5103
4159
  turn_id: string | null;
5104
- status: "message" | "completed" | "failed" | "canceled" | "interrupted" | "lost" | "legacy";
4160
+ status: "message" | "failed" | "canceled" | "completed" | "interrupted" | "lost" | "legacy";
5105
4161
  last_seq: number;
5106
4162
  }, void, any>;
5107
4163
  open(id: string, options?: RequestOptions & {
@@ -5137,7 +4193,7 @@ declare class ConversationsApi {
5137
4193
  } | {
5138
4194
  type: "activity_started";
5139
4195
  activity_id: string;
5140
- kind: "tool" | "attachment" | "workspace" | "retrieval";
4196
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
5141
4197
  label: string;
5142
4198
  started_at: string | null;
5143
4199
  action?: string | undefined;
@@ -5146,10 +4202,10 @@ declare class ConversationsApi {
5146
4202
  type: "activity_finished";
5147
4203
  activity_id: string;
5148
4204
  ended_at: string | null;
5149
- outcome: "completed" | "failed" | "canceled" | "interrupted";
4205
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
5150
4206
  } | {
5151
4207
  type: "turn_terminal";
5152
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
4208
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
5153
4209
  reason?: string | undefined;
5154
4210
  } | undefined;
5155
4211
  } | null;
@@ -5160,7 +4216,7 @@ declare class ConversationsApi {
5160
4216
  type: "tool";
5161
4217
  call_id: string;
5162
4218
  name: string;
5163
- status: "pending" | "running" | "completed" | "failed" | "canceled";
4219
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
5164
4220
  input: z.core.util.JSONType;
5165
4221
  output?: z.core.util.JSONType | undefined;
5166
4222
  output_text?: string | undefined;
@@ -5182,7 +4238,7 @@ declare class ConversationsApi {
5182
4238
  type: "committed";
5183
4239
  conversation_id: string | null;
5184
4240
  turn_id: string | null;
5185
- status: "message" | "completed" | "failed" | "canceled" | "interrupted" | "lost" | "legacy";
4241
+ status: "message" | "failed" | "canceled" | "completed" | "interrupted" | "lost" | "legacy";
5186
4242
  last_seq: number;
5187
4243
  })[];
5188
4244
  }>;
@@ -5217,7 +4273,7 @@ declare class WorkspaceRequestsApi {
5217
4273
  mediaType: string;
5218
4274
  sizeBytes: number;
5219
4275
  digest: string;
5220
- visibility: "expired" | "ready" | "unavailable";
4276
+ visibility: "ready" | "expired" | "unavailable";
5221
4277
  storageOwnerId?: string | undefined;
5222
4278
  }[];
5223
4279
  };
@@ -5243,6 +4299,10 @@ declare class WorkspaceRequestsApi {
5243
4299
  settledAt: string | null;
5244
4300
  acknowledgedAt: string | null;
5245
4301
  finalizedAt: string | null;
4302
+ priorMessages?: {
4303
+ role: "user" | "assistant";
4304
+ content: string;
4305
+ }[] | undefined;
5246
4306
  producerSendClaimedAt?: string | undefined;
5247
4307
  finalizationBasis?: "never_sent" | "producer_acknowledged" | "runtime_fenced" | undefined;
5248
4308
  collection?: {
@@ -5254,8 +4314,8 @@ declare class WorkspaceRequestsApi {
5254
4314
  requestId: string;
5255
4315
  };
5256
4316
  manifestDigest: string;
5257
- completeness: "lost" | "complete" | "partial";
5258
- publication: "expired" | "unavailable" | "published";
4317
+ completeness: "complete" | "partial" | "lost";
4318
+ publication: "expired" | "published" | "unavailable";
5259
4319
  objects: {
5260
4320
  objectId: string;
5261
4321
  objectVersion: string;
@@ -5296,7 +4356,7 @@ declare class WorkspaceRequestsApi {
5296
4356
  mediaType: string;
5297
4357
  sizeBytes: number;
5298
4358
  digest: string;
5299
- visibility: "expired" | "ready" | "unavailable";
4359
+ visibility: "ready" | "expired" | "unavailable";
5300
4360
  storageOwnerId?: string | undefined;
5301
4361
  }[];
5302
4362
  };
@@ -5322,6 +4382,10 @@ declare class WorkspaceRequestsApi {
5322
4382
  settledAt: string | null;
5323
4383
  acknowledgedAt: string | null;
5324
4384
  finalizedAt: string | null;
4385
+ priorMessages?: {
4386
+ role: "user" | "assistant";
4387
+ content: string;
4388
+ }[] | undefined;
5325
4389
  producerSendClaimedAt?: string | undefined;
5326
4390
  finalizationBasis?: "never_sent" | "producer_acknowledged" | "runtime_fenced" | undefined;
5327
4391
  collection?: {
@@ -5333,8 +4397,8 @@ declare class WorkspaceRequestsApi {
5333
4397
  requestId: string;
5334
4398
  };
5335
4399
  manifestDigest: string;
5336
- completeness: "lost" | "complete" | "partial";
5337
- publication: "expired" | "unavailable" | "published";
4400
+ completeness: "complete" | "partial" | "lost";
4401
+ publication: "expired" | "published" | "unavailable";
5338
4402
  objects: {
5339
4403
  objectId: string;
5340
4404
  objectVersion: string;
@@ -5380,7 +4444,7 @@ declare class WorkspaceRequestsApi {
5380
4444
  mediaType: string;
5381
4445
  sizeBytes: number;
5382
4446
  digest: string;
5383
- visibility: "expired" | "ready" | "unavailable";
4447
+ visibility: "ready" | "expired" | "unavailable";
5384
4448
  storageOwnerId?: string | undefined;
5385
4449
  }[];
5386
4450
  };
@@ -5406,6 +4470,10 @@ declare class WorkspaceRequestsApi {
5406
4470
  settledAt: string | null;
5407
4471
  acknowledgedAt: string | null;
5408
4472
  finalizedAt: string | null;
4473
+ priorMessages?: {
4474
+ role: "user" | "assistant";
4475
+ content: string;
4476
+ }[] | undefined;
5409
4477
  producerSendClaimedAt?: string | undefined;
5410
4478
  finalizationBasis?: "never_sent" | "producer_acknowledged" | "runtime_fenced" | undefined;
5411
4479
  collection?: {
@@ -5417,8 +4485,8 @@ declare class WorkspaceRequestsApi {
5417
4485
  requestId: string;
5418
4486
  };
5419
4487
  manifestDigest: string;
5420
- completeness: "lost" | "complete" | "partial";
5421
- publication: "expired" | "unavailable" | "published";
4488
+ completeness: "complete" | "partial" | "lost";
4489
+ publication: "expired" | "published" | "unavailable";
5422
4490
  objects: {
5423
4491
  objectId: string;
5424
4492
  objectVersion: string;
@@ -5461,7 +4529,7 @@ declare class WorkspaceRequestsApi {
5461
4529
  mediaType: string;
5462
4530
  sizeBytes: number;
5463
4531
  digest: string;
5464
- visibility: "expired" | "ready" | "unavailable";
4532
+ visibility: "ready" | "expired" | "unavailable";
5465
4533
  storageOwnerId?: string | undefined;
5466
4534
  }[];
5467
4535
  };
@@ -5487,6 +4555,10 @@ declare class WorkspaceRequestsApi {
5487
4555
  settledAt: string | null;
5488
4556
  acknowledgedAt: string | null;
5489
4557
  finalizedAt: string | null;
4558
+ priorMessages?: {
4559
+ role: "user" | "assistant";
4560
+ content: string;
4561
+ }[] | undefined;
5490
4562
  producerSendClaimedAt?: string | undefined;
5491
4563
  finalizationBasis?: "never_sent" | "producer_acknowledged" | "runtime_fenced" | undefined;
5492
4564
  collection?: {
@@ -5498,8 +4570,8 @@ declare class WorkspaceRequestsApi {
5498
4570
  requestId: string;
5499
4571
  };
5500
4572
  manifestDigest: string;
5501
- completeness: "lost" | "complete" | "partial";
5502
- publication: "expired" | "unavailable" | "published";
4573
+ completeness: "complete" | "partial" | "lost";
4574
+ publication: "expired" | "published" | "unavailable";
5503
4575
  objects: {
5504
4576
  objectId: string;
5505
4577
  objectVersion: string;
@@ -5667,7 +4739,7 @@ declare class RecoveryApi {
5667
4739
  purge(principalId: string, workspaceId: string, executionKey: string, options?: RequestOptions): Promise<{
5668
4740
  id: string;
5669
4741
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
5670
- state: "pending" | "running" | "failed" | "succeeded";
4742
+ state: "failed" | "pending" | "running" | "succeeded";
5671
4743
  workspace_id: string | null;
5672
4744
  checkpoint_id: string | null;
5673
4745
  result_workspace_id: string | null;
@@ -5679,7 +4751,7 @@ declare class RecoveryApi {
5679
4751
  operation(principalId: string, operationId: string, options?: RequestOptions): Promise<{
5680
4752
  id: string;
5681
4753
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
5682
- state: "pending" | "running" | "failed" | "succeeded";
4754
+ state: "failed" | "pending" | "running" | "succeeded";
5683
4755
  workspace_id: string | null;
5684
4756
  checkpoint_id: string | null;
5685
4757
  result_workspace_id: string | null;
@@ -5775,36 +4847,10 @@ declare class SecretsApi {
5775
4847
  declare class SessionFilesApi {
5776
4848
  private readonly transport;
5777
4849
  constructor(transport: PocketCoderTransport);
5778
- register(sessionId: string, input: InputUpload, options?: RequestOptions): Promise<{
5779
- sessionId: string;
5780
- reference: {
5781
- inputId: string;
5782
- versionId: string;
5783
- sha256: string;
5784
- name: string;
5785
- mediaType: string;
5786
- sizeBytes: number;
5787
- };
5788
- state: "expired" | "ready" | "uploading" | "rejected";
5789
- expiresAt: string;
5790
- }>;
5791
- upload(sessionId: string, inputId: string, bytes: Uint8Array, options?: RequestOptions): Promise<{
5792
- sessionId: string;
5793
- reference: {
5794
- inputId: string;
5795
- versionId: string;
5796
- sha256: string;
5797
- name: string;
5798
- mediaType: string;
5799
- sizeBytes: number;
5800
- };
5801
- state: "expired" | "ready" | "uploading" | "rejected";
5802
- expiresAt: string;
5803
- }>;
5804
4850
  put(sessionId: string, file: {
5805
4851
  inputId: string;
5806
4852
  name: string;
5807
- mediaType: InputUpload["mediaType"];
4853
+ mediaType: string;
5808
4854
  bytes: Uint8Array;
5809
4855
  }, options?: RequestOptions): Promise<{
5810
4856
  sessionId: string;
@@ -5816,7 +4862,7 @@ declare class SessionFilesApi {
5816
4862
  mediaType: string;
5817
4863
  sizeBytes: number;
5818
4864
  };
5819
- state: "expired" | "ready" | "uploading" | "rejected";
4865
+ state: "ready" | "expired" | "uploading" | "rejected";
5820
4866
  expiresAt: string;
5821
4867
  }>;
5822
4868
  get(sessionId: string, inputId: string, options?: RequestOptions): Promise<{
@@ -5829,7 +4875,7 @@ declare class SessionFilesApi {
5829
4875
  mediaType: string;
5830
4876
  sizeBytes: number;
5831
4877
  };
5832
- state: "expired" | "ready" | "uploading" | "rejected";
4878
+ state: "ready" | "expired" | "uploading" | "rejected";
5833
4879
  expiresAt: string;
5834
4880
  }>;
5835
4881
  exports(sessionId: string, requestId: string, options?: RequestOptions): Promise<{
@@ -5843,7 +4889,7 @@ declare class SessionFilesApi {
5843
4889
  mediaType: string;
5844
4890
  sizeBytes: number;
5845
4891
  completeness: "complete" | "partial";
5846
- availability: "expired" | "unavailable" | "published";
4892
+ availability: "expired" | "published" | "unavailable";
5847
4893
  expiresAt: string;
5848
4894
  }[];
5849
4895
  nextCursor: string | null;
@@ -5851,6 +4897,25 @@ declare class SessionFilesApi {
5851
4897
  content(sessionId: string, exportId: string, options?: RequestOptions): Promise<Uint8Array<ArrayBuffer>>;
5852
4898
  }
5853
4899
  //#endregion
4900
+ //#region src/resources/sessions/profiles.d.ts
4901
+ declare class SessionProfilesApi {
4902
+ private readonly transport;
4903
+ constructor(transport: PocketCoderTransport);
4904
+ get(name: string, options?: RequestOptions): Promise<{
4905
+ template: string;
4906
+ placement: "exclusive" | "shared";
4907
+ limits: {
4908
+ workspacesPerOwner: number;
4909
+ sessionsPerWorkspace: number;
4910
+ };
4911
+ dispatchDeadlineSeconds: number;
4912
+ name: string;
4913
+ templateVersion: string | null;
4914
+ disabled: boolean;
4915
+ issuer?: string | undefined;
4916
+ }>;
4917
+ }
4918
+ //#endregion
5854
4919
  //#region src/resources/sessions/requests.d.ts
5855
4920
  declare class SessionRequestsApi {
5856
4921
  private readonly transport;
@@ -5880,7 +4945,7 @@ declare class SessionRequestsApi {
5880
4945
  mediaType: string;
5881
4946
  sizeBytes: number;
5882
4947
  completeness: "complete" | "partial";
5883
- availability: "expired" | "unavailable" | "published";
4948
+ availability: "expired" | "published" | "unavailable";
5884
4949
  expiresAt: string;
5885
4950
  }[];
5886
4951
  errors: string[];
@@ -5904,20 +4969,20 @@ declare class SessionRequestsApi {
5904
4969
  mediaType: string;
5905
4970
  sizeBytes: number;
5906
4971
  completeness: "complete" | "partial";
5907
- availability: "expired" | "unavailable" | "published";
4972
+ availability: "expired" | "published" | "unavailable";
5908
4973
  expiresAt: string;
5909
4974
  }[];
5910
4975
  errors: string[];
5911
4976
  cleanupState: "pending" | "complete" | "not_required";
5912
4977
  state: "settled";
5913
- completeness: "lost" | "complete" | "partial";
4978
+ completeness: "complete" | "partial" | "lost";
5914
4979
  manifestDigest: string;
5915
4980
  settledAt: string;
5916
4981
  expiresAt: string;
5917
4982
  };
5918
4983
  finalResponse: string | null;
5919
4984
  state: "terminal";
5920
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
4985
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
5921
4986
  } | {
5922
4987
  sessionId: string;
5923
4988
  requestId: string;
@@ -5942,7 +5007,7 @@ declare class SessionRequestsApi {
5942
5007
  mediaType: string;
5943
5008
  sizeBytes: number;
5944
5009
  completeness: "complete" | "partial";
5945
- availability: "expired" | "unavailable" | "published";
5010
+ availability: "expired" | "published" | "unavailable";
5946
5011
  expiresAt: string;
5947
5012
  }[];
5948
5013
  errors: string[];
@@ -5966,13 +5031,13 @@ declare class SessionRequestsApi {
5966
5031
  mediaType: string;
5967
5032
  sizeBytes: number;
5968
5033
  completeness: "complete" | "partial";
5969
- availability: "expired" | "unavailable" | "published";
5034
+ availability: "expired" | "published" | "unavailable";
5970
5035
  expiresAt: string;
5971
5036
  }[];
5972
5037
  errors: string[];
5973
5038
  cleanupState: "pending" | "complete" | "not_required";
5974
5039
  state: "settled";
5975
- completeness: "lost" | "complete" | "partial";
5040
+ completeness: "complete" | "partial" | "lost";
5976
5041
  manifestDigest: string;
5977
5042
  settledAt: string;
5978
5043
  expiresAt: string;
@@ -6007,7 +5072,7 @@ declare class SessionRequestsApi {
6007
5072
  mediaType: string;
6008
5073
  sizeBytes: number;
6009
5074
  completeness: "complete" | "partial";
6010
- availability: "expired" | "unavailable" | "published";
5075
+ availability: "expired" | "published" | "unavailable";
6011
5076
  expiresAt: string;
6012
5077
  }[];
6013
5078
  errors: string[];
@@ -6031,20 +5096,20 @@ declare class SessionRequestsApi {
6031
5096
  mediaType: string;
6032
5097
  sizeBytes: number;
6033
5098
  completeness: "complete" | "partial";
6034
- availability: "expired" | "unavailable" | "published";
5099
+ availability: "expired" | "published" | "unavailable";
6035
5100
  expiresAt: string;
6036
5101
  }[];
6037
5102
  errors: string[];
6038
5103
  cleanupState: "pending" | "complete" | "not_required";
6039
5104
  state: "settled";
6040
- completeness: "lost" | "complete" | "partial";
5105
+ completeness: "complete" | "partial" | "lost";
6041
5106
  manifestDigest: string;
6042
5107
  settledAt: string;
6043
5108
  expiresAt: string;
6044
5109
  };
6045
5110
  finalResponse: string | null;
6046
5111
  state: "terminal";
6047
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
5112
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
6048
5113
  } | {
6049
5114
  sessionId: string;
6050
5115
  requestId: string;
@@ -6069,7 +5134,7 @@ declare class SessionRequestsApi {
6069
5134
  mediaType: string;
6070
5135
  sizeBytes: number;
6071
5136
  completeness: "complete" | "partial";
6072
- availability: "expired" | "unavailable" | "published";
5137
+ availability: "expired" | "published" | "unavailable";
6073
5138
  expiresAt: string;
6074
5139
  }[];
6075
5140
  errors: string[];
@@ -6083,169 +5148,381 @@ declare class SessionRequestsApi {
6083
5148
  sessionId: string;
6084
5149
  requestId: string;
6085
5150
  revision: number;
6086
- objects: {
6087
- exportId: string;
5151
+ objects: {
5152
+ exportId: string;
5153
+ sessionId: string;
5154
+ requestId: string;
5155
+ versionId: string;
5156
+ sha256: string;
5157
+ name: string;
5158
+ mediaType: string;
5159
+ sizeBytes: number;
5160
+ completeness: "complete" | "partial";
5161
+ availability: "expired" | "published" | "unavailable";
5162
+ expiresAt: string;
5163
+ }[];
5164
+ errors: string[];
5165
+ cleanupState: "pending" | "complete" | "not_required";
5166
+ state: "settled";
5167
+ completeness: "complete" | "partial" | "lost";
5168
+ manifestDigest: string;
5169
+ settledAt: string;
5170
+ expiresAt: string;
5171
+ };
5172
+ finalResponse: string | null;
5173
+ state: "running" | "accepted" | "waiting" | "checking_outcome";
5174
+ outcome: null;
5175
+ endedAt: null;
5176
+ }>;
5177
+ cancel(sessionId: string, requestId: string, options?: RequestOptions): Promise<{
5178
+ sessionId: string;
5179
+ state: "pending" | "completed";
5180
+ acceptedAt: string;
5181
+ completedAt: string | null;
5182
+ scope: "request";
5183
+ requestId: string;
5184
+ } | {
5185
+ sessionId: string;
5186
+ state: "pending" | "completed";
5187
+ acceptedAt: string;
5188
+ completedAt: string | null;
5189
+ scope: "session";
5190
+ requestId: null;
5191
+ }>;
5192
+ collection(sessionId: string, requestId: string, options?: RequestOptions): Promise<{
5193
+ sessionId: string;
5194
+ requestId: string;
5195
+ revision: number;
5196
+ objects: {
5197
+ exportId: string;
5198
+ sessionId: string;
5199
+ requestId: string;
5200
+ versionId: string;
5201
+ sha256: string;
5202
+ name: string;
5203
+ mediaType: string;
5204
+ sizeBytes: number;
5205
+ completeness: "complete" | "partial";
5206
+ availability: "expired" | "published" | "unavailable";
5207
+ expiresAt: string;
5208
+ }[];
5209
+ errors: string[];
5210
+ cleanupState: "pending" | "complete" | "not_required";
5211
+ state: "pending" | "finalizing";
5212
+ completeness: null;
5213
+ manifestDigest: null;
5214
+ settledAt: null;
5215
+ expiresAt: null;
5216
+ } | {
5217
+ sessionId: string;
5218
+ requestId: string;
5219
+ revision: number;
5220
+ objects: {
5221
+ exportId: string;
5222
+ sessionId: string;
5223
+ requestId: string;
5224
+ versionId: string;
5225
+ sha256: string;
5226
+ name: string;
5227
+ mediaType: string;
5228
+ sizeBytes: number;
5229
+ completeness: "complete" | "partial";
5230
+ availability: "expired" | "published" | "unavailable";
5231
+ expiresAt: string;
5232
+ }[];
5233
+ errors: string[];
5234
+ cleanupState: "pending" | "complete" | "not_required";
5235
+ state: "settled";
5236
+ completeness: "complete" | "partial" | "lost";
5237
+ manifestDigest: string;
5238
+ settledAt: string;
5239
+ expiresAt: string;
5240
+ }>;
5241
+ }
5242
+ //#endregion
5243
+ //#region src/resources/sessions/events.d.ts
5244
+ interface SessionEventOptions {
5245
+ after?: string;
5246
+ signal?: AbortSignal;
5247
+ reconnect?: boolean;
5248
+ }
5249
+ //#endregion
5250
+ //#region src/resources/sessions/sessions.d.ts
5251
+ type StopReceipt = CancelReceipt;
5252
+ interface SessionPreviewOptions extends RequestOptions {
5253
+ session?: ViewSessionOptions;
5254
+ grant?: {
5255
+ id: string;
5256
+ subject: string;
5257
+ accessRevision: string;
5258
+ ceilingAt: string;
5259
+ };
5260
+ }
5261
+ declare class SessionsApi {
5262
+ private readonly transport;
5263
+ constructor(transport: PocketCoderTransport);
5264
+ list(query?: {
5265
+ owner?: string;
5266
+ state?: "open" | Session["state"];
5267
+ }, options?: RequestOptions): Promise<{
5268
+ sessionId: string;
5269
+ profile: string;
5270
+ owner: string;
5271
+ group: string;
5272
+ revision: number;
5273
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
5274
+ reasonCode: string | null;
5275
+ createdAt: string;
5276
+ updatedAt: string;
5277
+ activeRequestId: string | null;
5278
+ }[]>;
5279
+ cancel(sessionId: string, options?: RequestOptions): Promise<{
5280
+ sessionId: string;
5281
+ state: "pending" | "completed";
5282
+ acceptedAt: string;
5283
+ completedAt: string | null;
5284
+ scope: "request";
5285
+ requestId: string;
5286
+ } | {
5287
+ sessionId: string;
5288
+ state: "pending" | "completed";
5289
+ acceptedAt: string;
5290
+ completedAt: string | null;
5291
+ scope: "session";
5292
+ requestId: null;
5293
+ }>;
5294
+ conversation(sessionId: string, query?: {
5295
+ after?: string;
5296
+ }, options?: RequestOptions): Promise<{
5297
+ session: {
5298
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
5299
+ reasonCode: string | null;
5300
+ };
5301
+ requests: ({
5302
+ sessionId: string;
5303
+ requestId: string;
5304
+ turnId: string;
5305
+ inputFingerprint: string;
5306
+ revision: number;
5307
+ reasonCode: string | null;
5308
+ acceptedAt: string;
5309
+ startedAt: string | null;
5310
+ endedAt: string | null;
5311
+ dispatchDeadline: string;
5312
+ collection: {
5313
+ sessionId: string;
5314
+ requestId: string;
5315
+ revision: number;
5316
+ objects: {
5317
+ exportId: string;
5318
+ sessionId: string;
5319
+ requestId: string;
5320
+ versionId: string;
5321
+ sha256: string;
5322
+ name: string;
5323
+ mediaType: string;
5324
+ sizeBytes: number;
5325
+ completeness: "complete" | "partial";
5326
+ availability: "expired" | "published" | "unavailable";
5327
+ expiresAt: string;
5328
+ }[];
5329
+ errors: string[];
5330
+ cleanupState: "pending" | "complete" | "not_required";
5331
+ state: "pending" | "finalizing";
5332
+ completeness: null;
5333
+ manifestDigest: null;
5334
+ settledAt: null;
5335
+ expiresAt: null;
5336
+ } | {
5337
+ sessionId: string;
5338
+ requestId: string;
5339
+ revision: number;
5340
+ objects: {
5341
+ exportId: string;
5342
+ sessionId: string;
5343
+ requestId: string;
5344
+ versionId: string;
5345
+ sha256: string;
5346
+ name: string;
5347
+ mediaType: string;
5348
+ sizeBytes: number;
5349
+ completeness: "complete" | "partial";
5350
+ availability: "expired" | "published" | "unavailable";
5351
+ expiresAt: string;
5352
+ }[];
5353
+ errors: string[];
5354
+ cleanupState: "pending" | "complete" | "not_required";
5355
+ state: "settled";
5356
+ completeness: "complete" | "partial" | "lost";
5357
+ manifestDigest: string;
5358
+ settledAt: string;
5359
+ expiresAt: string;
5360
+ };
5361
+ finalResponse: string | null;
5362
+ state: "terminal";
5363
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
5364
+ } | {
5365
+ sessionId: string;
5366
+ requestId: string;
5367
+ turnId: string;
5368
+ inputFingerprint: string;
5369
+ revision: number;
5370
+ reasonCode: string | null;
5371
+ acceptedAt: string;
5372
+ startedAt: string | null;
5373
+ dispatchDeadline: string;
5374
+ collection: {
6088
5375
  sessionId: string;
6089
5376
  requestId: string;
6090
- versionId: string;
6091
- sha256: string;
6092
- name: string;
6093
- mediaType: string;
6094
- sizeBytes: number;
6095
- completeness: "complete" | "partial";
6096
- availability: "expired" | "unavailable" | "published";
5377
+ revision: number;
5378
+ objects: {
5379
+ exportId: string;
5380
+ sessionId: string;
5381
+ requestId: string;
5382
+ versionId: string;
5383
+ sha256: string;
5384
+ name: string;
5385
+ mediaType: string;
5386
+ sizeBytes: number;
5387
+ completeness: "complete" | "partial";
5388
+ availability: "expired" | "published" | "unavailable";
5389
+ expiresAt: string;
5390
+ }[];
5391
+ errors: string[];
5392
+ cleanupState: "pending" | "complete" | "not_required";
5393
+ state: "pending" | "finalizing";
5394
+ completeness: null;
5395
+ manifestDigest: null;
5396
+ settledAt: null;
5397
+ expiresAt: null;
5398
+ } | {
5399
+ sessionId: string;
5400
+ requestId: string;
5401
+ revision: number;
5402
+ objects: {
5403
+ exportId: string;
5404
+ sessionId: string;
5405
+ requestId: string;
5406
+ versionId: string;
5407
+ sha256: string;
5408
+ name: string;
5409
+ mediaType: string;
5410
+ sizeBytes: number;
5411
+ completeness: "complete" | "partial";
5412
+ availability: "expired" | "published" | "unavailable";
5413
+ expiresAt: string;
5414
+ }[];
5415
+ errors: string[];
5416
+ cleanupState: "pending" | "complete" | "not_required";
5417
+ state: "settled";
5418
+ completeness: "complete" | "partial" | "lost";
5419
+ manifestDigest: string;
5420
+ settledAt: string;
6097
5421
  expiresAt: string;
6098
- }[];
6099
- errors: string[];
6100
- cleanupState: "pending" | "complete" | "not_required";
6101
- state: "settled";
6102
- completeness: "lost" | "complete" | "partial";
6103
- manifestDigest: string;
6104
- settledAt: string;
6105
- expiresAt: string;
6106
- };
6107
- finalResponse: string | null;
6108
- state: "running" | "accepted" | "waiting" | "checking_outcome";
6109
- outcome: null;
6110
- endedAt: null;
6111
- }>;
6112
- cancel(sessionId: string, requestId: string, command: CancelCommand, options?: RequestOptions): Promise<{
6113
- sessionId: string;
6114
- cancelId: string;
6115
- state: "pending" | "completed";
6116
- acceptedAt: string;
6117
- completedAt: string | null;
6118
- cancelDeadline: string;
6119
- scope: "request";
6120
- requestId: string;
6121
- } | {
6122
- sessionId: string;
6123
- cancelId: string;
6124
- state: "pending" | "completed";
6125
- acceptedAt: string;
6126
- completedAt: string | null;
6127
- cancelDeadline: string;
6128
- scope: "session";
6129
- requestId: null;
6130
- }>;
6131
- collection(sessionId: string, requestId: string, options?: RequestOptions): Promise<{
6132
- sessionId: string;
6133
- requestId: string;
6134
- revision: number;
6135
- objects: {
6136
- exportId: string;
6137
- sessionId: string;
5422
+ };
5423
+ finalResponse: string | null;
5424
+ state: "running" | "accepted" | "waiting" | "checking_outcome";
5425
+ outcome: null;
5426
+ endedAt: null;
5427
+ })[];
5428
+ messages: {
5429
+ messageId: string;
6138
5430
  requestId: string;
6139
- versionId: string;
6140
- sha256: string;
6141
- name: string;
6142
- mediaType: string;
6143
- sizeBytes: number;
6144
- completeness: "complete" | "partial";
6145
- availability: "expired" | "unavailable" | "published";
6146
- expiresAt: string;
5431
+ turnId: string;
5432
+ role: "user" | "assistant" | "system" | "tool";
5433
+ parts: ({
5434
+ type: "text";
5435
+ text: string;
5436
+ } | {
5437
+ type: "tool";
5438
+ call_id: string;
5439
+ name: string;
5440
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
5441
+ input: z.core.util.JSONType;
5442
+ output?: z.core.util.JSONType | undefined;
5443
+ output_text?: string | undefined;
5444
+ started_at?: string | null | undefined;
5445
+ ended_at?: string | null | undefined;
5446
+ } | {
5447
+ type: "error";
5448
+ code: string;
5449
+ message: string;
5450
+ } | {
5451
+ type: "file";
5452
+ file_id: string;
5453
+ name: string;
5454
+ media_type: string;
5455
+ size_bytes: number;
5456
+ })[];
5457
+ final: boolean;
5458
+ occurredAt: string;
6147
5459
  }[];
6148
- errors: string[];
6149
- cleanupState: "pending" | "complete" | "not_required";
6150
- state: "pending" | "finalizing";
6151
- completeness: null;
6152
- manifestDigest: null;
6153
- settledAt: null;
6154
- expiresAt: null;
6155
- } | {
5460
+ cursor: string;
5461
+ reset: boolean;
5462
+ }>;
5463
+ upload(sessionId: string, file: {
5464
+ inputId: string;
5465
+ name: string;
5466
+ mediaType: string;
5467
+ bytes: Uint8Array;
5468
+ }, options?: RequestOptions): Promise<{
6156
5469
  sessionId: string;
6157
- requestId: string;
6158
- revision: number;
6159
- objects: {
6160
- exportId: string;
6161
- sessionId: string;
6162
- requestId: string;
5470
+ reference: {
5471
+ inputId: string;
6163
5472
  versionId: string;
6164
5473
  sha256: string;
6165
5474
  name: string;
6166
5475
  mediaType: string;
6167
5476
  sizeBytes: number;
6168
- completeness: "complete" | "partial";
6169
- availability: "expired" | "unavailable" | "published";
6170
- expiresAt: string;
6171
- }[];
6172
- errors: string[];
6173
- cleanupState: "pending" | "complete" | "not_required";
6174
- state: "settled";
6175
- completeness: "lost" | "complete" | "partial";
6176
- manifestDigest: string;
6177
- settledAt: string;
5477
+ };
5478
+ state: "ready" | "expired" | "uploading" | "rejected";
6178
5479
  expiresAt: string;
6179
5480
  }>;
6180
- }
6181
- //#endregion
6182
- //#region src/resources/sessions/events.d.ts
6183
- interface SessionEventOptions {
6184
- after?: string;
6185
- signal?: AbortSignal;
6186
- reconnect?: boolean;
6187
- }
6188
- //#endregion
6189
- //#region src/resources/sessions/sessions.d.ts
6190
- type StopReceipt = CancelReceipt;
6191
- interface SessionPreviewOptions extends RequestOptions {
6192
- session?: ViewSessionOptions;
6193
- grant?: {
6194
- id: string;
6195
- subject: string;
6196
- accessRevision: string;
6197
- ceilingAt: string;
6198
- };
6199
- }
6200
- declare class SessionsApi {
6201
- private readonly transport;
6202
- constructor(transport: PocketCoderTransport);
6203
5481
  create(input: SessionCreate, options?: RequestOptions): Promise<{
6204
5482
  sessionId: string;
6205
- profileId: string;
6206
- profileRevision: number;
5483
+ profile: string;
5484
+ owner: string;
5485
+ group: string;
6207
5486
  revision: number;
6208
- state: "failed" | "ready" | "provisioning" | "suspended" | "closed";
5487
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
6209
5488
  reasonCode: string | null;
6210
5489
  createdAt: string;
6211
5490
  updatedAt: string;
6212
5491
  }>;
6213
5492
  get(sessionId: string, options?: RequestOptions): Promise<{
6214
5493
  sessionId: string;
6215
- profileId: string;
6216
- profileRevision: number;
5494
+ profile: string;
5495
+ owner: string;
5496
+ group: string;
6217
5497
  revision: number;
6218
- state: "failed" | "ready" | "provisioning" | "suspended" | "closed";
5498
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
6219
5499
  reasonCode: string | null;
6220
5500
  createdAt: string;
6221
5501
  updatedAt: string;
6222
5502
  }>;
6223
5503
  resume(sessionId: string, options?: RequestOptions): Promise<{
6224
5504
  sessionId: string;
6225
- profileId: string;
6226
- profileRevision: number;
5505
+ profile: string;
5506
+ owner: string;
5507
+ group: string;
6227
5508
  revision: number;
6228
- state: "failed" | "ready" | "provisioning" | "suspended" | "closed";
5509
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
6229
5510
  reasonCode: string | null;
6230
5511
  createdAt: string;
6231
5512
  updatedAt: string;
6232
5513
  }>;
6233
- close(sessionId: string, command: CancelCommand, options?: RequestOptions): Promise<{
5514
+ close(sessionId: string, options?: RequestOptions): Promise<{
6234
5515
  sessionId: string;
6235
- cancelId: string;
6236
5516
  state: "pending" | "completed";
6237
5517
  acceptedAt: string;
6238
5518
  completedAt: string | null;
6239
- cancelDeadline: string;
6240
5519
  scope: "request";
6241
5520
  requestId: string;
6242
5521
  } | {
6243
5522
  sessionId: string;
6244
- cancelId: string;
6245
5523
  state: "pending" | "completed";
6246
5524
  acceptedAt: string;
6247
5525
  completedAt: string | null;
6248
- cancelDeadline: string;
6249
5526
  scope: "session";
6250
5527
  requestId: null;
6251
5528
  }>;
@@ -6264,7 +5541,7 @@ declare class SessionsApi {
6264
5541
  turn_id: string;
6265
5542
  request_fingerprint: string;
6266
5543
  } | null;
6267
- status: "message" | "completed" | "failed" | "canceled" | "interrupted" | "lost" | "legacy";
5544
+ status: "message" | "failed" | "canceled" | "completed" | "interrupted" | "lost" | "legacy";
6268
5545
  reason: string | null;
6269
5546
  messages: {
6270
5547
  message_id: string;
@@ -6293,7 +5570,7 @@ declare class SessionsApi {
6293
5570
  } | {
6294
5571
  type: "activity_started";
6295
5572
  activity_id: string;
6296
- kind: "tool" | "attachment" | "workspace" | "retrieval";
5573
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
6297
5574
  label: string;
6298
5575
  started_at: string | null;
6299
5576
  action?: string | undefined;
@@ -6302,10 +5579,10 @@ declare class SessionsApi {
6302
5579
  type: "activity_finished";
6303
5580
  activity_id: string;
6304
5581
  ended_at: string | null;
6305
- outcome: "completed" | "failed" | "canceled" | "interrupted";
5582
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
6306
5583
  } | {
6307
5584
  type: "turn_terminal";
6308
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
5585
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
6309
5586
  reason?: string | undefined;
6310
5587
  } | undefined;
6311
5588
  } | null;
@@ -6316,7 +5593,7 @@ declare class SessionsApi {
6316
5593
  type: "tool";
6317
5594
  call_id: string;
6318
5595
  name: string;
6319
- status: "pending" | "running" | "completed" | "failed" | "canceled";
5596
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
6320
5597
  input: z.core.util.JSONType;
6321
5598
  output?: z.core.util.JSONType | undefined;
6322
5599
  output_text?: string | undefined;
@@ -6363,7 +5640,7 @@ declare class SessionsApi {
6363
5640
  turn_id: string;
6364
5641
  request_fingerprint: string;
6365
5642
  } | null;
6366
- status: "message" | "completed" | "failed" | "canceled" | "interrupted" | "lost" | "legacy";
5643
+ status: "message" | "failed" | "canceled" | "completed" | "interrupted" | "lost" | "legacy";
6367
5644
  reason: string | null;
6368
5645
  messages: {
6369
5646
  message_id: string;
@@ -6392,7 +5669,7 @@ declare class SessionsApi {
6392
5669
  } | {
6393
5670
  type: "activity_started";
6394
5671
  activity_id: string;
6395
- kind: "tool" | "attachment" | "workspace" | "retrieval";
5672
+ kind: "workspace" | "tool" | "attachment" | "retrieval";
6396
5673
  label: string;
6397
5674
  started_at: string | null;
6398
5675
  action?: string | undefined;
@@ -6401,10 +5678,10 @@ declare class SessionsApi {
6401
5678
  type: "activity_finished";
6402
5679
  activity_id: string;
6403
5680
  ended_at: string | null;
6404
- outcome: "completed" | "failed" | "canceled" | "interrupted";
5681
+ outcome: "failed" | "canceled" | "completed" | "interrupted";
6405
5682
  } | {
6406
5683
  type: "turn_terminal";
6407
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
5684
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
6408
5685
  reason?: string | undefined;
6409
5686
  } | undefined;
6410
5687
  } | null;
@@ -6415,7 +5692,7 @@ declare class SessionsApi {
6415
5692
  type: "tool";
6416
5693
  call_id: string;
6417
5694
  name: string;
6418
- status: "pending" | "running" | "completed" | "failed" | "canceled";
5695
+ status: "failed" | "pending" | "running" | "canceled" | "completed";
6419
5696
  input: z.core.util.JSONType;
6420
5697
  output?: z.core.util.JSONType | undefined;
6421
5698
  output_text?: string | undefined;
@@ -6461,10 +5738,11 @@ declare class SessionsApi {
6461
5738
  requestId: null;
6462
5739
  data: {
6463
5740
  sessionId: string;
6464
- profileId: string;
6465
- profileRevision: number;
5741
+ profile: string;
5742
+ owner: string;
5743
+ group: string;
6466
5744
  revision: number;
6467
- state: "failed" | "ready" | "provisioning" | "suspended" | "closed";
5745
+ state: "ready" | "failed" | "provisioning" | "suspended" | "closed";
6468
5746
  reasonCode: string | null;
6469
5747
  createdAt: string;
6470
5748
  updatedAt: string;
@@ -6504,7 +5782,7 @@ declare class SessionsApi {
6504
5782
  mediaType: string;
6505
5783
  sizeBytes: number;
6506
5784
  completeness: "complete" | "partial";
6507
- availability: "expired" | "unavailable" | "published";
5785
+ availability: "expired" | "published" | "unavailable";
6508
5786
  expiresAt: string;
6509
5787
  }[];
6510
5788
  errors: string[];
@@ -6528,20 +5806,20 @@ declare class SessionsApi {
6528
5806
  mediaType: string;
6529
5807
  sizeBytes: number;
6530
5808
  completeness: "complete" | "partial";
6531
- availability: "expired" | "unavailable" | "published";
5809
+ availability: "expired" | "published" | "unavailable";
6532
5810
  expiresAt: string;
6533
5811
  }[];
6534
5812
  errors: string[];
6535
5813
  cleanupState: "pending" | "complete" | "not_required";
6536
5814
  state: "settled";
6537
- completeness: "lost" | "complete" | "partial";
5815
+ completeness: "complete" | "partial" | "lost";
6538
5816
  manifestDigest: string;
6539
5817
  settledAt: string;
6540
5818
  expiresAt: string;
6541
5819
  };
6542
5820
  finalResponse: string | null;
6543
5821
  state: "terminal";
6544
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
5822
+ outcome: "failed" | "canceled" | "completed" | "interrupted" | "lost";
6545
5823
  } | {
6546
5824
  sessionId: string;
6547
5825
  requestId: string;
@@ -6566,7 +5844,7 @@ declare class SessionsApi {
6566
5844
  mediaType: string;
6567
5845
  sizeBytes: number;
6568
5846
  completeness: "complete" | "partial";
6569
- availability: "expired" | "unavailable" | "published";
5847
+ availability: "expired" | "published" | "unavailable";
6570
5848
  expiresAt: string;
6571
5849
  }[];
6572
5850
  errors: string[];
@@ -6590,13 +5868,13 @@ declare class SessionsApi {
6590
5868
  mediaType: string;
6591
5869
  sizeBytes: number;
6592
5870
  completeness: "complete" | "partial";
6593
- availability: "expired" | "unavailable" | "published";
5871
+ availability: "expired" | "published" | "unavailable";
6594
5872
  expiresAt: string;
6595
5873
  }[];
6596
5874
  errors: string[];
6597
5875
  cleanupState: "pending" | "complete" | "not_required";
6598
5876
  state: "settled";
6599
- completeness: "lost" | "complete" | "partial";
5877
+ completeness: "complete" | "partial" | "lost";
6600
5878
  manifestDigest: string;
6601
5879
  settledAt: string;
6602
5880
  expiresAt: string;
@@ -6626,90 +5904,10 @@ declare class SessionsApi {
6626
5904
  mediaType: string;
6627
5905
  sizeBytes: number;
6628
5906
  completeness: "complete" | "partial";
6629
- availability: "expired" | "unavailable" | "published";
5907
+ availability: "expired" | "published" | "unavailable";
6630
5908
  expiresAt: string;
6631
5909
  };
6632
5910
  }, any, any>;
6633
- open(sessionId: string, options?: RequestOptions): Promise<{
6634
- turns: ({
6635
- type: "turn";
6636
- conversation_id: string;
6637
- turn_id: string;
6638
- messages: {
6639
- metadata: Record<string, string>;
6640
- message_id: string;
6641
- role: "user" | "assistant" | "system" | "tool";
6642
- content: string;
6643
- occurred_at: string;
6644
- identity: {
6645
- schema: "pocketcoder.conversation/v2";
6646
- authority: "external" | "generic";
6647
- conversation_id: string;
6648
- request_id: string;
6649
- turn_id: string;
6650
- request_fingerprint: string;
6651
- event_id: string;
6652
- message_id: string;
6653
- sequence: number;
6654
- revision: number;
6655
- fact?: {
6656
- type: "intermediate";
6657
- } | {
6658
- type: "final_response";
6659
- } | {
6660
- type: "tool_only";
6661
- } | {
6662
- type: "activity_started";
6663
- activity_id: string;
6664
- kind: "tool" | "attachment" | "workspace" | "retrieval";
6665
- label: string;
6666
- started_at: string | null;
6667
- action?: string | undefined;
6668
- subject?: string | undefined;
6669
- } | {
6670
- type: "activity_finished";
6671
- activity_id: string;
6672
- ended_at: string | null;
6673
- outcome: "completed" | "failed" | "canceled" | "interrupted";
6674
- } | {
6675
- type: "turn_terminal";
6676
- outcome: "completed" | "failed" | "canceled" | "interrupted" | "lost";
6677
- reason?: string | undefined;
6678
- } | undefined;
6679
- } | null;
6680
- parts?: ({
6681
- type: "text";
6682
- text: string;
6683
- } | {
6684
- type: "tool";
6685
- call_id: string;
6686
- name: string;
6687
- status: "pending" | "running" | "completed" | "failed" | "canceled";
6688
- input: z.core.util.JSONType;
6689
- output?: z.core.util.JSONType | undefined;
6690
- output_text?: string | undefined;
6691
- started_at?: string | null | undefined;
6692
- ended_at?: string | null | undefined;
6693
- } | {
6694
- type: "error";
6695
- code: string;
6696
- message: string;
6697
- } | {
6698
- type: "file";
6699
- file_id: string;
6700
- name: string;
6701
- media_type: string;
6702
- size_bytes: number;
6703
- })[] | undefined;
6704
- }[];
6705
- } | {
6706
- type: "committed";
6707
- conversation_id: string | null;
6708
- turn_id: string | null;
6709
- status: "message" | "completed" | "failed" | "canceled" | "interrupted" | "lost" | "legacy";
6710
- last_seq: number;
6711
- })[];
6712
- }>;
6713
5911
  openPreview(sessionId: string, name: string, options?: SessionPreviewOptions): Promise<{
6714
5912
  url: string;
6715
5913
  expires_at: string;
@@ -6819,14 +6017,14 @@ declare class WorkspacesApi {
6819
6017
  version: string;
6820
6018
  digest: string;
6821
6019
  };
6822
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6020
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
6823
6021
  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" | "launch_refused" | "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;
6824
6022
  agent_state: "unknown" | "running" | "stable";
6825
6023
  change_cursor: number;
6826
6024
  provider_kind: string | null;
6827
6025
  provisioning_mode: "cold" | "warm" | null;
6828
6026
  network: {
6829
- state: "ready" | "disabled" | "starting" | "degraded";
6027
+ state: "disabled" | "ready" | "starting" | "degraded";
6830
6028
  };
6831
6029
  health: Record<string, string>;
6832
6030
  created_at: string;
@@ -6873,14 +6071,14 @@ declare class WorkspacesApi {
6873
6071
  version: string;
6874
6072
  digest: string;
6875
6073
  };
6876
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6074
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
6877
6075
  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" | "launch_refused" | "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;
6878
6076
  agent_state: "unknown" | "running" | "stable";
6879
6077
  change_cursor: number;
6880
6078
  provider_kind: string | null;
6881
6079
  provisioning_mode: "cold" | "warm" | null;
6882
6080
  network: {
6883
- state: "ready" | "disabled" | "starting" | "degraded";
6081
+ state: "disabled" | "ready" | "starting" | "degraded";
6884
6082
  };
6885
6083
  health: Record<string, string>;
6886
6084
  created_at: string;
@@ -6927,14 +6125,14 @@ declare class WorkspacesApi {
6927
6125
  version: string;
6928
6126
  digest: string;
6929
6127
  };
6930
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6128
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
6931
6129
  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" | "launch_refused" | "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;
6932
6130
  agent_state: "unknown" | "running" | "stable";
6933
6131
  change_cursor: number;
6934
6132
  provider_kind: string | null;
6935
6133
  provisioning_mode: "cold" | "warm" | null;
6936
6134
  network: {
6937
- state: "ready" | "disabled" | "starting" | "degraded";
6135
+ state: "disabled" | "ready" | "starting" | "degraded";
6938
6136
  };
6939
6137
  health: Record<string, string>;
6940
6138
  created_at: string;
@@ -6981,14 +6179,14 @@ declare class WorkspacesApi {
6981
6179
  version: string;
6982
6180
  digest: string;
6983
6181
  };
6984
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6182
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
6985
6183
  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" | "launch_refused" | "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;
6986
6184
  agent_state: "unknown" | "running" | "stable";
6987
6185
  change_cursor: number;
6988
6186
  provider_kind: string | null;
6989
6187
  provisioning_mode: "cold" | "warm" | null;
6990
6188
  network: {
6991
- state: "ready" | "disabled" | "starting" | "degraded";
6189
+ state: "disabled" | "ready" | "starting" | "degraded";
6992
6190
  };
6993
6191
  health: Record<string, string>;
6994
6192
  created_at: string;
@@ -7035,14 +6233,14 @@ declare class WorkspacesApi {
7035
6233
  version: string;
7036
6234
  digest: string;
7037
6235
  };
7038
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6236
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7039
6237
  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" | "launch_refused" | "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;
7040
6238
  agent_state: "unknown" | "running" | "stable";
7041
6239
  change_cursor: number;
7042
6240
  provider_kind: string | null;
7043
6241
  provisioning_mode: "cold" | "warm" | null;
7044
6242
  network: {
7045
- state: "ready" | "disabled" | "starting" | "degraded";
6243
+ state: "disabled" | "ready" | "starting" | "degraded";
7046
6244
  };
7047
6245
  health: Record<string, string>;
7048
6246
  created_at: string;
@@ -7092,14 +6290,14 @@ declare class WorkspacesApi {
7092
6290
  version: string;
7093
6291
  digest: string;
7094
6292
  };
7095
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6293
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7096
6294
  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" | "launch_refused" | "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;
7097
6295
  agent_state: "unknown" | "running" | "stable";
7098
6296
  change_cursor: number;
7099
6297
  provider_kind: string | null;
7100
6298
  provisioning_mode: "cold" | "warm" | null;
7101
6299
  network: {
7102
- state: "ready" | "disabled" | "starting" | "degraded";
6300
+ state: "disabled" | "ready" | "starting" | "degraded";
7103
6301
  };
7104
6302
  health: Record<string, string>;
7105
6303
  created_at: string;
@@ -7149,14 +6347,14 @@ declare class WorkspacesApi {
7149
6347
  version: string;
7150
6348
  digest: string;
7151
6349
  };
7152
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6350
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7153
6351
  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" | "launch_refused" | "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;
7154
6352
  agent_state: "unknown" | "running" | "stable";
7155
6353
  change_cursor: number;
7156
6354
  provider_kind: string | null;
7157
6355
  provisioning_mode: "cold" | "warm" | null;
7158
6356
  network: {
7159
- state: "ready" | "disabled" | "starting" | "degraded";
6357
+ state: "disabled" | "ready" | "starting" | "degraded";
7160
6358
  };
7161
6359
  health: Record<string, string>;
7162
6360
  created_at: string;
@@ -7204,14 +6402,14 @@ declare class WorkspacesApi {
7204
6402
  version: string;
7205
6403
  digest: string;
7206
6404
  };
7207
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6405
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7208
6406
  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" | "launch_refused" | "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;
7209
6407
  agent_state: "unknown" | "running" | "stable";
7210
6408
  change_cursor: number;
7211
6409
  provider_kind: string | null;
7212
6410
  provisioning_mode: "cold" | "warm" | null;
7213
6411
  network: {
7214
- state: "ready" | "disabled" | "starting" | "degraded";
6412
+ state: "disabled" | "ready" | "starting" | "degraded";
7215
6413
  };
7216
6414
  health: Record<string, string>;
7217
6415
  created_at: string;
@@ -7253,7 +6451,7 @@ declare class WorkspacesApi {
7253
6451
  checkpoint: {
7254
6452
  id: string;
7255
6453
  workspace_id: string;
7256
- state: "deleted" | "failed" | "ready" | "creating" | "deleting";
6454
+ state: "deleted" | "creating" | "ready" | "failed" | "deleting";
7257
6455
  reason_code: string | null;
7258
6456
  template: {
7259
6457
  name: string;
@@ -7274,7 +6472,7 @@ declare class WorkspacesApi {
7274
6472
  operation: {
7275
6473
  id: string;
7276
6474
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
7277
- state: "pending" | "running" | "failed" | "succeeded";
6475
+ state: "failed" | "pending" | "running" | "succeeded";
7278
6476
  workspace_id: string | null;
7279
6477
  checkpoint_id: string | null;
7280
6478
  result_workspace_id: string | null;
@@ -7287,7 +6485,7 @@ declare class WorkspacesApi {
7287
6485
  purge(id: string, key: string, options?: RequestOptions): Promise<{
7288
6486
  id: string;
7289
6487
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
7290
- state: "pending" | "running" | "failed" | "succeeded";
6488
+ state: "failed" | "pending" | "running" | "succeeded";
7291
6489
  workspace_id: string | null;
7292
6490
  checkpoint_id: string | null;
7293
6491
  result_workspace_id: string | null;
@@ -7305,14 +6503,14 @@ declare class WorkspacesApi {
7305
6503
  version: string;
7306
6504
  digest: string;
7307
6505
  };
7308
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6506
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7309
6507
  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" | "launch_refused" | "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;
7310
6508
  agent_state: "unknown" | "running" | "stable";
7311
6509
  change_cursor: number;
7312
6510
  provider_kind: string | null;
7313
6511
  provisioning_mode: "cold" | "warm" | null;
7314
6512
  network: {
7315
- state: "ready" | "disabled" | "starting" | "degraded";
6513
+ state: "disabled" | "ready" | "starting" | "degraded";
7316
6514
  };
7317
6515
  health: Record<string, string>;
7318
6516
  created_at: string;
@@ -7354,7 +6552,7 @@ declare class WorkspacesApi {
7354
6552
  operation: {
7355
6553
  id: string;
7356
6554
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
7357
- state: "pending" | "running" | "failed" | "succeeded";
6555
+ state: "failed" | "pending" | "running" | "succeeded";
7358
6556
  workspace_id: string | null;
7359
6557
  checkpoint_id: string | null;
7360
6558
  result_workspace_id: string | null;
@@ -7373,14 +6571,14 @@ declare class WorkspacesApi {
7373
6571
  version: string;
7374
6572
  digest: string;
7375
6573
  };
7376
- state: "failed" | "canceled" | "expired" | "ready" | "provisioning" | "succeeded" | "queued" | "connected" | "preserving" | "terminating" | "preserved";
6574
+ state: "ready" | "failed" | "succeeded" | "queued" | "provisioning" | "connected" | "preserving" | "terminating" | "canceled" | "expired" | "preserved";
7377
6575
  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" | "launch_refused" | "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;
7378
6576
  agent_state: "unknown" | "running" | "stable";
7379
6577
  change_cursor: number;
7380
6578
  provider_kind: string | null;
7381
6579
  provisioning_mode: "cold" | "warm" | null;
7382
6580
  network: {
7383
- state: "ready" | "disabled" | "starting" | "degraded";
6581
+ state: "disabled" | "ready" | "starting" | "degraded";
7384
6582
  };
7385
6583
  health: Record<string, string>;
7386
6584
  created_at: string;
@@ -7422,7 +6620,7 @@ declare class WorkspacesApi {
7422
6620
  operation: {
7423
6621
  id: string;
7424
6622
  kind: "preserve" | "restore" | "verify" | "delete" | "purge";
7425
- state: "pending" | "running" | "failed" | "succeeded";
6623
+ state: "failed" | "pending" | "running" | "succeeded";
7426
6624
  workspace_id: string | null;
7427
6625
  checkpoint_id: string | null;
7428
6626
  result_workspace_id: string | null;
@@ -7465,7 +6663,7 @@ declare class PocketCoderClient {
7465
6663
  readonly sessions: SessionsApi;
7466
6664
  readonly requests: SessionRequestsApi;
7467
6665
  readonly files: SessionFilesApi;
7468
- readonly authority: ManagedAuthorityApi;
6666
+ readonly profiles: SessionProfilesApi;
7469
6667
  constructor(config: PocketCoderClientConfig, fetchImpl?: typeof fetch);
7470
6668
  raw(path: string, init?: RequestInit): Promise<Response>;
7471
6669
  }
@@ -7533,4 +6731,4 @@ declare class WorkspaceTerminalError extends Error {
7533
6731
  }
7534
6732
  declare function isPocketCoderErrorCode(value: unknown): value is ErrorCode;
7535
6733
  //#endregion
7536
- export { type AcceptedInputManifest, AdministrationApi, type AttachmentDescriptor, type AttachmentUploadInput, AttachmentsApi, type BrowserAction, type BudgetScopeGrant, type CheckpointResource, type CheckpointState, CheckpointsApi, type ClientErrorCode, ConversationGoneError, type ConversationMessage, type ConversationMessageIdentity, type ConversationMessageInput, type ConversationPage, type ConversationPart, type ConversationRequestIdentity, type ConversationSummary, ConversationsApi, type CredentialBinding, type CredentialSlot, type CursorListQuery, type ExecutionRecord, type ExportObjectReference, type InputObjectReference, type InstalledWorkload, type KeyIssueRequest, type KeyIssueResponse, type KeyListQuery, type KeyListResponse, type KeyResource, KeysApi, type LogChunk, LogsApi, ManagedAuthorityApi, 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 SessionEventOptions, SessionFilesApi, type SessionPreviewOptions, SessionRequestsApi, SessionsApi, type StopReceipt, 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 WorkspaceRequest, WorkspaceRequestsApi, type WorkspaceResource, type WorkspaceState, type WorkspaceSummary, WorkspaceTerminalError, WorkspaceTurnResolutionError, type WorkspaceTurnResolutionErrorCode, WorkspaceTurnResolver, type WorkspaceTurnResolverOptions, WorkspacesApi, isPocketCoderErrorCode, index_d_exports as managed, sessionTemplate };
6734
+ export { type AcceptedInputManifest, AdministrationApi, type AttachmentDescriptor, type AttachmentUploadInput, AttachmentsApi, type BrowserAction, type CheckpointResource, type CheckpointState, CheckpointsApi, type ClientErrorCode, ConversationGoneError, type ConversationMessage, type ConversationMessageIdentity, type ConversationMessageInput, type ConversationPage, type ConversationPart, type ConversationRequestIdentity, type ConversationSummary, ConversationsApi, type CredentialSlot, type CursorListQuery, type ExecutionRecord, 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 SessionEventOptions, SessionFilesApi, type SessionPreviewOptions, SessionRequestsApi, SessionsApi, type StopReceipt, 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 WorkspaceRequest, WorkspaceRequestsApi, type WorkspaceResource, type WorkspaceState, type WorkspaceSummary, WorkspaceTerminalError, WorkspaceTurnResolutionError, type WorkspaceTurnResolutionErrorCode, WorkspaceTurnResolver, type WorkspaceTurnResolverOptions, WorkspacesApi, isPocketCoderErrorCode, index_d_exports as managed, sessionTemplate };