@hearsay-tools/squawk 0.18.0-dev.8057 → 0.18.0-dev.8071

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 (156) hide show
  1. package/dist/built-in-wait-kinds.d.ts +2 -1
  2. package/dist/built-in-wait-kinds.js +9 -5
  3. package/dist/built-in-wait-kinds.js.map +1 -1
  4. package/dist/ci-wait/pr-wait-kind.d.ts +65 -0
  5. package/dist/ci-wait/pr-wait-kind.js +120 -0
  6. package/dist/ci-wait/pr-wait-kind.js.map +1 -0
  7. package/dist/contract/conversations.d.ts +2 -0
  8. package/dist/contract/delegation.d.ts +57 -0
  9. package/dist/contract/index.js +187 -144
  10. package/dist/contract/run-predicates.d.ts +9 -0
  11. package/dist/contract/usage-limit-hold.d.ts +7 -0
  12. package/dist/contract/waits.d.ts +2 -2
  13. package/dist/delegation/cli.js +8 -4
  14. package/dist/delegation/cli.js.map +1 -1
  15. package/dist/delegation/conversation-send.js +15 -4
  16. package/dist/delegation/conversation-send.js.map +1 -1
  17. package/dist/delegation/conversations.js +6 -0
  18. package/dist/delegation/conversations.js.map +1 -1
  19. package/dist/delegation/execution-identity.d.ts +53 -9
  20. package/dist/delegation/execution-identity.js +165 -9
  21. package/dist/delegation/execution-identity.js.map +1 -1
  22. package/dist/delegation/park-notice.d.ts +29 -3
  23. package/dist/delegation/park-notice.js +32 -4
  24. package/dist/delegation/park-notice.js.map +1 -1
  25. package/dist/delegation/provision.js +3 -3
  26. package/dist/delegation/provision.js.map +1 -1
  27. package/dist/delegation/routes.d.ts +98 -79
  28. package/dist/delegation/service.d.ts +5 -0
  29. package/dist/delegation/service.js +93 -14
  30. package/dist/delegation/service.js.map +1 -1
  31. package/dist/delegation/transport.d.ts +23 -4
  32. package/dist/delegation/wait-kinds.d.ts +8 -0
  33. package/dist/delegation/wait-kinds.js +317 -0
  34. package/dist/delegation/wait-kinds.js.map +1 -0
  35. package/dist/delegation/worker-executions.d.ts +2 -0
  36. package/dist/delegation/worker-executions.js +5 -1
  37. package/dist/delegation/worker-executions.js.map +1 -1
  38. package/dist/runs/ports.d.ts +2 -0
  39. package/dist/runs/run-archive.d.ts +72 -72
  40. package/dist/server/live-routes.d.ts +6 -6
  41. package/dist/server/provider-action-gate.d.ts +8 -0
  42. package/dist/server/provider-action-gate.js +19 -2
  43. package/dist/server/provider-action-gate.js.map +1 -1
  44. package/dist/server/reports-api.d.ts +2 -2
  45. package/dist/server/run-accounts.d.ts +4 -3
  46. package/dist/server/run-accounts.js +20 -5
  47. package/dist/server/run-accounts.js.map +1 -1
  48. package/dist/server/runner-install-routes.d.ts +10 -10
  49. package/dist/server/server.d.ts +1386 -1372
  50. package/dist/server/server.js +3 -9
  51. package/dist/server/server.js.map +1 -1
  52. package/dist/workflows/continuation-admission.d.ts +7 -0
  53. package/dist/workflows/continuation-admission.js +21 -8
  54. package/dist/workflows/continuation-admission.js.map +1 -1
  55. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  56. package/dist/workflows/run/continuation-acceptance.d.ts +5 -1
  57. package/dist/workflows/run/continuation-acceptance.js +94 -29
  58. package/dist/workflows/run/continuation-acceptance.js.map +1 -1
  59. package/dist/workflows/run/launch-read-resolver.d.ts +6 -0
  60. package/dist/workflows/run/launch-read-resolver.js +13 -2
  61. package/dist/workflows/run/launch-read-resolver.js.map +1 -1
  62. package/dist/workflows/run/run-settlement.js +6 -0
  63. package/dist/workflows/run/run-settlement.js.map +1 -1
  64. package/dist/workflows/run/wait-engine.d.ts +95 -109
  65. package/dist/workflows/run/wait-engine.js +100 -212
  66. package/dist/workflows/run/wait-engine.js.map +1 -1
  67. package/dist/workflows/run/wait-kind-registry.d.ts +78 -2
  68. package/dist/workflows/run/wait-kind-registry.js.map +1 -1
  69. package/dist/workflows/run/wait-kinds.d.ts +390 -1011
  70. package/dist/workflows/run/wait-kinds.js +71 -188
  71. package/dist/workflows/run/wait-kinds.js.map +1 -1
  72. package/dist/workflows/run/wait-registration.d.ts +7 -0
  73. package/dist/workflows/run/wait-registration.js +2 -0
  74. package/dist/workflows/run/wait-registration.js.map +1 -1
  75. package/dist/workflows/run/wait-registry.d.ts +26 -36
  76. package/dist/workflows/run/wait-registry.js +71 -160
  77. package/dist/workflows/run/wait-registry.js.map +1 -1
  78. package/dist/workflows/run/worker-questions.d.ts +4 -0
  79. package/dist/workflows/run/worker-questions.js +42 -8
  80. package/dist/workflows/run/worker-questions.js.map +1 -1
  81. package/dist/workflows/waits.d.ts +2 -2
  82. package/dist/workflows/waits.js +2 -2
  83. package/dist/workflows/waits.js.map +1 -1
  84. package/package.json +4 -4
  85. package/web/dist/assets/{accounts-section-D3P_Z-Nu.js → accounts-section-BkKQ8sVH.js} +1 -1
  86. package/web/dist/assets/{activity-motion-BW-0k8s7.js → activity-motion-D80Uv4-Z.js} +1 -1
  87. package/web/dist/assets/{activity-route-Bpgblioe.js → activity-route-DVT8IWTR.js} +1 -1
  88. package/web/dist/assets/{agent-config-section-Cj3w7UIn.js → agent-config-section-BbwkJunW.js} +1 -1
  89. package/web/dist/assets/{agent-defaults-section-BJ4poe9c.js → agent-defaults-section-BLNTIZT_.js} +1 -1
  90. package/web/dist/assets/{appearance-BUsUTPF0.js → appearance-B6YBsmTo.js} +1 -1
  91. package/web/dist/assets/{archive-on-merge-field-D_kgBFNv.js → archive-on-merge-field-Bx1bEmI8.js} +1 -1
  92. package/web/dist/assets/attention-otQlgfRj.js +1 -0
  93. package/web/dist/assets/{automation-format-1lHzRTbq.js → automation-format-BsnXeUET.js} +1 -1
  94. package/web/dist/assets/automations-route-BOcGwfd4.js +1 -0
  95. package/web/dist/assets/{cez-idle-BY3rjM_y.js → cez-idle-Crszm9Ts.js} +1 -1
  96. package/web/dist/assets/{commit-diff-panel-xwLW6Ydr.js → commit-diff-panel-DKUnniap.js} +1 -1
  97. package/web/dist/assets/{diff-BB8SoL-s.js → diff-DUbLBjbg.js} +2 -2
  98. package/web/dist/assets/{diff-view-O8lx1ztb.js → diff-view-D_bjQyDl.js} +1 -1
  99. package/web/dist/assets/{file-preview-BS6M2tBo.js → file-preview-glEH09z8.js} +1 -1
  100. package/web/dist/assets/{folder-browser-Dsqz0Z1z.js → folder-browser-G_9ZgDjg.js} +1 -1
  101. package/web/dist/assets/{git-toolbar-DoPFA36c.js → git-toolbar-CTsmGICA.js} +1 -1
  102. package/web/dist/assets/{github-Bjy3WBvf.js → github-BqW9PaQO.js} +1 -1
  103. package/web/dist/assets/{global-activity-route-BXBZKz_9.js → global-activity-route-BP_Z7HNc.js} +1 -1
  104. package/web/dist/assets/index-DXIRYobS.js +21 -0
  105. package/web/dist/assets/{label-CZp8t0zE.js → label-BWld23ke.js} +1 -1
  106. package/web/dist/assets/live-protocol-BXzu6cSE.js +64 -0
  107. package/web/dist/assets/{markdown-KHcncamw.js → markdown-CT65TA_B.js} +1 -1
  108. package/web/dist/assets/{notifications-section-DD21Sd79.js → notifications-section-DuSzYLwP.js} +1 -1
  109. package/web/dist/assets/{open-in-menu-DdKs6X5r.js → open-in-menu-D03osLGE.js} +1 -1
  110. package/web/dist/assets/{preview-pane-connected-BvTZv2SQ.js → preview-pane-connected-DHmgDHId.js} +1 -1
  111. package/web/dist/assets/{project-location-B3LBvkz2.js → project-location-BM-6wMI3.js} +1 -1
  112. package/web/dist/assets/{project-router-CIKODSHW.js → project-router-DtTvMbeA.js} +1 -1
  113. package/web/dist/assets/project-scope-context-Dgq8_2JZ.js +4 -0
  114. package/web/dist/assets/{projects-section-C0k8kyb-.js → projects-section-Dr0xJWTm.js} +1 -1
  115. package/web/dist/assets/{prompt-templates-section-DNkosCni.js → prompt-templates-section-COKMgKMw.js} +1 -1
  116. package/web/dist/assets/queries-yuG-mM6_.js +1 -0
  117. package/web/dist/assets/{reference-chip-BWViAFIN.js → reference-chip-DTKtEtWv.js} +1 -1
  118. package/web/dist/assets/{remote-settings-notice-DPCENbhz.js → remote-settings-notice-BV_sPAXc.js} +1 -1
  119. package/web/dist/assets/{repo-git-jKOnO3ba.js → repo-git-BgXC4opq.js} +1 -1
  120. package/web/dist/assets/{report-reader-DXYiKNcg.js → report-reader-CtHvvSln.js} +1 -1
  121. package/web/dist/assets/{reports-DEE0bHNv.js → reports-CdbDUzkK.js} +1 -1
  122. package/web/dist/assets/{resources-section-lqXgYTrv.js → resources-section-C8KZ4hre.js} +1 -1
  123. package/web/dist/assets/{run-header-CXlUbvDO.js → run-header-RQYKdIMw.js} +1 -1
  124. package/web/dist/assets/runners-CDw7wLfd.js +1 -0
  125. package/web/dist/assets/{settings-agent-picker-BRvZn4kM.js → settings-agent-picker-3uuSf9LK.js} +1 -1
  126. package/web/dist/assets/{settings-shell-DTtd-vIa.js → settings-shell-DnYRfclU.js} +1 -1
  127. package/web/dist/assets/{sidebar-section-BFW4ZfBR.js → sidebar-section-CCg4QGtg.js} +1 -1
  128. package/web/dist/assets/{skills-AImMlT1T.js → skills-L01dfEnP.js} +1 -1
  129. package/web/dist/assets/{tab-link-CM6SDBtV.js → tab-link-Dl5Mmavw.js} +1 -1
  130. package/web/dist/assets/{task-changes-01Z_ppIw.js → task-changes-DWPWp6ZV.js} +1 -1
  131. package/web/dist/assets/{task-commits-DRNIum3J.js → task-commits-D576LERH.js} +1 -1
  132. package/web/dist/assets/{task-files-Crz7Fo3C.js → task-files-1EjplVVb.js} +1 -1
  133. package/web/dist/assets/{task-github-item-psG2V47c.js → task-github-item-BubKlTej.js} +1 -1
  134. package/web/dist/assets/task-groups-D4RYW5I_.js +1 -0
  135. package/web/dist/assets/task-thread-yWACZZAo.js +9 -0
  136. package/web/dist/assets/{tasks-table-DHTEGteC.js → tasks-table-DTNcYbbN.js} +1 -1
  137. package/web/dist/assets/{thread-state-BWJ2YyXo.js → thread-state-BiS8rKQ-.js} +1 -1
  138. package/web/dist/assets/{use-hand-to-agent-state-DNROQerR.js → use-hand-to-agent-state-BFx3SZia.js} +1 -1
  139. package/web/dist/assets/{useInfiniteQuery-qJeCNhM7.js → useInfiniteQuery-BnyaEFle.js} +1 -1
  140. package/web/dist/assets/useQuery-BUslvRIM.js +1 -0
  141. package/web/dist/assets/{workflows-Cx9lgrEo.js → workflows-DbuTPPz7.js} +1 -1
  142. package/web/dist/assets/{workspace-tools-CVitt3kE.js → workspace-tools-DPnEZoDL.js} +1 -1
  143. package/web/dist/assets/{worktrees-section-DxUg4l9n.js → worktrees-section-Vr8s9cio.js} +1 -1
  144. package/web/dist/assets/{ws-BisMp6U5.js → ws-Bal5BUy2.js} +1 -1
  145. package/web/dist/index.html +17 -17
  146. package/web/dist/live-worker.js +1 -1
  147. package/web/dist/assets/attention-lvUYNNvV.js +0 -1
  148. package/web/dist/assets/automations-route-CZaUrmDs.js +0 -1
  149. package/web/dist/assets/index-CmadQXcg.js +0 -21
  150. package/web/dist/assets/live-protocol-D9ji1YCl.js +0 -64
  151. package/web/dist/assets/project-scope-context-D1bpJixc.js +0 -4
  152. package/web/dist/assets/queries-dHXhD3Hc.js +0 -1
  153. package/web/dist/assets/runners-CGQjSsir.js +0 -1
  154. package/web/dist/assets/task-groups-DF0XoB6U.js +0 -1
  155. package/web/dist/assets/task-thread-Bqg91ZVZ.js +0 -9
  156. package/web/dist/assets/useQuery-C3CQhXsT.js +0 -1
@@ -27,6 +27,18 @@ export declare function delegationFailure(error: unknown): {
27
27
  export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
28
28
  "/list": {
29
29
  $get: {
30
+ output: {
31
+ error: string;
32
+ code?: "invalid_input" | undefined;
33
+ };
34
+ outputFormat: "json";
35
+ status: 400;
36
+ input: {
37
+ query: {
38
+ offset?: string | undefined;
39
+ };
40
+ };
41
+ } | {
30
42
  output: {
31
43
  workers: {
32
44
  workerId: string;
@@ -48,6 +60,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
48
60
  hostRunId: string;
49
61
  baselineSha: string;
50
62
  };
63
+ hold?: {
64
+ reason: "provider-error" | "usage-limit";
65
+ resumeAt: string;
66
+ attempts?: number | undefined;
67
+ error?: string | undefined;
68
+ } | undefined;
51
69
  destroy?: {
52
70
  requestedAt: string;
53
71
  phase: "cleaning" | "complete" | "incomplete" | "requested" | "terminating";
@@ -73,34 +91,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
73
91
  offset?: string | undefined;
74
92
  };
75
93
  };
76
- } | {
77
- output: {
78
- error: string;
79
- code?: "invalid_input" | undefined;
80
- };
81
- outputFormat: "json";
82
- status: 400;
83
- input: {
84
- query: {
85
- offset?: string | undefined;
86
- };
87
- };
88
94
  };
89
95
  };
90
96
  } & {
91
97
  "/discover": {
92
98
  $post: {
93
99
  output: {
94
- scope: "host-default-account";
95
- runners: {
96
- requiresAccountHome?: boolean | undefined;
97
- status: "connected" | "disconnected" | "not-installed" | "unknown";
98
- enabled?: boolean | undefined;
99
- hint?: string | undefined;
100
- authFailureId?: string | undefined;
101
- runner: string;
102
- }[];
103
- } | {
104
100
  runner: string;
105
101
  models: {
106
102
  id: string;
@@ -111,6 +107,16 @@ export declare function createDelegationRoutes(service: DelegationService, crede
111
107
  source: "cache" | "live" | "unavailable";
112
108
  stale: boolean;
113
109
  reason?: string | undefined;
110
+ } | {
111
+ scope: "host-default-account";
112
+ runners: {
113
+ requiresAccountHome?: boolean | undefined;
114
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
115
+ enabled?: boolean | undefined;
116
+ hint?: string | undefined;
117
+ authFailureId?: string | undefined;
118
+ runner: string;
119
+ }[];
114
120
  } | {
115
121
  tasks: {
116
122
  id: string;
@@ -232,13 +238,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
232
238
  status: 200;
233
239
  input: {
234
240
  json: {
235
- workerIds: string[];
236
- timeoutSeconds?: number | undefined;
237
- mode?: "all" | "any" | "one" | undefined;
238
- } | {
239
241
  requestIds: string[];
240
242
  mode?: "all" | "any" | "one" | undefined;
241
243
  timeoutSeconds?: number | undefined;
244
+ } | {
245
+ workerIds: string[];
246
+ timeoutSeconds?: number | undefined;
247
+ mode?: "all" | "any" | "one" | undefined;
242
248
  } | {
243
249
  peerIds: string[];
244
250
  timeoutSeconds?: number | undefined;
@@ -357,6 +363,8 @@ export declare function createDelegationRoutes(service: DelegationService, crede
357
363
  text: string;
358
364
  timeoutSeconds?: number | undefined;
359
365
  resume?: boolean | undefined;
366
+ model?: string | undefined;
367
+ effort?: string | undefined;
360
368
  };
361
369
  };
362
370
  };
@@ -414,6 +422,8 @@ export declare function createDelegationRoutes(service: DelegationService, crede
414
422
  text: string;
415
423
  timeoutSeconds?: number | undefined;
416
424
  resume?: boolean | undefined;
425
+ model?: string | undefined;
426
+ effort?: string | undefined;
417
427
  };
418
428
  };
419
429
  };
@@ -471,6 +481,8 @@ export declare function createDelegationRoutes(service: DelegationService, crede
471
481
  text: string;
472
482
  timeoutSeconds?: number | undefined;
473
483
  resume?: boolean | undefined;
484
+ model?: string | undefined;
485
+ effort?: string | undefined;
474
486
  };
475
487
  };
476
488
  };
@@ -629,6 +641,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
629
641
  } & {
630
642
  "/:workerId": {
631
643
  $get: {
644
+ output: {
645
+ error: string;
646
+ code?: "invalid_input" | undefined;
647
+ };
648
+ outputFormat: "json";
649
+ status: 400;
650
+ input: {
651
+ param: {
652
+ workerId: string;
653
+ };
654
+ };
655
+ } | {
632
656
  output: {
633
657
  workerId: string;
634
658
  settled: boolean;
@@ -653,6 +677,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
653
677
  };
654
678
  backend?: string | undefined;
655
679
  model?: string | undefined;
680
+ effort?: string | undefined;
681
+ hold?: {
682
+ reason: "provider-error" | "usage-limit";
683
+ resumeAt: string;
684
+ attempts?: number | undefined;
685
+ error?: string | undefined;
686
+ } | undefined;
656
687
  inputs?: {
657
688
  source: {
658
689
  kind: "parent-file";
@@ -746,7 +777,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
746
777
  workerId: string;
747
778
  };
748
779
  };
749
- } | {
780
+ };
781
+ };
782
+ } & {
783
+ "/:workerId/collect": {
784
+ $post: {
750
785
  output: {
751
786
  error: string;
752
787
  code?: "invalid_input" | undefined;
@@ -757,12 +792,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
757
792
  param: {
758
793
  workerId: string;
759
794
  };
795
+ } & {
796
+ json: Record<string, never>;
760
797
  };
761
- };
762
- };
763
- } & {
764
- "/:workerId/collect": {
765
- $post: {
798
+ } | {
766
799
  output: {
767
800
  workerId: string;
768
801
  parentRunId: string;
@@ -885,7 +918,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
885
918
  } & {
886
919
  json: Record<string, never>;
887
920
  };
888
- } | {
921
+ };
922
+ };
923
+ } & {
924
+ "/:workerId/steer": {
925
+ $post: {
889
926
  output: {
890
927
  error: string;
891
928
  code?: "invalid_input" | undefined;
@@ -897,13 +934,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
897
934
  workerId: string;
898
935
  };
899
936
  } & {
900
- json: Record<string, never>;
937
+ json: {
938
+ text: string;
939
+ };
901
940
  };
902
- };
903
- };
904
- } & {
905
- "/:workerId/steer": {
906
- $post: {
941
+ } | {
907
942
  output: {
908
943
  workerId: string;
909
944
  state: "delivered" | "queued";
@@ -919,7 +954,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
919
954
  text: string;
920
955
  };
921
956
  };
922
- } | {
957
+ };
958
+ };
959
+ } & {
960
+ "/:workerId/stop": {
961
+ $post: {
923
962
  output: {
924
963
  error: string;
925
964
  code?: "invalid_input" | undefined;
@@ -931,15 +970,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
931
970
  workerId: string;
932
971
  };
933
972
  } & {
934
- json: {
935
- text: string;
936
- };
973
+ json: Record<string, never>;
937
974
  };
938
- };
939
- };
940
- } & {
941
- "/:workerId/stop": {
942
- $post: {
975
+ } | {
943
976
  output: {
944
977
  workerId: string;
945
978
  state: "stopping" | "terminated";
@@ -953,7 +986,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
953
986
  } & {
954
987
  json: Record<string, never>;
955
988
  };
956
- } | {
989
+ };
990
+ };
991
+ } & {
992
+ "/:workerId/destroy": {
993
+ $post: {
957
994
  output: {
958
995
  error: string;
959
996
  code?: "invalid_input" | undefined;
@@ -965,13 +1002,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
965
1002
  workerId: string;
966
1003
  };
967
1004
  } & {
968
- json: Record<string, never>;
1005
+ json: {
1006
+ discardWork?: true | undefined;
1007
+ };
969
1008
  };
970
- };
971
- };
972
- } & {
973
- "/:workerId/destroy": {
974
- $post: {
1009
+ } | {
975
1010
  output: {
976
1011
  workerId: string;
977
1012
  state: "complete" | "incomplete";
@@ -1000,22 +1035,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1000
1035
  discardWork?: true | undefined;
1001
1036
  };
1002
1037
  };
1003
- } | {
1004
- output: {
1005
- error: string;
1006
- code?: "invalid_input" | undefined;
1007
- };
1008
- outputFormat: "json";
1009
- status: 400;
1010
- input: {
1011
- param: {
1012
- workerId: string;
1013
- };
1014
- } & {
1015
- json: {
1016
- discardWork?: true | undefined;
1017
- };
1018
- };
1019
1038
  } | {
1020
1039
  output: {
1021
1040
  workerId: string;
@@ -1051,13 +1070,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1051
1070
  "/:workerId/diff": {
1052
1071
  $get: {
1053
1072
  output: {
1054
- workerId: string;
1055
- baselineSha: string;
1056
- diff: string;
1057
- truncated: boolean;
1073
+ error: string;
1074
+ code?: "invalid_input" | undefined;
1058
1075
  };
1059
1076
  outputFormat: "json";
1060
- status: 200;
1077
+ status: 400;
1061
1078
  input: {
1062
1079
  param: {
1063
1080
  workerId: string;
@@ -1065,11 +1082,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1065
1082
  };
1066
1083
  } | {
1067
1084
  output: {
1068
- error: string;
1069
- code?: "invalid_input" | undefined;
1085
+ workerId: string;
1086
+ baselineSha: string;
1087
+ diff: string;
1088
+ truncated: boolean;
1070
1089
  };
1071
1090
  outputFormat: "json";
1072
- status: 400;
1091
+ status: 200;
1073
1092
  input: {
1074
1093
  param: {
1075
1094
  workerId: string;
@@ -35,6 +35,7 @@ export declare class DelegationService {
35
35
  private discovery?;
36
36
  setDiscovery(discovery: HostDiscovery): void;
37
37
  discover(caller: Caller, value: DiscoveryRequest): Promise<DiscoveryResponse>;
38
+ private assertCatalogModel;
38
39
  private validateModels;
39
40
  private projects;
40
41
  private serial;
@@ -64,6 +65,10 @@ export declare class DelegationService {
64
65
  /** A cancelled or session-less worker restarts from its worktree and branch (hearsay-tools/squawk#3337),
65
66
  * so --resume proves both still exist before anything is accepted. */
66
67
  private assertResumableWorkspace;
68
+ /** Validate and normalize same-runner `--model` / `--effort` overrides on `worker resume`. */
69
+ private resolveResumeOverrides;
70
+ private resumeStepTarget;
71
+ private validateResumeModel;
67
72
  /** Runs entirely under the ledger lock; mutable records are read at the queue head. */
68
73
  private sendLocked;
69
74
  private assertSendScope;
@@ -1,6 +1,7 @@
1
1
  import { spawnCapacityRefusal } from './capacity.js';
2
2
  import { commandText } from '../home/command.js';
3
3
  import { WAIT_KINDS } from '../workflows/run/wait-kinds.js';
4
+ import { isUntouchedCancelledRun } from '../workflows/run/run-guards.js';
4
5
  import { projectPaths } from '../project-paths.js';
5
6
  import { assertReplyDirection, sendRequestContext, sendAdmission, sendMessage, sendInput } from './conversation-send.js';
6
7
  import { discoverTasks } from './task-discovery.js';
@@ -10,7 +11,14 @@ export { rootDelegation } from './conversations.js';
10
11
  import { collectWorkerEvidence, revalidateRetainedWorkerResult, workerRevision } from './results.js';
11
12
  import { workerContextTask } from './context.js';
12
13
  import { workerExecutionsOf } from './worker-executions.js';
13
- import { acceptedWorkerIdentitySchema, workerContextHash, workerWorkflowHash } from './execution-identity.js';
14
+ import { acceptedWorkerIdentitySchema, boundWorkerAccountEnv, continuationDefStep, workerContextHash, workerIdentity, workerStepIdentity, workerWorkflowHash } from './execution-identity.js';
15
+ import { latestSessionStep, workerContinuationStep } from '../contract/index.js';
16
+ import { isUsageLimitHold, usageLimitHoldOf } from '../contract/index.js';
17
+ import { AGENT_MODELS_LOCKED_ERROR, agentModelsLocked } from '../core/agent-model-policy.js';
18
+ import { buildChildEnv } from '../core/agent-env.js';
19
+ import { readAgentModelSettings } from '../agent-config/models.js';
20
+ import { formatModelIdentity, normalizeModelForBackend } from '../core/model-identity.js';
21
+ import { modelConflictsWithRunner } from '../core/model-presets.js';
14
22
  import { createHash, randomUUID } from 'node:crypto';
15
23
  import { discoveryRequestSchema, } from '../contract/index.js';
16
24
  import { CONVERSATION_PAGE_MESSAGES, conversationSendEffectSchema, decodeConversationCursor, encodeConversationCursor, conversationSendRequestSchema, conversationInspectRequestSchema, conversationCancelRequestSchema, inboxReceiptRequestSchema, requestWaitRequestSchema, } from '../contract/index.js';
@@ -192,6 +200,17 @@ export class DelegationService {
192
200
  throw new DelegationPolicyError('unavailable_transport', 'Host discovery is unavailable');
193
201
  return request.kind === 'models' ? this.discovery.models.get(registeredRunnerId(request.runner)) : discoveredRunners(await this.discovery.providers());
194
202
  }
203
+ async assertCatalogModel(runner, model, backendModel, modelIdentity) {
204
+ if (!this.discovery)
205
+ return;
206
+ const choices = await missingModelChoices(this.discovery, runner, model, backendModel, modelIdentity);
207
+ if (!choices)
208
+ return;
209
+ const alternatives = choices.otherRunners.join(', ') || 'none';
210
+ const available = choices.availableModels.map(row => `${row.id}${row.effortLevels ? ` (effort: ${row.effortLevels.join(', ') || 'none advertised'})` : ''}`).join('; ');
211
+ // Full choices remain structured even when the human-readable error reaches its bound.
212
+ throw new DelegationPolicyError('invalid_input', `Model "${model}" is not in the ${runner} catalog. Available models: ${available.slice(0, 1200)}. Other runners listing "${model}": ${alternatives}. ${commandText(`Use cez discover models --runner=${runner}.`)}`, choices);
213
+ }
195
214
  async validateModels(request, resolved) {
196
215
  if (!this.discovery)
197
216
  return;
@@ -208,13 +227,7 @@ export class DelegationService {
208
227
  if (checked.has(key))
209
228
  continue;
210
229
  checked.add(key);
211
- const choices = await missingModelChoices(this.discovery, runner, model, settings.model, settings.modelIdentity);
212
- if (!choices)
213
- continue;
214
- const alternatives = choices.otherRunners.join(', ') || 'none';
215
- const available = choices.availableModels.map(row => `${row.id}${row.effortLevels ? ` (effort: ${row.effortLevels.join(', ') || 'none advertised'})` : ''}`).join('; ');
216
- // Full choices remain structured even when the human-readable error reaches its bound.
217
- throw new DelegationPolicyError('invalid_input', `Model "${model}" is not in the ${runner} catalog. Available models: ${available.slice(0, 1200)}. Other runners listing "${model}": ${alternatives}. ${commandText(`Use cez discover models --runner=${runner}.`)}`, choices);
230
+ await this.assertCatalogModel(runner, model, settings.model, settings.modelIdentity);
218
231
  }
219
232
  }
220
233
  projects = new Map();
@@ -329,7 +342,8 @@ export class DelegationService {
329
342
  return this.serialized(`conversation:${initial.project.id}:${this.ledgerFor(initial, request).id}`, async () => {
330
343
  if (request.resume)
331
344
  await this.assertResumableWorkspace(caller, request);
332
- return this.sendLocked(caller, request);
345
+ const resumeOverrides = request.resume ? await this.resolveResumeOverrides(caller, request) : undefined;
346
+ return this.sendLocked(caller, request, resumeOverrides);
333
347
  });
334
348
  }
335
349
  /** A cancelled or session-less worker restarts from its worktree and branch (hearsay-tools/squawk#3337),
@@ -342,7 +356,7 @@ export class DelegationService {
342
356
  return;
343
357
  if (recipient.delegation?.role !== 'worker' || recipient.delegation.destroy || !freshWorkerSession(recipient) && recipient.status !== 'cancelled')
344
358
  return;
345
- if (['queued', 'running', 'waiting'].includes(recipient.status))
359
+ if (['queued', 'running', 'waiting'].includes(recipient.status) && !isUsageLimitHold(recipient))
346
360
  return;
347
361
  try {
348
362
  await workspaceKindOf(recipient).assertResumable(project.root, recipient);
@@ -351,8 +365,64 @@ export class DelegationService {
351
365
  throw new DelegationPolicyError('incompatible_state', `Worker worktree or branch is gone (${error instanceof Error ? error.message : String(error)}); --resume cannot restart it. Spawn a new worker with the follow-up instruction`);
352
366
  }
353
367
  }
368
+ /** Validate and normalize same-runner `--model` / `--effort` overrides on `worker resume`. */
369
+ async resolveResumeOverrides(caller, request) {
370
+ if (request.model === undefined && request.effort === undefined)
371
+ return undefined;
372
+ const pair = this.conversationPair(caller, request.recipientRunId, true);
373
+ const { project, recipient } = pair;
374
+ const root = this.ledgerFor(pair, request);
375
+ if (this.currentConversation(project, root).messages.some(message => message.id === request.id))
376
+ return undefined;
377
+ this.assertSendScope(pair, request);
378
+ sendAdmission(pair, request);
379
+ const effortPin = parseDelegationEffort(request.effort);
380
+ if (agentModelsLocked(project.root, process.env, project.home) && (request.model !== undefined || effortPin !== undefined)) {
381
+ throw new DelegationPolicyError('invalid_input', AGENT_MODELS_LOCKED_ERROR);
382
+ }
383
+ const model = request.model === undefined ? undefined : await this.validateResumeModel(project, recipient, request.model);
384
+ return { ...(model === undefined ? {} : { model }), ...(request.effort === undefined ? {} : { effort: effortPin ?? '' }) };
385
+ }
386
+ resumeStepTarget(project, recipient) {
387
+ const untouched = isUntouchedCancelledRun(recipient);
388
+ const sessionId = latestSessionStep(recipient.steps)?.sessionId;
389
+ const stepId = continuationDefStep(project.store, recipient, sessionId, untouched)?.id;
390
+ try {
391
+ const identity = workerIdentity(project.store, project.root, recipient.id, stepId, project.home);
392
+ const stepIdentity = identity ? (stepId === undefined ? identity : workerStepIdentity(identity, stepId)) : undefined;
393
+ const runner = stepIdentity?.account.provider ?? recipient.runner;
394
+ if (!runner)
395
+ throw new DelegationPolicyError('incompatible_state', 'Worker runner identity is unavailable');
396
+ const baseEnv = buildChildEnv({ backend: runner });
397
+ const env = stepIdentity ? { ...baseEnv, ...boundWorkerAccountEnv(stepIdentity.account, baseEnv) } : baseEnv;
398
+ return { runner, profileId: stepIdentity?.account.profileId ?? recipient.agentProfile ?? 'default', env };
399
+ }
400
+ catch (error) {
401
+ if (error instanceof DelegationPolicyError)
402
+ throw error;
403
+ throw new DelegationPolicyError('incompatible_state', error instanceof Error ? error.message : 'Worker execution identity is unavailable');
404
+ }
405
+ }
406
+ async validateResumeModel(project, recipient, requested) {
407
+ const { runner, profileId, env } = this.resumeStepTarget(project, recipient);
408
+ const native = await readAgentModelSettings(runner, project.root, env);
409
+ let normalized;
410
+ try {
411
+ normalized = normalizeModelForBackend(runner, requested, { configuredProvider: native.provider });
412
+ }
413
+ catch (error) {
414
+ throw new DelegationPolicyError('invalid_input', error instanceof Error ? error.message : 'Invalid model');
415
+ }
416
+ if (profileId === 'default') {
417
+ await this.assertCatalogModel(runner, requested, normalized?.backendModel, normalized ? formatModelIdentity(normalized.identity) : undefined);
418
+ }
419
+ if (modelConflictsWithRunner(requested, runner)) {
420
+ throw new DelegationPolicyError('invalid_input', `Model "${requested}" is incompatible with ${runner}`);
421
+ }
422
+ return normalized?.backendModel ?? requested;
423
+ }
354
424
  /** Runs entirely under the ledger lock; mutable records are read at the queue head. */
355
- sendLocked(caller, request) {
425
+ sendLocked(caller, request, resumeOverrides) {
356
426
  const pair = this.conversationPair(caller, request.recipientRunId, true);
357
427
  const { project, sender, recipient } = pair;
358
428
  const root = this.ledgerFor(pair, request);
@@ -386,7 +456,7 @@ export class DelegationService {
386
456
  const outcomes = replyOutcomes(state, request, settled, now);
387
457
  const input = sendInput(pair, root, message, requestHash, now);
388
458
  const next = { messages: [...state.messages, message], outcomes };
389
- this.commitSend(pair, root, next, input, resume, enqueue);
459
+ this.commitSend(pair, root, next, input, resume, enqueue, resumeOverrides);
390
460
  try {
391
461
  projectConversationEvents(project.store, project.store.getRun(root.id));
392
462
  project.manager.reconcileWorkerWaits();
@@ -421,7 +491,7 @@ export class DelegationService {
421
491
  }
422
492
  return { ...this.conversationReceipt(project, root.id, existing), effect: conversationSendEffectSchema.enum.unchanged };
423
493
  }
424
- commitSend(pair, root, next, input, resume, enqueue) {
494
+ commitSend(pair, root, next, input, resume, enqueue, resumeOverrides) {
425
495
  const { project, recipient, relationship } = pair;
426
496
  const peer = relationship === 'peer';
427
497
  if (resume) {
@@ -436,6 +506,8 @@ export class DelegationService {
436
506
  const fresh = freshWorkerSession(recipient) ? `${FRESH_SESSION_NOTICE}\n` : '';
437
507
  const result = project.manager.continueRun(recipient.id, {
438
508
  text: `Your parent resumed this worker with a new instruction.\n${fresh}Agent conversation ${JSON.stringify({ id: input.id, ...input.conversation })}\n${input.text}`,
509
+ ...(resumeOverrides?.model === undefined ? {} : { model: resumeOverrides.model }),
510
+ ...(resumeOverrides?.effort === undefined ? {} : { effort: resumeOverrides.effort }),
439
511
  }, true, { rootId: root.id, state: next, input });
440
512
  if (!result.ok)
441
513
  throw new DelegationPolicyError('incompatible_state', `Worker was not resumed: ${result.error}. No message was accepted; ${result.next ?? 'resolve this condition and retry the same command'}`);
@@ -718,6 +790,7 @@ export class DelegationService {
718
790
  workers.push({ workerId: inspection.workerId, parentRunId: inspection.parentRunId,
719
791
  ...(inspection.supervisorRunId === undefined ? {} : { supervisorRunId: inspection.supervisorRunId }),
720
792
  status: inspection.status, workspace: inspection.workspace,
793
+ ...(inspection.hold ? { hold: inspection.hold } : {}),
721
794
  ...(inspection.destroy ? { destroy: inspection.destroy } : {}), revision: workerRevision(worker),
722
795
  settled: inspection.settled,
723
796
  destroyed: worker.delegation.destroy?.phase === 'complete' });
@@ -733,11 +806,17 @@ export class DelegationService {
733
806
  const wait = this.inspectedWait(parent, worker.id);
734
807
  const completion = completionWaitEntry(parent.waits, worker.id);
735
808
  const completionWait = completion ? workerCompletionWaitProjection(completion, parent) : undefined;
809
+ const hold = usageLimitHoldOf(worker);
810
+ const activeStep = workerContinuationStep(worker, isUntouchedCancelledRun(worker));
811
+ const backend = activeStep?.runner ?? worker.runner;
812
+ const model = activeStep ? activeStep.model : worker.model;
813
+ const effort = activeStep ? activeStep.effort : worker.effort;
736
814
  return { workerId: worker.id, parentRunId: worker.delegation.parentRunId,
737
815
  ...(worker.delegation.supervisorRunId === undefined ? {} : { supervisorRunId: worker.delegation.supervisorRunId }),
738
816
  status: worker.status, workspace: worker.delegation.workspace,
739
817
  settled: workerObservation(worker, project.store.workerExecutions.readWorkerExecution(worker.id)).settled,
740
- ...(worker.runner === undefined ? {} : { backend: worker.runner }), ...(worker.model === undefined ? {} : { model: worker.model }),
818
+ ...(backend === undefined ? {} : { backend }), ...(model === undefined ? {} : { model }),
819
+ ...(effort === undefined ? {} : { effort }), ...(hold ? { hold } : {}),
741
820
  ...(worker.delegation.context === undefined ? {} : { inputs: worker.delegation.context.inputs }),
742
821
  ...(worker.currentStepId === undefined ? {} : { currentStepId: worker.currentStepId }),
743
822
  ...(wait ? { wait } : {}), ...(completionWait ? { completionWait } : {}), ...(worker.delegation.destroy ? { destroy: workerDestroyView(worker) } : {}), ...(outcome ? { outcome } : {}),