@wjarka/cezarion 0.17.0 → 0.18.0-dev.5793

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 (1158) hide show
  1. package/bin.js +2 -0
  2. package/cez.js +2 -0
  3. package/cezarion.js +2 -0
  4. package/dist/cez.js +2 -0
  5. package/dist/cezarion.js +2 -0
  6. package/dist/hsq.js +2 -0
  7. package/dist/index.js +1 -835
  8. package/dist/server/app-type.d.ts +1 -6
  9. package/dist/server/app-type.js +1 -2
  10. package/hsq.js +2 -0
  11. package/package.json +20 -59
  12. package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
  13. package/web/dist/assets/activity-motion-2nE59DAT.js +2 -0
  14. package/web/dist/assets/activity-route-R9lPc2jy.js +1 -0
  15. package/web/dist/assets/agent-accounts-f1cxwgfz.js +18 -0
  16. package/web/dist/assets/alert-dialog-Dj464rjk.js +1 -0
  17. package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
  18. package/web/dist/assets/button-CHUAMTHK.js +3 -0
  19. package/web/dist/assets/centered-state-DGyy0SuA.js +1 -0
  20. package/web/dist/assets/cez-idle-EVoUsgU3.js +1 -0
  21. package/web/dist/assets/commit-diff-panel-BJyNYmCY.js +1 -0
  22. package/web/dist/assets/control-locations-C9II3kPz.js +1 -0
  23. package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
  24. package/web/dist/assets/diff-D_9MtICR.js +3 -0
  25. package/web/dist/assets/diff-controls-BR2uqhwG.js +1 -0
  26. package/web/dist/assets/diff-view-xRPxXHXl.js +11 -0
  27. package/web/dist/assets/dropdown-menu-DhrBcVgr.js +1 -0
  28. package/web/dist/assets/es2015-D345RR4o.js +41 -0
  29. package/web/dist/assets/file-preview-D08Kq15E.js +2 -0
  30. package/web/dist/assets/git-toolbar-D9taioU5.js +1 -0
  31. package/web/dist/assets/github-bv_pBGc5.js +1 -0
  32. package/web/dist/assets/github-sidebar-model-B0Ufci5S.js +1 -0
  33. package/web/dist/assets/global-activity-route-QxTPDyx-.js +1 -0
  34. package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
  35. package/web/dist/assets/{image-preview-C_t9q45f.js → image-preview-Cq1vDiEo.js} +1 -1
  36. package/web/dist/assets/index-B18AqW0Z.css +1 -0
  37. package/web/dist/assets/index-DgU3yYUl.js +14 -0
  38. package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
  39. package/web/dist/assets/live-protocol-BVn0UA_g.js +64 -0
  40. package/web/dist/assets/live-refetch-BdnmTJ_8.js +1 -0
  41. package/web/dist/assets/{live-worker-BizfZSoh.ts → live-worker-BWdeGzQX.ts} +2 -1
  42. package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
  43. package/web/dist/assets/markdown-D7DUNWcJ.js +6 -0
  44. package/web/dist/assets/mermaid.min-3O9YjB2l.js +1 -0
  45. package/web/dist/assets/message-square-B-MD-8rD.js +1 -0
  46. package/web/dist/assets/{nav-row-styles-AoIhhIwf.js → nav-row-styles-BZUUavOF.js} +1 -1
  47. package/web/dist/assets/popover-DRcRI46x.js +1 -0
  48. package/web/dist/assets/preview-pane-connected-cD-MTiVN.js +3 -0
  49. package/web/dist/assets/project-router-MMOk9VbW.js +1 -0
  50. package/web/dist/assets/project-scope-context-B3M-u8R0.js +4 -0
  51. package/web/dist/assets/queries-DORTKwyN.js +1 -0
  52. package/web/dist/assets/repo-git-E_4Ighvg.js +1 -0
  53. package/web/dist/assets/report-reader-XVNQsXB4.js +1 -0
  54. package/web/dist/assets/report-title-D4Mbu2Er.js +1 -0
  55. package/web/dist/assets/reports-B7QAzibP.css +1 -0
  56. package/web/dist/assets/reports-B_PVTBzP.js +1 -0
  57. package/web/dist/assets/run-header-wm0gSs6X.js +2 -0
  58. package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
  59. package/web/dist/assets/skills-D2RLxUIc.js +1 -0
  60. package/web/dist/assets/skills-DFBiAuJG.js +1 -0
  61. package/web/dist/assets/skills-workflows-C21NystW.css +1 -0
  62. package/web/dist/assets/sortable.esm-zp_qkYGV.js +5 -0
  63. package/web/dist/assets/tab-link-BvoGfK8S.js +1 -0
  64. package/web/dist/assets/task-changes-DNtkfFzQ.js +1 -0
  65. package/web/dist/assets/task-commits-CivO-OrN.js +1 -0
  66. package/web/dist/assets/task-files-dczkxV_G.js +1 -0
  67. package/web/dist/assets/task-github-item-DKV4yrcf.js +1 -0
  68. package/web/dist/assets/task-thread-DIaTTGEF.js +9 -0
  69. package/web/dist/assets/textarea-DlVUfdWG.js +1 -0
  70. package/web/dist/assets/thread-state-DIozHuHb.js +4 -0
  71. package/web/dist/assets/toaster-B1MyeHiE.js +1 -0
  72. package/web/dist/assets/use-hand-to-agent-state-D58ayxI4.js +1 -0
  73. package/web/dist/assets/useInfiniteQuery-BbYMWe23.js +1 -0
  74. package/web/dist/assets/useQuery-CqqnAJvu.js +1 -0
  75. package/web/dist/assets/workflows-YMEsGXeB.js +7 -0
  76. package/web/dist/assets/ws-BtSVmivO.js +1 -0
  77. package/web/dist/assets/zoomable-image-5pOUaPEg.js +1 -0
  78. package/web/dist/index.html +31 -15
  79. package/web/dist/live-worker.js +2 -2
  80. package/LICENSE +0 -22
  81. package/README.md +0 -1725
  82. package/dist/agent-config/account-identity.d.ts +0 -28
  83. package/dist/agent-config/account-identity.js +0 -131
  84. package/dist/agent-config/account-identity.js.map +0 -1
  85. package/dist/agent-config/catalog.d.ts +0 -70
  86. package/dist/agent-config/catalog.js +0 -383
  87. package/dist/agent-config/catalog.js.map +0 -1
  88. package/dist/agent-config/files.d.ts +0 -42
  89. package/dist/agent-config/files.js +0 -115
  90. package/dist/agent-config/files.js.map +0 -1
  91. package/dist/agent-config/model-settings/claude.d.ts +0 -2
  92. package/dist/agent-config/model-settings/claude.js +0 -11
  93. package/dist/agent-config/model-settings/claude.js.map +0 -1
  94. package/dist/agent-config/model-settings/codex.d.ts +0 -2
  95. package/dist/agent-config/model-settings/codex.js +0 -16
  96. package/dist/agent-config/model-settings/codex.js.map +0 -1
  97. package/dist/agent-config/model-settings/opencode.d.ts +0 -2
  98. package/dist/agent-config/model-settings/opencode.js +0 -8
  99. package/dist/agent-config/model-settings/opencode.js.map +0 -1
  100. package/dist/agent-config/model-settings/pi.d.ts +0 -2
  101. package/dist/agent-config/model-settings/pi.js +0 -38
  102. package/dist/agent-config/model-settings/pi.js.map +0 -1
  103. package/dist/agent-config/model-settings/shared.d.ts +0 -12
  104. package/dist/agent-config/model-settings/shared.js +0 -100
  105. package/dist/agent-config/model-settings/shared.js.map +0 -1
  106. package/dist/agent-config/model-settings/types.d.ts +0 -9
  107. package/dist/agent-config/model-settings/types.js +0 -2
  108. package/dist/agent-config/model-settings/types.js.map +0 -1
  109. package/dist/agent-config/models.d.ts +0 -9
  110. package/dist/agent-config/models.js +0 -40
  111. package/dist/agent-config/models.js.map +0 -1
  112. package/dist/agent-config/seed.d.ts +0 -15
  113. package/dist/agent-config/seed.js +0 -94
  114. package/dist/agent-config/seed.js.map +0 -1
  115. package/dist/agent-config/service.d.ts +0 -44
  116. package/dist/agent-config/service.js +0 -72
  117. package/dist/agent-config/service.js.map +0 -1
  118. package/dist/agent-config/validate.d.ts +0 -18
  119. package/dist/agent-config/validate.js +0 -82
  120. package/dist/agent-config/validate.js.map +0 -1
  121. package/dist/application-update/bin-recovery.d.ts +0 -5
  122. package/dist/application-update/bin-recovery.js +0 -96
  123. package/dist/application-update/bin-recovery.js.map +0 -1
  124. package/dist/application-update/discovery.d.ts +0 -22
  125. package/dist/application-update/discovery.js +0 -91
  126. package/dist/application-update/discovery.js.map +0 -1
  127. package/dist/application-update/helper.d.ts +0 -57
  128. package/dist/application-update/helper.js +0 -369
  129. package/dist/application-update/helper.js.map +0 -1
  130. package/dist/application-update/launcher.d.ts +0 -12
  131. package/dist/application-update/launcher.js +0 -59
  132. package/dist/application-update/launcher.js.map +0 -1
  133. package/dist/application-update/lock.d.ts +0 -4
  134. package/dist/application-update/lock.js +0 -70
  135. package/dist/application-update/lock.js.map +0 -1
  136. package/dist/application-update/npm-process.d.ts +0 -17
  137. package/dist/application-update/npm-process.js +0 -133
  138. package/dist/application-update/npm-process.js.map +0 -1
  139. package/dist/application-update/service.d.ts +0 -69
  140. package/dist/application-update/service.js +0 -456
  141. package/dist/application-update/service.js.map +0 -1
  142. package/dist/archive-on-merge-setting.d.ts +0 -15
  143. package/dist/archive-on-merge-setting.js +0 -14
  144. package/dist/archive-on-merge-setting.js.map +0 -1
  145. package/dist/artifacts/cli.d.ts +0 -9
  146. package/dist/artifacts/cli.js +0 -59
  147. package/dist/artifacts/cli.js.map +0 -1
  148. package/dist/artifacts/lifecycle.d.ts +0 -4
  149. package/dist/artifacts/lifecycle.js +0 -42
  150. package/dist/artifacts/lifecycle.js.map +0 -1
  151. package/dist/artifacts/resolve.d.ts +0 -18
  152. package/dist/artifacts/resolve.js +0 -103
  153. package/dist/artifacts/resolve.js.map +0 -1
  154. package/dist/artifacts/store.d.ts +0 -8
  155. package/dist/artifacts/store.js +0 -323
  156. package/dist/artifacts/store.js.map +0 -1
  157. package/dist/automations/automation-cli.d.ts +0 -59
  158. package/dist/automations/automation-cli.js +0 -509
  159. package/dist/automations/automation-cli.js.map +0 -1
  160. package/dist/automations/builtin-skill.d.ts +0 -7
  161. package/dist/automations/builtin-skill.js +0 -14
  162. package/dist/automations/builtin-skill.js.map +0 -1
  163. package/dist/automations/coordinator.d.ts +0 -33
  164. package/dist/automations/coordinator.js +0 -86
  165. package/dist/automations/coordinator.js.map +0 -1
  166. package/dist/automations/github-baseline.d.ts +0 -3
  167. package/dist/automations/github-baseline.js +0 -17
  168. package/dist/automations/github-baseline.js.map +0 -1
  169. package/dist/automations/github-poller.d.ts +0 -93
  170. package/dist/automations/github-poller.js +0 -303
  171. package/dist/automations/github-poller.js.map +0 -1
  172. package/dist/automations/prompts.d.ts +0 -12
  173. package/dist/automations/prompts.js +0 -160
  174. package/dist/automations/prompts.js.map +0 -1
  175. package/dist/automations/schedule-runner.d.ts +0 -149
  176. package/dist/automations/schedule-runner.js +0 -513
  177. package/dist/automations/schedule-runner.js.map +0 -1
  178. package/dist/automations/scheduler.d.ts +0 -87
  179. package/dist/automations/scheduler.js +0 -434
  180. package/dist/automations/scheduler.js.map +0 -1
  181. package/dist/automations/service.d.ts +0 -777
  182. package/dist/automations/service.js +0 -444
  183. package/dist/automations/service.js.map +0 -1
  184. package/dist/automations/store.d.ts +0 -160
  185. package/dist/automations/store.js +0 -738
  186. package/dist/automations/store.js.map +0 -1
  187. package/dist/automations/task-template.d.ts +0 -59
  188. package/dist/automations/task-template.js +0 -273
  189. package/dist/automations/task-template.js.map +0 -1
  190. package/dist/automations/tool-adapter.d.ts +0 -6
  191. package/dist/automations/tool-adapter.js +0 -108
  192. package/dist/automations/tool-adapter.js.map +0 -1
  193. package/dist/automations/types.d.ts +0 -1
  194. package/dist/automations/types.js +0 -2
  195. package/dist/automations/types.js.map +0 -1
  196. package/dist/autosave-cleanup.d.ts +0 -26
  197. package/dist/autosave-cleanup.js +0 -87
  198. package/dist/autosave-cleanup.js.map +0 -1
  199. package/dist/autosave-git.d.ts +0 -21
  200. package/dist/autosave-git.js +0 -204
  201. package/dist/autosave-git.js.map +0 -1
  202. package/dist/autosave-group.d.ts +0 -8
  203. package/dist/autosave-group.js +0 -61
  204. package/dist/autosave-group.js.map +0 -1
  205. package/dist/autosave-holders.d.ts +0 -34
  206. package/dist/autosave-holders.js +0 -204
  207. package/dist/autosave-holders.js.map +0 -1
  208. package/dist/autosave-windows.d.ts +0 -25
  209. package/dist/autosave-windows.js +0 -156
  210. package/dist/autosave-windows.js.map +0 -1
  211. package/dist/ci-wait/client.d.ts +0 -28
  212. package/dist/ci-wait/client.js +0 -105
  213. package/dist/ci-wait/client.js.map +0 -1
  214. package/dist/ci-wait/controller.d.ts +0 -756
  215. package/dist/ci-wait/controller.js +0 -334
  216. package/dist/ci-wait/controller.js.map +0 -1
  217. package/dist/ci-wait/errors.d.ts +0 -27
  218. package/dist/ci-wait/errors.js +0 -252
  219. package/dist/ci-wait/errors.js.map +0 -1
  220. package/dist/ci-wait/github.d.ts +0 -87
  221. package/dist/ci-wait/github.js +0 -278
  222. package/dist/ci-wait/github.js.map +0 -1
  223. package/dist/ci-wait/injection.d.ts +0 -3
  224. package/dist/ci-wait/injection.js +0 -26
  225. package/dist/ci-wait/injection.js.map +0 -1
  226. package/dist/ci-wait/mcp.d.ts +0 -3
  227. package/dist/ci-wait/mcp.js +0 -30
  228. package/dist/ci-wait/mcp.js.map +0 -1
  229. package/dist/ci-wait/resources.d.ts +0 -7
  230. package/dist/ci-wait/resources.js +0 -32
  231. package/dist/ci-wait/resources.js.map +0 -1
  232. package/dist/ci-wait/supervisor.d.ts +0 -29
  233. package/dist/ci-wait/supervisor.js +0 -260
  234. package/dist/ci-wait/supervisor.js.map +0 -1
  235. package/dist/ci-wait/tools.d.ts +0 -827
  236. package/dist/ci-wait/tools.js +0 -208
  237. package/dist/ci-wait/tools.js.map +0 -1
  238. package/dist/config.d.ts +0 -68
  239. package/dist/config.js +0 -209
  240. package/dist/config.js.map +0 -1
  241. package/dist/contract/active-provider.d.ts +0 -12
  242. package/dist/contract/agent-config.d.ts +0 -160
  243. package/dist/contract/agent-profiles.d.ts +0 -369
  244. package/dist/contract/application-update.d.ts +0 -32
  245. package/dist/contract/artifacts.d.ts +0 -83
  246. package/dist/contract/ask-schema.d.ts +0 -50
  247. package/dist/contract/ask.d.ts +0 -9
  248. package/dist/contract/attachments.d.ts +0 -35
  249. package/dist/contract/attention.d.ts +0 -90
  250. package/dist/contract/automation-requests.d.ts +0 -308
  251. package/dist/contract/automation-schedule.d.ts +0 -89
  252. package/dist/contract/automation-storage.d.ts +0 -512
  253. package/dist/contract/automations.d.ts +0 -1542
  254. package/dist/contract/ci-wait.d.ts +0 -222
  255. package/dist/contract/config-requests.d.ts +0 -36
  256. package/dist/contract/conversations.d.ts +0 -351
  257. package/dist/contract/defined.d.ts +0 -8
  258. package/dist/contract/delegation.d.ts +0 -1882
  259. package/dist/contract/discovery.d.ts +0 -141
  260. package/dist/contract/effort.d.ts +0 -18
  261. package/dist/contract/events.d.ts +0 -292
  262. package/dist/contract/github-requests.d.ts +0 -26
  263. package/dist/contract/github.d.ts +0 -732
  264. package/dist/contract/handoff.d.ts +0 -43
  265. package/dist/contract/health.d.ts +0 -124
  266. package/dist/contract/image-path.d.ts +0 -6
  267. package/dist/contract/index.d.ts +0 -59
  268. package/dist/contract/index.js +0 -5887
  269. package/dist/contract/live-coordination.d.ts +0 -158
  270. package/dist/contract/live-limits.d.ts +0 -8
  271. package/dist/contract/live.d.ts +0 -123
  272. package/dist/contract/pending-ask.d.ts +0 -58
  273. package/dist/contract/permissions.d.ts +0 -54
  274. package/dist/contract/preview.d.ts +0 -541
  275. package/dist/contract/project-limits.d.ts +0 -33
  276. package/dist/contract/projects.d.ts +0 -716
  277. package/dist/contract/provider-requests.d.ts +0 -77
  278. package/dist/contract/query-requests.d.ts +0 -52
  279. package/dist/contract/repo-requests.d.ts +0 -12
  280. package/dist/contract/repo.d.ts +0 -496
  281. package/dist/contract/run-labels.d.ts +0 -8
  282. package/dist/contract/run-limits.d.ts +0 -8
  283. package/dist/contract/run-predicates.d.ts +0 -32
  284. package/dist/contract/run-requests.d.ts +0 -33
  285. package/dist/contract/run-search.d.ts +0 -193
  286. package/dist/contract/runs.d.ts +0 -5340
  287. package/dist/contract/scheduled-tasks.d.ts +0 -187
  288. package/dist/contract/skills.d.ts +0 -56
  289. package/dist/contract/team-skill-ref.d.ts +0 -10
  290. package/dist/contract/tool-display.d.ts +0 -25
  291. package/dist/contract/ui-state-requests.d.ts +0 -60
  292. package/dist/contract/version.d.ts +0 -3
  293. package/dist/contract/voice.d.ts +0 -213
  294. package/dist/contract/waits.d.ts +0 -1204
  295. package/dist/contract/workflow-file.d.ts +0 -37
  296. package/dist/contract/workflow-requests.d.ts +0 -7
  297. package/dist/contract/workflows.d.ts +0 -250
  298. package/dist/contract/workspace.d.ts +0 -631
  299. package/dist/contract/zoned-time.d.ts +0 -26
  300. package/dist/core/agent-env.d.ts +0 -30
  301. package/dist/core/agent-env.js +0 -400
  302. package/dist/core/agent-env.js.map +0 -1
  303. package/dist/core/agent-model-policy.d.ts +0 -10
  304. package/dist/core/agent-model-policy.js +0 -36
  305. package/dist/core/agent-model-policy.js.map +0 -1
  306. package/dist/core/agent-profiles.d.ts +0 -50
  307. package/dist/core/agent-profiles.js +0 -105
  308. package/dist/core/agent-profiles.js.map +0 -1
  309. package/dist/core/agent-runner.d.ts +0 -394
  310. package/dist/core/agent-runner.js +0 -96
  311. package/dist/core/agent-runner.js.map +0 -1
  312. package/dist/core/ask.d.ts +0 -79
  313. package/dist/core/ask.js +0 -232
  314. package/dist/core/ask.js.map +0 -1
  315. package/dist/core/backend-detect.d.ts +0 -17
  316. package/dist/core/backend-detect.js +0 -209
  317. package/dist/core/backend-detect.js.map +0 -1
  318. package/dist/core/claude-cli-runner.d.ts +0 -72
  319. package/dist/core/claude-cli-runner.js +0 -910
  320. package/dist/core/claude-cli-runner.js.map +0 -1
  321. package/dist/core/claude-model-catalog.d.ts +0 -16
  322. package/dist/core/claude-model-catalog.js +0 -198
  323. package/dist/core/claude-model-catalog.js.map +0 -1
  324. package/dist/core/claude-ui-mapper.d.ts +0 -80
  325. package/dist/core/claude-ui-mapper.js +0 -696
  326. package/dist/core/claude-ui-mapper.js.map +0 -1
  327. package/dist/core/codex-app-server-runner.d.ts +0 -61
  328. package/dist/core/codex-app-server-runner.js +0 -1278
  329. package/dist/core/codex-app-server-runner.js.map +0 -1
  330. package/dist/core/codex-app-server-transport.d.ts +0 -52
  331. package/dist/core/codex-app-server-transport.js +0 -199
  332. package/dist/core/codex-app-server-transport.js.map +0 -1
  333. package/dist/core/codex-approvals.d.ts +0 -12
  334. package/dist/core/codex-approvals.js +0 -161
  335. package/dist/core/codex-approvals.js.map +0 -1
  336. package/dist/core/codex-model-catalog.d.ts +0 -10
  337. package/dist/core/codex-model-catalog.js +0 -110
  338. package/dist/core/codex-model-catalog.js.map +0 -1
  339. package/dist/core/codex-permissions.d.ts +0 -6
  340. package/dist/core/codex-permissions.js +0 -27
  341. package/dist/core/codex-permissions.js.map +0 -1
  342. package/dist/core/codex-stream-error.d.ts +0 -2
  343. package/dist/core/codex-stream-error.js +0 -12
  344. package/dist/core/codex-stream-error.js.map +0 -1
  345. package/dist/core/codex-turn-outcome.d.ts +0 -8
  346. package/dist/core/codex-turn-outcome.js +0 -30
  347. package/dist/core/codex-turn-outcome.js.map +0 -1
  348. package/dist/core/codex-ui-mapper.d.ts +0 -112
  349. package/dist/core/codex-ui-mapper.js +0 -808
  350. package/dist/core/codex-ui-mapper.js.map +0 -1
  351. package/dist/core/cursor-acp-runner.d.ts +0 -34
  352. package/dist/core/cursor-acp-runner.js +0 -777
  353. package/dist/core/cursor-acp-runner.js.map +0 -1
  354. package/dist/core/cursor-cli-flags.d.ts +0 -19
  355. package/dist/core/cursor-cli-flags.js +0 -47
  356. package/dist/core/cursor-cli-flags.js.map +0 -1
  357. package/dist/core/cursor-config-options.d.ts +0 -18
  358. package/dist/core/cursor-config-options.js +0 -31
  359. package/dist/core/cursor-config-options.js.map +0 -1
  360. package/dist/core/cursor-model-catalog.d.ts +0 -45
  361. package/dist/core/cursor-model-catalog.js +0 -300
  362. package/dist/core/cursor-model-catalog.js.map +0 -1
  363. package/dist/core/cursor-print-capabilities.d.ts +0 -16
  364. package/dist/core/cursor-print-capabilities.js +0 -141
  365. package/dist/core/cursor-print-capabilities.js.map +0 -1
  366. package/dist/core/cursor-print-process.d.ts +0 -31
  367. package/dist/core/cursor-print-process.js +0 -117
  368. package/dist/core/cursor-print-process.js.map +0 -1
  369. package/dist/core/cursor-print-runner.d.ts +0 -31
  370. package/dist/core/cursor-print-runner.js +0 -555
  371. package/dist/core/cursor-print-runner.js.map +0 -1
  372. package/dist/core/cursor-print-tool-catalog.d.ts +0 -10
  373. package/dist/core/cursor-print-tool-catalog.js +0 -91
  374. package/dist/core/cursor-print-tool-catalog.js.map +0 -1
  375. package/dist/core/cursor-print-ui-mapper.d.ts +0 -47
  376. package/dist/core/cursor-print-ui-mapper.js +0 -553
  377. package/dist/core/cursor-print-ui-mapper.js.map +0 -1
  378. package/dist/core/cursor-provider-error.d.ts +0 -33
  379. package/dist/core/cursor-provider-error.js +0 -68
  380. package/dist/core/cursor-provider-error.js.map +0 -1
  381. package/dist/core/cursor-runner.d.ts +0 -24
  382. package/dist/core/cursor-runner.js +0 -149
  383. package/dist/core/cursor-runner.js.map +0 -1
  384. package/dist/core/cursor-ui-mapper.d.ts +0 -29
  385. package/dist/core/cursor-ui-mapper.js +0 -275
  386. package/dist/core/cursor-ui-mapper.js.map +0 -1
  387. package/dist/core/defined.d.ts +0 -1
  388. package/dist/core/defined.js +0 -2
  389. package/dist/core/defined.js.map +0 -1
  390. package/dist/core/hook-items.d.ts +0 -14
  391. package/dist/core/hook-items.js +0 -13
  392. package/dist/core/hook-items.js.map +0 -1
  393. package/dist/core/host-model-catalog.d.ts +0 -7
  394. package/dist/core/host-model-catalog.js +0 -21
  395. package/dist/core/host-model-catalog.js.map +0 -1
  396. package/dist/core/input-submissions.d.ts +0 -14
  397. package/dist/core/input-submissions.js +0 -26
  398. package/dist/core/input-submissions.js.map +0 -1
  399. package/dist/core/managed-session.d.ts +0 -6
  400. package/dist/core/managed-session.js +0 -116
  401. package/dist/core/managed-session.js.map +0 -1
  402. package/dist/core/model-identity.d.ts +0 -108
  403. package/dist/core/model-identity.js +0 -137
  404. package/dist/core/model-identity.js.map +0 -1
  405. package/dist/core/model-presets.d.ts +0 -10
  406. package/dist/core/model-presets.js +0 -77
  407. package/dist/core/model-presets.js.map +0 -1
  408. package/dist/core/ndjson.d.ts +0 -6
  409. package/dist/core/ndjson.js +0 -23
  410. package/dist/core/ndjson.js.map +0 -1
  411. package/dist/core/omp-model-catalog.d.ts +0 -43
  412. package/dist/core/omp-model-catalog.js +0 -205
  413. package/dist/core/omp-model-catalog.js.map +0 -1
  414. package/dist/core/omp-runner.d.ts +0 -72
  415. package/dist/core/omp-runner.js +0 -1049
  416. package/dist/core/omp-runner.js.map +0 -1
  417. package/dist/core/omp-ui-mapper.d.ts +0 -106
  418. package/dist/core/omp-ui-mapper.js +0 -882
  419. package/dist/core/omp-ui-mapper.js.map +0 -1
  420. package/dist/core/opencode-model-catalog.d.ts +0 -32
  421. package/dist/core/opencode-model-catalog.js +0 -215
  422. package/dist/core/opencode-model-catalog.js.map +0 -1
  423. package/dist/core/opencode-permissions.d.ts +0 -52
  424. package/dist/core/opencode-permissions.js +0 -101
  425. package/dist/core/opencode-permissions.js.map +0 -1
  426. package/dist/core/opencode-server-runner.d.ts +0 -61
  427. package/dist/core/opencode-server-runner.js +0 -1692
  428. package/dist/core/opencode-server-runner.js.map +0 -1
  429. package/dist/core/opencode-session-error.d.ts +0 -19
  430. package/dist/core/opencode-session-error.js +0 -42
  431. package/dist/core/opencode-session-error.js.map +0 -1
  432. package/dist/core/opencode-ui-mapper.d.ts +0 -137
  433. package/dist/core/opencode-ui-mapper.js +0 -768
  434. package/dist/core/opencode-ui-mapper.js.map +0 -1
  435. package/dist/core/pi-model-catalog.d.ts +0 -38
  436. package/dist/core/pi-model-catalog.js +0 -249
  437. package/dist/core/pi-model-catalog.js.map +0 -1
  438. package/dist/core/pi-runner.d.ts +0 -43
  439. package/dist/core/pi-runner.js +0 -827
  440. package/dist/core/pi-runner.js.map +0 -1
  441. package/dist/core/pi-ui-mapper.d.ts +0 -52
  442. package/dist/core/pi-ui-mapper.js +0 -395
  443. package/dist/core/pi-ui-mapper.js.map +0 -1
  444. package/dist/core/process-usage.d.ts +0 -74
  445. package/dist/core/process-usage.js +0 -218
  446. package/dist/core/process-usage.js.map +0 -1
  447. package/dist/core/provider-auth.d.ts +0 -168
  448. package/dist/core/provider-auth.js +0 -660
  449. package/dist/core/provider-auth.js.map +0 -1
  450. package/dist/core/provider-availability.d.ts +0 -3
  451. package/dist/core/provider-availability.js +0 -14
  452. package/dist/core/provider-availability.js.map +0 -1
  453. package/dist/core/runner-factory.d.ts +0 -11
  454. package/dist/core/runner-factory.js +0 -31
  455. package/dist/core/runner-factory.js.map +0 -1
  456. package/dist/core/runner-model-catalog.d.ts +0 -34
  457. package/dist/core/runner-model-catalog.js +0 -109
  458. package/dist/core/runner-model-catalog.js.map +0 -1
  459. package/dist/core/runner-runtime.d.ts +0 -40
  460. package/dist/core/runner-runtime.js +0 -88
  461. package/dist/core/runner-runtime.js.map +0 -1
  462. package/dist/core/runner-stderr.d.ts +0 -2
  463. package/dist/core/runner-stderr.js +0 -20
  464. package/dist/core/runner-stderr.js.map +0 -1
  465. package/dist/core/runner-tool-grants.d.ts +0 -21
  466. package/dist/core/runner-tool-grants.js +0 -64
  467. package/dist/core/runner-tool-grants.js.map +0 -1
  468. package/dist/core/secret-redaction.d.ts +0 -20
  469. package/dist/core/secret-redaction.js +0 -98
  470. package/dist/core/secret-redaction.js.map +0 -1
  471. package/dist/core/session-process.d.ts +0 -42
  472. package/dist/core/session-process.js +0 -360
  473. package/dist/core/session-process.js.map +0 -1
  474. package/dist/core/shell-env.d.ts +0 -17
  475. package/dist/core/shell-env.js +0 -51
  476. package/dist/core/shell-env.js.map +0 -1
  477. package/dist/core/ui-events.d.ts +0 -348
  478. package/dist/core/ui-events.js +0 -2
  479. package/dist/core/ui-events.js.map +0 -1
  480. package/dist/core/usage-limit.d.ts +0 -42
  481. package/dist/core/usage-limit.js +0 -152
  482. package/dist/core/usage-limit.js.map +0 -1
  483. package/dist/core/usage.d.ts +0 -11
  484. package/dist/core/usage.js +0 -15
  485. package/dist/core/usage.js.map +0 -1
  486. package/dist/core/v1-text-coalescer.d.ts +0 -36
  487. package/dist/core/v1-text-coalescer.js +0 -72
  488. package/dist/core/v1-text-coalescer.js.map +0 -1
  489. package/dist/data-gitignore.d.ts +0 -6
  490. package/dist/data-gitignore.js +0 -59
  491. package/dist/data-gitignore.js.map +0 -1
  492. package/dist/delegation/capacity.d.ts +0 -15
  493. package/dist/delegation/capacity.js +0 -30
  494. package/dist/delegation/capacity.js.map +0 -1
  495. package/dist/delegation/cli.d.ts +0 -4
  496. package/dist/delegation/cli.js +0 -481
  497. package/dist/delegation/cli.js.map +0 -1
  498. package/dist/delegation/context.d.ts +0 -40
  499. package/dist/delegation/context.js +0 -378
  500. package/dist/delegation/context.js.map +0 -1
  501. package/dist/delegation/conversations.d.ts +0 -9
  502. package/dist/delegation/conversations.js +0 -66
  503. package/dist/delegation/conversations.js.map +0 -1
  504. package/dist/delegation/credentials.d.ts +0 -21
  505. package/dist/delegation/credentials.js +0 -66
  506. package/dist/delegation/credentials.js.map +0 -1
  507. package/dist/delegation/destroy-observation.d.ts +0 -42
  508. package/dist/delegation/destroy-observation.js +0 -115
  509. package/dist/delegation/destroy-observation.js.map +0 -1
  510. package/dist/delegation/effort.d.ts +0 -1
  511. package/dist/delegation/effort.js +0 -11
  512. package/dist/delegation/effort.js.map +0 -1
  513. package/dist/delegation/execution-identity.d.ts +0 -180
  514. package/dist/delegation/execution-identity.js +0 -154
  515. package/dist/delegation/execution-identity.js.map +0 -1
  516. package/dist/delegation/idle-test-app.d.ts +0 -4
  517. package/dist/delegation/idle-test-app.js +0 -174
  518. package/dist/delegation/idle-test-app.js.map +0 -1
  519. package/dist/delegation/input.d.ts +0 -12
  520. package/dist/delegation/input.js +0 -50
  521. package/dist/delegation/input.js.map +0 -1
  522. package/dist/delegation/park-notice.d.ts +0 -42
  523. package/dist/delegation/park-notice.js +0 -71
  524. package/dist/delegation/park-notice.js.map +0 -1
  525. package/dist/delegation/policy.d.ts +0 -22
  526. package/dist/delegation/policy.js +0 -95
  527. package/dist/delegation/policy.js.map +0 -1
  528. package/dist/delegation/process-liveness.d.ts +0 -98
  529. package/dist/delegation/process-liveness.js +0 -213
  530. package/dist/delegation/process-liveness.js.map +0 -1
  531. package/dist/delegation/provision.d.ts +0 -32
  532. package/dist/delegation/provision.js +0 -177
  533. package/dist/delegation/provision.js.map +0 -1
  534. package/dist/delegation/questions.d.ts +0 -21
  535. package/dist/delegation/questions.js +0 -50
  536. package/dist/delegation/questions.js.map +0 -1
  537. package/dist/delegation/readiness.d.ts +0 -13
  538. package/dist/delegation/readiness.js +0 -19
  539. package/dist/delegation/readiness.js.map +0 -1
  540. package/dist/delegation/results.d.ts +0 -13
  541. package/dist/delegation/results.js +0 -154
  542. package/dist/delegation/results.js.map +0 -1
  543. package/dist/delegation/retry-backoff.d.ts +0 -31
  544. package/dist/delegation/retry-backoff.js +0 -26
  545. package/dist/delegation/retry-backoff.js.map +0 -1
  546. package/dist/delegation/routes.d.ts +0 -953
  547. package/dist/delegation/routes.js +0 -74
  548. package/dist/delegation/routes.js.map +0 -1
  549. package/dist/delegation/scratch-cleanup.d.ts +0 -28
  550. package/dist/delegation/scratch-cleanup.js +0 -145
  551. package/dist/delegation/scratch-cleanup.js.map +0 -1
  552. package/dist/delegation/service.d.ts +0 -211
  553. package/dist/delegation/service.js +0 -946
  554. package/dist/delegation/service.js.map +0 -1
  555. package/dist/delegation/transport.d.ts +0 -931
  556. package/dist/delegation/transport.js +0 -22
  557. package/dist/delegation/transport.js.map +0 -1
  558. package/dist/delegation/wait.d.ts +0 -14
  559. package/dist/delegation/wait.js +0 -72
  560. package/dist/delegation/wait.js.map +0 -1
  561. package/dist/delegation/windows-test-app.d.ts +0 -5
  562. package/dist/delegation/windows-test-app.js +0 -63
  563. package/dist/delegation/windows-test-app.js.map +0 -1
  564. package/dist/delegation/windows-workspace-identity.d.ts +0 -3
  565. package/dist/delegation/windows-workspace-identity.js +0 -22
  566. package/dist/delegation/windows-workspace-identity.js.map +0 -1
  567. package/dist/delegation/workspace.d.ts +0 -33
  568. package/dist/delegation/workspace.js +0 -556
  569. package/dist/delegation/workspace.js.map +0 -1
  570. package/dist/detached-process.d.ts +0 -103
  571. package/dist/detached-process.js +0 -301
  572. package/dist/detached-process.js.map +0 -1
  573. package/dist/discovery/catalog.d.ts +0 -15
  574. package/dist/discovery/catalog.js +0 -31
  575. package/dist/discovery/catalog.js.map +0 -1
  576. package/dist/discovery/cli.d.ts +0 -8
  577. package/dist/discovery/cli.js +0 -106
  578. package/dist/discovery/cli.js.map +0 -1
  579. package/dist/git-diff-base.d.ts +0 -41
  580. package/dist/git-diff-base.js +0 -116
  581. package/dist/git-diff-base.js.map +0 -1
  582. package/dist/git-index-copy.d.ts +0 -4
  583. package/dist/git-index-copy.js +0 -10
  584. package/dist/git-index-copy.js.map +0 -1
  585. package/dist/git-refs.d.ts +0 -11
  586. package/dist/git-refs.js +0 -14
  587. package/dist/git-refs.js.map +0 -1
  588. package/dist/git-worktree-lock-helper.d.ts +0 -7
  589. package/dist/git-worktree-lock-helper.js +0 -158
  590. package/dist/git-worktree-lock-helper.js.map +0 -1
  591. package/dist/git-worktree-lock.d.ts +0 -17
  592. package/dist/git-worktree-lock.js +0 -90
  593. package/dist/git-worktree-lock.js.map +0 -1
  594. package/dist/git-worktree-release.d.ts +0 -20
  595. package/dist/git-worktree-release.js +0 -27
  596. package/dist/git-worktree-release.js.map +0 -1
  597. package/dist/git-worktree.d.ts +0 -154
  598. package/dist/git-worktree.js +0 -858
  599. package/dist/git-worktree.js.map +0 -1
  600. package/dist/handoff.d.ts +0 -72
  601. package/dist/handoff.js +0 -206
  602. package/dist/handoff.js.map +0 -1
  603. package/dist/index.d.ts +0 -2
  604. package/dist/index.js.map +0 -1
  605. package/dist/install-as-command.d.ts +0 -40
  606. package/dist/install-as-command.js +0 -52
  607. package/dist/install-as-command.js.map +0 -1
  608. package/dist/merge-observations.d.ts +0 -13
  609. package/dist/merge-observations.js +0 -55
  610. package/dist/merge-observations.js.map +0 -1
  611. package/dist/open-url.d.ts +0 -2
  612. package/dist/open-url.js +0 -10
  613. package/dist/open-url.js.map +0 -1
  614. package/dist/pack-check.d.ts +0 -17
  615. package/dist/pack-check.js +0 -27
  616. package/dist/pack-check.js.map +0 -1
  617. package/dist/paths.d.ts +0 -138
  618. package/dist/paths.js +0 -220
  619. package/dist/paths.js.map +0 -1
  620. package/dist/planner.d.ts +0 -28
  621. package/dist/planner.js +0 -271
  622. package/dist/planner.js.map +0 -1
  623. package/dist/preview/agent-address.d.ts +0 -34
  624. package/dist/preview/agent-address.js +0 -51
  625. package/dist/preview/agent-address.js.map +0 -1
  626. package/dist/preview/agent-marker.d.ts +0 -17
  627. package/dist/preview/agent-marker.js +0 -71
  628. package/dist/preview/agent-marker.js.map +0 -1
  629. package/dist/preview/cdp-proxy.d.ts +0 -54
  630. package/dist/preview/cdp-proxy.js +0 -151
  631. package/dist/preview/cdp-proxy.js.map +0 -1
  632. package/dist/preview/cdp.d.ts +0 -49
  633. package/dist/preview/cdp.js +0 -167
  634. package/dist/preview/cdp.js.map +0 -1
  635. package/dist/preview/chromium.d.ts +0 -87
  636. package/dist/preview/chromium.js +0 -481
  637. package/dist/preview/chromium.js.map +0 -1
  638. package/dist/preview/dev-server.d.ts +0 -68
  639. package/dist/preview/dev-server.js +0 -317
  640. package/dist/preview/dev-server.js.map +0 -1
  641. package/dist/preview/host.d.ts +0 -221
  642. package/dist/preview/host.js +0 -967
  643. package/dist/preview/host.js.map +0 -1
  644. package/dist/preview/registration.d.ts +0 -68
  645. package/dist/preview/registration.js +0 -111
  646. package/dist/preview/registration.js.map +0 -1
  647. package/dist/preview/session.d.ts +0 -75
  648. package/dist/preview/session.js +0 -357
  649. package/dist/preview/session.js.map +0 -1
  650. package/dist/preview/url.d.ts +0 -6
  651. package/dist/preview/url.js +0 -17
  652. package/dist/preview/url.js.map +0 -1
  653. package/dist/process-wait/exit-file.d.ts +0 -29
  654. package/dist/process-wait/exit-file.js +0 -67
  655. package/dist/process-wait/exit-file.js.map +0 -1
  656. package/dist/process-wait/supervisor.d.ts +0 -30
  657. package/dist/process-wait/supervisor.js +0 -71
  658. package/dist/process-wait/supervisor.js.map +0 -1
  659. package/dist/release/manifests.d.ts +0 -103
  660. package/dist/release/manifests.js +0 -90
  661. package/dist/release/manifests.js.map +0 -1
  662. package/dist/release/snapshot.d.ts +0 -67
  663. package/dist/release/snapshot.js +0 -97
  664. package/dist/release/snapshot.js.map +0 -1
  665. package/dist/release/stable.d.ts +0 -38
  666. package/dist/release/stable.js +0 -55
  667. package/dist/release/stable.js.map +0 -1
  668. package/dist/runs/agent-tmpdir-removal.d.ts +0 -15
  669. package/dist/runs/agent-tmpdir-removal.js +0 -60
  670. package/dist/runs/agent-tmpdir-removal.js.map +0 -1
  671. package/dist/runs/agent-tmpdir.d.ts +0 -119
  672. package/dist/runs/agent-tmpdir.js +0 -829
  673. package/dist/runs/agent-tmpdir.js.map +0 -1
  674. package/dist/runs/arm-repo-handle.d.ts +0 -9
  675. package/dist/runs/arm-repo-handle.js +0 -45
  676. package/dist/runs/arm-repo-handle.js.map +0 -1
  677. package/dist/runs/auto-name.d.ts +0 -75
  678. package/dist/runs/auto-name.js +0 -179
  679. package/dist/runs/auto-name.js.map +0 -1
  680. package/dist/runs/client-request.d.ts +0 -11
  681. package/dist/runs/client-request.js +0 -26
  682. package/dist/runs/client-request.js.map +0 -1
  683. package/dist/runs/delegation-state.d.ts +0 -400
  684. package/dist/runs/delegation-state.js +0 -22
  685. package/dist/runs/delegation-state.js.map +0 -1
  686. package/dist/runs/event-history-agent-context.d.ts +0 -14
  687. package/dist/runs/event-history-agent-context.js +0 -105
  688. package/dist/runs/event-history-agent-context.js.map +0 -1
  689. package/dist/runs/event-history-context.d.ts +0 -15
  690. package/dist/runs/event-history-context.js +0 -109
  691. package/dist/runs/event-history-context.js.map +0 -1
  692. package/dist/runs/event-history.d.ts +0 -53
  693. package/dist/runs/event-history.js +0 -535
  694. package/dist/runs/event-history.js.map +0 -1
  695. package/dist/runs/history-compressor.d.ts +0 -29
  696. package/dist/runs/history-compressor.js +0 -116
  697. package/dist/runs/history-compressor.js.map +0 -1
  698. package/dist/runs/history-file.d.ts +0 -36
  699. package/dist/runs/history-file.js +0 -463
  700. package/dist/runs/history-file.js.map +0 -1
  701. package/dist/runs/history-stream.d.ts +0 -2
  702. package/dist/runs/history-stream.js +0 -62
  703. package/dist/runs/history-stream.js.map +0 -1
  704. package/dist/runs/legacy-index.d.ts +0 -49
  705. package/dist/runs/legacy-index.js +0 -155
  706. package/dist/runs/legacy-index.js.map +0 -1
  707. package/dist/runs/live-item-snapshots.d.ts +0 -13
  708. package/dist/runs/live-item-snapshots.js +0 -79
  709. package/dist/runs/live-item-snapshots.js.map +0 -1
  710. package/dist/runs/loaded-run-healing.d.ts +0 -3
  711. package/dist/runs/loaded-run-healing.js +0 -17
  712. package/dist/runs/loaded-run-healing.js.map +0 -1
  713. package/dist/runs/outcome-commit.d.ts +0 -98
  714. package/dist/runs/outcome-commit.js +0 -132
  715. package/dist/runs/outcome-commit.js.map +0 -1
  716. package/dist/runs/pull-requests.d.ts +0 -14
  717. package/dist/runs/pull-requests.js +0 -96
  718. package/dist/runs/pull-requests.js.map +0 -1
  719. package/dist/runs/raw-record.d.ts +0 -40
  720. package/dist/runs/raw-record.js +0 -133
  721. package/dist/runs/raw-record.js.map +0 -1
  722. package/dist/runs/retention.d.ts +0 -91
  723. package/dist/runs/retention.js +0 -182
  724. package/dist/runs/retention.js.map +0 -1
  725. package/dist/runs/review-gate.d.ts +0 -18
  726. package/dist/runs/review-gate.js +0 -21
  727. package/dist/runs/review-gate.js.map +0 -1
  728. package/dist/runs/run-claims.d.ts +0 -16
  729. package/dist/runs/run-claims.js +0 -24
  730. package/dist/runs/run-claims.js.map +0 -1
  731. package/dist/runs/run-database.d.ts +0 -380
  732. package/dist/runs/run-database.js +0 -1008
  733. package/dist/runs/run-database.js.map +0 -1
  734. package/dist/runs/run-index.d.ts +0 -26
  735. package/dist/runs/run-index.js +0 -212
  736. package/dist/runs/run-index.js.map +0 -1
  737. package/dist/runs/run-row.d.ts +0 -15
  738. package/dist/runs/run-row.js +0 -59
  739. package/dist/runs/run-row.js.map +0 -1
  740. package/dist/runs/store-open-error.d.ts +0 -24
  741. package/dist/runs/store-open-error.js +0 -61
  742. package/dist/runs/store-open-error.js.map +0 -1
  743. package/dist/runs/store.d.ts +0 -3090
  744. package/dist/runs/store.js +0 -4693
  745. package/dist/runs/store.js.map +0 -1
  746. package/dist/runs/task-markers.d.ts +0 -29
  747. package/dist/runs/task-markers.js +0 -78
  748. package/dist/runs/task-markers.js.map +0 -1
  749. package/dist/runs/task-refs.d.ts +0 -25
  750. package/dist/runs/task-refs.js +0 -74
  751. package/dist/runs/task-refs.js.map +0 -1
  752. package/dist/runs/transcript-facts-fold.d.ts +0 -64
  753. package/dist/runs/transcript-facts-fold.js +0 -109
  754. package/dist/runs/transcript-facts-fold.js.map +0 -1
  755. package/dist/runs/transcript-facts-load.d.ts +0 -11
  756. package/dist/runs/transcript-facts-load.js +0 -66
  757. package/dist/runs/transcript-facts-load.js.map +0 -1
  758. package/dist/runs/transcript-facts-queue.d.ts +0 -30
  759. package/dist/runs/transcript-facts-queue.js +0 -227
  760. package/dist/runs/transcript-facts-queue.js.map +0 -1
  761. package/dist/runs/transcript-facts-worker.d.ts +0 -15
  762. package/dist/runs/transcript-facts-worker.js +0 -26
  763. package/dist/runs/transcript-facts-worker.js.map +0 -1
  764. package/dist/runs/transcript-facts.d.ts +0 -39
  765. package/dist/runs/transcript-facts.js +0 -186
  766. package/dist/runs/transcript-facts.js.map +0 -1
  767. package/dist/runs/ui-event-sink.d.ts +0 -56
  768. package/dist/runs/ui-event-sink.js +0 -188
  769. package/dist/runs/ui-event-sink.js.map +0 -1
  770. package/dist/runs/webhook.d.ts +0 -191
  771. package/dist/runs/webhook.js +0 -360
  772. package/dist/runs/webhook.js.map +0 -1
  773. package/dist/runs/worker-execution.d.ts +0 -22
  774. package/dist/runs/worker-execution.js +0 -30
  775. package/dist/runs/worker-execution.js.map +0 -1
  776. package/dist/server/app-type.js.map +0 -1
  777. package/dist/server/archive-on-merge.d.ts +0 -35
  778. package/dist/server/archive-on-merge.js +0 -202
  779. package/dist/server/archive-on-merge.js.map +0 -1
  780. package/dist/server/capabilities.d.ts +0 -59
  781. package/dist/server/capabilities.js +0 -141
  782. package/dist/server/capabilities.js.map +0 -1
  783. package/dist/server/checkout-progress.d.ts +0 -10
  784. package/dist/server/checkout-progress.js +0 -27
  785. package/dist/server/checkout-progress.js.map +0 -1
  786. package/dist/server/checkout.d.ts +0 -129
  787. package/dist/server/checkout.js +0 -304
  788. package/dist/server/checkout.js.map +0 -1
  789. package/dist/server/cockpit-ownership.d.ts +0 -31
  790. package/dist/server/cockpit-ownership.js +0 -191
  791. package/dist/server/cockpit-ownership.js.map +0 -1
  792. package/dist/server/cold-repo-handles.d.ts +0 -14
  793. package/dist/server/cold-repo-handles.js +0 -78
  794. package/dist/server/cold-repo-handles.js.map +0 -1
  795. package/dist/server/completion-actions.d.ts +0 -30
  796. package/dist/server/completion-actions.js +0 -204
  797. package/dist/server/completion-actions.js.map +0 -1
  798. package/dist/server/create-project.d.ts +0 -71
  799. package/dist/server/create-project.js +0 -448
  800. package/dist/server/create-project.js.map +0 -1
  801. package/dist/server/forge/github-filters.d.ts +0 -22
  802. package/dist/server/forge/github-filters.js +0 -127
  803. package/dist/server/forge/github-filters.js.map +0 -1
  804. package/dist/server/forge/github-merge-requirements.d.ts +0 -18
  805. package/dist/server/forge/github-merge-requirements.js +0 -137
  806. package/dist/server/forge/github-merge-requirements.js.map +0 -1
  807. package/dist/server/forge/github.d.ts +0 -535
  808. package/dist/server/forge/github.js +0 -3200
  809. package/dist/server/forge/github.js.map +0 -1
  810. package/dist/server/forge/index.d.ts +0 -40
  811. package/dist/server/forge/index.js +0 -72
  812. package/dist/server/forge/index.js.map +0 -1
  813. package/dist/server/forge/types.d.ts +0 -244
  814. package/dist/server/forge/types.js +0 -2
  815. package/dist/server/forge/types.js.map +0 -1
  816. package/dist/server/fs-browse.d.ts +0 -80
  817. package/dist/server/fs-browse.js +0 -182
  818. package/dist/server/fs-browse.js.map +0 -1
  819. package/dist/server/git-changes.d.ts +0 -203
  820. package/dist/server/git-changes.js +0 -508
  821. package/dist/server/git-changes.js.map +0 -1
  822. package/dist/server/git.d.ts +0 -52
  823. package/dist/server/git.js +0 -170
  824. package/dist/server/git.js.map +0 -1
  825. package/dist/server/github.d.ts +0 -9
  826. package/dist/server/github.js +0 -8
  827. package/dist/server/github.js.map +0 -1
  828. package/dist/server/launch-key.d.ts +0 -5
  829. package/dist/server/launch-key.js +0 -31
  830. package/dist/server/launch-key.js.map +0 -1
  831. package/dist/server/live-routes.d.ts +0 -68
  832. package/dist/server/live-routes.js +0 -147
  833. package/dist/server/live-routes.js.map +0 -1
  834. package/dist/server/open-in-app.d.ts +0 -57
  835. package/dist/server/open-in-app.js +0 -177
  836. package/dist/server/open-in-app.js.map +0 -1
  837. package/dist/server/open-in-targets.d.ts +0 -42
  838. package/dist/server/open-in-targets.js +0 -110
  839. package/dist/server/open-in-targets.js.map +0 -1
  840. package/dist/server/open-in-terminal.d.ts +0 -73
  841. package/dist/server/open-in-terminal.js +0 -159
  842. package/dist/server/open-in-terminal.js.map +0 -1
  843. package/dist/server/pr.d.ts +0 -7
  844. package/dist/server/pr.js +0 -7
  845. package/dist/server/pr.js.map +0 -1
  846. package/dist/server/preview-cdp-socket.d.ts +0 -21
  847. package/dist/server/preview-cdp-socket.js +0 -112
  848. package/dist/server/preview-cdp-socket.js.map +0 -1
  849. package/dist/server/preview-socket.d.ts +0 -36
  850. package/dist/server/preview-socket.js +0 -126
  851. package/dist/server/preview-socket.js.map +0 -1
  852. package/dist/server/preview-sockets.d.ts +0 -14
  853. package/dist/server/preview-sockets.js +0 -18
  854. package/dist/server/preview-sockets.js.map +0 -1
  855. package/dist/server/project-context.d.ts +0 -192
  856. package/dist/server/project-context.js +0 -444
  857. package/dist/server/project-context.js.map +0 -1
  858. package/dist/server/provider-action-gate.d.ts +0 -5
  859. package/dist/server/provider-action-gate.js +0 -27
  860. package/dist/server/provider-action-gate.js.map +0 -1
  861. package/dist/server/provider-auth-runtime.d.ts +0 -32
  862. package/dist/server/provider-auth-runtime.js +0 -116
  863. package/dist/server/provider-auth-runtime.js.map +0 -1
  864. package/dist/server/repo-branches.d.ts +0 -99
  865. package/dist/server/repo-branches.js +0 -620
  866. package/dist/server/repo-branches.js.map +0 -1
  867. package/dist/server/repo-pull.d.ts +0 -18
  868. package/dist/server/repo-pull.js +0 -96
  869. package/dist/server/repo-pull.js.map +0 -1
  870. package/dist/server/run-event-feed.d.ts +0 -20
  871. package/dist/server/run-event-feed.js +0 -190
  872. package/dist/server/run-event-feed.js.map +0 -1
  873. package/dist/server/server-deps.d.ts +0 -37
  874. package/dist/server/server-deps.js +0 -114
  875. package/dist/server/server-deps.js.map +0 -1
  876. package/dist/server/server.d.ts +0 -28587
  877. package/dist/server/server.js +0 -5466
  878. package/dist/server/server.js.map +0 -1
  879. package/dist/server/start-run-options.d.ts +0 -82
  880. package/dist/server/start-run-options.js +0 -111
  881. package/dist/server/start-run-options.js.map +0 -1
  882. package/dist/server/static-ui.d.ts +0 -49
  883. package/dist/server/static-ui.js +0 -98
  884. package/dist/server/static-ui.js.map +0 -1
  885. package/dist/server/upgrade-router.d.ts +0 -23
  886. package/dist/server/upgrade-router.js +0 -53
  887. package/dist/server/upgrade-router.js.map +0 -1
  888. package/dist/server/validators.d.ts +0 -80
  889. package/dist/server/validators.js +0 -85
  890. package/dist/server/validators.js.map +0 -1
  891. package/dist/server/ws.d.ts +0 -65
  892. package/dist/server/ws.js +0 -200
  893. package/dist/server/ws.js.map +0 -1
  894. package/dist/server/wsl.d.ts +0 -25
  895. package/dist/server/wsl.js +0 -92
  896. package/dist/server/wsl.js.map +0 -1
  897. package/dist/server-install/engine.d.ts +0 -47
  898. package/dist/server-install/engine.js +0 -317
  899. package/dist/server-install/engine.js.map +0 -1
  900. package/dist/server-install/npx-cache.d.ts +0 -36
  901. package/dist/server-install/npx-cache.js +0 -104
  902. package/dist/server-install/npx-cache.js.map +0 -1
  903. package/dist/server-install/platforms/macosx-ngrok.d.ts +0 -6
  904. package/dist/server-install/platforms/macosx-ngrok.js +0 -371
  905. package/dist/server-install/platforms/macosx-ngrok.js.map +0 -1
  906. package/dist/server-install/platforms/ubuntu-vps.d.ts +0 -54
  907. package/dist/server-install/platforms/ubuntu-vps.js +0 -1066
  908. package/dist/server-install/platforms/ubuntu-vps.js.map +0 -1
  909. package/dist/server-install/state.d.ts +0 -50
  910. package/dist/server-install/state.js +0 -180
  911. package/dist/server-install/state.js.map +0 -1
  912. package/dist/server-install/steps.d.ts +0 -108
  913. package/dist/server-install/steps.js +0 -332
  914. package/dist/server-install/steps.js.map +0 -1
  915. package/dist/server-install/strategies.d.ts +0 -4
  916. package/dist/server-install/strategies.js +0 -20
  917. package/dist/server-install/strategies.js.map +0 -1
  918. package/dist/server-install/types.d.ts +0 -284
  919. package/dist/server-install/types.js +0 -118
  920. package/dist/server-install/types.js.map +0 -1
  921. package/dist/server-install/ui.d.ts +0 -36
  922. package/dist/server-install/ui.js +0 -130
  923. package/dist/server-install/ui.js.map +0 -1
  924. package/dist/session-context.d.ts +0 -64
  925. package/dist/session-context.js +0 -264
  926. package/dist/session-context.js.map +0 -1
  927. package/dist/skills-provision.d.ts +0 -62
  928. package/dist/skills-provision.js +0 -325
  929. package/dist/skills-provision.js.map +0 -1
  930. package/dist/skills-remote.d.ts +0 -129
  931. package/dist/skills-remote.js +0 -782
  932. package/dist/skills-remote.js.map +0 -1
  933. package/dist/skills.d.ts +0 -71
  934. package/dist/skills.js +0 -249
  935. package/dist/skills.js.map +0 -1
  936. package/dist/subcommands.d.ts +0 -11
  937. package/dist/subcommands.js +0 -24
  938. package/dist/subcommands.js.map +0 -1
  939. package/dist/task-cli/cli.d.ts +0 -38
  940. package/dist/task-cli/cli.js +0 -710
  941. package/dist/task-cli/cli.js.map +0 -1
  942. package/dist/task-cli/discovery.d.ts +0 -25
  943. package/dist/task-cli/discovery.js +0 -98
  944. package/dist/task-cli/discovery.js.map +0 -1
  945. package/dist/task-cli/hint.d.ts +0 -20
  946. package/dist/task-cli/hint.js +0 -14
  947. package/dist/task-cli/hint.js.map +0 -1
  948. package/dist/task-cli/http.d.ts +0 -49
  949. package/dist/task-cli/http.js +0 -109
  950. package/dist/task-cli/http.js.map +0 -1
  951. package/dist/task-cli/projections.d.ts +0 -68
  952. package/dist/task-cli/projections.js +0 -76
  953. package/dist/task-cli/projections.js.map +0 -1
  954. package/dist/task-cli/watch.d.ts +0 -119
  955. package/dist/task-cli/watch.js +0 -475
  956. package/dist/task-cli/watch.js.map +0 -1
  957. package/dist/ui-state.d.ts +0 -41
  958. package/dist/ui-state.js +0 -90
  959. package/dist/ui-state.js.map +0 -1
  960. package/dist/update-check.d.ts +0 -2
  961. package/dist/update-check.js +0 -26
  962. package/dist/update-check.js.map +0 -1
  963. package/dist/voice/decide.d.ts +0 -32
  964. package/dist/voice/decide.js +0 -297
  965. package/dist/voice/decide.js.map +0 -1
  966. package/dist/voice/decision-log.d.ts +0 -52
  967. package/dist/voice/decision-log.js +0 -107
  968. package/dist/voice/decision-log.js.map +0 -1
  969. package/dist/voice/engine.d.ts +0 -119
  970. package/dist/voice/engine.js +0 -60
  971. package/dist/voice/engine.js.map +0 -1
  972. package/dist/voice/fake-engine.d.ts +0 -10
  973. package/dist/voice/fake-engine.js +0 -192
  974. package/dist/voice/fake-engine.js.map +0 -1
  975. package/dist/voice/jev-engine.d.ts +0 -17
  976. package/dist/voice/jev-engine.js +0 -110
  977. package/dist/voice/jev-engine.js.map +0 -1
  978. package/dist/voice/pending-ask.d.ts +0 -17
  979. package/dist/voice/pending-ask.js +0 -50
  980. package/dist/voice/pending-ask.js.map +0 -1
  981. package/dist/voice/routes.d.ts +0 -115
  982. package/dist/voice/routes.js +0 -91
  983. package/dist/voice/routes.js.map +0 -1
  984. package/dist/voice/sentence.d.ts +0 -21
  985. package/dist/voice/sentence.js +0 -61
  986. package/dist/voice/sentence.js.map +0 -1
  987. package/dist/voice/thresholds.d.ts +0 -28
  988. package/dist/voice/thresholds.js +0 -29
  989. package/dist/voice/thresholds.js.map +0 -1
  990. package/dist/webhooks/cli.d.ts +0 -18
  991. package/dist/webhooks/cli.js +0 -145
  992. package/dist/webhooks/cli.js.map +0 -1
  993. package/dist/webhooks/prompt.d.ts +0 -5
  994. package/dist/webhooks/prompt.js +0 -26
  995. package/dist/webhooks/prompt.js.map +0 -1
  996. package/dist/workflows/active-run.d.ts +0 -167
  997. package/dist/workflows/active-run.js +0 -21
  998. package/dist/workflows/active-run.js.map +0 -1
  999. package/dist/workflows/attachment-path.d.ts +0 -6
  1000. package/dist/workflows/attachment-path.js +0 -40
  1001. package/dist/workflows/attachment-path.js.map +0 -1
  1002. package/dist/workflows/continuation-admission.d.ts +0 -913
  1003. package/dist/workflows/continuation-admission.js +0 -265
  1004. package/dist/workflows/continuation-admission.js.map +0 -1
  1005. package/dist/workflows/execution-account.d.ts +0 -13
  1006. package/dist/workflows/execution-account.js +0 -18
  1007. package/dist/workflows/execution-account.js.map +0 -1
  1008. package/dist/workflows/grouped-command.d.ts +0 -31
  1009. package/dist/workflows/grouped-command.js +0 -143
  1010. package/dist/workflows/grouped-command.js.map +0 -1
  1011. package/dist/workflows/input-acknowledgement.d.ts +0 -152
  1012. package/dist/workflows/input-acknowledgement.js +0 -38
  1013. package/dist/workflows/input-acknowledgement.js.map +0 -1
  1014. package/dist/workflows/line-order.d.ts +0 -5
  1015. package/dist/workflows/line-order.js +0 -25
  1016. package/dist/workflows/line-order.js.map +0 -1
  1017. package/dist/workflows/load.d.ts +0 -17
  1018. package/dist/workflows/load.js +0 -61
  1019. package/dist/workflows/load.js.map +0 -1
  1020. package/dist/workflows/outcome-batches.d.ts +0 -20
  1021. package/dist/workflows/outcome-batches.js +0 -25
  1022. package/dist/workflows/outcome-batches.js.map +0 -1
  1023. package/dist/workflows/question-routing.d.ts +0 -8
  1024. package/dist/workflows/question-routing.js +0 -18
  1025. package/dist/workflows/question-routing.js.map +0 -1
  1026. package/dist/workflows/run-scheduling.d.ts +0 -35
  1027. package/dist/workflows/run-scheduling.js +0 -61
  1028. package/dist/workflows/run-scheduling.js.map +0 -1
  1029. package/dist/workflows/run-states.d.ts +0 -190
  1030. package/dist/workflows/run-states.js +0 -295
  1031. package/dist/workflows/run-states.js.map +0 -1
  1032. package/dist/workflows/run.d.ts +0 -2405
  1033. package/dist/workflows/run.js +0 -10745
  1034. package/dist/workflows/run.js.map +0 -1
  1035. package/dist/workflows/turn-end.d.ts +0 -116
  1036. package/dist/workflows/turn-end.js +0 -68
  1037. package/dist/workflows/turn-end.js.map +0 -1
  1038. package/dist/workflows/types.d.ts +0 -83
  1039. package/dist/workflows/types.js +0 -192
  1040. package/dist/workflows/types.js.map +0 -1
  1041. package/dist/workflows/waits.d.ts +0 -74
  1042. package/dist/workflows/waits.js +0 -197
  1043. package/dist/workflows/waits.js.map +0 -1
  1044. package/dist/workspace/agent-accounts.d.ts +0 -128
  1045. package/dist/workspace/agent-accounts.js +0 -280
  1046. package/dist/workspace/agent-accounts.js.map +0 -1
  1047. package/dist/workspace/agent-profiles.d.ts +0 -124
  1048. package/dist/workspace/agent-profiles.js +0 -190
  1049. package/dist/workspace/agent-profiles.js.map +0 -1
  1050. package/dist/workspace/config.d.ts +0 -181
  1051. package/dist/workspace/config.js +0 -389
  1052. package/dist/workspace/config.js.map +0 -1
  1053. package/dist/workspace/migrations.d.ts +0 -35
  1054. package/dist/workspace/migrations.js +0 -147
  1055. package/dist/workspace/migrations.js.map +0 -1
  1056. package/dist/workspace/projects-cli.d.ts +0 -25
  1057. package/dist/workspace/projects-cli.js +0 -172
  1058. package/dist/workspace/projects-cli.js.map +0 -1
  1059. package/dist/workspace/projects.d.ts +0 -129
  1060. package/dist/workspace/projects.js +0 -267
  1061. package/dist/workspace/projects.js.map +0 -1
  1062. package/dist/workspace/semaphore.d.ts +0 -145
  1063. package/dist/workspace/semaphore.js +0 -196
  1064. package/dist/workspace/semaphore.js.map +0 -1
  1065. package/dist/workspace/ui-state.d.ts +0 -36
  1066. package/dist/workspace/ui-state.js +0 -55
  1067. package/dist/workspace/ui-state.js.map +0 -1
  1068. package/dist/workspace/webhooks.d.ts +0 -40
  1069. package/dist/workspace/webhooks.js +0 -146
  1070. package/dist/workspace/webhooks.js.map +0 -1
  1071. package/dist/worktree-manifest.d.ts +0 -165
  1072. package/dist/worktree-manifest.js +0 -530
  1073. package/dist/worktree-manifest.js.map +0 -1
  1074. package/dist/worktree-setup.d.ts +0 -85
  1075. package/dist/worktree-setup.js +0 -164
  1076. package/dist/worktree-setup.js.map +0 -1
  1077. package/scripts/benchmark-run-store-fixture.ts +0 -432
  1078. package/scripts/benchmark-run-store.ts +0 -743
  1079. package/scripts/benchmark-stuck-destroys.ts +0 -143
  1080. package/scripts/check-pack.mjs +0 -48
  1081. package/scripts/inline-contract.mjs +0 -165
  1082. package/scripts/install-as-command.mjs +0 -122
  1083. package/scripts/measure-transcript-facts-health.mjs +0 -87
  1084. package/scripts/measure-transcript-facts-lag.mjs +0 -68
  1085. package/scripts/mock-autonomous.mjs +0 -11
  1086. package/scripts/mock-ci-tool.mjs +0 -111
  1087. package/scripts/mock-claude-model-refusal.mjs +0 -42
  1088. package/scripts/mock-claude.mjs +0 -1065
  1089. package/scripts/mock-codex-app-server.mjs +0 -905
  1090. package/scripts/mock-codex-coalesce-steer.mjs +0 -59
  1091. package/scripts/mock-codex-reverse-steer.mjs +0 -130
  1092. package/scripts/mock-cursor-acp.mjs +0 -423
  1093. package/scripts/mock-cursor-hang-stdin-late.mjs +0 -35
  1094. package/scripts/mock-cursor-hang-stdin.mjs +0 -30
  1095. package/scripts/mock-cursor-print.mjs +0 -256
  1096. package/scripts/mock-deferred-turn-start.mjs +0 -16
  1097. package/scripts/mock-delivery-control.d.mts +0 -23
  1098. package/scripts/mock-delivery-control.mjs +0 -80
  1099. package/scripts/mock-env-record.mjs +0 -11
  1100. package/scripts/mock-failure-control.d.mts +0 -13
  1101. package/scripts/mock-failure-control.mjs +0 -68
  1102. package/scripts/mock-multi-pr.mjs +0 -7
  1103. package/scripts/mock-nudge.mjs +0 -45
  1104. package/scripts/mock-omp-rpc.mjs +0 -779
  1105. package/scripts/mock-opencode-serve.mjs +0 -1230
  1106. package/scripts/mock-pi-rpc.mjs +0 -698
  1107. package/scripts/mock-runner-crash.mjs +0 -58
  1108. package/scripts/mock-session-context.d.mts +0 -5
  1109. package/scripts/mock-session-context.mjs +0 -56
  1110. package/scripts/mock-silent-tail.mjs +0 -85
  1111. package/scripts/mock-turn-messages.mjs +0 -5
  1112. package/scripts/omp-ci-wait.mjs +0 -29
  1113. package/scripts/omp-restrict-delegation.yml +0 -4
  1114. package/scripts/pi-ci-wait.mjs +0 -17
  1115. package/scripts/pi-default-tools.mjs +0 -22
  1116. package/scripts/pi-project-skills.mjs +0 -59
  1117. package/scripts/pi-retry-degraded-service.mjs +0 -16
  1118. package/scripts/probe-cursor-print.mjs +0 -627
  1119. package/scripts/seed-archive-profile.ts +0 -53
  1120. package/scripts/sync-readme.mjs +0 -20
  1121. package/scripts/test-process-usage.mjs +0 -47
  1122. package/scripts/transcript-facts-fixture.mjs +0 -53
  1123. package/scripts/voice-replay.ts +0 -50
  1124. package/scripts/windows-workspace-identity.cs +0 -208
  1125. package/scripts/windows-workspace-identity.ps1 +0 -10
  1126. package/web/dist/assets/alert-dialog-DfctKUMw.js +0 -1
  1127. package/web/dist/assets/button-CeupvoKG.js +0 -41
  1128. package/web/dist/assets/centered-state-hDsyXrnH.js +0 -1
  1129. package/web/dist/assets/cez-idle-D3aj_9lp.js +0 -1
  1130. package/web/dist/assets/diff-BnIXZK3i2.js +0 -3
  1131. package/web/dist/assets/diff-controls-GewpW9aF.js +0 -1
  1132. package/web/dist/assets/diff-view-Byo7gpvW.js +0 -11
  1133. package/web/dist/assets/dropdown-menu-COj_J5wd.js +0 -6
  1134. package/web/dist/assets/git-toolbar-DY0z0n4S.js +0 -1
  1135. package/web/dist/assets/github-DwU6ALRK.js +0 -1
  1136. package/web/dist/assets/index-BOfE8pyD.js +0 -34
  1137. package/web/dist/assets/index-D9HpsmdW.css +0 -1
  1138. package/web/dist/assets/lib-BQXq3kEf.js +0 -1
  1139. package/web/dist/assets/live-protocol-Uce2NwEX.js +0 -64
  1140. package/web/dist/assets/play-CmVAj_fu.js +0 -1
  1141. package/web/dist/assets/popover-D56fhiXj.js +0 -1
  1142. package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +0 -3
  1143. package/web/dist/assets/reference-chip-gQNk-4jc.js +0 -1
  1144. package/web/dist/assets/repo-git-B5ECDUuv.js +0 -1
  1145. package/web/dist/assets/run-header-C0Y1NvEM.js +0 -2
  1146. package/web/dist/assets/skill-empty-hint-oOtzR3v0.js +0 -1
  1147. package/web/dist/assets/skills-DUeTkZ9z.js +0 -1
  1148. package/web/dist/assets/status-dot-1PR0i69P.js +0 -1
  1149. package/web/dist/assets/tab-link-DmWk4l5O.js +0 -1
  1150. package/web/dist/assets/task-changes-DKZXuW89.js +0 -1
  1151. package/web/dist/assets/task-commits-BZ6KxWdF.js +0 -1
  1152. package/web/dist/assets/task-files-DlF7Apcn.js +0 -2
  1153. package/web/dist/assets/task-github-item-CVPo3geZ.js +0 -1
  1154. package/web/dist/assets/task-thread-mm4-ECyo.js +0 -9
  1155. package/web/dist/assets/thread-state-CIw2BlhT.js +0 -4
  1156. package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +0 -1
  1157. package/web/dist/assets/workflows-D8vYD-ql.js +0 -7
  1158. package/web/dist/assets/zoomable-image-CxQSsfcn.js +0 -1
@@ -1,2405 +0,0 @@
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';
7
- import { type PreviewHostLike } from '../preview/registration.ts';
8
- import type { CezarToolHandlers } from '../ci-wait/controller.ts';
9
- import { type WorkerAccountBinding } from '../delegation/execution-identity.ts';
10
- import type { DelegationProvisioner } from '../delegation/provision.ts';
11
- import { type AskRequest } from '../core/ask.ts';
12
- import { type CwdSource } from '../delegation/process-liveness.ts';
13
- import type { RunnerId } 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';
17
- import { type Skill } from '../skills.ts';
18
- import { type QueuedMessage, type RunRecord, type RunStore } from '../runs/store.ts';
19
- import { WorkspaceSemaphore, type AccountHolds } from '../workspace/semaphore.ts';
20
- import type { UiEvent } from '../core/ui-events.ts';
21
- import { type WorkflowDef, type WorkflowStepDef } from './types.ts';
22
- /** An interactive session that hears nothing from the user closes itself. */
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;
30
- /**
31
- * Preserve boundaries between complete assistant text blocks while a turn is
32
- * accumulated for marker parsing. The runners join these same v1 blocks with
33
- * newlines in `AgentRunResult`; matching that contract here prevents a
34
- * trailing `CEZ:TITLE=` block from absorbing later commentary (#623).
35
- */
36
- export declare function appendTurnText(current: string, next: string): string;
37
- export type TurnTail = 'none' | 'visible' | 'silent';
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. */
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;
73
- /** Periodic "cezar autosave" commit in the task worktree (spec 006). */
74
- export declare const AUTOSAVE_INTERVAL_MS = 90000;
75
- export { CHECK_KILL_GRACE_MS, CHECK_TERMINATION_CONFIRM_MS } from './grouped-command.ts';
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
- */
80
- export declare function periodicAutosaveEnabled(env?: NodeJS.ProcessEnv): boolean;
81
- /**
82
- * Explicitly opt out of the repository-root lease for runs that execute in the
83
- * current checkout. This covers explicit worktree opt-out, non-Git degradation,
84
- * and continuations whose worktree cannot be restored (spec 006 hardening, #438).
85
- * This is intentionally unsafe: concurrent agents may overwrite each other's
86
- * files or Git state. Isolated worktree runs are unaffected.
87
- */
88
- export declare function repositoryRootLockDisabled(env?: NodeJS.ProcessEnv): boolean;
89
- export type DelegationExecutionSettings = {
90
- cwd: string;
91
- runner: RunnerId;
92
- model?: string | undefined;
93
- modelIdentity?: string | undefined;
94
- effort?: string | undefined;
95
- agentProfile: string;
96
- accountBinding?: WorkerAccountBinding | undefined;
97
- systemPrompt?: string | undefined;
98
- allowedTools?: string[] | undefined;
99
- bashAllowlist?: string[] | undefined;
100
- };
101
- /** #505: a real steer is read at the harness's next model step; a quiet boundary this long
102
- * with input still unread means the harness will not read it without help. */
103
- export declare const UNREAD_INPUT_GRACE_MS = 30000;
104
- /** #486: recheck a turn-end that deferred close/park only because the harness still held a human follow-up. */
105
- export declare const HELD_HUMAN_INPUT_RECHECK_MS = 250;
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";
128
- /** Bound one unattended session; an explicit Continue starts a new budget. */
129
- export declare const MAX_AUTO_CONTINUES = 40;
130
- export { AUTONOMOUS_NUDGE };
131
- /**
132
- * Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
133
- *
134
- * The wait is the provider's own reset instant plus this grace: resuming AT the boundary races the
135
- * provider's clock (and its rounding), and one failed resume costs the whole window over again.
136
- * Thirty seconds is cheap next to five hours and long enough to be past any sane skew.
137
- */
138
- export declare const AUTO_RESUME_GRACE_MS = 30000;
139
- /**
140
- * Consecutive automatic resumes allowed without a human turn. A resume can only fire after a real
141
- * reset instant, so this is not a throttle — it is the backstop for the pathological case (a
142
- * provider that answers "limit reached, retry now" in a loop), and it is deliberately generous
143
- * enough to sit through a couple of days of five-hour windows.
144
- */
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";
163
- /**
164
- * How long a missed deadline stays worth acting on. The promise is "we pick this up when the
165
- * window reopens" — kept across a restart or an overnight close, which is the case the feature
166
- * exists for. A day later it is no longer that promise: the user has moved on, and a task
167
- * springing back to life is a surprise rather than a service. Such a deadline is retired with a
168
- * note instead of fired, so the only tasks a sweep can revive are ones someone is still waiting on.
169
- */
170
- export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
171
- /**
172
- * How often the queue checks that it is not wedged.
173
- *
174
- * A hold is the only thing in the engine that can make an idle queue CORRECT, so it is also the
175
- * only thing that can make a wedged one look correct. This tick is the way out: cheap (a few
176
- * in-memory checks), unref'd, and it only ever acts when idling has no justification left.
177
- */
178
- export declare const QUEUE_WATCHDOG_MS = 60000;
179
- export interface StartRunInput {
180
- task: string;
181
- model?: string | undefined;
182
- /** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
183
- * Unset = harness default. Same class of override as `model`. */
184
- effort?: string | undefined;
185
- /** Agent backend chosen for this task (GUI). Unset = the config default. */
186
- runner?: RunnerId | undefined;
187
- /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
188
- * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
189
- * survives into resume and Continue, and so the thread can say which account did the work. */
190
- agentProfile?: string | undefined;
191
- /** Attachments pasted into the new-task form — persisted when the run is created and
192
- * delivered once, with the first agent step's opening message. Images ride along as blocks the
193
- * model can view; a file (#950) only ever reaches the agent as the path it was written to. */
194
- images?: PastedContent[] | undefined;
195
- /** Per-run system-prompt override (`POST /api/runs`, programmatic callers).
196
- * Replaces the `config.json` default for this run — see
197
- * `resolveExtraSystemPrompt` for the precedence contract. */
198
- systemPrompt?: string | undefined;
199
- /** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
200
- * working tree instead of an isolated worktree. Undefined/`true` keeps the
201
- * default per-task worktree. */
202
- worktree?: boolean | undefined;
203
- /** Autonomous mode (#autonomous): eligible turn ends auto-continue until done
204
- * or the safety cap. Native asks, input delivery and lifecycle waits still apply. */
205
- autonomous?: boolean | undefined;
206
- archiveWhenDone?: boolean | undefined;
207
- autoMergePr?: boolean | undefined;
208
- /** Task webhook opt-in (#589). Persisted on the record at creation; read from there after. */
209
- notify?: boolean | undefined;
210
- /** Attachments from the queued prompt stack (#472), re-encoded from disk by
211
- * `hydrateQueuedInput` at dequeue. Kept separate from `images` because those
212
- * are persisted into `taskImages` by `startRun()` — folding
213
- * the stack's (already-persisted) files in there would write duplicate files
214
- * and make the task bubble render the stack's images as its own. In-memory
215
- * only: rebuilt from the record on every hydration, never persisted. */
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'];
221
- }
222
- /**
223
- * The effective "extra" system prompt for a run (spec §protocol v2, R2 2.3):
224
- * the per-run override (`POST /api/runs` `systemPrompt`) REPLACES the
225
- * `config.json` default — they are the same knob at two scopes, so the more
226
- * specific one wins outright; they never concatenate. Whichever wins is
227
- * ADDITIVE to the skill body and the handoff contract, which always ride
228
- * along (see `composeSystemPrompt`). Blank strings count as unset.
229
- */
230
- export declare function resolveExtraSystemPrompt(override: string | undefined, configDefault: string | undefined): string | undefined;
231
- /**
232
- * Joins the parts of one agent step's system prompt in fixed order — skill
233
- * body (most task-specific), then the run's extra prompt (user guidance, can
234
- * amend the skill), then the handoff contract (always last, never optional in
235
- * practice). Blank parts drop out; survivors join with the same `\n\n---\n\n`
236
- * divider the skill+handoff composition has always used.
237
- */
238
- export declare function composeSystemPrompt(...parts: Array<string | undefined>): string;
239
- /**
240
- * The directories a spawned agent may reach outside its worktree: the run-state
241
- * folder that holds its handoff file, plus its own temp directory when this run
242
- * got one (#785). Handing an agent a `TMPDIR` its file tools are not allowed to
243
- * write would trade one silent failure for another, so the two travel together;
244
- * under `CEZ_AGENT_TMPDIR=0` there is no per-run directory and the list is
245
- * exactly what it always was.
246
- */
247
- export declare function agentDirectories(runsDir: string, env: Record<string, string>): string[];
248
- /**
249
- * Materialized pasted attachment: the on-disk name/serving-URL pair the
250
- * transcript already used, plus the absolute path that lets the agent
251
- * operate on the file itself — save it, `cp` it, attach it to a GitHub
252
- * issue/PR (#357). `path` is only ever an absolute path under
253
- * `.ai/cezar/runs/<runId>-images/` (see `RunManager.persistAttachment`).
254
- */
255
- /** Inverse of `attachmentExtension` (#472) — a persisted attachment is re-encoded from disk at
256
- * dequeue and needs its media type back. Only ever asked about IMAGE names (a file reaches the
257
- * agent as a path, never as a block), so an unknown extension still answers `image/png`: that is
258
- * the pre-existing fallback for the `.img` an SVG or a BMP paste lands as. */
259
- export declare function mediaTypeFor(name: string): string;
260
- /** Highest `<prefix>-<n>.<ext>` suffix already present in a run's image dir (#472).
261
- * `screenshot-*` and `pasted-*` share one numbering space, so this scans both and
262
- * returns 0 for a missing/empty directory. */
263
- export declare function highestImageSeq(dir: string): number;
264
- export interface PersistedAttachment {
265
- name: string;
266
- url: string;
267
- path: string;
268
- }
269
- /**
270
- * A user attachment that is NOT an image (#950) — a PDF, a `.txt`, a `.md`.
271
- *
272
- * Deliberately not a `ContentBlock` variant: `ContentBlock` is the runner protocol
273
- * (`AGENT_PROTOCOL.md`), and a file has nothing a model can look at. The RunManager
274
- * converts these into files on disk plus a path in the prompt before anything is
275
- * handed to a session, so a `file` block can never reach a backend.
276
- */
277
- export interface FileBlock {
278
- type: 'file';
279
- mediaType: string;
280
- data: string;
281
- }
282
- /** What the routes hand the engine: image/text blocks the session will see, plus file blocks it
283
- * will never see. Every RunManager entry point accepts this wider type. */
284
- export type PastedContent = ContentBlock | FileBlock;
285
- /** One wire attachment (`{mediaType, data}`) as the engine wants it: an image the model can view,
286
- * or a file it will only ever be given the path of. The single mapping the four attachment-
287
- * carrying routes share, so none of them can invent a different one. */
288
- export declare function toPastedContent(attachment: {
289
- mediaType: string;
290
- data: string;
291
- }): PastedContent;
292
- /** The image blocks of a mixed list — what may be delivered to a session. */
293
- export declare function contentBlocksOf(content: readonly PastedContent[]): ContentBlock[];
294
- /**
295
- * Plain-text note listing the absolute paths of pasted attachments, appended
296
- * to the message that carries them (#357). The base64 image blocks stay in
297
- * the message for the model to *view*; this note is what lets it *use* the
298
- * files as files — and the only usable reference on backends (codex,
299
- * opencode) whose `textOf()` drops image blocks before reaching the model.
300
- */
301
- export declare function pastedAttachmentsText(attachments: PersistedAttachment[]): string;
302
- /** Same note as `pastedAttachmentsText`, wrapped as a trailing `ContentBlock`
303
- * ready to append to a message's content array. */
304
- export declare function pastedAttachmentsNote(attachments: PersistedAttachment[]): ContentBlock;
305
- /** Only an original workflow that has never executed may return to its queue. */
306
- export declare function isUntouchedCancelledRun(run: RunRecord): boolean;
307
- /** #469: why destroy could not prove a crashed generation's termination. */
308
- export type WorkerTerminationBlocker = {
309
- kind: 'unreadable';
310
- } | {
311
- kind: 'controller';
312
- pid: number;
313
- } | {
314
- kind: 'processes';
315
- pids: number[];
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
- };
322
- /**
323
- * The mini workflow engine: executes a `WorkflowDef` against a repo, one step
324
- * at a time, persisting every event to the RunStore (which the SSE endpoints
325
- * relay live to the GUI). No GitHub choreography — agent steps and shell
326
- * checks with bounded retry loops, plus live sessions: the last agent step
327
- * stays open for follow-ups (`waiting`) until "finish", idle timeout, or
328
- * cancel. Runs queue behind the workspace-wide `maxParallel` slots (the shared
329
- * `WorkspaceSemaphore`, spec 2026-07-20 step 2.5) and each run executes in its
330
- * own git worktree on a `cez/<id8>` branch (spec 006), autosave-committed at
331
- * turn end and before a draft PR — plus every 90 s when opted in via
332
- * CEZ_AUTOSAVE=1 (#471). Each autosave records its trigger in the commit
333
- * subject, so the always-on flushes are not mistaken for the opt-in timer.
334
- * The user's working tree is never touched.
335
- */
336
- export declare class RunManager {
337
- private readonly store;
338
- private readonly repoRoot;
339
- private readonly active;
340
- private readonly queue;
341
- private readonly executions;
342
- private readonly finalizedWorkers;
343
- private readonly stoppedWorkers;
344
- private readonly terminationWaiters;
345
- private beginWorkerExecution;
346
- private finishWorkerExecution;
347
- /** Capture every returned process result before setup can throw. A setup
348
- * exception or an interrupt request cannot stand in for session termination. */
349
- private trackWorkerSessionResult;
350
- private persistWorkerCompletion;
351
- /** #469: the generation a dead controller left `starting`, if this manager may judge it. A
352
- * generation this process controls is never judged here: the in-memory execution map owns it,
353
- * and a disposed manager's still-running sessions look like orphans. `busy` is transient (this
354
- * manager holds the run); `unknown` is a present record that proves nothing. */
355
- private orphanState;
356
- private orphanedWorkerGeneration;
357
- /** Settles a crashed generation after exit proof. Sync and signal-free; recovery, resume,
358
- * delivery, collect and destroy then take their normal paths.
359
- * A non-gone probe is cached briefly: on darwin the scan is a synchronous `lsof` on the event loop. */
360
- settleOrphanedWorkerExecution(runId: string, opts?: {
361
- admitting?: boolean;
362
- fresh?: boolean;
363
- cwds?: CwdSource;
364
- }): boolean;
365
- private readonly orphanProbes;
366
- /** Pending orphan reprobes by run id. One timer serves them all (hearsay-tools/cezarion#879). */
367
- private readonly orphanDue;
368
- private orphanTimer?;
369
- /** The `at` the timer was armed for; with the clock, it decides what a tick takes. */
370
- private orphanArmedFor;
371
- private readonly orphanBlockers;
372
- private readonly reportedOrphanBlockers;
373
- private orphanBackoff;
374
- private orphanTermGraceMs;
375
- /** #469: a survivor that dies after recovery has no other wake source (no exit callback for a
376
- * process another cezar spawned). Unref'd; finalization's `run` event then lets worker waits and
377
- * outcomes observe it. Every 15 s for the first 15 minutes, then backing off to hourly
378
- * (hearsay-tools/cezarion#879), so a long-lived survivor is still noticed when it exits. One
379
- * timer serves every orphan, and a tick shares one `/proc` scan across them. A tick while this
380
- * manager holds the run is skipped; only terminal reasons (proof settled, generation changed,
381
- * run gone, unknown record, dispose) stop it. */
382
- private armOrphanReprobe;
383
- private wakeOrphanReprobes;
384
- private orphanReprobeTick;
385
- private clearOrphanReprobe;
386
- /** Why the last destroy could not prove termination (#469), and whether that differs from the
387
- * reason last reported, so a retry loop appends one lifecycle event per distinct blocker set. */
388
- takeWorkerTerminationBlocker(runId: string): {
389
- blocker: WorkerTerminationBlocker;
390
- changed: boolean;
391
- } | undefined;
392
- /** Continue over a live orphan names what still runs; other refusals keep the generic text. */
393
- private orphanAdmissionRefusal;
394
- /** Destroy only (#469): signal the recorded, token-verified survivors of a generation whose
395
- * controller is proven dead, then finalize on `gone`. Scan-only processes are never signalled. */
396
- private reapOrphanedWorker;
397
- /** Destroy only: SIGTERM recorded survivors, then SIGKILL what outlives `orphanTermGraceMs`.
398
- * `pids` are signalled by token-verified pid; `groups` are session leaders whose whole process
399
- * group is signalled (hearsay-tools/cezarion#890), so what an agent left behind exits with it. A
400
- * dead leader's group counts only while a process holding `paths` is in it. Every signal
401
- * re-verifies first: a reused PID or group number is never touched. */
402
- private terminateRecorded;
403
- /** Destroy of a finished generation (hearsay-tools/cezarion#890): a dev server or watcher its
404
- * agent left in its process group holds the worktree, and nothing else ties it to the worker.
405
- * A record whose controller is another live cezar is not ours to act on. */
406
- private terminateFinishedWorkerGroups;
407
- /** Best effort: a failed write leaves the working-directory scan as this process's evidence. */
408
- private recordWorkerProcess;
409
- private trackTurnEnd;
410
- requestWorkerStop(runId: string): WorkerStopResult;
411
- awaitRunTermination(runId: string, timeoutMs: number, opts?: {
412
- reapOrphans?: boolean;
413
- }): Promise<boolean>;
414
- private proveRunTermination;
415
- /** Irreversible history removal is an execution tombstone, including for legacy children. */
416
- private historyDeletionPending;
417
- private workerExecutionStopped;
418
- private readonly starting;
419
- /** Runs whose worktree a reclaim, or whose branch a delete, is removing right now
420
- * (`claimWorktreeReclaim`, `claimForBranchCleanup`). `continueRun` refuses them. */
421
- private readonly reclaiming;
422
- private readonly waiting;
423
- /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
424
- private readonly monitoring;
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. */
430
- private readonly ciWatches;
431
- /** CI lookups in flight, keyed by run id and normalized PR URL: two PRs may register at once. */
432
- private readonly ciRegistrations;
433
- /** A resolution whose checkpoint failed, retried by wait id. */
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;
450
- private readonly ciResources;
451
- /** #781: the workspace-wide preview host. Absent (`cez run`, tests) means every registration is `headless`. */
452
- private readonly preview?;
453
- /** The same host, for a removal outside this manager that must release a run's preview first. */
454
- get previewHost(): PreviewHostLike | undefined;
455
- /** #781: cezar's own listening port, which no dev server may register. */
456
- private readonly cezarPort?;
457
- private ciSupervisor;
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;
461
- private readonly inboxClaimTimers;
462
- private reconcilingWorkers;
463
- private reconcilingFamily;
464
- private readonly pendingReconciliations;
465
- /** What the recovery in progress covers: every run at boot (`family` undefined), or the one
466
- * family an adoption hands it (#779, plan step 3). Undefined: no recovery in progress. */
467
- private recoveryScope;
468
- /** Settles when the recovery in progress (if any) has finished. */
469
- private recoveryInFlight;
470
- private recoveryFactsPending;
471
- /** Adoptions of dead processes' runs, one at a time (`adoptOrphanedRun`). */
472
- private adoptionTail;
473
- /** Quiet window before unread input is resubmitted or left unconfirmed (#505). */
474
- private readonly unreadInputGraceMs;
475
- /** Quiet window after a final-message nudge before a still-silent session parks (#544). */
476
- private readonly noWaitNudgeReplyMs;
477
- private disposed;
478
- /** Whether any recovery is in progress: one at a time (`recover`), and `pump` waits for it. */
479
- private get recovering();
480
- /**
481
- * Whether a recovery in progress holds this run, so its wakes, input flushes and delegation
482
- * reconciles wait for that recovery's own passes: every run during boot recovery, and only the
483
- * adopted family's during a recovery scoped to one. The rest of a running project stays live: a
484
- * wake held back for an unrelated family would be lost, since the scoped passes never revisit it.
485
- */
486
- private recoveringRun;
487
- private readonly onDelegationRun;
488
- private readonly pendingJobs;
489
- /** Interrupted agent turns recovered after a process restart. Unlike an
490
- * explicit user Continue, these are bulk scheduler work and must re-enter
491
- * through `pump()` so both workspace and per-project caps are honored. */
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;
496
- /** Accepted Continues supersede in-flight settlement even before launch or after
497
- * idle close. Retain these across dropActive/dispose so absence cannot look like
498
- * the earlier execution again; disposal alone never revokes terminal intent. */
499
- private readonly continuationGenerations;
500
- /** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
501
- * the manager rather than the `ActiveRun` so a *queued* run — which has no
502
- * `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
503
- private readonly queuedImageSeq;
504
- /** Messages after hydration in the dequeue → session-open gap (#472).
505
- * Wait-withdrawing entries also retain a durable queue ID until delivered. */
506
- private readonly deferredMessages;
507
- /** Armed usage-limit resumes, keyed by run id (spec
508
- * 2026-08-03-auto-resume-after-usage-limit). The DEADLINE itself lives on the record
509
- * (`autoResumeAt`) — this map holds only the process-local timer, so a restart rebuilds it
510
- * from the record rather than losing the wait. Runs here are `failed` and therefore NOT in
511
- * `active`, which is why the timer cannot live on an `ActiveRun` like the monitoring one. */
512
- private readonly autoResumeTimers;
513
- private pumping;
514
- /** The scheduler only needs repo presence, stable for this manager's lifetime.
515
- * Cache the promise (including null) so every sweep doesn't spawn Git (#364).
516
- * execute() still reads fresh branch/remote metadata for each run. */
517
- private pumpRepoInfo?;
518
- /** A pump that arrived while one was in flight — replayed by `pump()`'s own
519
- * loop so a slot freed mid-sweep is never a lost wakeup. */
520
- private pumpAgain;
521
- /**
522
- * Runs normally isolate in worktrees and may execute in parallel. When that
523
- * isolation is unavailable (or explicitly disabled), access to `repoRoot` is
524
- * serialized by default so two agents cannot edit/revert the same files
525
- * (#438). `CEZ_DISABLE_REPO_LOCK=1` deliberately bypasses this safety lease.
526
- */
527
- private repoRootTail;
528
- /** `.ai/cezar` — where the per-task handoff files live. */
529
- private readonly dataDir;
530
- /** Runs currently being paused by the memory guard — dedupes the ~2 s samples so one breach
531
- * triggers one pause, not a burst. Cleared in dropActive when the run leaves the registry. */
532
- private readonly memoryPausing;
533
- /** Unsubscribe handle for the constructor's `onUsage` subscription — released
534
- * by dispose() so a torn-down manager stops receiving sampler ticks. */
535
- private readonly offUsage;
536
- /** The stalled-queue watchdog (see `rescueStalledQueue`). */
537
- private readonly queueWatchdog;
538
- /** Set by the watchdog for exactly one sweep: ignore the usage-limit hold and make progress. */
539
- private forceNextPump;
540
- /** Runs the watchdog started despite the hold. The spawn-time gate (`requeueWhileHeld`) would
541
- * otherwise hand them straight back and the rescue would undo itself in a millisecond. */
542
- private readonly forceStarted;
543
- /** The workspace-wide parallel-cap semaphore + cached resource config
544
- * (spec 2026-07-20, step 2.5). Boot constructs ONE and every manager shares
545
- * it; the private fallback keeps single-manager callers and tests working. */
546
- private readonly semaphore;
547
- /** Unregister handle for this manager's semaphore membership — released by
548
- * dispose() so a torn-down project stops counting against the cap. */
549
- private readonly offSemaphore;
550
- constructor(store: RunStore, repoRoot: string, options?: {
551
- semaphore?: WorkspaceSemaphore;
552
- unreadInputGraceMs?: number;
553
- noWaitNudgeReplyMs?: number;
554
- preview?: PreviewHostLike | undefined;
555
- cezarPort?: (() => number | undefined) | undefined;
556
- cockpit?: {
557
- origin: string;
558
- projectId: string;
559
- } | undefined;
560
- });
561
- /**
562
- * Release everything this manager owns without touching run records
563
- * (multi-project workspace, spec 2026-07-20: a removed project's context is
564
- * torn down while the process lives on). Unsubscribes the shared usage
565
- * sampler — before dispose() existed that subscription lived for the whole
566
- * process — clears every per-run idle/autosave timer, releases any held
567
- * repo-root locks, and empties the queued state so nothing fires later.
568
- * Live sessions are NOT ended here: run lifecycle stays the caller's policy;
569
- * dispose only guarantees the manager makes no further moves on its own.
570
- */
571
- dispose(): void;
572
- /**
573
- * Pause any active run whose whole process tree exceeds the WORKSPACE
574
- * `resources.memoryLimitMb`, freeing its slot so the queue advances
575
- * (#memory-guard). "Pause" closes the session — freeing the tree's
576
- * memory — and leaves the run resumable via Continue; a loud warning explains why. No-op when
577
- * no limit is set or the sampler has no data (e.g. `ps`/PowerShell unavailable).
578
- */
579
- private enforceMemoryLimit;
580
- /** Env for the rolling handoff and artifacts.
581
- *
582
- * `TMPDIR`/`TEMP`/`TMP` (#785) point at this run's own scratch directory
583
- * instead of the machine-wide one every agent used to share. Created and
584
- * write-probed here, on the last common path before a spawn, so an unusable
585
- * temp directory throws `AgentTempDirError` at the caller rather than
586
- * turning into empty command output inside a running agent. */
587
- private agentEnv;
588
- /**
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.
592
- */
593
- /**
594
- * Ordinary runs retain mutable discovery; owned runs require explicit durable evidence. With a
595
- * `stepId`, the step's own pinned entry is checked too (#452): its account must still be
596
- * available and its model/effort must clear the lock, exactly as the run-level fields must.
597
- */
598
- private workerIdentity;
599
- /** The pinned identity one agent step of an owned worker runs under; undefined for ordinary and internal runs. */
600
- private workerStep;
601
- /**
602
- * The steps a continuation may extend. An accepted worker's public `workflowDef` is authority
603
- * only while its identity binds it: a catalog chain through `ownedWorkflow`, and the default
604
- * quick-task from the built-in constant, exactly the definition `ownedJob` launches — a salvaged
605
- * or edited public record never picks which pinned identity a turn runs under.
606
- */
607
- private continuationDefSteps;
608
- /**
609
- * The definition step a continuation extends: the one owning the resumed session, else the
610
- * chain's last agent step — a synthetic `continue-N` owner and a fresh-session continuation
611
- * both extend the run's tail. Shared by `continueRun` (which identity to hold the override
612
- * against) and `runContinuation` (which tools, model, effort and account the turn gets).
613
- */
614
- private continuationDefStep;
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;
715
- private delegationProvisioner?;
716
- setDelegationProvisioner(provisioner: DelegationProvisioner): () => void;
717
- private provisionSession;
718
- /** Provision the same capability and descriptor on every start, Continue and recovered launch. */
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;
754
- stopPreviewServer(runId: string, request: PreviewStopRequest, signal?: AbortSignal): Promise<PreviewStopResult>;
755
- /**
756
- * #781: record a dev server the agent registered. One probe at registration becomes
757
- * `answeredAtRegistration`; the run is re-validated after it, since the probe awaits.
758
- */
759
- registerPreviewServer(runId: string, request: PreviewServeRequest, signal?: AbortSignal): Promise<PreviewServeResult>;
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;
820
- private startCiWatch;
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;
968
- /** Snapshot of the actual active session, never guessed from partial run settings. */
969
- delegationExecutionSettings(runId: string): DelegationExecutionSettings;
970
- /**
971
- * Resolve one agent step's selection before acceptance; permission grants always come from the
972
- * parent. Called once per agent step of the accepted chain (#452): a same-backend step inherits
973
- * the parent's account, model and effort, another runner resolves its own project/default
974
- * account, and an explicit `agentProfile` names the account for either — an id the registry
975
- * does not know is refused rather than degraded to the default, because a worker silently
976
- * running on another login is a billing boundary crossed without anyone choosing it.
977
- */
978
- selectDelegationExecutionSettings(runId: string, selection: {
979
- backend?: RunnerId | undefined;
980
- model?: string | undefined;
981
- effort?: string | undefined;
982
- agentProfile?: string;
983
- }, validateModel?: (settings: DelegationExecutionSettings) => Promise<void>): Promise<DelegationExecutionSettings>;
984
- /**
985
- * Idempotent start (#504, spec 2026-09-24-cez-task-cli). Lookup and create share one
986
- * synchronous path, so the event loop serialises concurrent retries: the first creates, every
987
- * later one with the same hash gets that run back, and a different hash is a conflict.
988
- */
989
- startRunIdempotent(workflow: WorkflowDef, input: StartRunInput, request: {
990
- id: string;
991
- hash: string;
992
- }): {
993
- run: RunRecord;
994
- created: boolean;
995
- } | {
996
- conflict: true;
997
- };
998
- startRun(workflow: WorkflowDef, input: StartRunInput, clientRequest?: {
999
- id: string;
1000
- hash: string;
1001
- }): RunRecord;
1002
- /** Accept only the store's already-durable owned creation, never caller-supplied paths/workflows. */
1003
- enqueueOwnedRun(runId: string): void;
1004
- private ownedJob;
1005
- /**
1006
- * The catalog chain an owned worker runs (#451), or undefined for the built-in quick-task.
1007
- * The public `workflowDef` is mutable state, so it is authority only while the private
1008
- * identity's hash binds it — the same shape as the context recipe. A tampered or lost
1009
- * definition refuses execution instead of quietly running quick-task or the edit.
1010
- */
1011
- private ownedWorkflow;
1012
- /**
1013
- * Slots this manager holds against the workspace-wide cap. `waiting` runs
1014
- * don't hold a slot (#347): an idle claude process costs memory but no
1015
- * tokens, queued work progressing matters more, and the idle timeout already
1016
- * bounds how long a session can sit open. Because the exemption lives HERE —
1017
- * in the count, not in any acquire path — a message into a `waiting` run
1018
- * (sendMessage) resumes it immediately even when that momentarily exceeds
1019
- * `maxParallel`, including when other projects saturate the cap.
1020
- */
1021
- private busySlots;
1022
- /** Epoch ms of this manager's oldest queued run (the semaphore's fairness
1023
- * key when a freed slot is broadcast), or null when nothing is queued.
1024
- * `queue` is FIFO — `startRun` pushes and `recover()` re-queues by
1025
- * `createdAt` — so the head is the oldest. */
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;
1040
- /**
1041
- * A slot this manager held just came free. Pump the whole WORKSPACE, not
1042
- * just this manager: `maxParallel` is counted across every project, so the
1043
- * run that should take the slot is the workspace's oldest queued one — which
1044
- * usually sits in another project's queue. Pumping only `this` is what left
1045
- * a queued run in project B stuck at `queued` while project A's runs came
1046
- * and went. `release()` pumps this manager too, so it replaces the local
1047
- * `pump()` at every slot-freeing transition.
1048
- */
1049
- private releaseSlot;
1050
- /**
1051
- * Start queued runs while parallel slots are free. A run starts only under
1052
- * BOTH ceilings: the WORKSPACE `resources.maxParallel` (default 2, counted
1053
- * across every manager — spec 2026-07-20, step 2.5) AND this project's own
1054
- * per-project `maxParallel` when the registry sets one (spec 2026-07-22,
1055
- * inherits the workspace cap when unset). Legacy per-repo `maxParallel` keys
1056
- * are ignored. A non-git directory degrades to 1 sequential run in the repo
1057
- * root (spec 006 degradation rule), which is always the tighter bound.
1058
- */
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;
1068
- /**
1069
- * Rebuild executable state for a durable queued record. Shared by recovery and the watchdog;
1070
- * reconstruct jobs or continuations before pumping.
1071
- */
1072
- private reviveQueuedRun;
1073
- private reviveQueuedContinuation;
1074
- /** Match the pinned execution account before considering a persisted session resumable. */
1075
- private queuedResumeSession;
1076
- private reviveQueuedWorker;
1077
- /**
1078
- * Startup recovery (#367) — re-adopt runs that were live when the previous
1079
- * cezar process exited (requires the store opened with `keepLive`):
1080
- * - `queued` → back into the queue (FIFO by createdAt), from the persisted
1081
- * workflowDef (or the catalog by name for older records);
1082
- * - `waiting` → preserve the durable attention state, while reaping the
1083
- * dead session's temporary resources (Continue or Finish still works);
1084
- * - `running` → mark interrupted, then immediately resume the last agent
1085
- * session via the Continue path, pointing the agent at its handoff file.
1086
- * Call once, before the server starts taking requests.
1087
- *
1088
- * With `familyRootId`, the same recovery for the one delegation family a dead process left
1089
- * behind, which `adoptOrphanedRun` has just loaded. Either way only runs this store owns are
1090
- * touched: another live process's runs are not in the live set, and the passes that read every
1091
- * worker or root skip their families (#779, plan step 3).
1092
- */
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;
1103
- /**
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.
1136
- */
1137
- adoptOrphanedRun(runId: string, opts?: {
1138
- stop?: boolean;
1139
- }): Promise<boolean>;
1140
- /** The persisted definition when it looks sane, else the catalog by name. */
1141
- private reviveWorkflow;
1142
- private isDisposedDelegatedRun;
1143
- /** Shutdown is not completion. Explicit terminal controls retain their precedence. */
1144
- private preserveRunAfterDisposal;
1145
- /**
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).
1151
- */
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;
1158
- /** Remove a run from the live registries — keeps `waiting ⊆ active`. */
1159
- private dropActive;
1160
- private readonly workerScratchCleanup;
1161
- /** Project detach cancels autonomous cleanup; reattach reconstructs the durable intents. */
1162
- pauseWorkerCleanup(): void;
1163
- recoverWorkerCleanup(): void;
1164
- /** Hold off every admission path until destructive work (including async Git) completes. */
1165
- claimWorkerCleanup(runId: string): (() => void) | undefined;
1166
- /** Scratch belongs to the task, not its current agent process (#515).
1167
- * Terminal status alone is not process-exit proof: an active session or an
1168
- * unfinished private worker generation must retain its files until exit. */
1169
- private reapTerminalScratch;
1170
- /**
1171
- * A run just failed: if the provider said "usage limit, back at T", promise to resume it at
1172
- * `T + AUTO_RESUME_GRACE_MS` instead of leaving the task dead until someone notices.
1173
- *
1174
- * Every refusal below is silent-but-honest — the run stays `failed` with its Continue button,
1175
- * which is exactly the pre-feature behavior — except the safety cap, which says so on the
1176
- * transcript, because a run that stops resuming itself needs to explain why.
1177
- */
1178
- private scheduleAutoResumeIfLimited;
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. */
1181
- private armAutoResume;
1182
- /**
1183
- * The window has reopened. Re-check the record synchronously — hours may have passed, and the
1184
- * user may have continued, deleted or cancelled the run in them — then hand the resume to the
1185
- * ordinary queued-continuation path so it obeys both concurrency caps like any other work.
1186
- */
1187
- private fireAutoResume;
1188
- /**
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.
1191
- */
1192
- private reconcileAutoResumes;
1193
- /**
1194
- * Hand a run that has not spawned anything back to the queue, when the account it would run on
1195
- * went into a usage-limit hold (spec 2026-08-03-auto-resume-after-usage-limit).
1196
- *
1197
- * The dequeue-time gate in `pump()` cannot be the only one: a run can sit between dequeue and
1198
- * spawn for a long time — an in-place run waiting for the exclusive repo-root lease is the
1199
- * measured case — and the account can close in that gap. This is the last honest moment to
1200
- * refuse, because everything after it costs a real agent turn.
1201
- *
1202
- * "Untouched" is the contract: the run has created no session and no worktree, so it goes back
1203
- * as plain `queued` with its `startedAt` cleared, and `pump()` will pick it up when the window
1204
- * reopens. Returns true when the caller must abandon the run.
1205
- */
1206
- private requeueWhileHeld;
1207
- /**
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.
1210
- */
1211
- rescueStalledQueue(now?: number): Promise<void>;
1212
- /**
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.
1215
- */
1216
- accountHolds(now?: number): AccountHolds;
1217
- /**
1218
- * The PER-TASK off switch (`DELETE /api/v1/runs/:id/auto-resume`, and the archive route):
1219
- * stop resuming THIS task, without touching the workspace setting or any other task.
1220
- *
1221
- * Idempotent — a run with nothing pending answers the same way, because "this task will not
1222
- * resume itself" is equally true either way. Returns false only when the run does not exist,
1223
- * which is the route's 404.
1224
- */
1225
- cancelAutoResume(runId: string): boolean;
1226
- /** Retire a pending resume — timer, deadline and counter. The counter goes too because every
1227
- * caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
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;
1237
- /** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
1238
- * `cez/<id8>` branch kept. Best-effort; a failure never affects run
1239
- * lifecycle. `review`/live runs are excluded by the selector. */
1240
- private enforceRetention;
1241
- /** Last live-refresh namer inputs per run — unchanged inputs skip the call. */
1242
- private lastNamerKey;
1243
- /**
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.
1247
- */
1248
- private acquireRepoRoot;
1249
- cancel(runId: string): boolean;
1250
- private cancelActiveRun;
1251
- private cancelWorkerExecution;
1252
- private cancelQueuedRun;
1253
- private cancelRunWithoutSession;
1254
- isActive(runId: string): boolean;
1255
- /**
1256
- * Claim a run's worktree for a reclaim (#483, issue 08 §B4), or null when it is in use or no
1257
- * longer reclaimable. The check and the claim are one synchronous step, and `continueRun`
1258
- * refuses a claimed run until the release, so a Continue can never resume into a directory a
1259
- * forced removal is deleting — nor a removal start under a session that was just admitted.
1260
- */
1261
- claimWorktreeReclaim(runId: string): (() => void) | null;
1262
- /**
1263
- * Hold `runIds` against Continue, reclaim, publish and branch cleanup here AND in every other
1264
- * cezar process for the length of an async operation (#779, plan step 3; PR #851 review). An
1265
- * ownership check alone is a moment: pinning claims each run's family, so another process
1266
- * cannot claim and Continue it while this one rematerializes, publishes or deletes. Null when
1267
- * any hold fails (another process took the claim first); nothing stays held then.
1268
- */
1269
- private holdForMaintenance;
1270
- /**
1271
- * Claim every run that owns a branch about to be deleted (issue 08 §B3), or null when any is in
1272
- * use: live, queued, at the review gate, or already claimed. The classification that allowed the
1273
- * delete read liveness before awaiting git and GitHub; this re-reads it and holds Continue off —
1274
- * its re-materialization would otherwise recreate the branch from the base under the delete.
1275
- */
1276
- /**
1277
- * Claim a settled run while its draft PR is published (`POST /runs/:id/pr`), or null when it is
1278
- * live or already claimed. Publishing may first re-materialize a reclaimed checkout, which
1279
- * clears the reclaim stamp and makes the run reclaimable again; held, the claim keeps reclaim,
1280
- * branch cleanup and Continue off the checkout until the push and `gh` are done with it.
1281
- */
1282
- claimForPublish(runId: string): (() => void) | null;
1283
- claimForBranchCleanup(runIds: readonly string[]): (() => void) | null;
1284
- /**
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.
1288
- */
1289
- private hydrateQueuedInput;
1290
- /** Apply edits and messages made while a restart continuation waits for
1291
- * capacity. The durable record remains the source of truth, just as it is for
1292
- * an ordinary queued workflow (#472), so a second restart reconstructs and
1293
- * hydrates the same amendments instead of dropping them. */
1294
- private hydrateQueuedContinuation;
1295
- /**
1296
- * Re-read persisted attachments at dequeue/restart (#472): an image comes back as a viewable
1297
- * block AND a path, a file (#950) as a path only. The branch is on the NAME's extension, never
1298
- * on which list the URL came from — images and files share one list, and re-encoding a `.pdf`
1299
- * into a base64 image block is a message no backend can accept.
1300
- *
1301
- * A file is still `stat`-checked here rather than trusted: an attachment the user deleted must
1302
- * drop out of the paths handed to the agent, exactly as a missing image does.
1303
- */
1304
- private readPersistedAttachments;
1305
- /**
1306
- * Still waiting for a slot? Checked against the engine's own queue rather than
1307
- * the record's `status` (#472): the record is written by `execute()` a tick
1308
- * after `pump()` dequeues, so a status read can see `queued` for a run that has
1309
- * already started. The pending maps are deleted synchronously at dequeue, so
1310
- * they are the authoritative answer for "can this prompt still be amended".
1311
- */
1312
- private isQueued;
1313
- /** Split a pasted message into the persisted shape a stacked message holds. */
1314
- private toQueuedMessage;
1315
- /**
1316
- * Append a prompt message onto a still-queued run (#472). Returns the stored
1317
- * entry, or null when the run has already started — the caller then falls
1318
- * through to `deferMessage`.
1319
- */
1320
- enqueueMessage(runId: string, content: PastedContent[]): QueuedMessage | null;
1321
- /** Edit a stacked message in place. Omitted fields retain their current value. */
1322
- editQueuedMessage(runId: string, msgId: string, edit: {
1323
- text?: string;
1324
- images?: PastedContent[];
1325
- }): QueuedMessage | null;
1326
- /** Remove a stacked message and its now-orphaned attachments. */
1327
- removeQueuedMessage(runId: string, msgId: string): boolean;
1328
- /**
1329
- * Delete image files no longer referenced by anything (#472). Best effort — a
1330
- * leftover file is harmless and goes with the run. Never touches a URL still
1331
- * referenced by another stacked entry or by the initial prompt's `taskImages`.
1332
- */
1333
- private dropOrphanImages;
1334
- /**
1335
- * Edit the initial prompt of a still-queued run (#472). Re-derives the
1336
- * heuristic title and the PR/issue chips, but never re-runs the LLM namer —
1337
- * it already fired at creation and a second model call per edit is unjustified.
1338
- */
1339
- editTask(runId: string, task: string): boolean;
1340
- /**
1341
- * Buffer a message that arrived in the gap between dequeue and session-open
1342
- * (#472). `pump()` has already folded the stack and `execute()` is spawning the
1343
- * backend, so there is nothing left to amend and no session to deliver into —
1344
- * without this rung the message would 409, a genuinely dropped message in the
1345
- * feature built to stop dropping them. Flushed as an ordinary follow-up turn
1346
- * the instant the session opens; dropped if the run never starts, which the
1347
- * existing error path already surfaces.
1348
- *
1349
- * The buffer lives on the manager rather than the `ActiveRun` because the
1350
- * `ActiveRun` does not exist yet for part of this window.
1351
- */
1352
- deferMessage(runId: string, content: PastedContent[]): boolean;
1353
- private parentCompletionBlockers;
1354
- /** A settled-but-uncollected result is work for the parent, not a live worker.
1355
- * Keep the private termination proof: a public terminal status can precede exit. */
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;
1360
- private delegationFinishBlockedReason;
1361
- /** The read-only verdict and explicit Finish share this decision. Operational failures
1362
- * (for example a failed durable write) are still handled at execution time. */
1363
- private finishDecision;
1364
- finishBlockedReason(runId: string): string | undefined;
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. */
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). */
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). */
1435
- private assertCanRegisterWorkerWait;
1436
- /** An answer already executing in this generation is not an unanswered question.
1437
- * Keep the durable checkpoint at turn-end for crash recovery, and match its exact
1438
- * sequence so it can never hide a newer question. */
1439
- private hasUnansweredHumanAsk;
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). */
1442
- registerRequestWait(runId: string, request: RequestWaitRequest): WorkerWait;
1443
- /** A wait wake is only a pointer. Only provider submission/opening prompts own delivery. */
1444
- private providerOwnsInboxInput;
1445
- canClaimInboxInput(runId: string, id: string): boolean;
1446
- /** The service supplies authorized, bounded IDs; claim and flight reservations are synchronous. */
1447
- reserveInboxInputs(runId: string, generation: string, ids: readonly string[]): {
1448
- receiptId: string;
1449
- expiresAt: string;
1450
- inputIds: string[];
1451
- } | undefined;
1452
- acknowledgeInbox(runId: string, generation: string, receiptId: string): 'acknowledged' | 'already-acknowledged';
1453
- releaseInbox(runId: string, generation: string, receiptId: string): 'released';
1454
- /** Expiry is an independent wake source, including after the provider's last turn. */
1455
- private armInboxClaimExpiry;
1456
- /** Accepted conversation input uses the existing scheduler admission for idle recipients. */
1457
- deliverConversationInput(runId: string): void;
1458
- /** A worker's pending question goes to its owning parent as a conversation request
1459
- * (#505). The worker still parks on its ask; only the parent's reply, or a human after
1460
- * fallback, answers it. Routing is idempotent: the message ID derives from the ask seq. */
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;
1484
- /** A human answering a worker question its parent handed back (#505): the reviewing parent
1485
- * can no longer answer it, so it must not also block the human. */
1486
- private answersFallenBackAsk;
1487
- /** The worker's pending ask when it went to the parent and has not fallen back to a human. */
1488
- private routedAsk;
1489
- /** The parent's reply answers the routed question like a human answer would: through the
1490
- * live session's native answer seam, or by reopening a session that is gone (#505). */
1491
- private answerRoutedQuestion;
1492
- private pendingRoutedAnswer;
1493
- private reopenRoutedAnswer;
1494
- private deliverRoutedAnswer;
1495
- /** A routed question settled without a reply (its worker stopped, a deadline, fallback) can
1496
- * never be answered by the parent any more: hand it to the human on the worker (#505). */
1497
- private retireSettledQuestions;
1498
- /** Routed questions this parent has not answered yet, by asking worker. */
1499
- private unansweredQuestions;
1500
- /** The parent can no longer answer: its workers' routed questions go back to the human
1501
- * (#505). The outcome lands first, so a crash before the worker's event repeats this. */
1502
- private fallbackRoutedQuestions;
1503
- /** The parent can still read and answer a routed question; answering needs its steer grant. */
1504
- private parentCanReceive;
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
- */
1513
- cancelWorkerWait(parentId: string, waitId: string): WorkerWait;
1514
- /** A turn of this run is executing now: a recovered run's is not, whatever it last recorded. */
1515
- private isExecutingWorkerWaitTurn;
1516
- private rootFinishRequested;
1517
- private executionBlockedByRootFinish;
1518
- /** Finish can arrive during continuation preflight. Retain its accepted
1519
- * payload in the ordinary queue, releasing the slot without opening a session. */
1520
- private holdContinuationForRootFinish;
1521
- private settleRequestedRootFinish;
1522
- /** Request deadlines share the existing reconciliation timer registry, never a polling loop. */
1523
- private reconcileConversations;
1524
- /** One delegation family: its root, then the root's direct workers (the store's
1525
- * `parent_run_id` query). Workers cannot delegate, so this never recurses. */
1526
- private familyMembers;
1527
- /** Every member of every family with a live member, each once: the families the store holds
1528
- * in memory (#779), which is where every delegation sweep that is not about one family looks. */
1529
- private liveFamilyMembers;
1530
- /**
1531
- * Recovery's full pass (#661): every family whose root carries a conversation — settled ones
1532
- * too, so a projection or outcome a crash interrupted is repaired — then every live family.
1533
- * Only roots with a conversation are read; a settled family without one has nothing to settle:
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.
1536
- * Everything else asks `reconcileWorkerWaits()`, which covers the live families (#779).
1537
- */
1538
- private reconcileRecoveryWorkerFamilies;
1539
- reconcileAllWorkerFamilies(): void;
1540
- /** Authority and wait live on disk; these collections are admission/timer caches only. One
1541
- * family by its root's id, or (no id) every family with a live member. */
1542
- reconcileWorkerWaits(familyRootId?: string): void;
1543
- private reconcileWorkerFamily;
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;
1558
- /** Durable queue is the single hydration source for fresh, continuing and recovered runs. */
1559
- steerWorker(runId: string, input: AgentInput): 'queued' | 'delivered';
1560
- /** Transcript bubbles include refused sends. Only a successful delivery
1561
- * checkpoint can answer the specific ask observed before that send. */
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;
1573
- private hasPendingHumanAsk;
1574
- /** Accepted input may be temporarily refused while a backend HTTP ack is
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. */
1577
- private hasQueuedAgentInputs;
1578
- /** Only the current session's observation writes consumedAt (#505). An ID reported
1579
- * before its acceptance checkpoint lands is applied when that checkpoint commits. */
1580
- private handleAgentInputConsumed;
1581
- /** #505: input the harness accepted but will never read returns to the queue, so
1582
- * DONE, auto-end and park see queued work. Out of a turn (an OpenCode lost wake)
1583
- * it is submitted right away; at a turn-end the handler's own flush submits it. */
1584
- private retireUnreadInputs;
1585
- /** #505: the harness started the opening turn, so the opening input was accepted.
1586
- * Its replay-prompt retirement still waits for that turn's successful end. */
1587
- private recordOpeningAccepted;
1588
- /** The conversation messages the next submission would carry, if nothing but
1589
- * conversation input leads the queue (lifecycle input stays a barrier). */
1590
- private pendingConversationBatch;
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. */
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;
1604
- /** The turn that carried bundled messages has ended: the model read them. */
1605
- private readBundledInputs;
1606
- /** #505: the session closed without reporting it read (failure, stop, exit): the input
1607
- * goes back to the queue so a later session delivers it; never shown as delivered. */
1608
- private requeueUnreadAtClose;
1609
- /** An idle, open boundary with nothing left to deliver: DONE closes, otherwise the
1610
- * run parks as waiting or monitoring. Shared by acknowledgements that land after a
1611
- * turn ended and by the unread-input grace timer (#505). */
1612
- private settleIdleBoundary;
1613
- /** #505 liveness bound: a harness that accepted input and then neither read it nor ran
1614
- * another turn must not hold the run and its slot forever. After a quiet grace window the
1615
- * input is resubmitted once; after a second it is left delivered but unconfirmed. */
1616
- private armUnreadInputTimer;
1617
- private clearUnreadInputTimer;
1618
- /** #486: a turn-end deferred close/park only because the harness still held a human follow-up. */
1619
- private armHeldHumanInputTimer;
1620
- private clearHeldHumanInputTimer;
1621
- /** #505: the harness accepted input this session has not reported reading yet. */
1622
- private harnessOwesInput;
1623
- /** #486: a human follow-up is still queued in the live session and will still be delivered. */
1624
- private harnessHoldsHumanInput;
1625
- /** A callback from an old/replaced/disposed session carries no authority. */
1626
- private handleAgentInputReady;
1627
- /** Reservation is synchronous; only an acknowledged transport may checkpoint delivery. */
1628
- private submitAgentInput;
1629
- /** Apply the acknowledgement's effects only after its outcome commit succeeds. */
1630
- private applyAcknowledgedInput;
1631
- /** False leaves the durable entry untouched. No human-answer/slash-expansion fallback. */
1632
- private flushAgentInputs;
1633
- private formatAgentInput;
1634
- private agentInputOutcomeText;
1635
- /** Deliver anything `deferMessage` buffered, once the session is live. */
1636
- private flushDeferred;
1637
- /**
1638
- * Deliver a user message into the run's live claude session (mid-turn or
1639
- * while `waiting`). Returns false when there is no open session — the GUI
1640
- * then offers "Continue" instead.
1641
- */
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;
1645
- /** Restore active lifecycle/accounting when either Cezar or the backend
1646
- * resumes work in a parked session. */
1647
- private resumeParkedRun;
1648
- /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
1649
- * bookkeeping without masquerading as user-authored transcript messages. */
1650
- private deliverMessage;
1651
- private prepareMessageContent;
1652
- private applyHumanMessageDelivery;
1653
- /** Close the open session gracefully — the run then completes as `done`
1654
- * (or rests at `review` when the worktree holds changes, spec 009).
1655
- * On a run already resting at `review` (no session — the engine loop is
1656
- * over), "Finish" is the third review exit: accept the changes without a
1657
- * PR and flip straight to `done`. */
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;
1664
- /** A synthetic continuation can settle only the resumed agent turn. If the
1665
- * original workflow still has steps after the waiting one, that would skip
1666
- * those steps rather than resume the workflow engine. */
1667
- private waitingBeforeFinalWorkflowStep;
1668
- /** A clean process exit cannot complete a workflow still blocked on a question.
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). */
1672
- private unansweredWorkflowAsk;
1673
- /** Locate the original workflow step whose closed session a synthetic Continue is resuming. */
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;
1686
- /**
1687
- * Session ids Cursor will accept on `session/load`. A launch UUID written
1688
- * before `session.started` is only for the step rail (#583).
1689
- */
1690
- private resumableSessionId;
1691
- /**
1692
- * "Continue" (spec 003): reopen a finished run's claude session in-process
1693
- * (`claude --resume <sessionId>`) as a new synthetic step. The session then
1694
- * behaves exactly like an interactive step: `waiting` after each turn,
1695
- * messages via sendMessage, closed by finish/idle/cancel.
1696
- */
1697
- continueRun(runId: string, opts?: ContinueRunOptions,
1698
- /** Restart recovery may discover several interrupted tasks at once. Those
1699
- * continuations are queued; an explicit user Continue remains immediate. */
1700
- deferForCapacity?: boolean, conversation?: Parameters<RunStore['commitWorkerContinuation']>[3]): {
1701
- ok: boolean;
1702
- error?: string;
1703
- };
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;
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;
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;
1903
- /** Returns an error message, or null on success. */
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;
1961
- /** Some adapters return assistant text only in their final result. Preserve that
1962
- * evidence for collection without duplicating an already persisted transcript. */
1963
- private persistWorkerAssistantResult;
1964
- /**
1965
- * Protocol-v2 sink for one agent session (R2 step 2.1): the runner's
1966
- * `onUiEvent` stream flows through here. Persisted snapshots ride the same
1967
- * NDJSON file as v1 (the store stamps `seq`/`ts`, `appendEvent` fans them
1968
- * out live too); coalesced `item.delta` flushes go out live-only via
1969
- * `emitEphemeral` — raw deltas never hit disk (spec §performance
1970
- * guardrails). One sink per session: cumulative usage dedup and the
1971
- * item-shape cache are session-scoped, like the mapper state feeding them.
1972
- */
1973
- private makeUiSink;
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. */
1976
- private prepareHumanAsk;
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;
2025
- /** Native backend asks arrive before turn-end. Persist and park immediately
2026
- * so the cockpit shows attention and the run releases its workspace slot. */
2027
- private handleRunnerUiEvent;
2028
- private handlePermissionRequested;
2029
- private handlePermissionResolved;
2030
- private handleNativeAskRequested;
2031
- /** Persist the invocation checkpoint before launching a runner. A throw or
2032
- * process exit before `turn.started` therefore leaves a durable mismatch. */
2033
- private beginUsageInvocation;
2034
- /** Claude's `total_cost_usd` is cumulative for the conversation, including
2035
- * turns in Continue steps. Other runners emit per-message cost deltas. */
2036
- private recordReportedCost;
2037
- /** Fold backend-neutral completed-turn usage into the current step exactly
2038
- * once. Invocation/turn counters are written before the event reaches the
2039
- * NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
2040
- private recordUsageUiEvent;
2041
- /** Usage completeness is a crash boundary, unlike high-frequency token
2042
- * snapshots: the checkpoint must reach `runs.json` before the runner starts
2043
- * or the matching UI event is persisted and forwarded. */
2044
- private persistUsageCheckpoint;
2045
- /**
2046
- * Turn-end bookkeeping (#389), shared by `runAgentStep` and
2047
- * `runContinuation` — called (fire-and-forget) from every `turn-end` event:
2048
- *
2049
- * - `titleSummary`: derived from the turn's text, set ONCE — only while the
2050
- * record has none. A user's inline edit also lands in `titleSummary`
2051
- * (see `PATCH /api/runs/:id`), so an edit is never overwritten either.
2052
- * - `diffStat`: cheap `git diff --shortstat` vs the base, refreshed every
2053
- * turn. Async and best-effort — a git failure becomes at most a `note`
2054
- * event, NEVER a run failure. `updateRun` fans the record out over SSE,
2055
- * so the list views pick both up with no extra wiring.
2056
- *
2057
- * Not `private` so the integration tests can drive a turn-end directly —
2058
- * a real agent session is the only other way to reach this path.
2059
- */
2060
- /**
2061
- * The namer's apply path (task auto-naming spec). Fire-and-forget: called
2062
- * without await from `startRun` (creation) and `recordTurnEnd` (live
2063
- * refresh). A user-owned title (`titleOrigin: 'user'`) is never overwritten;
2064
- * namer-owned titles may be replaced by fresher namer results.
2065
- */
2066
- private autoNameRun;
2067
- recordTurnEnd(runId: string, turnText: string): Promise<void>;
2068
- /**
2069
- * In-band declarations from the finished turn (spec
2070
- * 2026-07-18-task-ref-markers): the main thread's own `CEZ:PR=` /
2071
- * `CEZ:ISSUE=` / `CEZ:TITLE=` lines, parsed from the accumulated turn text
2072
- * like `CEZ:DONE` — never from tool output. Declared numbers overwrite the
2073
- * regex/namer display tier (the store re-resolves the referenced-PR chip);
2074
- * a declared title takes `titleOrigin: 'marker'`, which beats the namer but
2075
- * never a user rename, and silences the live refresh below.
2076
- */
2077
- private applyTurnMarkers;
2078
- /**
2079
- * Live title refresh (task auto-naming spec, step 3): re-run the namer with
2080
- * the turn's context. Skips: toggle off (`liveTitleUpdates` config over
2081
- * `CEZ_TITLE_UPDATES` env, default ON), user-owned title, marker-owned title
2082
- * (the agent declares via `CEZ:TITLE` — the token-saving fast path), dry-run
2083
- * mocks (canned answers add nothing), empty turn text, unchanged namer inputs.
2084
- */
2085
- private maybeRefreshTitle;
2086
- /**
2087
- * End-of-session telemetry (#348): stop sampling the run's process tree and
2088
- * fold the session's peaks into the run record. `max` with existing values —
2089
- * a run can hold several sessions (multiple agent steps, Continue) and the
2090
- * record keeps the highest water mark across all of them.
2091
- */
2092
- private recordUsagePeaks;
2093
- /**
2094
- * Diff-first review gate (spec 009), shared by `execute` and
2095
- * `runContinuation`: a *successful* run whose worktree holds changes rests
2096
- * at `review` instead of `done` — the user inspects the diff first, then
2097
- * sends feedback back, opens a draft PR, or just finishes. Failed/cancelled
2098
- * runs never enter review; no worktree or an empty diff means plain `done`.
2099
- *
2100
- * The gate is opt-in (#489): the review park happens only when it is enabled
2101
- * (`reviewGateEnabled` — config toggle over the `CEZ_REVIEW_GATE` env, default
2102
- * OFF) AND the run is not autonomous. Autonomous runs — and runs with the gate
2103
- * off — settle straight to `done`, leaving the diff in the worktree untouched.
2104
- */
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;
2121
- /** Called only after session/process settlement. A refused nudge retained its
2122
- * slot and running status until idle close; ordinary roots must now become
2123
- * resumable. Previously parked roots and delegated lifecycle policy stay intact. */
2124
- private settleIdleClosedRun;
2125
- /** An ordinary owned worker cannot accept an inactive Continue. Once its
2126
- * idle-closed process has ended, publish the same terminal outcome recovery
2127
- * would produce so its parent can collect it. Explicit asks and worker waits
2128
- * remain durable attention states. */
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;
2138
- /**
2139
- * Persist every attachment a user message carries — images and files alike (#950) — into the
2140
- * run's own attachment folder, in the order they were attached. The returned paths are what the
2141
- * agent is told about; the caller decides which of them also ride along as viewable blocks.
2142
- */
2143
- private persistPastedAttachments;
2144
- /**
2145
- * Agent screenshot (an image block inside a tool result) or a user attachment —
2146
- * a pasted screenshot, or since #950 a PDF/TXT/MD file: the base64 data never
2147
- * enters the NDJSON event log — it lands as a file under
2148
- * `.ai/cezar/runs/<id>-images/` and the transcript event carries only the name +
2149
- * serving URL. `namePrefix` distinguishes the two origins on disk
2150
- * (`screenshot-<n>.<ext>` for agent tool screenshots, `pasted-<n>.<ext>` for user
2151
- * attachments, #357) and the absolute `path` lets the agent operate on the file
2152
- * directly (save/attach/upload) — for a non-image attachment that path is the ONLY
2153
- * way it ever reaches the agent.
2154
- * Best effort: on failure the attachment is dropped, the transcript still
2155
- * shows the tool result's `[screenshot]` placeholder (or the image count).
2156
- */
2157
- private persistAttachment;
2158
- /** Shared stop/input/liveness guards for an automatic continuation. */
2159
- private canAutoContinue;
2160
- /**
2161
- * Both turn-end paths keep a nudged session running, with no user-wait timer or
2162
- * released slot. The next turn can finish with DONE, nudge again, or park at the
2163
- * cap (waiting/monitoring with their existing wake/idle rules). Queued/accepted
2164
- * input, worker/CI waits and parent completion keep priority. Cancel, Finish,
2165
- * disposal and memory pause stop nudging; provider errors/exits use normal
2166
- * teardown. Native mid-turn asks still park for an answer (outside this policy).
2167
- * A refused ordinary nudge waits for readiness at this exact boundary; the idle
2168
- * timeout bounds a missing readiness signal. New activity/input invalidates it.
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.
2171
- */
2172
- /** `text` is the turn-end rule's nudge; an ask line's nudge scopes the same one itself (hearsay-tools/cezarion#1620). */
2173
- private tryAutonomousNudge;
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;
2310
- private armIdleTimer;
2311
- private clearIdleTimer;
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. */
2337
- private saveWorktree;
2338
- /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
2339
- * Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
2340
- private armAutosave;
2341
- private clearAutosaveTimer;
2342
- /**
2343
- * Worktree setup (#917, spec `.ai/specs/2026-10-07-worktree-setup.md`): run the project's
2344
- * `worktreeSetup` commands in this run's isolated worktree when it needs them, and return the
2345
- * paragraph for the agent's opening message. `start` is a new task or worker, `rematerialized`
2346
- * a Continue that rebuilt a reclaimed directory, and `resume` any other Continue, which only
2347
- * finishes a setup a restart interrupted. In-place and non-Git runs never get setup: that tree
2348
- * is the user's own checkout.
2349
- */
2350
- private prepareWorktree;
2351
- private runCheckStep;
2352
- private finishStep;
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;
2357
- /**
2358
- * Immediate title shown while a run is queued. The namer's `titleSummary`
2359
- * replaces it once the model answers; this is the honest, permanent fallback
2360
- * when no model is available (#432, spec 2026-07-17-task-auto-naming). When
2361
- * the task references a PR/issue, the number leads: `469: /om-auto-review-pr`.
2362
- */
2363
- export declare function makeRunTitle(task: string, workflow: WorkflowDef): string;
2364
- /**
2365
- * Skill identity is context, while the Markdown body remains instructions.
2366
- *
2367
- * For an on-disk skill we also hand the agent the ABSOLUTE directory of the
2368
- * installed copy. A run executes in an isolated worktree that has no local
2369
- * `.agents/skills` (gitignored, absent in a fresh checkout), so without this
2370
- * the agent cannot read the skill's companion files (`references/*.md`) — or,
2371
- * worse, reads a stale copy materialized from the team-repo cache. The path
2372
- * resolves against the MAIN project root (`discoverSkills(repoRoot)`), i.e. the
2373
- * current `npx skills`-installed copy, so a worktree agent and the main
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.
2380
- */
2381
- export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>, teamFilesDir?: string): string;
2382
- /**
2383
- * Expand a registry-backed slash skill in one prompt string before it reaches a
2384
- * backend. Claude otherwise intercepts an unknown leading slash command, and
2385
- * Codex/OpenCode have no native slash-skill lookup at all (#676).
2386
- *
2387
- * Only a match at character zero counts, and unknown commands pass through
2388
- * byte-for-byte — a backend's OWN slash commands must keep working. The caller
2389
- * persists the original user text before applying this delivery-only rewrite.
2390
- *
2391
- * All delivery seams route through here: live-session messages via
2392
- * `expandRegistrySlashSkill`, and fresh or continuation opening prompts, which
2393
- * become the session's `userPrompt` without passing through `deliverMessage`.
2394
- */
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;
2400
- /**
2401
- * `expandRegistrySlashSkillText` over a live chat message: only the first text
2402
- * block is eligible, and an unchanged block returns the caller's array
2403
- * identity untouched.
2404
- */
2405
- export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];