@open-mercato/cezar 0.9.1 → 0.9.2-pr772.1071

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 (355) hide show
  1. package/README.md +36 -17
  2. package/dist/agent-config/account-identity.d.ts +44 -0
  3. package/dist/agent-config/account-identity.js +128 -0
  4. package/dist/agent-config/account-identity.js.map +1 -0
  5. package/dist/agent-config/catalog.d.ts +9 -1
  6. package/dist/agent-config/catalog.js +18 -0
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/files.d.ts +1 -1
  9. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  10. package/dist/agent-config/model-settings/claude.js +11 -0
  11. package/dist/agent-config/model-settings/claude.js.map +1 -0
  12. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  13. package/dist/agent-config/model-settings/codex.js +16 -0
  14. package/dist/agent-config/model-settings/codex.js.map +1 -0
  15. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  16. package/dist/agent-config/model-settings/opencode.js +8 -0
  17. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  18. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  19. package/dist/agent-config/model-settings/shared.js +93 -0
  20. package/dist/agent-config/model-settings/shared.js.map +1 -0
  21. package/dist/agent-config/model-settings/types.d.ts +9 -0
  22. package/dist/agent-config/model-settings/types.js +2 -0
  23. package/dist/agent-config/model-settings/types.js.map +1 -0
  24. package/dist/agent-config/models.d.ts +9 -0
  25. package/dist/agent-config/models.js +30 -0
  26. package/dist/agent-config/models.js.map +1 -0
  27. package/dist/agent-config/service.d.ts +1 -1
  28. package/dist/agent-config/service.js +4 -4
  29. package/dist/agent-config/service.js.map +1 -1
  30. package/dist/agent-config/validate.d.ts +1 -1
  31. package/dist/automations/coordinator.d.ts +26 -0
  32. package/dist/automations/coordinator.js +66 -0
  33. package/dist/automations/coordinator.js.map +1 -0
  34. package/dist/automations/github-poller.d.ts +74 -0
  35. package/dist/automations/github-poller.js +234 -0
  36. package/dist/automations/github-poller.js.map +1 -0
  37. package/dist/automations/scheduler.d.ts +42 -0
  38. package/dist/automations/scheduler.js +192 -0
  39. package/dist/automations/scheduler.js.map +1 -0
  40. package/dist/automations/store.d.ts +65 -0
  41. package/dist/automations/store.js +298 -0
  42. package/dist/automations/store.js.map +1 -0
  43. package/dist/automations/task-template.d.ts +18 -0
  44. package/dist/automations/task-template.js +95 -0
  45. package/dist/automations/task-template.js.map +1 -0
  46. package/dist/automations/types.d.ts +251 -0
  47. package/dist/automations/types.js +158 -0
  48. package/dist/automations/types.js.map +1 -0
  49. package/dist/config.d.ts +17 -112
  50. package/dist/config.js +45 -4
  51. package/dist/config.js.map +1 -1
  52. package/dist/contract/agent-config.d.ts +151 -0
  53. package/dist/contract/agent-profiles.d.ts +332 -0
  54. package/dist/contract/automations.d.ts +919 -0
  55. package/dist/contract/events.d.ts +45 -0
  56. package/dist/contract/github.d.ts +467 -0
  57. package/dist/contract/health.d.ts +96 -0
  58. package/dist/contract/index.d.ts +16 -0
  59. package/dist/contract/index.js +1614 -0
  60. package/dist/contract/projects.d.ts +185 -0
  61. package/dist/contract/repo.d.ts +234 -0
  62. package/dist/contract/runs.d.ts +1261 -0
  63. package/dist/contract/skills.d.ts +229 -0
  64. package/dist/contract/workflows.d.ts +212 -0
  65. package/dist/contract/workspace.d.ts +490 -0
  66. package/dist/core/agent-env.d.ts +1 -1
  67. package/dist/core/agent-model-policy.d.ts +10 -0
  68. package/dist/core/agent-model-policy.js +36 -0
  69. package/dist/core/agent-model-policy.js.map +1 -0
  70. package/dist/core/agent-profiles.d.ts +59 -0
  71. package/dist/core/agent-profiles.js +83 -0
  72. package/dist/core/agent-profiles.js.map +1 -0
  73. package/dist/core/agent-runner.d.ts +12 -1
  74. package/dist/core/agent-runner.js +13 -0
  75. package/dist/core/agent-runner.js.map +1 -1
  76. package/dist/core/ask.d.ts +45 -124
  77. package/dist/core/ask.js +103 -13
  78. package/dist/core/ask.js.map +1 -1
  79. package/dist/core/backend-detect.js +7 -2
  80. package/dist/core/backend-detect.js.map +1 -1
  81. package/dist/core/claude-cli-runner.d.ts +2 -2
  82. package/dist/core/claude-cli-runner.js +52 -9
  83. package/dist/core/claude-cli-runner.js.map +1 -1
  84. package/dist/core/claude-ui-mapper.d.ts +1 -1
  85. package/dist/core/codex-app-server-runner.d.ts +1 -1
  86. package/dist/core/codex-app-server-runner.js +60 -3
  87. package/dist/core/codex-app-server-runner.js.map +1 -1
  88. package/dist/core/codex-app-server-transport.d.ts +6 -1
  89. package/dist/core/codex-app-server-transport.js +12 -3
  90. package/dist/core/codex-app-server-transport.js.map +1 -1
  91. package/dist/core/codex-model-catalog.d.ts +1 -1
  92. package/dist/core/codex-ui-mapper.d.ts +5 -1
  93. package/dist/core/codex-ui-mapper.js +74 -17
  94. package/dist/core/codex-ui-mapper.js.map +1 -1
  95. package/dist/core/model-identity.d.ts +13 -6
  96. package/dist/core/model-identity.js +32 -17
  97. package/dist/core/model-identity.js.map +1 -1
  98. package/dist/core/model-presets.d.ts +2 -2
  99. package/dist/core/model-presets.js +1 -1
  100. package/dist/core/opencode-server-runner.d.ts +2 -2
  101. package/dist/core/opencode-ui-mapper.d.ts +4 -1
  102. package/dist/core/opencode-ui-mapper.js +45 -7
  103. package/dist/core/opencode-ui-mapper.js.map +1 -1
  104. package/dist/core/provider-auth.d.ts +154 -0
  105. package/dist/core/provider-auth.js +488 -0
  106. package/dist/core/provider-auth.js.map +1 -0
  107. package/dist/core/provider-availability.d.ts +3 -0
  108. package/dist/core/provider-availability.js +14 -0
  109. package/dist/core/provider-availability.js.map +1 -0
  110. package/dist/core/runner-factory.d.ts +1 -1
  111. package/dist/core/runner-model-catalog.d.ts +1 -1
  112. package/dist/core/shell-env.d.ts +28 -0
  113. package/dist/core/shell-env.js +56 -0
  114. package/dist/core/shell-env.js.map +1 -0
  115. package/dist/core/tool-display.d.ts +1 -1
  116. package/dist/core/ui-events.d.ts +1 -1
  117. package/dist/core/ui-events.js +1 -1
  118. package/dist/core/usage-limit.d.ts +42 -0
  119. package/dist/core/usage-limit.js +209 -0
  120. package/dist/core/usage-limit.js.map +1 -0
  121. package/dist/git-diff-base.d.ts +60 -0
  122. package/dist/git-diff-base.js +54 -0
  123. package/dist/git-diff-base.js.map +1 -0
  124. package/dist/git-worktree.d.ts +37 -6
  125. package/dist/git-worktree.js +39 -9
  126. package/dist/git-worktree.js.map +1 -1
  127. package/dist/handoff.d.ts +2 -2
  128. package/dist/handoff.js +1 -1
  129. package/dist/index.js +65 -8
  130. package/dist/index.js.map +1 -1
  131. package/dist/paths.d.ts +69 -6
  132. package/dist/paths.js +86 -9
  133. package/dist/paths.js.map +1 -1
  134. package/dist/planner.d.ts +2 -2
  135. package/dist/planner.js +7 -1
  136. package/dist/planner.js.map +1 -1
  137. package/dist/release/manifests.d.ts +81 -0
  138. package/dist/release/manifests.js +74 -0
  139. package/dist/release/manifests.js.map +1 -0
  140. package/dist/release/snapshot.d.ts +9 -23
  141. package/dist/release/snapshot.js +9 -22
  142. package/dist/release/snapshot.js.map +1 -1
  143. package/dist/release/stable.d.ts +15 -29
  144. package/dist/release/stable.js +14 -27
  145. package/dist/release/stable.js.map +1 -1
  146. package/dist/runs/auto-name.d.ts +1 -1
  147. package/dist/runs/auto-name.js +6 -1
  148. package/dist/runs/auto-name.js.map +1 -1
  149. package/dist/runs/retention.d.ts +1 -1
  150. package/dist/runs/store.d.ts +149 -336
  151. package/dist/runs/store.js +187 -9
  152. package/dist/runs/store.js.map +1 -1
  153. package/dist/runs/ui-event-sink.d.ts +1 -1
  154. package/dist/server/app-type.d.ts +21 -0
  155. package/dist/server/app-type.js +2 -0
  156. package/dist/server/app-type.js.map +1 -0
  157. package/dist/server/capabilities.d.ts +6 -5
  158. package/dist/server/capabilities.js +11 -0
  159. package/dist/server/capabilities.js.map +1 -1
  160. package/dist/server/forge/github.d.ts +58 -151
  161. package/dist/server/forge/github.js +530 -6
  162. package/dist/server/forge/github.js.map +1 -1
  163. package/dist/server/forge/index.d.ts +10 -3
  164. package/dist/server/forge/index.js +14 -1
  165. package/dist/server/forge/index.js.map +1 -1
  166. package/dist/server/forge/types.d.ts +86 -1
  167. package/dist/server/git-changes.d.ts +8 -8
  168. package/dist/server/git-changes.js +14 -17
  169. package/dist/server/git-changes.js.map +1 -1
  170. package/dist/server/git.d.ts +2 -0
  171. package/dist/server/git.js +9 -0
  172. package/dist/server/git.js.map +1 -1
  173. package/dist/server/github.d.ts +3 -3
  174. package/dist/server/github.js +1 -1
  175. package/dist/server/github.js.map +1 -1
  176. package/dist/server/open-in-terminal.d.ts +8 -1
  177. package/dist/server/open-in-terminal.js +16 -8
  178. package/dist/server/open-in-terminal.js.map +1 -1
  179. package/dist/server/pr.d.ts +2 -2
  180. package/dist/server/project-context.d.ts +20 -3
  181. package/dist/server/project-context.js +30 -1
  182. package/dist/server/project-context.js.map +1 -1
  183. package/dist/server/provider-action-gate.d.ts +8 -0
  184. package/dist/server/provider-action-gate.js +54 -0
  185. package/dist/server/provider-action-gate.js.map +1 -0
  186. package/dist/server/provider-auth-runtime.d.ts +21 -0
  187. package/dist/server/provider-auth-runtime.js +66 -0
  188. package/dist/server/provider-auth-runtime.js.map +1 -0
  189. package/dist/server/server.d.ts +12128 -47
  190. package/dist/server/server.js +2652 -917
  191. package/dist/server/server.js.map +1 -1
  192. package/dist/server/validators.d.ts +97 -0
  193. package/dist/server/validators.js +86 -0
  194. package/dist/server/validators.js.map +1 -0
  195. package/dist/server/ws.d.ts +2 -2
  196. package/dist/server/ws.js +2 -2
  197. package/dist/server/ws.js.map +1 -1
  198. package/dist/server-install/engine.d.ts +1 -1
  199. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  200. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  201. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  202. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  203. package/dist/server-install/state.d.ts +1 -1
  204. package/dist/server-install/steps.d.ts +2 -2
  205. package/dist/server-install/strategies.d.ts +1 -1
  206. package/dist/server-install/types.d.ts +38 -424
  207. package/dist/server-install/ui.d.ts +1 -1
  208. package/dist/skills-banner.d.ts +7 -6
  209. package/dist/skills-banner.js +7 -6
  210. package/dist/skills-banner.js.map +1 -1
  211. package/dist/skills-remote.d.ts +2 -2
  212. package/dist/skills-update.d.ts +88 -0
  213. package/dist/skills-update.js +392 -0
  214. package/dist/skills-update.js.map +1 -0
  215. package/dist/skills.d.ts +2 -0
  216. package/dist/skills.js +7 -2
  217. package/dist/skills.js.map +1 -1
  218. package/dist/todos.d.ts +2 -28
  219. package/dist/todos.js +1 -1
  220. package/dist/ui-state.d.ts +16 -2
  221. package/dist/ui-state.js +14 -1
  222. package/dist/ui-state.js.map +1 -1
  223. package/dist/workflows/load.d.ts +1 -1
  224. package/dist/workflows/run.d.ts +238 -12
  225. package/dist/workflows/run.js +1103 -115
  226. package/dist/workflows/run.js.map +1 -1
  227. package/dist/workflows/types.d.ts +59 -224
  228. package/dist/workflows/types.js +14 -0
  229. package/dist/workflows/types.js.map +1 -1
  230. package/dist/workspace/agent-accounts.d.ts +149 -0
  231. package/dist/workspace/agent-accounts.js +303 -0
  232. package/dist/workspace/agent-accounts.js.map +1 -0
  233. package/dist/workspace/agent-profiles.d.ts +78 -0
  234. package/dist/workspace/agent-profiles.js +115 -0
  235. package/dist/workspace/agent-profiles.js.map +1 -0
  236. package/dist/workspace/config.d.ts +82 -206
  237. package/dist/workspace/config.js +183 -14
  238. package/dist/workspace/config.js.map +1 -1
  239. package/dist/workspace/migrations.d.ts +1 -1
  240. package/dist/workspace/migrations.js +19 -4
  241. package/dist/workspace/migrations.js.map +1 -1
  242. package/dist/workspace/projects.d.ts +8 -2
  243. package/dist/workspace/projects.js +9 -3
  244. package/dist/workspace/projects.js.map +1 -1
  245. package/dist/workspace/semaphore.d.ts +45 -0
  246. package/dist/workspace/semaphore.js +45 -1
  247. package/dist/workspace/semaphore.js.map +1 -1
  248. package/dist/workspace/ui-state.d.ts +13 -3
  249. package/dist/workspace/ui-state.js +15 -5
  250. package/dist/workspace/ui-state.js.map +1 -1
  251. package/package.json +17 -39
  252. package/scripts/inline-contract.mjs +112 -0
  253. package/scripts/mock-claude.mjs +59 -1
  254. package/scripts/sync-readme.mjs +20 -0
  255. package/web/dist/assets/alert-dialog-LMDsWZ8t.js +1 -0
  256. package/web/dist/assets/arrow-down-CDJD8f8N.js +1 -0
  257. package/web/dist/assets/arrow-left-DUirK4gC.js +1 -0
  258. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  259. package/web/dist/assets/centered-state-CX0EhxaQ.js +43 -0
  260. package/web/dist/assets/chevron-right-B70aoBYh.js +1 -0
  261. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  262. package/web/dist/assets/circle-check-C6IhUojk.js +1 -0
  263. package/web/dist/assets/circle-x-hV9f6Ypp.js +1 -0
  264. package/web/dist/assets/collapsible-D2igywSh.js +1 -0
  265. package/web/dist/assets/commit-list-ocsM8XZs.js +1 -0
  266. package/web/dist/assets/compare-variants-CYdYsQBv.js +1 -0
  267. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  268. package/web/dist/assets/diff-3y-HnHEH.js +3 -0
  269. package/web/dist/assets/diff-stat-OeTa1MCD.js +1 -0
  270. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-D8VBKGxl.js} +4 -4
  271. package/web/dist/assets/dropdown-menu-B9UHiJFv.js +1 -0
  272. package/web/dist/assets/editable-title-C9aK-GCt.js +1 -0
  273. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-BVp0AyW4.js} +1 -1
  274. package/web/dist/assets/{file-D4GBh1ao.js → file-D1v6Cb9Q.js} +1 -1
  275. package/web/dist/assets/folder-HNaOtP70.js +1 -0
  276. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-C6KuSF45.js} +1 -1
  277. package/web/dist/assets/git-toolbar-DpRPWLaM.js +1 -0
  278. package/web/dist/assets/github-UumAmuAM.js +1 -0
  279. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  280. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  281. package/web/dist/assets/image-preview-M1y8lBCU.js +1 -0
  282. package/web/dist/assets/index-BNgqhk51.js +6 -0
  283. package/web/dist/assets/index-De7KdVHL.css +2 -0
  284. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  285. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  286. package/web/dist/assets/markdown-DfljSy6W.js +2 -0
  287. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  288. package/web/dist/assets/new-task-form-CkgsW8GC.js +1 -0
  289. package/web/dist/assets/pill-DWy7Dbv3.js +1 -0
  290. package/web/dist/assets/project-router-BJR_8pfk.js +1 -0
  291. package/web/dist/assets/prompt-templates-CKbMbly-.js +15 -0
  292. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  293. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-Bs4wU0JM.js} +1 -1
  294. package/web/dist/assets/repo-git-CBbpvexr.js +1 -0
  295. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  296. package/web/dist/assets/run-diff-CzrO-R7P.js +3 -0
  297. package/web/dist/assets/run-header-BQDPFKUM.js +1 -0
  298. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-sxnYXz0H.js} +1 -1
  299. package/web/dist/assets/skill-empty-hint-CMfCEn9L.js +1 -0
  300. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  301. package/web/dist/assets/skills-DrG0KcAJ.js +1 -0
  302. package/web/dist/assets/sparkles-CL1cbhb_.js +1 -0
  303. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-5JEPtGG-.js} +1 -1
  304. package/web/dist/assets/tab-link-DVT33Q2m.js +1 -0
  305. package/web/dist/assets/task-changes-BuuNjQ_C.js +1 -0
  306. package/web/dist/assets/task-commits-CVjZWXuP.js +1 -0
  307. package/web/dist/assets/task-files-f7USaQD1.js +2 -0
  308. package/web/dist/assets/task-thread-Cc7rMyer.js +9 -0
  309. package/web/dist/assets/textarea-BieGhkR-.js +1 -0
  310. package/web/dist/assets/thread-loading-CwfY_3r7.js +1 -0
  311. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-Cmbuh3Q9.js} +1 -1
  312. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-dswtPk4F.js} +1 -1
  313. package/web/dist/assets/{upload-CDdyPPo_.js → upload-BY1qMAxW.js} +1 -1
  314. package/web/dist/assets/use-desktop-DrxT9b31.js +1 -0
  315. package/web/dist/assets/use-submit-shortcut-CULpfw9y.js +1 -0
  316. package/web/dist/assets/utils-C5bzdO9U.js +64 -0
  317. package/web/dist/assets/workflows-D6GsX0A9.js +11 -0
  318. package/web/dist/assets/zoomable-image-CEjRqsuW.js +1 -0
  319. package/web/dist/index.html +33 -13
  320. package/scripts/dev.mjs +0 -74
  321. package/scripts/release-snapshot.mjs +0 -130
  322. package/scripts/release.mjs +0 -119
  323. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  324. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  325. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  326. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  327. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  328. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  329. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  330. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  331. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  332. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  333. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  334. package/web/dist/assets/index-DzroxqBG.css +0 -2
  335. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  336. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  337. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  338. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  339. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  340. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  341. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  342. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  343. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  344. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  345. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  346. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  347. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  348. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  349. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  350. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  351. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  352. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  353. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  354. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  355. /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
package/dist/todos.js CHANGED
@@ -121,7 +121,7 @@ export async function removeTodo(dataDir, id) {
121
121
  /** The task text "▶ Run" turns an entry into: the suggested prompt (or the summary when the
122
122
  * entry carries none), plus the suggested args as a trailing line. The single server-side
123
123
  * source for `POST /api/todos/:id/start`; the cockpit's prefill copy
124
- * (`web/app/src/routes/inbox.tsx`, #374) lives in another process and cannot import this, so
124
+ * (`packages/web/src/routes/inbox.tsx`, #374) lives in another process and cannot import this, so
125
125
  * the two are pinned to the shared cases in `test/fixtures/todo-task-text.json`. */
126
126
  export function todoTaskText(todo) {
127
127
  let task = (todo.suggestedPrompt ?? todo.summary).trim() || todo.summary;
@@ -1,3 +1,4 @@
1
+ import type { UiState } from './contract/index.js';
1
2
  /**
2
3
  * `.ai/cezar/ui-state.json` — small GUI preferences the cockpit persists (files, not a DB).
3
4
  * The server owns the schema and the writes (`PUT /api/ui-state` in `src/server/server.ts`);
@@ -8,5 +9,18 @@
8
9
  * `{}` — an absent preference, never a throw, never a blocked startup.
9
10
  */
10
11
  export declare function uiStatePath(repoRoot: string): string;
11
- /** Read `ui-state.json` on demand — never cached, never throws. */
12
- export declare function readUiState(repoRoot: string): Promise<Record<string, unknown>>;
12
+ /**
13
+ * Read `ui-state.json` on demand — never cached, never throws.
14
+ *
15
+ * Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
16
+ * value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
17
+ * per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
18
+ * `z.looseObject`, so the index signature (and with it the round-trip promise of
19
+ * BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
20
+ *
21
+ * The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
22
+ * through the schema, because a single malformed pref must not discard the whole bag (§3). What
23
+ * the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
24
+ * by `uiStateBody`) is what actually enforces it.
25
+ */
26
+ export declare function readUiState(repoRoot: string): Promise<UiState>;
package/dist/ui-state.js CHANGED
@@ -12,7 +12,20 @@ import { join } from 'node:path';
12
12
  export function uiStatePath(repoRoot) {
13
13
  return join(repoRoot, '.ai/cezar', 'ui-state.json');
14
14
  }
15
- /** Read `ui-state.json` on demand — never cached, never throws. */
15
+ /**
16
+ * Read `ui-state.json` on demand — never cached, never throws.
17
+ *
18
+ * Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
19
+ * value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
20
+ * per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
21
+ * `z.looseObject`, so the index signature (and with it the round-trip promise of
22
+ * BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
23
+ *
24
+ * The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
25
+ * through the schema, because a single malformed pref must not discard the whole bag (§3). What
26
+ * the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
27
+ * by `uiStateBody`) is what actually enforces it.
28
+ */
16
29
  export async function readUiState(repoRoot) {
17
30
  try {
18
31
  const parsed = JSON.parse(await readFile(uiStatePath(repoRoot), 'utf8'));
@@ -1 +1 @@
1
- {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type WorkflowDef } from './types.js';
1
+ import { type WorkflowDef } from './types.ts';
2
2
  export declare const WORKFLOWS_DIR = ".ai/cezar/workflows";
3
3
  export interface WorkflowLoadIssue {
4
4
  path: string;
@@ -1,9 +1,9 @@
1
- import type { RunnerId } from '../core/agent-runner.js';
2
- import type { ContentBlock } from '../core/agent-runner.js';
3
- import { type Skill } from '../skills.js';
4
- import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.js';
5
- import { WorkspaceSemaphore } from '../workspace/semaphore.js';
6
- import { type WorkflowDef } from './types.js';
1
+ import type { RunnerId } from '../core/agent-runner.ts';
2
+ import type { ContentBlock } from '../core/agent-runner.ts';
3
+ import { type Skill } from '../skills.ts';
4
+ import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.ts';
5
+ import { WorkspaceSemaphore, type AccountHolds } from '../workspace/semaphore.ts';
6
+ import { type WorkflowDef } from './types.ts';
7
7
  /** An interactive session that hears nothing from the user closes itself. */
8
8
  export declare const IDLE_TIMEOUT_MS: number;
9
9
  /**
@@ -20,11 +20,57 @@ export declare const AUTOSAVE_INTERVAL_MS = 90000;
20
20
  * noise interleaving PR history. The flushes (`autosaveCommit` at turn end and before
21
21
  * a draft PR) are NOT gated: the branch must still end holding the finished state. */
22
22
  export declare function periodicAutosaveEnabled(env?: NodeJS.ProcessEnv): boolean;
23
+ /**
24
+ * Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
25
+ *
26
+ * The wait is the provider's own reset instant plus this grace: resuming AT the boundary races the
27
+ * provider's clock (and its rounding), and one failed resume costs the whole window over again.
28
+ * Thirty seconds is cheap next to five hours and long enough to be past any sane skew.
29
+ */
30
+ export declare const AUTO_RESUME_GRACE_MS = 30000;
31
+ /**
32
+ * Consecutive automatic resumes allowed without a human turn. A resume can only fire after a real
33
+ * reset instant, so this is not a throttle — it is the backstop for the pathological case (a
34
+ * provider that answers "limit reached, retry now" in a loop), and it is deliberately generous
35
+ * enough to sit through a couple of days of five-hour windows.
36
+ */
37
+ export declare const MAX_AUTO_RESUMES = 12;
38
+ /**
39
+ * How long a missed deadline stays worth acting on. The promise is "we pick this up when the
40
+ * window reopens" — kept across a restart or an overnight close, which is the case the feature
41
+ * exists for. A day later it is no longer that promise: the user has moved on, and a task
42
+ * springing back to life is a surprise rather than a service. Such a deadline is retired with a
43
+ * note instead of fired, so the only tasks a sweep can revive are ones someone is still waiting on.
44
+ */
45
+ export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
46
+ /**
47
+ * How often the queue checks that it is not wedged.
48
+ *
49
+ * A hold is the only thing in the engine that can make an idle queue CORRECT, so it is also the
50
+ * only thing that can make a wedged one look correct. This tick is the way out: cheap (a few
51
+ * in-memory checks), unref'd, and it only ever acts when idling has no justification left.
52
+ */
53
+ export declare const QUEUE_WATCHDOG_MS = 60000;
54
+ /**
55
+ * Which agent ACCOUNT a run's work runs on — the thing a provider usage limit actually closes
56
+ * (spec 2026-08-03-auto-resume-after-usage-limit).
57
+ *
58
+ * Backend plus agent account, because those are the two axes a limit is scoped to: a Claude
59
+ * limit must never stall a Codex task, and a second Claude login is a second budget. A record
60
+ * that names no runner has not started yet and will take the configured default, which is what
61
+ * `fallbackRunner` carries; a run that HAS started always carries its resolved runner (execute
62
+ * persists it), and only started runs can be holding.
63
+ */
64
+ export declare function runAccountKey(run: Pick<RunRecord, 'runner' | 'agentProfile'>, fallbackRunner: RunnerId): string;
23
65
  export interface StartRunInput {
24
66
  task: string;
25
67
  model?: string;
26
68
  /** Agent backend chosen for this task (GUI). Unset = the config default. */
27
69
  runner?: RunnerId;
70
+ /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
71
+ * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
72
+ * survives into resume and Continue, and so the thread can say which account did the work. */
73
+ agentProfile?: string;
28
74
  /** Screenshots pasted into the new-task form — persisted when the run is
29
75
  * created and delivered once, with the first agent step's opening message. */
30
76
  images?: ContentBlock[];
@@ -33,9 +79,8 @@ export interface StartRunInput {
33
79
  * `resolveExtraSystemPrompt` for the precedence contract. */
34
80
  systemPrompt?: string;
35
81
  /** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
36
- * working tree instead of an isolated worktree — for read-only skills that
37
- * don't need a branch. Undefined/`true` keeps the default per-task worktree.
38
- * Ignored for variants (they always isolate). */
82
+ * working tree instead of an isolated worktree. Undefined/`true` keeps the
83
+ * default per-task worktree. Ignored for variants (they always isolate). */
39
84
  worktree?: boolean;
40
85
  /** Autonomous mode (#autonomous): the run never parks at `waiting` for the
41
86
  * user — turn-ends auto-continue until the agent signals done or the safety
@@ -123,7 +168,13 @@ export declare class RunManager {
123
168
  private readonly queue;
124
169
  private readonly starting;
125
170
  private readonly waiting;
171
+ /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
172
+ private readonly monitoring;
126
173
  private readonly pendingJobs;
174
+ /** Interrupted agent turns recovered after a process restart. Unlike an
175
+ * explicit user Continue, these are bulk scheduler work and must re-enter
176
+ * through `pump()` so both workspace and per-project caps are honored. */
177
+ private readonly pendingContinuations;
127
178
  /** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
128
179
  * the manager rather than the `ActiveRun` so a *queued* run — which has no
129
180
  * `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
@@ -131,6 +182,12 @@ export declare class RunManager {
131
182
  /** Messages that landed in the dequeue → session-open gap (#472), flushed as
132
183
  * ordinary follow-up turns the moment the session opens. In-memory only. */
133
184
  private readonly deferredMessages;
185
+ /** Armed usage-limit resumes, keyed by run id (spec
186
+ * 2026-08-03-auto-resume-after-usage-limit). The DEADLINE itself lives on the record
187
+ * (`autoResumeAt`) — this map holds only the process-local timer, so a restart rebuilds it
188
+ * from the record rather than losing the wait. Runs here are `failed` and therefore NOT in
189
+ * `active`, which is why the timer cannot live on an `ActiveRun` like the monitoring one. */
190
+ private readonly autoResumeTimers;
134
191
  private pumping;
135
192
  /** A pump that arrived while one was in flight — replayed by `pump()`'s own
136
193
  * loop so a slot freed mid-sweep is never a lost wakeup. */
@@ -149,6 +206,13 @@ export declare class RunManager {
149
206
  /** Unsubscribe handle for the constructor's `onUsage` subscription — released
150
207
  * by dispose() so a torn-down manager stops receiving sampler ticks. */
151
208
  private readonly offUsage;
209
+ /** The stalled-queue watchdog (see `rescueStalledQueue`). */
210
+ private readonly queueWatchdog;
211
+ /** Set by the watchdog for exactly one sweep: ignore the usage-limit hold and make progress. */
212
+ private forceNextPump;
213
+ /** Runs the watchdog started despite the hold. The spawn-time gate (`requeueWhileHeld`) would
214
+ * otherwise hand them straight back and the rescue would undo itself in a millisecond. */
215
+ private readonly forceStarted;
152
216
  /** The workspace-wide parallel-cap semaphore + cached resource config
153
217
  * (spec 2026-07-20, step 2.5). Boot constructs ONE and every manager shares
154
218
  * it; the private fallback keeps single-manager callers and tests working. */
@@ -188,6 +252,25 @@ export declare class RunManager {
188
252
  * write follow-ups into the parent's inbox despite the opt-out. Empty is the
189
253
  * established "absent" spelling — consumers guard with `if (todosFile)`. */
190
254
  private agentEnv;
255
+ /**
256
+ * `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
257
+ * 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
258
+ *
259
+ * Resolved per step, not per run, because a workflow can mix backends: an override naming a
260
+ * Claude account says nothing about which Codex account a codex step should use. Resolution
261
+ * order, most specific first:
262
+ *
263
+ * 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
264
+ * account that created the session, whatever the project has since been switched to;
265
+ * 2. the run's composer override, but only for steps on the run's own runner;
266
+ * 3. the project's stored selection, and failing that the discovered default.
267
+ *
268
+ * Read fresh every time. `~/.cezar/config.json` is shared by every cezar process on this
269
+ * machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
270
+ * spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
271
+ * exactly the behaviour that predates profiles.
272
+ */
273
+ private agentEnvForStep;
191
274
  startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
192
275
  groupId: string;
193
276
  variant: string;
@@ -235,6 +318,22 @@ export declare class RunManager {
235
318
  * root (spec 006 degradation rule), which is always the tighter bound.
236
319
  */
237
320
  private pump;
321
+ /**
322
+ * Make one `queued` RECORD executable again — the engine half a queued run needs but does not
323
+ * persist (`pendingJobs` / `pendingContinuations` are process-local, the record is not).
324
+ *
325
+ * Two callers, one path: boot recovery re-adopts everything the previous process was holding,
326
+ * and the queue watchdog re-adopts anything the running process has somehow lost. A queued
327
+ * record with no work item behind it is invisible to `pump()` and would sit there for good,
328
+ * which is the worst failure this engine has — the task is neither running nor failed, just
329
+ * silently never going to happen.
330
+ *
331
+ * A continuation is reconstructed first: its executable details are gone, but the pending
332
+ * `continue-N` step and the session before it are durable, which is enough. Otherwise the
333
+ * workflow is revived from the record. A run that can be neither is failed loudly rather than
334
+ * left in the queue as a ghost.
335
+ */
336
+ private reviveQueuedRun;
238
337
  /**
239
338
  * Startup recovery (#367) — re-adopt runs that were live when the previous
240
339
  * cezar process exited (requires the store opened with `keepLive`):
@@ -251,6 +350,97 @@ export declare class RunManager {
251
350
  private reviveWorkflow;
252
351
  /** Remove a run from the live registries — keeps `waiting ⊆ active`. */
253
352
  private dropActive;
353
+ /**
354
+ * A run just failed: if the provider said "usage limit, back at T", promise to resume it at
355
+ * `T + AUTO_RESUME_GRACE_MS` instead of leaving the task dead until someone notices.
356
+ *
357
+ * Every refusal below is silent-but-honest — the run stays `failed` with its Continue button,
358
+ * which is exactly the pre-feature behavior — except the safety cap, which says so on the
359
+ * transcript, because a run that stops resuming itself needs to explain why.
360
+ */
361
+ private scheduleAutoResumeIfLimited;
362
+ /** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. */
363
+ private armAutoResume;
364
+ /**
365
+ * The window has reopened. Re-check the record synchronously — hours may have passed, and the
366
+ * user may have continued, deleted or cancelled the run in them — then hand the resume to the
367
+ * ordinary queued-continuation path so it obeys both concurrency caps like any other work.
368
+ */
369
+ private fireAutoResume;
370
+ /**
371
+ * Make the armed timers agree with the records and the current setting. Runs on every `pump()`
372
+ * — which is where a settings change lands (a config PUT refreshes the shared semaphore, which
373
+ * pumps every manager) — and once from `recover()`.
374
+ *
375
+ * It is a RECONCILE rather than a one-shot restore because the deadline is durable state and
376
+ * the timer is not: a restart, a rebuilt project context, a manager disposed mid-wait, or a
377
+ * refusal all leave a record promising a resume that no timer is holding. Rebuilding from the
378
+ * record covers every one of those at once — the alternative is a hint counting down to a time
379
+ * that has already passed, which is exactly the failure this method exists to make impossible.
380
+ *
381
+ * Cheap: an in-memory scan, and arming is skipped for every run already held.
382
+ */
383
+ private reconcileAutoResumes;
384
+ /**
385
+ * Hand a run that has not spawned anything back to the queue, when the account it would run on
386
+ * went into a usage-limit hold (spec 2026-08-03-auto-resume-after-usage-limit).
387
+ *
388
+ * The dequeue-time gate in `pump()` cannot be the only one: a run can sit between dequeue and
389
+ * spawn for a long time — an in-place run waiting for the exclusive repo-root lease is the
390
+ * measured case — and the account can close in that gap. This is the last honest moment to
391
+ * refuse, because everything after it costs a real agent turn.
392
+ *
393
+ * "Untouched" is the contract: the run has created no session and no worktree, so it goes back
394
+ * as plain `queued` with its `startedAt` cleared, and `pump()` will pick it up when the window
395
+ * reopens. Returns true when the caller must abandon the run.
396
+ */
397
+ private requeueWhileHeld;
398
+ /**
399
+ * The failsafe: a queue must never be able to wedge.
400
+ *
401
+ * Everything else in this file makes an idle queue CORRECT under some condition — a slot cap, a
402
+ * repo-root lease, and now a usage-limit hold. That is also what makes a wedged queue look
403
+ * correct, and the hold has already produced one in the field: two resumes fired together, each
404
+ * holding the account the other was waiting on, and the whole workspace stopped with every task
405
+ * `queued`. That specific bug is fixed and tested, but "the queue stopped and nothing will ever
406
+ * restart it" is too expensive a failure mode to leave resting on any single fix being right.
407
+ *
408
+ * The test is deliberately about JUSTIFICATION rather than about any particular bug: idling is
409
+ * legitimate while work is running (here or in another project), or while a real appointment is
410
+ * still ahead — a scheduled resume that will fire and pump on its own. Anything else is a
411
+ * queue with work in it, nothing running anywhere, and no event coming to wake it. That gets one
412
+ * forced sweep, which starts work under the ordinary caps and lets the account's real state
413
+ * re-assert itself: if the window truly is shut, that task meets the limit and re-establishes an
414
+ * honest hold, with a real deadline behind it this time.
415
+ *
416
+ * Public so a test can drive the wedge directly instead of waiting out the interval.
417
+ */
418
+ rescueStalledQueue(now?: number): Promise<void>;
419
+ /**
420
+ * The accounts this project is currently holding: one key per run parked on a usage-limit
421
+ * resume that has not come due yet (spec 2026-08-03-auto-resume-after-usage-limit).
422
+ *
423
+ * Published to the shared semaphore so the hold spans PROJECTS — one Claude account can be
424
+ * driving tasks in three repos, and a limit closes it for all of them. Derived from the
425
+ * records on every ask rather than tracked as state: a deadline that passes, a resume that
426
+ * fires, a cancel, an archive and a delete all lift the hold with no bookkeeping.
427
+ *
428
+ * Deliberately excludes a deadline that has already passed — that run is about to resume, and
429
+ * holding the queue for it would only stall the very work the window reopened for.
430
+ */
431
+ accountHolds(now?: number): AccountHolds;
432
+ /**
433
+ * The PER-TASK off switch (`DELETE /api/v1/runs/:id/auto-resume`, and the archive route):
434
+ * stop resuming THIS task, without touching the workspace setting or any other task.
435
+ *
436
+ * Idempotent — a run with nothing pending answers the same way, because "this task will not
437
+ * resume itself" is equally true either way. Returns false only when the run does not exist,
438
+ * which is the route's 404.
439
+ */
440
+ cancelAutoResume(runId: string): boolean;
441
+ /** Retire a pending resume — timer, deadline and counter. The counter goes too because every
442
+ * caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
443
+ private clearAutoResume;
254
444
  /** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
255
445
  * `cez/<id8>` branch kept. Best-effort; a failure never affects run
256
446
  * lifecycle. `review`/live runs are excluded by the selector. */
@@ -295,12 +485,18 @@ export declare class RunManager {
295
485
  * bound — asserted directly by a test.
296
486
  */
297
487
  private hydrateQueuedInput;
488
+ /** Apply edits and messages made while a restart continuation waits for
489
+ * capacity. The durable record remains the source of truth, just as it is for
490
+ * an ordinary queued workflow (#472), so a second restart reconstructs and
491
+ * hydrates the same amendments instead of dropping them. */
492
+ private hydrateQueuedContinuation;
493
+ private readPersistedImages;
298
494
  /**
299
495
  * Still waiting for a slot? Checked against the engine's own queue rather than
300
496
  * the record's `status` (#472): the record is written by `execute()` a tick
301
497
  * after `pump()` dequeues, so a status read can see `queued` for a run that has
302
- * already started. `pendingJobs` is deleted synchronously at dequeue, so it is
303
- * the authoritative answer for "can this prompt still be amended".
498
+ * already started. The pending maps are deleted synchronously at dequeue, so
499
+ * they are the authoritative answer for "can this prompt still be amended".
304
500
  */
305
501
  private isQueued;
306
502
  /** Split `ContentBlock[]` into the persisted shape a stacked message holds. */
@@ -351,6 +547,9 @@ export declare class RunManager {
351
547
  * then offers "Continue" instead.
352
548
  */
353
549
  sendMessage(runId: string, content: ContentBlock[]): boolean;
550
+ /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
551
+ * bookkeeping without masquerading as user-authored transcript messages. */
552
+ private deliverMessage;
354
553
  /** Close the open session gracefully — the run then completes as `done`
355
554
  * (or rests at `review` when the worktree holds changes, spec 009).
356
555
  * On a run already resting at `review` (no session — the engine loop is
@@ -368,7 +567,10 @@ export declare class RunManager {
368
567
  images?: ContentBlock[];
369
568
  runner?: RunnerId;
370
569
  model?: string;
371
- }): {
570
+ },
571
+ /** Restart recovery may discover several interrupted tasks at once. Those
572
+ * continuations are queued; an explicit user Continue remains immediate. */
573
+ deferForCapacity?: boolean): {
372
574
  ok: boolean;
373
575
  error?: string;
374
576
  };
@@ -389,6 +591,17 @@ export declare class RunManager {
389
591
  /** Native backend asks arrive before turn-end. Persist and park immediately
390
592
  * so the cockpit shows attention and the run releases its workspace slot. */
391
593
  private handleRunnerUiEvent;
594
+ /** Persist the invocation checkpoint before launching a runner. A throw or
595
+ * process exit before `turn.started` therefore leaves a durable mismatch. */
596
+ private beginUsageInvocation;
597
+ /** Fold backend-neutral completed-turn usage into the current step exactly
598
+ * once. Invocation/turn counters are written before the event reaches the
599
+ * NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
600
+ private recordUsageUiEvent;
601
+ /** Usage completeness is a crash boundary, unlike high-frequency token
602
+ * snapshots: the checkpoint must reach `runs.json` before the runner starts
603
+ * or the matching UI event is persisted and forwarded. */
604
+ private persistUsageCheckpoint;
392
605
  /**
393
606
  * Turn-end bookkeeping (#389), shared by `runAgentStep` and
394
607
  * `runContinuation` — called (fire-and-forget) from every `turn-end` event:
@@ -464,6 +677,9 @@ export declare class RunManager {
464
677
  private persistImage;
465
678
  private armIdleTimer;
466
679
  private clearIdleTimer;
680
+ private reconcileMonitoringWakeTimers;
681
+ private armMonitoringWakeTimer;
682
+ private clearMonitoringWakeTimer;
467
683
  /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
468
684
  * Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
469
685
  private armAutosave;
@@ -492,3 +708,13 @@ export declare function makeRunTitle(task: string, workflow: WorkflowDef): strin
492
708
  * they are materialized into the worktree separately (see the call site).
493
709
  */
494
710
  export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
711
+ /**
712
+ * Expand a registry-backed slash skill in a live chat message before it reaches
713
+ * a backend. Claude otherwise intercepts an unknown leading slash command, and
714
+ * Codex/OpenCode have no native slash-skill lookup at all (#676).
715
+ *
716
+ * Only the first text block is eligible, only at character zero, and unknown
717
+ * commands pass through byte-for-byte. The caller persists the original user
718
+ * content before applying this delivery-only rewrite.
719
+ */
720
+ export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];