@open-mercato/cezar 0.9.1 → 0.9.2

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 (300) hide show
  1. package/README.md +19 -11
  2. package/dist/agent-config/catalog.d.ts +1 -1
  3. package/dist/agent-config/files.d.ts +1 -1
  4. package/dist/agent-config/service.d.ts +1 -1
  5. package/dist/agent-config/validate.d.ts +1 -1
  6. package/dist/automations/coordinator.d.ts +26 -0
  7. package/dist/automations/coordinator.js +66 -0
  8. package/dist/automations/coordinator.js.map +1 -0
  9. package/dist/automations/github-poller.d.ts +74 -0
  10. package/dist/automations/github-poller.js +234 -0
  11. package/dist/automations/github-poller.js.map +1 -0
  12. package/dist/automations/scheduler.d.ts +42 -0
  13. package/dist/automations/scheduler.js +192 -0
  14. package/dist/automations/scheduler.js.map +1 -0
  15. package/dist/automations/store.d.ts +65 -0
  16. package/dist/automations/store.js +298 -0
  17. package/dist/automations/store.js.map +1 -0
  18. package/dist/automations/task-template.d.ts +18 -0
  19. package/dist/automations/task-template.js +95 -0
  20. package/dist/automations/task-template.js.map +1 -0
  21. package/dist/automations/types.d.ts +251 -0
  22. package/dist/automations/types.js +158 -0
  23. package/dist/automations/types.js.map +1 -0
  24. package/dist/config.d.ts +9 -111
  25. package/dist/contract/agent-config.d.ts +151 -0
  26. package/dist/contract/automations.d.ts +911 -0
  27. package/dist/contract/events.d.ts +45 -0
  28. package/dist/contract/github.d.ts +467 -0
  29. package/dist/contract/health.d.ts +96 -0
  30. package/dist/contract/index.d.ts +15 -0
  31. package/dist/contract/index.js +1421 -0
  32. package/dist/contract/projects.d.ts +182 -0
  33. package/dist/contract/repo.d.ts +234 -0
  34. package/dist/contract/runs.d.ts +1226 -0
  35. package/dist/contract/skills.d.ts +225 -0
  36. package/dist/contract/workflows.d.ts +212 -0
  37. package/dist/contract/workspace.d.ts +442 -0
  38. package/dist/core/agent-env.d.ts +1 -1
  39. package/dist/core/agent-runner.d.ts +12 -1
  40. package/dist/core/agent-runner.js +13 -0
  41. package/dist/core/agent-runner.js.map +1 -1
  42. package/dist/core/ask.d.ts +45 -124
  43. package/dist/core/ask.js +103 -13
  44. package/dist/core/ask.js.map +1 -1
  45. package/dist/core/claude-cli-runner.d.ts +2 -2
  46. package/dist/core/claude-cli-runner.js +52 -9
  47. package/dist/core/claude-cli-runner.js.map +1 -1
  48. package/dist/core/claude-ui-mapper.d.ts +1 -1
  49. package/dist/core/codex-app-server-runner.d.ts +1 -1
  50. package/dist/core/codex-app-server-runner.js +55 -3
  51. package/dist/core/codex-app-server-runner.js.map +1 -1
  52. package/dist/core/codex-app-server-transport.d.ts +6 -1
  53. package/dist/core/codex-app-server-transport.js +12 -3
  54. package/dist/core/codex-app-server-transport.js.map +1 -1
  55. package/dist/core/codex-model-catalog.d.ts +1 -1
  56. package/dist/core/codex-ui-mapper.d.ts +5 -1
  57. package/dist/core/codex-ui-mapper.js +74 -17
  58. package/dist/core/codex-ui-mapper.js.map +1 -1
  59. package/dist/core/model-identity.d.ts +1 -1
  60. package/dist/core/model-presets.d.ts +2 -2
  61. package/dist/core/model-presets.js +1 -1
  62. package/dist/core/opencode-server-runner.d.ts +2 -2
  63. package/dist/core/opencode-ui-mapper.d.ts +4 -1
  64. package/dist/core/opencode-ui-mapper.js +45 -7
  65. package/dist/core/opencode-ui-mapper.js.map +1 -1
  66. package/dist/core/provider-auth.d.ts +62 -0
  67. package/dist/core/provider-auth.js +290 -0
  68. package/dist/core/provider-auth.js.map +1 -0
  69. package/dist/core/provider-availability.d.ts +3 -0
  70. package/dist/core/provider-availability.js +13 -0
  71. package/dist/core/provider-availability.js.map +1 -0
  72. package/dist/core/runner-factory.d.ts +1 -1
  73. package/dist/core/runner-model-catalog.d.ts +1 -1
  74. package/dist/core/tool-display.d.ts +1 -1
  75. package/dist/core/ui-events.d.ts +1 -1
  76. package/dist/core/ui-events.js +1 -1
  77. package/dist/git-diff-base.d.ts +60 -0
  78. package/dist/git-diff-base.js +54 -0
  79. package/dist/git-diff-base.js.map +1 -0
  80. package/dist/git-worktree.d.ts +37 -6
  81. package/dist/git-worktree.js +39 -9
  82. package/dist/git-worktree.js.map +1 -1
  83. package/dist/handoff.d.ts +2 -2
  84. package/dist/handoff.js +1 -1
  85. package/dist/index.js +65 -8
  86. package/dist/index.js.map +1 -1
  87. package/dist/paths.d.ts +16 -1
  88. package/dist/paths.js +24 -1
  89. package/dist/paths.js.map +1 -1
  90. package/dist/planner.d.ts +2 -2
  91. package/dist/planner.js +1 -1
  92. package/dist/planner.js.map +1 -1
  93. package/dist/release/manifests.d.ts +81 -0
  94. package/dist/release/manifests.js +74 -0
  95. package/dist/release/manifests.js.map +1 -0
  96. package/dist/release/snapshot.d.ts +9 -23
  97. package/dist/release/snapshot.js +9 -22
  98. package/dist/release/snapshot.js.map +1 -1
  99. package/dist/release/stable.d.ts +15 -29
  100. package/dist/release/stable.js +14 -27
  101. package/dist/release/stable.js.map +1 -1
  102. package/dist/runs/auto-name.d.ts +1 -1
  103. package/dist/runs/retention.d.ts +1 -1
  104. package/dist/runs/store.d.ts +142 -336
  105. package/dist/runs/store.js +136 -9
  106. package/dist/runs/store.js.map +1 -1
  107. package/dist/runs/ui-event-sink.d.ts +1 -1
  108. package/dist/server/app-type.d.ts +21 -0
  109. package/dist/server/app-type.js +2 -0
  110. package/dist/server/app-type.js.map +1 -0
  111. package/dist/server/capabilities.d.ts +6 -5
  112. package/dist/server/capabilities.js +11 -0
  113. package/dist/server/capabilities.js.map +1 -1
  114. package/dist/server/forge/github.d.ts +58 -151
  115. package/dist/server/forge/github.js +530 -6
  116. package/dist/server/forge/github.js.map +1 -1
  117. package/dist/server/forge/index.d.ts +10 -3
  118. package/dist/server/forge/index.js +14 -1
  119. package/dist/server/forge/index.js.map +1 -1
  120. package/dist/server/forge/types.d.ts +86 -1
  121. package/dist/server/git-changes.d.ts +8 -8
  122. package/dist/server/git-changes.js +14 -17
  123. package/dist/server/git-changes.js.map +1 -1
  124. package/dist/server/git.d.ts +2 -0
  125. package/dist/server/git.js +9 -0
  126. package/dist/server/git.js.map +1 -1
  127. package/dist/server/github.d.ts +3 -3
  128. package/dist/server/github.js +1 -1
  129. package/dist/server/github.js.map +1 -1
  130. package/dist/server/pr.d.ts +2 -2
  131. package/dist/server/project-context.d.ts +20 -3
  132. package/dist/server/project-context.js +30 -1
  133. package/dist/server/project-context.js.map +1 -1
  134. package/dist/server/provider-action-gate.d.ts +8 -0
  135. package/dist/server/provider-action-gate.js +54 -0
  136. package/dist/server/provider-action-gate.js.map +1 -0
  137. package/dist/server/provider-auth-runtime.d.ts +21 -0
  138. package/dist/server/provider-auth-runtime.js +66 -0
  139. package/dist/server/provider-auth-runtime.js.map +1 -0
  140. package/dist/server/server.d.ts +11142 -47
  141. package/dist/server/server.js +1714 -806
  142. package/dist/server/server.js.map +1 -1
  143. package/dist/server/validators.d.ts +97 -0
  144. package/dist/server/validators.js +86 -0
  145. package/dist/server/validators.js.map +1 -0
  146. package/dist/server/ws.d.ts +2 -2
  147. package/dist/server/ws.js +2 -2
  148. package/dist/server/ws.js.map +1 -1
  149. package/dist/server-install/engine.d.ts +1 -1
  150. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  151. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  152. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  153. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  154. package/dist/server-install/state.d.ts +1 -1
  155. package/dist/server-install/steps.d.ts +2 -2
  156. package/dist/server-install/strategies.d.ts +1 -1
  157. package/dist/server-install/types.d.ts +38 -424
  158. package/dist/server-install/ui.d.ts +1 -1
  159. package/dist/skills-banner.d.ts +7 -6
  160. package/dist/skills-banner.js +7 -6
  161. package/dist/skills-banner.js.map +1 -1
  162. package/dist/skills-remote.d.ts +2 -2
  163. package/dist/skills-update.d.ts +88 -0
  164. package/dist/skills-update.js +392 -0
  165. package/dist/skills-update.js.map +1 -0
  166. package/dist/skills.d.ts +2 -0
  167. package/dist/skills.js +3 -2
  168. package/dist/skills.js.map +1 -1
  169. package/dist/todos.d.ts +2 -28
  170. package/dist/todos.js +1 -1
  171. package/dist/ui-state.d.ts +16 -2
  172. package/dist/ui-state.js +14 -1
  173. package/dist/ui-state.js.map +1 -1
  174. package/dist/workflows/load.d.ts +1 -1
  175. package/dist/workflows/run.d.ts +53 -12
  176. package/dist/workflows/run.js +436 -64
  177. package/dist/workflows/run.js.map +1 -1
  178. package/dist/workflows/types.d.ts +59 -224
  179. package/dist/workflows/types.js +14 -0
  180. package/dist/workflows/types.js.map +1 -1
  181. package/dist/workspace/config.d.ts +68 -206
  182. package/dist/workspace/config.js +145 -14
  183. package/dist/workspace/config.js.map +1 -1
  184. package/dist/workspace/migrations.d.ts +1 -1
  185. package/dist/workspace/migrations.js +19 -4
  186. package/dist/workspace/migrations.js.map +1 -1
  187. package/dist/workspace/projects.d.ts +8 -2
  188. package/dist/workspace/projects.js +9 -3
  189. package/dist/workspace/projects.js.map +1 -1
  190. package/dist/workspace/semaphore.d.ts +6 -0
  191. package/dist/workspace/semaphore.js +14 -1
  192. package/dist/workspace/semaphore.js.map +1 -1
  193. package/dist/workspace/ui-state.d.ts +13 -3
  194. package/dist/workspace/ui-state.js +15 -5
  195. package/dist/workspace/ui-state.js.map +1 -1
  196. package/package.json +17 -39
  197. package/scripts/inline-contract.mjs +112 -0
  198. package/scripts/mock-claude.mjs +39 -1
  199. package/scripts/sync-readme.mjs +20 -0
  200. package/web/dist/assets/alert-dialog-ghffK6g9.js +1 -0
  201. package/web/dist/assets/arrow-down-Cz8qb71e.js +1 -0
  202. package/web/dist/assets/arrow-left-wcYKQXI_.js +1 -0
  203. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  204. package/web/dist/assets/centered-state-ZtnFHA-n.js +43 -0
  205. package/web/dist/assets/chevron-right-G4caF2QV.js +1 -0
  206. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  207. package/web/dist/assets/circle-check--KvBxXWp.js +1 -0
  208. package/web/dist/assets/circle-x-C3EFZ3xf.js +1 -0
  209. package/web/dist/assets/collapsible-B0JVzd0B.js +1 -0
  210. package/web/dist/assets/commit-list-wm6DPHNs.js +1 -0
  211. package/web/dist/assets/compare-variants-DbdP4Y5T.js +1 -0
  212. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  213. package/web/dist/assets/diff-Bizc96qe.js +3 -0
  214. package/web/dist/assets/diff-stat-Dyfg3ltF.js +1 -0
  215. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-CG8ek6tC.js} +4 -4
  216. package/web/dist/assets/dropdown-menu-C1Dlf35P.js +1 -0
  217. package/web/dist/assets/editable-title-5rC_QRBZ.js +1 -0
  218. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-DpGTRqC2.js} +1 -1
  219. package/web/dist/assets/{file-D4GBh1ao.js → file-DlUGpUlb.js} +1 -1
  220. package/web/dist/assets/folder-BAY6Vddy.js +1 -0
  221. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-agOG0iGM.js} +1 -1
  222. package/web/dist/assets/git-toolbar-DGiNMmtY.js +1 -0
  223. package/web/dist/assets/github-Vp7lxYGQ.js +1 -0
  224. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  225. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  226. package/web/dist/assets/image-preview-BWGk5fPX.js +1 -0
  227. package/web/dist/assets/index-DSxyJpuK.css +2 -0
  228. package/web/dist/assets/index-DiawI6RX.js +6 -0
  229. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  230. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  231. package/web/dist/assets/markdown-BGBOGCA_.js +2 -0
  232. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  233. package/web/dist/assets/new-task-form-BpAw_Dks.js +1 -0
  234. package/web/dist/assets/pill-Dvs-P0xy.js +1 -0
  235. package/web/dist/assets/project-router-Cx8NPoqn.js +1 -0
  236. package/web/dist/assets/prompt-templates-CSBYBR1I.js +15 -0
  237. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  238. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-BoGdAykg.js} +1 -1
  239. package/web/dist/assets/repo-git-PmX-BNMo.js +1 -0
  240. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  241. package/web/dist/assets/run-diff-EcOkf3ti.js +3 -0
  242. package/web/dist/assets/run-header-BGiv6_qX.js +1 -0
  243. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-X3EpVhgs.js} +1 -1
  244. package/web/dist/assets/skill-empty-hint-CZLALx6l.js +1 -0
  245. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  246. package/web/dist/assets/skills-CC91ouGH.js +1 -0
  247. package/web/dist/assets/sparkles-Dt4q7pbG.js +1 -0
  248. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-hwBL8XsC.js} +1 -1
  249. package/web/dist/assets/tab-link-DIlR5T07.js +1 -0
  250. package/web/dist/assets/task-changes-XkHDxzQA.js +1 -0
  251. package/web/dist/assets/task-commits-BTTA5k5T.js +1 -0
  252. package/web/dist/assets/task-files-Da8_4C9g.js +2 -0
  253. package/web/dist/assets/task-thread-DoNXUsHr.js +9 -0
  254. package/web/dist/assets/textarea-CUdokhkv.js +1 -0
  255. package/web/dist/assets/thread-loading-B8q8ukXJ.js +1 -0
  256. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-DhVIdWv8.js} +1 -1
  257. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-XYT0DGCI.js} +1 -1
  258. package/web/dist/assets/{upload-CDdyPPo_.js → upload-BKjN59-1.js} +1 -1
  259. package/web/dist/assets/use-desktop-Bf5LS_P4.js +1 -0
  260. package/web/dist/assets/use-submit-shortcut-CzVyoAMd.js +1 -0
  261. package/web/dist/assets/utils-DsLuRXwV.js +64 -0
  262. package/web/dist/assets/workflows-o2QU_pvU.js +11 -0
  263. package/web/dist/assets/zoomable-image-7WyUiaVD.js +1 -0
  264. package/web/dist/index.html +32 -13
  265. package/scripts/dev.mjs +0 -74
  266. package/scripts/release-snapshot.mjs +0 -130
  267. package/scripts/release.mjs +0 -119
  268. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  269. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  270. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  271. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  272. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  273. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  274. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  275. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  276. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  277. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  278. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  279. package/web/dist/assets/index-DzroxqBG.css +0 -2
  280. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  281. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  282. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  283. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  284. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  285. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  286. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  287. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  288. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  289. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  290. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  291. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  292. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  293. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  294. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  295. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  296. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  297. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  298. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  299. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  300. /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
@@ -1,4 +1,4 @@
1
- import type { AgentBackend, AgentRunner, RunnerId } from './agent-runner.js';
1
+ import type { AgentBackend, AgentRunner, RunnerId } from './agent-runner.ts';
2
2
  /**
3
3
  * The single place that maps a backend id onto a concrete runner. Everything
4
4
  * that used to `new ClaudeCliRunner()` (the planner and the workflow engine)
@@ -1,4 +1,4 @@
1
- import type { RunnerId } from './agent-runner.js';
1
+ import type { RunnerId } from './agent-runner.ts';
2
2
  export interface ModelOption {
3
3
  id: string;
4
4
  label: string;
@@ -20,7 +20,7 @@
20
20
  * as tolerance for its non-app-server transports)
21
21
  * - opencode: bash, edit, write, read, grep, glob, webfetch, task, todowrite
22
22
  */
23
- import type { ToolKind } from './ui-events.js';
23
+ import type { ToolKind } from './ui-events.ts';
24
24
  export interface ToolDisplay {
25
25
  toolKind: ToolKind;
26
26
  /** Human line for the card trigger, e.g. "Ran npm test". */
@@ -19,7 +19,7 @@
19
19
  * can migrate one panel at a time.
20
20
  *
21
21
  * This module is pure vocabulary: no runtime imports, no runner coupling.
22
- * Step 2.4 mirrors it into `web/app/src/protocol/`.
22
+ * Mirrored into `packages/api-client/src/protocol/`.
23
23
  */
24
24
  /** The backend that produced a session — mirrors `RunnerId` in
25
25
  * `agent-runner.ts` (kept structurally identical; a type-level test
@@ -19,7 +19,7 @@
19
19
  * can migrate one panel at a time.
20
20
  *
21
21
  * This module is pure vocabulary: no runtime imports, no runner coupling.
22
- * Step 2.4 mirrors it into `web/app/src/protocol/`.
22
+ * Mirrored into `packages/api-client/src/protocol/`.
23
23
  */
24
24
  export {};
25
25
  //# sourceMappingURL=ui-events.js.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * "Which ref anchors *this task's* diff" — the single rule every task-diff
3
+ * surface resolves through (#751).
4
+ *
5
+ * The normal answer is `merge-base(baseBranch, HEAD)`: it keeps a task's diff
6
+ * to the task's own commits even after the base branch moves on, and even
7
+ * after the task merges the base back in.
8
+ *
9
+ * The exception is a **repointed HEAD**. cezar hands the agent a worktree on
10
+ * the task's own branch, but nothing stops the agent from checking out some
11
+ * other branch in it — every `review/pr-NNN`, QA, and "continue someone
12
+ * else's branch" run does exactly that. Anchoring at the merge-base then
13
+ * silently redefines "this task's diff" as *the whole reviewed branch*, which
14
+ * is how a task that committed nothing came to report `+22505 −2628`. When
15
+ * HEAD is not on the task's branch the honest anchor is `HEAD` itself: the
16
+ * uncommitted work in the tree is the only part this task can be said to have
17
+ * produced.
18
+ *
19
+ * #591 established that rule for the Changes tab; #751 found the sidebar and
20
+ * Tasks-table numbers still on the old anchor. It lives here so a third
21
+ * surface cannot get it wrong again — callers hand in their own `git` runner
22
+ * (`git-worktree.ts` and `server/git-changes.ts` each own a private one, and
23
+ * `git-changes` needs its scratch-`GIT_INDEX_FILE` variant), so this module
24
+ * stays a pure decision with no process-spawning of its own.
25
+ */
26
+ /** What a caller's `git` runner must answer with. Both existing runners are wider than this. */
27
+ export interface GitRunResult {
28
+ ok: boolean;
29
+ stdout: string;
30
+ }
31
+ /** A caller-supplied `git` invocation, already bound to a working directory (and env). */
32
+ export type GitRunner = (args: string[]) => Promise<GitRunResult>;
33
+ /** The task branch cezar created vs. the branch HEAD actually sits on. */
34
+ export interface RepointedHead {
35
+ headBranch: string;
36
+ taskBranch: string;
37
+ }
38
+ export interface TaskDiffBase {
39
+ /** The ref to diff against. */
40
+ base: string;
41
+ /** Present only when HEAD left the task's branch — the reason `base` is `HEAD`. */
42
+ repointedHead?: RepointedHead;
43
+ }
44
+ /**
45
+ * Resolve the diff anchor for a task worktree. Never throws: a failing git
46
+ * call degrades to the base branch name, which is what the un-guarded callers
47
+ * did before this helper existed.
48
+ *
49
+ * `taskBranch` is optional because not every caller has one (the main working
50
+ * tree has no task branch at all). Without it there is nothing to compare
51
+ * HEAD against, so the merge-base anchor is used unchanged — that is the
52
+ * pre-#751 behavior, preserved exactly.
53
+ *
54
+ * A detached HEAD (`rev-parse --abbrev-ref HEAD` → `HEAD`) counts as
55
+ * repointed: it is by definition not the task's branch, so the same
56
+ * uncommitted-only anchor is the honest one.
57
+ */
58
+ export declare function resolveTaskDiffBase(runGit: GitRunner, baseBranch: string, opts?: {
59
+ taskBranch?: string;
60
+ }): Promise<TaskDiffBase>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * "Which ref anchors *this task's* diff" — the single rule every task-diff
3
+ * surface resolves through (#751).
4
+ *
5
+ * The normal answer is `merge-base(baseBranch, HEAD)`: it keeps a task's diff
6
+ * to the task's own commits even after the base branch moves on, and even
7
+ * after the task merges the base back in.
8
+ *
9
+ * The exception is a **repointed HEAD**. cezar hands the agent a worktree on
10
+ * the task's own branch, but nothing stops the agent from checking out some
11
+ * other branch in it — every `review/pr-NNN`, QA, and "continue someone
12
+ * else's branch" run does exactly that. Anchoring at the merge-base then
13
+ * silently redefines "this task's diff" as *the whole reviewed branch*, which
14
+ * is how a task that committed nothing came to report `+22505 −2628`. When
15
+ * HEAD is not on the task's branch the honest anchor is `HEAD` itself: the
16
+ * uncommitted work in the tree is the only part this task can be said to have
17
+ * produced.
18
+ *
19
+ * #591 established that rule for the Changes tab; #751 found the sidebar and
20
+ * Tasks-table numbers still on the old anchor. It lives here so a third
21
+ * surface cannot get it wrong again — callers hand in their own `git` runner
22
+ * (`git-worktree.ts` and `server/git-changes.ts` each own a private one, and
23
+ * `git-changes` needs its scratch-`GIT_INDEX_FILE` variant), so this module
24
+ * stays a pure decision with no process-spawning of its own.
25
+ */
26
+ /**
27
+ * Resolve the diff anchor for a task worktree. Never throws: a failing git
28
+ * call degrades to the base branch name, which is what the un-guarded callers
29
+ * did before this helper existed.
30
+ *
31
+ * `taskBranch` is optional because not every caller has one (the main working
32
+ * tree has no task branch at all). Without it there is nothing to compare
33
+ * HEAD against, so the merge-base anchor is used unchanged — that is the
34
+ * pre-#751 behavior, preserved exactly.
35
+ *
36
+ * A detached HEAD (`rev-parse --abbrev-ref HEAD` → `HEAD`) counts as
37
+ * repointed: it is by definition not the task's branch, so the same
38
+ * uncommitted-only anchor is the honest one.
39
+ */
40
+ export async function resolveTaskDiffBase(runGit, baseBranch, opts = {}) {
41
+ if (opts.taskBranch) {
42
+ const headBranchResult = await runGit(['rev-parse', '--abbrev-ref', 'HEAD']);
43
+ const headBranch = headBranchResult.ok ? headBranchResult.stdout.trim() : '';
44
+ // An unreadable HEAD (no commits yet, broken worktree) is NOT evidence of a
45
+ // repoint — fall through to the merge-base anchor rather than narrowing on a
46
+ // guess.
47
+ if (headBranch && headBranch !== opts.taskBranch) {
48
+ return { base: 'HEAD', repointedHead: { headBranch, taskBranch: opts.taskBranch } };
49
+ }
50
+ }
51
+ const mergeBase = await runGit(['merge-base', baseBranch, 'HEAD']);
52
+ return { base: mergeBase.ok && mergeBase.stdout.trim() ? mergeBase.stdout.trim() : baseBranch };
53
+ }
54
+ //# sourceMappingURL=git-diff-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-diff-base.js","sourceRoot":"","sources":["../src/git-diff-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAwBH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAiB,EACjB,UAAkB,EAClB,IAAI,GAA4B,EAAE;IAElC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7E,MAAM,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,4EAA4E;QAC5E,6EAA6E;QAC7E,SAAS;QACT,IAAI,UAAU,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YACjD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;QACtF,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IACnE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;AAClG,CAAC"}
@@ -85,11 +85,28 @@ export declare function autosaveCommit(dir: string, reason: AutosaveReason): Pro
85
85
  * "What did this task change": diff of the worktree (committed + uncommitted
86
86
  * + untracked, via `add -N`) against the merge-base with its base branch —
87
87
  * so the diff stays *this task's* changes even after the base moves on.
88
+ *
89
+ * Deliberately does NOT take the repointed-HEAD guard that `collectChanges`
90
+ * (#591) and `worktreeShortstat` (#751) resolve through
91
+ * `resolveTaskDiffBase` — this is the whole-branch anchor on purpose, for two
92
+ * reasons. Its text output is `GET /api/v1/runs/:id/diff`, a protected surface
93
+ * (BACKWARD_COMPATIBILITY.md §2), so narrowing it would silently change what
94
+ * every existing consumer reads. And its other caller, `settleSuccess`, asks
95
+ * only "is there anything here to review at all" — over-answering that parks a
96
+ * run at the review gate, which is recoverable, while under-answering would
97
+ * settle a run to `done` with work still in the tree. If a future change wants
98
+ * the narrow answer here, take it from `resolveTaskDiffBase` rather than
99
+ * re-deriving the rule a fourth time.
88
100
  */
89
101
  export declare function worktreeDiff(worktreePath: string, baseBranch: string, cap?: number): Promise<string>;
90
102
  /**
91
103
  * `git diff --stat` version of `worktreeDiff` (spec 010 — the variant
92
- * comparison columns). Same merge-base anchoring; returns '' on any failure.
104
+ * comparison columns). Same merge-base anchoring, and it stays whole-branch
105
+ * for a reason of its own: variants are sibling cezar worktrees, each on its
106
+ * own `cez/*` branch, and the column exists to compare their *committed* work
107
+ * against one another. Narrowing one variant to its uncommitted tree would
108
+ * make the comparison meaningless rather than more honest. Returns '' on any
109
+ * failure. (The task-diff rule the other surfaces follow: `git-diff-base.ts`.)
93
110
  */
94
111
  export declare function worktreeDiffStat(worktreePath: string, baseBranch: string): Promise<string>;
95
112
  /** Aggregate diff numbers (#389) — the shape stored on `RunRecord.diffStat`. */
@@ -97,6 +114,10 @@ export interface DiffStat {
97
114
  adds: number;
98
115
  dels: number;
99
116
  files: number;
117
+ /** Set only when the numbers were narrowed to uncommitted work because the worktree's
118
+ * HEAD had been repointed off the task's branch (#751). Absent — never `false` — on a
119
+ * normal run, so the persisted shape is unchanged for every task that behaved. */
120
+ repointed?: boolean;
100
121
  }
101
122
  /**
102
123
  * Parse `git diff --shortstat` output — " 3 files changed, 10 insertions(+),
@@ -107,12 +128,22 @@ export interface DiffStat {
107
128
  */
108
129
  export declare function parseShortstat(s: string): DiffStat;
109
130
  /**
110
- * `git diff --shortstat` of the worktree vs its base (#389) — same
111
- * merge-base anchoring and intent-to-add as `worktreeDiff`, parsed into
112
- * numbers. Null on git failure (the caller notes it, never fails the run);
113
- * an empty diff is a valid all-zero stat.
131
+ * `git diff --shortstat` of the worktree vs its base (#389) — the numbers
132
+ * behind `RunRecord.diffStat`, which is what the sidebar quick list and the
133
+ * Tasks table show. Same intent-to-add as `worktreeDiff`, but the anchor comes
134
+ * from the shared `resolveTaskDiffBase` rule (`git-diff-base.ts`): pass the
135
+ * run's own `taskBranch` and a worktree whose HEAD was repointed onto another
136
+ * branch reports its uncommitted work only, instead of claiming that whole
137
+ * branch's diff as this task's (#751 — the #591 guard, on this surface).
138
+ *
139
+ * `repointed: true` rides along on the returned stat exactly when that
140
+ * narrowing happened, so the UI can say why the number is what it is. Null on
141
+ * git failure (the caller notes it, never fails the run); an empty diff is a
142
+ * valid all-zero stat.
114
143
  */
115
- export declare function worktreeShortstat(worktreePath: string, baseBranch: string): Promise<DiffStat | null>;
144
+ export declare function worktreeShortstat(worktreePath: string, baseBranch: string, opts?: {
145
+ taskBranch?: string;
146
+ }): Promise<DiffStat | null>;
116
147
  /**
117
148
  * Startup reconcile: `git worktree prune` + remove every directory under
118
149
  * `.ai/cezar/worktrees/` whose run id is no longer in the store (and its
@@ -2,6 +2,7 @@ import { execFile } from 'node:child_process';
2
2
  import { existsSync, realpathSync } from 'node:fs';
3
3
  import { readdir, readFile, rm, stat } from 'node:fs/promises';
4
4
  import { basename, join, resolve } from 'node:path';
5
+ import { resolveTaskDiffBase } from './git-diff-base.js';
5
6
  import { isSafeGitRef } from './git-refs.js';
6
7
  /**
7
8
  * Git worktree per task (spec 006). Each run gets its own branch
@@ -386,6 +387,18 @@ async function gitHasIdentity(dir) {
386
387
  * "What did this task change": diff of the worktree (committed + uncommitted
387
388
  * + untracked, via `add -N`) against the merge-base with its base branch —
388
389
  * so the diff stays *this task's* changes even after the base moves on.
390
+ *
391
+ * Deliberately does NOT take the repointed-HEAD guard that `collectChanges`
392
+ * (#591) and `worktreeShortstat` (#751) resolve through
393
+ * `resolveTaskDiffBase` — this is the whole-branch anchor on purpose, for two
394
+ * reasons. Its text output is `GET /api/v1/runs/:id/diff`, a protected surface
395
+ * (BACKWARD_COMPATIBILITY.md §2), so narrowing it would silently change what
396
+ * every existing consumer reads. And its other caller, `settleSuccess`, asks
397
+ * only "is there anything here to review at all" — over-answering that parks a
398
+ * run at the review gate, which is recoverable, while under-answering would
399
+ * settle a run to `done` with work still in the tree. If a future change wants
400
+ * the narrow answer here, take it from `resolveTaskDiffBase` rather than
401
+ * re-deriving the rule a fourth time.
389
402
  */
390
403
  export async function worktreeDiff(worktreePath, baseBranch, cap = DIFF_CAP) {
391
404
  if (!isSafeGitRef(baseBranch))
@@ -402,7 +415,12 @@ export async function worktreeDiff(worktreePath, baseBranch, cap = DIFF_CAP) {
402
415
  }
403
416
  /**
404
417
  * `git diff --stat` version of `worktreeDiff` (spec 010 — the variant
405
- * comparison columns). Same merge-base anchoring; returns '' on any failure.
418
+ * comparison columns). Same merge-base anchoring, and it stays whole-branch
419
+ * for a reason of its own: variants are sibling cezar worktrees, each on its
420
+ * own `cez/*` branch, and the column exists to compare their *committed* work
421
+ * against one another. Narrowing one variant to its uncommitted tree would
422
+ * make the comparison meaningless rather than more honest. Returns '' on any
423
+ * failure. (The task-diff rule the other surfaces follow: `git-diff-base.ts`.)
406
424
  */
407
425
  export async function worktreeDiffStat(worktreePath, baseBranch) {
408
426
  if (!isSafeGitRef(baseBranch))
@@ -431,19 +449,31 @@ export function parseShortstat(s) {
431
449
  };
432
450
  }
433
451
  /**
434
- * `git diff --shortstat` of the worktree vs its base (#389) — same
435
- * merge-base anchoring and intent-to-add as `worktreeDiff`, parsed into
436
- * numbers. Null on git failure (the caller notes it, never fails the run);
437
- * an empty diff is a valid all-zero stat.
452
+ * `git diff --shortstat` of the worktree vs its base (#389) — the numbers
453
+ * behind `RunRecord.diffStat`, which is what the sidebar quick list and the
454
+ * Tasks table show. Same intent-to-add as `worktreeDiff`, but the anchor comes
455
+ * from the shared `resolveTaskDiffBase` rule (`git-diff-base.ts`): pass the
456
+ * run's own `taskBranch` and a worktree whose HEAD was repointed onto another
457
+ * branch reports its uncommitted work only, instead of claiming that whole
458
+ * branch's diff as this task's (#751 — the #591 guard, on this surface).
459
+ *
460
+ * `repointed: true` rides along on the returned stat exactly when that
461
+ * narrowing happened, so the UI can say why the number is what it is. Null on
462
+ * git failure (the caller notes it, never fails the run); an empty diff is a
463
+ * valid all-zero stat.
438
464
  */
439
- export async function worktreeShortstat(worktreePath, baseBranch) {
465
+ export async function worktreeShortstat(worktreePath, baseBranch, opts = {}) {
440
466
  if (!isSafeGitRef(baseBranch))
441
467
  return null;
442
468
  await git(worktreePath, ['add', '-N', '.']); // intent-to-add: untracked files show up
443
- const mergeBase = await git(worktreePath, ['merge-base', baseBranch, 'HEAD']);
444
- const base = mergeBase.ok && mergeBase.stdout.trim() ? mergeBase.stdout.trim() : baseBranch;
469
+ const { base, repointedHead } = await resolveTaskDiffBase((args) => git(worktreePath, args), baseBranch, opts);
445
470
  const res = await git(worktreePath, ['diff', '--shortstat', base]);
446
- return res.ok ? parseShortstat(res.stdout) : null;
471
+ if (!res.ok)
472
+ return null;
473
+ // The key stays ABSENT (not `false`) on a normal run: `diffStat` is persisted in
474
+ // `runs.json` and served on the runs API, so the un-narrowed shape must keep
475
+ // round-tripping byte-identically.
476
+ return { ...parseShortstat(res.stdout), ...(repointedHead ? { repointed: true } : {}) };
447
477
  }
448
478
  /**
449
479
  * Startup reconcile: `git worktree prune` + remove every directory under
@@ -1 +1 @@
1
- {"version":3,"file":"git-worktree.js","sourceRoot":"","sources":["../src/git-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;GAOG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAEnD,MAAM,QAAQ,GAAG,OAAO,CAAC;AAazB,iEAAiE;AACjE,S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a,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1F,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAAgB,EAChB,QAA6B;IAE7B,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,uBAAuB;IACpC,CAAC;IACD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/D,MAAM,cAAc,CAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7F,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/handoff.d.ts CHANGED
@@ -56,7 +56,7 @@ export declare function followupsEnabled(env?: NodeJS.ProcessEnv): boolean;
56
56
  * inherited value from a parent cezar cannot shine through
57
57
  * (`RunManager.agentEnv`).
58
58
  */
59
- export declare const HANDOFF_ONLY_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 1\u20134 questions, each with 2\u20134 options and unique option labels. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.";
59
+ export declare const HANDOFF_ONLY_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 use only those keys (plus an optional non-empty \"id\" up to 64 characters), with 1\u20134 questions, 2\u20134 options per question, unique question text and option labels, header 1\u201312 characters, question 1\u2013400, option label 1\u201360, and description at most 280. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.";
60
60
  export declare const FOLLOWUP_INSTRUCTIONS = "## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
61
61
  /** Default-on combined contract retained for old callers and runs. */
62
- export declare const HANDOFF_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 1\u20134 questions, each with 2\u20134 options and unique option labels. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.\n\n## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
62
+ export declare const HANDOFF_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 use only those keys (plus an optional non-empty \"id\" up to 64 characters), with 1\u20134 questions, 2\u20134 options per question, unique question text and option labels, header 1\u201312 characters, question 1\u2013400, option label 1\u201360, and description at most 280. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.\n\n## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
package/dist/handoff.js CHANGED
@@ -137,7 +137,7 @@ Task completion marker: when the task's goal is fully achieved and you have no q
137
137
 
138
138
  Still-working marker: if you end a turn while still working on your OWN downstream work — a sub-agent you dispatched, or a long-running command you're monitoring — and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as "monitoring" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.
139
139
 
140
- Structured question marker: when you are blocked on a decision that is genuinely the user's to make — one you cannot resolve from the request, the code, or sensible defaults — and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {"questions":[{"header":"≤12-char label","question":"a clear question ending in ?","multiSelect":false,"options":[{"label":"short choice","description":"what it means / the trade-off"}]}]} — 1–4 questions, each with 2–4 options and unique option labels. The user can always type a free-form reply, so never add an "Other" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.
140
+ Structured question marker: when you are blocked on a decision that is genuinely the user's to make — one you cannot resolve from the request, the code, or sensible defaults — and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {"questions":[{"header":"≤12-char label","question":"a clear question ending in ?","multiSelect":false,"options":[{"label":"short choice","description":"what it means / the trade-off"}]}]} — use only those keys (plus an optional non-empty "id" up to 64 characters), with 1–4 questions, 2–4 options per question, unique question text and option labels, header 1–12 characters, question 1–400, option label 1–60, and description at most 280. The user can always type a free-form reply, so never add an "Other" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.
141
141
 
142
142
  Task reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject — never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. "implementing comment threads"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.
143
143
 
package/dist/index.js CHANGED
@@ -6,16 +6,21 @@ import { mkdirSync, writeFileSync, existsSync, readFileSync } from 'node:fs';
6
6
  import { dirname, join, resolve } from 'node:path';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { detectEnvironment } from './core/backend-detect.js';
9
+ import { ProviderAuthService } from './core/provider-auth.js';
10
+ import { applyProviderEnablement } from './core/provider-availability.js';
9
11
  import { pruneOrphans } from './git-worktree.js';
10
12
  import { getRepoInfo } from './server/git.js';
11
- import { DEFAULT_WORKTREE_RETENTION, resolveWorktreeRetention } from './config.js';
13
+ import { DEFAULT_WORKTREE_RETENTION, loadConfig, resolveWorktreeRetention } from './config.js';
12
14
  import { reclaimWorktrees } from './runs/retention.js';
13
15
  import { RunStore } from './runs/store.js';
14
16
  import { RunManager } from './workflows/run.js';
15
17
  import { loadWorkflows } from './workflows/load.js';
16
- import { startServer } from './server/server.js';
18
+ import { startServer, WorkspaceEventBus } from './server/server.js';
19
+ import { ProviderRuntimeAuthObserver, recoverWithProviderRuntimeAuthObservation, } from './server/provider-auth-runtime.js';
20
+ import { providersRequiredByWorkflow, unavailableProviderMessage, } from './server/provider-action-gate.js';
17
21
  import { checkForUpdate } from './update-check.js';
18
22
  import { printSkillsBanner } from './skills-banner.js';
23
+ import { loadWorkspaceConfig } from './workspace/config.js';
19
24
  import { runMigrations } from './workspace/migrations.js';
20
25
  import { registerProject, shouldRegisterProject } from './workspace/projects.js';
21
26
  import { runProjectsCommand } from './workspace/projects-cli.js';
@@ -157,7 +162,7 @@ async function main() {
157
162
  *
158
163
  * Returns the boot project's registry id when registration happened —
159
164
  * `serveCommand` plumbs it into the server (`ServerDeps.bootProjectId`) so
160
- * `/api/projects` and `/api/health` can name the boot project without a
165
+ * `/api/projects` and `/api/v1/health` can name the boot project without a
161
166
  * lookup. Undefined when registration was suppressed or the workspace is
162
167
  * unavailable; the server then derives a fallback on its own.
163
168
  */
@@ -186,6 +191,11 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
186
191
  // the previous process exited are re-queued or resumed instead of failed.
187
192
  const store = openStore(repoRoot, { keepLive: true });
188
193
  const manager = new RunManager(store, repoRoot, { semaphore });
194
+ const providerAuth = new ProviderAuthService();
195
+ const workspaceEvents = new WorkspaceEventBus();
196
+ const providerRuntimeAuth = new ProviderRuntimeAuthObserver(providerAuth, (status) => {
197
+ workspaceEvents.emit('provider-status', status);
198
+ });
189
199
  const version = readOwnVersion();
190
200
  const checks = await detectEnvironment();
191
201
  const repo = await getRepoInfo(repoRoot);
@@ -207,11 +217,11 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
207
217
  const recovered = store
208
218
  .listRuns()
209
219
  .filter((r) => ['queued', 'waiting', 'running'].includes(r.status)).length;
210
- await manager.recover();
220
+ await recoverWithProviderRuntimeAuthObservation(store, () => manager.recover(), providerRuntimeAuth);
211
221
  if (recovered > 0)
212
222
  console.log(` recovered ${recovered} run(s) from the previous session`);
213
223
  // Update discovery (#368) — fire-and-forget; the banner prints whenever the
214
- // registry answers and /api/health picks it up for the GUI chip.
224
+ // registry answers and /api/v1/health picks it up for the GUI chip.
215
225
  const pkgName = readOwnName();
216
226
  const update = {};
217
227
  void checkForUpdate(pkgName, version).then((latest) => {
@@ -230,7 +240,19 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
230
240
  ` Only do this behind a reverse proxy that enforces authentication,\n` +
231
241
  ` and make sure this interface is not reachable from the internet.\n`);
232
242
  }
233
- startServer({ repoRoot, store, manager, version, update, bootProjectId, semaphore, bindHost }, port);
243
+ startServer({
244
+ repoRoot,
245
+ store,
246
+ manager,
247
+ version,
248
+ update,
249
+ bootProjectId,
250
+ semaphore,
251
+ bindHost,
252
+ providerAuth,
253
+ providerRuntimeAuth,
254
+ workspaceEvents,
255
+ }, port);
234
256
  const url = `http://localhost:${port}`;
235
257
  console.log(`\n cezar v${version} — ${repoRoot}`);
236
258
  console.log(` ${repo ? `branch ${repo.branch}` : 'not a git repository (tasks run in place, one at a time; repo view is empty)'}`);
@@ -253,7 +275,7 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
253
275
  // Open the browser only once the server actually answers, so the first
254
276
  // paint is the cockpit and never a connection error.
255
277
  if (openBrowser) {
256
- const healthy = await waitForHealth(`${url}/api/health`, 5_000);
278
+ const healthy = await waitForHealth(`${url}/api/v1/health`, 5_000);
257
279
  if (healthy)
258
280
  openUrl(url);
259
281
  }
@@ -307,7 +329,25 @@ async function runCommand(repoRoot, task, workflowName, model) {
307
329
  process.exitCode = 1;
308
330
  return;
309
331
  }
332
+ const providerAuth = new ProviderAuthService();
333
+ const requiredProviders = providersRequiredByWorkflow(workflow, (await loadConfig(repoRoot)).defaultRunner);
334
+ if (requiredProviders.length > 0) {
335
+ const [discovered, workspace] = await Promise.all([
336
+ providerAuth.status(),
337
+ loadWorkspaceConfig(),
338
+ ]);
339
+ const blocked = unavailableProviderMessage(requiredProviders, applyProviderEnablement(discovered, workspace.disabledProviders));
340
+ if (blocked) {
341
+ console.error(blocked);
342
+ process.exitCode = 1;
343
+ return;
344
+ }
345
+ }
310
346
  const store = openStore(repoRoot);
347
+ // Headless tasks still appear in the cockpit later, so persist the same
348
+ // task-local recovery event when a credential expires after the preflight.
349
+ const providerRuntimeAuth = new ProviderRuntimeAuthObserver(providerAuth, () => { });
350
+ providerRuntimeAuth.watch(store);
311
351
  // Headless runs enforce the same workspace-level cap/memory limit (step
312
352
  // 2.5) — one refreshed semaphore, even with just one manager in play.
313
353
  const semaphore = new WorkspaceSemaphore();
@@ -549,7 +589,24 @@ function openStore(repoRoot, opts) {
549
589
  /** Keep run data out of the user's repo history; workflows/skills stay committable. */
550
590
  function ensureDataGitignore(repoRoot) {
551
591
  const path = join(repoRoot, '.ai/cezar', '.gitignore');
552
- const wanted = ['runs.json', 'runs.json.tmp', 'runs/', 'worktrees/', 'todos.json', 'todos.json.tmp', 'launch-key'];
592
+ const wanted = [
593
+ 'runs.json',
594
+ 'runs.json.tmp',
595
+ 'runs/',
596
+ 'worktrees/',
597
+ 'todos.json',
598
+ 'todos.json.tmp',
599
+ 'launch-key',
600
+ 'automations.json',
601
+ 'automations.json.tmp',
602
+ 'automation-state.json',
603
+ 'automation-state.json.tmp',
604
+ 'automation-receipts.ndjson',
605
+ 'automation-receipts.ndjson.tmp',
606
+ 'automation-log.ndjson',
607
+ 'automation-log.ndjson.tmp',
608
+ 'automation-poll.lock',
609
+ ];
553
610
  try {
554
611
  mkdirSync(join(repoRoot, '.ai/cezar'), { recursive: true });
555
612
  const current = existsSync(path) ? readFileSync(path, 'utf8') : '';