@wjarka/cezarion 0.10.0-pr30.54

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 (478) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +838 -0
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +72 -0
  7. package/dist/agent-config/catalog.js +223 -0
  8. package/dist/agent-config/catalog.js.map +1 -0
  9. package/dist/agent-config/files.d.ts +46 -0
  10. package/dist/agent-config/files.js +119 -0
  11. package/dist/agent-config/files.js.map +1 -0
  12. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  13. package/dist/agent-config/model-settings/claude.js +11 -0
  14. package/dist/agent-config/model-settings/claude.js.map +1 -0
  15. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  16. package/dist/agent-config/model-settings/codex.js +16 -0
  17. package/dist/agent-config/model-settings/codex.js.map +1 -0
  18. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  19. package/dist/agent-config/model-settings/opencode.js +8 -0
  20. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  21. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  22. package/dist/agent-config/model-settings/pi.js +18 -0
  23. package/dist/agent-config/model-settings/pi.js.map +1 -0
  24. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  25. package/dist/agent-config/model-settings/shared.js +93 -0
  26. package/dist/agent-config/model-settings/shared.js.map +1 -0
  27. package/dist/agent-config/model-settings/types.d.ts +9 -0
  28. package/dist/agent-config/model-settings/types.js +2 -0
  29. package/dist/agent-config/model-settings/types.js.map +1 -0
  30. package/dist/agent-config/models.d.ts +9 -0
  31. package/dist/agent-config/models.js +32 -0
  32. package/dist/agent-config/models.js.map +1 -0
  33. package/dist/agent-config/seed.d.ts +7 -0
  34. package/dist/agent-config/seed.js +90 -0
  35. package/dist/agent-config/seed.js.map +1 -0
  36. package/dist/agent-config/service.d.ts +44 -0
  37. package/dist/agent-config/service.js +71 -0
  38. package/dist/agent-config/service.js.map +1 -0
  39. package/dist/agent-config/validate.d.ts +21 -0
  40. package/dist/agent-config/validate.js +76 -0
  41. package/dist/agent-config/validate.js.map +1 -0
  42. package/dist/automations/coordinator.d.ts +26 -0
  43. package/dist/automations/coordinator.js +66 -0
  44. package/dist/automations/coordinator.js.map +1 -0
  45. package/dist/automations/github-poller.d.ts +74 -0
  46. package/dist/automations/github-poller.js +234 -0
  47. package/dist/automations/github-poller.js.map +1 -0
  48. package/dist/automations/scheduler.d.ts +42 -0
  49. package/dist/automations/scheduler.js +192 -0
  50. package/dist/automations/scheduler.js.map +1 -0
  51. package/dist/automations/store.d.ts +65 -0
  52. package/dist/automations/store.js +298 -0
  53. package/dist/automations/store.js.map +1 -0
  54. package/dist/automations/task-template.d.ts +18 -0
  55. package/dist/automations/task-template.js +95 -0
  56. package/dist/automations/task-template.js.map +1 -0
  57. package/dist/automations/types.d.ts +255 -0
  58. package/dist/automations/types.js +159 -0
  59. package/dist/automations/types.js.map +1 -0
  60. package/dist/config.d.ts +77 -0
  61. package/dist/config.js +242 -0
  62. package/dist/config.js.map +1 -0
  63. package/dist/contract/agent-config.d.ts +153 -0
  64. package/dist/contract/agent-profiles.d.ts +347 -0
  65. package/dist/contract/automations.d.ts +935 -0
  66. package/dist/contract/events.d.ts +104 -0
  67. package/dist/contract/github.d.ts +556 -0
  68. package/dist/contract/health.d.ts +102 -0
  69. package/dist/contract/index.d.ts +16 -0
  70. package/dist/contract/index.js +1895 -0
  71. package/dist/contract/projects.d.ts +210 -0
  72. package/dist/contract/repo.d.ts +234 -0
  73. package/dist/contract/runs.d.ts +1473 -0
  74. package/dist/contract/skills.d.ts +232 -0
  75. package/dist/contract/workflows.d.ts +218 -0
  76. package/dist/contract/workspace.d.ts +579 -0
  77. package/dist/core/agent-env.d.ts +31 -0
  78. package/dist/core/agent-env.js +371 -0
  79. package/dist/core/agent-env.js.map +1 -0
  80. package/dist/core/agent-model-policy.d.ts +10 -0
  81. package/dist/core/agent-model-policy.js +36 -0
  82. package/dist/core/agent-model-policy.js.map +1 -0
  83. package/dist/core/agent-profiles.d.ts +62 -0
  84. package/dist/core/agent-profiles.js +90 -0
  85. package/dist/core/agent-profiles.js.map +1 -0
  86. package/dist/core/agent-runner.d.ts +211 -0
  87. package/dist/core/agent-runner.js +68 -0
  88. package/dist/core/agent-runner.js.map +1 -0
  89. package/dist/core/ask.d.ts +105 -0
  90. package/dist/core/ask.js +187 -0
  91. package/dist/core/ask.js.map +1 -0
  92. package/dist/core/backend-detect.d.ts +16 -0
  93. package/dist/core/backend-detect.js +155 -0
  94. package/dist/core/backend-detect.js.map +1 -0
  95. package/dist/core/claude-cli-runner.d.ts +59 -0
  96. package/dist/core/claude-cli-runner.js +483 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-ui-mapper.d.ts +80 -0
  99. package/dist/core/claude-ui-mapper.js +598 -0
  100. package/dist/core/claude-ui-mapper.js.map +1 -0
  101. package/dist/core/codex-app-server-runner.d.ts +41 -0
  102. package/dist/core/codex-app-server-runner.js +584 -0
  103. package/dist/core/codex-app-server-runner.js.map +1 -0
  104. package/dist/core/codex-app-server-transport.d.ts +35 -0
  105. package/dist/core/codex-app-server-transport.js +150 -0
  106. package/dist/core/codex-app-server-transport.js.map +1 -0
  107. package/dist/core/codex-model-catalog.d.ts +10 -0
  108. package/dist/core/codex-model-catalog.js +110 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -0
  110. package/dist/core/codex-ui-mapper.d.ts +112 -0
  111. package/dist/core/codex-ui-mapper.js +766 -0
  112. package/dist/core/codex-ui-mapper.js.map +1 -0
  113. package/dist/core/model-identity.d.ts +125 -0
  114. package/dist/core/model-identity.js +132 -0
  115. package/dist/core/model-identity.js.map +1 -0
  116. package/dist/core/model-presets.d.ts +21 -0
  117. package/dist/core/model-presets.js +81 -0
  118. package/dist/core/model-presets.js.map +1 -0
  119. package/dist/core/ndjson.d.ts +6 -0
  120. package/dist/core/ndjson.js +23 -0
  121. package/dist/core/ndjson.js.map +1 -0
  122. package/dist/core/opencode-model-catalog.d.ts +32 -0
  123. package/dist/core/opencode-model-catalog.js +153 -0
  124. package/dist/core/opencode-model-catalog.js.map +1 -0
  125. package/dist/core/opencode-server-runner.d.ts +32 -0
  126. package/dist/core/opencode-server-runner.js +882 -0
  127. package/dist/core/opencode-server-runner.js.map +1 -0
  128. package/dist/core/opencode-ui-mapper.d.ts +137 -0
  129. package/dist/core/opencode-ui-mapper.js +800 -0
  130. package/dist/core/opencode-ui-mapper.js.map +1 -0
  131. package/dist/core/pi-model-catalog.d.ts +31 -0
  132. package/dist/core/pi-model-catalog.js +152 -0
  133. package/dist/core/pi-model-catalog.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +403 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +36 -0
  138. package/dist/core/pi-ui-mapper.js +304 -0
  139. package/dist/core/pi-ui-mapper.js.map +1 -0
  140. package/dist/core/process-usage.d.ts +66 -0
  141. package/dist/core/process-usage.js +193 -0
  142. package/dist/core/process-usage.js.map +1 -0
  143. package/dist/core/provider-auth.d.ts +154 -0
  144. package/dist/core/provider-auth.js +509 -0
  145. package/dist/core/provider-auth.js.map +1 -0
  146. package/dist/core/provider-availability.d.ts +3 -0
  147. package/dist/core/provider-availability.js +14 -0
  148. package/dist/core/provider-availability.js.map +1 -0
  149. package/dist/core/runner-factory.d.ts +8 -0
  150. package/dist/core/runner-factory.js +25 -0
  151. package/dist/core/runner-factory.js.map +1 -0
  152. package/dist/core/runner-model-catalog.d.ts +29 -0
  153. package/dist/core/runner-model-catalog.js +78 -0
  154. package/dist/core/runner-model-catalog.js.map +1 -0
  155. package/dist/core/secret-redaction.d.ts +37 -0
  156. package/dist/core/secret-redaction.js +115 -0
  157. package/dist/core/secret-redaction.js.map +1 -0
  158. package/dist/core/shell-env.d.ts +28 -0
  159. package/dist/core/shell-env.js +56 -0
  160. package/dist/core/shell-env.js.map +1 -0
  161. package/dist/core/tool-display.d.ts +31 -0
  162. package/dist/core/tool-display.js +179 -0
  163. package/dist/core/tool-display.js.map +1 -0
  164. package/dist/core/ui-events.d.ts +335 -0
  165. package/dist/core/ui-events.js +25 -0
  166. package/dist/core/ui-events.js.map +1 -0
  167. package/dist/core/usage-limit.d.ts +42 -0
  168. package/dist/core/usage-limit.js +209 -0
  169. package/dist/core/usage-limit.js.map +1 -0
  170. package/dist/core/usage.d.ts +11 -0
  171. package/dist/core/usage.js +15 -0
  172. package/dist/core/usage.js.map +1 -0
  173. package/dist/core/v1-text-coalescer.d.ts +36 -0
  174. package/dist/core/v1-text-coalescer.js +72 -0
  175. package/dist/core/v1-text-coalescer.js.map +1 -0
  176. package/dist/git-diff-base.d.ts +85 -0
  177. package/dist/git-diff-base.js +180 -0
  178. package/dist/git-diff-base.js.map +1 -0
  179. package/dist/git-refs.d.ts +11 -0
  180. package/dist/git-refs.js +14 -0
  181. package/dist/git-refs.js.map +1 -0
  182. package/dist/git-worktree.d.ts +161 -0
  183. package/dist/git-worktree.js +508 -0
  184. package/dist/git-worktree.js.map +1 -0
  185. package/dist/handoff.d.ts +62 -0
  186. package/dist/handoff.js +154 -0
  187. package/dist/handoff.js.map +1 -0
  188. package/dist/index.d.ts +2 -0
  189. package/dist/index.js +680 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/install-as-command.d.ts +40 -0
  192. package/dist/install-as-command.js +52 -0
  193. package/dist/install-as-command.js.map +1 -0
  194. package/dist/pack-check.d.ts +17 -0
  195. package/dist/pack-check.js +27 -0
  196. package/dist/pack-check.js.map +1 -0
  197. package/dist/paths.d.ts +140 -0
  198. package/dist/paths.js +192 -0
  199. package/dist/paths.js.map +1 -0
  200. package/dist/planner.d.ts +27 -0
  201. package/dist/planner.js +268 -0
  202. package/dist/planner.js.map +1 -0
  203. package/dist/release/manifests.d.ts +81 -0
  204. package/dist/release/manifests.js +74 -0
  205. package/dist/release/manifests.js.map +1 -0
  206. package/dist/release/snapshot.d.ts +67 -0
  207. package/dist/release/snapshot.js +97 -0
  208. package/dist/release/snapshot.js.map +1 -0
  209. package/dist/release/stable.d.ts +38 -0
  210. package/dist/release/stable.js +55 -0
  211. package/dist/release/stable.js.map +1 -0
  212. package/dist/runs/agent-tmpdir.d.ts +41 -0
  213. package/dist/runs/agent-tmpdir.js +183 -0
  214. package/dist/runs/agent-tmpdir.js.map +1 -0
  215. package/dist/runs/auto-name.d.ts +75 -0
  216. package/dist/runs/auto-name.js +179 -0
  217. package/dist/runs/auto-name.js.map +1 -0
  218. package/dist/runs/event-history.d.ts +50 -0
  219. package/dist/runs/event-history.js +613 -0
  220. package/dist/runs/event-history.js.map +1 -0
  221. package/dist/runs/retention.d.ts +60 -0
  222. package/dist/runs/retention.js +86 -0
  223. package/dist/runs/retention.js.map +1 -0
  224. package/dist/runs/review-gate.d.ts +18 -0
  225. package/dist/runs/review-gate.js +21 -0
  226. package/dist/runs/review-gate.js.map +1 -0
  227. package/dist/runs/run-index.d.ts +19 -0
  228. package/dist/runs/run-index.js +43 -0
  229. package/dist/runs/run-index.js.map +1 -0
  230. package/dist/runs/store.d.ts +446 -0
  231. package/dist/runs/store.js +1118 -0
  232. package/dist/runs/store.js.map +1 -0
  233. package/dist/runs/task-markers.d.ts +28 -0
  234. package/dist/runs/task-markers.js +74 -0
  235. package/dist/runs/task-markers.js.map +1 -0
  236. package/dist/runs/task-refs.d.ts +25 -0
  237. package/dist/runs/task-refs.js +74 -0
  238. package/dist/runs/task-refs.js.map +1 -0
  239. package/dist/runs/ui-event-sink.d.ts +81 -0
  240. package/dist/runs/ui-event-sink.js +210 -0
  241. package/dist/runs/ui-event-sink.js.map +1 -0
  242. package/dist/server/app-type.d.ts +21 -0
  243. package/dist/server/app-type.js +2 -0
  244. package/dist/server/app-type.js.map +1 -0
  245. package/dist/server/capabilities.d.ts +70 -0
  246. package/dist/server/capabilities.js +152 -0
  247. package/dist/server/capabilities.js.map +1 -0
  248. package/dist/server/checkout.d.ts +128 -0
  249. package/dist/server/checkout.js +296 -0
  250. package/dist/server/checkout.js.map +1 -0
  251. package/dist/server/forge/github.d.ts +513 -0
  252. package/dist/server/forge/github.js +2364 -0
  253. package/dist/server/forge/github.js.map +1 -0
  254. package/dist/server/forge/index.d.ts +40 -0
  255. package/dist/server/forge/index.js +72 -0
  256. package/dist/server/forge/index.js.map +1 -0
  257. package/dist/server/forge/types.d.ts +242 -0
  258. package/dist/server/forge/types.js +2 -0
  259. package/dist/server/forge/types.js.map +1 -0
  260. package/dist/server/fs-browse.d.ts +105 -0
  261. package/dist/server/fs-browse.js +182 -0
  262. package/dist/server/fs-browse.js.map +1 -0
  263. package/dist/server/git-changes.d.ts +213 -0
  264. package/dist/server/git-changes.js +555 -0
  265. package/dist/server/git-changes.js.map +1 -0
  266. package/dist/server/git.d.ts +28 -0
  267. package/dist/server/git.js +112 -0
  268. package/dist/server/git.js.map +1 -0
  269. package/dist/server/github.d.ts +9 -0
  270. package/dist/server/github.js +8 -0
  271. package/dist/server/github.js.map +1 -0
  272. package/dist/server/launch-key.d.ts +7 -0
  273. package/dist/server/launch-key.js +33 -0
  274. package/dist/server/launch-key.js.map +1 -0
  275. package/dist/server/open-in-app.d.ts +66 -0
  276. package/dist/server/open-in-app.js +211 -0
  277. package/dist/server/open-in-app.js.map +1 -0
  278. package/dist/server/open-in-terminal.d.ts +70 -0
  279. package/dist/server/open-in-terminal.js +179 -0
  280. package/dist/server/open-in-terminal.js.map +1 -0
  281. package/dist/server/pr.d.ts +7 -0
  282. package/dist/server/pr.js +7 -0
  283. package/dist/server/pr.js.map +1 -0
  284. package/dist/server/project-context.d.ts +120 -0
  285. package/dist/server/project-context.js +182 -0
  286. package/dist/server/project-context.js.map +1 -0
  287. package/dist/server/provider-action-gate.d.ts +8 -0
  288. package/dist/server/provider-action-gate.js +56 -0
  289. package/dist/server/provider-action-gate.js.map +1 -0
  290. package/dist/server/provider-auth-runtime.d.ts +21 -0
  291. package/dist/server/provider-auth-runtime.js +66 -0
  292. package/dist/server/provider-auth-runtime.js.map +1 -0
  293. package/dist/server/server.d.ts +13138 -0
  294. package/dist/server/server.js +5263 -0
  295. package/dist/server/server.js.map +1 -0
  296. package/dist/server/static-ui.d.ts +49 -0
  297. package/dist/server/static-ui.js +92 -0
  298. package/dist/server/static-ui.js.map +1 -0
  299. package/dist/server/validators.d.ts +97 -0
  300. package/dist/server/validators.js +86 -0
  301. package/dist/server/validators.js.map +1 -0
  302. package/dist/server/ws.d.ts +85 -0
  303. package/dist/server/ws.js +218 -0
  304. package/dist/server/ws.js.map +1 -0
  305. package/dist/server/wsl.d.ts +25 -0
  306. package/dist/server/wsl.js +92 -0
  307. package/dist/server/wsl.js.map +1 -0
  308. package/dist/server-install/engine.d.ts +50 -0
  309. package/dist/server-install/engine.js +324 -0
  310. package/dist/server-install/engine.js.map +1 -0
  311. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  312. package/dist/server-install/platforms/macosx-ngrok.js +345 -0
  313. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  314. package/dist/server-install/platforms/ubuntu-vps.d.ts +78 -0
  315. package/dist/server-install/platforms/ubuntu-vps.js +1016 -0
  316. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  317. package/dist/server-install/state.d.ts +52 -0
  318. package/dist/server-install/state.js +182 -0
  319. package/dist/server-install/state.js.map +1 -0
  320. package/dist/server-install/steps.d.ts +109 -0
  321. package/dist/server-install/steps.js +334 -0
  322. package/dist/server-install/steps.js.map +1 -0
  323. package/dist/server-install/strategies.d.ts +4 -0
  324. package/dist/server-install/strategies.js +20 -0
  325. package/dist/server-install/strategies.js.map +1 -0
  326. package/dist/server-install/types.d.ts +287 -0
  327. package/dist/server-install/types.js +121 -0
  328. package/dist/server-install/types.js.map +1 -0
  329. package/dist/server-install/ui.d.ts +42 -0
  330. package/dist/server-install/ui.js +130 -0
  331. package/dist/server-install/ui.js.map +1 -0
  332. package/dist/skills-banner.d.ts +22 -0
  333. package/dist/skills-banner.js +41 -0
  334. package/dist/skills-banner.js.map +1 -0
  335. package/dist/skills-remote.d.ts +84 -0
  336. package/dist/skills-remote.js +468 -0
  337. package/dist/skills-remote.js.map +1 -0
  338. package/dist/skills-update.d.ts +88 -0
  339. package/dist/skills-update.js +392 -0
  340. package/dist/skills-update.js.map +1 -0
  341. package/dist/skills.d.ts +82 -0
  342. package/dist/skills.js +251 -0
  343. package/dist/skills.js.map +1 -0
  344. package/dist/todos.d.ts +48 -0
  345. package/dist/todos.js +201 -0
  346. package/dist/todos.js.map +1 -0
  347. package/dist/ui-state.d.ts +26 -0
  348. package/dist/ui-state.js +38 -0
  349. package/dist/ui-state.js.map +1 -0
  350. package/dist/update-check.d.ts +12 -0
  351. package/dist/update-check.js +41 -0
  352. package/dist/update-check.js.map +1 -0
  353. package/dist/workflows/load.d.ts +15 -0
  354. package/dist/workflows/load.js +56 -0
  355. package/dist/workflows/load.js.map +1 -0
  356. package/dist/workflows/run.d.ts +758 -0
  357. package/dist/workflows/run.js +3389 -0
  358. package/dist/workflows/run.js.map +1 -0
  359. package/dist/workflows/types.d.ts +153 -0
  360. package/dist/workflows/types.js +212 -0
  361. package/dist/workflows/types.js.map +1 -0
  362. package/dist/workspace/agent-accounts.d.ts +153 -0
  363. package/dist/workspace/agent-accounts.js +304 -0
  364. package/dist/workspace/agent-accounts.js.map +1 -0
  365. package/dist/workspace/agent-profiles.d.ts +78 -0
  366. package/dist/workspace/agent-profiles.js +115 -0
  367. package/dist/workspace/agent-profiles.js.map +1 -0
  368. package/dist/workspace/config.d.ts +169 -0
  369. package/dist/workspace/config.js +379 -0
  370. package/dist/workspace/config.js.map +1 -0
  371. package/dist/workspace/migrations.d.ts +45 -0
  372. package/dist/workspace/migrations.js +147 -0
  373. package/dist/workspace/migrations.js.map +1 -0
  374. package/dist/workspace/projects-cli.d.ts +25 -0
  375. package/dist/workspace/projects-cli.js +172 -0
  376. package/dist/workspace/projects-cli.js.map +1 -0
  377. package/dist/workspace/projects.d.ts +109 -0
  378. package/dist/workspace/projects.js +250 -0
  379. package/dist/workspace/projects.js.map +1 -0
  380. package/dist/workspace/semaphore.d.ts +179 -0
  381. package/dist/workspace/semaphore.js +195 -0
  382. package/dist/workspace/semaphore.js.map +1 -0
  383. package/dist/workspace/ui-state.d.ts +34 -0
  384. package/dist/workspace/ui-state.js +53 -0
  385. package/dist/workspace/ui-state.js.map +1 -0
  386. package/package.json +70 -0
  387. package/scripts/check-pack.mjs +46 -0
  388. package/scripts/inline-contract.mjs +112 -0
  389. package/scripts/install-as-command.mjs +120 -0
  390. package/scripts/mock-claude.mjs +520 -0
  391. package/scripts/mock-pi-rpc.mjs +83 -0
  392. package/scripts/sync-readme.mjs +20 -0
  393. package/scripts/test-process-usage.mjs +47 -0
  394. package/web/dist/assets/alert-dialog-B4Ofsgv7.js +1 -0
  395. package/web/dist/assets/arrow-down-Dy8dup7j.js +1 -0
  396. package/web/dist/assets/arrow-left-BJaucbhn.js +1 -0
  397. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  398. package/web/dist/assets/centered-state-duPW0phQ.js +43 -0
  399. package/web/dist/assets/chevron-right-Be4A5TCS.js +1 -0
  400. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  401. package/web/dist/assets/collapsible-DdcNBdSk.js +1 -0
  402. package/web/dist/assets/commit-list-CgvN9vec.js +1 -0
  403. package/web/dist/assets/compare-variants-CQA2nd65.js +1 -0
  404. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  405. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  406. package/web/dist/assets/diff-B6Agp5Hl.js +3 -0
  407. package/web/dist/assets/diff-stat-BoXuGkgq.js +1 -0
  408. package/web/dist/assets/diff-view-CD8XI-fj.js +6 -0
  409. package/web/dist/assets/diff-woXpYk--.js +1 -0
  410. package/web/dist/assets/dropdown-menu-B3SYw-k5.js +1 -0
  411. package/web/dist/assets/editable-title-B-hjp5wl.js +1 -0
  412. package/web/dist/assets/ellipsis-vertical-BYwzw0xl.js +1 -0
  413. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  414. package/web/dist/assets/file-BRj5eISx.js +1 -0
  415. package/web/dist/assets/folder-z4oT5981.js +1 -0
  416. package/web/dist/assets/git-toolbar-owSEkYld.js +1 -0
  417. package/web/dist/assets/github-Bz2VgRX3.js +1 -0
  418. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  419. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  420. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  421. package/web/dist/assets/html-BY76lXLH.js +1 -0
  422. package/web/dist/assets/image-preview-h3WFluuy.js +1 -0
  423. package/web/dist/assets/index-BbcQNT92.css +2 -0
  424. package/web/dist/assets/index-EtQQQ6Kj.js +7 -0
  425. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  426. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  427. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  428. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  429. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  430. package/web/dist/assets/json-qhed-kSA.js +1 -0
  431. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  432. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  433. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  434. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  435. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  436. package/web/dist/assets/markdown-DqBKYPiB.js +2 -0
  437. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  438. package/web/dist/assets/new-task-form-BdJKRBJX.js +1 -0
  439. package/web/dist/assets/pill-BQfmfpYp.js +1 -0
  440. package/web/dist/assets/project-router-DxgFZY1l.js +1 -0
  441. package/web/dist/assets/prompt-templates-B6m16gq-.js +15 -0
  442. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  443. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  444. package/web/dist/assets/refresh-cw-mhSpxf2a.js +1 -0
  445. package/web/dist/assets/repo-git-CUNRxR3_.js +1 -0
  446. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  447. package/web/dist/assets/run-diff-DsmmDVfx.js +3 -0
  448. package/web/dist/assets/run-header-BkhrseLJ.js +1 -0
  449. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  450. package/web/dist/assets/search-x-BqDMB2g8.js +1 -0
  451. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  452. package/web/dist/assets/skill-empty-hint-BWEvTggc.js +1 -0
  453. package/web/dist/assets/skills-9oR_oHse.js +1 -0
  454. package/web/dist/assets/skills-DwIxnnWO.js +1 -0
  455. package/web/dist/assets/sparkles-DIoTQpyx.js +1 -0
  456. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  457. package/web/dist/assets/square-terminal-Cc7CuQxc.js +1 -0
  458. package/web/dist/assets/tab-link-D1fQgpmO.js +1 -0
  459. package/web/dist/assets/task-changes-BKeLlDpK.js +1 -0
  460. package/web/dist/assets/task-commits-gcEFZIa5.js +1 -0
  461. package/web/dist/assets/task-files-BGAqoXTW.js +2 -0
  462. package/web/dist/assets/task-thread-DT8aUYTS.js +9 -0
  463. package/web/dist/assets/textarea-BOVbfy5C.js +1 -0
  464. package/web/dist/assets/thread-loading-CypW73KD.js +1 -0
  465. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  466. package/web/dist/assets/trash-2-CJq6LHWn.js +1 -0
  467. package/web/dist/assets/triangle-alert-CjDFvU27.js +1 -0
  468. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  469. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  470. package/web/dist/assets/upload-CPDZlJeK.js +1 -0
  471. package/web/dist/assets/use-desktop-5JsLmi0a.js +1 -0
  472. package/web/dist/assets/use-submit-shortcut-CHVFevty.js +1 -0
  473. package/web/dist/assets/utils-DiO6zyJd.js +64 -0
  474. package/web/dist/assets/workflows-rQDFzWRt.js +11 -0
  475. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  476. package/web/dist/assets/zoomable-image-COWqb11v.js +1 -0
  477. package/web/dist/index.html +80 -0
  478. package/web/dist/open-mercato.svg +11 -0
@@ -0,0 +1,211 @@
1
+ /**
2
+ * The backend-agnostic seam for running one agent task. Adapted from
3
+ * @cezar/core's `agents/agent-runner.ts`, trimmed for single-user local use:
4
+ * no token-budget circuit breaker, no zod response schemas — one run is one
5
+ * agent-CLI session streaming normalized events.
6
+ *
7
+ * Four interchangeable backends implement this seam, each as a persistent
8
+ * process so multi-turn follow-ups, `waiting`, interrupt and resume all work:
9
+ * - `claude` — Claude Code CLI, stream-json over stdin/stdout;
10
+ * - `codex` — `codex app-server`, JSON-RPC 2.0 (JSONL) over stdin/stdout;
11
+ * - `opencode` — `opencode serve`, HTTP + SSE;
12
+ * - `pi` — pi coding CLI, RPC over JSONL stdin/stdout, selecting its
13
+ * model with `provider/model`.
14
+ */
15
+ import type { UiEvent } from './ui-events.ts';
16
+ /**
17
+ * The user-selectable runners (what config/GUI expose), in display order — the SINGLE source of
18
+ * truth for the set. Every runtime enumeration derives from this tuple (zod schemas, the
19
+ * server-install "at least one agent CLI" gate, the CLI-handoff registry) rather than repeating
20
+ * the literals, so adding runner #5 is a one-line change here and typecheck finds the rest.
21
+ */
22
+ export declare const RUNNER_IDS: readonly ['claude', 'codex', 'opencode', 'pi'];
23
+ /** The user-selectable runners (what config/GUI expose). */
24
+ export type RunnerId = (typeof RUNNER_IDS)[number];
25
+ /** `claude-cli` is the legacy id kept so old run records still parse. */
26
+ export type AgentBackend = RunnerId | 'claude-cli';
27
+ /** Narrow an arbitrary string (a config value, a check name) to a runner id. */
28
+ export declare function isRunnerId(value: string): value is RunnerId;
29
+ export interface AgentRunSpec {
30
+ /** Appended to the CLI's default system prompt (`--append-system-prompt`). */
31
+ systemPrompt?: string;
32
+ userPrompt: string;
33
+ /** Image blocks delivered with the first user message — screenshots pasted
34
+ * into the new-task form (spec 002's paste path, at task start). */
35
+ images?: ContentBlock[];
36
+ /** The directory the agent runs in — also the only writable root. */
37
+ cwd: string;
38
+ /** Tool allowlist; the CLI is default-deny for anything not listed — but
39
+ * the zero-config default (`DEFAULT_ALLOWED_TOOLS`) includes `Bash`
40
+ * unrestricted unless `bashAllowlist` is set, so treat the default as
41
+ * full shell access in `cwd`, not a sandboxed allowlist (#430). */
42
+ allowedTools?: string[];
43
+ /** When `Bash` is allowed, restrict it to commands starting with one of these. */
44
+ bashAllowlist?: string[];
45
+ /** Extra directories the agent may read/write besides `cwd`. */
46
+ additionalDirectories?: string[];
47
+ /** Extra env vars for the agent process (merged over `process.env`) —
48
+ * e.g. CEZ_HANDOFF_FILE / CEZ_TODOS_FILE / CEZ_TASK_ID (spec 007). */
49
+ env?: Record<string, string>;
50
+ model?: string;
51
+ /** Wall-clock kill switch for the run (ms). */
52
+ timeoutMs?: number;
53
+ /**
54
+ * Stable session id (UUID) so the user can take over interactively later:
55
+ * `cd <repo> && claude --resume <sessionId>`.
56
+ */
57
+ sessionId?: string;
58
+ /**
59
+ * Spawn `claude --resume <sessionId>` instead of starting a fresh session —
60
+ * picks up the on-disk conversation (used by "Continue" after a run ends).
61
+ */
62
+ resume?: boolean;
63
+ }
64
+ /**
65
+ * Backends without a dedicated system-prompt channel (codex app-server,
66
+ * opencode serve) deliver `spec.systemPrompt` as a leading block of the
67
+ * opening user message — the documented per-backend mapping (spec §protocol
68
+ * v2: claude = `--append-system-prompt`, codex/opencode = prepended here).
69
+ */
70
+ export declare function prependSystemPrompt(systemPrompt: string | undefined, userPrompt: string): string;
71
+ /**
72
+ * True for the `128 + signal` exit codes an agent CLI reports when it handles
73
+ * a stop signal itself instead of dying from it (SIGINT/SIGKILL/SIGTERM).
74
+ *
75
+ * Every runner arms a SIGTERM→SIGKILL watchdog on `end()` and signals on
76
+ * `interrupt()` (#703): the CLIs install their own handlers, so a session the
77
+ * runner tore down on purpose comes back as a NON-ZERO exit. Paired with a
78
+ * "we sent the signal" flag, this predicate keeps that teardown out of the
79
+ * error path — an exit cezar caused is never an agent failure.
80
+ */
81
+ export declare function isSignalTerminationExit(exitCode: number | null): boolean;
82
+ /** The slice of `ChildProcess` a termination tracker needs — keeps the helper
83
+ * usable from the transport layer and from test fakes alike. */
84
+ export interface TrackableChild {
85
+ exitCode: number | null;
86
+ signalCode: NodeJS.Signals | null;
87
+ once(event: 'exit', listener: () => void): unknown;
88
+ }
89
+ /**
90
+ * Returns a predicate that answers "has this child actually terminated?".
91
+ *
92
+ * `ChildProcess.killed` answers a different question — it flips as soon as a
93
+ * signal is *delivered*, whether or not the child dies from it. Every agent CLI
94
+ * installs its own SIGTERM handler, so gating a SIGTERM→SIGKILL watchdog on
95
+ * `!child.killed` disables the escalation for exactly the child it exists for:
96
+ * `killed` is true, `exitCode` stays null, and the process outlives the whole
97
+ * grace window (#844, same defect fixed for the discovery probe in #841).
98
+ *
99
+ * Seeded from `exitCode`/`signalCode` so a child that died before the watchdog
100
+ * was armed is recognized without waiting for an event that already fired.
101
+ */
102
+ export declare function trackChildExit(child: TrackableChild): () => boolean;
103
+ /** One content block of a user message — mirrors the Anthropic wire format
104
+ * so it can be written to the claude CLI's stdin verbatim. */
105
+ export type ContentBlock = {
106
+ type: 'text';
107
+ text: string;
108
+ } | {
109
+ type: 'image';
110
+ source: {
111
+ type: 'base64';
112
+ media_type: string;
113
+ data: string;
114
+ };
115
+ };
116
+ /** Normalized event stream — the GUI renders these, the store persists them. */
117
+ export type AgentEvent = {
118
+ type: 'text';
119
+ text: string;
120
+ } | {
121
+ type: 'tool-call';
122
+ id: string;
123
+ tool: string;
124
+ input: unknown;
125
+ } | {
126
+ type: 'tool-result';
127
+ toolCallId: string;
128
+ result: string;
129
+ isError: boolean;
130
+ }
131
+ /** An image inside a tool result (screenshot tools, Read on a PNG…) —
132
+ * raw base64 here; the run manager persists it and re-emits a URL. */
133
+ | {
134
+ type: 'image';
135
+ mediaType: string;
136
+ data: string;
137
+ } | {
138
+ type: 'token-usage';
139
+ tokensUsed: number;
140
+ } | {
141
+ type: 'cost';
142
+ usd: number;
143
+ }
144
+ /** The backend's real session id, once known — codex threads and opencode
145
+ * sessions mint their own id, so the run manager persists this to enable
146
+ * resume ("Continue") and "open in CLI". Claude's equals `spec.sessionId`. */
147
+ | {
148
+ type: 'session';
149
+ sessionId: string;
150
+ } | {
151
+ type: 'turn-end';
152
+ } | {
153
+ type: 'note';
154
+ message: string;
155
+ } | {
156
+ type: 'done';
157
+ } | {
158
+ type: 'error';
159
+ message: string;
160
+ };
161
+ export interface AgentToolCallRecord {
162
+ id: string;
163
+ name: string;
164
+ input: unknown;
165
+ }
166
+ export interface AgentRunResult {
167
+ /** Concatenated assistant text across the run, trimmed. */
168
+ text: string;
169
+ toolCalls: AgentToolCallRecord[];
170
+ /** Cost-weighted token usage; 0 when the backend surfaced no telemetry. */
171
+ tokensUsed: number;
172
+ sessionId?: string;
173
+ }
174
+ export interface SessionOptions {
175
+ /** Close the session shortly after the first turn ends (single-turn
176
+ * behavior, used for non-interactive workflow steps). Interactive
177
+ * sessions omit this and control `end()` themselves. */
178
+ autoEndAfterFirstTurn?: boolean;
179
+ /** Protocol-v2 channel: receives the normalized `UiEvent` stream emitted
180
+ * ALONGSIDE the v1 `AgentEvent`s (additive — v1 keeps flowing unchanged).
181
+ * RunManager consumption lands in R2 step 2.1. */
182
+ onUiEvent?: (event: UiEvent) => void;
183
+ }
184
+ /**
185
+ * A live agent session over one spawned backend process. The process stays
186
+ * alive between turns and reads further user messages — that's what makes
187
+ * mid-task follow-ups possible. Implemented identically by every backend
188
+ * (claude stdin, codex app-server, opencode serve).
189
+ */
190
+ export interface AgentSession {
191
+ /** Resolves when the backend process exits — the session is fully over. */
192
+ result: Promise<AgentRunResult>;
193
+ /** OS pid of the spawned backend process — the root of the run's process
194
+ * tree (agents spawn Bash children under it). Absent when the spawn
195
+ * failed before a pid existed. Feeds live resource telemetry (#348). */
196
+ readonly pid?: number;
197
+ /** Write a user message into the live session. False when it is closed. */
198
+ sendMessage(content: ContentBlock[]): boolean;
199
+ /** Graceful close: end input, then a SIGTERM→SIGKILL watchdog. */
200
+ end(): void;
201
+ /** Hard stop (used by cancel). */
202
+ interrupt(): void;
203
+ /** True while the session still accepts messages. */
204
+ readonly open: boolean;
205
+ }
206
+ export interface AgentRunner {
207
+ readonly backend: AgentBackend;
208
+ run(spec: AgentRunSpec, onEvent?: (event: AgentEvent) => void): Promise<AgentRunResult>;
209
+ startSession(spec: AgentRunSpec, onEvent?: (event: AgentEvent) => void, opts?: SessionOptions): AgentSession;
210
+ interrupt(): Promise<void>;
211
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The backend-agnostic seam for running one agent task. Adapted from
3
+ * @cezar/core's `agents/agent-runner.ts`, trimmed for single-user local use:
4
+ * no token-budget circuit breaker, no zod response schemas — one run is one
5
+ * agent-CLI session streaming normalized events.
6
+ *
7
+ * Four interchangeable backends implement this seam, each as a persistent
8
+ * process so multi-turn follow-ups, `waiting`, interrupt and resume all work:
9
+ * - `claude` — Claude Code CLI, stream-json over stdin/stdout;
10
+ * - `codex` — `codex app-server`, JSON-RPC 2.0 (JSONL) over stdin/stdout;
11
+ * - `opencode` — `opencode serve`, HTTP + SSE;
12
+ * - `pi` — pi coding CLI, RPC over JSONL stdin/stdout, selecting its
13
+ * model with `provider/model`.
14
+ */
15
+ /**
16
+ * The user-selectable runners (what config/GUI expose), in display order — the SINGLE source of
17
+ * truth for the set. Every runtime enumeration derives from this tuple (zod schemas, the
18
+ * server-install "at least one agent CLI" gate, the CLI-handoff registry) rather than repeating
19
+ * the literals, so adding runner #5 is a one-line change here and typecheck finds the rest.
20
+ */
21
+ export const RUNNER_IDS = ['claude', 'codex', 'opencode', 'pi'];
22
+ /** Narrow an arbitrary string (a config value, a check name) to a runner id. */
23
+ export function isRunnerId(value) {
24
+ return RUNNER_IDS.includes(value);
25
+ }
26
+ /**
27
+ * Backends without a dedicated system-prompt channel (codex app-server,
28
+ * opencode serve) deliver `spec.systemPrompt` as a leading block of the
29
+ * opening user message — the documented per-backend mapping (spec §protocol
30
+ * v2: claude = `--append-system-prompt`, codex/opencode = prepended here).
31
+ */
32
+ export function prependSystemPrompt(systemPrompt, userPrompt) {
33
+ return systemPrompt ? `${systemPrompt}\n\n---\n\n${userPrompt}` : userPrompt;
34
+ }
35
+ /**
36
+ * True for the `128 + signal` exit codes an agent CLI reports when it handles
37
+ * a stop signal itself instead of dying from it (SIGINT/SIGKILL/SIGTERM).
38
+ *
39
+ * Every runner arms a SIGTERM→SIGKILL watchdog on `end()` and signals on
40
+ * `interrupt()` (#703): the CLIs install their own handlers, so a session the
41
+ * runner tore down on purpose comes back as a NON-ZERO exit. Paired with a
42
+ * "we sent the signal" flag, this predicate keeps that teardown out of the
43
+ * error path — an exit cezar caused is never an agent failure.
44
+ */
45
+ export function isSignalTerminationExit(exitCode) {
46
+ return exitCode === 130 || exitCode === 137 || exitCode === 143;
47
+ }
48
+ /**
49
+ * Returns a predicate that answers "has this child actually terminated?".
50
+ *
51
+ * `ChildProcess.killed` answers a different question — it flips as soon as a
52
+ * signal is *delivered*, whether or not the child dies from it. Every agent CLI
53
+ * installs its own SIGTERM handler, so gating a SIGTERM→SIGKILL watchdog on
54
+ * `!child.killed` disables the escalation for exactly the child it exists for:
55
+ * `killed` is true, `exitCode` stays null, and the process outlives the whole
56
+ * grace window (#844, same defect fixed for the discovery probe in #841).
57
+ *
58
+ * Seeded from `exitCode`/`signalCode` so a child that died before the watchdog
59
+ * was armed is recognized without waiting for an event that already fired.
60
+ */
61
+ export function trackChildExit(child) {
62
+ let exited = child.exitCode != null || child.signalCode != null;
63
+ child.once('exit', () => {
64
+ exited = true;
65
+ });
66
+ return () => exited;
67
+ }
68
+ //# sourceMappingURL=agent-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runner.js","sourceRoot":"","sources":["../../src/core/agent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAU,CAAC;AAQzE,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAQ,UAAgC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAsCD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAgC,EAAE,UAAkB;IACtF,OAAO,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,cAAc,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;AAC/E,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAuB;IAC7D,OAAO,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC;AAClE,CAAC;AAUD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC;IAChE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;QACtB,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC;AACtB,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * AskUser payload — the structured multiple-choice question an agent asks the
3
+ * user, so the cockpit can render clickable option chips instead of the prose
4
+ * fallback ("AskUserQuestion isn't available…"). See the spec
5
+ * `.ai/specs/2026-07-18-askuser-across-runners.md`.
6
+ *
7
+ * The agent emits this as a `CEZ:ASK <compact-json>` control marker (a sibling
8
+ * of `CEZ:DONE` / `CEZ:MONITORING`), parsed on the assembled turn text in
9
+ * `src/workflows/run.ts` — uniform across claude, codex and opencode with no
10
+ * per-backend mapper work. The shape is modeled 1:1 on Claude Code's built-in
11
+ * `AskUserQuestion` (1–4 questions, 2–4 options each, `header` ≤12 chars,
12
+ * unique question texts and unique option labels) so a native bridge can map
13
+ * onto it later. A free-text "Other" is always available via the composer, so
14
+ * it is never an explicit option.
15
+ */
16
+ import { z } from 'zod';
17
+ export declare const askOptionSchema: z.ZodObject<{
18
+ label: z.ZodString;
19
+ description: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>;
21
+ export declare const askQuestionSchema: z.ZodObject<{
22
+ id: z.ZodOptional<z.ZodString>;
23
+ header: z.ZodString;
24
+ question: z.ZodString;
25
+ options: z.ZodArray<z.ZodObject<{
26
+ label: z.ZodString;
27
+ description: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strict>>;
29
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
30
+ }, z.core.$strict>;
31
+ export declare const askRequestSchema: z.ZodObject<{
32
+ questions: z.ZodArray<z.ZodObject<{
33
+ id: z.ZodOptional<z.ZodString>;
34
+ header: z.ZodString;
35
+ question: z.ZodString;
36
+ options: z.ZodArray<z.ZodObject<{
37
+ label: z.ZodString;
38
+ description: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strict>>;
40
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
41
+ }, z.core.$strict>>;
42
+ }, z.core.$strict>;
43
+ export type AskOption = z.infer<typeof askOptionSchema>;
44
+ export type AskQuestion = z.infer<typeof askQuestionSchema>;
45
+ export type AskRequest = z.infer<typeof askRequestSchema>;
46
+ export interface AskParseIssue {
47
+ code: string;
48
+ path: PropertyKey[];
49
+ message: string;
50
+ }
51
+ /** The diagnostic parse result used at turn-end. The compatibility wrapper
52
+ * below deliberately keeps returning `AskRequest | null`. */
53
+ export type AskMarkerParseResult = {
54
+ kind: 'none';
55
+ } | {
56
+ kind: 'invalid-json';
57
+ message: string;
58
+ } | {
59
+ kind: 'invalid-structure';
60
+ issues: AskParseIssue[];
61
+ } | {
62
+ kind: 'valid';
63
+ request: AskRequest;
64
+ normalized: boolean;
65
+ };
66
+ /**
67
+ * Parse a value into a validated `AskRequest`, or `null` when it does not match
68
+ * (bad counts, over-length header, non-unique labels/questions, extra keys).
69
+ * Callers degrade to plain text on `null` — the feature never makes the prose
70
+ * fallback worse.
71
+ */
72
+ export declare function parseAskRequest(value: unknown): AskRequest | null;
73
+ /**
74
+ * The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
75
+ * sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
76
+ * text so delta-streaming backends can't split it — uniform across all three
77
+ * backends. The JSON is greedily captured from the first `{` after the keyword
78
+ * to the last `}` at end-of-text.
79
+ */
80
+ export declare const ASK_MARKER_RE: RegExp;
81
+ /**
82
+ * Parse a trailing marker with an actionable result for diagnostics. A
83
+ * parseable near-valid request gets one bounded normalization pass; structural
84
+ * violations remain rejected so the raw fallback stays readable.
85
+ */
86
+ export declare function parseAskMarkerResult(turnText: string): AskMarkerParseResult;
87
+ /**
88
+ * Extract and validate a trailing `CEZ:ASK <json>` marker from assembled turn
89
+ * text. Returns a strict or safely normalized `AskRequest`, or `null` when
90
+ * there is no marker or its payload remains invalid (caller degrades to plain
91
+ * text — the prose fallback is never made worse).
92
+ */
93
+ export declare function parseAskMarker(turnText: string): AskRequest | null;
94
+ /**
95
+ * Strip a trailing `CEZ:ASK <json>` marker from one text event so transcripts
96
+ * stay free of protocol noise — but ONLY when the payload actually validates.
97
+ * An invalid payload never becomes an ask card (`parseAskMarker` → `null`), so
98
+ * stripping it would delete the agent's question from the transcript with
99
+ * nothing to replace it; it stays visible as raw text instead — degraded but
100
+ * answerable (the prose fallback is never made worse). Delta backends may split
101
+ * the marker across events — then it stays visible; detection on the assembled
102
+ * turn text is unaffected (same best-effort caveat as the `CEZ:DONE` /
103
+ * `CEZ:MONITORING` strippers).
104
+ */
105
+ export declare function stripAskMarker(text: string): string;
@@ -0,0 +1,187 @@
1
+ /**
2
+ * AskUser payload — the structured multiple-choice question an agent asks the
3
+ * user, so the cockpit can render clickable option chips instead of the prose
4
+ * fallback ("AskUserQuestion isn't available…"). See the spec
5
+ * `.ai/specs/2026-07-18-askuser-across-runners.md`.
6
+ *
7
+ * The agent emits this as a `CEZ:ASK <compact-json>` control marker (a sibling
8
+ * of `CEZ:DONE` / `CEZ:MONITORING`), parsed on the assembled turn text in
9
+ * `src/workflows/run.ts` — uniform across claude, codex and opencode with no
10
+ * per-backend mapper work. The shape is modeled 1:1 on Claude Code's built-in
11
+ * `AskUserQuestion` (1–4 questions, 2–4 options each, `header` ≤12 chars,
12
+ * unique question texts and unique option labels) so a native bridge can map
13
+ * onto it later. A free-text "Other" is always available via the composer, so
14
+ * it is never an explicit option.
15
+ */
16
+ import { z } from 'zod';
17
+ export const askOptionSchema = z
18
+ .object({
19
+ label: z.string().min(1).max(60),
20
+ description: z.string().max(280).optional(),
21
+ })
22
+ .strict();
23
+ export const askQuestionSchema = z
24
+ .object({
25
+ /** Stable key for the answer; defaults to the array index when omitted. */
26
+ id: z.string().min(1).max(64).optional(),
27
+ /** ≤12-char chip label (matches AskUserQuestion's `header`). */
28
+ header: z.string().min(1).max(12),
29
+ question: z.string().min(1).max(400),
30
+ options: z
31
+ .array(askOptionSchema)
32
+ .min(2)
33
+ .max(4)
34
+ .refine((opts) => new Set(opts.map((o) => o.label)).size === opts.length, {
35
+ message: 'option labels must be unique within a question',
36
+ }),
37
+ multiSelect: z.boolean().optional(),
38
+ })
39
+ .strict();
40
+ export const askRequestSchema = z
41
+ .object({
42
+ questions: z
43
+ .array(askQuestionSchema)
44
+ .min(1)
45
+ .max(4)
46
+ .refine((qs) => new Set(qs.map((q) => q.question)).size === qs.length, {
47
+ message: 'question texts must be unique',
48
+ }),
49
+ })
50
+ .strict();
51
+ /**
52
+ * Parse a value into a validated `AskRequest`, or `null` when it does not match
53
+ * (bad counts, over-length header, non-unique labels/questions, extra keys).
54
+ * Callers degrade to plain text on `null` — the feature never makes the prose
55
+ * fallback worse.
56
+ */
57
+ export function parseAskRequest(value) {
58
+ const parsed = askRequestSchema.safeParse(value);
59
+ return parsed.success ? parsed.data : null;
60
+ }
61
+ /**
62
+ * The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
63
+ * sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
64
+ * text so delta-streaming backends can't split it — uniform across all three
65
+ * backends. The JSON is greedily captured from the first `{` after the keyword
66
+ * to the last `}` at end-of-text.
67
+ */
68
+ export const ASK_MARKER_RE = /CEZ:ASK[ \t]+(\{[\s\S]*\})\s*$/;
69
+ /** Looser than `ASK_MARKER_RE` so diagnostics can distinguish a malformed
70
+ * trailing marker from ordinary assistant prose. */
71
+ const ASK_MARKER_CANDIDATE_RE = /CEZ:ASK[ \t]+([\s\S]*)$/;
72
+ function isRecord(value) {
73
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
74
+ }
75
+ function hasOwn(record, key) {
76
+ return Object.prototype.hasOwnProperty.call(record, key);
77
+ }
78
+ /**
79
+ * Recover only presentation drift that cannot change the user's available
80
+ * choices. Unknown keys are discarded, and the display-only header and option
81
+ * description are clipped to their documented bounds. Counts, required text,
82
+ * types, and uniqueness remain schema-enforced; questions/options are never
83
+ * dropped to manufacture validity.
84
+ */
85
+ function normalizeAskRequest(value) {
86
+ if (!isRecord(value))
87
+ return value;
88
+ const request = {};
89
+ if (!hasOwn(value, 'questions'))
90
+ return request;
91
+ request.questions = Array.isArray(value.questions)
92
+ ? value.questions.map((question) => {
93
+ if (!isRecord(question))
94
+ return question;
95
+ const normalized = {};
96
+ for (const key of ['id', 'question', 'multiSelect']) {
97
+ if (hasOwn(question, key))
98
+ normalized[key] = question[key];
99
+ }
100
+ if (hasOwn(question, 'header')) {
101
+ normalized.header =
102
+ typeof question.header === 'string' ? question.header.slice(0, 12) : question.header;
103
+ }
104
+ if (hasOwn(question, 'options')) {
105
+ normalized.options = Array.isArray(question.options)
106
+ ? question.options.map((option) => {
107
+ if (!isRecord(option))
108
+ return option;
109
+ const next = {};
110
+ if (hasOwn(option, 'label'))
111
+ next.label = option.label;
112
+ if (hasOwn(option, 'description')) {
113
+ next.description =
114
+ typeof option.description === 'string'
115
+ ? option.description.slice(0, 280)
116
+ : option.description;
117
+ }
118
+ return next;
119
+ })
120
+ : question.options;
121
+ }
122
+ return normalized;
123
+ })
124
+ : value.questions;
125
+ return request;
126
+ }
127
+ function issuesOf(error) {
128
+ return error.issues.map((issue) => ({
129
+ code: issue.code,
130
+ path: issue.path,
131
+ message: issue.message,
132
+ }));
133
+ }
134
+ /**
135
+ * Parse a trailing marker with an actionable result for diagnostics. A
136
+ * parseable near-valid request gets one bounded normalization pass; structural
137
+ * violations remain rejected so the raw fallback stays readable.
138
+ */
139
+ export function parseAskMarkerResult(turnText) {
140
+ const match = ASK_MARKER_CANDIDATE_RE.exec(turnText.trimEnd());
141
+ if (!match || match[1] === undefined)
142
+ return { kind: 'none' };
143
+ let raw;
144
+ try {
145
+ raw = JSON.parse(match[1]);
146
+ }
147
+ catch (error) {
148
+ return {
149
+ kind: 'invalid-json',
150
+ message: error instanceof Error ? error.message : 'invalid JSON',
151
+ };
152
+ }
153
+ const strict = askRequestSchema.safeParse(raw);
154
+ if (strict.success)
155
+ return { kind: 'valid', request: strict.data, normalized: false };
156
+ const normalized = askRequestSchema.safeParse(normalizeAskRequest(raw));
157
+ if (normalized.success)
158
+ return { kind: 'valid', request: normalized.data, normalized: true };
159
+ return { kind: 'invalid-structure', issues: issuesOf(normalized.error) };
160
+ }
161
+ /**
162
+ * Extract and validate a trailing `CEZ:ASK <json>` marker from assembled turn
163
+ * text. Returns a strict or safely normalized `AskRequest`, or `null` when
164
+ * there is no marker or its payload remains invalid (caller degrades to plain
165
+ * text — the prose fallback is never made worse).
166
+ */
167
+ export function parseAskMarker(turnText) {
168
+ const parsed = parseAskMarkerResult(turnText);
169
+ return parsed.kind === 'valid' ? parsed.request : null;
170
+ }
171
+ /**
172
+ * Strip a trailing `CEZ:ASK <json>` marker from one text event so transcripts
173
+ * stay free of protocol noise — but ONLY when the payload actually validates.
174
+ * An invalid payload never becomes an ask card (`parseAskMarker` → `null`), so
175
+ * stripping it would delete the agent's question from the transcript with
176
+ * nothing to replace it; it stays visible as raw text instead — degraded but
177
+ * answerable (the prose fallback is never made worse). Delta backends may split
178
+ * the marker across events — then it stays visible; detection on the assembled
179
+ * turn text is unaffected (same best-effort caveat as the `CEZ:DONE` /
180
+ * `CEZ:MONITORING` strippers).
181
+ */
182
+ export function stripAskMarker(text) {
183
+ if (parseAskMarker(text) === null)
184
+ return text;
185
+ return text.replace(/\s*CEZ:ASK[ \t]+\{[\s\S]*\}\s*$/, '');
186
+ }
187
+ //# sourceMappingURL=ask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/core/ask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,2EAA2E;IAC3E,EAAE,EAAE,CAAC,CA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AAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC7F,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACzD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface BackendCheck {
2
+ name: 'claude' | 'codex' | 'opencode' | 'pi' | 'gh' | 'git';
3
+ available: boolean;
4
+ version?: string;
5
+ hint?: string;
6
+ }
7
+ /**
8
+ * Probe the host for everything cez leans on: the agent CLIs (`claude`, and
9
+ * the optional `codex` / `opencode` / `pi` alternatives), `gh` (GitHub auth for
10
+ * PR creation) and `git`. Nothing is required except at least one agent CLI —
11
+ * the GUI degrades gracefully, only offers the runners that are present, and
12
+ * shows the hints for the rest.
13
+ */
14
+ export declare function detectEnvironment(): Promise<BackendCheck[]>;
15
+ /** The host's GitHub token: logged-in `gh` first, `GITHUB_TOKEN` fallback. */
16
+ export declare function readHostGithubToken(): Promise<string | null>;