@wjarka/cezarion 0.17.0-pr2005.3024 → 0.17.0-pr2007.3038

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 (83) hide show
  1. package/dist/ci-wait/controller.d.ts +22 -22
  2. package/dist/ci-wait/tools.d.ts +4 -4
  3. package/dist/contract/conversations.d.ts +50 -0
  4. package/dist/contract/delegation.d.ts +18 -0
  5. package/dist/contract/events.d.ts +9 -0
  6. package/dist/contract/index.js +27 -4
  7. package/dist/contract/runs.d.ts +45 -0
  8. package/dist/contract/waits.d.ts +2 -0
  9. package/dist/core/claude-cli-runner.js +260 -264
  10. package/dist/core/claude-cli-runner.js.map +1 -1
  11. package/dist/core/claude-stream.d.ts +31 -0
  12. package/dist/core/claude-stream.js +68 -0
  13. package/dist/core/claude-stream.js.map +1 -0
  14. package/dist/core/codex-app-server-runner.js +55 -64
  15. package/dist/core/codex-app-server-runner.js.map +1 -1
  16. package/dist/core/codex-native-frames.d.ts +10 -0
  17. package/dist/core/codex-native-frames.js +47 -0
  18. package/dist/core/codex-native-frames.js.map +1 -0
  19. package/dist/delegation/conversations.d.ts +1539 -3
  20. package/dist/delegation/conversations.js +162 -17
  21. package/dist/delegation/conversations.js.map +1 -1
  22. package/dist/delegation/park-notice.d.ts +4 -1
  23. package/dist/delegation/park-notice.js +8 -0
  24. package/dist/delegation/park-notice.js.map +1 -1
  25. package/dist/delegation/provision.js +2 -3
  26. package/dist/delegation/provision.js.map +1 -1
  27. package/dist/delegation/routes.d.ts +16 -9
  28. package/dist/delegation/service.d.ts +32 -3
  29. package/dist/delegation/service.js +164 -76
  30. package/dist/delegation/service.js.map +1 -1
  31. package/dist/delegation/transport.d.ts +16 -9
  32. package/dist/runs/conversation-identity.d.ts +19 -0
  33. package/dist/runs/conversation-identity.js +31 -0
  34. package/dist/runs/conversation-identity.js.map +1 -0
  35. package/dist/runs/delegation-state.d.ts +9 -0
  36. package/dist/runs/store.d.ts +31 -9
  37. package/dist/runs/store.js +10 -37
  38. package/dist/runs/store.js.map +1 -1
  39. package/dist/runs/task-refs.d.ts +14 -0
  40. package/dist/runs/task-refs.js +33 -0
  41. package/dist/runs/task-refs.js.map +1 -1
  42. package/dist/server/server.d.ts +164 -128
  43. package/dist/workflows/continuation-admission.d.ts +9 -7
  44. package/dist/workflows/input-acknowledgement.d.ts +26 -1
  45. package/dist/workflows/input-acknowledgement.js +6 -3
  46. package/dist/workflows/input-acknowledgement.js.map +1 -1
  47. package/dist/workflows/pasted-content.d.ts +60 -0
  48. package/dist/workflows/pasted-content.js +69 -0
  49. package/dist/workflows/pasted-content.js.map +1 -0
  50. package/dist/workflows/run.d.ts +10 -57
  51. package/dist/workflows/run.js +60 -78
  52. package/dist/workflows/run.js.map +1 -1
  53. package/dist/workflows/waits.d.ts +7 -1
  54. package/dist/workflows/waits.js +8 -0
  55. package/dist/workflows/waits.js.map +1 -1
  56. package/package.json +3 -3
  57. package/web/dist/assets/{centered-state-hDsyXrnH.js → centered-state-BlCWT-Vc.js} +1 -1
  58. package/web/dist/assets/{diff-EDmRN8pP2.js → diff-C743ZNen2.js} +2 -2
  59. package/web/dist/assets/{diff-controls-GewpW9aF.js → diff-controls-RFpkPfTB.js} +1 -1
  60. package/web/dist/assets/{diff-view-BSRNH_Mq.js → diff-view-CX8_54Eh.js} +1 -1
  61. package/web/dist/assets/{dropdown-menu-COj_J5wd.js → dropdown-menu-BgI0XjKm.js} +1 -1
  62. package/web/dist/assets/{git-toolbar-B_KLrjba.js → git-toolbar-Cb4A5-1f.js} +1 -1
  63. package/web/dist/assets/{github-gfznAOq9.js → github-YmH72SiA.js} +1 -1
  64. package/web/dist/assets/{index-6mOQALqD.js → index-DNHb2zby.js} +4 -4
  65. package/web/dist/assets/{live-protocol-Uce2NwEX.js → live-protocol-B2t0yAoY.js} +1 -1
  66. package/web/dist/assets/{popover-D56fhiXj.js → popover-DKceHkLJ.js} +1 -1
  67. package/web/dist/assets/{preview-pane-connected-UwGHfbhd.js → preview-pane-connected-Bga8CMcB.js} +1 -1
  68. package/web/dist/assets/{reference-chip-gQNk-4jc.js → reference-chip-AFKDJZdL.js} +1 -1
  69. package/web/dist/assets/{repo-git-BzqdlCks.js → repo-git-Bfol0ggW.js} +1 -1
  70. package/web/dist/assets/{run-header-CBHN9bMW.js → run-header-BuNj6zJ1.js} +1 -1
  71. package/web/dist/assets/{skills-DTponTzk.js → skills-D4YCKhgs.js} +1 -1
  72. package/web/dist/assets/{status-dot-1PR0i69P.js → status-dot-CC2EADr5.js} +1 -1
  73. package/web/dist/assets/{tab-link-DmWk4l5O.js → tab-link-Ckr7xDCb.js} +1 -1
  74. package/web/dist/assets/{task-changes-1gZu3mS1.js → task-changes-DcelRz1j.js} +1 -1
  75. package/web/dist/assets/{task-commits-Et-picsu.js → task-commits-BqKgGyda.js} +1 -1
  76. package/web/dist/assets/{task-files-DpuknjCM.js → task-files-DhzD5OC6.js} +1 -1
  77. package/web/dist/assets/{task-github-item-BGwH2nfJ.js → task-github-item--0UgXbWX.js} +1 -1
  78. package/web/dist/assets/{task-thread-BInpSr44.js → task-thread-D1DrGgGm.js} +1 -1
  79. package/web/dist/assets/{thread-state-XbMapyPV.js → thread-state-D9PylWFr.js} +1 -1
  80. package/web/dist/assets/{use-hand-to-agent-state-BiWjFksc.js → use-hand-to-agent-state-ZGYNMmkw.js} +1 -1
  81. package/web/dist/assets/{workflows--EyZTjEF.js → workflows-CQGHai7L.js} +1 -1
  82. package/web/dist/index.html +7 -7
  83. package/web/dist/live-worker.js +1 -1
@@ -453,13 +453,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
453
453
  "/api/v1/tools/preview-stop": {
454
454
  $post: {
455
455
  output: {
456
- ok: boolean;
457
- code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
456
+ code: 'capability_revoked';
458
457
  message: string;
459
- hint: string;
460
458
  };
461
459
  outputFormat: "json";
462
- status: import("hono/utils/http-status").ContentfulStatusCode;
460
+ status: 401;
463
461
  input: {
464
462
  json: {
465
463
  port: number;
@@ -468,11 +466,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
468
466
  };
469
467
  } | {
470
468
  output: {
471
- code: 'capability_revoked';
469
+ ok: boolean;
470
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
472
471
  message: string;
472
+ hint: string;
473
473
  };
474
474
  outputFormat: "json";
475
- status: 401;
475
+ status: import("hono/utils/http-status").ContentfulStatusCode;
476
476
  input: {
477
477
  json: {
478
478
  port: number;
@@ -485,13 +485,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
485
485
  "/api/v1/tools/preview-serve": {
486
486
  $post: {
487
487
  output: {
488
- ok: boolean;
489
- code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
488
+ code: 'capability_revoked';
490
489
  message: string;
491
- hint: string;
492
490
  };
493
491
  outputFormat: "json";
494
- status: import("hono/utils/http-status").ContentfulStatusCode;
492
+ status: 401;
495
493
  input: {
496
494
  json: {
497
495
  command: string;
@@ -503,11 +501,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
503
501
  };
504
502
  } | {
505
503
  output: {
506
- code: 'capability_revoked';
504
+ ok: boolean;
505
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
507
506
  message: string;
507
+ hint: string;
508
508
  };
509
509
  outputFormat: "json";
510
- status: 401;
510
+ status: import("hono/utils/http-status").ContentfulStatusCode;
511
511
  input: {
512
512
  json: {
513
513
  command: string;
@@ -523,12 +523,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
523
523
  "/api/v1/tools/schedule-task": {
524
524
  $post: {
525
525
  output: {
526
- ok: false;
527
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
526
+ code: 'capability_revoked';
528
527
  message: string;
529
528
  };
530
529
  outputFormat: "json";
531
- status: import("hono/utils/http-status").ContentfulStatusCode;
530
+ status: 401;
532
531
  input: {
533
532
  json: {
534
533
  at?: string | undefined;
@@ -546,11 +545,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
546
545
  };
547
546
  } | {
548
547
  output: {
549
- code: 'capability_revoked';
548
+ ok: false;
549
+ code: import('../contract/index.js').ScheduledTaskRefusalCode;
550
550
  message: string;
551
551
  };
552
552
  outputFormat: "json";
553
- status: 401;
553
+ status: import("hono/utils/http-status").ContentfulStatusCode;
554
554
  input: {
555
555
  json: {
556
556
  at?: string | undefined;
@@ -609,12 +609,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
609
609
  "/api/v1/tools/scheduled-tasks": {
610
610
  $post: {
611
611
  output: {
612
- ok: false;
613
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
612
+ code: 'capability_revoked';
614
613
  message: string;
615
614
  };
616
615
  outputFormat: "json";
617
- status: import("hono/utils/http-status").ContentfulStatusCode;
616
+ status: 401;
618
617
  input: {
619
618
  json: {
620
619
  at?: string | undefined;
@@ -648,11 +647,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
648
647
  };
649
648
  } | {
650
649
  output: {
651
- code: 'capability_revoked';
650
+ ok: false;
651
+ code: import('../contract/index.js').ScheduledTaskRefusalCode;
652
652
  message: string;
653
653
  };
654
654
  outputFormat: "json";
655
- status: 401;
655
+ status: import("hono/utils/http-status").ContentfulStatusCode;
656
656
  input: {
657
657
  json: {
658
658
  at?: string | undefined;
@@ -759,10 +759,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
759
759
  }[];
760
760
  isError: boolean;
761
761
  details: {
762
- ok: false;
763
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
764
- message: string;
765
- } | {
766
762
  ok: true;
767
763
  task: {
768
764
  id: string;
@@ -776,6 +772,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
776
772
  url?: string | undefined;
777
773
  };
778
774
  note: string;
775
+ } | {
776
+ ok: false;
777
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
778
+ message: string;
779
779
  };
780
780
  }>;
781
781
  export declare function invokeScheduledTasksTool(input: unknown): Promise<{
@@ -1,4 +1,12 @@
1
1
  import { z } from 'zod';
2
+ /** Who may talk: a root and its owned worker (`family`), or two root tasks of one project (`peer`,
3
+ * spec 2026-10-27-task-communication-protocol § 2). Cezar writes it on peer messages only; an
4
+ * absent field reads as `family`, so family records stay as older versions wrote them. */
5
+ export declare const conversationRelationshipSchema: z.ZodEnum<{
6
+ family: "family";
7
+ peer: "peer";
8
+ }>;
9
+ export type ConversationRelationship = z.infer<typeof conversationRelationshipSchema>;
2
10
  export declare const conversationAttributionSchema: z.ZodObject<{
3
11
  senderRunId: z.ZodUUID;
4
12
  recipientRunId: z.ZodUUID;
@@ -9,6 +17,10 @@ export declare const conversationAttributionSchema: z.ZodObject<{
9
17
  request: "request";
10
18
  }>;
11
19
  requestId: z.ZodOptional<z.ZodUUID>;
20
+ relationship: z.ZodOptional<z.ZodEnum<{
21
+ family: "family";
22
+ peer: "peer";
23
+ }>>;
12
24
  }, z.core.$strict>;
13
25
  export declare const conversationMessageSchema: z.ZodObject<{
14
26
  senderRunId: z.ZodUUID;
@@ -20,6 +32,10 @@ export declare const conversationMessageSchema: z.ZodObject<{
20
32
  request: "request";
21
33
  }>;
22
34
  requestId: z.ZodOptional<z.ZodUUID>;
35
+ relationship: z.ZodOptional<z.ZodEnum<{
36
+ family: "family";
37
+ peer: "peer";
38
+ }>>;
23
39
  id: z.ZodUUID;
24
40
  text: z.ZodString;
25
41
  createdAt: z.ZodISODateTime;
@@ -53,6 +69,7 @@ export declare const requestOutcomeSchema: z.ZodObject<{
53
69
  status: z.ZodEnum<{
54
70
  cancelled: "cancelled";
55
71
  "completed-without-reply": "completed-without-reply";
72
+ deleted: "deleted";
56
73
  destroyed: "destroyed";
57
74
  failed: "failed";
58
75
  "human-fallback": "human-fallback";
@@ -76,6 +93,10 @@ export declare const conversationStateSchema: z.ZodObject<{
76
93
  request: "request";
77
94
  }>;
78
95
  requestId: z.ZodOptional<z.ZodUUID>;
96
+ relationship: z.ZodOptional<z.ZodEnum<{
97
+ family: "family";
98
+ peer: "peer";
99
+ }>>;
79
100
  id: z.ZodUUID;
80
101
  text: z.ZodString;
81
102
  createdAt: z.ZodISODateTime;
@@ -108,6 +129,7 @@ export declare const conversationStateSchema: z.ZodObject<{
108
129
  status: z.ZodEnum<{
109
130
  cancelled: "cancelled";
110
131
  "completed-without-reply": "completed-without-reply";
132
+ deleted: "deleted";
111
133
  destroyed: "destroyed";
112
134
  failed: "failed";
113
135
  "human-fallback": "human-fallback";
@@ -121,6 +143,17 @@ export declare const conversationStateSchema: z.ZodObject<{
121
143
  }, z.core.$strict>>;
122
144
  }, z.core.$strict>;
123
145
  export type ConversationState = z.infer<typeof conversationStateSchema>;
146
+ export declare const conversationCursorSchema: z.ZodString;
147
+ export declare function encodeConversationCursor(message: {
148
+ createdAt: string;
149
+ id: string;
150
+ }): string;
151
+ export declare function decodeConversationCursor(cursor: string): {
152
+ createdAt: string;
153
+ id: string;
154
+ };
155
+ /** The merged history page bound: the newest 1,024 messages of a pair, which may span two ledgers. */
156
+ export declare const CONVERSATION_PAGE_MESSAGES = 1024;
124
157
  export declare const conversationInspectResultSchema: z.ZodObject<{
125
158
  messages: z.ZodArray<z.ZodObject<{
126
159
  senderRunId: z.ZodUUID;
@@ -132,6 +165,10 @@ export declare const conversationInspectResultSchema: z.ZodObject<{
132
165
  request: "request";
133
166
  }>;
134
167
  requestId: z.ZodOptional<z.ZodUUID>;
168
+ relationship: z.ZodOptional<z.ZodEnum<{
169
+ family: "family";
170
+ peer: "peer";
171
+ }>>;
135
172
  id: z.ZodUUID;
136
173
  text: z.ZodString;
137
174
  createdAt: z.ZodISODateTime;
@@ -164,6 +201,7 @@ export declare const conversationInspectResultSchema: z.ZodObject<{
164
201
  status: z.ZodEnum<{
165
202
  cancelled: "cancelled";
166
203
  "completed-without-reply": "completed-without-reply";
204
+ deleted: "deleted";
167
205
  destroyed: "destroyed";
168
206
  failed: "failed";
169
207
  "human-fallback": "human-fallback";
@@ -176,6 +214,7 @@ export declare const conversationInspectResultSchema: z.ZodObject<{
176
214
  replyId: z.ZodOptional<z.ZodUUID>;
177
215
  }, z.core.$strict>>;
178
216
  hint: z.ZodOptional<z.ZodString>;
217
+ nextBefore: z.ZodOptional<z.ZodString>;
179
218
  }, z.core.$strict>;
180
219
  export type ConversationInspectResult = z.infer<typeof conversationInspectResultSchema>;
181
220
  export declare const inboxReserveResultSchema: z.ZodObject<{
@@ -189,6 +228,10 @@ export declare const inboxReserveResultSchema: z.ZodObject<{
189
228
  request: "request";
190
229
  }>;
191
230
  requestId: z.ZodOptional<z.ZodUUID>;
231
+ relationship: z.ZodOptional<z.ZodEnum<{
232
+ family: "family";
233
+ peer: "peer";
234
+ }>>;
192
235
  id: z.ZodUUID;
193
236
  text: z.ZodString;
194
237
  createdAt: z.ZodISODateTime;
@@ -221,6 +264,7 @@ export declare const inboxReserveResultSchema: z.ZodObject<{
221
264
  status: z.ZodEnum<{
222
265
  cancelled: "cancelled";
223
266
  "completed-without-reply": "completed-without-reply";
267
+ deleted: "deleted";
224
268
  destroyed: "destroyed";
225
269
  failed: "failed";
226
270
  "human-fallback": "human-fallback";
@@ -280,6 +324,10 @@ export declare const conversationSendResultSchema: z.ZodObject<{
280
324
  request: "request";
281
325
  }>;
282
326
  requestId: z.ZodOptional<z.ZodUUID>;
327
+ relationship: z.ZodOptional<z.ZodEnum<{
328
+ family: "family";
329
+ peer: "peer";
330
+ }>>;
283
331
  id: z.ZodUUID;
284
332
  text: z.ZodString;
285
333
  createdAt: z.ZodISODateTime;
@@ -318,6 +366,7 @@ export declare const conversationSendResultSchema: z.ZodObject<{
318
366
  status: z.ZodEnum<{
319
367
  cancelled: "cancelled";
320
368
  "completed-without-reply": "completed-without-reply";
369
+ deleted: "deleted";
321
370
  destroyed: "destroyed";
322
371
  failed: "failed";
323
372
  "human-fallback": "human-fallback";
@@ -333,6 +382,7 @@ export declare const conversationSendResultSchema: z.ZodObject<{
333
382
  export type ConversationSendResult = z.infer<typeof conversationSendResultSchema>;
334
383
  export declare const conversationInspectRequestSchema: z.ZodObject<{
335
384
  recipientRunId: z.ZodUUID;
385
+ before: z.ZodOptional<z.ZodString>;
336
386
  }, z.core.$strict>;
337
387
  export type ConversationInspectRequest = z.infer<typeof conversationInspectRequestSchema>;
338
388
  export declare const conversationCancelRequestSchema: z.ZodObject<{
@@ -48,6 +48,7 @@ export declare const workerWaitSchema: z.ZodObject<{
48
48
  status: z.ZodEnum<{
49
49
  cancelled: "cancelled";
50
50
  "completed-without-reply": "completed-without-reply";
51
+ deleted: "deleted";
51
52
  destroyed: "destroyed";
52
53
  failed: "failed";
53
54
  "human-fallback": "human-fallback";
@@ -629,6 +630,10 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
629
630
  request: "request";
630
631
  }>;
631
632
  requestId: z.ZodOptional<z.ZodUUID>;
633
+ relationship: z.ZodOptional<z.ZodEnum<{
634
+ family: "family";
635
+ peer: "peer";
636
+ }>>;
632
637
  id: z.ZodUUID;
633
638
  text: z.ZodString;
634
639
  createdAt: z.ZodISODateTime;
@@ -661,6 +666,7 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
661
666
  status: z.ZodEnum<{
662
667
  cancelled: "cancelled";
663
668
  "completed-without-reply": "completed-without-reply";
669
+ deleted: "deleted";
664
670
  destroyed: "destroyed";
665
671
  failed: "failed";
666
672
  "human-fallback": "human-fallback";
@@ -705,6 +711,7 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
705
711
  status: z.ZodEnum<{
706
712
  cancelled: "cancelled";
707
713
  "completed-without-reply": "completed-without-reply";
714
+ deleted: "deleted";
708
715
  destroyed: "destroyed";
709
716
  failed: "failed";
710
717
  "human-fallback": "human-fallback";
@@ -760,6 +767,7 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
760
767
  status: z.ZodEnum<{
761
768
  cancelled: "cancelled";
762
769
  "completed-without-reply": "completed-without-reply";
770
+ deleted: "deleted";
763
771
  destroyed: "destroyed";
764
772
  failed: "failed";
765
773
  "human-fallback": "human-fallback";
@@ -850,6 +858,7 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
850
858
  status: z.ZodEnum<{
851
859
  cancelled: "cancelled";
852
860
  "completed-without-reply": "completed-without-reply";
861
+ deleted: "deleted";
853
862
  destroyed: "destroyed";
854
863
  failed: "failed";
855
864
  "human-fallback": "human-fallback";
@@ -905,6 +914,7 @@ export declare const delegationStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject
905
914
  status: z.ZodEnum<{
906
915
  cancelled: "cancelled";
907
916
  "completed-without-reply": "completed-without-reply";
917
+ deleted: "deleted";
908
918
  destroyed: "destroyed";
909
919
  failed: "failed";
910
920
  "human-fallback": "human-fallback";
@@ -1103,6 +1113,10 @@ export declare const agentInputSchema: z.ZodObject<{
1103
1113
  request: "request";
1104
1114
  }>;
1105
1115
  requestId: z.ZodOptional<z.ZodUUID>;
1116
+ relationship: z.ZodOptional<z.ZodEnum<{
1117
+ family: "family";
1118
+ peer: "peer";
1119
+ }>>;
1106
1120
  }, z.core.$strict>>;
1107
1121
  id: z.ZodUUID;
1108
1122
  source: z.ZodEnum<{
@@ -1179,6 +1193,7 @@ export declare const workerInspectionSchema: z.ZodObject<{
1179
1193
  status: z.ZodEnum<{
1180
1194
  cancelled: "cancelled";
1181
1195
  "completed-without-reply": "completed-without-reply";
1196
+ deleted: "deleted";
1182
1197
  destroyed: "destroyed";
1183
1198
  failed: "failed";
1184
1199
  "human-fallback": "human-fallback";
@@ -1559,6 +1574,7 @@ export declare const runRelationshipsSchema: z.ZodObject<{
1559
1574
  status: z.ZodEnum<{
1560
1575
  cancelled: "cancelled";
1561
1576
  "completed-without-reply": "completed-without-reply";
1577
+ deleted: "deleted";
1562
1578
  destroyed: "destroyed";
1563
1579
  failed: "failed";
1564
1580
  "human-fallback": "human-fallback";
@@ -1768,6 +1784,7 @@ export declare const workerWaitResultSchema: z.ZodObject<{
1768
1784
  status: z.ZodEnum<{
1769
1785
  cancelled: "cancelled";
1770
1786
  "completed-without-reply": "completed-without-reply";
1787
+ deleted: "deleted";
1771
1788
  destroyed: "destroyed";
1772
1789
  failed: "failed";
1773
1790
  "human-fallback": "human-fallback";
@@ -1832,6 +1849,7 @@ export declare const workerCancelWaitResultSchema: z.ZodObject<{
1832
1849
  status: z.ZodEnum<{
1833
1850
  cancelled: "cancelled";
1834
1851
  "completed-without-reply": "completed-without-reply";
1852
+ deleted: "deleted";
1835
1853
  destroyed: "destroyed";
1836
1854
  failed: "failed";
1837
1855
  "human-fallback": "human-fallback";
@@ -40,6 +40,10 @@ export declare const conversationMessageEventSchema: z.ZodObject<{
40
40
  request: "request";
41
41
  }>;
42
42
  requestId: z.ZodOptional<z.ZodUUID>;
43
+ relationship: z.ZodOptional<z.ZodEnum<{
44
+ family: "family";
45
+ peer: "peer";
46
+ }>>;
43
47
  id: z.ZodUUID;
44
48
  text: z.ZodString;
45
49
  createdAt: z.ZodISODateTime;
@@ -87,6 +91,7 @@ export declare const requestOutcomeEventSchema: z.ZodObject<{
87
91
  status: z.ZodEnum<{
88
92
  cancelled: "cancelled";
89
93
  "completed-without-reply": "completed-without-reply";
94
+ deleted: "deleted";
90
95
  destroyed: "destroyed";
91
96
  failed: "failed";
92
97
  "human-fallback": "human-fallback";
@@ -116,6 +121,10 @@ export declare const agentInputEventSchema: z.ZodObject<{
116
121
  request: "request";
117
122
  }>;
118
123
  requestId: z.ZodOptional<z.ZodUUID>;
124
+ relationship: z.ZodOptional<z.ZodEnum<{
125
+ family: "family";
126
+ peer: "peer";
127
+ }>>;
119
128
  }, z.core.$strict>>;
120
129
  id: z.ZodUUID;
121
130
  source: z.ZodEnum<{
@@ -34,11 +34,13 @@ var askRequestSchema = z.object({
34
34
  }).strict();
35
35
 
36
36
  // ../contract/src/conversations.ts
37
+ var conversationRelationshipSchema = z2.enum(["family", "peer"]);
37
38
  var conversationAttributionSchema = z2.object({
38
39
  senderRunId: z2.uuid(),
39
40
  recipientRunId: z2.uuid(),
40
41
  kind: z2.enum(["request", "progress", "follow-up", "reply"]),
41
- requestId: z2.uuid().optional()
42
+ requestId: z2.uuid().optional(),
43
+ relationship: conversationRelationshipSchema.optional()
42
44
  }).strict();
43
45
  var conversationMessageSchema = conversationAttributionSchema.extend({
44
46
  id: z2.uuid(),
@@ -55,12 +57,28 @@ var conversationMessageSchema = conversationAttributionSchema.extend({
55
57
  });
56
58
  var requestOutcomeSchema = z2.object({
57
59
  requestId: z2.uuid(),
58
- status: z2.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback"]),
60
+ /** `deleted`: a peer recipient's record was deleted while the request was open. */
61
+ status: z2.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback", "deleted"]),
59
62
  observedAt: z2.iso.datetime(),
60
63
  replyId: z2.uuid().optional()
61
64
  }).strict();
62
65
  var conversationStateSchema = z2.object({ messages: z2.array(conversationMessageSchema).max(1024), outcomes: z2.array(requestOutcomeSchema).max(1024) }).strict();
63
- var conversationInspectResultSchema = conversationStateSchema.extend({ hint: z2.string().optional() });
66
+ var CURSOR = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)~([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
67
+ var conversationCursorSchema = z2.string().max(128).regex(CURSOR, "Not a history cursor; pass nextBefore from an earlier page");
68
+ function encodeConversationCursor(message2) {
69
+ return `${message2.createdAt}~${message2.id}`;
70
+ }
71
+ function decodeConversationCursor(cursor) {
72
+ const match = CURSOR.exec(cursor);
73
+ if (!match) throw new Error("Not a history cursor");
74
+ return { createdAt: match[1], id: match[2] };
75
+ }
76
+ var CONVERSATION_PAGE_MESSAGES = 1024;
77
+ var conversationInspectResultSchema = conversationStateSchema.extend({
78
+ hint: z2.string().optional(),
79
+ /** Present when older messages exist: pass it as `before` to read the page before this one. */
80
+ nextBefore: conversationCursorSchema.optional()
81
+ });
64
82
  var inboxReserveResultSchema = z2.object({
65
83
  messages: z2.array(conversationMessageSchema).max(32),
66
84
  outcomes: z2.array(requestOutcomeSchema).max(32),
@@ -88,7 +106,7 @@ var conversationSendRequestSchema = z2.object({
88
106
  resume: z2.boolean().optional()
89
107
  }).strict().refine((value) => value.timeoutSeconds <= MAX_CONVERSATION_REQUEST_SECONDS || value.resume === true && value.kind === "request", { path: ["timeoutSeconds"], message: "Only --resume requests accept deadlines above 1800 seconds (maximum 86400)" }).refine((value) => (value.kind === "reply" || value.kind === "follow-up") === (value.requestId !== void 0), { message: "Replies and follow-ups require a request ID; new messages must omit it" }).refine((value) => !value.resume || value.kind === "request" || value.kind === "progress", { message: "--resume requires a new request or progress instruction" });
90
108
  var conversationSendResultSchema = z2.object({ message: conversationMessageSchema, delivery: z2.enum(["queued", "delivered", "consumed", "not-delivered"]), outcome: requestOutcomeSchema.optional() }).strict();
91
- var conversationInspectRequestSchema = z2.object({ recipientRunId: z2.uuid() }).strict();
109
+ var conversationInspectRequestSchema = z2.object({ recipientRunId: z2.uuid(), before: conversationCursorSchema.optional() }).strict();
92
110
  var conversationCancelRequestSchema = z2.object({ requestId: z2.uuid() }).strict();
93
111
  var requestWaitRequestSchema = z2.object({
94
112
  requestIds: z2.array(z2.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length),
@@ -5279,6 +5297,7 @@ export {
5279
5297
  ATTENTION_RUNGS,
5280
5298
  CI_WAIT_LIMITATION,
5281
5299
  CI_WAIT_RECEIPT_INSTRUCTION,
5300
+ CONVERSATION_PAGE_MESSAGES,
5282
5301
  DEFAULT_AGENT_ACCOUNT_ID,
5283
5302
  DEFAULT_CONVERSATION_REQUEST_SECONDS,
5284
5303
  DEFAULT_WEBHOOK_TRIGGERS,
@@ -5464,10 +5483,12 @@ export {
5464
5483
  continueSchema,
5465
5484
  conversationAttributionSchema,
5466
5485
  conversationCancelRequestSchema,
5486
+ conversationCursorSchema,
5467
5487
  conversationInspectRequestSchema,
5468
5488
  conversationInspectResultSchema,
5469
5489
  conversationMessageEventSchema,
5470
5490
  conversationMessageSchema,
5491
+ conversationRelationshipSchema,
5471
5492
  conversationSendRequestSchema,
5472
5493
  conversationSendResultSchema,
5473
5494
  conversationStateSchema,
@@ -5482,6 +5503,7 @@ export {
5482
5503
  createRunInputSchema,
5483
5504
  createRunResponseSchema,
5484
5505
  cronOf,
5506
+ decodeConversationCursor,
5485
5507
  defined,
5486
5508
  delegationErrorResponseSchema,
5487
5509
  delegationStateSchema,
@@ -5501,6 +5523,7 @@ export {
5501
5523
  editQueuedMessageResponseSchema,
5502
5524
  effortFieldSchema,
5503
5525
  effortLevelSchema,
5526
+ encodeConversationCursor,
5504
5527
  engineOwnsRun,
5505
5528
  exactLineIndex,
5506
5529
  fileLinkQuerySchema,