@wjarka/cezarion 0.14.6 → 0.14.7-pr488.741

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 (126) hide show
  1. package/README.md +37 -2
  2. package/dist/agent-config/model-settings/shared.d.ts +2 -1
  3. package/dist/agent-config/model-settings/shared.js +1 -1
  4. package/dist/agent-config/model-settings/shared.js.map +1 -1
  5. package/dist/ci-wait/client.d.ts +4 -0
  6. package/dist/ci-wait/client.js +67 -0
  7. package/dist/ci-wait/client.js.map +1 -0
  8. package/dist/ci-wait/controller.d.ts +78 -0
  9. package/dist/ci-wait/controller.js +148 -0
  10. package/dist/ci-wait/controller.js.map +1 -0
  11. package/dist/ci-wait/github.d.ts +61 -0
  12. package/dist/ci-wait/github.js +209 -0
  13. package/dist/ci-wait/github.js.map +1 -0
  14. package/dist/ci-wait/injection.d.ts +3 -0
  15. package/dist/ci-wait/injection.js +26 -0
  16. package/dist/ci-wait/injection.js.map +1 -0
  17. package/dist/ci-wait/mcp.d.ts +97 -0
  18. package/dist/ci-wait/mcp.js +35 -0
  19. package/dist/ci-wait/mcp.js.map +1 -0
  20. package/dist/ci-wait/resources.d.ts +7 -0
  21. package/dist/ci-wait/resources.js +32 -0
  22. package/dist/ci-wait/resources.js.map +1 -0
  23. package/dist/ci-wait/supervisor.d.ts +21 -0
  24. package/dist/ci-wait/supervisor.js +163 -0
  25. package/dist/ci-wait/supervisor.js.map +1 -0
  26. package/dist/contract/ci-wait.d.ts +151 -0
  27. package/dist/contract/conversations.d.ts +105 -0
  28. package/dist/contract/delegation.d.ts +17 -0
  29. package/dist/contract/events.d.ts +10 -0
  30. package/dist/contract/index.d.ts +1 -0
  31. package/dist/contract/index.js +1046 -936
  32. package/dist/contract/runs.d.ts +496 -0
  33. package/dist/contract/skills.d.ts +99 -0
  34. package/dist/core/agent-env.js +2 -0
  35. package/dist/core/agent-env.js.map +1 -1
  36. package/dist/core/agent-runner.d.ts +6 -0
  37. package/dist/core/agent-runner.js +1 -0
  38. package/dist/core/agent-runner.js.map +1 -1
  39. package/dist/core/claude-cli-runner.js +10 -0
  40. package/dist/core/claude-cli-runner.js.map +1 -1
  41. package/dist/core/codex-app-server-runner.js +5 -1
  42. package/dist/core/codex-app-server-runner.js.map +1 -1
  43. package/dist/core/codex-app-server-transport.js +3 -1
  44. package/dist/core/codex-app-server-transport.js.map +1 -1
  45. package/dist/core/cursor-acp-runner.js +9 -1
  46. package/dist/core/cursor-acp-runner.js.map +1 -1
  47. package/dist/core/opencode-server-runner.js +6 -2
  48. package/dist/core/opencode-server-runner.js.map +1 -1
  49. package/dist/core/pi-runner.js +7 -1
  50. package/dist/core/pi-runner.js.map +1 -1
  51. package/dist/delegation/cli.js +110 -10
  52. package/dist/delegation/cli.js.map +1 -1
  53. package/dist/delegation/conversations.js +2 -1
  54. package/dist/delegation/conversations.js.map +1 -1
  55. package/dist/delegation/input.d.ts +7 -0
  56. package/dist/delegation/input.js +27 -0
  57. package/dist/delegation/input.js.map +1 -1
  58. package/dist/delegation/provision.js +4 -1
  59. package/dist/delegation/provision.js.map +1 -1
  60. package/dist/delegation/routes.d.ts +78 -0
  61. package/dist/delegation/routes.js +4 -1
  62. package/dist/delegation/routes.js.map +1 -1
  63. package/dist/delegation/service.d.ts +6 -2
  64. package/dist/delegation/service.js +113 -9
  65. package/dist/delegation/service.js.map +1 -1
  66. package/dist/delegation/transport.d.ts +78 -0
  67. package/dist/runs/delegation-state.d.ts +2 -0
  68. package/dist/runs/run-index.js +2 -3
  69. package/dist/runs/run-index.js.map +1 -1
  70. package/dist/runs/store.d.ts +534 -3
  71. package/dist/runs/store.js +186 -6
  72. package/dist/runs/store.js.map +1 -1
  73. package/dist/server/server.d.ts +1530 -12
  74. package/dist/workflows/run.d.ts +39 -1
  75. package/dist/workflows/run.js +606 -50
  76. package/dist/workflows/run.js.map +1 -1
  77. package/package.json +4 -3
  78. package/scripts/mock-ci-tool.mjs +53 -0
  79. package/scripts/mock-claude.mjs +8 -0
  80. package/scripts/mock-codex-app-server.mjs +212 -0
  81. package/scripts/mock-cursor-acp.mjs +6 -2
  82. package/scripts/mock-opencode-serve.mjs +392 -0
  83. package/scripts/mock-pi-rpc.mjs +7 -0
  84. package/scripts/pi-ci-wait.mjs +14 -0
  85. package/web/dist/assets/{agent-accounts-lP_xK83o.js → agent-accounts-DveiLHoy.js} +1 -1
  86. package/web/dist/assets/{alert-dialog-CmDuefYh.js → alert-dialog-BRmsCA3M.js} +1 -1
  87. package/web/dist/assets/{collapsible-BqX8REmY.js → collapsible-BWfM2PdZ.js} +1 -1
  88. package/web/dist/assets/{commit-list-BWvv1H7A.js → commit-list-C-rCgcKm.js} +1 -1
  89. package/web/dist/assets/{compare-variants-Bg7eLW3z.js → compare-variants-Ccp9IYp-.js} +1 -1
  90. package/web/dist/assets/{diff-0GBum40Q2.js → diff-BvZErqfg2.js} +2 -2
  91. package/web/dist/assets/{diff-controls-HwWHHait.js → diff-controls-BFI8ngtw.js} +1 -1
  92. package/web/dist/assets/{diff-stat-mNkhAc5m.js → diff-stat-CVFxf2Ar.js} +1 -1
  93. package/web/dist/assets/{diff-view-DW64doDY.js → diff-view-B35r8kQK.js} +1 -1
  94. package/web/dist/assets/{dropdown-menu-sZjYPcLh.js → dropdown-menu-C_fj6kzP.js} +1 -1
  95. package/web/dist/assets/{git-toolbar-DBW5EIcY.js → git-toolbar-BaqAvRC1.js} +1 -1
  96. package/web/dist/assets/{github-CkZ4hWI5.js → github-DIkBazPA.js} +1 -1
  97. package/web/dist/assets/{image-preview-DZicGNkU.js → image-preview-BBqbaKaq.js} +1 -1
  98. package/web/dist/assets/{index-DWWI-B9n.js → index-BIae70yp.js} +3 -3
  99. package/web/dist/assets/index-CXZukB1O.css +1 -0
  100. package/web/dist/assets/{markdown-AY2K3kIV.js → markdown-kouQNPB6.js} +1 -1
  101. package/web/dist/assets/{pill-CcJqA1cL.js → pill-mHX_rKXP.js} +1 -1
  102. package/web/dist/assets/{project-router-SwsXRKXs.js → project-router-Ds9EvxjN.js} +1 -1
  103. package/web/dist/assets/{prompt-templates-iV2WD2jy.js → prompt-templates-AaKKdIiY.js} +1 -1
  104. package/web/dist/assets/{repo-git-BW3TOs3U.js → repo-git-6StCwqhj.js} +1 -1
  105. package/web/dist/assets/{run-diff-DPUNj56q.js → run-diff-fChfUdwr.js} +1 -1
  106. package/web/dist/assets/run-header-B3ZPhDZr.js +1 -0
  107. package/web/dist/assets/{run-header-CSaJIGXl.css → run-header-BJQfFL2l.css} +1 -1
  108. package/web/dist/assets/{skills-Dv8Vwv5D.js → skills-DSWaVvcu.js} +1 -1
  109. package/web/dist/assets/{tab-link-DSftvkZS.js → tab-link-Db6yDTIQ.js} +1 -1
  110. package/web/dist/assets/{task-changes-CTCuVls1.js → task-changes-DdmerESW.js} +1 -1
  111. package/web/dist/assets/{task-commits-weJQ5GSl.js → task-commits-Co-bb1P6.js} +1 -1
  112. package/web/dist/assets/{task-files-B4bUimY8.js → task-files-B2KASfyL.js} +1 -1
  113. package/web/dist/assets/{task-thread-BuXrVB9K.js → task-thread-8kGLJO4Q.js} +4 -4
  114. package/web/dist/assets/task-thread-Dc3wplva.css +1 -0
  115. package/web/dist/assets/{textarea-CxRdTWlq.js → textarea-Qhdzn_oU.js} +1 -1
  116. package/web/dist/assets/thread-loading-C6ENzZYk.js +1 -0
  117. package/web/dist/assets/{token-metrics-Z3UFYbuD.js → token-metrics-BsT6Rqji.js} +1 -1
  118. package/web/dist/assets/utils-VFstALJW.js +64 -0
  119. package/web/dist/assets/{workflows-vA27Yi8W.js → workflows-UKoofNFJ.js} +1 -1
  120. package/web/dist/assets/{zoomable-image-DUE1KFJ0.js → zoomable-image-DpL5gtv4.js} +1 -1
  121. package/web/dist/index.html +14 -14
  122. package/web/dist/assets/index-DK0Mkv2m.css +0 -1
  123. package/web/dist/assets/run-header-DbDluWoV.js +0 -1
  124. package/web/dist/assets/task-thread-DMRD0IVt.css +0 -1
  125. package/web/dist/assets/thread-loading-JlP6dUpX.js +0 -1
  126. package/web/dist/assets/utils-CUnaAifW.js +0 -64
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { z } from 'zod';
3
- import type { ConversationState, AgentInput, DelegationState, WorkerCollectedResult } from '../contract/index.js';
3
+ import type { CiWait, ConversationState, AgentInput, InboxClaim, DelegationState, WorkerCollectedResult } from '../contract/index.js';
4
4
  import { type WorkerExecutionIdentity } from '../delegation/execution-identity.ts';
5
5
  import { workflowDefSchema } from '../workflows/types.ts';
6
6
  import type { RunnerId } from '../core/agent-runner.ts';
@@ -96,6 +96,7 @@ export declare const runRecordSchema: z.ZodObject<{
96
96
  human: "human";
97
97
  lifecycle: "lifecycle";
98
98
  }>>;
99
+ agentInputId: z.ZodOptional<z.ZodUUID>;
99
100
  }, z.core.$strip>>;
100
101
  invalidAsk: z.ZodOptional<z.ZodBoolean>;
101
102
  delegation: z.ZodCatch<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -122,6 +123,8 @@ export declare const runRecordSchema: z.ZodObject<{
122
123
  destroyed: "destroyed";
123
124
  late: "late";
124
125
  }>;
126
+ resumed: z.ZodOptional<z.ZodLiteral<true>>;
127
+ instruction: z.ZodOptional<z.ZodString>;
125
128
  }, z.core.$strict>>;
126
129
  outcomes: z.ZodArray<z.ZodObject<{
127
130
  requestId: z.ZodUUID;
@@ -483,7 +486,103 @@ export declare const runRecordSchema: z.ZodObject<{
483
486
  text: z.ZodString;
484
487
  createdAt: z.ZodISODateTime;
485
488
  deliveredAt: z.ZodOptional<z.ZodISODateTime>;
489
+ inboxClaim: z.ZodOptional<z.ZodObject<{
490
+ receiptId: z.ZodUUID;
491
+ generation: z.ZodUUID;
492
+ expiresAt: z.ZodISODateTime;
493
+ acknowledgedAt: z.ZodOptional<z.ZodISODateTime>;
494
+ memberIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
495
+ }, z.core.$strict>>;
486
496
  }, z.core.$strict>>>;
497
+ ciWait: z.ZodOptional<z.ZodObject<{
498
+ prUrl: z.ZodString;
499
+ repository: z.ZodString;
500
+ prNumber: z.ZodNumber;
501
+ headSha: z.ZodString;
502
+ id: z.ZodUUID;
503
+ generation: z.ZodString;
504
+ turnId: z.ZodString;
505
+ timeoutSeconds: z.ZodNumber;
506
+ registeredAt: z.ZodISODateTime;
507
+ deadline: z.ZodISODateTime;
508
+ phase: z.ZodEnum<{
509
+ delivered: "delivered";
510
+ parked: "parked";
511
+ registered: "registered";
512
+ "wake-pending": "wake-pending";
513
+ withdrawn: "withdrawn";
514
+ }>;
515
+ result: z.ZodOptional<z.ZodObject<{
516
+ outcome: z.ZodEnum<{
517
+ cancelled: "cancelled";
518
+ deadline: "deadline";
519
+ error: "error";
520
+ failed: "failed";
521
+ head_changed: "head_changed";
522
+ no_checks: "no_checks";
523
+ passed: "passed";
524
+ skipped: "skipped";
525
+ }>;
526
+ headSha: z.ZodString;
527
+ observedHeadSha: z.ZodOptional<z.ZodString>;
528
+ observedAt: z.ZodISODateTime;
529
+ checks: z.ZodArray<z.ZodObject<{
530
+ name: z.ZodString;
531
+ state: z.ZodString;
532
+ link: z.ZodString;
533
+ }, z.core.$strict>>;
534
+ totalChecks: z.ZodNumber;
535
+ truncated: z.ZodBoolean;
536
+ diagnostic: z.ZodOptional<z.ZodString>;
537
+ }, z.core.$strict>>;
538
+ wakeId: z.ZodOptional<z.ZodString>;
539
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
540
+ }, z.core.$strict>>;
541
+ lastCiWait: z.ZodOptional<z.ZodObject<{
542
+ prUrl: z.ZodString;
543
+ repository: z.ZodString;
544
+ prNumber: z.ZodNumber;
545
+ headSha: z.ZodString;
546
+ id: z.ZodUUID;
547
+ generation: z.ZodString;
548
+ turnId: z.ZodString;
549
+ timeoutSeconds: z.ZodNumber;
550
+ registeredAt: z.ZodISODateTime;
551
+ deadline: z.ZodISODateTime;
552
+ phase: z.ZodEnum<{
553
+ delivered: "delivered";
554
+ parked: "parked";
555
+ registered: "registered";
556
+ "wake-pending": "wake-pending";
557
+ withdrawn: "withdrawn";
558
+ }>;
559
+ result: z.ZodOptional<z.ZodObject<{
560
+ outcome: z.ZodEnum<{
561
+ cancelled: "cancelled";
562
+ deadline: "deadline";
563
+ error: "error";
564
+ failed: "failed";
565
+ head_changed: "head_changed";
566
+ no_checks: "no_checks";
567
+ passed: "passed";
568
+ skipped: "skipped";
569
+ }>;
570
+ headSha: z.ZodString;
571
+ observedHeadSha: z.ZodOptional<z.ZodString>;
572
+ observedAt: z.ZodISODateTime;
573
+ checks: z.ZodArray<z.ZodObject<{
574
+ name: z.ZodString;
575
+ state: z.ZodString;
576
+ link: z.ZodString;
577
+ }, z.core.$strict>>;
578
+ totalChecks: z.ZodNumber;
579
+ truncated: z.ZodBoolean;
580
+ diagnostic: z.ZodOptional<z.ZodString>;
581
+ }, z.core.$strict>>;
582
+ wakeId: z.ZodOptional<z.ZodString>;
583
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
584
+ }, z.core.$strict>>;
585
+ lastCiWaitError: z.ZodOptional<z.ZodString>;
487
586
  taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
488
587
  model: z.ZodOptional<z.ZodString>;
489
588
  effort: z.ZodOptional<z.ZodString>;
@@ -641,6 +740,422 @@ export declare const runRecordSchema: z.ZodObject<{
641
740
  path: z.ZodOptional<z.ZodString>;
642
741
  }, z.core.$strip>>>;
643
742
  }, z.core.$strip>;
743
+ /** Salvage CI state identically for live stores and the read-only workspace index. */
744
+ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
745
+ id: string;
746
+ title: string;
747
+ titleSummary?: string | undefined;
748
+ diffStat?: {
749
+ adds: number;
750
+ dels: number;
751
+ files: number;
752
+ repointed?: boolean | undefined;
753
+ } | undefined;
754
+ workflow: string;
755
+ task: string;
756
+ queuedMessages?: {
757
+ id: string;
758
+ text: string;
759
+ images?: string[] | undefined;
760
+ createdAt: string;
761
+ }[] | undefined;
762
+ continuationMessage?: {
763
+ id: string;
764
+ text: string;
765
+ images?: string[] | undefined;
766
+ createdAt: string;
767
+ origin?: "human" | "lifecycle" | undefined;
768
+ agentInputId?: string | undefined;
769
+ } | undefined;
770
+ invalidAsk?: boolean | undefined;
771
+ delegation?: {
772
+ role: "root";
773
+ conversation?: {
774
+ messages: {
775
+ senderRunId: string;
776
+ recipientRunId: string;
777
+ kind: "follow-up" | "progress" | "reply" | "request";
778
+ requestId?: string | undefined;
779
+ id: string;
780
+ text: string;
781
+ createdAt: string;
782
+ deadline?: string | undefined;
783
+ requestHash: string;
784
+ state: "accepted" | "continuation-required" | "destroyed" | "late";
785
+ resumed?: true | undefined;
786
+ instruction?: string | undefined;
787
+ }[];
788
+ outcomes: {
789
+ requestId: string;
790
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
791
+ observedAt: string;
792
+ replyId?: string | undefined;
793
+ }[];
794
+ } | undefined;
795
+ permissions: ("destroy" | "diff" | "inspect" | "spawn" | "steer" | "stop" | "wait")[];
796
+ receipts: {
797
+ requestId: string;
798
+ workerId: string;
799
+ requestHash: string;
800
+ deletion?: {
801
+ phase: "complete" | "pending";
802
+ revision: number;
803
+ resourceId: string;
804
+ generation: string;
805
+ } | undefined;
806
+ }[];
807
+ wait?: {
808
+ id: string;
809
+ workerIds: string[];
810
+ requestIds?: string[] | undefined;
811
+ requestOutcomes?: {
812
+ requestId: string;
813
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
814
+ observedAt: string;
815
+ replyId?: string | undefined;
816
+ }[] | undefined;
817
+ deadline: string;
818
+ mode?: "all" | "any" | "one" | undefined;
819
+ revisions?: {
820
+ workerId: string;
821
+ revision: number;
822
+ }[] | undefined;
823
+ reason?: "cancelled" | "message" | "outcome" | "timeout" | undefined;
824
+ phase: "parked" | "registered" | "wake-pending";
825
+ outcomes: {
826
+ workerId: string;
827
+ status: "cancelled" | "done" | "failed" | "review";
828
+ observedAt: string;
829
+ summary?: string | undefined;
830
+ revision?: number | undefined;
831
+ }[];
832
+ wakeId?: string | undefined;
833
+ } | undefined;
834
+ lastWait?: {
835
+ id: string;
836
+ workerIds: string[];
837
+ requestIds?: string[] | undefined;
838
+ requestOutcomes?: {
839
+ requestId: string;
840
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
841
+ observedAt: string;
842
+ replyId?: string | undefined;
843
+ }[] | undefined;
844
+ deadline: string;
845
+ mode?: "all" | "any" | "one" | undefined;
846
+ revisions?: {
847
+ workerId: string;
848
+ revision: number;
849
+ }[] | undefined;
850
+ reason?: "cancelled" | "message" | "outcome" | "timeout" | undefined;
851
+ phase: "parked" | "registered" | "wake-pending";
852
+ outcomes: {
853
+ workerId: string;
854
+ status: "cancelled" | "done" | "failed" | "review";
855
+ observedAt: string;
856
+ summary?: string | undefined;
857
+ revision?: number | undefined;
858
+ }[];
859
+ wakeId?: string | undefined;
860
+ } | undefined;
861
+ results?: {
862
+ workerId: string;
863
+ revision: number;
864
+ snapshotId: string;
865
+ observedAt: string;
866
+ lastExecutionOutcome: "cancelled" | "completed" | "failed" | "review-ready" | "running";
867
+ previous?: {
868
+ revision: number;
869
+ observedAt: string;
870
+ lastExecutionOutcome: "cancelled" | "completed" | "failed" | "review-ready" | "running";
871
+ } | undefined;
872
+ }[] | undefined;
873
+ finishRequestedAt?: string | undefined;
874
+ historyDeletion?: "pending" | undefined;
875
+ completion?: {
876
+ phase: "attention" | "waiting";
877
+ waitId?: string | undefined;
878
+ } | undefined;
879
+ } | {
880
+ role: "worker";
881
+ wait?: {
882
+ id: string;
883
+ workerIds: string[];
884
+ requestIds?: string[] | undefined;
885
+ requestOutcomes?: {
886
+ requestId: string;
887
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
888
+ observedAt: string;
889
+ replyId?: string | undefined;
890
+ }[] | undefined;
891
+ deadline: string;
892
+ mode?: "all" | "any" | "one" | undefined;
893
+ revisions?: {
894
+ workerId: string;
895
+ revision: number;
896
+ }[] | undefined;
897
+ reason?: "cancelled" | "message" | "outcome" | "timeout" | undefined;
898
+ phase: "parked" | "registered" | "wake-pending";
899
+ outcomes: {
900
+ workerId: string;
901
+ status: "cancelled" | "done" | "failed" | "review";
902
+ observedAt: string;
903
+ summary?: string | undefined;
904
+ revision?: number | undefined;
905
+ }[];
906
+ wakeId?: string | undefined;
907
+ } | undefined;
908
+ lastWait?: {
909
+ id: string;
910
+ workerIds: string[];
911
+ requestIds?: string[] | undefined;
912
+ requestOutcomes?: {
913
+ requestId: string;
914
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
915
+ observedAt: string;
916
+ replyId?: string | undefined;
917
+ }[] | undefined;
918
+ deadline: string;
919
+ mode?: "all" | "any" | "one" | undefined;
920
+ revisions?: {
921
+ workerId: string;
922
+ revision: number;
923
+ }[] | undefined;
924
+ reason?: "cancelled" | "message" | "outcome" | "timeout" | undefined;
925
+ phase: "parked" | "registered" | "wake-pending";
926
+ outcomes: {
927
+ workerId: string;
928
+ status: "cancelled" | "done" | "failed" | "review";
929
+ observedAt: string;
930
+ summary?: string | undefined;
931
+ revision?: number | undefined;
932
+ }[];
933
+ wakeId?: string | undefined;
934
+ } | undefined;
935
+ permissions: ("destroy" | "diff" | "inspect" | "spawn" | "steer" | "stop" | "wait")[];
936
+ parentRunId: string;
937
+ workspace: {
938
+ ownerRunId: string;
939
+ resourceId: string;
940
+ kind: "owned-isolated";
941
+ path: string;
942
+ branch: string;
943
+ baselineSha: string;
944
+ };
945
+ destroy?: {
946
+ requestedAt: string;
947
+ phase: "cleaning" | "complete" | "incomplete" | "requested" | "terminating";
948
+ remaining: ("branch" | "process" | "worktree")[];
949
+ error?: string | undefined;
950
+ } | undefined;
951
+ context?: {
952
+ text?: string | undefined;
953
+ inputs: {
954
+ source: {
955
+ kind: "baseline-file";
956
+ path: string;
957
+ } | {
958
+ kind: "parent-attachment";
959
+ id: string;
960
+ };
961
+ path: string;
962
+ sha256: string;
963
+ bytes: number;
964
+ }[];
965
+ } | undefined;
966
+ executionRevision?: number | undefined;
967
+ executionStartSeq?: number | undefined;
968
+ } | {
969
+ role: "invalid";
970
+ } | undefined;
971
+ agentInputs?: {
972
+ conversation?: {
973
+ senderRunId: string;
974
+ recipientRunId: string;
975
+ kind: "follow-up" | "progress" | "reply" | "request";
976
+ requestId?: string | undefined;
977
+ } | undefined;
978
+ id: string;
979
+ source: "agent" | "lifecycle";
980
+ parentRunId: string;
981
+ text: string;
982
+ createdAt: string;
983
+ deliveredAt?: string | undefined;
984
+ inboxClaim?: {
985
+ receiptId: string;
986
+ generation: string;
987
+ expiresAt: string;
988
+ acknowledgedAt?: string | undefined;
989
+ memberIds?: string[] | undefined;
990
+ } | undefined;
991
+ }[] | undefined;
992
+ ciWait?: {
993
+ prUrl: string;
994
+ repository: string;
995
+ prNumber: number;
996
+ headSha: string;
997
+ id: string;
998
+ generation: string;
999
+ turnId: string;
1000
+ timeoutSeconds: number;
1001
+ registeredAt: string;
1002
+ deadline: string;
1003
+ phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
1004
+ result?: {
1005
+ outcome: "cancelled" | "deadline" | "error" | "failed" | "head_changed" | "no_checks" | "passed" | "skipped";
1006
+ headSha: string;
1007
+ observedHeadSha?: string | undefined;
1008
+ observedAt: string;
1009
+ checks: {
1010
+ name: string;
1011
+ state: string;
1012
+ link: string;
1013
+ }[];
1014
+ totalChecks: number;
1015
+ truncated: boolean;
1016
+ diagnostic?: string | undefined;
1017
+ } | undefined;
1018
+ wakeId?: string | undefined;
1019
+ deliveredAt?: string | undefined;
1020
+ } | undefined;
1021
+ lastCiWait?: {
1022
+ prUrl: string;
1023
+ repository: string;
1024
+ prNumber: number;
1025
+ headSha: string;
1026
+ id: string;
1027
+ generation: string;
1028
+ turnId: string;
1029
+ timeoutSeconds: number;
1030
+ registeredAt: string;
1031
+ deadline: string;
1032
+ phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
1033
+ result?: {
1034
+ outcome: "cancelled" | "deadline" | "error" | "failed" | "head_changed" | "no_checks" | "passed" | "skipped";
1035
+ headSha: string;
1036
+ observedHeadSha?: string | undefined;
1037
+ observedAt: string;
1038
+ checks: {
1039
+ name: string;
1040
+ state: string;
1041
+ link: string;
1042
+ }[];
1043
+ totalChecks: number;
1044
+ truncated: boolean;
1045
+ diagnostic?: string | undefined;
1046
+ } | undefined;
1047
+ wakeId?: string | undefined;
1048
+ deliveredAt?: string | undefined;
1049
+ } | undefined;
1050
+ lastCiWaitError?: string | undefined;
1051
+ taskImages?: string[] | undefined;
1052
+ model?: string | undefined;
1053
+ effort?: string | undefined;
1054
+ modelIdentity?: string | undefined;
1055
+ runner?: "claude" | "codex" | "cursor" | "opencode" | "pi" | undefined;
1056
+ agentProfile?: string | undefined;
1057
+ systemPrompt?: string | undefined;
1058
+ generateFollowups?: boolean | undefined;
1059
+ autonomous?: boolean | undefined;
1060
+ automation?: {
1061
+ automationId: string;
1062
+ automationRevision: number;
1063
+ receiptId: string;
1064
+ event: string;
1065
+ githubUrl: string;
1066
+ } | undefined;
1067
+ status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
1068
+ stopping?: boolean | undefined;
1069
+ activity?: "monitoring" | undefined;
1070
+ hasPendingHumanAsk?: boolean | undefined;
1071
+ monitoringWakeAt?: string | undefined;
1072
+ monitoringWakeCapReached?: boolean | undefined;
1073
+ autoResumeAt?: string | undefined;
1074
+ autoResumeAttempts?: number | undefined;
1075
+ createdAt: string;
1076
+ startedAt?: string | undefined;
1077
+ finishedAt?: string | undefined;
1078
+ tokensUsed: number;
1079
+ inputTokens?: number | undefined;
1080
+ outputTokens?: number | undefined;
1081
+ costUsd?: number | undefined;
1082
+ pullRequestUrl?: string | undefined;
1083
+ referencedPullRequestUrl?: string | undefined;
1084
+ prNumber?: number | undefined;
1085
+ issueNumber?: number | undefined;
1086
+ referencedIssueNumberSeeded?: boolean | undefined;
1087
+ titleOrigin?: "auto" | "marker" | "user" | undefined;
1088
+ markerRefs?: {
1089
+ pr?: number | undefined;
1090
+ issue?: number | undefined;
1091
+ } | undefined;
1092
+ referencedPrCandidates?: string[] | undefined;
1093
+ referencedIssueUrl?: string | undefined;
1094
+ referencedIssueCandidates?: string[] | undefined;
1095
+ worktree?: false | undefined;
1096
+ worktreePath?: string | undefined;
1097
+ branch?: string | undefined;
1098
+ baseBranch?: string | undefined;
1099
+ worktreeReclaimedAt?: string | undefined;
1100
+ groupId?: string | undefined;
1101
+ variant?: string | undefined;
1102
+ peakRssBytes?: number | undefined;
1103
+ peakProcCount?: number | undefined;
1104
+ archived: boolean;
1105
+ archivedAt?: string | undefined;
1106
+ pinned?: boolean | undefined;
1107
+ pinnedAt?: string | undefined;
1108
+ seenAt?: string | undefined;
1109
+ currentStepId?: string | undefined;
1110
+ error?: string | undefined;
1111
+ steps: {
1112
+ id: string;
1113
+ name: string;
1114
+ kind: "agent" | "check";
1115
+ status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
1116
+ iterations: number;
1117
+ retriesUsed?: number | undefined;
1118
+ tokensUsed: number;
1119
+ inputTokens?: number | undefined;
1120
+ outputTokens?: number | undefined;
1121
+ usageInvocationsStarted?: number | undefined;
1122
+ usageInvocationsObserved?: number | undefined;
1123
+ usageTurnsStarted?: number | undefined;
1124
+ usageTurnsRecorded?: number | undefined;
1125
+ usageInvocationEpoch?: number | undefined;
1126
+ startedAt?: string | undefined;
1127
+ finishedAt?: string | undefined;
1128
+ error?: string | undefined;
1129
+ sessionId?: string | undefined;
1130
+ backend?: "claude" | "codex" | "cursor" | "opencode" | "pi" | undefined;
1131
+ profileId?: string | undefined;
1132
+ costUsd?: number | undefined;
1133
+ synthetic?: "continuation" | undefined;
1134
+ }[];
1135
+ workflowDef?: {
1136
+ name: string;
1137
+ description?: string | undefined;
1138
+ steps: {
1139
+ id: string;
1140
+ name?: string | undefined;
1141
+ prompt?: string | undefined;
1142
+ skill?: string | undefined;
1143
+ model?: string | undefined;
1144
+ effort?: string | undefined;
1145
+ runner?: "claude" | "codex" | "cursor" | "opencode" | "pi" | undefined;
1146
+ agentProfile?: string | undefined;
1147
+ allowedTools?: string[] | undefined;
1148
+ bashAllowlist?: string[] | undefined;
1149
+ command?: string | undefined;
1150
+ onFail?: {
1151
+ retry: string;
1152
+ max: number;
1153
+ } | undefined;
1154
+ }[];
1155
+ source: "built-in" | "file";
1156
+ path?: string | undefined;
1157
+ } | undefined;
1158
+ }[]>;
644
1159
  export type StepState = z.infer<typeof stepStateSchema>;
645
1160
  export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
646
1161
  export type RunRecord = z.infer<typeof runRecordSchema>;
@@ -746,7 +1261,19 @@ export declare class RunStore extends EventEmitter {
746
1261
  input: AgentInput;
747
1262
  }): void;
748
1263
  /** Observable atomic input checkpoint: a failed write publishes nothing. */
749
- commitAgentInputs(id: string, inputs: readonly AgentInput[]): void;
1264
+ commitAgentInputs(id: string, inputs: readonly AgentInput[], openingContinuationInputId?: string): void;
1265
+ /** Reserve only unread conversation inputs in one durable index replacement. */
1266
+ claimInboxInputs(runId: string, ids: readonly string[], claim: InboxClaim): void;
1267
+ /** A receipt owns every matching input or none; exact ACK retries preserve the first timestamp. */
1268
+ ackInboxInputs(runId: string, receiptId: string, generation: string, at: string): 'acknowledged' | 'already-acknowledged';
1269
+ releaseInboxInputs(runId: string, receiptId: string, generation: string): 'released';
1270
+ clearExpiredInboxClaims(runId: string, now: string): void;
1271
+ /** CI intent and its wake entry share one atomic index replacement. */
1272
+ commitCiWait(id: string, wait: CiWait, input?: AgentInput): void;
1273
+ /** Retire the wait and precisely its pending wake, optionally accepting human input. */
1274
+ commitCiWaitWithdrawal(id: string, acceptedHumanMessage?: QueuedMessage): void;
1275
+ /** Provider acceptance and receipt retirement have one delivery checkpoint. */
1276
+ commitCiWaitDelivery(id: string, inputId: string): void;
750
1277
  /** Retain the settled receipt and retire exactly one wait together with any human message that superseded it. */
751
1278
  commitWorkerWaitWithdrawal(id: string, waitId: string, acceptedHumanMessage?: QueuedMessage): void;
752
1279
  /** Successful deferred human delivery consumes only its persisted queue ID.
@@ -766,7 +1293,11 @@ export declare class RunStore extends EventEmitter {
766
1293
  delegation: DelegationState;
767
1294
  }>): void;
768
1295
  /** Accepted execution revision is public lifecycle identity, separate from process generations. */
769
- commitWorkerContinuation(id: string, patch: Partial<Omit<RunRecord, 'id' | 'steps' | 'delegation'>>, step?: Pick<StepState, 'id' | 'name' | 'kind' | 'synthetic'>): void;
1296
+ commitWorkerContinuation(id: string, patch: Partial<Omit<RunRecord, 'id' | 'steps' | 'delegation'>>, step?: Pick<StepState, 'id' | 'name' | 'kind' | 'synthetic'>, conversation?: {
1297
+ rootId: string;
1298
+ state: ConversationState;
1299
+ input: AgentInput;
1300
+ }): void;
770
1301
  private workerResultsDir;
771
1302
  workerResultSnapshotPath(parentId: string, workerId: string, snapshotId: string): string;
772
1303
  private readWorkerResultFile;