@open-mercato/cezar 0.9.1 → 0.9.2-pr710.1256

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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -32
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +9 -1
  7. package/dist/agent-config/catalog.js +18 -0
  8. package/dist/agent-config/catalog.js.map +1 -1
  9. package/dist/agent-config/files.d.ts +1 -1
  10. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  11. package/dist/agent-config/model-settings/claude.js +11 -0
  12. package/dist/agent-config/model-settings/claude.js.map +1 -0
  13. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  14. package/dist/agent-config/model-settings/codex.js +16 -0
  15. package/dist/agent-config/model-settings/codex.js.map +1 -0
  16. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  17. package/dist/agent-config/model-settings/opencode.js +8 -0
  18. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  19. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  20. package/dist/agent-config/model-settings/pi.js +18 -0
  21. package/dist/agent-config/model-settings/pi.js.map +1 -0
  22. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  23. package/dist/agent-config/model-settings/shared.js +93 -0
  24. package/dist/agent-config/model-settings/shared.js.map +1 -0
  25. package/dist/agent-config/model-settings/types.d.ts +9 -0
  26. package/dist/agent-config/model-settings/types.js +2 -0
  27. package/dist/agent-config/model-settings/types.js.map +1 -0
  28. package/dist/agent-config/models.d.ts +9 -0
  29. package/dist/agent-config/models.js +32 -0
  30. package/dist/agent-config/models.js.map +1 -0
  31. package/dist/agent-config/service.d.ts +1 -1
  32. package/dist/agent-config/service.js +4 -4
  33. package/dist/agent-config/service.js.map +1 -1
  34. package/dist/agent-config/validate.d.ts +1 -1
  35. package/dist/automations/coordinator.d.ts +26 -0
  36. package/dist/automations/coordinator.js +66 -0
  37. package/dist/automations/coordinator.js.map +1 -0
  38. package/dist/automations/github-poller.d.ts +74 -0
  39. package/dist/automations/github-poller.js +234 -0
  40. package/dist/automations/github-poller.js.map +1 -0
  41. package/dist/automations/scheduler.d.ts +42 -0
  42. package/dist/automations/scheduler.js +192 -0
  43. package/dist/automations/scheduler.js.map +1 -0
  44. package/dist/automations/store.d.ts +65 -0
  45. package/dist/automations/store.js +298 -0
  46. package/dist/automations/store.js.map +1 -0
  47. package/dist/automations/task-template.d.ts +18 -0
  48. package/dist/automations/task-template.js +95 -0
  49. package/dist/automations/task-template.js.map +1 -0
  50. package/dist/automations/types.d.ts +255 -0
  51. package/dist/automations/types.js +159 -0
  52. package/dist/automations/types.js.map +1 -0
  53. package/dist/config.d.ts +19 -112
  54. package/dist/config.js +48 -5
  55. package/dist/config.js.map +1 -1
  56. package/dist/contract/agent-config.d.ts +153 -0
  57. package/dist/contract/agent-profiles.d.ts +347 -0
  58. package/dist/contract/automations.d.ts +935 -0
  59. package/dist/contract/events.d.ts +104 -0
  60. package/dist/contract/github.d.ts +467 -0
  61. package/dist/contract/health.d.ts +102 -0
  62. package/dist/contract/index.d.ts +16 -0
  63. package/dist/contract/index.js +1830 -0
  64. package/dist/contract/projects.d.ts +210 -0
  65. package/dist/contract/repo.d.ts +234 -0
  66. package/dist/contract/runs.d.ts +1407 -0
  67. package/dist/contract/skills.d.ts +232 -0
  68. package/dist/contract/workflows.d.ts +218 -0
  69. package/dist/contract/workspace.d.ts +577 -0
  70. package/dist/core/agent-env.d.ts +1 -1
  71. package/dist/core/agent-env.js +41 -16
  72. package/dist/core/agent-env.js.map +1 -1
  73. package/dist/core/agent-model-policy.d.ts +10 -0
  74. package/dist/core/agent-model-policy.js +36 -0
  75. package/dist/core/agent-model-policy.js.map +1 -0
  76. package/dist/core/agent-profiles.d.ts +62 -0
  77. package/dist/core/agent-profiles.js +90 -0
  78. package/dist/core/agent-profiles.js.map +1 -0
  79. package/dist/core/agent-runner.d.ts +49 -7
  80. package/dist/core/agent-runner.js +48 -3
  81. package/dist/core/agent-runner.js.map +1 -1
  82. package/dist/core/ask.d.ts +45 -124
  83. package/dist/core/ask.js +103 -13
  84. package/dist/core/ask.js.map +1 -1
  85. package/dist/core/backend-detect.d.ts +5 -5
  86. package/dist/core/backend-detect.js +44 -7
  87. package/dist/core/backend-detect.js.map +1 -1
  88. package/dist/core/claude-cli-runner.d.ts +2 -2
  89. package/dist/core/claude-cli-runner.js +61 -13
  90. package/dist/core/claude-cli-runner.js.map +1 -1
  91. package/dist/core/claude-ui-mapper.d.ts +1 -1
  92. package/dist/core/codex-app-server-runner.d.ts +1 -1
  93. package/dist/core/codex-app-server-runner.js +65 -3
  94. package/dist/core/codex-app-server-runner.js.map +1 -1
  95. package/dist/core/codex-app-server-transport.d.ts +6 -1
  96. package/dist/core/codex-app-server-transport.js +17 -3
  97. package/dist/core/codex-app-server-transport.js.map +1 -1
  98. package/dist/core/codex-model-catalog.d.ts +1 -1
  99. package/dist/core/codex-ui-mapper.d.ts +5 -1
  100. package/dist/core/codex-ui-mapper.js +74 -17
  101. package/dist/core/codex-ui-mapper.js.map +1 -1
  102. package/dist/core/model-identity.d.ts +24 -12
  103. package/dist/core/model-identity.js +41 -24
  104. package/dist/core/model-identity.js.map +1 -1
  105. package/dist/core/model-presets.d.ts +10 -4
  106. package/dist/core/model-presets.js +52 -9
  107. package/dist/core/model-presets.js.map +1 -1
  108. package/dist/core/opencode-model-catalog.d.ts +30 -0
  109. package/dist/core/opencode-model-catalog.js +126 -0
  110. package/dist/core/opencode-model-catalog.js.map +1 -0
  111. package/dist/core/opencode-server-runner.d.ts +2 -2
  112. package/dist/core/opencode-ui-mapper.d.ts +4 -1
  113. package/dist/core/opencode-ui-mapper.js +45 -7
  114. package/dist/core/opencode-ui-mapper.js.map +1 -1
  115. package/dist/core/pi-runner.d.ts +24 -0
  116. package/dist/core/pi-runner.js +349 -0
  117. package/dist/core/pi-runner.js.map +1 -0
  118. package/dist/core/pi-ui-mapper.d.ts +34 -0
  119. package/dist/core/pi-ui-mapper.js +270 -0
  120. package/dist/core/pi-ui-mapper.js.map +1 -0
  121. package/dist/core/provider-auth.d.ts +154 -0
  122. package/dist/core/provider-auth.js +509 -0
  123. package/dist/core/provider-auth.js.map +1 -0
  124. package/dist/core/provider-availability.d.ts +3 -0
  125. package/dist/core/provider-availability.js +14 -0
  126. package/dist/core/provider-availability.js.map +1 -0
  127. package/dist/core/runner-factory.d.ts +1 -1
  128. package/dist/core/runner-factory.js +3 -0
  129. package/dist/core/runner-factory.js.map +1 -1
  130. package/dist/core/runner-model-catalog.d.ts +1 -1
  131. package/dist/core/shell-env.d.ts +28 -0
  132. package/dist/core/shell-env.js +56 -0
  133. package/dist/core/shell-env.js.map +1 -0
  134. package/dist/core/tool-display.d.ts +1 -1
  135. package/dist/core/ui-events.d.ts +2 -2
  136. package/dist/core/ui-events.js +1 -1
  137. package/dist/core/usage-limit.d.ts +42 -0
  138. package/dist/core/usage-limit.js +209 -0
  139. package/dist/core/usage-limit.js.map +1 -0
  140. package/dist/git-diff-base.d.ts +85 -0
  141. package/dist/git-diff-base.js +180 -0
  142. package/dist/git-diff-base.js.map +1 -0
  143. package/dist/git-worktree.d.ts +46 -6
  144. package/dist/git-worktree.js +46 -9
  145. package/dist/git-worktree.js.map +1 -1
  146. package/dist/handoff.d.ts +2 -2
  147. package/dist/handoff.js +1 -1
  148. package/dist/index.js +66 -8
  149. package/dist/index.js.map +1 -1
  150. package/dist/paths.d.ts +69 -6
  151. package/dist/paths.js +86 -9
  152. package/dist/paths.js.map +1 -1
  153. package/dist/planner.d.ts +2 -2
  154. package/dist/planner.js +7 -1
  155. package/dist/planner.js.map +1 -1
  156. package/dist/release/manifests.d.ts +81 -0
  157. package/dist/release/manifests.js +74 -0
  158. package/dist/release/manifests.js.map +1 -0
  159. package/dist/release/snapshot.d.ts +9 -23
  160. package/dist/release/snapshot.js +9 -22
  161. package/dist/release/snapshot.js.map +1 -1
  162. package/dist/release/stable.d.ts +15 -29
  163. package/dist/release/stable.js +14 -27
  164. package/dist/release/stable.js.map +1 -1
  165. package/dist/runs/agent-tmpdir.d.ts +41 -0
  166. package/dist/runs/agent-tmpdir.js +183 -0
  167. package/dist/runs/agent-tmpdir.js.map +1 -0
  168. package/dist/runs/auto-name.d.ts +1 -1
  169. package/dist/runs/auto-name.js +6 -1
  170. package/dist/runs/auto-name.js.map +1 -1
  171. package/dist/runs/event-history.d.ts +50 -0
  172. package/dist/runs/event-history.js +613 -0
  173. package/dist/runs/event-history.js.map +1 -0
  174. package/dist/runs/retention.d.ts +1 -1
  175. package/dist/runs/run-index.d.ts +19 -0
  176. package/dist/runs/run-index.js +43 -0
  177. package/dist/runs/run-index.js.map +1 -0
  178. package/dist/runs/store.d.ts +209 -344
  179. package/dist/runs/store.js +298 -39
  180. package/dist/runs/store.js.map +1 -1
  181. package/dist/runs/ui-event-sink.d.ts +1 -1
  182. package/dist/server/app-type.d.ts +21 -0
  183. package/dist/server/app-type.js +2 -0
  184. package/dist/server/app-type.js.map +1 -0
  185. package/dist/server/capabilities.d.ts +21 -6
  186. package/dist/server/capabilities.js +27 -1
  187. package/dist/server/capabilities.js.map +1 -1
  188. package/dist/server/forge/github.d.ts +58 -151
  189. package/dist/server/forge/github.js +530 -6
  190. package/dist/server/forge/github.js.map +1 -1
  191. package/dist/server/forge/index.d.ts +19 -3
  192. package/dist/server/forge/index.js +28 -1
  193. package/dist/server/forge/index.js.map +1 -1
  194. package/dist/server/forge/types.d.ts +86 -1
  195. package/dist/server/git-changes.d.ts +10 -8
  196. package/dist/server/git-changes.js +19 -17
  197. package/dist/server/git-changes.js.map +1 -1
  198. package/dist/server/git.d.ts +2 -0
  199. package/dist/server/git.js +9 -0
  200. package/dist/server/git.js.map +1 -1
  201. package/dist/server/github.d.ts +3 -3
  202. package/dist/server/github.js +1 -1
  203. package/dist/server/github.js.map +1 -1
  204. package/dist/server/open-in-app.d.ts +2 -1
  205. package/dist/server/open-in-app.js +3 -1
  206. package/dist/server/open-in-app.js.map +1 -1
  207. package/dist/server/open-in-terminal.d.ts +46 -1
  208. package/dist/server/open-in-terminal.js +72 -13
  209. package/dist/server/open-in-terminal.js.map +1 -1
  210. package/dist/server/pr.d.ts +2 -2
  211. package/dist/server/project-context.d.ts +20 -3
  212. package/dist/server/project-context.js +30 -1
  213. package/dist/server/project-context.js.map +1 -1
  214. package/dist/server/provider-action-gate.d.ts +8 -0
  215. package/dist/server/provider-action-gate.js +56 -0
  216. package/dist/server/provider-action-gate.js.map +1 -0
  217. package/dist/server/provider-auth-runtime.d.ts +21 -0
  218. package/dist/server/provider-auth-runtime.js +66 -0
  219. package/dist/server/provider-auth-runtime.js.map +1 -0
  220. package/dist/server/server.d.ts +12802 -47
  221. package/dist/server/server.js +2857 -949
  222. package/dist/server/server.js.map +1 -1
  223. package/dist/server/validators.d.ts +97 -0
  224. package/dist/server/validators.js +86 -0
  225. package/dist/server/validators.js.map +1 -0
  226. package/dist/server/ws.d.ts +2 -2
  227. package/dist/server/ws.js +2 -2
  228. package/dist/server/ws.js.map +1 -1
  229. package/dist/server-install/engine.d.ts +1 -1
  230. package/dist/server-install/engine.js +5 -18
  231. package/dist/server-install/engine.js.map +1 -1
  232. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  233. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  234. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  235. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  236. package/dist/server-install/state.d.ts +1 -1
  237. package/dist/server-install/steps.d.ts +2 -2
  238. package/dist/server-install/steps.js +6 -2
  239. package/dist/server-install/steps.js.map +1 -1
  240. package/dist/server-install/strategies.d.ts +1 -1
  241. package/dist/server-install/types.d.ts +38 -424
  242. package/dist/server-install/ui.d.ts +1 -1
  243. package/dist/skills-banner.d.ts +7 -6
  244. package/dist/skills-banner.js +7 -6
  245. package/dist/skills-banner.js.map +1 -1
  246. package/dist/skills-remote.d.ts +2 -2
  247. package/dist/skills-update.d.ts +88 -0
  248. package/dist/skills-update.js +392 -0
  249. package/dist/skills-update.js.map +1 -0
  250. package/dist/skills.d.ts +2 -0
  251. package/dist/skills.js +7 -2
  252. package/dist/skills.js.map +1 -1
  253. package/dist/todos.d.ts +2 -28
  254. package/dist/todos.js +1 -1
  255. package/dist/ui-state.d.ts +16 -2
  256. package/dist/ui-state.js +14 -1
  257. package/dist/ui-state.js.map +1 -1
  258. package/dist/workflows/load.d.ts +1 -1
  259. package/dist/workflows/run.d.ts +276 -15
  260. package/dist/workflows/run.js +1261 -159
  261. package/dist/workflows/run.js.map +1 -1
  262. package/dist/workflows/types.d.ts +62 -224
  263. package/dist/workflows/types.js +25 -2
  264. package/dist/workflows/types.js.map +1 -1
  265. package/dist/workspace/agent-accounts.d.ts +153 -0
  266. package/dist/workspace/agent-accounts.js +304 -0
  267. package/dist/workspace/agent-accounts.js.map +1 -0
  268. package/dist/workspace/agent-profiles.d.ts +78 -0
  269. package/dist/workspace/agent-profiles.js +115 -0
  270. package/dist/workspace/agent-profiles.js.map +1 -0
  271. package/dist/workspace/config.d.ts +94 -206
  272. package/dist/workspace/config.js +226 -14
  273. package/dist/workspace/config.js.map +1 -1
  274. package/dist/workspace/migrations.d.ts +1 -1
  275. package/dist/workspace/migrations.js +19 -4
  276. package/dist/workspace/migrations.js.map +1 -1
  277. package/dist/workspace/projects-cli.js +54 -4
  278. package/dist/workspace/projects-cli.js.map +1 -1
  279. package/dist/workspace/projects.d.ts +26 -2
  280. package/dist/workspace/projects.js +42 -3
  281. package/dist/workspace/projects.js.map +1 -1
  282. package/dist/workspace/semaphore.d.ts +51 -0
  283. package/dist/workspace/semaphore.js +53 -3
  284. package/dist/workspace/semaphore.js.map +1 -1
  285. package/dist/workspace/ui-state.d.ts +16 -5
  286. package/dist/workspace/ui-state.js +18 -7
  287. package/dist/workspace/ui-state.js.map +1 -1
  288. package/package.json +17 -39
  289. package/scripts/inline-contract.mjs +112 -0
  290. package/scripts/mock-claude.mjs +59 -1
  291. package/scripts/mock-pi-rpc.mjs +83 -0
  292. package/scripts/sync-readme.mjs +20 -0
  293. package/web/dist/assets/alert-dialog-BVs3QSmP.js +1 -0
  294. package/web/dist/assets/arrow-down-D7T7XuF6.js +1 -0
  295. package/web/dist/assets/arrow-left-B1dRFd8y.js +1 -0
  296. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  297. package/web/dist/assets/centered-state-DdRLYi9u.js +43 -0
  298. package/web/dist/assets/chevron-right-Dh0t3AL8.js +1 -0
  299. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  300. package/web/dist/assets/circle-check-4FDOlh9u.js +1 -0
  301. package/web/dist/assets/circle-x-CgTVbqX5.js +1 -0
  302. package/web/dist/assets/collapsible-BoADzTok.js +1 -0
  303. package/web/dist/assets/commit-list-BCcCkRbU.js +1 -0
  304. package/web/dist/assets/compare-variants-B7gTgGqR.js +1 -0
  305. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  306. package/web/dist/assets/diff-ecfV3-op.js +3 -0
  307. package/web/dist/assets/diff-stat-C2KGLVnZ.js +1 -0
  308. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-CQtonQ4L.js} +4 -4
  309. package/web/dist/assets/dropdown-menu-WcGoirf2.js +1 -0
  310. package/web/dist/assets/editable-title-SqNK-wuI.js +1 -0
  311. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-ClTFrwit.js} +1 -1
  312. package/web/dist/assets/{file-D4GBh1ao.js → file-BU0mWida.js} +1 -1
  313. package/web/dist/assets/folder-rsgCF0aw.js +1 -0
  314. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-BFhIKb83.js} +1 -1
  315. package/web/dist/assets/git-toolbar-CF1_tzqz.js +1 -0
  316. package/web/dist/assets/github-CyjPz-Ks.js +1 -0
  317. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  318. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  319. package/web/dist/assets/image-preview-iEzCyEmz.js +1 -0
  320. package/web/dist/assets/index-BN09RpYY.css +2 -0
  321. package/web/dist/assets/index-CyG7aE1W.js +7 -0
  322. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  323. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  324. package/web/dist/assets/markdown-CNAa22LB.js +2 -0
  325. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  326. package/web/dist/assets/new-task-form-CWhQZbsX.js +1 -0
  327. package/web/dist/assets/pill-BO5s2x3N.js +1 -0
  328. package/web/dist/assets/project-router-Dm4OhAPE.js +1 -0
  329. package/web/dist/assets/prompt-templates-CP__OCDQ.js +15 -0
  330. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  331. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-DyiysCoP.js} +1 -1
  332. package/web/dist/assets/repo-git-B1WM6N8T.js +1 -0
  333. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  334. package/web/dist/assets/run-diff-CKx4d9Oo.js +3 -0
  335. package/web/dist/assets/run-header-DpbfOtNi.js +1 -0
  336. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-DRvk-6x4.js} +1 -1
  337. package/web/dist/assets/skill-empty-hint-D5vsHfMr.js +1 -0
  338. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  339. package/web/dist/assets/skills-XGltyIJ_.js +1 -0
  340. package/web/dist/assets/sparkles-BugkDxWO.js +1 -0
  341. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-Drp2h-o8.js} +1 -1
  342. package/web/dist/assets/tab-link-CiRLRlnY.js +1 -0
  343. package/web/dist/assets/task-changes-C2hKkEtc.js +1 -0
  344. package/web/dist/assets/task-commits-CwGs_Opa.js +1 -0
  345. package/web/dist/assets/task-files-5KUgFzX3.js +2 -0
  346. package/web/dist/assets/task-thread-B3AFO3SS.js +9 -0
  347. package/web/dist/assets/textarea-Dn90Eun6.js +1 -0
  348. package/web/dist/assets/thread-loading-_1hPuk76.js +1 -0
  349. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-BKEc5Sp2.js} +1 -1
  350. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-BGGPY2C2.js} +1 -1
  351. package/web/dist/assets/{upload-CDdyPPo_.js → upload-B0AQw-mO.js} +1 -1
  352. package/web/dist/assets/use-desktop-CegyTp3X.js +1 -0
  353. package/web/dist/assets/use-submit-shortcut-Mle-9uJp.js +1 -0
  354. package/web/dist/assets/utils-D9GHDNza.js +64 -0
  355. package/web/dist/assets/workflows-3PCz57Z6.js +11 -0
  356. package/web/dist/assets/zoomable-image-DTq7s8CZ.js +1 -0
  357. package/web/dist/index.html +33 -13
  358. package/scripts/dev.mjs +0 -74
  359. package/scripts/release-snapshot.mjs +0 -130
  360. package/scripts/release.mjs +0 -119
  361. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  362. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  363. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  364. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  365. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  366. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  367. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  368. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  369. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  370. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  371. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  372. package/web/dist/assets/index-DzroxqBG.css +0 -2
  373. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  374. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  375. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  376. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  377. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  378. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  379. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  380. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  381. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  382. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  383. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  384. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  385. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  386. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  387. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  388. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  389. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  390. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  391. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  392. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  393. /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,65 @@ 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
+ * Explicitly opt out of the repository-root lease for runs that execute in the
25
+ * current checkout. This covers explicit worktree opt-out, non-Git degradation,
26
+ * and continuations whose worktree cannot be restored (spec 006 hardening, #438).
27
+ * This is intentionally unsafe: concurrent agents may overwrite each other's
28
+ * files or Git state. Isolated worktree runs are unaffected.
29
+ */
30
+ export declare function repositoryRootLockDisabled(env?: NodeJS.ProcessEnv): boolean;
31
+ /**
32
+ * Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
33
+ *
34
+ * The wait is the provider's own reset instant plus this grace: resuming AT the boundary races the
35
+ * provider's clock (and its rounding), and one failed resume costs the whole window over again.
36
+ * Thirty seconds is cheap next to five hours and long enough to be past any sane skew.
37
+ */
38
+ export declare const AUTO_RESUME_GRACE_MS = 30000;
39
+ /**
40
+ * Consecutive automatic resumes allowed without a human turn. A resume can only fire after a real
41
+ * reset instant, so this is not a throttle — it is the backstop for the pathological case (a
42
+ * provider that answers "limit reached, retry now" in a loop), and it is deliberately generous
43
+ * enough to sit through a couple of days of five-hour windows.
44
+ */
45
+ export declare const MAX_AUTO_RESUMES = 12;
46
+ /**
47
+ * How long a missed deadline stays worth acting on. The promise is "we pick this up when the
48
+ * window reopens" — kept across a restart or an overnight close, which is the case the feature
49
+ * exists for. A day later it is no longer that promise: the user has moved on, and a task
50
+ * springing back to life is a surprise rather than a service. Such a deadline is retired with a
51
+ * note instead of fired, so the only tasks a sweep can revive are ones someone is still waiting on.
52
+ */
53
+ export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
54
+ /**
55
+ * How often the queue checks that it is not wedged.
56
+ *
57
+ * A hold is the only thing in the engine that can make an idle queue CORRECT, so it is also the
58
+ * only thing that can make a wedged one look correct. This tick is the way out: cheap (a few
59
+ * in-memory checks), unref'd, and it only ever acts when idling has no justification left.
60
+ */
61
+ export declare const QUEUE_WATCHDOG_MS = 60000;
62
+ /**
63
+ * Which agent ACCOUNT a run's work runs on — the thing a provider usage limit actually closes
64
+ * (spec 2026-08-03-auto-resume-after-usage-limit).
65
+ *
66
+ * Backend plus agent account, because those are the two axes a limit is scoped to: a Claude
67
+ * limit must never stall a Codex task, and a second Claude login is a second budget. A record
68
+ * that names no runner has not started yet and will take the configured default, which is what
69
+ * `fallbackRunner` carries; a run that HAS started always carries its resolved runner (execute
70
+ * persists it), and only started runs can be holding.
71
+ */
72
+ export declare function runAccountKey(run: Pick<RunRecord, 'runner' | 'agentProfile'>, fallbackRunner: RunnerId): string;
23
73
  export interface StartRunInput {
24
74
  task: string;
25
75
  model?: string;
26
76
  /** Agent backend chosen for this task (GUI). Unset = the config default. */
27
77
  runner?: RunnerId;
78
+ /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
79
+ * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
80
+ * survives into resume and Continue, and so the thread can say which account did the work. */
81
+ agentProfile?: string;
28
82
  /** Screenshots pasted into the new-task form — persisted when the run is
29
83
  * created and delivered once, with the first agent step's opening message. */
30
84
  images?: ContentBlock[];
@@ -33,9 +87,8 @@ export interface StartRunInput {
33
87
  * `resolveExtraSystemPrompt` for the precedence contract. */
34
88
  systemPrompt?: string;
35
89
  /** 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). */
90
+ * working tree instead of an isolated worktree. Undefined/`true` keeps the
91
+ * default per-task worktree. Ignored for variants (they always isolate). */
39
92
  worktree?: boolean;
40
93
  /** Autonomous mode (#autonomous): the run never parks at `waiting` for the
41
94
  * user — turn-ends auto-continue until the agent signals done or the safety
@@ -69,6 +122,15 @@ export declare function resolveExtraSystemPrompt(override: string | undefined, c
69
122
  * divider the skill+handoff composition has always used.
70
123
  */
71
124
  export declare function composeSystemPrompt(...parts: Array<string | undefined>): string;
125
+ /**
126
+ * The directories a spawned agent may reach outside its worktree: the run-state
127
+ * folder that holds its handoff file, plus its own temp directory when this run
128
+ * got one (#785). Handing an agent a `TMPDIR` its file tools are not allowed to
129
+ * write would trade one silent failure for another, so the two travel together;
130
+ * under `CEZ_AGENT_TMPDIR=0` there is no per-run directory and the list is
131
+ * exactly what it always was.
132
+ */
133
+ export declare function agentDirectories(runsDir: string, env: Record<string, string>): string[];
72
134
  /**
73
135
  * Materialized pasted attachment: the on-disk name/serving-URL pair the
74
136
  * transcript already used, plus the absolute path that lets the agent
@@ -123,7 +185,13 @@ export declare class RunManager {
123
185
  private readonly queue;
124
186
  private readonly starting;
125
187
  private readonly waiting;
188
+ /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
189
+ private readonly monitoring;
126
190
  private readonly pendingJobs;
191
+ /** Interrupted agent turns recovered after a process restart. Unlike an
192
+ * explicit user Continue, these are bulk scheduler work and must re-enter
193
+ * through `pump()` so both workspace and per-project caps are honored. */
194
+ private readonly pendingContinuations;
127
195
  /** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
128
196
  * the manager rather than the `ActiveRun` so a *queued* run — which has no
129
197
  * `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
@@ -131,14 +199,21 @@ export declare class RunManager {
131
199
  /** Messages that landed in the dequeue → session-open gap (#472), flushed as
132
200
  * ordinary follow-up turns the moment the session opens. In-memory only. */
133
201
  private readonly deferredMessages;
202
+ /** Armed usage-limit resumes, keyed by run id (spec
203
+ * 2026-08-03-auto-resume-after-usage-limit). The DEADLINE itself lives on the record
204
+ * (`autoResumeAt`) — this map holds only the process-local timer, so a restart rebuilds it
205
+ * from the record rather than losing the wait. Runs here are `failed` and therefore NOT in
206
+ * `active`, which is why the timer cannot live on an `ActiveRun` like the monitoring one. */
207
+ private readonly autoResumeTimers;
134
208
  private pumping;
135
209
  /** A pump that arrived while one was in flight — replayed by `pump()`'s own
136
210
  * loop so a slot freed mid-sweep is never a lost wakeup. */
137
211
  private pumpAgain;
138
212
  /**
139
213
  * Runs normally isolate in worktrees and may execute in parallel. When that
140
- * isolation is unavailable (or explicitly disabled), serialize access to
141
- * `repoRoot` so two agents can never edit/revert the same files (#438).
214
+ * isolation is unavailable (or explicitly disabled), access to `repoRoot` is
215
+ * serialized by default so two agents cannot edit/revert the same files
216
+ * (#438). `CEZ_DISABLE_REPO_LOCK=1` deliberately bypasses this safety lease.
142
217
  */
143
218
  private repoRootTail;
144
219
  /** `.ai/cezar` — where the per-task handoff files and todos.json live. */
@@ -149,6 +224,13 @@ export declare class RunManager {
149
224
  /** Unsubscribe handle for the constructor's `onUsage` subscription — released
150
225
  * by dispose() so a torn-down manager stops receiving sampler ticks. */
151
226
  private readonly offUsage;
227
+ /** The stalled-queue watchdog (see `rescueStalledQueue`). */
228
+ private readonly queueWatchdog;
229
+ /** Set by the watchdog for exactly one sweep: ignore the usage-limit hold and make progress. */
230
+ private forceNextPump;
231
+ /** Runs the watchdog started despite the hold. The spawn-time gate (`requeueWhileHeld`) would
232
+ * otherwise hand them straight back and the rescue would undo itself in a millisecond. */
233
+ private readonly forceStarted;
152
234
  /** The workspace-wide parallel-cap semaphore + cached resource config
153
235
  * (spec 2026-07-20, step 2.5). Boot constructs ONE and every manager shares
154
236
  * it; the private fallback keeps single-manager callers and tests working. */
@@ -186,8 +268,33 @@ export declare class RunManager {
186
268
  * key would let a value inherited from *this* process through — a nested
187
269
  * cezar (an agent running `cez serve`/`cez run`/the test suite) would then
188
270
  * write follow-ups into the parent's inbox despite the opt-out. Empty is the
189
- * established "absent" spelling — consumers guard with `if (todosFile)`. */
271
+ * established "absent" spelling — consumers guard with `if (todosFile)`.
272
+ *
273
+ * `TMPDIR`/`TEMP`/`TMP` (#785) point at this run's own scratch directory
274
+ * instead of the machine-wide one every agent used to share. Created and
275
+ * write-probed here, on the last common path before a spawn, so an unusable
276
+ * temp directory throws `AgentTempDirError` at the caller rather than
277
+ * turning into empty command output inside a running agent. */
190
278
  private agentEnv;
279
+ /**
280
+ * `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
281
+ * 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
282
+ *
283
+ * Resolved per step, not per run, because a workflow can mix backends: an override naming a
284
+ * Claude account says nothing about which Codex account a codex step should use. Resolution
285
+ * order, most specific first:
286
+ *
287
+ * 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
288
+ * account that created the session, whatever the project has since been switched to;
289
+ * 2. the run's composer override, but only for steps on the run's own runner;
290
+ * 3. the project's stored selection, and failing that the discovered default.
291
+ *
292
+ * Read fresh every time. `~/.cezar/config.json` is shared by every cezar process on this
293
+ * machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
294
+ * spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
295
+ * exactly the behaviour that predates profiles.
296
+ */
297
+ private agentEnvForStep;
191
298
  startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
192
299
  groupId: string;
193
300
  variant: string;
@@ -235,6 +342,22 @@ export declare class RunManager {
235
342
  * root (spec 006 degradation rule), which is always the tighter bound.
236
343
  */
237
344
  private pump;
345
+ /**
346
+ * Make one `queued` RECORD executable again — the engine half a queued run needs but does not
347
+ * persist (`pendingJobs` / `pendingContinuations` are process-local, the record is not).
348
+ *
349
+ * Two callers, one path: boot recovery re-adopts everything the previous process was holding,
350
+ * and the queue watchdog re-adopts anything the running process has somehow lost. A queued
351
+ * record with no work item behind it is invisible to `pump()` and would sit there for good,
352
+ * which is the worst failure this engine has — the task is neither running nor failed, just
353
+ * silently never going to happen.
354
+ *
355
+ * A continuation is reconstructed first: its executable details are gone, but the pending
356
+ * `continue-N` step and the session before it are durable, which is enough. Otherwise the
357
+ * workflow is revived from the record. A run that can be neither is failed loudly rather than
358
+ * left in the queue as a ghost.
359
+ */
360
+ private reviveQueuedRun;
238
361
  /**
239
362
  * Startup recovery (#367) — re-adopt runs that were live when the previous
240
363
  * cezar process exited (requires the store opened with `keepLive`):
@@ -251,6 +374,97 @@ export declare class RunManager {
251
374
  private reviveWorkflow;
252
375
  /** Remove a run from the live registries — keeps `waiting ⊆ active`. */
253
376
  private dropActive;
377
+ /**
378
+ * A run just failed: if the provider said "usage limit, back at T", promise to resume it at
379
+ * `T + AUTO_RESUME_GRACE_MS` instead of leaving the task dead until someone notices.
380
+ *
381
+ * Every refusal below is silent-but-honest — the run stays `failed` with its Continue button,
382
+ * which is exactly the pre-feature behavior — except the safety cap, which says so on the
383
+ * transcript, because a run that stops resuming itself needs to explain why.
384
+ */
385
+ private scheduleAutoResumeIfLimited;
386
+ /** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. */
387
+ private armAutoResume;
388
+ /**
389
+ * The window has reopened. Re-check the record synchronously — hours may have passed, and the
390
+ * user may have continued, deleted or cancelled the run in them — then hand the resume to the
391
+ * ordinary queued-continuation path so it obeys both concurrency caps like any other work.
392
+ */
393
+ private fireAutoResume;
394
+ /**
395
+ * Make the armed timers agree with the records and the current setting. Runs on every `pump()`
396
+ * — which is where a settings change lands (a config PUT refreshes the shared semaphore, which
397
+ * pumps every manager) — and once from `recover()`.
398
+ *
399
+ * It is a RECONCILE rather than a one-shot restore because the deadline is durable state and
400
+ * the timer is not: a restart, a rebuilt project context, a manager disposed mid-wait, or a
401
+ * refusal all leave a record promising a resume that no timer is holding. Rebuilding from the
402
+ * record covers every one of those at once — the alternative is a hint counting down to a time
403
+ * that has already passed, which is exactly the failure this method exists to make impossible.
404
+ *
405
+ * Cheap: an in-memory scan, and arming is skipped for every run already held.
406
+ */
407
+ private reconcileAutoResumes;
408
+ /**
409
+ * Hand a run that has not spawned anything back to the queue, when the account it would run on
410
+ * went into a usage-limit hold (spec 2026-08-03-auto-resume-after-usage-limit).
411
+ *
412
+ * The dequeue-time gate in `pump()` cannot be the only one: a run can sit between dequeue and
413
+ * spawn for a long time — an in-place run waiting for the exclusive repo-root lease is the
414
+ * measured case — and the account can close in that gap. This is the last honest moment to
415
+ * refuse, because everything after it costs a real agent turn.
416
+ *
417
+ * "Untouched" is the contract: the run has created no session and no worktree, so it goes back
418
+ * as plain `queued` with its `startedAt` cleared, and `pump()` will pick it up when the window
419
+ * reopens. Returns true when the caller must abandon the run.
420
+ */
421
+ private requeueWhileHeld;
422
+ /**
423
+ * The failsafe: a queue must never be able to wedge.
424
+ *
425
+ * Everything else in this file makes an idle queue CORRECT under some condition — a slot cap, a
426
+ * repo-root lease, and now a usage-limit hold. That is also what makes a wedged queue look
427
+ * correct, and the hold has already produced one in the field: two resumes fired together, each
428
+ * holding the account the other was waiting on, and the whole workspace stopped with every task
429
+ * `queued`. That specific bug is fixed and tested, but "the queue stopped and nothing will ever
430
+ * restart it" is too expensive a failure mode to leave resting on any single fix being right.
431
+ *
432
+ * The test is deliberately about JUSTIFICATION rather than about any particular bug: idling is
433
+ * legitimate while work is running (here or in another project), or while a real appointment is
434
+ * still ahead — a scheduled resume that will fire and pump on its own. Anything else is a
435
+ * queue with work in it, nothing running anywhere, and no event coming to wake it. That gets one
436
+ * forced sweep, which starts work under the ordinary caps and lets the account's real state
437
+ * re-assert itself: if the window truly is shut, that task meets the limit and re-establishes an
438
+ * honest hold, with a real deadline behind it this time.
439
+ *
440
+ * Public so a test can drive the wedge directly instead of waiting out the interval.
441
+ */
442
+ rescueStalledQueue(now?: number): Promise<void>;
443
+ /**
444
+ * The accounts this project is currently holding: one key per run parked on a usage-limit
445
+ * resume that has not come due yet (spec 2026-08-03-auto-resume-after-usage-limit).
446
+ *
447
+ * Published to the shared semaphore so the hold spans PROJECTS — one Claude account can be
448
+ * driving tasks in three repos, and a limit closes it for all of them. Derived from the
449
+ * records on every ask rather than tracked as state: a deadline that passes, a resume that
450
+ * fires, a cancel, an archive and a delete all lift the hold with no bookkeeping.
451
+ *
452
+ * Deliberately excludes a deadline that has already passed — that run is about to resume, and
453
+ * holding the queue for it would only stall the very work the window reopened for.
454
+ */
455
+ accountHolds(now?: number): AccountHolds;
456
+ /**
457
+ * The PER-TASK off switch (`DELETE /api/v1/runs/:id/auto-resume`, and the archive route):
458
+ * stop resuming THIS task, without touching the workspace setting or any other task.
459
+ *
460
+ * Idempotent — a run with nothing pending answers the same way, because "this task will not
461
+ * resume itself" is equally true either way. Returns false only when the run does not exist,
462
+ * which is the route's 404.
463
+ */
464
+ cancelAutoResume(runId: string): boolean;
465
+ /** Retire a pending resume — timer, deadline and counter. The counter goes too because every
466
+ * caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
467
+ private clearAutoResume;
254
468
  /** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
255
469
  * `cez/<id8>` branch kept. Best-effort; a failure never affects run
256
470
  * lifecycle. `review`/live runs are excluded by the selector. */
@@ -295,12 +509,18 @@ export declare class RunManager {
295
509
  * bound — asserted directly by a test.
296
510
  */
297
511
  private hydrateQueuedInput;
512
+ /** Apply edits and messages made while a restart continuation waits for
513
+ * capacity. The durable record remains the source of truth, just as it is for
514
+ * an ordinary queued workflow (#472), so a second restart reconstructs and
515
+ * hydrates the same amendments instead of dropping them. */
516
+ private hydrateQueuedContinuation;
517
+ private readPersistedImages;
298
518
  /**
299
519
  * Still waiting for a slot? Checked against the engine's own queue rather than
300
520
  * the record's `status` (#472): the record is written by `execute()` a tick
301
521
  * 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".
522
+ * already started. The pending maps are deleted synchronously at dequeue, so
523
+ * they are the authoritative answer for "can this prompt still be amended".
304
524
  */
305
525
  private isQueued;
306
526
  /** Split `ContentBlock[]` into the persisted shape a stacked message holds. */
@@ -351,6 +571,9 @@ export declare class RunManager {
351
571
  * then offers "Continue" instead.
352
572
  */
353
573
  sendMessage(runId: string, content: ContentBlock[]): boolean;
574
+ /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
575
+ * bookkeeping without masquerading as user-authored transcript messages. */
576
+ private deliverMessage;
354
577
  /** Close the open session gracefully — the run then completes as `done`
355
578
  * (or rests at `review` when the worktree holds changes, spec 009).
356
579
  * On a run already resting at `review` (no session — the engine loop is
@@ -368,7 +591,10 @@ export declare class RunManager {
368
591
  images?: ContentBlock[];
369
592
  runner?: RunnerId;
370
593
  model?: string;
371
- }): {
594
+ },
595
+ /** Restart recovery may discover several interrupted tasks at once. Those
596
+ * continuations are queued; an explicit user Continue remains immediate. */
597
+ deferForCapacity?: boolean): {
372
598
  ok: boolean;
373
599
  error?: string;
374
600
  };
@@ -389,6 +615,17 @@ export declare class RunManager {
389
615
  /** Native backend asks arrive before turn-end. Persist and park immediately
390
616
  * so the cockpit shows attention and the run releases its workspace slot. */
391
617
  private handleRunnerUiEvent;
618
+ /** Persist the invocation checkpoint before launching a runner. A throw or
619
+ * process exit before `turn.started` therefore leaves a durable mismatch. */
620
+ private beginUsageInvocation;
621
+ /** Fold backend-neutral completed-turn usage into the current step exactly
622
+ * once. Invocation/turn counters are written before the event reaches the
623
+ * NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
624
+ private recordUsageUiEvent;
625
+ /** Usage completeness is a crash boundary, unlike high-frequency token
626
+ * snapshots: the checkpoint must reach `runs.json` before the runner starts
627
+ * or the matching UI event is persisted and forwarded. */
628
+ private persistUsageCheckpoint;
392
629
  /**
393
630
  * Turn-end bookkeeping (#389), shared by `runAgentStep` and
394
631
  * `runContinuation` — called (fire-and-forget) from every `turn-end` event:
@@ -464,6 +701,9 @@ export declare class RunManager {
464
701
  private persistImage;
465
702
  private armIdleTimer;
466
703
  private clearIdleTimer;
704
+ private reconcileMonitoringWakeTimers;
705
+ private armMonitoringWakeTimer;
706
+ private clearMonitoringWakeTimer;
467
707
  /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
468
708
  * Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
469
709
  private armAutosave;
@@ -492,3 +732,24 @@ export declare function makeRunTitle(task: string, workflow: WorkflowDef): strin
492
732
  * they are materialized into the worktree separately (see the call site).
493
733
  */
494
734
  export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
735
+ /**
736
+ * Expand a registry-backed slash skill in one prompt string before it reaches a
737
+ * backend. Claude otherwise intercepts an unknown leading slash command, and
738
+ * Codex/OpenCode have no native slash-skill lookup at all (#676).
739
+ *
740
+ * Only a match at character zero counts, and unknown commands pass through
741
+ * byte-for-byte — a backend's OWN slash commands must keep working. The caller
742
+ * persists the original user text before applying this delivery-only rewrite.
743
+ *
744
+ * Both delivery seams route through here: live-session messages via
745
+ * `expandRegistrySlashSkill`, and a continuation's opening prompt, which becomes
746
+ * the session's `userPrompt` and never passes through `deliverMessage` at all
747
+ * (#811).
748
+ */
749
+ export declare function expandRegistrySlashSkillText(text: string, skills: readonly Skill[]): string;
750
+ /**
751
+ * `expandRegistrySlashSkillText` over a live chat message: only the first text
752
+ * block is eligible, and an unchanged block returns the caller's array
753
+ * identity untouched.
754
+ */
755
+ export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];