@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
@@ -0,0 +1,182 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The project-registry family: `GET/POST/PATCH/DELETE /api/v1/projects`, the folder picker
4
+ * (`GET /api/v1/fs/browse`) that feeds it, and the launch-key read.
5
+ *
6
+ * Node-free by construction (see README rule 1) — `zod` and nothing else.
7
+ */
8
+ /**
9
+ * One `GET /api/v1/projects` registry entry (multi-project spec, step 1.6).
10
+ *
11
+ * Unlike health's id+name pairs this carries the absolute `root`: the registry routes are
12
+ * same-origin, the CORS-open health route is not, and that difference is the reason the two
13
+ * project shapes are deliberately NOT the same type.
14
+ *
15
+ * Deliberately a CLOSED object even though the server's persistence schema
16
+ * (`src/workspace/config.ts`, `workspaceProjectSchema.passthrough()`) keeps unknown keys in the
17
+ * file: passthrough is a durability promise about `~/.cezar/config.json`, not a promise that the
18
+ * API answers arbitrary keys. Modelling it as a loose object here would also be unprovable — see
19
+ * the note on the index signature in `src/server/contract-parity.workspace.test.ts`.
20
+ */
21
+ export declare const projectListEntrySchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ name: z.ZodString;
24
+ root: z.ZodString;
25
+ addedAt: z.ZodString;
26
+ lastOpenedAt: z.ZodString;
27
+ source: z.ZodEnum<{
28
+ checkout: "checkout";
29
+ local: "local";
30
+ }>;
31
+ status: z.ZodEnum<{
32
+ missing: "missing";
33
+ "not-git": "not-git";
34
+ ok: "ok";
35
+ }>;
36
+ branch: z.ZodOptional<z.ZodString>;
37
+ forge: z.ZodOptional<z.ZodLiteral<"github">>;
38
+ maxParallel: z.ZodOptional<z.ZodNumber>;
39
+ }, z.core.$strip>;
40
+ export type ProjectListEntry = z.infer<typeof projectListEntrySchema>;
41
+ /** `GET /api/v1/projects` — the workspace registry. Workspace-level: never 404s, never scoped.
42
+ * An unreadable workspace degrades to `projects: []` plus the default `projectsDir`, so all
43
+ * three keys are always present. */
44
+ export declare const projectsResponseSchema: z.ZodObject<{
45
+ projects: z.ZodArray<z.ZodObject<{
46
+ id: z.ZodString;
47
+ name: z.ZodString;
48
+ root: z.ZodString;
49
+ addedAt: z.ZodString;
50
+ lastOpenedAt: z.ZodString;
51
+ source: z.ZodEnum<{
52
+ checkout: "checkout";
53
+ local: "local";
54
+ }>;
55
+ status: z.ZodEnum<{
56
+ missing: "missing";
57
+ "not-git": "not-git";
58
+ ok: "ok";
59
+ }>;
60
+ branch: z.ZodOptional<z.ZodString>;
61
+ forge: z.ZodOptional<z.ZodLiteral<"github">>;
62
+ maxParallel: z.ZodOptional<z.ZodNumber>;
63
+ }, z.core.$strip>>;
64
+ bootProject: z.ZodString;
65
+ projectsDir: z.ZodString;
66
+ }, z.core.$strip>;
67
+ export type ProjectsResponse = z.infer<typeof projectsResponseSchema>;
68
+ /**
69
+ * `POST /api/v1/projects` (multi-project spec, step 4.2) — what the folder-browser dialog gets
70
+ * back. `error` is present ONLY on the 409 (already registered), where `project` is the EXISTING
71
+ * entry: the dialog navigates to it rather than dead-ending on a duplicate.
72
+ */
73
+ export declare const registerProjectResponseSchema: z.ZodObject<{
74
+ project: z.ZodObject<{
75
+ id: z.ZodString;
76
+ name: z.ZodString;
77
+ root: z.ZodString;
78
+ addedAt: z.ZodString;
79
+ lastOpenedAt: z.ZodString;
80
+ source: z.ZodEnum<{
81
+ checkout: "checkout";
82
+ local: "local";
83
+ }>;
84
+ status: z.ZodEnum<{
85
+ missing: "missing";
86
+ "not-git": "not-git";
87
+ ok: "ok";
88
+ }>;
89
+ branch: z.ZodOptional<z.ZodString>;
90
+ forge: z.ZodOptional<z.ZodLiteral<"github">>;
91
+ maxParallel: z.ZodOptional<z.ZodNumber>;
92
+ }, z.core.$strip>;
93
+ error: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strip>;
95
+ export type RegisterProjectResponse = z.infer<typeof registerProjectResponseSchema>;
96
+ /**
97
+ * `DELETE /api/v1/projects/:projectId` (multi-project spec, step 4.4) — Settings → Projects'
98
+ * per-row Remove. Deregistration ONLY: the server never touches anything under the project root,
99
+ * so this is a registry edit and nothing else. The interesting failures are 409s (the project has
100
+ * running tasks, or it is the project this server booted in), whose `{ error }` the pane shows
101
+ * verbatim.
102
+ */
103
+ export declare const removeProjectResponseSchema: z.ZodObject<{
104
+ removed: z.ZodLiteral<true>;
105
+ id: z.ZodString;
106
+ }, z.core.$strip>;
107
+ export type RemoveProjectResponse = z.infer<typeof removeProjectResponseSchema>;
108
+ /** `PATCH /api/v1/projects/:projectId` — the updated entry, the same shape `GET /api/v1/projects`
109
+ * attaches (the handler re-probes `status`/`branch` so one project has one shape). */
110
+ export declare const updateProjectResponseSchema: z.ZodObject<{
111
+ project: z.ZodObject<{
112
+ id: z.ZodString;
113
+ name: z.ZodString;
114
+ root: z.ZodString;
115
+ addedAt: z.ZodString;
116
+ lastOpenedAt: z.ZodString;
117
+ source: z.ZodEnum<{
118
+ checkout: "checkout";
119
+ local: "local";
120
+ }>;
121
+ status: z.ZodEnum<{
122
+ missing: "missing";
123
+ "not-git": "not-git";
124
+ ok: "ok";
125
+ }>;
126
+ branch: z.ZodOptional<z.ZodString>;
127
+ forge: z.ZodOptional<z.ZodLiteral<"github">>;
128
+ maxParallel: z.ZodOptional<z.ZodNumber>;
129
+ }, z.core.$strip>;
130
+ }, z.core.$strip>;
131
+ export type UpdateProjectResponse = z.infer<typeof updateProjectResponseSchema>;
132
+ /**
133
+ * `PATCH /api/v1/projects/:projectId` body (spec 2026-07-22-per-project-concurrency) — set or
134
+ * clear a project's per-project concurrency ceiling. `null` clears the override back to "inherit
135
+ * the workspace cap"; an integer `1..16` pins it. The bounds mirror `workspaceProjectSchema`
136
+ * exactly, so a value this schema accepts can never be degraded away by the next load's `.catch`.
137
+ */
138
+ export declare const updateProjectInputSchema: z.ZodObject<{
139
+ maxParallel: z.ZodNullable<z.ZodNumber>;
140
+ }, z.core.$strip>;
141
+ export type UpdateProjectInput = z.infer<typeof updateProjectInputSchema>;
142
+ /**
143
+ * `POST /api/v1/projects/checkout` (multi-project spec, step 4.3) — the clone-from-GitHub body.
144
+ * `name` defaults server-side to the repo name; `checkoutId` is the cockpit's own correlation
145
+ * token, echoed on every `checkout-progress` event so two tabs cloning at once never render each
146
+ * other's progress.
147
+ */
148
+ export declare const checkoutProjectInputSchema: z.ZodObject<{
149
+ url: z.ZodString;
150
+ name: z.ZodOptional<z.ZodString>;
151
+ checkoutId: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>;
153
+ export type CheckoutProjectInput = z.infer<typeof checkoutProjectInputSchema>;
154
+ /** One directory in a `GET /api/v1/fs/browse` listing (multi-project spec, step 4.1). `path` is
155
+ * absolute — same-origin route, like `ProjectListEntry.root`. */
156
+ export declare const fsBrowseDirSchema: z.ZodObject<{
157
+ name: z.ZodString;
158
+ path: z.ZodString;
159
+ isRepo: z.ZodBoolean;
160
+ }, z.core.$strip>;
161
+ export type FsBrowseDir = z.infer<typeof fsBrowseDirSchema>;
162
+ /** `GET /api/v1/fs/browse?path=` — the folder picker's listing. Rooted at the independently
163
+ * configured browse root, directories only. */
164
+ export declare const fsBrowseResponseSchema: z.ZodObject<{
165
+ path: z.ZodString;
166
+ parent: z.ZodNullable<z.ZodString>;
167
+ dirs: z.ZodArray<z.ZodObject<{
168
+ name: z.ZodString;
169
+ path: z.ZodString;
170
+ isRepo: z.ZodBoolean;
171
+ }, z.core.$strip>>;
172
+ truncated: z.ZodBoolean;
173
+ }, z.core.$strip>;
174
+ export type FsBrowseResponse = z.infer<typeof fsBrowseResponseSchema>;
175
+ /** `GET /api/v1/launch-key` — the bookmarklet auto-start secret (spec 011). Fetched to COMPARE
176
+ * against the `?key=` query param and to bake into the `javascript:` links the Settings → Skills
177
+ * bookmarklet panel generates. The value never renders as text, never logs, and never goes back
178
+ * into the address bar. */
179
+ export declare const launchKeyResponseSchema: z.ZodObject<{
180
+ key: z.ZodString;
181
+ }, z.core.$strip>;
182
+ export type LaunchKeyResponse = z.infer<typeof launchKeyResponseSchema>;
@@ -0,0 +1,234 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The repo / git family of `/api/v1` — the Repo view, the structured diff shapes the Changes and
4
+ * Files tabs read, and the worktree-retention panel.
5
+ *
6
+ * `RepoInfo` is NOT redeclared here: health already owns it (`./health.ts`), and the Repo view
7
+ * serves the very same record.
8
+ */
9
+ /** One `git status --porcelain` row. */
10
+ export declare const statusEntrySchema: z.ZodObject<{
11
+ status: z.ZodString;
12
+ path: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export type StatusEntry = z.infer<typeof statusEntrySchema>;
15
+ /** One `git log` row; `when` is git's relative `%cr` ("3 hours ago"), not a timestamp. */
16
+ export declare const logEntrySchema: z.ZodObject<{
17
+ hash: z.ZodString;
18
+ subject: z.ZodString;
19
+ author: z.ZodString;
20
+ when: z.ZodString;
21
+ }, z.core.$strip>;
22
+ export type LogEntry = z.infer<typeof logEntrySchema>;
23
+ /**
24
+ * `GET /api/v1/repo` — the Repo view's one read.
25
+ *
26
+ * A union, and deliberately so: the handler answers a DIFFERENT object when the project root is
27
+ * not a repository (`server.ts:3481`) than when it is (`server.ts:3494`), and the empty branch's
28
+ * `[]` literals make its arrays `never[]` in the route type. Modelling this as the flat
29
+ * `{ info: RepoInfo | null; status: StatusEntry[]; … }` the hand-written DTO used would be WIDER
30
+ * than the route — the parity guard rejects it. Both members still parse the real wire bytes
31
+ * (an empty array satisfies `z.array(z.never())`), so nothing is lost at runtime; it is the
32
+ * compile-time shape that is oddly precise. See the report note on `server.ts:3481`.
33
+ */
34
+ export declare const repoResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
35
+ info: z.ZodNull;
36
+ status: z.ZodArray<z.ZodNever>;
37
+ log: z.ZodArray<z.ZodNever>;
38
+ branches: z.ZodArray<z.ZodNever>;
39
+ baseBranch: z.ZodNull;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ info: z.ZodObject<{
42
+ root: z.ZodString;
43
+ branch: z.ZodString;
44
+ remote: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>;
46
+ status: z.ZodArray<z.ZodObject<{
47
+ status: z.ZodString;
48
+ path: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ log: z.ZodArray<z.ZodObject<{
51
+ hash: z.ZodString;
52
+ subject: z.ZodString;
53
+ author: z.ZodString;
54
+ when: z.ZodString;
55
+ }, z.core.$strip>>;
56
+ branches: z.ZodArray<z.ZodString>;
57
+ baseBranch: z.ZodNullable<z.ZodString>;
58
+ }, z.core.$strip>]>;
59
+ export type RepoResponse = z.infer<typeof repoResponseSchema>;
60
+ /** `POST /api/v1/repo/branch` — switch to an existing branch, or create one and switch. Every
61
+ * predictable git failure (invalid name, unknown `from`, dirty-tree conflict) is a 409. */
62
+ export declare const repoBranchResponseSchema: z.ZodObject<{
63
+ branch: z.ZodString;
64
+ created: z.ZodBoolean;
65
+ }, z.core.$strip>;
66
+ export type RepoBranchResponse = z.infer<typeof repoBranchResponseSchema>;
67
+ /** One changed file of a structured diff (`/runs/:id/changes`, `/repo/changes`, the commit
68
+ * routes). Assignable to the diff facade's `DiffFileChange` by construction. */
69
+ export declare const changedFileSchema: z.ZodObject<{
70
+ path: z.ZodString;
71
+ oldPath: z.ZodOptional<z.ZodString>;
72
+ status: z.ZodEnum<{
73
+ added: "added";
74
+ copied: "copied";
75
+ deleted: "deleted";
76
+ modified: "modified";
77
+ renamed: "renamed";
78
+ }>;
79
+ adds: z.ZodNumber;
80
+ dels: z.ZodNumber;
81
+ binary: z.ZodBoolean;
82
+ image: z.ZodOptional<z.ZodBoolean>;
83
+ patch: z.ZodString;
84
+ }, z.core.$strip>;
85
+ export type ChangedFile = z.infer<typeof changedFileSchema>;
86
+ /** `GET /api/v1/runs/:id/changes` and `GET /api/v1/repo/changes` — the structured diff.
87
+ * 409 (+ reason) when the run's backing directory is unavailable or git itself refuses; never HTML. */
88
+ export declare const changesPayloadSchema: z.ZodObject<{
89
+ files: z.ZodArray<z.ZodObject<{
90
+ path: z.ZodString;
91
+ oldPath: z.ZodOptional<z.ZodString>;
92
+ status: z.ZodEnum<{
93
+ added: "added";
94
+ copied: "copied";
95
+ deleted: "deleted";
96
+ modified: "modified";
97
+ renamed: "renamed";
98
+ }>;
99
+ adds: z.ZodNumber;
100
+ dels: z.ZodNumber;
101
+ binary: z.ZodBoolean;
102
+ image: z.ZodOptional<z.ZodBoolean>;
103
+ patch: z.ZodString;
104
+ }, z.core.$strip>>;
105
+ stat: z.ZodObject<{
106
+ adds: z.ZodNumber;
107
+ dels: z.ZodNumber;
108
+ files: z.ZodNumber;
109
+ }, z.core.$strip>;
110
+ repointedHead: z.ZodOptional<z.ZodObject<{
111
+ headBranch: z.ZodString;
112
+ taskBranch: z.ZodString;
113
+ }, z.core.$strip>>;
114
+ }, z.core.$strip>;
115
+ export type ChangesPayload = z.infer<typeof changesPayloadSchema>;
116
+ /** `GET /api/v1/repo/commit/:sha?structured=1` (and `/runs/:id/commit/:sha`) — one commit's
117
+ * metadata plus the same `{files, stat}` shape the /changes routes serve. A merge commit
118
+ * honestly answers zero files. The bare (unstructured) route keeps its legacy text shape. */
119
+ export declare const repoCommitPayloadSchema: z.ZodObject<{
120
+ sha: z.ZodString;
121
+ subject: z.ZodString;
122
+ author: z.ZodString;
123
+ when: z.ZodString;
124
+ files: z.ZodArray<z.ZodObject<{
125
+ path: z.ZodString;
126
+ oldPath: z.ZodOptional<z.ZodString>;
127
+ status: z.ZodEnum<{
128
+ added: "added";
129
+ copied: "copied";
130
+ deleted: "deleted";
131
+ modified: "modified";
132
+ renamed: "renamed";
133
+ }>;
134
+ adds: z.ZodNumber;
135
+ dels: z.ZodNumber;
136
+ binary: z.ZodBoolean;
137
+ image: z.ZodOptional<z.ZodBoolean>;
138
+ patch: z.ZodString;
139
+ }, z.core.$strip>>;
140
+ stat: z.ZodObject<{
141
+ adds: z.ZodNumber;
142
+ dels: z.ZodNumber;
143
+ files: z.ZodNumber;
144
+ }, z.core.$strip>;
145
+ }, z.core.$strip>;
146
+ export type RepoCommitPayload = z.infer<typeof repoCommitPayloadSchema>;
147
+ /** One row of a `GET /api/v1/runs/:id/files` directory listing. */
148
+ export declare const worktreeDirEntrySchema: z.ZodObject<{
149
+ name: z.ZodString;
150
+ type: z.ZodEnum<{
151
+ dir: "dir";
152
+ file: "file";
153
+ }>;
154
+ size: z.ZodOptional<z.ZodNumber>;
155
+ }, z.core.$strip>;
156
+ export type WorktreeDirEntry = z.infer<typeof worktreeDirEntrySchema>;
157
+ /**
158
+ * `GET /api/v1/runs/:id/files?path=` — a directory listing or one file (size-capped, binary
159
+ * flagged). `content` is absent exactly when `binary` or `tooLarge`.
160
+ *
161
+ * A discriminated union on `type`. Both handlers now build their literal with `as const`; without
162
+ * it the property widened to `string` during Hono's route-type inference and the route lost the
163
+ * discriminant, so a consumer narrowing on `entry.type === 'dir'` was left with `never`.
164
+ */
165
+ export declare const worktreeEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
166
+ type: z.ZodLiteral<"dir">;
167
+ path: z.ZodString;
168
+ entries: z.ZodArray<z.ZodObject<{
169
+ name: z.ZodString;
170
+ type: z.ZodEnum<{
171
+ dir: "dir";
172
+ file: "file";
173
+ }>;
174
+ size: z.ZodOptional<z.ZodNumber>;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strip>, z.ZodObject<{
177
+ type: z.ZodLiteral<"file">;
178
+ path: z.ZodString;
179
+ size: z.ZodNumber;
180
+ binary: z.ZodBoolean;
181
+ tooLarge: z.ZodBoolean;
182
+ content: z.ZodOptional<z.ZodString>;
183
+ }, z.core.$strip>], "type">;
184
+ export type WorktreeEntry = z.infer<typeof worktreeEntrySchema>;
185
+ /** One materialized task worktree in the management panel (#483). `sizeBytes` is null when `du`
186
+ * is unavailable (Windows / missing). `reclaimable` = finished, has a directory, not yet
187
+ * reclaimed (retention's rule). */
188
+ export declare const worktreeInfoSchema: z.ZodObject<{
189
+ runId: z.ZodString;
190
+ title: z.ZodString;
191
+ status: z.ZodEnum<{
192
+ cancelled: "cancelled";
193
+ done: "done";
194
+ failed: "failed";
195
+ queued: "queued";
196
+ review: "review";
197
+ running: "running";
198
+ waiting: "waiting";
199
+ }>;
200
+ branch: z.ZodNullable<z.ZodString>;
201
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
202
+ finishedAt: z.ZodNullable<z.ZodString>;
203
+ reclaimable: z.ZodBoolean;
204
+ }, z.core.$strip>;
205
+ export type WorktreeInfo = z.infer<typeof worktreeInfoSchema>;
206
+ /** `GET /api/v1/worktrees` (#483): the worktrees on disk, their total size (null when any
207
+ * degraded), and the current keep-limit (0 = unlimited). */
208
+ export declare const worktreesResponseSchema: z.ZodObject<{
209
+ worktrees: z.ZodArray<z.ZodObject<{
210
+ runId: z.ZodString;
211
+ title: z.ZodString;
212
+ status: z.ZodEnum<{
213
+ cancelled: "cancelled";
214
+ done: "done";
215
+ failed: "failed";
216
+ queued: "queued";
217
+ review: "review";
218
+ running: "running";
219
+ waiting: "waiting";
220
+ }>;
221
+ branch: z.ZodNullable<z.ZodString>;
222
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
223
+ finishedAt: z.ZodNullable<z.ZodString>;
224
+ reclaimable: z.ZodBoolean;
225
+ }, z.core.$strip>>;
226
+ totalBytes: z.ZodNullable<z.ZodNumber>;
227
+ keep: z.ZodNumber;
228
+ }, z.core.$strip>;
229
+ export type WorktreesResponse = z.infer<typeof worktreesResponseSchema>;
230
+ /** `POST /api/v1/worktrees/reclaim` (#483): the run ids whose directory was reclaimed. */
231
+ export declare const reclaimWorktreesResponseSchema: z.ZodObject<{
232
+ reclaimed: z.ZodArray<z.ZodString>;
233
+ }, z.core.$strip>;
234
+ export type ReclaimWorktreesResponse = z.infer<typeof reclaimWorktreesResponseSchema>;