@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
@@ -1,8 +1,8 @@
1
1
  // ../contract/src/events.ts
2
- import { z as z5 } from "zod";
2
+ import { z as z6 } from "zod";
3
3
 
4
4
  // ../contract/src/conversations.ts
5
- import { z as z2 } from "zod";
5
+ import { z as z3 } from "zod";
6
6
 
7
7
  // ../contract/src/ask-schema.ts
8
8
  import { z } from "zod";
@@ -35,38 +35,50 @@ var askRequestSchema = z.object({
35
35
  })
36
36
  }).strict();
37
37
 
38
+ // ../contract/src/effort.ts
39
+ import { z as z2 } from "zod";
40
+ var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
41
+ var effortLevelSchema = z2.enum(EFFORT_LEVELS);
42
+ var effortFieldSchema = z2.string().max(32).optional();
43
+ function parseEffort(value) {
44
+ const trimmed = value?.trim().toLowerCase();
45
+ if (!trimmed || trimmed === "auto") return void 0;
46
+ const parsed = effortLevelSchema.safeParse(trimmed);
47
+ return parsed.success ? parsed.data : void 0;
48
+ }
49
+
38
50
  // ../contract/src/conversations.ts
39
- var conversationRelationshipSchema = z2.enum(["family", "peer"]);
40
- var conversationAttributionSchema = z2.object({
41
- senderRunId: z2.uuid(),
42
- recipientRunId: z2.uuid(),
43
- kind: z2.enum(["request", "progress", "follow-up", "reply"]),
44
- requestId: z2.uuid().optional(),
51
+ var conversationRelationshipSchema = z3.enum(["family", "peer"]);
52
+ var conversationAttributionSchema = z3.object({
53
+ senderRunId: z3.uuid(),
54
+ recipientRunId: z3.uuid(),
55
+ kind: z3.enum(["request", "progress", "follow-up", "reply"]),
56
+ requestId: z3.uuid().optional(),
45
57
  relationship: conversationRelationshipSchema.optional()
46
58
  }).strict();
47
59
  var conversationMessageSchema = conversationAttributionSchema.extend({
48
- id: z2.uuid(),
49
- text: z2.string().min(1).max(1e5),
50
- createdAt: z2.iso.datetime(),
51
- deadline: z2.iso.datetime().optional(),
52
- requestHash: z2.string().regex(/^[0-9a-f]{64}$/),
53
- state: z2.enum(["accepted", "continuation-required", "destroyed", "late"]),
60
+ id: z3.uuid(),
61
+ text: z3.string().min(1).max(1e5),
62
+ createdAt: z3.iso.datetime(),
63
+ deadline: z3.iso.datetime().optional(),
64
+ requestHash: z3.string().regex(/^[0-9a-f]{64}$/),
65
+ state: z3.enum(["accepted", "continuation-required", "destroyed", "late"]),
54
66
  /** A parent-authorized new execution; retained on exact message retries. */
55
- resumed: z2.literal(true).optional(),
56
- instruction: z2.string().max(2048).optional(),
67
+ resumed: z3.literal(true).optional(),
68
+ instruction: z3.string().max(2048).optional(),
57
69
  /** A worker's question routed to its parent (#505): answered only by a reply naming it. */
58
70
  question: askRequestSchema.optional()
59
71
  });
60
- var requestOutcomeSchema = z2.object({
61
- requestId: z2.uuid(),
72
+ var requestOutcomeSchema = z3.object({
73
+ requestId: z3.uuid(),
62
74
  /** `deleted`: a peer recipient's record was deleted while the request was open. */
63
- status: z2.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback", "deleted"]),
64
- observedAt: z2.iso.datetime(),
65
- replyId: z2.uuid().optional()
75
+ status: z3.enum(["replied", "replied-late", "completed-without-reply", "failed", "cancelled", "destroyed", "timed-out", "sender-closed", "human-fallback", "deleted"]),
76
+ observedAt: z3.iso.datetime(),
77
+ replyId: z3.uuid().optional()
66
78
  }).strict();
67
- var conversationStateSchema = z2.object({ messages: z2.array(conversationMessageSchema).max(1024), outcomes: z2.array(requestOutcomeSchema).max(1024) }).strict();
79
+ var conversationStateSchema = z3.object({ messages: z3.array(conversationMessageSchema).max(1024), outcomes: z3.array(requestOutcomeSchema).max(1024) }).strict();
68
80
  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;
69
- var conversationCursorSchema = z2.string().max(128).regex(CURSOR, "Not a history cursor; pass nextBefore from an earlier page");
81
+ var conversationCursorSchema = z3.string().max(128).regex(CURSOR, "Not a history cursor; pass nextBefore from an earlier page");
70
82
  function encodeConversationCursor(message2) {
71
83
  return `${message2.createdAt}~${message2.id}`;
72
84
  }
@@ -77,180 +89,182 @@ function decodeConversationCursor(cursor) {
77
89
  }
78
90
  var CONVERSATION_PAGE_MESSAGES = 1024;
79
91
  var conversationInspectResultSchema = conversationStateSchema.extend({
80
- hint: z2.string().optional(),
92
+ hint: z3.string().optional(),
81
93
  /** Present when older messages exist: pass it as `before` to read the page before this one. */
82
94
  nextBefore: conversationCursorSchema.optional()
83
95
  });
84
- var inboxReserveResultSchema = z2.object({
85
- messages: z2.array(conversationMessageSchema).max(32),
86
- outcomes: z2.array(requestOutcomeSchema).max(32),
87
- receiptId: z2.uuid().optional(),
88
- expiresAt: z2.iso.datetime().optional()
96
+ var inboxReserveResultSchema = z3.object({
97
+ messages: z3.array(conversationMessageSchema).max(32),
98
+ outcomes: z3.array(requestOutcomeSchema).max(32),
99
+ receiptId: z3.uuid().optional(),
100
+ expiresAt: z3.iso.datetime().optional()
89
101
  }).strict().refine(
90
102
  (value) => value.messages.length > 0 ? value.receiptId !== void 0 && value.expiresAt !== void 0 : value.receiptId === void 0 && value.expiresAt === void 0,
91
103
  { message: "A nonempty inbox batch requires a receipt and expiry" }
92
104
  );
93
- var inboxReceiptRequestSchema = z2.object({ receiptId: z2.uuid() }).strict();
94
- var inboxReceiptResultSchema = z2.object({
95
- receiptId: z2.uuid(),
96
- status: z2.enum(["acknowledged", "already-acknowledged", "released"])
105
+ var inboxReceiptRequestSchema = z3.object({ receiptId: z3.uuid() }).strict();
106
+ var inboxReceiptResultSchema = z3.object({
107
+ receiptId: z3.uuid(),
108
+ status: z3.enum(["acknowledged", "already-acknowledged", "released"])
97
109
  }).strict();
98
110
  var MAX_RESUME_REQUEST_SECONDS = 86400;
99
111
  var MAX_CONVERSATION_REQUEST_SECONDS = 7200;
100
112
  var DEFAULT_CONVERSATION_REQUEST_SECONDS = 600;
101
- var conversationSendRequestSchema = z2.object({
102
- id: z2.uuid(),
103
- recipientRunId: z2.uuid(),
113
+ var conversationSendRequestSchema = z3.object({
114
+ id: z3.uuid(),
115
+ recipientRunId: z3.uuid(),
104
116
  kind: conversationAttributionSchema.shape.kind,
105
- requestId: z2.uuid().optional(),
106
- text: z2.string().min(1).max(1e5).refine((text) => text.trim().length > 0),
107
- timeoutSeconds: z2.number().int().min(1).max(MAX_RESUME_REQUEST_SECONDS).default(DEFAULT_CONVERSATION_REQUEST_SECONDS),
108
- resume: z2.boolean().optional()
109
- }).strict().refine((value) => value.timeoutSeconds <= MAX_CONVERSATION_REQUEST_SECONDS || value.resume === true && value.kind === "request", { path: ["timeoutSeconds"], message: "Only --resume requests accept deadlines above 7200 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" });
110
- var conversationSendEffectSchema = z2.enum(["applied", "unchanged", "refused", "unknown"]);
111
- var conversationSendResultSchema = z2.object({ message: conversationMessageSchema, delivery: z2.enum(["queued", "delivered", "consumed", "not-delivered"]), outcome: requestOutcomeSchema.optional(), effect: conversationSendEffectSchema.optional() }).strict();
112
- var conversationInspectRequestSchema = z2.object({ recipientRunId: z2.uuid(), before: conversationCursorSchema.optional() }).strict();
113
- var conversationCancelRequestSchema = z2.object({ requestId: z2.uuid() }).strict();
114
- var requestWaitRequestSchema = z2.object({
115
- requestIds: z2.array(z2.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length),
116
- mode: z2.enum(["one", "any", "all"]).optional(),
117
- timeoutSeconds: z2.number().int().min(1).max(7200).default(600)
117
+ requestId: z3.uuid().optional(),
118
+ text: z3.string().min(1).max(1e5).refine((text) => text.trim().length > 0),
119
+ timeoutSeconds: z3.number().int().min(1).max(MAX_RESUME_REQUEST_SECONDS).default(DEFAULT_CONVERSATION_REQUEST_SECONDS),
120
+ resume: z3.boolean().optional(),
121
+ model: z3.string().trim().min(1).max(512).optional(),
122
+ effort: effortFieldSchema
123
+ }).strict().refine((value) => value.timeoutSeconds <= MAX_CONVERSATION_REQUEST_SECONDS || value.resume === true && value.kind === "request", { path: ["timeoutSeconds"], message: "Only --resume requests accept deadlines above 7200 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" }).refine((value) => value.resume === true || value.model === void 0 && value.effort === void 0, { message: "--model and --effort require --resume" });
124
+ var conversationSendEffectSchema = z3.enum(["applied", "unchanged", "refused", "unknown"]);
125
+ var conversationSendResultSchema = z3.object({ message: conversationMessageSchema, delivery: z3.enum(["queued", "delivered", "consumed", "not-delivered"]), outcome: requestOutcomeSchema.optional(), effect: conversationSendEffectSchema.optional() }).strict();
126
+ var conversationInspectRequestSchema = z3.object({ recipientRunId: z3.uuid(), before: conversationCursorSchema.optional() }).strict();
127
+ var conversationCancelRequestSchema = z3.object({ requestId: z3.uuid() }).strict();
128
+ var requestWaitRequestSchema = z3.object({
129
+ requestIds: z3.array(z3.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length),
130
+ mode: z3.enum(["one", "any", "all"]).optional(),
131
+ timeoutSeconds: z3.number().int().min(1).max(7200).default(600)
118
132
  }).strict().refine((value) => value.mode !== "one" || value.requestIds.length === 1, { message: "one requires exactly one request" });
119
133
 
120
134
  // ../contract/src/agent-input.ts
121
- import { z as z3 } from "zod";
122
- var inboxClaimSchema = z3.object({
123
- receiptId: z3.uuid(),
124
- generation: z3.uuid(),
125
- expiresAt: z3.iso.datetime(),
126
- acknowledgedAt: z3.iso.datetime().optional(),
135
+ import { z as z4 } from "zod";
136
+ var inboxClaimSchema = z4.object({
137
+ receiptId: z4.uuid(),
138
+ generation: z4.uuid(),
139
+ expiresAt: z4.iso.datetime(),
140
+ acknowledgedAt: z4.iso.datetime().optional(),
127
141
  /** Optional on read for receipts persisted before member manifests existed. */
128
- memberIds: z3.array(z3.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
142
+ memberIds: z4.array(z4.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
129
143
  }).strict();
130
- var agentInputSchema = z3.object({
144
+ var agentInputSchema = z4.object({
131
145
  conversation: conversationAttributionSchema.optional(),
132
- id: z3.uuid(),
133
- source: z3.enum(["agent", "lifecycle"]),
134
- parentRunId: z3.uuid(),
135
- text: z3.string().min(1).max(1e5),
136
- createdAt: z3.iso.datetime(),
137
- deliveredAt: z3.iso.datetime().optional(),
146
+ id: z4.uuid(),
147
+ source: z4.enum(["agent", "lifecycle"]),
148
+ parentRunId: z4.uuid(),
149
+ text: z4.string().min(1).max(1e5),
150
+ createdAt: z4.iso.datetime(),
151
+ deliveredAt: z4.iso.datetime().optional(),
138
152
  /** The model received it, when the harness can show that (#505). Absent on
139
153
  * unobservable backends and on records written before #505. */
140
- consumedAt: z3.iso.datetime().optional(),
154
+ consumedAt: z4.iso.datetime().optional(),
141
155
  /** Accepted by a harness that reports reading, and not read yet. A restart replays
142
156
  * such input; records written before #505 never carry it, so nothing historical replays. */
143
- awaitingRead: z3.literal(true).optional(),
157
+ awaitingRead: z4.literal(true).optional(),
144
158
  inboxClaim: inboxClaimSchema.optional(),
145
159
  /** A completion refusal Squawk queued for a closed session (hearsay-tools/cezarion#1301): its
146
160
  * delivery is the nudge's turn, bounded by the nudge's reply bound, and a session that closes
147
161
  * before it is a failed delivery. `undelivered-question` is Squawk's answer to a worker question
148
162
  * that could not reach its live parent (hearsay-tools/cezarion#2410). Absent on every other input
149
163
  * and on records written before. */
150
- purpose: z3.enum(["completion-refusal", "undelivered-question"]).optional(),
164
+ purpose: z4.enum(["completion-refusal", "undelivered-question"]).optional(),
151
165
  /** A peer message's own hash and request deadline (hearsay-tools/cezarion#1990): the sender's
152
166
  * ledger can be deleted before the recipient reads it. Absent on family and lifecycle inputs. */
153
- requestHash: z3.string().regex(/^[0-9a-f]{64}$/).optional(),
154
- deadline: z3.iso.datetime().optional()
167
+ requestHash: z4.string().regex(/^[0-9a-f]{64}$/).optional(),
168
+ deadline: z4.iso.datetime().optional()
155
169
  }).strict();
156
170
 
157
171
  // ../contract/src/worker-outcome.ts
158
- import { z as z4 } from "zod";
159
- var workerOutcomeSchema = z4.object({
160
- workerId: z4.uuid(),
161
- status: z4.enum(["review", "done", "failed", "cancelled"]),
162
- observedAt: z4.iso.datetime(),
163
- summary: z4.string().max(4e3).optional(),
164
- revision: z4.number().int().nonnegative().optional()
172
+ import { z as z5 } from "zod";
173
+ var workerOutcomeSchema = z5.object({
174
+ workerId: z5.uuid(),
175
+ status: z5.enum(["review", "done", "failed", "cancelled"]),
176
+ observedAt: z5.iso.datetime(),
177
+ summary: z5.string().max(4e3).optional(),
178
+ revision: z5.number().int().nonnegative().optional()
165
179
  }).strict();
166
- var workerWaitModeSchema = z4.enum(["one", "any", "all"]);
180
+ var workerWaitModeSchema = z5.enum(["one", "any", "all"]);
167
181
 
168
182
  // ../contract/src/events.ts
169
- var runEventSchema = z5.looseObject({
170
- seq: z5.number(),
171
- ts: z5.string(),
172
- stepId: z5.string().optional(),
173
- type: z5.string()
174
- });
175
- var conversationMessageEventSchema = runEventSchema.extend({ type: z5.literal("conversation-message"), message: conversationMessageSchema, delivery: z5.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z5.iso.datetime().optional(), consumedAt: z5.iso.datetime().optional() });
176
- var requestOutcomeEventSchema = runEventSchema.extend({ type: z5.literal("request-outcome"), outcome: requestOutcomeSchema });
183
+ var runEventSchema = z6.looseObject({
184
+ seq: z6.number(),
185
+ ts: z6.string(),
186
+ stepId: z6.string().optional(),
187
+ type: z6.string()
188
+ });
189
+ var conversationMessageEventSchema = runEventSchema.extend({ type: z6.literal("conversation-message"), message: conversationMessageSchema, delivery: z6.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z6.iso.datetime().optional(), consumedAt: z6.iso.datetime().optional() });
190
+ var requestOutcomeEventSchema = runEventSchema.extend({ type: z6.literal("request-outcome"), outcome: requestOutcomeSchema });
177
191
  var agentInputEventSchema = runEventSchema.extend({
178
- type: z5.literal("agent-input"),
192
+ type: z6.literal("agent-input"),
179
193
  input: agentInputSchema
180
194
  });
181
195
  var humanInputDeliveredEventSchema = runEventSchema.extend({
182
- type: z5.literal("human-input-delivered"),
183
- askSeq: z5.number().int().nonnegative(),
196
+ type: z6.literal("human-input-delivered"),
197
+ askSeq: z6.number().int().nonnegative(),
184
198
  /** Who answered: absent (records before #505) or `human` is a person; `parent` is the
185
199
  * owning parent's reply to a routed worker question; `cezar` is Squawk's notice that the question
186
200
  * could not reach a live parent (hearsay-tools/cezarion#2410). */
187
- source: z5.enum(["human", "parent", "cezar"]).optional()
201
+ source: z6.enum(["human", "parent", "cezar"]).optional()
188
202
  });
189
203
  var humanAskClosedEventSchema = runEventSchema.extend({
190
- type: z5.literal("human-ask-closed"),
191
- askSeq: z5.number().int().nonnegative(),
192
- reason: z5.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
204
+ type: z6.literal("human-ask-closed"),
205
+ askSeq: z6.number().int().nonnegative(),
206
+ reason: z6.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
193
207
  });
194
208
  var workerQuestionRoutedEventSchema = runEventSchema.extend({
195
- type: z5.literal("worker-question-routed"),
196
- askSeq: z5.number().int().nonnegative(),
197
- messageId: z5.uuid(),
198
- parentRunId: z5.uuid()
209
+ type: z6.literal("worker-question-routed"),
210
+ askSeq: z6.number().int().nonnegative(),
211
+ messageId: z6.uuid(),
212
+ parentRunId: z6.uuid()
199
213
  });
200
214
  var workerQuestionFallbackEventSchema = runEventSchema.extend({
201
- type: z5.literal("worker-question-fallback"),
202
- askSeq: z5.number().int().nonnegative(),
203
- reason: z5.string().min(1).max(200)
215
+ type: z6.literal("worker-question-fallback"),
216
+ askSeq: z6.number().int().nonnegative(),
217
+ reason: z6.string().min(1).max(200)
204
218
  });
205
219
  var workerQuestionUndeliveredEventSchema = runEventSchema.extend({
206
- type: z5.literal("worker-question-undelivered"),
207
- askSeq: z5.number().int().nonnegative(),
208
- reason: z5.string().min(1).max(200)
220
+ type: z6.literal("worker-question-undelivered"),
221
+ askSeq: z6.number().int().nonnegative(),
222
+ reason: z6.string().min(1).max(200)
209
223
  });
210
224
  var workerOutcomeEventSchema = runEventSchema.extend({
211
- type: z5.literal("worker-outcome"),
225
+ type: z6.literal("worker-outcome"),
212
226
  outcome: workerOutcomeSchema
213
227
  });
214
228
  var RUN_HISTORY_PAGE_ITEMS = 100;
215
- var runIdParamSchema = z5.object({
216
- id: z5.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
229
+ var runIdParamSchema = z6.object({
230
+ id: z6.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
217
231
  });
218
- var runHistoryCursorSchema = z5.string().min(1).max(2048);
219
- var runHistoryQuerySchema = z5.object({
232
+ var runHistoryCursorSchema = z6.string().min(1).max(2048);
233
+ var runHistoryQuerySchema = z6.object({
220
234
  cursor: runHistoryCursorSchema.optional()
221
235
  });
222
- var runEventsQuerySchema = z5.object({
236
+ var runEventsQuerySchema = z6.object({
223
237
  cursor: runHistoryCursorSchema.optional(),
224
- afterSeq: z5.coerce.number().int().nonnegative().optional()
225
- });
226
- var runHistoryEventSchema = z5.object({
227
- seq: z5.number(),
228
- ts: z5.string(),
229
- stepId: z5.string().optional(),
230
- type: z5.string()
231
- }).catchall(z5.any());
232
- var runHistoryPageSchema = z5.object({
233
- events: z5.array(runHistoryEventSchema),
234
- itemCount: z5.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
238
+ afterSeq: z6.coerce.number().int().nonnegative().optional()
239
+ });
240
+ var runHistoryEventSchema = z6.object({
241
+ seq: z6.number(),
242
+ ts: z6.string(),
243
+ stepId: z6.string().optional(),
244
+ type: z6.string()
245
+ }).catchall(z6.any());
246
+ var runHistoryPageSchema = z6.object({
247
+ events: z6.array(runHistoryEventSchema),
248
+ itemCount: z6.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
235
249
  olderCursor: runHistoryCursorSchema.optional(),
236
250
  newerCursor: runHistoryCursorSchema.optional(),
237
251
  liveCursor: runHistoryCursorSchema,
238
- asOfSeq: z5.number().int().nonnegative(),
239
- hasOlder: z5.boolean()
240
- });
241
- var runHistoryContextSchema = z5.object({
242
- contextEvents: z5.array(runHistoryEventSchema),
243
- asOfSeq: z5.number().int().nonnegative()
244
- });
245
- var checkoutProgressEventSchema = z5.object({
246
- checkoutId: z5.string().optional(),
247
- name: z5.string(),
248
- phase: z5.enum(["cloning", "done", "error"]),
249
- line: z5.string().optional(),
250
- error: z5.string().optional(),
252
+ asOfSeq: z6.number().int().nonnegative(),
253
+ hasOlder: z6.boolean()
254
+ });
255
+ var runHistoryContextSchema = z6.object({
256
+ contextEvents: z6.array(runHistoryEventSchema),
257
+ asOfSeq: z6.number().int().nonnegative()
258
+ });
259
+ var checkoutProgressEventSchema = z6.object({
260
+ checkoutId: z6.string().optional(),
261
+ name: z6.string(),
262
+ phase: z6.enum(["cloning", "done", "error"]),
263
+ line: z6.string().optional(),
264
+ error: z6.string().optional(),
251
265
  /** On `done` only: the project was created and registered, but a later step did not finish
252
266
  * (new-project flow, spec 2026-10-15-create-new-project). Names what exists and how to finish. */
253
- warning: z5.string().optional()
267
+ warning: z6.string().optional()
254
268
  });
255
269
 
256
270
  // ../contract/src/ask.ts
@@ -300,18 +314,6 @@ function askCardOf(ask) {
300
314
  // ../contract/src/delegation.ts
301
315
  import { z as z10 } from "zod";
302
316
 
303
- // ../contract/src/effort.ts
304
- import { z as z6 } from "zod";
305
- var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
306
- var effortLevelSchema = z6.enum(EFFORT_LEVELS);
307
- var effortFieldSchema = z6.string().max(32).optional();
308
- function parseEffort(value) {
309
- const trimmed = value?.trim().toLowerCase();
310
- if (!trimmed || trimmed === "auto") return void 0;
311
- const parsed = effortLevelSchema.safeParse(trimmed);
312
- return parsed.success ? parsed.data : void 0;
313
- }
314
-
315
317
  // ../contract/src/run-status.ts
316
318
  import { z as z7 } from "zod";
317
319
  var runStatusSchema = z7.enum([
@@ -706,6 +708,12 @@ var workerWaitRequestSchema = z10.object({
706
708
  timeoutSeconds: z10.number().int().min(1).max(7200).default(600),
707
709
  mode: workerWaitModeSchema.optional()
708
710
  }).strict().refine((request) => request.mode !== "one" || request.workerIds.length === 1, { message: "one mode requires exactly one worker" });
711
+ var workerHoldSchema = z10.object({
712
+ reason: z10.enum(["usage-limit", "provider-error"]),
713
+ resumeAt: z10.iso.datetime(),
714
+ attempts: z10.number().int().min(0).optional(),
715
+ error: z10.string().max(2e3).optional()
716
+ }).strict();
709
717
  var workerInspectionSchema = z10.object({
710
718
  workerId: z10.uuid(),
711
719
  settled: z10.boolean(),
@@ -718,6 +726,8 @@ var workerInspectionSchema = z10.object({
718
726
  workspace: workerWorkspaceSchema,
719
727
  backend: workerBackendSchema.optional(),
720
728
  model: z10.string().max(512).optional(),
729
+ effort: effortFieldSchema,
730
+ hold: workerHoldSchema.optional(),
721
731
  inputs: z10.array(workerInputSchema).max(32).optional(),
722
732
  wait: workerWaitSchema.optional(),
723
733
  /** The parent's deadline-less completion wait on this worker (hearsay-tools/cezarion#1301). */
@@ -734,6 +744,7 @@ var workerListEntrySchema = workerInspectionSchema.pick({
734
744
  supervisorRunId: true,
735
745
  status: true,
736
746
  workspace: true,
747
+ hold: true,
737
748
  destroy: true
738
749
  }).extend({
739
750
  revision: z10.number().int().nonnegative(),
@@ -1567,6 +1578,15 @@ var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
1567
1578
  function isUsageLimitHold(run) {
1568
1579
  return run.status === "waiting" && run.autoResumeAt !== void 0;
1569
1580
  }
1581
+ function usageLimitHoldOf(run) {
1582
+ if (!isUsageLimitHold(run)) return void 0;
1583
+ return {
1584
+ reason: run.autoResumeReason ?? "usage-limit",
1585
+ resumeAt: run.autoResumeAt,
1586
+ ...run.autoResumeAttempts === void 0 ? {} : { attempts: run.autoResumeAttempts },
1587
+ ...run.error === void 0 ? {} : { error: run.error.slice(0, 2e3) }
1588
+ };
1589
+ }
1570
1590
 
1571
1591
  // ../contract/src/wait-limits.ts
1572
1592
  var WAIT_LIMIT = 16;
@@ -4799,6 +4819,26 @@ function latestSession(run) {
4799
4819
  const step = removedRunnerStepAfter(run.steps, latest?.sessionId) ? void 0 : latest;
4800
4820
  return { sessionId: step?.sessionId, backend: sessionRunner(step, run), profileId: step?.profileId };
4801
4821
  }
4822
+ function isAgentWorkflowStep(step) {
4823
+ return step.command === void 0 && step.kind !== "plugin";
4824
+ }
4825
+ function workerContinuationStepId(run) {
4826
+ const cursorId = run.workflowCursor?.mode === "resume" ? run.workflowCursor.stepId : void 0;
4827
+ if (cursorId && run.steps.find((step) => step.id === cursorId)?.status === "failed") return cursorId;
4828
+ const session = latestSessionStep(run.steps);
4829
+ if (!session) return void 0;
4830
+ if (session.synthetic === "continuation" && session.continuesStepId !== void 0) return session.continuesStepId;
4831
+ return run.steps.find((step) => step.sessionId === session.sessionId)?.id ?? session.id;
4832
+ }
4833
+ function workerContinuationStep(run, untouched = false) {
4834
+ if (run.delegation?.role !== "worker") return void 0;
4835
+ const steps = run.workflowDef?.steps;
4836
+ if (!steps?.length) return void 0;
4837
+ if (untouched) return steps.find(isAgentWorkflowStep);
4838
+ const targetId = workerContinuationStepId(run);
4839
+ const targeted = targetId ? steps.find((step) => step.id === targetId && isAgentWorkflowStep(step)) : void 0;
4840
+ return targeted ?? [...steps].reverse().find(isAgentWorkflowStep);
4841
+ }
4802
4842
  var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
4803
4843
  function isLiveStatus(status) {
4804
4844
  return LIVE_STATUSES.has(status);
@@ -6837,6 +6877,7 @@ export {
6837
6877
  updateProjectInputSchema,
6838
6878
  updateProjectResponseSchema,
6839
6879
  updateProjectWebhookInputSchema,
6880
+ usageLimitHoldOf,
6840
6881
  userMcpListingSchema,
6841
6882
  utcMinute,
6842
6883
  waitErrorCodeSchema,
@@ -6860,6 +6901,7 @@ export {
6860
6901
  workerCompletionWaitSchema,
6861
6902
  workerContextReferenceSchema,
6862
6903
  workerContextSchema,
6904
+ workerContinuationStep,
6863
6905
  workerCreationReceiptSchema,
6864
6906
  workerDestroyRequestSchema,
6865
6907
  workerDestroyResultSchema,
@@ -6869,6 +6911,7 @@ export {
6869
6911
  workerDestroyWorkSchema,
6870
6912
  workerDiffSchema,
6871
6913
  workerEmptyRequestSchema,
6914
+ workerHoldSchema,
6872
6915
  workerIdsSchema,
6873
6916
  workerInputRecipeSchema,
6874
6917
  workerInputSchema,
@@ -32,6 +32,15 @@ export declare function latestSession(run: {
32
32
  backend: NonNullable<RunRecord['runner']>;
33
33
  profileId: string | undefined;
34
34
  };
35
+ type WorkerContinuationRun = Partial<Pick<RunRecord, 'delegation' | 'workflowDef' | 'workflowCursor'>> & {
36
+ steps: readonly Pick<StepState, 'id' | 'sessionId' | 'startedAt' | 'continuesStepId' | 'synthetic' | 'status'>[];
37
+ };
38
+ type WorkflowStepEntry = NonNullable<RunRecord['workflowDef']>['steps'][number];
39
+ /**
40
+ * The workflow agent step an owned worker's Continue extends: the first agent step when untouched,
41
+ * else the resumed cursor step, else the step owning the latest session, else the last agent step.
42
+ */
43
+ export declare function workerContinuationStep(run: WorkerContinuationRun, untouched?: boolean): WorkflowStepEntry | undefined;
35
44
  /** Status-only live predicate: queued, running or waiting. */
36
45
  export declare function isLiveStatus(status: string): boolean;
37
46
  type OwnershipInput = Pick<RunRecord, 'status'> & Partial<Pick<RunRecord, 'autoResumeAt'>>;
@@ -13,3 +13,10 @@ import type { RunRecord } from './runs.ts';
13
13
  export declare function isUsageLimitHold<T extends Partial<Pick<RunRecord, 'status' | 'autoResumeAt'>>>(run: T): run is T & {
14
14
  autoResumeAt: string;
15
15
  };
16
+ /** Structured hold details when a run is on a usage-limit or provider-error hold; undefined otherwise. */
17
+ export declare function usageLimitHoldOf(run: Partial<Pick<RunRecord, 'status' | 'autoResumeAt' | 'autoResumeReason' | 'autoResumeAttempts' | 'error'>>): {
18
+ reason: 'usage-limit' | 'provider-error';
19
+ resumeAt: string;
20
+ attempts?: number;
21
+ error?: string;
22
+ } | undefined;
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import type { PeerWaitView, WorkerCompletionWait, WorkerWait } from './delegation.ts';
3
3
  import type { RunRecord } from './runs.ts';
4
- import { isUsageLimitHold } from './usage-limit-hold.ts';
4
+ import { isUsageLimitHold, usageLimitHoldOf } from './usage-limit-hold.ts';
5
5
  import { WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN } from './wait-limits.ts';
6
6
  export { withRootLedger, requestsToPeers, workerWaitTargets, computeWaitingOn, asksHuman, asksQuestion, hasResolvedWait, resolveWaitingOn, type WaitingOnInput, type WorkerWaitTarget, } from './waiting-on.ts';
7
- export { isUsageLimitHold, WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN, };
7
+ export { isUsageLimitHold, usageLimitHoldOf, WAIT_LIMIT, LAST_WAITS_LIMIT, TIMER_MIN_SECONDS, TIMER_MAX_SECONDS, PROCESS_TIMEOUT_DEFAULT_SECONDS, PROCESS_TIMEOUT_MAX_SECONDS, PROCESS_EXIT_FILE_MAX, PEER_WAIT_DEFAULT_SECONDS, PEER_WAIT_MAX_SECONDS, SUBAGENT_WAIT_DEADLINE_SECONDS, SUBAGENT_WAIT_GRACE_SECONDS, SUBAGENT_WAIT_CHILD_LIMIT, WAIT_MESSAGE_MAX, NOTE_MAX, PID_MIN, };
8
8
  /** `open` → `resolved` (its event fired or its deadline passed) → `delivered`, or `cancelled`. */
9
9
  export declare const waitPhaseSchema: z.ZodEnum<{
10
10
  cancelled: "cancelled";
@@ -50,7 +50,7 @@ function attachIssue(error, operation, typed) {
50
50
  return value === undefined ? `${operation} has invalid --attach` : `${operation} has invalid --attach: ${value}`;
51
51
  }
52
52
  const WORKER_USAGE = { operations: [
53
- { name: 'resume', positionals: 2, required: ['--id'], optional: ['--timeout-seconds'] },
53
+ { name: 'resume', positionals: 2, required: ['--id'], optional: ['--timeout-seconds', '--model', '--effort'] },
54
54
  { name: 'spawn', positionals: 1, required: ['--request-id'], optional: ['--baseline', '--workspace', '--workflow', '--skill', '--runner', '--backend', '--model', '--effort', '--context', '--context-file', '--attach'] },
55
55
  { name: 'list', positionals: 0 },
56
56
  { name: 'inspect', positionals: 1 },
@@ -64,7 +64,7 @@ const WORKER_USAGE = { operations: [
64
64
  { name: 'cancel-wait', positionals: 1 },
65
65
  ] };
66
66
  const WORKER_HELP = {
67
- resume: { args: '<worker-id> "<instruction>" --id <UUID>', description: 'Resume a settled owned worker with a request; --timeout-seconds accepts 1-86400.' },
67
+ resume: { args: '<worker-id> "<instruction>" --id <UUID> [--model <model>] [--effort <level>]', description: 'Resume a settled or held owned worker with a request; --timeout-seconds accepts 1-86400. Optional --model and --effort override model/effort on the worker\'s existing runner.' },
68
68
  spawn: { args: '"<task>" --request-id <UUID> [--baseline <ref> | --workspace shared]', description: 'Create an owned worker: in its own worktree from a committed baseline, or in your worktree with --workspace shared. A worker may start one shared worker at a time, and no flag is needed: wait for it (worker wait), read its result (worker collect) and destroy it (worker destroy) before you start the next.' },
69
69
  list: { args: '', description: 'List your owned workers, execution revisions and remaining cleanup resources.' },
70
70
  inspect: { args: '<worker-id>', description: 'Show worker state and input locations.' },
@@ -349,7 +349,7 @@ export async function runWorkerCommand(argv, env) {
349
349
  return 0;
350
350
  }
351
351
  if (flags.some(arg => /^--(?:kind|resume|request-id)(?:=|$)/.test(arg)))
352
- return usageFailure(commandText('Use cez worker resume <worker-id> "<instruction>" --id <UUID> [--timeout-seconds <1-86400>].'));
352
+ return usageFailure(commandText('Use cez worker resume <worker-id> "<instruction>" --id <UUID> [--timeout-seconds <1-86400>] [--model <model>] [--effort <level>].'));
353
353
  return runDelegationCommand(['send', '--kind', 'request', '--resume', ...argv.slice(1)], env, () => workerHelp('resume'));
354
354
  }
355
355
  if (!WORKER_USAGE.operations.some(entry => entry.name === argv[0])) {
@@ -387,6 +387,8 @@ export async function runMessageCommand(argv, env) {
387
387
  const flags = optionArguments(argv);
388
388
  if (flags.some(arg => arg === '--resume' || arg.startsWith('--resume=')))
389
389
  return usageFailure(commandText('Use cez worker resume <worker-id> "<instruction>" --id <UUID> to resume an owned worker.'));
390
+ if (flags.some(arg => /^--(?:model|effort)(?:=|$)/.test(arg)))
391
+ return usageFailure(commandText('Use cez worker resume <worker-id> "<instruction>" --id <UUID> [--model <model>] [--effort <level>] to override model or effort.'));
390
392
  if (flags.some(arg => arg === '--kind' || arg.startsWith('--kind=')))
391
393
  return usageFailure(commandText('The cez message verb selects the kind; use request, progress, follow-up or reply.'));
392
394
  if (flags.includes('--help') || flags.includes('-h')) {
@@ -477,7 +479,7 @@ const COMMAND_OPTIONS = {
477
479
  spawn: { baseline: stringFlag, workspace: stringFlag, 'request-id': stringFlag, workflow: stringFlag, skill: stringFlag, runner: stringFlag, backend: stringFlag,
478
480
  model: stringFlag, effort: stringFlag, context: stringFlag, 'context-file': stringFlag, attach: repeatedFlag },
479
481
  conversation: { before: stringFlag }, tasks: { all: { type: 'boolean' }, offset: stringFlag },
480
- send: { ...messageOptions, resume: { type: 'boolean' } }, progress: messageOptions, reply: messageOptions, 'follow-up': messageOptions,
482
+ send: { ...messageOptions, resume: { type: 'boolean' }, model: stringFlag, effort: stringFlag }, progress: messageOptions, reply: messageOptions, 'follow-up': messageOptions,
481
483
  wait: waitOptions, 'wait-requests': waitOptions, destroy: { 'discard-work': { type: 'boolean' } },
482
484
  };
483
485
  function cliInteger(operation, flag, value) {
@@ -493,6 +495,8 @@ function messagePayload(operation, values, positionals) {
493
495
  expectCount(operation, positionals, 2);
494
496
  return conversationSendRequestSchema.parse({ id: values.id, recipientRunId: positionals[0], text: positionals[1],
495
497
  kind: operation === 'send' ? values.kind : operation, resume: values.resume, requestId: values['request-id'],
498
+ ...(values.model === undefined ? {} : { model: values.model }),
499
+ ...(values.effort === undefined ? {} : { effort: values.effort }),
496
500
  timeoutSeconds: cliInteger(operation, 'timeout-seconds', values['timeout-seconds']) });
497
501
  }
498
502
  async function spawnPayload(values, positionals, argv) {