@wjarka/cezarion 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (907) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +594 -207
  3. package/dist/agent-config/account-identity.d.ts +3 -19
  4. package/dist/agent-config/account-identity.js +8 -5
  5. package/dist/agent-config/account-identity.js.map +1 -1
  6. package/dist/agent-config/catalog.d.ts +3 -14
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/files.d.ts +2 -6
  9. package/dist/agent-config/files.js +2 -6
  10. package/dist/agent-config/files.js.map +1 -1
  11. package/dist/agent-config/model-settings/types.d.ts +1 -1
  12. package/dist/agent-config/seed.d.ts +11 -3
  13. package/dist/agent-config/seed.js +52 -48
  14. package/dist/agent-config/seed.js.map +1 -1
  15. package/dist/agent-config/service.js +3 -2
  16. package/dist/agent-config/service.js.map +1 -1
  17. package/dist/agent-config/validate.d.ts +1 -4
  18. package/dist/agent-config/validate.js.map +1 -1
  19. package/dist/application-update/helper.d.ts +2 -2
  20. package/dist/application-update/helper.js +7 -12
  21. package/dist/application-update/helper.js.map +1 -1
  22. package/dist/application-update/launcher.d.ts +4 -0
  23. package/dist/application-update/launcher.js +18 -12
  24. package/dist/application-update/launcher.js.map +1 -1
  25. package/dist/application-update/service.d.ts +3 -3
  26. package/dist/application-update/service.js +1 -1
  27. package/dist/application-update/service.js.map +1 -1
  28. package/dist/archive-on-merge-setting.d.ts +15 -0
  29. package/dist/archive-on-merge-setting.js +14 -0
  30. package/dist/archive-on-merge-setting.js.map +1 -0
  31. package/dist/artifacts/cli.d.ts +8 -0
  32. package/dist/artifacts/cli.js +21 -2
  33. package/dist/artifacts/cli.js.map +1 -1
  34. package/dist/artifacts/resolve.js +2 -1
  35. package/dist/artifacts/resolve.js.map +1 -1
  36. package/dist/artifacts/store.js.map +1 -1
  37. package/dist/automations/automation-cli.d.ts +59 -0
  38. package/dist/automations/automation-cli.js +509 -0
  39. package/dist/automations/automation-cli.js.map +1 -0
  40. package/dist/automations/builtin-skill.d.ts +7 -0
  41. package/dist/automations/builtin-skill.js +14 -0
  42. package/dist/automations/builtin-skill.js.map +1 -0
  43. package/dist/automations/github-baseline.d.ts +3 -0
  44. package/dist/automations/github-baseline.js +17 -0
  45. package/dist/automations/github-baseline.js.map +1 -0
  46. package/dist/automations/github-poller.d.ts +23 -4
  47. package/dist/automations/github-poller.js +157 -88
  48. package/dist/automations/github-poller.js.map +1 -1
  49. package/dist/automations/prompts.d.ts +12 -0
  50. package/dist/automations/prompts.js +160 -0
  51. package/dist/automations/prompts.js.map +1 -0
  52. package/dist/automations/schedule-runner.d.ts +43 -24
  53. package/dist/automations/schedule-runner.js +207 -20
  54. package/dist/automations/schedule-runner.js.map +1 -1
  55. package/dist/automations/scheduler.d.ts +10 -2
  56. package/dist/automations/scheduler.js +200 -54
  57. package/dist/automations/scheduler.js.map +1 -1
  58. package/dist/automations/service.d.ts +777 -0
  59. package/dist/automations/service.js +444 -0
  60. package/dist/automations/service.js.map +1 -0
  61. package/dist/automations/store.d.ts +17 -7
  62. package/dist/automations/store.js +88 -17
  63. package/dist/automations/store.js.map +1 -1
  64. package/dist/automations/task-template.d.ts +7 -2
  65. package/dist/automations/task-template.js +93 -44
  66. package/dist/automations/task-template.js.map +1 -1
  67. package/dist/automations/tool-adapter.d.ts +6 -0
  68. package/dist/automations/tool-adapter.js +108 -0
  69. package/dist/automations/tool-adapter.js.map +1 -0
  70. package/dist/automations/types.d.ts +1 -405
  71. package/dist/automations/types.js +1 -218
  72. package/dist/automations/types.js.map +1 -1
  73. package/dist/autosave-cleanup.d.ts +26 -0
  74. package/dist/autosave-cleanup.js +87 -0
  75. package/dist/autosave-cleanup.js.map +1 -0
  76. package/dist/autosave-git.d.ts +3 -0
  77. package/dist/autosave-git.js +67 -35
  78. package/dist/autosave-git.js.map +1 -1
  79. package/dist/autosave-group.d.ts +8 -0
  80. package/dist/autosave-group.js +61 -0
  81. package/dist/autosave-group.js.map +1 -0
  82. package/dist/autosave-holders.d.ts +31 -4
  83. package/dist/autosave-holders.js +92 -7
  84. package/dist/autosave-holders.js.map +1 -1
  85. package/dist/autosave-windows.d.ts +14 -0
  86. package/dist/autosave-windows.js +36 -2
  87. package/dist/autosave-windows.js.map +1 -1
  88. package/dist/ci-wait/client.d.ts +20 -3
  89. package/dist/ci-wait/client.js +40 -44
  90. package/dist/ci-wait/client.js.map +1 -1
  91. package/dist/ci-wait/controller.d.ts +622 -36
  92. package/dist/ci-wait/controller.js +152 -20
  93. package/dist/ci-wait/controller.js.map +1 -1
  94. package/dist/ci-wait/errors.d.ts +19 -0
  95. package/dist/ci-wait/errors.js +180 -2
  96. package/dist/ci-wait/errors.js.map +1 -1
  97. package/dist/ci-wait/github.d.ts +25 -1
  98. package/dist/ci-wait/github.js +76 -9
  99. package/dist/ci-wait/github.js.map +1 -1
  100. package/dist/ci-wait/mcp.d.ts +0 -1
  101. package/dist/ci-wait/mcp.js +0 -2
  102. package/dist/ci-wait/mcp.js.map +1 -1
  103. package/dist/ci-wait/supervisor.d.ts +7 -0
  104. package/dist/ci-wait/supervisor.js +113 -17
  105. package/dist/ci-wait/supervisor.js.map +1 -1
  106. package/dist/ci-wait/tools.d.ts +536 -16
  107. package/dist/ci-wait/tools.js +165 -20
  108. package/dist/ci-wait/tools.js.map +1 -1
  109. package/dist/config.d.ts +3 -17
  110. package/dist/config.js +4 -60
  111. package/dist/config.js.map +1 -1
  112. package/dist/contract/active-provider.d.ts +12 -0
  113. package/dist/contract/agent-profiles.d.ts +2 -10
  114. package/dist/contract/ask-schema.d.ts +22 -4
  115. package/dist/contract/ask.d.ts +6 -4
  116. package/dist/contract/attachments.d.ts +35 -0
  117. package/dist/contract/attention.d.ts +46 -37
  118. package/dist/contract/automation-requests.d.ts +308 -0
  119. package/dist/contract/automation-schedule.d.ts +40 -11
  120. package/dist/contract/automation-storage.d.ts +512 -0
  121. package/dist/contract/automations.d.ts +421 -40
  122. package/dist/contract/ci-wait.d.ts +41 -4
  123. package/dist/contract/config-requests.d.ts +36 -0
  124. package/dist/contract/conversations.d.ts +24 -10
  125. package/dist/contract/defined.d.ts +8 -0
  126. package/dist/contract/delegation.d.ts +312 -8
  127. package/dist/contract/events.d.ts +24 -3
  128. package/dist/contract/github-requests.d.ts +26 -0
  129. package/dist/contract/github.d.ts +60 -27
  130. package/dist/contract/handoff.d.ts +43 -0
  131. package/dist/contract/health.d.ts +2 -2
  132. package/dist/contract/image-path.d.ts +6 -0
  133. package/dist/contract/index.d.ts +31 -0
  134. package/dist/contract/index.js +3756 -1525
  135. package/dist/contract/live-coordination.d.ts +158 -0
  136. package/dist/contract/live-limits.d.ts +8 -0
  137. package/dist/contract/live.d.ts +123 -0
  138. package/dist/contract/pending-ask.d.ts +58 -0
  139. package/dist/contract/permissions.d.ts +54 -0
  140. package/dist/contract/preview.d.ts +33 -0
  141. package/dist/contract/project-limits.d.ts +33 -0
  142. package/dist/contract/projects.d.ts +486 -20
  143. package/dist/contract/provider-requests.d.ts +77 -0
  144. package/dist/contract/query-requests.d.ts +52 -0
  145. package/dist/contract/repo-requests.d.ts +12 -0
  146. package/dist/contract/run-labels.d.ts +8 -0
  147. package/dist/contract/run-limits.d.ts +8 -0
  148. package/dist/contract/run-predicates.d.ts +32 -0
  149. package/dist/contract/run-requests.d.ts +33 -0
  150. package/dist/contract/run-search.d.ts +193 -0
  151. package/dist/contract/runs.d.ts +2232 -1894
  152. package/dist/contract/scheduled-tasks.d.ts +187 -0
  153. package/dist/contract/skills.d.ts +22 -772
  154. package/dist/contract/team-skill-ref.d.ts +10 -0
  155. package/dist/{core → contract}/tool-display.d.ts +4 -10
  156. package/dist/contract/ui-state-requests.d.ts +60 -0
  157. package/dist/contract/version.d.ts +3 -0
  158. package/dist/contract/voice.d.ts +213 -0
  159. package/dist/contract/waits.d.ts +1204 -0
  160. package/dist/contract/workflow-file.d.ts +37 -0
  161. package/dist/contract/workflow-requests.d.ts +7 -0
  162. package/dist/contract/workflows.d.ts +1 -2
  163. package/dist/contract/workspace.d.ts +34 -82
  164. package/dist/contract/zoned-time.d.ts +2 -11
  165. package/dist/core/agent-env.d.ts +4 -16
  166. package/dist/core/agent-env.js +14 -16
  167. package/dist/core/agent-env.js.map +1 -1
  168. package/dist/core/agent-profiles.d.ts +28 -40
  169. package/dist/core/agent-profiles.js +56 -51
  170. package/dist/core/agent-profiles.js.map +1 -1
  171. package/dist/core/agent-runner.d.ts +88 -44
  172. package/dist/core/agent-runner.js +17 -18
  173. package/dist/core/agent-runner.js.map +1 -1
  174. package/dist/core/ask.d.ts +3 -0
  175. package/dist/core/ask.js +12 -0
  176. package/dist/core/ask.js.map +1 -1
  177. package/dist/core/backend-detect.js +16 -2
  178. package/dist/core/backend-detect.js.map +1 -1
  179. package/dist/core/claude-cli-runner.d.ts +23 -4
  180. package/dist/core/claude-cli-runner.js +280 -76
  181. package/dist/core/claude-cli-runner.js.map +1 -1
  182. package/dist/core/claude-model-catalog.d.ts +2 -10
  183. package/dist/core/claude-model-catalog.js +2 -10
  184. package/dist/core/claude-model-catalog.js.map +1 -1
  185. package/dist/core/claude-ui-mapper.d.ts +2 -2
  186. package/dist/core/claude-ui-mapper.js +94 -2
  187. package/dist/core/claude-ui-mapper.js.map +1 -1
  188. package/dist/core/codex-app-server-runner.d.ts +3 -4
  189. package/dist/core/codex-app-server-runner.js +146 -51
  190. package/dist/core/codex-app-server-runner.js.map +1 -1
  191. package/dist/core/codex-app-server-transport.d.ts +4 -3
  192. package/dist/core/codex-app-server-transport.js +11 -7
  193. package/dist/core/codex-app-server-transport.js.map +1 -1
  194. package/dist/core/codex-approvals.d.ts +12 -0
  195. package/dist/core/codex-approvals.js +161 -0
  196. package/dist/core/codex-approvals.js.map +1 -0
  197. package/dist/core/codex-permissions.d.ts +1 -1
  198. package/dist/core/codex-ui-mapper.js +45 -1
  199. package/dist/core/codex-ui-mapper.js.map +1 -1
  200. package/dist/core/cursor-acp-runner.d.ts +1 -1
  201. package/dist/core/cursor-acp-runner.js +39 -15
  202. package/dist/core/cursor-acp-runner.js.map +1 -1
  203. package/dist/core/cursor-cli-flags.d.ts +19 -0
  204. package/dist/core/cursor-cli-flags.js +47 -0
  205. package/dist/core/cursor-cli-flags.js.map +1 -0
  206. package/dist/core/cursor-model-catalog.d.ts +22 -0
  207. package/dist/core/cursor-model-catalog.js +53 -24
  208. package/dist/core/cursor-model-catalog.js.map +1 -1
  209. package/dist/core/cursor-print-capabilities.d.ts +16 -0
  210. package/dist/core/cursor-print-capabilities.js +141 -0
  211. package/dist/core/cursor-print-capabilities.js.map +1 -0
  212. package/dist/core/cursor-print-process.d.ts +31 -0
  213. package/dist/core/cursor-print-process.js +117 -0
  214. package/dist/core/cursor-print-process.js.map +1 -0
  215. package/dist/core/cursor-print-runner.d.ts +31 -0
  216. package/dist/core/cursor-print-runner.js +555 -0
  217. package/dist/core/cursor-print-runner.js.map +1 -0
  218. package/dist/core/cursor-print-tool-catalog.d.ts +10 -0
  219. package/dist/core/cursor-print-tool-catalog.js +91 -0
  220. package/dist/core/cursor-print-tool-catalog.js.map +1 -0
  221. package/dist/core/cursor-print-ui-mapper.d.ts +47 -0
  222. package/dist/core/cursor-print-ui-mapper.js +553 -0
  223. package/dist/core/cursor-print-ui-mapper.js.map +1 -0
  224. package/dist/core/cursor-runner.d.ts +24 -0
  225. package/dist/core/cursor-runner.js +149 -0
  226. package/dist/core/cursor-runner.js.map +1 -0
  227. package/dist/core/cursor-ui-mapper.js +5 -2
  228. package/dist/core/cursor-ui-mapper.js.map +1 -1
  229. package/dist/core/defined.d.ts +1 -0
  230. package/dist/core/defined.js +2 -0
  231. package/dist/core/defined.js.map +1 -0
  232. package/dist/core/hook-items.d.ts +14 -0
  233. package/dist/core/hook-items.js +13 -0
  234. package/dist/core/hook-items.js.map +1 -0
  235. package/dist/core/host-model-catalog.d.ts +2 -9
  236. package/dist/core/host-model-catalog.js +2 -9
  237. package/dist/core/host-model-catalog.js.map +1 -1
  238. package/dist/core/managed-session.js +15 -3
  239. package/dist/core/managed-session.js.map +1 -1
  240. package/dist/core/model-identity.d.ts +4 -21
  241. package/dist/core/model-identity.js.map +1 -1
  242. package/dist/core/model-presets.d.ts +2 -13
  243. package/dist/core/model-presets.js +2 -13
  244. package/dist/core/model-presets.js.map +1 -1
  245. package/dist/core/omp-model-catalog.js.map +1 -1
  246. package/dist/core/omp-runner.d.ts +6 -7
  247. package/dist/core/omp-runner.js +92 -33
  248. package/dist/core/omp-runner.js.map +1 -1
  249. package/dist/core/omp-ui-mapper.js +1 -1
  250. package/dist/core/omp-ui-mapper.js.map +1 -1
  251. package/dist/core/opencode-model-catalog.js.map +1 -1
  252. package/dist/core/opencode-permissions.d.ts +52 -0
  253. package/dist/core/opencode-permissions.js +101 -0
  254. package/dist/core/opencode-permissions.js.map +1 -0
  255. package/dist/core/opencode-server-runner.d.ts +10 -9
  256. package/dist/core/opencode-server-runner.js +286 -28
  257. package/dist/core/opencode-server-runner.js.map +1 -1
  258. package/dist/core/opencode-session-error.d.ts +15 -7
  259. package/dist/core/opencode-session-error.js +25 -9
  260. package/dist/core/opencode-session-error.js.map +1 -1
  261. package/dist/core/opencode-ui-mapper.js +2 -2
  262. package/dist/core/opencode-ui-mapper.js.map +1 -1
  263. package/dist/core/pi-model-catalog.js.map +1 -1
  264. package/dist/core/pi-runner.d.ts +12 -4
  265. package/dist/core/pi-runner.js +171 -63
  266. package/dist/core/pi-runner.js.map +1 -1
  267. package/dist/core/pi-ui-mapper.js +1 -1
  268. package/dist/core/pi-ui-mapper.js.map +1 -1
  269. package/dist/core/process-usage.d.ts +5 -0
  270. package/dist/core/process-usage.js +24 -4
  271. package/dist/core/process-usage.js.map +1 -1
  272. package/dist/core/provider-auth.d.ts +16 -107
  273. package/dist/core/provider-auth.js +16 -132
  274. package/dist/core/provider-auth.js.map +1 -1
  275. package/dist/core/runner-factory.d.ts +4 -1
  276. package/dist/core/runner-factory.js +3 -3
  277. package/dist/core/runner-factory.js.map +1 -1
  278. package/dist/core/runner-runtime.d.ts +22 -0
  279. package/dist/core/runner-runtime.js +66 -5
  280. package/dist/core/runner-runtime.js.map +1 -1
  281. package/dist/core/runner-tool-grants.d.ts +21 -0
  282. package/dist/core/runner-tool-grants.js +64 -0
  283. package/dist/core/runner-tool-grants.js.map +1 -0
  284. package/dist/core/secret-redaction.d.ts +3 -20
  285. package/dist/core/secret-redaction.js +3 -20
  286. package/dist/core/secret-redaction.js.map +1 -1
  287. package/dist/core/session-process.d.ts +22 -2
  288. package/dist/core/session-process.js +170 -12
  289. package/dist/core/session-process.js.map +1 -1
  290. package/dist/core/shell-env.d.ts +2 -15
  291. package/dist/core/shell-env.js +2 -15
  292. package/dist/core/shell-env.js.map +1 -1
  293. package/dist/core/ui-events.d.ts +60 -47
  294. package/dist/core/ui-events.js +0 -23
  295. package/dist/core/ui-events.js.map +1 -1
  296. package/dist/core/usage-limit.js.map +1 -1
  297. package/dist/data-gitignore.js +3 -1
  298. package/dist/data-gitignore.js.map +1 -1
  299. package/dist/delegation/capacity.d.ts +4 -8
  300. package/dist/delegation/capacity.js +4 -8
  301. package/dist/delegation/capacity.js.map +1 -1
  302. package/dist/delegation/cli.js +123 -21
  303. package/dist/delegation/cli.js.map +1 -1
  304. package/dist/delegation/context.d.ts +19 -3
  305. package/dist/delegation/context.js +217 -22
  306. package/dist/delegation/context.js.map +1 -1
  307. package/dist/delegation/conversations.d.ts +4 -3
  308. package/dist/delegation/conversations.js +7 -5
  309. package/dist/delegation/conversations.js.map +1 -1
  310. package/dist/delegation/destroy-observation.d.ts +1 -1
  311. package/dist/delegation/destroy-observation.js.map +1 -1
  312. package/dist/delegation/effort.js.map +1 -1
  313. package/dist/delegation/execution-identity.d.ts +1 -1
  314. package/dist/delegation/execution-identity.js +41 -7
  315. package/dist/delegation/execution-identity.js.map +1 -1
  316. package/dist/delegation/idle-test-app.d.ts +4 -0
  317. package/dist/delegation/idle-test-app.js +174 -0
  318. package/dist/delegation/idle-test-app.js.map +1 -0
  319. package/dist/delegation/input.js.map +1 -1
  320. package/dist/delegation/park-notice.d.ts +42 -0
  321. package/dist/delegation/park-notice.js +71 -0
  322. package/dist/delegation/park-notice.js.map +1 -0
  323. package/dist/delegation/policy.d.ts +2 -0
  324. package/dist/delegation/policy.js +9 -1
  325. package/dist/delegation/policy.js.map +1 -1
  326. package/dist/delegation/process-liveness.d.ts +10 -15
  327. package/dist/delegation/process-liveness.js +11 -35
  328. package/dist/delegation/process-liveness.js.map +1 -1
  329. package/dist/delegation/provision.js +21 -19
  330. package/dist/delegation/provision.js.map +1 -1
  331. package/dist/delegation/questions.d.ts +3 -1
  332. package/dist/delegation/questions.js +10 -5
  333. package/dist/delegation/questions.js.map +1 -1
  334. package/dist/delegation/readiness.d.ts +2 -2
  335. package/dist/delegation/results.d.ts +4 -1
  336. package/dist/delegation/results.js +49 -18
  337. package/dist/delegation/results.js.map +1 -1
  338. package/dist/delegation/retry-backoff.d.ts +8 -0
  339. package/dist/delegation/retry-backoff.js +8 -0
  340. package/dist/delegation/retry-backoff.js.map +1 -1
  341. package/dist/delegation/routes.d.ts +114 -30
  342. package/dist/delegation/routes.js +4 -1
  343. package/dist/delegation/routes.js.map +1 -1
  344. package/dist/delegation/scratch-cleanup.d.ts +4 -5
  345. package/dist/delegation/scratch-cleanup.js +10 -8
  346. package/dist/delegation/scratch-cleanup.js.map +1 -1
  347. package/dist/delegation/service.d.ts +12 -4
  348. package/dist/delegation/service.js +76 -28
  349. package/dist/delegation/service.js.map +1 -1
  350. package/dist/delegation/transport.d.ts +154 -70
  351. package/dist/delegation/wait.d.ts +11 -0
  352. package/dist/delegation/wait.js +24 -0
  353. package/dist/delegation/wait.js.map +1 -1
  354. package/dist/delegation/windows-test-app.d.ts +5 -0
  355. package/dist/delegation/windows-test-app.js +63 -0
  356. package/dist/delegation/windows-test-app.js.map +1 -0
  357. package/dist/delegation/windows-workspace-identity.d.ts +3 -0
  358. package/dist/delegation/windows-workspace-identity.js +22 -0
  359. package/dist/delegation/windows-workspace-identity.js.map +1 -0
  360. package/dist/delegation/workspace.d.ts +5 -10
  361. package/dist/delegation/workspace.js +136 -75
  362. package/dist/delegation/workspace.js.map +1 -1
  363. package/dist/detached-process.d.ts +103 -0
  364. package/dist/detached-process.js +301 -0
  365. package/dist/detached-process.js.map +1 -0
  366. package/dist/discovery/catalog.d.ts +2 -1
  367. package/dist/discovery/catalog.js.map +1 -1
  368. package/dist/discovery/cli.js +3 -1
  369. package/dist/discovery/cli.js.map +1 -1
  370. package/dist/git-diff-base.d.ts +6 -61
  371. package/dist/git-diff-base.js +6 -70
  372. package/dist/git-diff-base.js.map +1 -1
  373. package/dist/git-index-copy.d.ts +4 -0
  374. package/dist/git-index-copy.js +10 -0
  375. package/dist/git-index-copy.js.map +1 -0
  376. package/dist/git-worktree-lock.d.ts +2 -4
  377. package/dist/git-worktree-lock.js +2 -4
  378. package/dist/git-worktree-lock.js.map +1 -1
  379. package/dist/git-worktree-release.d.ts +2 -2
  380. package/dist/git-worktree-release.js.map +1 -1
  381. package/dist/git-worktree.d.ts +47 -76
  382. package/dist/git-worktree.js +240 -94
  383. package/dist/git-worktree.js.map +1 -1
  384. package/dist/handoff.d.ts +51 -41
  385. package/dist/handoff.js +130 -78
  386. package/dist/handoff.js.map +1 -1
  387. package/dist/index.js +60 -39
  388. package/dist/index.js.map +1 -1
  389. package/dist/merge-observations.d.ts +13 -0
  390. package/dist/merge-observations.js +55 -0
  391. package/dist/merge-observations.js.map +1 -0
  392. package/dist/open-url.js +4 -14
  393. package/dist/open-url.js.map +1 -1
  394. package/dist/paths.d.ts +10 -13
  395. package/dist/paths.js +36 -17
  396. package/dist/paths.js.map +1 -1
  397. package/dist/planner.d.ts +2 -1
  398. package/dist/planner.js +9 -6
  399. package/dist/planner.js.map +1 -1
  400. package/dist/preview/agent-address.d.ts +34 -0
  401. package/dist/preview/agent-address.js +51 -0
  402. package/dist/preview/agent-address.js.map +1 -0
  403. package/dist/preview/agent-marker.d.ts +17 -0
  404. package/dist/preview/agent-marker.js +71 -0
  405. package/dist/preview/agent-marker.js.map +1 -0
  406. package/dist/preview/cdp-proxy.d.ts +54 -0
  407. package/dist/preview/cdp-proxy.js +151 -0
  408. package/dist/preview/cdp-proxy.js.map +1 -0
  409. package/dist/preview/cdp.d.ts +39 -3
  410. package/dist/preview/cdp.js +155 -57
  411. package/dist/preview/cdp.js.map +1 -1
  412. package/dist/preview/chromium.d.ts +18 -6
  413. package/dist/preview/chromium.js +112 -25
  414. package/dist/preview/chromium.js.map +1 -1
  415. package/dist/preview/dev-server.d.ts +1 -1
  416. package/dist/preview/dev-server.js +20 -44
  417. package/dist/preview/dev-server.js.map +1 -1
  418. package/dist/preview/host.d.ts +70 -3
  419. package/dist/preview/host.js +314 -28
  420. package/dist/preview/host.js.map +1 -1
  421. package/dist/preview/registration.d.ts +10 -5
  422. package/dist/preview/registration.js +2 -0
  423. package/dist/preview/registration.js.map +1 -1
  424. package/dist/preview/session.d.ts +2 -0
  425. package/dist/preview/session.js +10 -0
  426. package/dist/preview/session.js.map +1 -1
  427. package/dist/process-wait/exit-file.d.ts +29 -0
  428. package/dist/process-wait/exit-file.js +67 -0
  429. package/dist/process-wait/exit-file.js.map +1 -0
  430. package/dist/process-wait/supervisor.d.ts +30 -0
  431. package/dist/process-wait/supervisor.js +71 -0
  432. package/dist/process-wait/supervisor.js.map +1 -0
  433. package/dist/release/snapshot.d.ts +6 -6
  434. package/dist/runs/agent-tmpdir.d.ts +51 -36
  435. package/dist/runs/agent-tmpdir.js +389 -132
  436. package/dist/runs/agent-tmpdir.js.map +1 -1
  437. package/dist/runs/auto-name.d.ts +6 -6
  438. package/dist/runs/auto-name.js +1 -1
  439. package/dist/runs/auto-name.js.map +1 -1
  440. package/dist/runs/client-request.d.ts +3 -3
  441. package/dist/runs/client-request.js +3 -3
  442. package/dist/runs/client-request.js.map +1 -1
  443. package/dist/runs/delegation-state.d.ts +11 -2
  444. package/dist/runs/delegation-state.js.map +1 -1
  445. package/dist/runs/event-history-agent-context.d.ts +14 -0
  446. package/dist/runs/event-history-agent-context.js +105 -0
  447. package/dist/runs/event-history-agent-context.js.map +1 -0
  448. package/dist/runs/event-history-context.d.ts +15 -0
  449. package/dist/runs/event-history-context.js +109 -0
  450. package/dist/runs/event-history-context.js.map +1 -0
  451. package/dist/runs/event-history.d.ts +4 -1
  452. package/dist/runs/event-history.js +29 -130
  453. package/dist/runs/event-history.js.map +1 -1
  454. package/dist/runs/history-stream.d.ts +2 -0
  455. package/dist/runs/history-stream.js +62 -0
  456. package/dist/runs/history-stream.js.map +1 -0
  457. package/dist/runs/legacy-index.d.ts +6 -19
  458. package/dist/runs/legacy-index.js +6 -19
  459. package/dist/runs/legacy-index.js.map +1 -1
  460. package/dist/runs/live-item-snapshots.d.ts +13 -0
  461. package/dist/runs/live-item-snapshots.js +79 -0
  462. package/dist/runs/live-item-snapshots.js.map +1 -0
  463. package/dist/runs/loaded-run-healing.d.ts +3 -0
  464. package/dist/runs/loaded-run-healing.js +17 -0
  465. package/dist/runs/loaded-run-healing.js.map +1 -0
  466. package/dist/runs/outcome-commit.d.ts +98 -0
  467. package/dist/runs/outcome-commit.js +132 -0
  468. package/dist/runs/outcome-commit.js.map +1 -0
  469. package/dist/runs/pull-requests.d.ts +14 -0
  470. package/dist/runs/pull-requests.js +96 -0
  471. package/dist/runs/pull-requests.js.map +1 -0
  472. package/dist/runs/raw-record.d.ts +3 -15
  473. package/dist/runs/raw-record.js +3 -15
  474. package/dist/runs/raw-record.js.map +1 -1
  475. package/dist/runs/retention.d.ts +2 -2
  476. package/dist/runs/retention.js +7 -0
  477. package/dist/runs/retention.js.map +1 -1
  478. package/dist/runs/review-gate.d.ts +1 -1
  479. package/dist/runs/review-gate.js.map +1 -1
  480. package/dist/runs/run-claims.d.ts +2 -9
  481. package/dist/runs/run-claims.js.map +1 -1
  482. package/dist/runs/run-database.d.ts +29 -34
  483. package/dist/runs/run-database.js +124 -46
  484. package/dist/runs/run-database.js.map +1 -1
  485. package/dist/runs/run-index.d.ts +6 -25
  486. package/dist/runs/run-index.js +25 -38
  487. package/dist/runs/run-index.js.map +1 -1
  488. package/dist/runs/run-row.d.ts +5 -34
  489. package/dist/runs/run-row.js +13 -38
  490. package/dist/runs/run-row.js.map +1 -1
  491. package/dist/runs/store.d.ts +1597 -744
  492. package/dist/runs/store.js +1231 -739
  493. package/dist/runs/store.js.map +1 -1
  494. package/dist/runs/task-markers.d.ts +1 -0
  495. package/dist/runs/task-markers.js +5 -1
  496. package/dist/runs/task-markers.js.map +1 -1
  497. package/dist/runs/task-refs.d.ts +3 -3
  498. package/dist/runs/transcript-facts-fold.d.ts +64 -0
  499. package/dist/runs/transcript-facts-fold.js +109 -0
  500. package/dist/runs/transcript-facts-fold.js.map +1 -0
  501. package/dist/runs/transcript-facts-load.d.ts +11 -0
  502. package/dist/runs/transcript-facts-load.js +66 -0
  503. package/dist/runs/transcript-facts-load.js.map +1 -0
  504. package/dist/runs/transcript-facts-queue.d.ts +30 -0
  505. package/dist/runs/transcript-facts-queue.js +227 -0
  506. package/dist/runs/transcript-facts-queue.js.map +1 -0
  507. package/dist/runs/transcript-facts-worker.d.ts +15 -0
  508. package/dist/runs/transcript-facts-worker.js +26 -0
  509. package/dist/runs/transcript-facts-worker.js.map +1 -0
  510. package/dist/runs/transcript-facts.d.ts +13 -51
  511. package/dist/runs/transcript-facts.js +86 -202
  512. package/dist/runs/transcript-facts.js.map +1 -1
  513. package/dist/runs/ui-event-sink.d.ts +5 -30
  514. package/dist/runs/ui-event-sink.js +8 -30
  515. package/dist/runs/ui-event-sink.js.map +1 -1
  516. package/dist/runs/webhook.d.ts +104 -38
  517. package/dist/runs/webhook.js +180 -77
  518. package/dist/runs/webhook.js.map +1 -1
  519. package/dist/server/app-type.d.ts +2 -17
  520. package/dist/server/archive-on-merge.d.ts +35 -0
  521. package/dist/server/archive-on-merge.js +202 -0
  522. package/dist/server/archive-on-merge.js.map +1 -0
  523. package/dist/server/capabilities.d.ts +3 -15
  524. package/dist/server/capabilities.js +6 -19
  525. package/dist/server/capabilities.js.map +1 -1
  526. package/dist/server/checkout-progress.d.ts +10 -0
  527. package/dist/server/checkout-progress.js +27 -0
  528. package/dist/server/checkout-progress.js.map +1 -0
  529. package/dist/server/checkout.d.ts +10 -19
  530. package/dist/server/checkout.js +15 -45
  531. package/dist/server/checkout.js.map +1 -1
  532. package/dist/server/cockpit-ownership.d.ts +2 -0
  533. package/dist/server/cockpit-ownership.js +9 -0
  534. package/dist/server/cockpit-ownership.js.map +1 -1
  535. package/dist/server/cold-repo-handles.d.ts +2 -7
  536. package/dist/server/cold-repo-handles.js +2 -7
  537. package/dist/server/cold-repo-handles.js.map +1 -1
  538. package/dist/server/completion-actions.d.ts +30 -0
  539. package/dist/server/completion-actions.js +204 -0
  540. package/dist/server/completion-actions.js.map +1 -0
  541. package/dist/server/create-project.d.ts +71 -0
  542. package/dist/server/create-project.js +448 -0
  543. package/dist/server/create-project.js.map +1 -0
  544. package/dist/server/forge/github-filters.d.ts +7 -1
  545. package/dist/server/forge/github-filters.js +66 -51
  546. package/dist/server/forge/github-filters.js.map +1 -1
  547. package/dist/server/forge/github-merge-requirements.d.ts +18 -0
  548. package/dist/server/forge/github-merge-requirements.js +137 -0
  549. package/dist/server/forge/github-merge-requirements.js.map +1 -0
  550. package/dist/server/forge/github.d.ts +98 -111
  551. package/dist/server/forge/github.js +625 -306
  552. package/dist/server/forge/github.js.map +1 -1
  553. package/dist/server/forge/types.d.ts +25 -22
  554. package/dist/server/fs-browse.d.ts +3 -28
  555. package/dist/server/fs-browse.js.map +1 -1
  556. package/dist/server/git-changes.d.ts +5 -15
  557. package/dist/server/git-changes.js +3 -50
  558. package/dist/server/git-changes.js.map +1 -1
  559. package/dist/server/git.d.ts +3 -1
  560. package/dist/server/git.js +12 -0
  561. package/dist/server/git.js.map +1 -1
  562. package/dist/server/github.d.ts +1 -1
  563. package/dist/server/github.js +1 -1
  564. package/dist/server/github.js.map +1 -1
  565. package/dist/server/launch-key.d.ts +2 -4
  566. package/dist/server/launch-key.js +2 -4
  567. package/dist/server/launch-key.js.map +1 -1
  568. package/dist/server/live-routes.d.ts +68 -0
  569. package/dist/server/live-routes.js +147 -0
  570. package/dist/server/live-routes.js.map +1 -0
  571. package/dist/server/open-in-app.d.ts +4 -13
  572. package/dist/server/open-in-app.js +5 -41
  573. package/dist/server/open-in-app.js.map +1 -1
  574. package/dist/server/open-in-targets.d.ts +42 -0
  575. package/dist/server/open-in-targets.js +110 -0
  576. package/dist/server/open-in-targets.js.map +1 -0
  577. package/dist/server/open-in-terminal.d.ts +3 -0
  578. package/dist/server/open-in-terminal.js +6 -26
  579. package/dist/server/open-in-terminal.js.map +1 -1
  580. package/dist/server/preview-cdp-socket.d.ts +21 -0
  581. package/dist/server/preview-cdp-socket.js +112 -0
  582. package/dist/server/preview-cdp-socket.js.map +1 -0
  583. package/dist/server/preview-socket.d.ts +11 -11
  584. package/dist/server/preview-socket.js +22 -22
  585. package/dist/server/preview-socket.js.map +1 -1
  586. package/dist/server/preview-sockets.d.ts +14 -0
  587. package/dist/server/preview-sockets.js +18 -0
  588. package/dist/server/preview-sockets.js.map +1 -0
  589. package/dist/server/project-context.d.ts +54 -18
  590. package/dist/server/project-context.js +178 -5
  591. package/dist/server/project-context.js.map +1 -1
  592. package/dist/server/provider-action-gate.d.ts +0 -2
  593. package/dist/server/provider-action-gate.js +0 -21
  594. package/dist/server/provider-action-gate.js.map +1 -1
  595. package/dist/server/provider-auth-runtime.d.ts +3 -18
  596. package/dist/server/provider-auth-runtime.js +3 -18
  597. package/dist/server/provider-auth-runtime.js.map +1 -1
  598. package/dist/server/repo-branches.d.ts +3 -9
  599. package/dist/server/repo-branches.js +6 -22
  600. package/dist/server/repo-branches.js.map +1 -1
  601. package/dist/server/run-event-feed.d.ts +20 -0
  602. package/dist/server/run-event-feed.js +190 -0
  603. package/dist/server/run-event-feed.js.map +1 -0
  604. package/dist/server/server-deps.d.ts +37 -0
  605. package/dist/server/server-deps.js +114 -0
  606. package/dist/server/server-deps.js.map +1 -0
  607. package/dist/server/server.d.ts +14082 -11998
  608. package/dist/server/server.js +785 -1647
  609. package/dist/server/server.js.map +1 -1
  610. package/dist/server/start-run-options.d.ts +82 -0
  611. package/dist/server/start-run-options.js +111 -0
  612. package/dist/server/start-run-options.js.map +1 -0
  613. package/dist/server/validators.d.ts +3 -29
  614. package/dist/server/validators.js +1 -2
  615. package/dist/server/validators.js.map +1 -1
  616. package/dist/server/ws.d.ts +3 -23
  617. package/dist/server/ws.js +3 -23
  618. package/dist/server/ws.js.map +1 -1
  619. package/dist/server-install/engine.d.ts +6 -9
  620. package/dist/server-install/engine.js +2 -9
  621. package/dist/server-install/engine.js.map +1 -1
  622. package/dist/server-install/platforms/ubuntu-vps.d.ts +1 -1
  623. package/dist/server-install/state.d.ts +2 -4
  624. package/dist/server-install/state.js +2 -4
  625. package/dist/server-install/state.js.map +1 -1
  626. package/dist/server-install/steps.d.ts +2 -5
  627. package/dist/server-install/steps.js +3 -6
  628. package/dist/server-install/steps.js.map +1 -1
  629. package/dist/server-install/types.d.ts +3 -6
  630. package/dist/server-install/types.js +2 -5
  631. package/dist/server-install/types.js.map +1 -1
  632. package/dist/server-install/ui.d.ts +2 -8
  633. package/dist/server-install/ui.js +3 -3
  634. package/dist/server-install/ui.js.map +1 -1
  635. package/dist/session-context.d.ts +64 -0
  636. package/dist/session-context.js +264 -0
  637. package/dist/session-context.js.map +1 -0
  638. package/dist/skills-provision.d.ts +62 -0
  639. package/dist/skills-provision.js +325 -0
  640. package/dist/skills-provision.js.map +1 -0
  641. package/dist/skills-remote.d.ts +29 -27
  642. package/dist/skills-remote.js +236 -100
  643. package/dist/skills-remote.js.map +1 -1
  644. package/dist/skills.d.ts +25 -36
  645. package/dist/skills.js +43 -54
  646. package/dist/skills.js.map +1 -1
  647. package/dist/subcommands.d.ts +11 -0
  648. package/dist/subcommands.js +24 -0
  649. package/dist/subcommands.js.map +1 -0
  650. package/dist/task-cli/cli.js +78 -25
  651. package/dist/task-cli/cli.js.map +1 -1
  652. package/dist/task-cli/discovery.d.ts +4 -2
  653. package/dist/task-cli/discovery.js +14 -13
  654. package/dist/task-cli/discovery.js.map +1 -1
  655. package/dist/task-cli/hint.d.ts +20 -0
  656. package/dist/task-cli/hint.js +14 -0
  657. package/dist/task-cli/hint.js.map +1 -0
  658. package/dist/task-cli/http.d.ts +1 -0
  659. package/dist/task-cli/http.js +3 -1
  660. package/dist/task-cli/http.js.map +1 -1
  661. package/dist/task-cli/projections.d.ts +14 -11
  662. package/dist/task-cli/projections.js +15 -11
  663. package/dist/task-cli/projections.js.map +1 -1
  664. package/dist/task-cli/watch.d.ts +18 -10
  665. package/dist/task-cli/watch.js +128 -20
  666. package/dist/task-cli/watch.js.map +1 -1
  667. package/dist/ui-state.d.ts +17 -3
  668. package/dist/ui-state.js +56 -9
  669. package/dist/ui-state.js.map +1 -1
  670. package/dist/update-check.d.ts +0 -10
  671. package/dist/update-check.js +1 -16
  672. package/dist/update-check.js.map +1 -1
  673. package/dist/voice/decide.d.ts +32 -0
  674. package/dist/voice/decide.js +297 -0
  675. package/dist/voice/decide.js.map +1 -0
  676. package/dist/voice/decision-log.d.ts +52 -0
  677. package/dist/voice/decision-log.js +107 -0
  678. package/dist/voice/decision-log.js.map +1 -0
  679. package/dist/voice/engine.d.ts +119 -0
  680. package/dist/voice/engine.js +60 -0
  681. package/dist/voice/engine.js.map +1 -0
  682. package/dist/voice/fake-engine.d.ts +10 -0
  683. package/dist/voice/fake-engine.js +192 -0
  684. package/dist/voice/fake-engine.js.map +1 -0
  685. package/dist/voice/jev-engine.d.ts +17 -0
  686. package/dist/voice/jev-engine.js +110 -0
  687. package/dist/voice/jev-engine.js.map +1 -0
  688. package/dist/voice/pending-ask.d.ts +17 -0
  689. package/dist/voice/pending-ask.js +50 -0
  690. package/dist/voice/pending-ask.js.map +1 -0
  691. package/dist/voice/routes.d.ts +115 -0
  692. package/dist/voice/routes.js +91 -0
  693. package/dist/voice/routes.js.map +1 -0
  694. package/dist/voice/sentence.d.ts +21 -0
  695. package/dist/voice/sentence.js +61 -0
  696. package/dist/voice/sentence.js.map +1 -0
  697. package/dist/voice/thresholds.d.ts +28 -0
  698. package/dist/voice/thresholds.js +29 -0
  699. package/dist/voice/thresholds.js.map +1 -0
  700. package/dist/webhooks/cli.d.ts +18 -0
  701. package/dist/webhooks/cli.js +145 -0
  702. package/dist/webhooks/cli.js.map +1 -0
  703. package/dist/webhooks/prompt.d.ts +5 -0
  704. package/dist/webhooks/prompt.js +26 -0
  705. package/dist/webhooks/prompt.js.map +1 -0
  706. package/dist/workflows/active-run.d.ts +167 -0
  707. package/dist/workflows/active-run.js +21 -0
  708. package/dist/workflows/active-run.js.map +1 -0
  709. package/dist/workflows/continuation-admission.d.ts +913 -0
  710. package/dist/workflows/continuation-admission.js +265 -0
  711. package/dist/workflows/continuation-admission.js.map +1 -0
  712. package/dist/workflows/execution-account.d.ts +13 -0
  713. package/dist/workflows/execution-account.js +18 -0
  714. package/dist/workflows/execution-account.js.map +1 -0
  715. package/dist/workflows/input-acknowledgement.d.ts +152 -0
  716. package/dist/workflows/input-acknowledgement.js +38 -0
  717. package/dist/workflows/input-acknowledgement.js.map +1 -0
  718. package/dist/workflows/line-order.d.ts +5 -0
  719. package/dist/workflows/line-order.js +25 -0
  720. package/dist/workflows/line-order.js.map +1 -0
  721. package/dist/workflows/outcome-batches.d.ts +20 -0
  722. package/dist/workflows/outcome-batches.js +25 -0
  723. package/dist/workflows/outcome-batches.js.map +1 -0
  724. package/dist/workflows/question-routing.d.ts +8 -0
  725. package/dist/workflows/question-routing.js +18 -0
  726. package/dist/workflows/question-routing.js.map +1 -0
  727. package/dist/workflows/run-scheduling.d.ts +35 -0
  728. package/dist/workflows/run-scheduling.js +61 -0
  729. package/dist/workflows/run-scheduling.js.map +1 -0
  730. package/dist/workflows/run-states.d.ts +190 -0
  731. package/dist/workflows/run-states.js +295 -0
  732. package/dist/workflows/run-states.js.map +1 -0
  733. package/dist/workflows/run.d.ts +1296 -278
  734. package/dist/workflows/run.js +5730 -3265
  735. package/dist/workflows/run.js.map +1 -1
  736. package/dist/workflows/turn-end.d.ts +116 -0
  737. package/dist/workflows/turn-end.js +68 -0
  738. package/dist/workflows/turn-end.js.map +1 -0
  739. package/dist/workflows/types.d.ts +35 -130
  740. package/dist/workflows/types.js +47 -100
  741. package/dist/workflows/types.js.map +1 -1
  742. package/dist/workflows/waits.d.ts +74 -0
  743. package/dist/workflows/waits.js +197 -0
  744. package/dist/workflows/waits.js.map +1 -0
  745. package/dist/workspace/agent-accounts.d.ts +5 -38
  746. package/dist/workspace/agent-accounts.js +14 -40
  747. package/dist/workspace/agent-accounts.js.map +1 -1
  748. package/dist/workspace/agent-profiles.d.ts +40 -16
  749. package/dist/workspace/agent-profiles.js +77 -17
  750. package/dist/workspace/agent-profiles.js.map +1 -1
  751. package/dist/workspace/config.d.ts +48 -49
  752. package/dist/workspace/config.js +68 -72
  753. package/dist/workspace/config.js.map +1 -1
  754. package/dist/workspace/migrations.d.ts +3 -13
  755. package/dist/workspace/migrations.js.map +1 -1
  756. package/dist/workspace/projects-cli.d.ts +1 -1
  757. package/dist/workspace/projects-cli.js.map +1 -1
  758. package/dist/workspace/projects.d.ts +15 -18
  759. package/dist/workspace/projects.js +20 -16
  760. package/dist/workspace/projects.js.map +1 -1
  761. package/dist/workspace/semaphore.d.ts +11 -45
  762. package/dist/workspace/semaphore.js +6 -18
  763. package/dist/workspace/semaphore.js.map +1 -1
  764. package/dist/workspace/ui-state.d.ts +6 -4
  765. package/dist/workspace/ui-state.js +6 -4
  766. package/dist/workspace/ui-state.js.map +1 -1
  767. package/dist/workspace/webhooks.d.ts +40 -0
  768. package/dist/workspace/webhooks.js +146 -0
  769. package/dist/workspace/webhooks.js.map +1 -0
  770. package/dist/worktree-manifest.d.ts +165 -0
  771. package/dist/worktree-manifest.js +530 -0
  772. package/dist/worktree-manifest.js.map +1 -0
  773. package/dist/worktree-setup.js.map +1 -1
  774. package/package.json +6 -5
  775. package/scripts/benchmark-run-store-fixture.ts +7 -3
  776. package/scripts/check-pack.mjs +3 -1
  777. package/scripts/inline-contract.mjs +80 -27
  778. package/scripts/install-as-command.mjs +3 -1
  779. package/scripts/measure-transcript-facts-health.mjs +87 -0
  780. package/scripts/measure-transcript-facts-lag.mjs +68 -0
  781. package/scripts/mock-ci-tool.mjs +49 -6
  782. package/scripts/mock-claude-model-refusal.mjs +42 -0
  783. package/scripts/mock-claude.mjs +833 -591
  784. package/scripts/mock-codex-app-server.mjs +785 -418
  785. package/scripts/mock-cursor-acp.mjs +296 -125
  786. package/scripts/mock-cursor-print.mjs +256 -0
  787. package/scripts/mock-deferred-turn-start.mjs +16 -0
  788. package/scripts/mock-delivery-control.d.mts +23 -0
  789. package/scripts/mock-delivery-control.mjs +80 -0
  790. package/scripts/mock-env-record.mjs +11 -0
  791. package/scripts/mock-failure-control.d.mts +13 -0
  792. package/scripts/mock-failure-control.mjs +68 -0
  793. package/scripts/mock-multi-pr.mjs +7 -0
  794. package/scripts/mock-nudge.mjs +45 -0
  795. package/scripts/mock-omp-rpc.mjs +429 -255
  796. package/scripts/mock-opencode-serve.mjs +972 -557
  797. package/scripts/mock-pi-rpc.mjs +558 -331
  798. package/scripts/mock-runner-crash.mjs +18 -2
  799. package/scripts/mock-session-context.d.mts +5 -0
  800. package/scripts/mock-session-context.mjs +56 -0
  801. package/scripts/mock-silent-tail.mjs +10 -3
  802. package/scripts/pi-default-tools.mjs +22 -0
  803. package/scripts/pi-project-skills.mjs +59 -0
  804. package/scripts/probe-cursor-print.mjs +627 -0
  805. package/scripts/transcript-facts-fixture.mjs +53 -0
  806. package/scripts/voice-replay.ts +50 -0
  807. package/scripts/windows-workspace-identity.cs +208 -0
  808. package/scripts/windows-workspace-identity.ps1 +10 -0
  809. package/web/dist/assets/alert-dialog-DfctKUMw.js +1 -0
  810. package/web/dist/assets/button-CeupvoKG.js +41 -0
  811. package/web/dist/assets/centered-state-hDsyXrnH.js +1 -0
  812. package/web/dist/assets/cez-idle-D3aj_9lp.js +1 -0
  813. package/web/dist/assets/diff-BnIXZK3i2.js +3 -0
  814. package/web/dist/assets/diff-controls-GewpW9aF.js +1 -0
  815. package/web/dist/assets/diff-view-Byo7gpvW.js +11 -0
  816. package/web/dist/assets/dropdown-menu-COj_J5wd.js +6 -0
  817. package/web/dist/assets/eye-B8okNWXU.js +1 -0
  818. package/web/dist/assets/git-toolbar-DY0z0n4S.js +1 -0
  819. package/web/dist/assets/github-DwU6ALRK.js +1 -0
  820. package/web/dist/assets/{image-preview-FOEfqpZP.js → image-preview-C_t9q45f.js} +1 -1
  821. package/web/dist/assets/index-BOfE8pyD.js +34 -0
  822. package/web/dist/assets/index-D9HpsmdW.css +1 -0
  823. package/web/dist/assets/live-protocol-Uce2NwEX.js +64 -0
  824. package/web/dist/assets/live-worker-BizfZSoh.ts +33 -0
  825. package/web/dist/assets/markdown-BBDDg-4t.js +1 -0
  826. package/web/dist/assets/nav-row-styles-AoIhhIwf.js +1 -0
  827. package/web/dist/assets/popover-D56fhiXj.js +1 -0
  828. package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +3 -0
  829. package/web/dist/assets/reference-chip-gQNk-4jc.js +1 -0
  830. package/web/dist/assets/repo-git-B5ECDUuv.js +1 -0
  831. package/web/dist/assets/{repo-git-CoKp-g9K.css → repo-git-DVXNOJDT.css} +1 -1
  832. package/web/dist/assets/run-header-C0Y1NvEM.js +2 -0
  833. package/web/dist/assets/run-header-CC7VUTg9.css +1 -0
  834. package/web/dist/assets/skills-DUeTkZ9z.js +1 -0
  835. package/web/dist/assets/status-dot-1PR0i69P.js +1 -0
  836. package/web/dist/assets/tab-link-DmWk4l5O.js +1 -0
  837. package/web/dist/assets/task-changes-DKZXuW89.js +1 -0
  838. package/web/dist/assets/task-commits-BZ6KxWdF.js +1 -0
  839. package/web/dist/assets/task-files-DlF7Apcn.js +2 -0
  840. package/web/dist/assets/task-github-item-CVPo3geZ.js +1 -0
  841. package/web/dist/assets/task-thread-DtQ6uGfQ.css +1 -0
  842. package/web/dist/assets/task-thread-mm4-ECyo.js +9 -0
  843. package/web/dist/assets/thread-state-CIw2BlhT.js +4 -0
  844. package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +1 -0
  845. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +1 -0
  846. package/web/dist/assets/workflows-D8vYD-ql.js +7 -0
  847. package/web/dist/assets/zoomable-image-CxQSsfcn.js +1 -0
  848. package/web/dist/index.html +13 -17
  849. package/web/dist/live-worker.js +4 -0
  850. package/dist/core/tool-display.js +0 -179
  851. package/dist/core/tool-display.js.map +0 -1
  852. package/dist/runs/human-ask-summary.d.ts +0 -9
  853. package/dist/runs/human-ask-summary.js +0 -39
  854. package/dist/runs/human-ask-summary.js.map +0 -1
  855. package/dist/runs/run-search.d.ts +0 -29
  856. package/dist/runs/run-search.js +0 -63
  857. package/dist/runs/run-search.js.map +0 -1
  858. package/dist/skills-banner.d.ts +0 -22
  859. package/dist/skills-banner.js +0 -41
  860. package/dist/skills-banner.js.map +0 -1
  861. package/dist/skills-update.d.ts +0 -88
  862. package/dist/skills-update.js +0 -392
  863. package/dist/skills-update.js.map +0 -1
  864. package/dist/todos.d.ts +0 -48
  865. package/dist/todos.js +0 -201
  866. package/dist/todos.js.map +0 -1
  867. package/web/dist/assets/agent-accounts-CFOBMVHc.js +0 -1
  868. package/web/dist/assets/alert-dialog-BrpNUwMt.js +0 -1
  869. package/web/dist/assets/button-C_rd7CPp.js +0 -43
  870. package/web/dist/assets/compare-variants-D6WXhvXA.js +0 -1
  871. package/web/dist/assets/diff-DrEARXTV.js +0 -3
  872. package/web/dist/assets/diff-controls-B1-j7nFg.js +0 -1
  873. package/web/dist/assets/diff-view-DvGLjdTk.js +0 -6
  874. package/web/dist/assets/dropdown-menu-BegOZFrj.js +0 -1
  875. package/web/dist/assets/format-DpNe3S0A.js +0 -1
  876. package/web/dist/assets/git-toolbar-Cw4ljmhB.js +0 -1
  877. package/web/dist/assets/github-CfV5sqL0.js +0 -1
  878. package/web/dist/assets/index-DgWWlOLy.js +0 -13
  879. package/web/dist/assets/index-fBFnuvxu.css +0 -1
  880. package/web/dist/assets/nav-row-styles-vp2JbhuJ.js +0 -1
  881. package/web/dist/assets/popover-BohP6WTx.js +0 -1
  882. package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +0 -3
  883. package/web/dist/assets/preview-state-vuMviq6q.js +0 -1
  884. package/web/dist/assets/prompt-templates-Cubdut_C.js +0 -15
  885. package/web/dist/assets/repo-git-Cf4t5PD0.js +0 -1
  886. package/web/dist/assets/run-diff-BpkUW37Z.js +0 -3
  887. package/web/dist/assets/run-header-68WHf9wV.js +0 -1
  888. package/web/dist/assets/run-header-8GObNx6F.css +0 -1
  889. package/web/dist/assets/search-x-I9Q8pgUa.js +0 -1
  890. package/web/dist/assets/skills-DFBiAuJG.js +0 -1
  891. package/web/dist/assets/skills-DiVIgKeU.js +0 -1
  892. package/web/dist/assets/square-terminal-B6RYYieR.js +0 -1
  893. package/web/dist/assets/status-dot-CqTJHSP9.js +0 -1
  894. package/web/dist/assets/tab-link-B07Hu4QX.js +0 -1
  895. package/web/dist/assets/task-changes--lQF6EYf.js +0 -1
  896. package/web/dist/assets/task-commits-Cx0qy4DN.js +0 -1
  897. package/web/dist/assets/task-files-D50s-gKW.js +0 -2
  898. package/web/dist/assets/task-github-item-DaqmSwYT.js +0 -1
  899. package/web/dist/assets/task-thread-BPQ64lui.js +0 -7
  900. package/web/dist/assets/task-thread-zNE2Q9E-.css +0 -1
  901. package/web/dist/assets/textarea-D20O4Pw0.js +0 -1
  902. package/web/dist/assets/thread-state-DWcFMrvb.js +0 -4
  903. package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +0 -1
  904. package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +0 -1
  905. package/web/dist/assets/utils-JsL3ZsJf.js +0 -64
  906. package/web/dist/assets/workflows-jwG7uxqi.js +0 -11
  907. package/web/dist/assets/zoomable-image-BJJ64KGc.js +0 -1
@@ -1,18 +1,32 @@
1
- import { type PreviewStopRequest, type PreviewStopResult, type CiWait, type CiWaitRequest, type PreviewServeRequest, type PreviewServeResult } from '../contract/index.js';
1
+ import type { ContinueRunOptions } from './continuation-admission.ts';
2
+ import type { ScheduleTaskAnswer, ScheduleTaskRequest, ScheduledTasksAnswer, ScheduledTasksRequest } from '../contract/index.js';
3
+ import { type CezarAskRequest, type CezarDoneAnswer, type CezarDoneRequest, type CezarWaitRequestInput, type PrWaitEntry, type ProcessWaitEntry, type HumanWaitEntry, type TimerWaitEntry, type WaitVia, type WorkerWaitEntry, type DeadlinedWorkerWaitEntry } from '../contract/index.js';
4
+ import { type PreviewStopRequest, type PreviewStopResult, type PreviewServeRequest, type PreviewServeResult } from '../contract/index.js';
5
+ import { AUTONOMOUS_NUDGE } from './turn-end.ts';
6
+ export { runAccountKey } from './run-scheduling.ts';
2
7
  import { type PreviewHostLike } from '../preview/registration.ts';
8
+ import type { CezarToolHandlers } from '../ci-wait/controller.ts';
3
9
  import { type WorkerAccountBinding } from '../delegation/execution-identity.ts';
4
10
  import type { DelegationProvisioner } from '../delegation/provision.ts';
11
+ import { type AskRequest } from '../core/ask.ts';
5
12
  import { type CwdSource } from '../delegation/process-liveness.ts';
6
13
  import type { RunnerId } from '../core/agent-runner.ts';
7
- import { type AgentInput, type WorkerStopResult, type WorkerWait, type WorkerWaitRequest, type RequestWaitRequest } from '../contract/index.js';
8
- import type { ContentBlock } from '../core/agent-runner.ts';
14
+ import { type AgentInput, type WorkerStopResult, type WorkerWait, type WorkerWaitRequest } from '../contract/index.js';
15
+ import { type RequestWaitRequest } from '../contract/index.js';
16
+ import type { AgentEvent, ContentBlock } from '../core/agent-runner.ts';
9
17
  import { type Skill } from '../skills.ts';
10
18
  import { type QueuedMessage, type RunRecord, type RunStore } from '../runs/store.ts';
11
19
  import { WorkspaceSemaphore, type AccountHolds } from '../workspace/semaphore.ts';
12
20
  import type { UiEvent } from '../core/ui-events.ts';
13
- import { type WorkflowDef } from './types.ts';
21
+ import { type WorkflowDef, type WorkflowStepDef } from './types.ts';
14
22
  /** An interactive session that hears nothing from the user closes itself. */
15
23
  export declare const IDLE_TIMEOUT_MS: number;
24
+ /** Claude's native scheduler is the backend-level equivalent of the textual
25
+ * monitoring marker. Keep this recognition here, at the workflow boundary,
26
+ * so the v1 event protocol stays unchanged and other backends do not acquire
27
+ * semantics from a coincidentally named tool (#46). Undefined: not the scheduler; null: the
28
+ * scheduler without a usable `delaySeconds`; otherwise that delay (hearsay-tools/cezarion#1233). */
29
+ export declare function claudeScheduleWakeupDelay(event: AgentEvent, backend: RunnerId): number | null | undefined;
16
30
  /**
17
31
  * Preserve boundaries between complete assistant text blocks while a turn is
18
32
  * accumulated for marker parsing. The runners join these same v1 blocks with
@@ -23,13 +37,46 @@ export declare function appendTurnText(current: string, next: string): string;
23
37
  export type TurnTail = 'none' | 'visible' | 'silent';
24
38
  /** Last top-level completed item: a non-empty assistant message is a visible tail; reasoning or a tool is silent even after earlier visible text (#544). An empty turn stays `none` and never nudges. */
25
39
  export declare function trackTurnTail(tail: TurnTail, event: UiEvent): TurnTail;
40
+ /** What a turn's active `CEZ:ASK` declaration resolves to: the card to raise, and
41
+ * the notes to persist alongside it. */
42
+ type AskTurnOutcome = {
43
+ ask: AskRequest | null;
44
+ /** Emitted in order by the caller, which owns how a note is persisted. */
45
+ notes: Array<{
46
+ message: string;
47
+ tone?: 'danger';
48
+ }>;
49
+ };
50
+ /** How a turn end reads its turn (`classifyTurnEnd`). */
51
+ type TurnEndRead = AskTurnOutcome & {
52
+ done: boolean;
53
+ monitoring: boolean;
54
+ humanGate: boolean;
55
+ waitCard: boolean;
56
+ };
57
+ /** One turn-end decision for fresh and Continue, also retained until an input
58
+ * ACK settles. DONE and human gates take precedence over a quiet
59
+ * declaration or live workers; a false pending-ASK flag alone proves nothing.
60
+ * A human wait this turn registered and nobody has seen yet (hearsay-tools/cezarion#1234)
61
+ * raises its card, or the human gate when it has none, unless DONE wins or a valid ask line
62
+ * replaces its card; `waitCard` says the card is the wait's own. An accepted `cezar_done` is DONE
63
+ * whatever the text says, and beats any ask line in it. Only markers and waits count: no prose
64
+ * raises the gate, and a rejected ask line is a turn end with no wait. */
65
+ export declare function classifyTurnEnd(turnText: string, completedAssistantText: string, options: {
66
+ sessionOpen: boolean;
67
+ pendingHumanAsk: boolean;
68
+ scheduledWake: boolean;
69
+ liveWorkers: boolean;
70
+ humanWait?: Pick<HumanWaitEntry, 'questions' | 'context'> | undefined;
71
+ doneRequested?: boolean | undefined;
72
+ }): TurnEndRead;
26
73
  /** Periodic "cezar autosave" commit in the task worktree (spec 006). */
27
74
  export declare const AUTOSAVE_INTERVAL_MS = 90000;
28
75
  export { CHECK_KILL_GRACE_MS, CHECK_TERMINATION_CONFIRM_MS } from './grouped-command.ts';
29
- /** The periodic autosave timer is opt-in (#471): off, a task branch carries only the
30
- * agent's own commits plus the turn-end/pre-PR flushes — no mid-run "cezar autosave"
31
- * noise interleaving PR history. The flushes (`autosaveCommit` at turn end and before
32
- * a draft PR) are NOT gated: the branch must still end holding the finished state. */
76
+ /**
77
+ * Periodic saves are opt-in. Turn-end, finalization and pre-PR flushes remain enabled; only
78
+ * pre-PR follows a repointed HEAD. Coalesce timer-save evidence in the handoff.
79
+ */
33
80
  export declare function periodicAutosaveEnabled(env?: NodeJS.ProcessEnv): boolean;
34
81
  /**
35
82
  * Explicitly opt out of the repository-root lease for runs that execute in the
@@ -42,44 +89,45 @@ export declare function repositoryRootLockDisabled(env?: NodeJS.ProcessEnv): boo
42
89
  export type DelegationExecutionSettings = {
43
90
  cwd: string;
44
91
  runner: RunnerId;
45
- model?: string;
46
- modelIdentity?: string;
47
- effort?: string;
92
+ model?: string | undefined;
93
+ modelIdentity?: string | undefined;
94
+ effort?: string | undefined;
48
95
  agentProfile: string;
49
- accountBinding?: WorkerAccountBinding;
50
- systemPrompt?: string;
51
- allowedTools?: string[];
52
- bashAllowlist?: string[];
53
- };
54
- /** What a Continue may carry (`RunManager.continueRun`). */
55
- type ContinueRunOptions = {
56
- text?: string;
57
- images?: PastedContent[];
58
- runner?: RunnerId;
59
- /** Internal configured fallback for an untouched workflow, resolved by the route. */
60
- originalRunner?: RunnerId;
61
- model?: string;
62
- /** Reasoning-effort pin (#45). Omitted keeps the run's pin; empty string clears it. */
63
- effort?: string;
64
- /** Agent account for the reopened session (spec 2026-07-29-agent-profiles). Omitted = the
65
- * account the run is already on. */
66
- agentProfile?: string;
67
- /** #505: the parent reply this continuation delivers as the answer to a routed question. */
68
- answerInputId?: string;
96
+ accountBinding?: WorkerAccountBinding | undefined;
97
+ systemPrompt?: string | undefined;
98
+ allowedTools?: string[] | undefined;
99
+ bashAllowlist?: string[] | undefined;
69
100
  };
70
101
  /** #505: a real steer is read at the harness's next model step; a quiet boundary this long
71
102
  * with input still unread means the harness will not read it without help. */
72
103
  export declare const UNREAD_INPUT_GRACE_MS = 30000;
73
104
  /** #486: recheck a turn-end that deferred close/park only because the harness still held a human follow-up. */
74
105
  export declare const HELD_HUMAN_INPUT_RECHECK_MS = 250;
75
- /** Bound a final-message nudge that is ACKed but never produces a turn (#544).
76
- * OpenCode heartbeats re-arm the managed-session no-progress guard, so this is
77
- * the DEFAULT-path exit when the agent stays silent. Overridable on RunManager. */
78
- export declare const FINAL_MESSAGE_NUDGE_REPLY_MS: number;
106
+ /** Bound a no-wait nudge that is ACKed but never produces a turn (#544,
107
+ * hearsay-tools/cezarion#1234). OpenCode heartbeats re-arm the managed-session no-progress
108
+ * guard, so this is the DEFAULT-path exit when the agent stays silent. Overridable on RunManager. */
109
+ export declare const NO_WAIT_NUDGE_REPLY_MS: number;
110
+ /** The turn-end rule's notes (hearsay-tools/cezarion#1234). */
111
+ export declare const NO_WAIT_NUDGE_NOTE = "no wait or done \u2014 reminding the agent once";
112
+ export declare const NO_WAIT_NOTE = "waiting for you: the agent ended its turn without a wait or done";
113
+ export declare const NO_WAIT_NO_REPLY_NOTE = "no reply to the no-wait nudge \u2014 waiting for you";
114
+ export declare const COMPLETION_NO_REPLY_NOTE = "no reply to the completion nudge \u2014 waiting for you";
115
+ /** A worker's second turn end with no wait or done asks its parent, as a routed open question
116
+ * (hearsay-tools/cezarion#1301). */
117
+ export declare const WORKER_FALLBACK_QUESTION: (workerId: string) => string;
118
+ export declare const WORKER_FALLBACK_HEADER = "Worker idle";
119
+ export declare const WORKER_FALLBACK_NOTE = "no wait or done after the nudge \u2014 asking the parent";
120
+ export declare const WORKER_FALLBACK_REPLY_NOTE = "parent answered the idle worker";
121
+ /** A root's done blocked at a turn end is answered with the refusal `cezar_done` gives, as one
122
+ * automatic turn (hearsay-tools/cezarion#1301). The nudge adds this sentence when live workers block
123
+ * it; the mid-turn answer never does. */
124
+ export declare const COMPLETION_WILL_WAIT = "If you end your turn with done again while these workers are live, Cezar will wait on them for you and wake you when they have all settled.";
125
+ export declare const COMPLETION_NUDGE_NOTE = "completion blocked \u2014 refusal sent to the agent";
126
+ /** An autonomous run's ask line before the budget, which `cezar_ask` would refuse: its questions follow. */
127
+ export declare const AUTONOMOUS_ASK_NOTE = "autonomous \u2014 question not registered; continuing";
79
128
  /** Bound one unattended session; an explicit Continue starts a new budget. */
80
129
  export declare const MAX_AUTO_CONTINUES = 40;
81
- export declare const AUTONOMOUS_NUDGE = "Continue working autonomously until the task is fully complete. Do not ask me for confirmation or clarification \u2014 make reasonable assumptions and proceed. When everything is done, end the session with your done signal.";
82
- export declare const FINAL_MESSAGE_NUDGE = "Your last turn ended without a message to the user. Write your user-facing reply now: what you did, where things stand, and anything you need from the user. If the task goal is fully achieved, end that message with CEZ:DONE.";
130
+ export { AUTONOMOUS_NUDGE };
83
131
  /**
84
132
  * Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
85
133
  *
@@ -95,6 +143,23 @@ export declare const AUTO_RESUME_GRACE_MS = 30000;
95
143
  * enough to sit through a couple of days of five-hour windows.
96
144
  */
97
145
  export declare const MAX_AUTO_RESUMES = 12;
146
+ /**
147
+ * Consecutive failed automatic attempts to deliver a run's wait results (hearsay-tools/cezarion#1233):
148
+ * each is a session that failed, or closed cleanly, while the results were still owed, counted across
149
+ * the replacement sessions that retry them. At the bound the run settles `failed` and keeps the
150
+ * results for a human. The count is in memory, per manager, so a restart starts it again, like the
151
+ * per-session wake budget. A delivery acknowledgement, human input, Continue, Stop, Finish and
152
+ * cancel reset it; a usage-limit failure is not counted, because its own hold and automatic resume
153
+ * take it.
154
+ */
155
+ export declare const MAX_WAKE_DELIVERY_ATTEMPTS = 3;
156
+ export declare const WAKE_DELIVERY_CAP_NOTE = "could not deliver wait results after 3 attempts \u2014 continue this task to retry";
157
+ /** The error of a session that closed cleanly while it still owed wait results. */
158
+ export declare const WAKE_SESSION_CLOSED_ERROR = "the session closed before the wait results were delivered";
159
+ /** Stop on a failed run that held wait results: the results and the open waits are gone. */
160
+ export declare const WAITS_DISCARDED_NOTE = "Stop discarded the waits this task held and their results; the task stays failed";
161
+ /** Stop on a failed run that only owed a completion refusal (hearsay-tools/cezarion#1301). */
162
+ export declare const REFUSAL_DISCARDED_NOTE = "Stop discarded the completion refusal this task still owed; the task stays failed";
98
163
  /**
99
164
  * How long a missed deadline stays worth acting on. The promise is "we pick this up when the
100
165
  * window reopens" — kept across a restart or an overnight close, which is the case the feature
@@ -111,56 +176,48 @@ export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
111
176
  * in-memory checks), unref'd, and it only ever acts when idling has no justification left.
112
177
  */
113
178
  export declare const QUEUE_WATCHDOG_MS = 60000;
114
- /**
115
- * Which agent ACCOUNT a run's work runs on — the thing a provider usage limit actually closes
116
- * (spec 2026-08-03-auto-resume-after-usage-limit).
117
- *
118
- * Backend plus agent account, because those are the two axes a limit is scoped to: a Claude
119
- * limit must never stall a Codex task, and a second Claude login is a second budget. A record
120
- * that names no runner has not started yet and will take the configured default, which is what
121
- * `fallbackRunner` carries; a run that HAS started always carries its resolved runner (execute
122
- * persists it), and only started runs can be holding.
123
- */
124
- export declare function runAccountKey(run: Pick<RunRecord, 'runner' | 'agentProfile'>, fallbackRunner: RunnerId): string;
125
179
  export interface StartRunInput {
126
180
  task: string;
127
- model?: string;
181
+ model?: string | undefined;
128
182
  /** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
129
183
  * Unset = harness default. Same class of override as `model`. */
130
- effort?: string;
184
+ effort?: string | undefined;
131
185
  /** Agent backend chosen for this task (GUI). Unset = the config default. */
132
- runner?: RunnerId;
186
+ runner?: RunnerId | undefined;
133
187
  /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
134
188
  * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
135
189
  * survives into resume and Continue, and so the thread can say which account did the work. */
136
- agentProfile?: string;
190
+ agentProfile?: string | undefined;
137
191
  /** Attachments pasted into the new-task form — persisted when the run is created and
138
192
  * delivered once, with the first agent step's opening message. Images ride along as blocks the
139
193
  * model can view; a file (#950) only ever reaches the agent as the path it was written to. */
140
- images?: PastedContent[];
194
+ images?: PastedContent[] | undefined;
141
195
  /** Per-run system-prompt override (`POST /api/runs`, programmatic callers).
142
196
  * Replaces the `config.json` default for this run — see
143
197
  * `resolveExtraSystemPrompt` for the precedence contract. */
144
- systemPrompt?: string;
198
+ systemPrompt?: string | undefined;
145
199
  /** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
146
200
  * working tree instead of an isolated worktree. Undefined/`true` keeps the
147
- * default per-task worktree. Ignored for variants (they always isolate). */
148
- worktree?: boolean;
201
+ * default per-task worktree. */
202
+ worktree?: boolean | undefined;
149
203
  /** Autonomous mode (#autonomous): eligible turn ends auto-continue until done
150
204
  * or the safety cap. Native asks, input delivery and lifecycle waits still apply. */
151
- autonomous?: boolean;
205
+ autonomous?: boolean | undefined;
206
+ archiveWhenDone?: boolean | undefined;
207
+ autoMergePr?: boolean | undefined;
152
208
  /** Task webhook opt-in (#589). Persisted on the record at creation; read from there after. */
153
- notify?: boolean;
154
- /** Follow-up inbox generation (spec 007, #444). Omitted means enabled for
155
- * compatibility; the handoff journal runs either way. */
156
- generateFollowups?: boolean;
209
+ notify?: boolean | undefined;
157
210
  /** Attachments from the queued prompt stack (#472), re-encoded from disk by
158
211
  * `hydrateQueuedInput` at dequeue. Kept separate from `images` because those
159
212
  * are persisted into `taskImages` by `startRun()` — folding
160
213
  * the stack's (already-persisted) files in there would write duplicate files
161
214
  * and make the task bubble render the stack's images as its own. In-memory
162
215
  * only: rebuilt from the record on every hydration, never persisted. */
163
- stackedImages?: ContentBlock[];
216
+ stackedImages?: ContentBlock[] | undefined;
217
+ /** Automation provenance (hearsay-tools/cezarion#1465). Written by `createRun` in the row that
218
+ * creates the run, so a receipt never points at nothing after a crash. */
219
+ automation?: RunRecord['automation'];
220
+ automationTrigger?: RunRecord['automationTrigger'];
164
221
  }
165
222
  /**
166
223
  * The effective "extra" system prompt for a run (spec §protocol v2, R2 2.3):
@@ -245,9 +302,6 @@ export declare function pastedAttachmentsText(attachments: PersistedAttachment[]
245
302
  /** Same note as `pastedAttachmentsText`, wrapped as a trailing `ContentBlock`
246
303
  * ready to append to a message's content array. */
247
304
  export declare function pastedAttachmentsNote(attachments: PersistedAttachment[]): ContentBlock;
248
- /** Variant letters + the fixed diversification hints (spec 010). A runs the
249
- * task verbatim; B/C get one constant sentence each — zero configuration. */
250
- export declare const VARIANT_LETTERS: readonly ['A', 'B', 'C'];
251
305
  /** Only an original workflow that has never executed may return to its queue. */
252
306
  export declare function isUntouchedCancelledRun(run: RunRecord): boolean;
253
307
  /** #469: why destroy could not prove a crashed generation's termination. */
@@ -260,6 +314,11 @@ export type WorkerTerminationBlocker = {
260
314
  kind: 'processes';
261
315
  pids: number[];
262
316
  };
317
+ /** hearsay-tools/cezarion#1465: what `startServer` hands a manager for the schedule tools. */
318
+ export type AutomationToolService = {
319
+ scheduleTask(request: ScheduleTaskRequest): Promise<ScheduleTaskAnswer>;
320
+ scheduledTasks(request: ScheduledTasksRequest): Promise<ScheduledTasksAnswer>;
321
+ };
263
322
  /**
264
323
  * The mini workflow engine: executes a `WorkflowDef` against a repo, one step
265
324
  * at a time, persisting every event to the RunStore (which the SSE endpoints
@@ -363,12 +422,31 @@ export declare class RunManager {
363
422
  private readonly waiting;
364
423
  /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
365
424
  private readonly monitoring;
366
- /** Separate from human waiting: these resumes MUST reacquire scheduler capacity. */
367
- private readonly ciWakeQueuedAt;
368
- private readonly ciWakeAdmitted;
425
+ /** A run whose resolved waits wait for a wake (hearsay-tools/cezarion#1233). Separate from
426
+ * human waiting: these resumes MUST reacquire scheduler capacity. Keyed by run id. */
427
+ private readonly waitWakeQueuedAt;
428
+ private readonly waitWakeAdmitted;
429
+ /** One CI watch per open CI wait, keyed by wait id. */
369
430
  private readonly ciWatches;
431
+ /** CI lookups in flight, keyed by run id and normalized PR URL: two PRs may register at once. */
370
432
  private readonly ciRegistrations;
433
+ /** A resolution whose checkpoint failed, retried by wait id. */
371
434
  private readonly ciRetries;
435
+ /** Process waits' watches (hearsay-tools/cezarion#1446), by wait id. */
436
+ private readonly processWatches;
437
+ private readonly processSupervisor;
438
+ /** Worker waits whose resolution write failed and is being retried: the warning is said once. */
439
+ private readonly workerResolveRetries;
440
+ /** A wake that could not be admitted yet, retried by run id. */
441
+ private readonly wakeRetries;
442
+ /** The last "retained; continuation unavailable" note per run: the 1 Hz admission retry writes
443
+ * it on the transition into refusal or when the reason changes, never once per retry. */
444
+ private readonly retainedNotes;
445
+ /** The wait before the next automatic delivery attempt after a failed one, by run id. */
446
+ private readonly wakeBackoffs;
447
+ private wakeRetryBackoff;
448
+ /** One timer per open timer wait, keyed by wait id. */
449
+ private readonly waitTimers;
372
450
  private readonly ciResources;
373
451
  /** #781: the workspace-wide preview host. Absent (`cez run`, tests) means every registration is `headless`. */
374
452
  private readonly preview?;
@@ -377,10 +455,9 @@ export declare class RunManager {
377
455
  /** #781: cezar's own listening port, which no dev server may register. */
378
456
  private readonly cezarPort?;
379
457
  private ciSupervisor;
380
- private readonly workerWaiting;
381
- private readonly workerWakeAdmitted;
382
- private readonly workerWakeQueuedAt;
383
- private readonly workerWaitTimers;
458
+ /** Each family's conversation request deadlines. Every worker wait, Cezar's completion wait
459
+ * included, parks, wakes and times out through the wait list (hearsay-tools/cezarion#1301). */
460
+ private readonly requestDeadlineTimers;
384
461
  private readonly inboxClaimTimers;
385
462
  private reconcilingWorkers;
386
463
  private reconcilingFamily;
@@ -390,12 +467,13 @@ export declare class RunManager {
390
467
  private recoveryScope;
391
468
  /** Settles when the recovery in progress (if any) has finished. */
392
469
  private recoveryInFlight;
470
+ private recoveryFactsPending;
393
471
  /** Adoptions of dead processes' runs, one at a time (`adoptOrphanedRun`). */
394
472
  private adoptionTail;
395
473
  /** Quiet window before unread input is resubmitted or left unconfirmed (#505). */
396
474
  private readonly unreadInputGraceMs;
397
475
  /** Quiet window after a final-message nudge before a still-silent session parks (#544). */
398
- private readonly finalMessageNudgeReplyMs;
476
+ private readonly noWaitNudgeReplyMs;
399
477
  private disposed;
400
478
  /** Whether any recovery is in progress: one at a time (`recover`), and `pump` waits for it. */
401
479
  private get recovering();
@@ -412,6 +490,9 @@ export declare class RunManager {
412
490
  * explicit user Continue, these are bulk scheduler work and must re-enter
413
491
  * through `pump()` so both workspace and per-project caps are honored. */
414
492
  private readonly pendingContinuations;
493
+ /** The configured default runner as `pump()` last read it, so the sync `oldestWakeAt()` resolves
494
+ * a runnerless record's account the same way (hearsay-tools/cezarion#1236). */
495
+ private configuredDefaultRunner;
415
496
  /** Accepted Continues supersede in-flight settlement even before launch or after
416
497
  * idle close. Retain these across dropActive/dispose so absence cannot look like
417
498
  * the earlier execution again; disposal alone never revokes terminal intent. */
@@ -444,7 +525,7 @@ export declare class RunManager {
444
525
  * (#438). `CEZ_DISABLE_REPO_LOCK=1` deliberately bypasses this safety lease.
445
526
  */
446
527
  private repoRootTail;
447
- /** `.ai/cezar` — where the per-task handoff files and todos.json live. */
528
+ /** `.ai/cezar` — where the per-task handoff files live. */
448
529
  private readonly dataDir;
449
530
  /** Runs currently being paused by the memory guard — dedupes the ~2 s samples so one breach
450
531
  * triggers one pause, not a burst. Cleared in dropActive when the run leaves the registry. */
@@ -469,9 +550,13 @@ export declare class RunManager {
469
550
  constructor(store: RunStore, repoRoot: string, options?: {
470
551
  semaphore?: WorkspaceSemaphore;
471
552
  unreadInputGraceMs?: number;
472
- finalMessageNudgeReplyMs?: number;
473
- preview?: PreviewHostLike;
474
- cezarPort?: () => number | undefined;
553
+ noWaitNudgeReplyMs?: number;
554
+ preview?: PreviewHostLike | undefined;
555
+ cezarPort?: (() => number | undefined) | undefined;
556
+ cockpit?: {
557
+ origin: string;
558
+ projectId: string;
559
+ } | undefined;
475
560
  });
476
561
  /**
477
562
  * Release everything this manager owns without touching run records
@@ -492,15 +577,7 @@ export declare class RunManager {
492
577
  * no limit is set or the sampler has no data (e.g. `ps`/PowerShell unavailable).
493
578
  */
494
579
  private enforceMemoryLimit;
495
- /** Env the spawned claude gets so the agent can find its handoff file and
496
- * the global inbox (spec 007; the inbox only when the run opted in).
497
- *
498
- * `CEZ_TODOS_FILE` is set to `''` rather than omitted when follow-ups are
499
- * off: runners spawn with `{ ...process.env, ...spec.env }`, so omitting the
500
- * key would let a value inherited from *this* process through — a nested
501
- * cezar (an agent running `cez serve`/`cez run`/the test suite) would then
502
- * write follow-ups into the parent's inbox despite the opt-out. Empty is the
503
- * established "absent" spelling — consumers guard with `if (todosFile)`.
580
+ /** Env for the rolling handoff and artifacts.
504
581
  *
505
582
  * `TMPDIR`/`TEMP`/`TMP` (#785) point at this run's own scratch directory
506
583
  * instead of the machine-wide one every agent used to share. Created and
@@ -509,22 +586,9 @@ export declare class RunManager {
509
586
  * turning into empty command output inside a running agent. */
510
587
  private agentEnv;
511
588
  /**
512
- * `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
513
- * 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
514
- *
515
- * Resolved per step, not per run, because a workflow can mix backends: an override naming a
516
- * Claude account says nothing about which Codex account a codex step should use. Resolution
517
- * order, most specific first:
518
- *
519
- * 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
520
- * account that created the session, whatever the project has since been switched to;
521
- * 2. the run's composer override, but only for steps on the run's own runner;
522
- * 3. the project's stored selection, and failing that the discovered default.
523
- *
524
- * Read fresh every time. `~/.cezar/config.json` is shared by every cezar process on this
525
- * machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
526
- * spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
527
- * exactly the behaviour that predates profiles.
589
+ * Resolve this step’s account environment from agent-accounts.json and record its id. Ordinary
590
+ * steps prefer the recorded account, then a matching run override, then project selection and
591
+ * default. Keep account and session ids paired; owned workers use pinned identity.
528
592
  */
529
593
  /**
530
594
  * Ordinary runs retain mutable discovery; owned runs require explicit durable evidence. With a
@@ -549,24 +613,358 @@ export declare class RunManager {
549
613
  */
550
614
  private continuationDefStep;
551
615
  private agentEnvForStep;
616
+ /**
617
+ * The cockpit serving this manager's project, set by `startServer` once it listens (#774).
618
+ * Every agent env then carries it as `CEZ_COCKPIT_URL`/`CEZ_PROJECT_ID`, which is how
619
+ * `cez automation` reaches the cockpit without probing ports. A headless `cez run` never
620
+ * sets it, so it is also the "a cockpit is attached" signal for the automations gate.
621
+ */
622
+ private cockpit?;
623
+ setCockpitAddress(address: {
624
+ origin: string;
625
+ projectId: string;
626
+ } | undefined): void;
627
+ cockpitAddress(): {
628
+ origin: string;
629
+ projectId: string;
630
+ } | undefined;
631
+ /**
632
+ * hearsay-tools/cezarion#1465: the project's one-time schedule service behind
633
+ * `cezar_schedule_task` and `cezar_scheduled_tasks`, set by `startServer` beside the cockpit
634
+ * address. Headless `cez run` never sets it, so the tools answer `unavailable` there. The
635
+ * boot manager recovers runs before the server sets it, and a lazy project's manager recovers
636
+ * before its context is announced: a resumed session can call a tool in that window. With a
637
+ * cockpit address the call waits for the service, bounded like the CLI's startup retry.
638
+ */
639
+ private automationTools?;
640
+ private automationToolsWaiters;
641
+ setAutomationTools(tools: AutomationToolService | undefined): void;
642
+ private awaitAutomationTools;
643
+ /** Automations on AND a cockpit attached: the one predicate behind the prompt part and the built-in skill. */
644
+ private automationsReachable;
645
+ /** The built-in skills this manager may offer now; empty unless automations are reachable. */
646
+ builtinSkills(): Skill[];
647
+ /** The automations part of every session's system prompt, or nothing. */
648
+ private automationsPart;
649
+ /** The "Project webhooks" part (#1576): the webhooks this project exposes to agents, read from
650
+ * the registry when a session starts. Needs a cockpit to send through; nothing exposed, or an
651
+ * unreadable registry, adds nothing. */
652
+ private agentWebhooksPart;
653
+ /**
654
+ * One launch's session-start context (hearsay-tools/cezarion#1584): the run's own handoff,
655
+ * then the project's `context.yaml` rules for this recipient, read now and rendered once.
656
+ * Every launch reports its outcome as one lifecycle line. Both launch sites — a fresh step
657
+ * and `runContinuation` — come here; a live message never does. The prefix goes into the
658
+ * opening message only, never the system prompt a worker inherits (#778).
659
+ */
660
+ private sessionContextFor;
661
+ /** Every skill lookup in this manager goes through here, so the built-ins reach all of them. */
662
+ private discoverSkills;
663
+ /**
664
+ * Load the run's skill registry: the ONLY writer of `state.skills` (hearsay-tools/cezarion#1806).
665
+ * `execute` and `runContinuation` both call it, once the run is registered and after the awaits
666
+ * that precede its first prompt. `'throw'` lets a failed discovery fail the run, as a fresh run
667
+ * always did; `'ignore'` keeps the registry the run already has, or none, because discovery must
668
+ * never break a Continue (open-mercato/cezar#811). An empty registry expands no `/skill` (it is not an error).
669
+ */
670
+ private loadRunSkills;
671
+ /**
672
+ * The run's skill registry minus the project's off-list as it is now (#1494): the ONLY reader of
673
+ * `state.skills`. The registry is discovered when the run starts or continues, so a team skill
674
+ * switched off since then is still in `state.skills`; every prompt a step, a Continue or a live
675
+ * `/name` builds reads this instead. A caller that already read the off-list passes it as
676
+ * `disabled`, so that both see one list.
677
+ */
678
+ private enabledSkills;
679
+ /**
680
+ * A live `/name` message already carries the skill's body, and `sendMessage` answers
681
+ * synchronously, so its files and companions install after the message went out (#1408).
682
+ * When anything new landed, or a team skill's files went to a cache copy the message could not
683
+ * name, one durable agent input says what and where. Whether a runner's native lookup sees a skill
684
+ * added mid-session is not relied on: that input is the delivery for every runner. Nothing
685
+ * new: no input. A run that stopped, or moved to another session, gets none.
686
+ */
687
+ private provisionLiveSlashSkill;
688
+ /**
689
+ * Provision the step skill and leading registry slash skill for start, Continue, recovery and
690
+ * live input, and at a step's start every registry skill its prompt names as a typed `/name`
691
+ * (#1672). Native slashes that are not registry skills install nothing.
692
+ *
693
+ * The run's OWN task worktree gets every root and the companions their bodies name
694
+ * (`provisionSkills`): links to local and global skills, generated `SKILL.md` files, and marked
695
+ * team copies, in `.claude/skills`, `.agents/skills` and `.cursor/skills`, recorded in the
696
+ * worktree's git dir and kept out of git by a worktree-local `.gitignore`. The project's
697
+ * off-list (`disabledTeamSkills`) is read fresh on every pass and applied to the saved
698
+ * registry, the roots and the team list alike: a team skill switched off for the project is
699
+ * never installed, not even for a skill that runs it, and a switch-off made after the run
700
+ * started holds for the next step, a live `/name` and Continue. Copies a pass installed before
701
+ * the switch stay in the worktree until the task ends: cezar removes nothing mid-task.
702
+ *
703
+ * Any other cwd — worktree off, a non-git project, a Continue whose worktree is gone — is the
704
+ * main checkout or unknown, where those directories are LOCAL skills to `discoverSkills` that
705
+ * would shadow the team source for every later run. A selected or leading-slash directory team
706
+ * root gets a per-commit cache copy there instead, and nothing else is installed: a skill only
707
+ * the prompt names gets nothing there, like a companion. So does a worktree where no copy of
708
+ * it landed, such as one whose three agent dirs all link out of it; one that took only some
709
+ * copies names the first that landed, since the runner's own dir may be the one skipped.
710
+ * Returns the step-start notes and, per team root, the directory its prompt must name.
711
+ */
712
+ private provisionRunSkills;
713
+ /** `cwd` is the run's recorded task worktree, and not the project root. Unresolvable means no. */
714
+ private isOwnTaskWorktree;
552
715
  private delegationProvisioner?;
553
716
  setDelegationProvisioner(provisioner: DelegationProvisioner): () => void;
554
717
  private provisionSession;
555
718
  /** Provision the same capability and descriptor on every start, Continue and recovered launch. */
556
719
  private provisionCiSession;
720
+ /**
721
+ * The trusted callbacks behind one session's cezar tools (hearsay-tools/cezarion#1233). Both
722
+ * answers list the waits still open; a coded refusal answers with its fixed message, never the
723
+ * thrower's text, and anything else is left to the tool server's `unavailable`.
724
+ */
725
+ cezarToolHandlers(runId: string, generation: string): CezarToolHandlers;
726
+ /** The refusals every cezar tool call shares: it must come from the run's current, open session,
727
+ * the one `state` was when the call began. */
728
+ private toolSessionRefusal;
729
+ /**
730
+ * `cezar_done` (hearsay-tools/cezarion#1234). Accepted, the run finishes at this turn's end
731
+ * through the done branch, which cancels every open wait; in a workflow step that is not the
732
+ * last, that branch completes the step and the next one starts (hearsay-tools/cezarion#1620), and
733
+ * the answer says which. Refused, the answer says what to do
734
+ * first. The gate is the completion gate, in order: the session, a root finish, the user's
735
+ * question, then for a root its workers' questions, live workers and uncollected results. The turn end re-checks it (`deferParentCompletion`).
736
+ */
737
+ acceptDone(runId: string, generation: string, request: CezarDoneRequest, signal?: AbortSignal): CezarDoneAnswer;
738
+ /**
739
+ * The root checks `cezar_done` makes after the session, root-finish and human-question ones, in
740
+ * order: its workers' questions, live workers, then uncollected settled results. One text source
741
+ * for the mid-turn answer and the turn end's refusal nudge (hearsay-tools/cezarion#1301).
742
+ * `liveWorkerIds` names the live workers that block it, empty when questions block it first.
743
+ */
744
+ private completionRefusal;
745
+ /** The `cezar_done` this session accepted since its last turn end, taken by this turn end: a
746
+ * later turn must call it again, as it must repeat the done line. */
747
+ private takeDoneRequest;
748
+ /** The boundary a turn end closes on when it is DONE, and what declared it. */
749
+ private recordDoneAtBoundary;
750
+ /** Goal achieved (agent contract, #347): the summary `cezar_done` gave as a note, the closing
751
+ * event naming what declared it, every open wait cancelled (DONE ranks above every wait), and
752
+ * the session closes instead of parking, so the run completes and frees its slot. */
753
+ private closeAsDone;
557
754
  stopPreviewServer(runId: string, request: PreviewStopRequest, signal?: AbortSignal): Promise<PreviewStopResult>;
558
755
  /**
559
756
  * #781: record a dev server the agent registered. One probe at registration becomes
560
757
  * `answeredAtRegistration`; the run is re-validated after it, since the probe awaits.
561
758
  */
562
759
  registerPreviewServer(runId: string, request: PreviewServeRequest, signal?: AbortSignal): Promise<PreviewServeResult>;
563
- /** Trusted capability callbacks supply run identity; the model supplies only a PR and deadline. */
564
- registerCiWait(runId: string, request: CiWaitRequest, generation: string, capabilitySignal?: AbortSignal): Promise<CiWait>;
760
+ /** The checks every wait registration shares: the session that called is the run's current one,
761
+ * and no root finish blocks it. Refusals throw `{ code }`. */
762
+ private registrationGate;
763
+ /**
764
+ * `cezar_ask` (hearsay-tools/cezarion#1234): open the run's human wait with its card. A run holds
765
+ * one: a registration in the turn that opened it replaces its card and keeps its id, and one after
766
+ * the user saw it returns it unchanged. An autonomous run assumes and continues instead, until
767
+ * its automatic wakes are spent.
768
+ */
769
+ registerAsk(runId: string, request: CezarAskRequest, generation: string, capabilitySignal?: AbortSignal): Promise<HumanWaitEntry>;
770
+ /**
771
+ * Open a CI or timer wait (hearsay-tools/cezarion#1233). Trusted capability callbacks supply run
772
+ * identity; the model supplies only the PR and deadline, or the seconds and note. Refusals throw
773
+ * `{ code }`. An identical registration (same PR; or same seconds and note in the same turn)
774
+ * returns the open wait it repeats.
775
+ */
776
+ registerWait(runId: string, request: CezarWaitRequestInput, via: WaitVia, generation: string, capabilitySignal?: AbortSignal): Promise<PrWaitEntry | TimerWaitEntry | WorkerWaitEntry | ProcessWaitEntry>;
777
+ /**
778
+ * A process wait (hearsay-tools/cezarion#1446, spec § Process wait decisions). Cezar refuses only
779
+ * what it cannot watch to an end: another user's PID, its own, and an agent session's leader;
780
+ * the agent's shell can already observe any process of its own, so there is no ownership proof.
781
+ * A PID already gone is no error: the command was fast, and the wait resolves at once from its
782
+ * exit file, or as exited.
783
+ */
784
+ private registerProcessWait;
785
+ /** Where a process wait's exit file may sit: the run's worktree (the checkout for a run without
786
+ * one) and, unless turned off, the Cezar temp directory its agent gets as `TMPDIR`. */
787
+ private exitFileRoots;
788
+ /** Commit, arm and (at a boundary) park on a newly registered wait. */
789
+ private openWait;
790
+ /**
791
+ * The agent's `cezar_cancel_wait`. An open wait is cancelled with its watch or timer, and no
792
+ * result for it is ever delivered. A resolved wait is already owed: cancelling it is a no-op and
793
+ * its result arrives with the next wake. A settled or unknown id is `not_found`. A human wait the
794
+ * user already sees is theirs to answer (`human_question`); one from this turn can be withdrawn.
795
+ */
796
+ cancelWait(runId: string, waitId: string, generation: string): {
797
+ cancelled: true;
798
+ } | {
799
+ cancelled: false;
800
+ code: 'not_found' | 'already_resolved' | 'human_question';
801
+ };
802
+ /** Start what resolves an open wait: its CI watch, or its timer from the stored deadline. An
803
+ * overdue timer (restart) resolves at once. */
804
+ private armWait;
805
+ /**
806
+ * A worker wait's deadline re-observes its family (hearsay-tools/cezarion#1235): the reconcile
807
+ * resolves it with `timeout`, keeping any outcome observed by then. A failed checkpoint is
808
+ * retried every second while the wait is still open, never dropped as an uncaught error. An
809
+ * outcome whose resolution failed to commit arms the same retry with `firstDelay` 1 second.
810
+ */
811
+ private armWorkerDeadline;
812
+ /** Stop everything that could still resolve this wait. */
813
+ private disarmWait;
814
+ /**
815
+ * Watch a process wait's command (hearsay-tools/cezarion#1446). Like a timer, its wake is the
816
+ * agent's own arrangement: a stopping, stopped or finishing run takes none, and the wait stays
817
+ * open for that transition to cancel.
818
+ */
819
+ private startProcessWatch;
565
820
  private startCiWatch;
566
- private retryCiAdmission;
567
- private parkCiWait;
568
- private queueCiWake;
569
- private withdrawCiWait;
821
+ /** `resolveWait`, retried while its durable checkpoint is unavailable: a failed write may not
822
+ * drop the accepted intent or publish a false result. */
823
+ private settleWait;
824
+ /** Commit an open wait as resolved together with its lifecycle input (id = wait id, or an
825
+ * upgraded worker wait's `wakeInputId`), then queue the run's wake. A worker wait passes the
826
+ * entry as reconciled, with its outcomes and `result`. Throws when the checkpoint fails; a wait
827
+ * no longer open is ignored. */
828
+ private resolveWait;
829
+ /** A worker's current status, as a worker wait's result names it. */
830
+ private readonly workerStatus;
831
+ /** A timer or process wait due, or still owed, once the automatic-wake budget is spent wakes
832
+ * nothing: it is cancelled with the cap note, and the run keeps whatever else it waits on
833
+ * (hearsay-tools/cezarion#1233, hearsay-tools/cezarion#1446). */
834
+ private cancelAutomaticAtCap;
835
+ /** A parked run whose last wait was cancelled at the budget without a wake waits on the user: a
836
+ * `budget` human wait opens and is shown (hearsay-tools/cezarion#1234), and the run leaves the
837
+ * monitoring pool and its slot, as `parkForUser` does. A turn in progress is left to its own
838
+ * turn end. */
839
+ private reparkWithoutWaits;
840
+ /** The same for a parked run with no live session, as when recovery fires an overdue timer
841
+ * before any session exists: once no wait is left, the `budget` human wait opens and is shown,
842
+ * and the user's Continue answers it. */
843
+ private waitOnUserWithoutSession;
844
+ /**
845
+ * A session failed, or closed cleanly, while the run still owed wait results
846
+ * (hearsay-tools/cezarion#1233). Count the failed delivery and decide what the closing path does:
847
+ * `park` keeps the run waiting and retries after the backoff (or, with nothing resolved, leaves
848
+ * its open waits to wake it); `settle` fails the run the ordinary way, which a usage limit takes
849
+ * into its own hold and resume without being counted; `capped` fails it at
850
+ * `MAX_WAKE_DELIVERY_ATTEMPTS`. Every settled run keeps its results.
851
+ */
852
+ private failedWakeDelivery;
853
+ /** The closing session leaves something undelivered: a resolved wait, or a wake of messages
854
+ * alone (`owesWake`), which reopens the run as a resolved wait does and so counts against the
855
+ * same bound (hearsay-tools/cezarion#1235). */
856
+ private owesDelivery;
857
+ /** A delivery, a human or a terminal path ends a run of failed deliveries and its backoff. */
858
+ private resetWakeDelivery;
859
+ private clearWakeBackoff;
860
+ /** Saves an accepted continuation. A human Continue also answers every human wait, ends failed
861
+ * deliveries and restarts the budget, in the same best-effort commit. */
862
+ private commitContinuation;
863
+ /** An acknowledged wake turn runs: a retry stops unless a wake is still `owed`. Pool membership
864
+ * changes only at a turn end or a terminal path; a worker park's idle timer belongs to the park,
865
+ * not to the wake turn. */
866
+ private spendWakeAdmission;
867
+ /** `outcomes`, clearing the failure count when they deliver a wait result (`cleared`) or leave one
868
+ * of `ids` a message the agent received (hearsay-tools/cezarion#1235). The opening prompt of a wake
869
+ * continuation is not one: a session that reads it and fails has delivered nothing it owed, nor
870
+ * has a read reported for a message whose submission was never acknowledged. */
871
+ private withFailuresCleared;
872
+ /** A lifecycle input no wait names is a wake of its own, a queued refusal among them
873
+ * (hearsay-tools/cezarion#1301): `owesDelivery` counts it as owed, so its delivery ends the run
874
+ * of failed deliveries, as a message's does. */
875
+ private isUnnamedLifecycleInput;
876
+ /** The failure count is on the run record, so a restart keeps it (hearsay-tools/cezarion#1234). */
877
+ private clearWakeDeliveryFailures;
878
+ /**
879
+ * Automatic wakes spent since the user last wrote: timer wakes and autonomous nudges, against
880
+ * one budget of `MAX_AUTO_CONTINUES` (hearsay-tools/cezarion#1234). The count is on the run
881
+ * record, so a restart, a scheduler continuation and a usage-limit resume keep it. A timer batch
882
+ * still awaiting its acknowledgement counts the unit it reserved.
883
+ */
884
+ private automaticWakes;
885
+ /** Spend one automatic wake on the record; returns the count after it. */
886
+ private chargeAutomaticWake;
887
+ /** A human message or a human Continue restarts the budget. */
888
+ private resetAutomaticWakes;
889
+ private retryWaitAdmission;
890
+ /**
891
+ * Park a session on its waits (hearsay-tools/cezarion#1233): `waiting`. A CI or
892
+ * timer park keeps its slot in the monitoring pool, so its wake starts at once, and needs no idle
893
+ * timer; a resolved wait with nothing left open is a wake due now and keeps it too. Worker waits
894
+ * rank above CI and timers (hearsay-tools/cezarion#1235): a park on them holds no slot and arms
895
+ * the idle timer, so the session closes after `IDLE_TIMEOUT_MS` and the run stays `waiting` for
896
+ * the next resolution or message to reopen it. Its intent reaches disk before the slot is freed.
897
+ * An open human wait is shown and parks for the user, with no slot (hearsay-tools/cezarion#1234).
898
+ */
899
+ private parkOnWaits;
900
+ /** Parked on the wait list with `workers` as its top wait (hearsay-tools/cezarion#1235): the park
901
+ * holds no slot, so runner activity resumes it as it resumes a monitoring park. */
902
+ private parkedOnWorkers;
903
+ /** Leave the monitoring pool. Only a turn end or a terminal path does; a member's slot
904
+ * goes back to the workspace. */
905
+ private leaveMonitoringPool;
906
+ /**
907
+ * Queue one wake for every resolved wait of a run and every message it has not received
908
+ * (`owesWake`). A live session takes it only at a turn boundary: a turn in progress, a native
909
+ * question included, picks it up at its own turn end. A monitoring-pool member already holds its
910
+ * slot and is admitted at once; any other live session waits for scheduler admission; a run with
911
+ * no session reopens through a scheduler-owned continuation. A pending question does not hold the
912
+ * wake back: the wake turn delivers the results and the messages beside it, and the question
913
+ * stays answerable (hearsay-tools/cezarion#1235).
914
+ */
915
+ private queueWaitWake;
916
+ /** Reject only the same durable and manager-level holds before restoring wake inputs. */
917
+ private canQueueWaitWake;
918
+ private queueSessionlessWaitWake;
919
+ /** Is this run's account on a usage-limit hold that keeps its wake in the line? */
920
+ private wakeHeld;
921
+ /** The run with the account its next turn runs on (`executionAccount`): a live session's step
922
+ * settings, a queued continuation's account, else its latest session step. Both sides of a hold
923
+ * read it, so a mixed-runner step is held by the account it ran on (hearsay-tools/cezarion#1236). */
924
+ private withExecutionAccount;
925
+ /** A monitoring-pool member's wake waiting in the line: it already holds its slot, so it needs
926
+ * no regular one to leave (hearsay-tools/cezarion#1236). */
927
+ private poolWakeQueued;
928
+ /** A worker wait the store upgraded from the old engine as already settled may have had no wake input
929
+ * queued yet (hearsay-tools/cezarion#1235): the old engine wrote it on its next pass, so its
930
+ * result is written here, once, before the wake that delivers it. A full inbox waits. */
931
+ private restoreWorkerWaitInputs;
932
+ /**
933
+ * Messages are not waits (hearsay-tools/cezarion#1235): every conversation input the run has not
934
+ * received is an owed wake in its own right, beside its waits and beside a pending question. Not
935
+ * one claimed by an inbox read, one a provider flight or opening already carries, one a resolved
936
+ * wait carries as its wake, or the parent's answer to a routed question, which goes through the
937
+ * answer seam (`answerRoutedQuestion`). A lifecycle input no wait carries any more counts as one:
938
+ * the wake a legacy cancelled worker wait queued before the upgrade, which the wait list keeps as
939
+ * a cancelled entry and delivers as ordinary input, and a refusal queued for a closed session
940
+ * (hearsay-tools/cezarion#1301). One a listed wait or a delivered one names is that wait's, never
941
+ * owed again.
942
+ */
943
+ private pendingConversationWakes;
944
+ /** The parent's reply that answers a worker's pending routed question, still undelivered. */
945
+ private routedAnswer;
946
+ /** A wake is owed: a resolved wait, a message, or a parent's answer the run has not received. */
947
+ private owesWake;
948
+ /** A live session takes a wake at its turn boundary. A native question is mid-turn and takes one
949
+ * input there: the parent's answer to it, through the answer seam (#505). */
950
+ private takesWake;
951
+ /** An admitted wake goes to the agent: a parent's answer through the answer seam, everything
952
+ * else as one submission. */
953
+ private deliverAdmittedWake;
954
+ /** An admitted or queued wake whose messages an inbox read took has nothing left to deliver: the
955
+ * run goes back to its park and gives up the slot the admission reserved. */
956
+ private retireEmptyWake;
957
+ /**
958
+ * Cancel every open or resolved wait of a run without waking the agent: stop, Finish, cancel,
959
+ * deletion, DONE and any terminal status. Human input cancels none (hearsay-tools/cezarion#1233).
960
+ * A failed commit leaves the record as a crash would and never stops the disarm, so Stop still
961
+ * reaches the session when the store is closed or broken (hearsay-tools/cezarion#1234).
962
+ */
963
+ private cancelOpenWaits;
964
+ /** Stop every watch, timer, retry and queued wake a run's waits hold in memory. */
965
+ private disarmRunWaits;
966
+ /** A deleted run's row is gone with its waits; only what they armed in memory is left. */
967
+ private readonly onRunDeleted;
570
968
  /** Snapshot of the actual active session, never guessed from partial run settings. */
571
969
  delegationExecutionSettings(runId: string): DelegationExecutionSettings;
572
970
  /**
@@ -578,9 +976,9 @@ export declare class RunManager {
578
976
  * running on another login is a billing boundary crossed without anyone choosing it.
579
977
  */
580
978
  selectDelegationExecutionSettings(runId: string, selection: {
581
- backend?: RunnerId;
582
- model?: string;
583
- effort?: string;
979
+ backend?: RunnerId | undefined;
980
+ model?: string | undefined;
981
+ effort?: string | undefined;
584
982
  agentProfile?: string;
585
983
  }, validateModel?: (settings: DelegationExecutionSettings) => Promise<void>): Promise<DelegationExecutionSettings>;
586
984
  /**
@@ -597,10 +995,7 @@ export declare class RunManager {
597
995
  } | {
598
996
  conflict: true;
599
997
  };
600
- startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
601
- groupId: string;
602
- variant: string;
603
- }, clientRequest?: {
998
+ startRun(workflow: WorkflowDef, input: StartRunInput, clientRequest?: {
604
999
  id: string;
605
1000
  hash: string;
606
1001
  }): RunRecord;
@@ -614,14 +1009,6 @@ export declare class RunManager {
614
1009
  * definition refuses execution instead of quietly running quick-task or the edit.
615
1010
  */
616
1011
  private ownedWorkflow;
617
- /**
618
- * Parallel variants (spec 010): N runs of the same workflow on the same
619
- * task, sharing a groupId. Variant A gets the task verbatim; B and C get a
620
- * fixed one-line approach hint appended to the *task input* (not the step
621
- * template), so diversification works with any workflow. The normal queue
622
- * applies — with maxParallel=2 a third variant simply waits.
623
- */
624
- startVariants(workflow: WorkflowDef, input: StartRunInput, count: number): RunRecord[];
625
1012
  /**
626
1013
  * Slots this manager holds against the workspace-wide cap. `waiting` runs
627
1014
  * don't hold a slot (#347): an idle claude process costs memory but no
@@ -637,6 +1024,19 @@ export declare class RunManager {
637
1024
  * `queue` is FIFO — `startRun` pushes and `recover()` re-queues by
638
1025
  * `createdAt` — so the head is the oldest. */
639
1026
  private oldestQueuedAt;
1027
+ /** When a queued entry joined the line as a wake of a run already in progress, or undefined for
1028
+ * a run that has not started (hearsay-tools/cezarion#1236, `nextLineEntry`). */
1029
+ private wakeJoinedAt;
1030
+ /** The oldest wake in this manager's line that an account hold does not keep there, or null:
1031
+ * the semaphore gives a freed slot to the project holding the oldest such wake before any
1032
+ * project's unstarted runs. A held wake is left out, or its project would take the slot and
1033
+ * start a new task ahead of another project's started run (hearsay-tools/cezarion#1236). */
1034
+ private oldestWakeAt;
1035
+ /** Can this queued entry leave the line now, capacity aside? No worktree cleanup, no
1036
+ * autosave cleanup, no pending root finish, no account hold, and not already admitted
1037
+ * elsewhere. `pump()` and `oldestWakeAt()` share it, so the workspace order and the project
1038
+ * order agree (hearsay-tools/cezarion#1236). */
1039
+ private canLeaveLine;
640
1040
  /**
641
1041
  * A slot this manager held just came free. Pump the whole WORKSPACE, not
642
1042
  * just this manager: `maxParallel` is counted across every project, so the
@@ -657,22 +1057,23 @@ export declare class RunManager {
657
1057
  * root (spec 006 degradation rule), which is always the tighter bound.
658
1058
  */
659
1059
  private pump;
1060
+ /** Checkpoint before dequeue, while worker cancellation can still find the queued entry. */
1061
+ private checkpointQueuedWorker;
1062
+ /** A lost runner boundary requeues the wake and ends this pass instead of spinning. */
1063
+ private admitQueuedWaitWake;
1064
+ /** Read and hydrate mutable queued input in the same synchronous tick as dequeue. */
1065
+ private launchQueuedRun;
1066
+ /** Save restart evidence before queue admission or the next startup await. */
1067
+ private checkpointRestartContext;
660
1068
  /**
661
- * Make one `queued` RECORD executable again — the engine half a queued run needs but does not
662
- * persist (`pendingJobs` / `pendingContinuations` are process-local, the record is not).
663
- *
664
- * Two callers, one path: boot recovery re-adopts everything the previous process was holding,
665
- * and the queue watchdog re-adopts anything the running process has somehow lost. A queued
666
- * record with no work item behind it is invisible to `pump()` and would sit there for good,
667
- * which is the worst failure this engine has — the task is neither running nor failed, just
668
- * silently never going to happen.
669
- *
670
- * A continuation is reconstructed first: its executable details are gone, but the pending
671
- * `continue-N` step and the session before it are durable, which is enough. Otherwise the
672
- * workflow is revived from the record. A run that can be neither is failed loudly rather than
673
- * left in the queue as a ghost.
1069
+ * Rebuild executable state for a durable queued record. Shared by recovery and the watchdog;
1070
+ * reconstruct jobs or continuations before pumping.
674
1071
  */
675
1072
  private reviveQueuedRun;
1073
+ private reviveQueuedContinuation;
1074
+ /** Match the pinned execution account before considering a persisted session resumable. */
1075
+ private queuedResumeSession;
1076
+ private reviveQueuedWorker;
676
1077
  /**
677
1078
  * Startup recovery (#367) — re-adopt runs that were live when the previous
678
1079
  * cezar process exited (requires the store opened with `keepLive`):
@@ -690,17 +1091,48 @@ export declare class RunManager {
690
1091
  * worker or root skip their families (#779, plan step 3).
691
1092
  */
692
1093
  recover(familyRootId?: string): Promise<void>;
1094
+ /** The workers in scope whose generation a dead controller left `starting`, and the members of
1095
+ * their families, whose transcript facts recovery prepares before it settles them. */
1096
+ private collectOrphanWorkerGenerations;
1097
+ /** Recovery's first pass over the live set: the input state a dead controller left behind. */
1098
+ private recoverUnreadInputs;
1099
+ /** Settles each orphaned `starting` generation, or re-probes it when its proof does not settle. */
1100
+ private settleOrphanWorkerGenerations;
1101
+ /** Restart sweeps every worker's scratch; an adopted family schedules only its own members. */
1102
+ private recoverWorkerScratch;
693
1103
  /**
694
- * Take over a run whose owning process is gone (#779, plan step 3): a control (Stop, Continue,
695
- * archive…) reached a run `runOwnership` calls `orphaned`. Its family is claimed, its live runs
696
- * are settled rather than resumed (`settleOrphanedRun`: interrupted, or cancelled before they
697
- * began), and the family is recovered as a restart would, which repairs it but finds nothing live
698
- * to resume. The control that follows then acts on a run this process now owns — rather than on
699
- * a record nobody owns, a dead end until a restart — and only Continue starts agent work, with
700
- * the user's own input. With `stop` the control is Stop, which the adoption carries out itself:
701
- * `runId` ends cancelled, as an accepted Stop reads, rather than interrupted. False when a live
702
- * process holds it after all (or it is gone): the control is refused as another process's.
703
- * Adoptions run one at a time, after any recovery already in progress.
1104
+ * One live run of the restart loop. Returns the promise the loop must await (a root finish, a
1105
+ * re-queue or a settlement), else `undefined`.
1106
+ */
1107
+ private recoverLiveRun;
1108
+ /** True when a worker's root takes no more work from it: a closed root cancels the worker, and a
1109
+ * root in review or finishing leaves it as it is. */
1110
+ private recoveryLeavesWorkerToRoot;
1111
+ /** The run as recovery reads it after it reconciles the run's question state. */
1112
+ private reconcileRecoveredAsk;
1113
+ /** True when the recovered run stays parked: on a human wait, a pending question or its waits. */
1114
+ private parkRecoveredRun;
1115
+ /** Parks a recovered run: `waiting`, with each of its open waits re-armed. */
1116
+ private parkOnOpenWaits;
1117
+ /**
1118
+ * A `waiting` run that did not park. Returns the settlement the loop must await, else
1119
+ * `undefined`.
1120
+ */
1121
+ private recoverClosedWaitingRun;
1122
+ /** A recovered run whose structured question cannot be answered fails with its open steps. */
1123
+ private failRecoveredInvalidAsk;
1124
+ /** A `running` run whose process died mid-turn. */
1125
+ private recoverInterruptedRun;
1126
+ /** True when the interrupted run has no session to continue and goes back to the queue. */
1127
+ private requeueInterruptedRun;
1128
+ /** Delivers the parent replies routed to each worker in scope. */
1129
+ private answerRecoveredRoutedQuestions;
1130
+ /** Re-arms each live run's waits, or queues the wake it owes. */
1131
+ private rearmRecoveredWakes;
1132
+ /**
1133
+ * Adopt a dead owner’s family for a control, then recover the settled family without resuming
1134
+ * work. Stop cancels its target; only Continue starts work. Serialize adoptions after recovery.
1135
+ * False means missing or live-owned.
704
1136
  */
705
1137
  adoptOrphanedRun(runId: string, opts?: {
706
1138
  stop?: boolean;
@@ -711,13 +1143,18 @@ export declare class RunManager {
711
1143
  /** Shutdown is not completion. Explicit terminal controls retain their precedence. */
712
1144
  private preserveRunAfterDisposal;
713
1145
  /**
714
- * Register an executing run: the ONE way an `ActiveRun` enters `active`. Both construction
715
- * sites (`execute` and `runContinuation`, which serves Continue and restart recovery) call it,
716
- * so the store pins every run this manager executes (#779) — its record stays the held object
717
- * every turn-end handler reads and writes until `dropActive` lets it go. A second site that set
718
- * `active` directly would execute a run the store could evict mid-turn (the #811 shape).
1146
+ * Register an executing run: the ONE way an `ActiveRun` enters `active`. Both callers of
1147
+ * `createActiveRun` (`execute` and `runContinuation`, which serves Continue and restart
1148
+ * recovery) call it, so the store pins every run this manager executes (#779) — its record stays
1149
+ * the held object every turn-end handler reads and writes until `dropActive` lets it go. A site
1150
+ * that set `active` directly would execute a run the store could evict mid-turn (the open-mercato/cezar#811 shape).
719
1151
  */
720
1152
  private activate;
1153
+ /** A detail's finish verdict reads the live registries, and a session leaves them after its
1154
+ * last write (the final autosave), so the cockpit's refetch on that write still saw "no open
1155
+ * session" and hid Accept. Publish a resting run again once it is out of them
1156
+ * (hearsay-tools/cezarion#1301). */
1157
+ private republishFinishVerdict;
721
1158
  /** Remove a run from the live registries — keeps `waiting ⊆ active`. */
722
1159
  private dropActive;
723
1160
  private readonly workerScratchCleanup;
@@ -739,7 +1176,8 @@ export declare class RunManager {
739
1176
  * transcript, because a run that stops resuming itself needs to explain why.
740
1177
  */
741
1178
  private scheduleAutoResumeIfLimited;
742
- /** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. */
1179
+ /** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. The
1180
+ * run waits for it (hearsay-tools/cezarion#1236): `waiting`, its error kept for a withdrawal. */
743
1181
  private armAutoResume;
744
1182
  /**
745
1183
  * The window has reopened. Re-check the record synchronously — hours may have passed, and the
@@ -748,17 +1186,8 @@ export declare class RunManager {
748
1186
  */
749
1187
  private fireAutoResume;
750
1188
  /**
751
- * Make the armed timers agree with the records and the current setting. Runs on every `pump()`
752
- * — which is where a settings change lands (a config PUT refreshes the shared semaphore, which
753
- * pumps every manager) — and once from `recover()`.
754
- *
755
- * It is a RECONCILE rather than a one-shot restore because the deadline is durable state and
756
- * the timer is not: a restart, a rebuilt project context, a manager disposed mid-wait, or a
757
- * refusal all leave a record promising a resume that no timer is holding. Rebuilding from the
758
- * record covers every one of those at once — the alternative is a hint counting down to a time
759
- * that has already passed, which is exactly the failure this method exists to make impossible.
760
- *
761
- * Cheap: an in-memory scan, and arming is skipped for every run already held.
1189
+ * Reconcile process-local resume timers from durable records on pump and recovery. Retire
1190
+ * appointments when disabled or invalid; do not leave a deadline with no wake source.
762
1191
  */
763
1192
  private reconcileAutoResumes;
764
1193
  /**
@@ -776,37 +1205,13 @@ export declare class RunManager {
776
1205
  */
777
1206
  private requeueWhileHeld;
778
1207
  /**
779
- * The failsafe: a queue must never be able to wedge.
780
- *
781
- * Everything else in this file makes an idle queue CORRECT under some condition — a slot cap, a
782
- * repo-root lease, and now a usage-limit hold. That is also what makes a wedged queue look
783
- * correct, and the hold has already produced one in the field: two resumes fired together, each
784
- * holding the account the other was waiting on, and the whole workspace stopped with every task
785
- * `queued`. That specific bug is fixed and tested, but "the queue stopped and nothing will ever
786
- * restart it" is too expensive a failure mode to leave resting on any single fix being right.
787
- *
788
- * The test is deliberately about JUSTIFICATION rather than about any particular bug: idling is
789
- * legitimate while work is running (here or in another project), or while a real appointment is
790
- * still ahead — a scheduled resume that will fire and pump on its own. Anything else is a
791
- * queue with work in it, nothing running anywhere, and no event coming to wake it. That gets one
792
- * forced sweep, which starts work under the ordinary caps and lets the account's real state
793
- * re-assert itself: if the window truly is shut, that task meets the limit and re-establishes an
794
- * honest hold, with a real deadline behind it this time.
795
- *
796
- * Public so a test can drive the wedge directly instead of waiting out the interval.
1208
+ * Repair queued records missing executable state. Rescue an idle queue only when no running work
1209
+ * or future appointment explains it; start through ordinary caps. Public for direct tests.
797
1210
  */
798
1211
  rescueStalledQueue(now?: number): Promise<void>;
799
1212
  /**
800
- * The accounts this project is currently holding: one key per run parked on a usage-limit
801
- * resume that has not come due yet (spec 2026-08-03-auto-resume-after-usage-limit).
802
- *
803
- * Published to the shared semaphore so the hold spans PROJECTS — one Claude account can be
804
- * driving tasks in three repos, and a limit closes it for all of them. Derived from the
805
- * records on every ask rather than tracked as state: a deadline that passes, a resume that
806
- * fires, a cancel, an archive and a delete all lift the hold with no bookkeeping.
807
- *
808
- * Deliberately excludes a deadline that has already passed — that run is about to resume, and
809
- * holding the queue for it would only stall the very work the window reopened for.
1213
+ * Derive this project’s future-deadline and in-flight account holds from records for the shared
1214
+ * semaphore. Past deadlines do not block the queue.
810
1215
  */
811
1216
  accountHolds(now?: number): AccountHolds;
812
1217
  /**
@@ -821,6 +1226,14 @@ export declare class RunManager {
821
1226
  /** Retire a pending resume — timer, deadline and counter. The counter goes too because every
822
1227
  * caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
823
1228
  private clearAutoResume;
1229
+ /**
1230
+ * Withdraw a pending resume without continuing the run: a per-task cancel, the setting switched
1231
+ * off, a missed window, the cap, or a resume that could not start. A run on hold settles
1232
+ * `failed` with the error it kept, the state it was in before it waited (owner,
1233
+ * 2026-10-21). Its waits stay as a failed run's do: open ones armed, resolved ones owed to the
1234
+ * next Continue.
1235
+ */
1236
+ private withdrawAutoResume;
824
1237
  /** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
825
1238
  * `cez/<id8>` branch kept. Best-effort; a failure never affects run
826
1239
  * lifecycle. `review`/live runs are excluded by the selector. */
@@ -828,25 +1241,16 @@ export declare class RunManager {
828
1241
  /** Last live-refresh namer inputs per run — unchanged inputs skip the call. */
829
1242
  private lastNamerKey;
830
1243
  /**
831
- * Acquire the one-at-a-time lease for runs executing in `repoRoot`.
832
- *
833
- * A lease waiter is idle, so it parks in `waiting` and gives its
834
- * `maxParallel` slot back (the #347 rule): isolated worktrees keep using
835
- * every configured slot while root runs line up. The store status stays
836
- * `running` — only the queue's busy count changes, so the GUI never shows a
837
- * lease-blocked run as awaiting user input.
838
- *
839
- * The lease is held for the run's whole lifetime, including the idle
840
- * `waiting` parks between agent turns. A parked session is still live and
841
- * writes to the working tree the moment it resumes, so handing the tree to
842
- * another run there would reintroduce the concurrent-edit bug (#438) this
843
- * lease exists to prevent.
844
- *
845
- * Returns false when the run was cancelled while waiting: the lease was
846
- * never granted and the caller must not touch the working tree.
1244
+ * Acquire the exclusive repository-root lease. A waiter releases scheduling capacity but stays
1245
+ * running in the store. Hold the lease across idle turns; false means cancellation before
1246
+ * acquisition and forbids tree access.
847
1247
  */
848
1248
  private acquireRepoRoot;
849
1249
  cancel(runId: string): boolean;
1250
+ private cancelActiveRun;
1251
+ private cancelWorkerExecution;
1252
+ private cancelQueuedRun;
1253
+ private cancelRunWithoutSession;
850
1254
  isActive(runId: string): boolean;
851
1255
  /**
852
1256
  * Claim a run's worktree for a reclaim (#483, issue 08 §B4), or null when it is in use or no
@@ -878,20 +1282,9 @@ export declare class RunManager {
878
1282
  claimForPublish(runId: string): (() => void) | null;
879
1283
  claimForBranchCleanup(runIds: readonly string[]): (() => void) | null;
880
1284
  /**
881
- * Fold a queued run's persisted prompt — `run.task` plus everything stacked
882
- * onto it (#472) — into the job input that is about to execute.
883
- *
884
- * Called from `pump()` immediately before `execute()`, which makes the RECORD
885
- * the single source of truth for a queued run's prompt. Before this, the
886
- * executing copy lived in `pendingJobs` (memory) while the record held a
887
- * second one, so an edit that PATCHed the record silently did nothing until a
888
- * restart. `recover()` rebuilds through the same helper, so both paths agree.
889
- *
890
- * **Read-only, and that is load-bearing.** It composes into the in-memory
891
- * `input` and never writes the folded string back to `RunRecord.task`; the
892
- * task and its stack stay separate on disk for the life of the run. Writing
893
- * back would re-append the whole stack on every recovery and compound without
894
- * bound — asserted directly by a test.
1285
+ * Fold the persisted task and queued message stack immediately before execution. Keep durable
1286
+ * record state authoritative over pendingJobs. Read-only: never write the composite back to
1287
+ * RunRecord.task; task and stack stay separate.
895
1288
  */
896
1289
  private hydrateQueuedInput;
897
1290
  /** Apply edits and messages made while a restart continuation waits for
@@ -957,31 +1350,95 @@ export declare class RunManager {
957
1350
  * `ActiveRun` does not exist yet for part of this window.
958
1351
  */
959
1352
  deferMessage(runId: string, content: PastedContent[]): boolean;
960
- private parentCompletionPending;
961
- /** The durable attention phase records a spent completion wait. It only
962
- * becomes human attention once no owned worker remains live. */
963
- private parentCompletionAttention;
964
- private resetParentCompletion;
965
1353
  private parentCompletionBlockers;
966
1354
  /** A settled-but-uncollected result is work for the parent, not a live worker.
967
1355
  * Keep the private termination proof: a public terminal status can precede exit. */
968
1356
  private hasLiveWorkers;
1357
+ /** Live workers keep a turn end monitoring unless the agent already waits on workers: an open
1358
+ * worker entry is the wait, so no implicit re-check timer goes beside it (hearsay-tools/cezarion#1235). */
1359
+ private monitorsLiveWorkers;
969
1360
  private delegationFinishBlockedReason;
970
1361
  /** The read-only verdict and explicit Finish share this decision. Operational failures
971
1362
  * (for example a failed durable write) are still handled at execution time. */
972
1363
  private finishDecision;
973
1364
  finishBlockedReason(runId: string): string | undefined;
974
- /** One durable automatic worker wait per cycle. Further premature DONEs with
975
- * live workers use the existing capped monitoring wakes; settled uncollected
976
- * results retain attention. Human input starts a fresh completion cycle. */
1365
+ /** A root's done blocked by its workers. In a live session the agent gets the refusal
1366
+ * `cezar_done` gives, as one automatic turn (`settleTurn`, hearsay-tools/cezarion#1301), at its
1367
+ * turn boundary, else at the live turn end; a closed session gets it as a queued lifecycle wake
1368
+ * that reopens it (`queueCompletionRefusal`),
1369
+ * a legacy accepted Finish's settlement included. A pending human question keeps its park. */
977
1370
  private deferParentCompletion;
1371
+ /** The completion gate for a root's done: `accept`; a refusal a live session takes as its turn
1372
+ * end's (`settleTurn`); or `held` when the gate settled it itself: a stopped root, a refusal
1373
+ * queued for a closed session, or a pending human question that parks for the user. */
1374
+ private completionGate;
1375
+ /** The session just took a refusal nudge, live or queued (hearsay-tools/cezarion#1301): its turn is
1376
+ * the nudge's, and its reply is bounded by the no-wait nudge's reply timer, so a harness that
1377
+ * reads the refusal and says nothing parks on Cezar's human wait instead of holding the slot. */
1378
+ private awaitCompletionNudgeReply;
1379
+ /**
1380
+ * A blocked done found when the session is gone (`settleSuccess` after its async work, a
1381
+ * restart; hearsay-tools/cezarion#1301): the refusal is queued as one lifecycle input, charged as
1382
+ * the live nudge is, and the scheduler continuation reopens the session to deliver it
1383
+ * (`queueWaitWake`); its delivery marks that turn as the nudge's. Open waits come first: they wake
1384
+ * the run, and the refusal is a note. A spent budget opens Cezar's `budget` human wait, and an
1385
+ * input the full inbox refuses leaves the run waiting for the user. Always true.
1386
+ */
1387
+ private queueCompletionRefusal;
1388
+ /** Stop discards a refusal the run still owes, as it discards its waits: a later Continue must not
1389
+ * deliver a stale one (hearsay-tools/cezarion#1301). One an inbox read holds is left to it. */
1390
+ private retireCompletionRefusal;
1391
+ /** A refusal `queueCompletionRefusal` queued and the run has not received yet. */
1392
+ private owesCompletionRefusal;
1393
+ /** A closing session leaves the run something to reopen for: an agent wait, or a refusal queued
1394
+ * for it (hearsay-tools/cezarion#1301). A refusal takes a wait's bounded delivery retry, so a
1395
+ * session that keeps closing before it is submitted stops at `MAX_WAKE_DELIVERY_ATTEMPTS`
1396
+ * instead of reaching the success path, which would queue the refusal again. */
1397
+ private holdsClosingWakes;
1398
+ /** A human message or a wake (hearsay-tools/cezarion#1301): the turn it opens or steers no longer
1399
+ * answers a refusal nudge, so its blocked done gets a fresh nudge rather than the second step. */
1400
+ private startCompletionCycle;
1401
+ /** `cez worker wait`: an alias into the wait list, answered in the legacy `WorkerWait` shape
1402
+ * (hearsay-tools/cezarion#1235). */
978
1403
  registerWorkerWait(parentId: string, request: WorkerWaitRequest): WorkerWait;
1404
+ /**
1405
+ * Open a `worker` wait in the list (hearsay-tools/cezarion#1235): on workers the parent owns, or
1406
+ * on replies to requests the run sent. It stands beside CI, timer and human waits, up to
1407
+ * `WAIT_LIMIT` open ones; the same target and mode return the open wait instead. The family is
1408
+ * reconciled at once, so outcomes already in resolve it now, and its deadline is armed.
1409
+ * Refusals throw `DelegationPolicyError`: `incompatible_state`, `denied_scope` or
1410
+ * `capacity_limit`.
1411
+ */
1412
+ registerWorkerListWait(runId: string, request: {
1413
+ workerIds?: string[];
1414
+ requestIds?: string[] | undefined;
1415
+ mode?: WorkerWaitRequest['mode'];
1416
+ timeoutSeconds: number;
1417
+ }, via: 'cezar_wait' | 'cez-worker-wait'): DeadlinedWorkerWaitEntry;
1418
+ /** Scope of a wait on workers: only a parent holding `wait` may select, and only workers it owns. */
1419
+ private assertOwnedWorkerWaitScope;
1420
+ /** Scope of a wait on replies: the caller's own accepted requests, read from its family root's conversation. */
1421
+ private assertRequestWaitScope;
1422
+ /** The entry's target fields: each worker's revision at registration, or the requests with no outcome yet. */
1423
+ private workerWaitTarget;
1424
+ /** The wait as the store now holds it, open or already delivered, with its deadline. */
1425
+ private recordedWorkerWait;
1426
+ /**
1427
+ * Cezar's own worker wait for a root that ignored its refusal nudge (hearsay-tools/cezarion#1301):
1428
+ * `mode: 'all'` on the live workers that block its done, with no deadline and so no timer. The
1429
+ * family is reconciled at once, so workers already settled resolve it now; their settlement wakes
1430
+ * the parent, and their messages wake it beside the open wait.
1431
+ */
1432
+ private registerCompletionWait;
1433
+ /** The states no worker wait registers in: refusals throw `incompatible_state`. Waits stand
1434
+ * beside CI, timer and human waits and beside each other (hearsay-tools/cezarion#1235). */
979
1435
  private assertCanRegisterWorkerWait;
980
1436
  /** An answer already executing in this generation is not an unanswered question.
981
1437
  * Keep the durable checkpoint at turn-end for crash recovery, and match its exact
982
1438
  * sequence so it can never hide a newer question. */
983
1439
  private hasUnansweredHumanAsk;
984
- /** Both roles can select their own requests without acquiring worker-management authority. */
1440
+ /** Both roles can select their own requests without acquiring worker-management authority.
1441
+ * `cez worker wait --request`: an alias into the wait list (hearsay-tools/cezarion#1235). */
985
1442
  registerRequestWait(runId: string, request: RequestWaitRequest): WorkerWait;
986
1443
  /** A wait wake is only a pointer. Only provider submission/opening prompts own delivery. */
987
1444
  private providerOwnsInboxInput;
@@ -1002,6 +1459,28 @@ export declare class RunManager {
1002
1459
  * (#505). The worker still parks on its ask; only the parent's reply, or a human after
1003
1460
  * fallback, answers it. Routing is idempotent: the message ID derives from the ask seq. */
1004
1461
  private routeWorkerQuestion;
1462
+ /**
1463
+ * A worker parked before finishing while its parent waits on it tells the parent why
1464
+ * (hearsay-tools/cezarion#1327): Cezar posts a progress message from the worker, which wakes the
1465
+ * parent and closes no wait. A parked question needs none, since the question itself goes to the
1466
+ * parent. At most one notice per parent wait (`parkNoticeId`), and none when the turn that
1467
+ * parked already messaged the parent, Cezar's own notice included. The message and the parent's
1468
+ * input commit together; a crash before that commit leaves the recovery sweep to post it.
1469
+ */
1470
+ private noticeParkedWorker;
1471
+ /** A worker parked before finishing: waiting, not stopping or complete, with no pending question
1472
+ * and no queued input. */
1473
+ private parkedBeforeFinishing;
1474
+ /** The ledger and the parent's inbox keep room as `service.send` counts it, beside open
1475
+ * questions' replies. When either is full, the worker's log says so once per wait. */
1476
+ private parkNoticeAtCapacity;
1477
+ /** Recovery's pass over family members: a question (#505) or a park notice
1478
+ * (hearsay-tools/cezarion#1327) that a crash caught before or after its commit to the parent
1479
+ * still reaches it. The worker waits settle between the two, so a notice selects only a wait
1480
+ * that is still open. */
1481
+ private recoverWorkerMessages;
1482
+ /** `noticeParkedWorker` for every worker a family's root owns. */
1483
+ private noticeParkedWorkers;
1005
1484
  /** A human answering a worker question its parent handed back (#505): the reviewing parent
1006
1485
  * can no longer answer it, so it must not also block the human. */
1007
1486
  private answersFallenBackAsk;
@@ -1010,6 +1489,9 @@ export declare class RunManager {
1010
1489
  /** The parent's reply answers the routed question like a human answer would: through the
1011
1490
  * live session's native answer seam, or by reopening a session that is gone (#505). */
1012
1491
  private answerRoutedQuestion;
1492
+ private pendingRoutedAnswer;
1493
+ private reopenRoutedAnswer;
1494
+ private deliverRoutedAnswer;
1013
1495
  /** A routed question settled without a reply (its worker stopped, a deadline, fallback) can
1014
1496
  * never be answered by the parent any more: hand it to the human on the worker (#505). */
1015
1497
  private retireSettledQuestions;
@@ -1020,9 +1502,17 @@ export declare class RunManager {
1020
1502
  private fallbackRoutedQuestions;
1021
1503
  /** The parent can still read and answer a routed question; answering needs its steer grant. */
1022
1504
  private parentCanReceive;
1023
- /** Cancel only the wait; persist its settlement before ordinary wake admission. */
1505
+ /** The parent can still read a message from its worker. */
1506
+ private parentTakesMessages;
1507
+ /**
1508
+ * `cez worker cancel-wait`: cancels a worker wait in the list, as `cezar_cancel_wait` does, and
1509
+ * answers the legacy `WorkerWait` shape (hearsay-tools/cezarion#1235). A cancelled wait wakes
1510
+ * nothing. A resolved wait is owed: it is returned as its `wake-pending` receipt and arrives with
1511
+ * the next wake. A settled one returns its receipt; an unknown id is `incompatible_state`.
1512
+ */
1024
1513
  cancelWorkerWait(parentId: string, waitId: string): WorkerWait;
1025
- private workerWait;
1514
+ /** A turn of this run is executing now: a recovered run's is not, whatever it last recorded. */
1515
+ private isExecutingWorkerWaitTurn;
1026
1516
  private rootFinishRequested;
1027
1517
  private executionBlockedByRootFinish;
1028
1518
  /** Finish can arrive during continuation preflight. Retain its accepted
@@ -1041,27 +1531,49 @@ export declare class RunManager {
1041
1531
  * Recovery's full pass (#661): every family whose root carries a conversation — settled ones
1042
1532
  * too, so a projection or outcome a crash interrupted is repaired — then every live family.
1043
1533
  * Only roots with a conversation are read; a settled family without one has nothing to settle:
1044
- * every other repair the sweep makes on a finished member (a stale `wait`, a cancelled root's
1045
- * Finish intent) is a clause of `isLiveRecord`, so open already holds that family.
1534
+ * the other repair the sweep makes on a finished member (a cancelled root's Finish
1535
+ * intent) is a clause of `isLiveRecord`, so open already holds that family.
1046
1536
  * Everything else asks `reconcileWorkerWaits()`, which covers the live families (#779).
1047
1537
  */
1538
+ private reconcileRecoveryWorkerFamilies;
1048
1539
  reconcileAllWorkerFamilies(): void;
1049
1540
  /** Authority and wait live on disk; these collections are admission/timer caches only. One
1050
1541
  * family by its root's id, or (no id) every family with a live member. */
1051
1542
  reconcileWorkerWaits(familyRootId?: string): void;
1052
1543
  private reconcileWorkerFamily;
1053
- queueWorkerWake(parentId: string): void;
1054
- /** Shared turn-end path; asks win, worker waits precede DONE/monitoring/nudges. */
1055
- private parkWorkerWait;
1056
- private withdrawWorkerWait;
1544
+ /** The settled outcomes a run's worker waits can observe now: each owned worker whose execution
1545
+ * is provably complete, and each deleted worker's retained result. */
1546
+ private workerObservations;
1547
+ /** The family conversation's request outcomes, which settle request waits. */
1548
+ private requestOutcomesOf;
1549
+ /**
1550
+ * Reconcile a run's open `worker` entries (hearsay-tools/cezarion#1235): the same observation
1551
+ * rules as the old engine's wait had (an unsettled wait follows a re-run worker's revision; an
1552
+ * observation without current proof is dropped). A satisfied or overdue entry resolves through
1553
+ * `resolveWait`, unless every worker it names was destroyed while the turn that waits on them is
1554
+ * still executing: nothing is left to await, so it is cancelled. Any other entry has its deadline
1555
+ * armed. Messages never resolve one.
1556
+ */
1557
+ private reconcileWorkerEntries;
1057
1558
  /** Durable queue is the single hydration source for fresh, continuing and recovered runs. */
1058
1559
  steerWorker(runId: string, input: AgentInput): 'queued' | 'delivered';
1059
1560
  /** Transcript bubbles include refused sends. Only a successful delivery
1060
1561
  * checkpoint can answer the specific ask observed before that send. */
1061
1562
  private pendingHumanAskSeq;
1563
+ /** An unanswered `ask.requested` with no open human wait (a row written before every ask opened
1564
+ * one) gets an open agent wait shown as that ask. Answer delivery still reads the transcript.
1565
+ * Cezar's own wait not shown as that ask is replaced, as the live ask does: a crash between
1566
+ * saving the ask and replacing it leaves that wait open (review of #1437). */
1567
+ private adoptTranscriptAsk;
1568
+ /** The human wait upgraded from a stored `hasPendingHumanAsk` (`turnId: 'legacy'`, never shown)
1569
+ * is settled as answered when the transcript's facts are known and hold no unanswered ask: that
1570
+ * flag was read from the transcript, so its ask was answered after the row was last saved.
1571
+ * Unknown facts are no evidence, and the wait stays open. */
1572
+ private settleAnsweredLegacyAsk;
1062
1573
  private hasPendingHumanAsk;
1063
1574
  /** Accepted input may be temporarily refused while a backend HTTP ack is
1064
- * outstanding. That is not an empty queue and must not trigger automatic DONE. */
1575
+ * outstanding. That is not an empty queue and must not trigger automatic DONE. `except` leaves
1576
+ * out inputs already submitted, such as an acknowledgement still in flight. */
1065
1577
  private hasQueuedAgentInputs;
1066
1578
  /** Only the current session's observation writes consumedAt (#505). An ID reported
1067
1579
  * before its acceptance checkpoint lands is applied when that checkpoint commits. */
@@ -1076,8 +1588,19 @@ export declare class RunManager {
1076
1588
  /** The conversation messages the next submission would carry, if nothing but
1077
1589
  * conversation input leads the queue (lifecycle input stays a barrier). */
1078
1590
  private pendingConversationBatch;
1079
- /** Bundled messages rode the answer's own write: delivered now, read when that turn ends. */
1591
+ /** Bundled messages rode the answer's own write: delivered now, read when that turn ends. The
1592
+ * answer's own outcomes (`with`: the human waits it answers, its charge) commit with them. A
1593
+ * refused write that carries a charge retries the whole batch best effort: the session has the
1594
+ * reply, and the charge never saves apart from it (hearsay-tools/cezarion#1805). Returns why the
1595
+ * first write was refused. */
1080
1596
  private commitBundledDelivery;
1597
+ /** The fallback reply's charge, the question it answers and the reply it delivers are one commit
1598
+ * (hearsay-tools/cezarion#1805): no restart reads the charge without the reply. */
1599
+ private commitRoutedAnswer;
1600
+ /** One commit (hearsay-tools/cezarion#1805): the human waits a message answers, the messages bundled
1601
+ * with it and a deferred message's queue entry. A refused queue entry interrupts the session:
1602
+ * stdin and disk cannot transact, so it stays for conservative recovery. */
1603
+ private commitAnswer;
1081
1604
  /** The turn that carried bundled messages has ended: the model read them. */
1082
1605
  private readBundledInputs;
1083
1606
  /** #505: the session closed without reporting it read (failure, stop, exit): the input
@@ -1103,6 +1626,8 @@ export declare class RunManager {
1103
1626
  private handleAgentInputReady;
1104
1627
  /** Reservation is synchronous; only an acknowledged transport may checkpoint delivery. */
1105
1628
  private submitAgentInput;
1629
+ /** Apply the acknowledgement's effects only after its outcome commit succeeds. */
1630
+ private applyAcknowledgedInput;
1106
1631
  /** False leaves the durable entry untouched. No human-answer/slash-expansion fallback. */
1107
1632
  private flushAgentInputs;
1108
1633
  private formatAgentInput;
@@ -1114,28 +1639,50 @@ export declare class RunManager {
1114
1639
  * while `waiting`). Returns false when there is no open session — the GUI
1115
1640
  * then offers "Continue" instead.
1116
1641
  */
1117
- sendMessage(runId: string, content: PastedContent[]): boolean;
1642
+ sendMessage(runId: string, content: PastedContent[], messageId?: string): boolean;
1643
+ /** Only an explicit option from the permission card may answer a native grant. */
1644
+ respondPermission(runId: string, requestId: string, optionId: string): boolean;
1118
1645
  /** Restore active lifecycle/accounting when either Cezar or the backend
1119
1646
  * resumes work in a parked session. */
1120
1647
  private resumeParkedRun;
1121
1648
  /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
1122
1649
  * bookkeeping without masquerading as user-authored transcript messages. */
1123
1650
  private deliverMessage;
1651
+ private prepareMessageContent;
1652
+ private applyHumanMessageDelivery;
1124
1653
  /** Close the open session gracefully — the run then completes as `done`
1125
1654
  * (or rests at `review` when the worktree holds changes, spec 009).
1126
1655
  * On a run already resting at `review` (no session — the engine loop is
1127
1656
  * over), "Finish" is the third review exit: accept the changes without a
1128
1657
  * PR and flip straight to `done`. */
1129
1658
  finish(runId: string): boolean;
1659
+ /** Finish ends the task, so an unanswered question is closed rather than left answerable on a
1660
+ * finished run (hearsay-tools/cezarion#1260). A root never gets here with one pending: its Finish
1661
+ * is refused until the question is answered. Stop keeps the question, which a human may still
1662
+ * answer to reopen the run (#505). */
1663
+ private closeQuestionOnFinish;
1130
1664
  /** A synthetic continuation can settle only the resumed agent turn. If the
1131
1665
  * original workflow still has steps after the waiting one, that would skip
1132
1666
  * those steps rather than resume the workflow engine. */
1133
1667
  private waitingBeforeFinalWorkflowStep;
1134
1668
  /** A clean process exit cannot complete a workflow still blocked on a question.
1135
- * Keep its existing durable waiting step so Continue can resume the tail. */
1669
+ * Keep its existing durable waiting step so Continue can resume the tail. Cezar's fallback
1670
+ * question on a worker is not one: the clean exit supersedes it, so the workflow goes on as the
1671
+ * plain park it replaced did (hearsay-tools/cezarion#1301). */
1136
1672
  private unansweredWorkflowAsk;
1137
1673
  /** Locate the original workflow step whose closed session a synthetic Continue is resuming. */
1138
1674
  private waitingWorkflowStepIndex;
1675
+ /** The workflow step after the one a continuation resumes, when that one is not the last: the
1676
+ * continuation's done completes the resumed step and starts this one (hearsay-tools/cezarion#1620). */
1677
+ /**
1678
+ * Whether a step session closed without its done while a later step waits (hearsay-tools/cezarion#1620).
1679
+ * It reads and clears the done `closeAsDone` recorded. Finish is an explicit stop, settled as before.
1680
+ */
1681
+ private stepLeftOpen;
1682
+ /** A resumed earlier step that closed without a done stays open: its workflow step, not the Continue's own. */
1683
+ private settleIncompleteContinuation;
1684
+ private continuationNextStep;
1685
+ private ciWorkflowResumeStepIndex;
1139
1686
  /**
1140
1687
  * Session ids Cursor will accept on `session/load`. A launch UUID written
1141
1688
  * before `session.started` is only for the step rail (#583).
@@ -1155,10 +1702,262 @@ export declare class RunManager {
1155
1702
  error?: string;
1156
1703
  };
1157
1704
  private admitContinuation;
1705
+ /** Overrides still persist before the execution checkpoint, even if that checkpoint refuses. */
1706
+ private acceptContinuation;
1707
+ private acceptUntouchedContinuation;
1708
+ private acceptResumedContinuation;
1709
+ private checkpointContinuation;
1710
+ private dispatchAcceptedContinuation;
1711
+ /** A Continue whose engine threw: the run fails and leaves the active set (exit `fail-crash`). */
1712
+ private failCrashedContinuation;
1158
1713
  private runContinuation;
1714
+ /** Where a Continue runs: an owned worker's verified workspace, or the task's worktree, which
1715
+ * retention may have reclaimed (#483), else the repository root. Returns undefined after an
1716
+ * unavailable owned workspace failed the run. */
1717
+ private continuationWorkspace;
1718
+ /** An owned worker's workspace for a Continue, verified with its parent's context. Returns
1719
+ * undefined after it failed the run: owned workers never adopt or recreate an unverified resource. */
1720
+ private ownedContinuationWorkspace;
1721
+ /** A Stop that arrived while the Continue resolved its workspace cancels the run before it
1722
+ * becomes active. */
1723
+ private settleStoppedContinuation;
1724
+ /** The repository-root lease of a Continue that runs in the repository root. Returns undefined
1725
+ * when no lease is needed, so that path does not yield, else whether the lease was granted. */
1726
+ private continuationRepoRootLease;
1727
+ /** Wait for the repository-root lease; a Stop during the wait cancels the run. */
1728
+ private acquireContinuationRepoRoot;
1729
+ /** Arm autosave, seed the handoff file, and run worktree setup. Returns setup's note for the
1730
+ * opening message. */
1731
+ private prepareContinuationWorktree;
1732
+ /** Mark the run and the Continue's step as running, then open the step. A Cursor session resumes
1733
+ * on the transport it was opened with. */
1734
+ private startContinuationStep;
1735
+ /** A Continue's opening message: the checkpoint's agent input with its outcome, its images and
1736
+ * attachments, and the `user-message` event that shows it. */
1737
+ private continuationOpening;
1738
+ /** A Continue's opening images and attachments. */
1739
+ private continuationImages;
1740
+ /** The human ask a human Continue answers, and the human waits that answer settles. */
1741
+ private openingAnswer;
1742
+ /**
1743
+ * A completed turn acknowledges the opening payload. Until then a restart
1744
+ * must replay it, including a crash after startSession but before delivery.
1745
+ * Returns false when the opening input's checkpoint failed, and the turn end stops there.
1746
+ */
1747
+ private acknowledgeOpeningTurn;
1748
+ /** Latch an agent input error, then interrupt: a transport failure the interrupt causes is secondary. */
1749
+ private latchAgentInputError;
1750
+ /**
1751
+ * What a Continue runs with. Backend + model come off the record: the run's current backend by
1752
+ * default, or the follow-up override that `continueRun` persisted before scheduling (#401).
1753
+ * Returns undefined after a pre-spawn gate failed the turn.
1754
+ */
1755
+ private continuationLaunchSettings;
1756
+ /** Settle this turn as a failure before anything is spawned — the shape every
1757
+ * pre-spawn gate needs (model identity, #405; temp directory, #785). */
1758
+ private failContinuationBeforeSpawn;
1759
+ /**
1760
+ * The model a Continue runs with, or the model identity error's message.
1761
+ * Apply the SAME canonical-identity gate the first spawn applies (#405, review M1).
1762
+ * A follow-up may switch both runner and model (#401), so without this the record keeps
1763
+ * asserting the identity the run STARTED with while a different model serves the turn —
1764
+ * the exact defect that PR existed to remove — and the raw record string reaches the CLI
1765
+ * in the un-normalised wire form the first step already converted away (`anthropic/opus`
1766
+ * instead of `opus`). Fail loud here too rather than let the backend pick a default.
1767
+ */
1768
+ private continuationModel;
1769
+ /** The effort a Continue runs at, or the message of the error that refuses it: an owned worker's
1770
+ * pinned effort, else the continued step's authored one, else the run's; unset when the project
1771
+ * locks agent models. */
1772
+ private continuationEffort;
1773
+ /** Record the Continue's account on its step and the settings its workers inherit. */
1774
+ private applyContinuationSettings;
1775
+ /** The Continue's runner, and whether it resumes into a thread that already holds the skill
1776
+ * playbook. A resumed Cursor session keeps the transport it was opened with. */
1777
+ private continuationRunner;
1778
+ /** The continued step's skill files and playbook, when the step names a skill or the prompt
1779
+ * starts with a `/name`. Returns undefined otherwise, so that path does not yield. */
1780
+ private continuationSkills;
1781
+ /** Reinstall the continued step's skill and a leading `/name`'s, and build the playbook. */
1782
+ private provisionContinuationSkills;
1783
+ /** The continued step's skill when the registry did not list it yet. */
1784
+ private awaitContinuedSkill;
1785
+ /** A Stop before the Continue's session spawned: cancel the step and the run. */
1786
+ private settleContinuationPrelaunchCancel;
1787
+ /** A Continue's launch went stale while it provisioned (`launchStale`). A replaced active run
1788
+ * needs nothing more; a Stop cancels the run; a root Finish holds the Continue in the queue. */
1789
+ private settleStaleContinuationLaunch;
1790
+ /** Start a Continue's session, resuming its own session when it has one. A throw revokes the
1791
+ * tools this launch was given and propagates to `continueRun`. */
1792
+ private startContinuationSession;
1793
+ /** Wait for a Continue's session to close, then settle the run by how it closed. Teardown always
1794
+ * revokes the launch's tools, saves the worktree and leaves the active set
1795
+ * (`releaseContinuationSession`). */
1796
+ private awaitContinuationSession;
1797
+ /** Settle a Continue whose session closed without a fault: undelivered wakes, a Stop, a step left
1798
+ * open, a done, or an idle close. Returns the settlement to wait for, or undefined when it
1799
+ * completed without yielding. */
1800
+ private settleClosedContinuation;
1801
+ /** The session closed with wakes it still holds: park the run, or fail it when their delivery
1802
+ * failed. */
1803
+ private settleClosingWakes;
1804
+ /** A Stop ended the Continue's session: cancel its step and the run. */
1805
+ private settleCancelledContinuation;
1806
+ /** The Continue's step is done: settle the run, or the workflow step it resumed. Returns the
1807
+ * settlement to wait for, or undefined when it queued the workflow remainder. */
1808
+ private settleDoneContinuation;
1809
+ /** The Continue finished the workflow step it resumed: queue the workflow remainder, or settle
1810
+ * the run when none is left or Finish was requested. */
1811
+ private settleResumedWorkflowStep;
1812
+ /** Settle the run after a successful Continue. */
1813
+ private succeedContinuation;
1814
+ /** The Continue's session failed, or its settlement threw: fail its step, then park the run
1815
+ * when it still holds wakes, else fail it. */
1816
+ private settleFailedContinuation;
1817
+ /** A Continue's session teardown: revoke the launch's tools, record the usage peaks, clear the
1818
+ * timers, save the worktree, leave the active set, then queue the workflow remainder. */
1819
+ private releaseContinuationSession;
1159
1820
  private execute;
1821
+ /**
1822
+ * The launch half of `execute`: the backend, extra system prompt and model identity the run
1823
+ * starts with, recorded on the run as it starts. Undefined when the run was cancelled or went
1824
+ * back to the queue first.
1825
+ */
1826
+ private startExecution;
1827
+ /**
1828
+ * Canonical provider/model identity (#405) — the normalised `provider/model`
1829
+ * the task ran with, persisted for cost attribution / reproducible replay
1830
+ * beside the free-text `model`. Best-effort here (a per-step `runner`/`model`
1831
+ * can still override it); the authoritative fail-loud gate is at spawn.
1832
+ */
1833
+ private taskModelIdentity;
1834
+ /**
1835
+ * Worktree per task (spec 006): the agent works on its own branch in
1836
+ * `.ai/cezar/worktrees/<id>`, never in the user's working tree. A Git task
1837
+ * that requests isolation fails closed if the worktree cannot be
1838
+ * established; only explicit opt-out and non-Git modes run in place.
1839
+ * False when the run stopped here.
1840
+ */
1841
+ private prepareExecutionWorktree;
1842
+ /**
1843
+ * Fork from the configured base branch (config.json `baseBranch`, e.g.
1844
+ * `develop`) — also the target of the eventual draft PR. Unresolvable
1845
+ * (typo, not fetched) → note + the currently checked-out branch.
1846
+ *
1847
+ * A task that already recorded a fork point keeps it: its worktree is
1848
+ * reused as-is, and re-resolving against a since-changed config would
1849
+ * silently re-anchor the `merge-base` every diff/shortstat is measured
1850
+ * from, shifting "what did this task change" under an existing task.
1851
+ */
1852
+ private executionBaseRef;
1853
+ /** Opens the task's worktree and prepares it for the first step. False when the worker stopped
1854
+ * first, or when the worktree could not be established, which fails the run. */
1855
+ private createExecutionWorktree;
1856
+ /** The task's worktree: an owned worker's verified workspace, or a new worktree forked from `base`. */
1857
+ private openExecutionWorktree;
1858
+ /**
1859
+ * The task's attachments for the first agent step's opening message, and its image blocks.
1860
+ * Both are empty once an agent step of this workflow has run.
1861
+ */
1862
+ private openingInputs;
1863
+ /**
1864
+ * The step loop of `execute`, from `startAt`. Returns its outcome for `settleExecution`, or
1865
+ * undefined when the run left this execution: parked, back in the queue, or held by another
1866
+ * owner.
1867
+ */
1868
+ private runWorkflowSteps;
1869
+ /**
1870
+ * What the step loop does once an agent step's session ended: start the next step, settle the
1871
+ * run, or leave the run to what holds it now (another owner, the queue, or a park). Synchronous,
1872
+ * like the loop body it came from, so the loop yields only where it awaits the step itself.
1873
+ */
1874
+ private nextAfterAgentStep;
1875
+ /**
1876
+ * An authored step deadline bounds the whole step, its question included (#427 Q8, #470 T3):
1877
+ * once it has passed, the step's human waits expire with it and the failure settles as it
1878
+ * did before questions were waits. CI and timer waits still park the failure
1879
+ * (`settleAgentStepWakes`). The clock starts before session setup, so a failure that close to
1880
+ * the deadline counts as it.
1881
+ */
1882
+ private expireStepDeadlineWaits;
1883
+ /**
1884
+ * Records a failed agent step, then settles what the run's closing wakes need. True when the
1885
+ * run parked to deliver them; a capped delivery fails the step and marks the loop capped.
1886
+ */
1887
+ private settleAgentStepWakes;
1888
+ /**
1889
+ * A check step's result: a pass goes on to the next step, a failure loops back to its
1890
+ * `onFail.retry` step while retries remain, and otherwise fails the run. Returns the index the
1891
+ * step loop continues from, or undefined when the run fails.
1892
+ */
1893
+ private settleCheckStep;
1894
+ /**
1895
+ * Settles the run once the step loop of `execute` ended: the final autosave, then the
1896
+ * cancelled, failed, incomplete-step, idle-closed or success settlement.
1897
+ */
1898
+ private settleExecution;
1899
+ /** The cancelled settlement: the run and its running and waiting steps become cancelled. */
1900
+ private settleCancelledRun;
1901
+ /** The failed settlement. A capped wake delivery adds the cap's note. */
1902
+ private settleFailedRun;
1160
1903
  /** Returns an error message, or null on success. */
1161
1904
  private runAgentStep;
1905
+ /** A fresh step's opening message, before the open-waits footer and the session-start context,
1906
+ * and the selected skill's playbook for its system prompt. */
1907
+ private stepOpening;
1908
+ /** Shutdown left this delegated run to restart recovery: its session's events are dropped, and an
1909
+ * error still interrupts the session. */
1910
+ private disposedSessionEvent;
1911
+ /** A session's fault: the first one stands, an agent input error recorded before it wins, and the
1912
+ * session is interrupted. */
1913
+ private recordSessionFault;
1914
+ /** The session reached a turn end: retire the inputs it left unread, read the bundled inputs, and
1915
+ * open the turn boundary with a fresh CI turn id. */
1916
+ private markTurnBoundary;
1917
+ /**
1918
+ * The model and effort a fresh step runs with. Normalise the selected model to canonical
1919
+ * `provider/model` and back to the backend's own wire form via the ONE shared mapper (#405).
1920
+ * Fail-loud: an unresolvable model (e.g. a bare id on opencode) returns the step error
1921
+ * instead of letting the backend silently substitute its default.
1922
+ */
1923
+ private stepModel;
1924
+ /** The effort a fresh step runs at: an owned worker's pinned effort, else the step's authored one,
1925
+ * else the run's; unset when the project locks agent models. An invalid authored effort throws
1926
+ * `DelegationPolicyError`. */
1927
+ private stepEffort;
1928
+ /**
1929
+ * The account a step's session spawns under, resolved together with the temp-directory preflight
1930
+ * (#785): the step fails with a named, actionable error instead of spawning a backend whose shell
1931
+ * would return empty output. An account that would open another folder than its own fails the
1932
+ * same way (#1283). Returns the profile, or that error's message.
1933
+ */
1934
+ private stepProfileFor;
1935
+ /**
1936
+ * Pre-launch revalidation (hearsay-tools/cezarion#1632). Stop, a stopped execution, a replaced
1937
+ * active run or a root Finish can arrive while provisioning awaits. Then this launch's CI tools
1938
+ * and delegation are revoked, and the run state forgets each one only while it is still this
1939
+ * launch's. The caller settles the run.
1940
+ */
1941
+ private launchStale;
1942
+ /** A launch's opening message (hearsay-tools/cezarion#1632): the body, the open-waits footer, the
1943
+ * resume context of a Continue's checkpoint, then the session-start context in front. */
1944
+ private launchOpening;
1945
+ /** Start a fresh step's session. A throw revokes the tools this launch was given and returns its
1946
+ * message as the step's error. */
1947
+ private startStepSession;
1948
+ /**
1949
+ * The system prompt after the skill playbook (hearsay-tools/cezarion#1632): the run's extra
1950
+ * prompt, the delegation instructions, the automations and project webhooks parts, the artifact
1951
+ * contract, then the handoff contract.
1952
+ */
1953
+ private launchSystemTail;
1954
+ /** Wait for a fresh step's session to close. Returns the step's error, or null. Teardown always
1955
+ * revokes the launch's tools and clears the session's state (`releaseStepSession`). */
1956
+ private awaitStepSession;
1957
+ /** A fresh step's session teardown: revoke the launch's tools, record the usage peaks, and clear
1958
+ * what its turns left on the run state: the idle timer, the monitoring and waiting marks, the
1959
+ * turn boundary, the park intents and the session itself. */
1960
+ private releaseStepSession;
1162
1961
  /** Some adapters return assistant text only in their final result. Preserve that
1163
1962
  * evidence for collection without duplicating an already persisted transcript. */
1164
1963
  private persistWorkerAssistantResult;
@@ -1172,16 +1971,63 @@ export declare class RunManager {
1172
1971
  * item-shape cache are session-scoped, like the mapper state feeding them.
1173
1972
  */
1174
1973
  private makeUiSink;
1175
- /** Ask precedence also releases an admitted but not yet delivered worker wake.
1176
- * Its durable input/wait remain queued until an actual human answer. */
1974
+ /** Ask precedence: the question is pending, and no autonomous nudge goes beside it. Durable
1975
+ * input and waits stay queued until an actual human answer. */
1177
1976
  private prepareHumanAsk;
1178
- /** A prose or rejected-ASK fallback supersedes a registered autonomous wait. Keep the
1179
- * checkpoint through idle closure/restart and hold worker input until a
1180
- * successful human delivery, just as for a structured ask. */
1181
- private prepareProseHumanGate;
1977
+ /** The human gate a human wait without a card raises (the monitoring line with re-checks off):
1978
+ * `PROSE_HUMAN_GATE` names it in the transcript. Keep the checkpoint through idle closure/restart
1979
+ * and hold worker input until a successful human delivery, just as for a structured ask. */
1980
+ private raiseHumanGate;
1981
+ /** The open human wait nobody has shown the user yet (hearsay-tools/cezarion#1234): one this
1982
+ * turn registered, or one a failure, close or crash caught before its turn end. */
1983
+ private unsurfacedHumanWait;
1984
+ /** The human wait this turn end raises: one nobody has seen yet. One registered while a question
1985
+ * is pending waits on that question instead, and raises nothing. */
1986
+ private turnEndHumanWait;
1987
+ /** An alias's human wait, or the one already open: a run holds one. A full list opens none. */
1988
+ private openHumanAlias;
1989
+ /** Record which question a human wait is shown as: the pending card or gate, whose answer settles
1990
+ * it. A card shown in place of the wait's own replaces it. A wait already shown is left alone. */
1991
+ private markHumanWaitSurfaced;
1992
+ /**
1993
+ * Show a human wait outside its turn end (hearsay-tools/cezarion#1234): at a boundary, at the
1994
+ * budget, or from the failure, close and recovery paths, where no turn end will. A card raises
1995
+ * `ask.requested` and goes to a worker's parent; a wait without one raises the human gate. A
1996
+ * question already pending is the one it waits on. A wait already shown is left alone. Cezar's
1997
+ * own wait is shown as its note instead (`showCezarHumanWait`).
1998
+ */
1999
+ private surfaceHumanWait;
2000
+ /**
2001
+ * Cezar's own human wait (`no-wait`, `budget`) is shown as a note, recorded as its `askSeq`, and
2002
+ * raises no human gate (hearsay-tools/cezarion#1234). The agent asked nothing: the run waits for
2003
+ * the user as the plain park did before these waits, so worker messages still wake it and its
2004
+ * wait registrations, `cezar_done` and the user's Finish are not refused. The user's message
2005
+ * settles it, and the agent's own wait or question replaces it (`withdrawCezarHumanWaits`).
2006
+ */
2007
+ private showCezarHumanWait;
2008
+ /** Cezar waited on the user only because the agent had nothing to wait on: the agent's own wait
2009
+ * or question replaces that wait (hearsay-tools/cezarion#1234). It also ends with the session
2010
+ * that opened it, so a close, an idle close or a failure settles as the plain park did. */
2011
+ private withdrawCezarHumanWaits;
2012
+ /** Whether a closing session leaves the run waits to park on. Cezar's own human waits end with the
2013
+ * session, even when the store refused their cancellation (`withdrawCezarHumanWaits`). */
2014
+ private holdsAgentWaits;
2015
+ /** A valid ask line replaces the card of the human wait its turn registered. It is saved
2016
+ * before the turn end can re-enter a boundary (Cursor print's ready callback from
2017
+ * `discardQueuedMessages`), so a wait shown there shows the later card. */
2018
+ private latchAskLineCard;
2019
+ /** Read fresh: a boundary the turn end re-enters (Cursor print's ready callback from
2020
+ * `discardQueuedMessages`) may have shown the wait already, and its card stands. */
2021
+ private humanWaitShown;
2022
+ /** The turn end raised a card or the gate: record the human wait it shows. A turn that registered
2023
+ * none opens the ask line's. */
2024
+ private recordTurnEndQuestion;
1182
2025
  /** Native backend asks arrive before turn-end. Persist and park immediately
1183
2026
  * so the cockpit shows attention and the run releases its workspace slot. */
1184
2027
  private handleRunnerUiEvent;
2028
+ private handlePermissionRequested;
2029
+ private handlePermissionResolved;
2030
+ private handleNativeAskRequested;
1185
2031
  /** Persist the invocation checkpoint before launching a runner. A throw or
1186
2032
  * process exit before `turn.started` therefore leaves a durable mismatch. */
1187
2033
  private beginUsageInvocation;
@@ -1257,6 +2103,21 @@ export declare class RunManager {
1257
2103
  * off — settle straight to `done`, leaving the diff in the worktree untouched.
1258
2104
  */
1259
2105
  private settleSuccess;
2106
+ /**
2107
+ * Whether a successful run rests at `review`: its worktree holds a diff, the review gate is
2108
+ * on, and the run is not autonomous. A root finish cannot settle without a diff, so a failed
2109
+ * diff throws for it.
2110
+ */
2111
+ private successNeedsReview;
2112
+ /** True when the success settlement must not write: the run is no longer live, a newer
2113
+ * continuation started, or another execution replaced the one that began settling. */
2114
+ private successSuperseded;
2115
+ /** A Stop accepted while the success settlement read the diff: the run and its running and
2116
+ * waiting steps become cancelled, and a step keeps a finish time it already has. */
2117
+ private settleCancelledSuccess;
2118
+ /** The ordinary success path (not a root finish): the steps that settle as done, then the run
2119
+ * as `review` or `done`. */
2120
+ private commitOrdinarySuccess;
1260
2121
  /** Called only after session/process settlement. A refused nudge retained its
1261
2122
  * slot and running status until idle close; ordinary roots must now become
1262
2123
  * resumable. Previously parked roots and delegated lifecycle policy stay intact. */
@@ -1266,6 +2127,14 @@ export declare class RunManager {
1266
2127
  * would produce so its parent can collect it. Explicit asks and worker waits
1267
2128
  * remain durable attention states. */
1268
2129
  private settleIdleClosedWorker;
2130
+ /**
2131
+ * An earlier workflow step whose session closed without a done: a clean exit, an idle close, or
2132
+ * a Continue that resumed it and closed the same way (hearsay-tools/cezarion#1620). The step stays
2133
+ * `waiting` and the tail never starts. A root waits for Continue, which resumes the step. An owned
2134
+ * worker settles as a single-step task's close does, so its parent can collect it; the step stays
2135
+ * `waiting`, and a parent resume re-enters it. A question still pending keeps either one waiting.
2136
+ */
2137
+ private settleIncompleteStep;
1269
2138
  /**
1270
2139
  * Persist every attachment a user message carries — images and files alike (#950) — into the
1271
2140
  * run's own attachment folder, in the order they were attached. The returned paths are what the
@@ -1297,36 +2166,174 @@ export declare class RunManager {
1297
2166
  * teardown. Native mid-turn asks still park for an answer (outside this policy).
1298
2167
  * A refused ordinary nudge waits for readiness at this exact boundary; the idle
1299
2168
  * timeout bounds a missing readiness signal. New activity/input invalidates it.
1300
- * A refused portable override falls back to normal question parking.
2169
+ * `ask` is this turn's ask line, which an autonomous run does not register before the budget
2170
+ * (hearsay-tools/cezarion#1234). A wire that refuses the nudge registers it after all.
1301
2171
  */
2172
+ /** `text` is the turn-end rule's nudge; an ask line's nudge scopes the same one itself (hearsay-tools/cezarion#1620). */
1302
2173
  private tryAutonomousNudge;
1303
- /** Shared silent-tail conditions for the one-shot visible-message nudge. Callers must
1304
- * invoke this only when nothing else already continued. */
1305
- private maybeFinalMessageNudge;
1306
- /** One-shot visible-message nudge when a turn ends on reasoning or a tool (#544, #119).
1307
- * Liveness: this path has no inputIds, so #505's unread-input timer does not apply, and
1308
- * resumeParkedRun / clearIdleTimer drop the user-wait idle bound. Do not re-arm idle until
1309
- * content arrives — some harnesses omit `turn.started` and still run (N8); idle would then
1310
- * kill a live turn. OpenCode heartbeats re-arm the managed-session no-progress guard without
1311
- * opening a turn, so an ACK that stays silent is bounded by FINAL_MESSAGE_NUDGE_REPLY_MS:
1312
- * parent-level v1 content (text, tool-call, tool-result) and UiEvent items count at any time,
1313
- * including before the timer is armed; `turn.started` counts after arm or while
1314
- * `finalMessageNudgeParked` matches the session (OpenCode/Cursor emit a synthetic one inside
1315
- * sendAgentMessage). Nested `item.*` with `parentItemId` is ignored.
1316
- * Expiry parks `waiting` and latches `finalMessageNudgeParked`; a late reply from that session
1317
- * resumes. User-authored delivery resets the one-shot latch; expiry does not. */
1318
- private tryFinalMessageNudge;
1319
- /** Heartbeats and nested subagent items are not a reply. OpenCode/Cursor synthetic `turn.started` inside `sendAgentMessage` cannot false-resume after expiry because a later send goes through `submitAgentInput` → `resumeParkedRun`. */
1320
- private isFinalMessageNudgeReply;
1321
- private noteFinalMessageNudgeContent;
1322
- private armFinalMessageNudgeReplyTimer;
1323
- private clearFinalMessageNudgeReplyTimer;
2174
+ /**
2175
+ * A turn end on the runner's own signal, shared by the fresh step's and the Continue's turn-end
2176
+ * handlers (hearsay-tools/cezarion#1525): read what the turn said, keep it for an acknowledgement
2177
+ * that lands after the turn end (`parkAfterAck`), then settle it (`settleTurn`). Nothing reads the
2178
+ * turn's prose beyond its markers.
2179
+ */
2180
+ private endTurn;
2181
+ /** Prepare the turn's ask before the turn end settles (`endTurn`): its notes, the `invalidAsk`
2182
+ * flag, and the ask or human gate the run parks on. True when the autonomous nudge went instead
2183
+ * of the ask line. */
2184
+ private prepareTurnAsk;
2185
+ /** The turn end an entry settles after it (`settleIdleBoundary`, `handleAgentInputReady`), and
2186
+ * the completion gate's live refusal: what `parkAfterAck` kept of it. */
2187
+ private boundaryTurn;
2188
+ /**
2189
+ * Settle a turn end (hearsay-tools/cezarion#1525). Every entry goes through it: the turn end
2190
+ * itself (`turn-end`, a fresh step or a Continue), an acknowledgement that lands after it
2191
+ * (`ack`), input readiness for a refused autonomous nudge (`ready`), and the completion gate's
2192
+ * refusal of a live session's done outside a turn end (`gate`). It takes a done to the completion
2193
+ * gate, gathers the facts, lets the pure rule (`decideTurnEnd`) decide and carries out the
2194
+ * decision. False when nothing was settled: the done closed the session, or the input checkpoint
2195
+ * failed.
2196
+ */
2197
+ private settleTurn;
2198
+ /** The completion gate held the done (`settleTurn`). A stopped root, or a question that parked
2199
+ * for the user: the done stays at the boundary. False when the input checkpoint failed. */
2200
+ private settleHeldTurn;
2201
+ /** The ask line's autonomous nudge went instead of the question (`settleTurn`): its turn is the
2202
+ * next one. False when the input checkpoint failed. */
2203
+ private settleAskNudgedTurn;
2204
+ /** What the turn-end rule decides for a settled turn (`settleTurn`): the timer alias the rule
2205
+ * reads, the first decision and the done it keeps, then the owed input a `take-input` decision
2206
+ * tries and the decision after it. `tried` is true when that input was tried. */
2207
+ private decideSettledTurn;
2208
+ /** The facts the turn-end rule reads for a settled turn (`decideSettledTurn`). `session` is the
2209
+ * session `settleTurn` found. */
2210
+ private turnEndFacts;
2211
+ /** The monitoring line and `ScheduleWakeup` open their timer before the rule reads the waits, as
2212
+ * the `cezar_wait` timer they alias. An autonomous nudge waiting for readiness keeps precedence. */
2213
+ private openTurnTimerAlias;
2214
+ /** The done the first decision keeps at the boundary (`decideSettledTurn`): a turn end records
2215
+ * it, and an acknowledgement drops a refused done the rule does not keep. */
2216
+ private keepSettledDone;
2217
+ /** The owed input a `take-input` decision tries (`decideSettledTurn`). True when input was taken.
2218
+ * #505: input the harness accepted but has not read yet runs as its next turn. An in-flight
2219
+ * submission is settled by its acknowledgement (parkAfterAck), not here. */
2220
+ private takeOwedInput;
2221
+ /** A turn end's own steps after the rule decided (`settleTurn`): the unread and held input timers,
2222
+ * then the `CEZ:ASK` card. False when the input checkpoint failed. */
2223
+ private settleTurnEndInput;
2224
+ /** Carry out what the turn-end rule decided, and report how it left the run. A refusal the
2225
+ * decision follows is noted first; then the decision kind's own method runs (`turnEndCarriers`). */
2226
+ private carryOutTurnEnd;
2227
+ /** The method for each decision kind (`carryOutTurnEnd`). A closed session settles elsewhere, and
2228
+ * owed input runs as the session's next turn: the run keeps running. */
2229
+ private readonly turnEndCarriers;
2230
+ /** Every park returns this once it is carried out, so a worker's park notice goes here whichever
2231
+ * decision parked it (hearsay-tools/cezarion#1327). */
2232
+ private parkedOutcome;
2233
+ /** A refused autonomous nudge waits for readiness at this boundary, bounded by the idle timer. */
2234
+ private carryOutDefer;
2235
+ private carryOutDone;
2236
+ /** A human wait is shown and parks for the user; CI and timer waits keep their slot. A question
2237
+ * with no wait parks for the user, and the freed slot can start a queued run. */
2238
+ private carryOutPark;
2239
+ /** One nudge per cycle: Cezar waits on the live workers for the agent, then parks as `park` does. */
2240
+ private carryOutCompletionWait;
2241
+ /** The completion cause's human wait: the refusal is its note, and Cezar's own wait shows it. */
2242
+ private carryOutCompletionHumanWait;
2243
+ /** The no-wait and budget human waits. A refusal that settles the turn end opens the budget wait. */
2244
+ private carryOutHumanWait;
2245
+ /** The completion cause's nudge: the refusal message, which names the worker wait when live
2246
+ * workers block the done. A nudge that cannot go parks for the user. */
2247
+ private carryOutCompletionNudge;
2248
+ /** The no-wait cause's nudge. One the wire refuses waits for input readiness when it is
2249
+ * autonomous, else opens Cezar's no-wait human wait. */
2250
+ private carryOutNoWaitNudge;
2251
+ /** The outcome a settled turn reached, for the parity cells that prove which path ran
2252
+ * (hearsay-tools/cezarion#1809, which removed the handoff heartbeat line that recorded it). No
2253
+ * outcome for the completion gate's refusal outside a turn end, nor while input readiness waits. */
2254
+ private settledTurnOutcome;
2255
+ /** The nudge a turn end with no wait or done gets: one automatic turn, charged to the
2256
+ * automatic-wake budget. The autonomous wording repeats; the no-wait one is sent once and is
2257
+ * bounded by its reply timer (#544's liveness). */
2258
+ private sendTurnEndNudge;
2259
+ /** Cezar's own human wait at a turn end (hearsay-tools/cezarion#1234): the cause as a note, the
2260
+ * wait shown as Needs you, and the run parked for the user. A worker's `no-wait` fallback at its
2261
+ * turn end (`turnEnd`) asks its parent instead (`askParentForWorker`, hearsay-tools/cezarion#1301);
2262
+ * any other worker fallback stays a plain park. */
2263
+ private openTurnEndHumanWait;
2264
+ /**
2265
+ * A worker that ended a second turn with no wait or done after its no-wait nudge
2266
+ * (hearsay-tools/cezarion#1301): Cezar's `no-wait` human wait carries one open question, raised
2267
+ * as `ask.requested` so `routeWorkerQuestion` takes it to the parent as a request. The parent's
2268
+ * reply resumes the worker through the answer seam, charged to the worker's budget; a parent that
2269
+ * cannot receive leaves it with the human (`worker-question-fallback`). A full wait list opens
2270
+ * none and the worker parks as before.
2271
+ */
2272
+ private askParentForWorker;
2273
+ /** The worker's pending question is the one `askParentForWorker` raised. */
2274
+ private isWorkerFallbackAsk;
2275
+ /** The worker's pending question is Cezar's fallback question. */
2276
+ private pendingWorkerFallback;
2277
+ /** The parent's reply to a worker's fallback question resumed it: one automatic wake, so a
2278
+ * parent and worker cannot go back and forth past the budget (hearsay-tools/cezarion#1301). */
2279
+ private chargeWorkerFallbackReply;
2280
+ /**
2281
+ * Cezar's fallback question is Cezar's, not the worker's (hearsay-tools/cezarion#1301): what the
2282
+ * plain park it replaced let through still goes through. A parent's input, a Continue or a closed
2283
+ * session supersedes it: its routed request gets an outcome, so it no longer holds the parent's
2284
+ * done, the parent's unread copy is retired, and only then does the question close unanswered
2285
+ * (`human-ask-closed`, `superseded`) and Cezar's wait go. Each step is idempotent and the close
2286
+ * comes last, so a failed write leaves the question pending and the next supersession, or
2287
+ * recovery, finishes it. A question the worker asked itself is never superseded. True when it
2288
+ * closed.
2289
+ */
2290
+ private supersedeWorkerFallback;
2291
+ /** The parent no longer owes an answer to a superseded fallback question: one it has not read is
2292
+ * retired, so neither a wake nor a restart's replay of unread input delivers it. One a provider
2293
+ * or an inbox read already holds is left to them. */
2294
+ private retireUnreadParentQuestion;
2295
+ /** Heartbeats and nested subagent items are not a reply. A `turn.started` counts only while the
2296
+ * reply timer runs or after it expired on this session: OpenCode and Cursor emit a synthetic one
2297
+ * inside `sendAgentMessage`, and a later send goes through `submitAgentInput`, which resumes. */
2298
+ private isNoWaitNudgeReply;
2299
+ /** A reply to the nudge clears its bound. One that arrives after the bound parked the run resumes
2300
+ * it, as the final-message nudge's did (#544); its turn end then decides, and a run still on
2301
+ * Cezar's no-wait wait parks on it again. */
2302
+ private noteNoWaitNudgeContent;
2303
+ /** A no-wait nudge the harness acknowledged but never answered (an OpenCode heartbeat keeps the
2304
+ * session alive without a turn): at the bound Cezar opens the no-wait human wait and the run
2305
+ * waits for the user. A reply that arrives after it runs, and the run stays on that question. */
2306
+ private armNoWaitNudgeReplyTimer;
2307
+ private clearNoWaitNudgeReplyTimer;
2308
+ /** Every run status `run.ts` writes comes from the run state table (hearsay-tools/cezarion#1804). */
2309
+ private move;
1324
2310
  private armIdleTimer;
1325
2311
  private clearIdleTimer;
1326
- private reconcileMonitoringWakeTimers;
1327
- private armMonitoringWakeTimer;
1328
- private clearMonitoringWakeTimer;
1329
- /** Keep the active/execution guard until autosave proves its processes exited. */
2312
+ /** The turn-end tail's park for the user: `waiting` with the idle timer, no slot. A result
2313
+ * already in (a pending question beside a resolved wait) still queues its wake. */
2314
+ private parkForUser;
2315
+ /**
2316
+ * The monitoring line and Claude's `ScheduleWakeup` open a timer in the wait list
2317
+ * (hearsay-tools/cezarion#1233): the line for the configured interval, `ScheduleWakeup` for its
2318
+ * `delaySeconds` clamped to 60–3,600 (the interval without one). Idempotent per `via`: while one
2319
+ * is open the alias registers nothing and the timer keeps its deadline. The line is only a
2320
+ * fallback: any open non-human wait suppresses its registration (hearsay-tools/cezarion#1268),
2321
+ * including the off/budget human fallback. With timers off and no such wait it opens
2322
+ * a `monitoring-line` human wait instead, and with the automatic-wake budget spent a `budget` one
2323
+ * (hearsay-tools/cezarion#1234); the park shows it. An autonomous run's nudge keeps precedence
2324
+ * over the line.
2325
+ */
2326
+ private openTimerAlias;
2327
+ /** The save may finish execution while its strict writer proof remains pending. */
2328
+ private readonly autosaveTasks;
2329
+ /** Cleanup evidence survives manager disposal and store close/reopen. */
2330
+ autosaveCleanupBlocker(runId: string): string | undefined;
2331
+ /** Keep a separate maintenance hold until autosave proves all its processes exited.
2332
+ * Commits only while HEAD is the run's recorded branch (hearsay-tools/cezarion#1004), and
2333
+ * records a commit or a skip in the run store, shown in the handoff's records block, and as a
2334
+ * note; a periodic save records only a commit, with no note, merged with the
2335
+ * periodic commits right before it. A run with no recorded branch keeps committing on
2336
+ * whatever HEAD is. */
1330
2337
  private saveWorktree;
1331
2338
  /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
1332
2339
  * Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
@@ -1344,6 +2351,9 @@ export declare class RunManager {
1344
2351
  private runCheckStep;
1345
2352
  private finishStep;
1346
2353
  }
2354
+ /** How `cezar_done` names the step its done starts: the rail's name, else the id. A workflow file
2355
+ * may give a step an empty name, and the done answer's `next_step` must not be empty. */
2356
+ export declare function stepLabel(step: WorkflowStepDef): string;
1347
2357
  /**
1348
2358
  * Immediate title shown while a run is queued. The namer's `titleSummary`
1349
2359
  * replaces it once the model answers; this is the honest, permanent fallback
@@ -1361,10 +2371,14 @@ export declare function makeRunTitle(task: string, workflow: WorkflowDef): strin
1361
2371
  * worse, reads a stale copy materialized from the team-repo cache. The path
1362
2372
  * resolves against the MAIN project root (`discoverSkills(repoRoot)`), i.e. the
1363
2373
  * current `npx skills`-installed copy, so a worktree agent and the main
1364
- * checkout read the exact same, up-to-date files. Team skills are omitted here:
1365
- * they are materialized into the worktree separately (see the call site).
2374
+ * checkout read the exact same, up-to-date files. A team skill's `path` is not
2375
+ * on disk: its files are materialized per run (`RunManager.provisionRunSkills`).
2376
+ * Inside the run's task worktree they need no pointer; a run without one, or
2377
+ * whose worktree took no copy, gets a per-commit cache copy, passed here as
2378
+ * `teamFilesDir` (#1024). A worktree that took only some of its copies passes
2379
+ * the first one it did take.
1366
2380
  */
1367
- export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
2381
+ export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>, teamFilesDir?: string): string;
1368
2382
  /**
1369
2383
  * Expand a registry-backed slash skill in one prompt string before it reaches a
1370
2384
  * backend. Claude otherwise intercepts an unknown leading slash command, and
@@ -1378,7 +2392,11 @@ export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'descripti
1378
2392
  * `expandRegistrySlashSkill`, and fresh or continuation opening prompts, which
1379
2393
  * become the session's `userPrompt` without passing through `deliverMessage`.
1380
2394
  */
1381
- export declare function expandRegistrySlashSkillText(text: string, skills: readonly Skill[]): string;
2395
+ export declare function expandRegistrySlashSkillText(text: string, skills: readonly Skill[],
2396
+ /** Per team skill, the cache or partial copy its prompt names (#1118). */
2397
+ teamFilesDir?: ReadonlyMap<string, string>): string;
2398
+ /** The `name` of a prompt's leading `/name` slash command, else undefined. */
2399
+ export declare function leadingSlashSkillName(text: string): string | undefined;
1382
2400
  /**
1383
2401
  * `expandRegistrySlashSkillText` over a live chat message: only the first text
1384
2402
  * block is eligible, and an unchanged block returns the caller's array