@qodeca/xezar 0.10.1

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 (481) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +810 -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 +71 -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 +597 -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 +1953 -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 +1527 -0
  74. package/dist/contract/skills.d.ts +234 -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 +115 -0
  90. package/dist/core/ask.js +256 -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 +65 -0
  96. package/dist/core/claude-cli-runner.js +479 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-model-catalog.d.ts +24 -0
  99. package/dist/core/claude-model-catalog.js +208 -0
  100. package/dist/core/claude-model-catalog.js.map +1 -0
  101. package/dist/core/claude-ui-mapper.d.ts +79 -0
  102. package/dist/core/claude-ui-mapper.js +597 -0
  103. package/dist/core/claude-ui-mapper.js.map +1 -0
  104. package/dist/core/codex-app-server-runner.d.ts +41 -0
  105. package/dist/core/codex-app-server-runner.js +584 -0
  106. package/dist/core/codex-app-server-runner.js.map +1 -0
  107. package/dist/core/codex-app-server-transport.d.ts +35 -0
  108. package/dist/core/codex-app-server-transport.js +150 -0
  109. package/dist/core/codex-app-server-transport.js.map +1 -0
  110. package/dist/core/codex-model-catalog.d.ts +10 -0
  111. package/dist/core/codex-model-catalog.js +110 -0
  112. package/dist/core/codex-model-catalog.js.map +1 -0
  113. package/dist/core/codex-ui-mapper.d.ts +109 -0
  114. package/dist/core/codex-ui-mapper.js +764 -0
  115. package/dist/core/codex-ui-mapper.js.map +1 -0
  116. package/dist/core/model-identity.d.ts +125 -0
  117. package/dist/core/model-identity.js +132 -0
  118. package/dist/core/model-identity.js.map +1 -0
  119. package/dist/core/model-presets.d.ts +21 -0
  120. package/dist/core/model-presets.js +91 -0
  121. package/dist/core/model-presets.js.map +1 -0
  122. package/dist/core/ndjson.d.ts +6 -0
  123. package/dist/core/ndjson.js +23 -0
  124. package/dist/core/ndjson.js.map +1 -0
  125. package/dist/core/opencode-model-catalog.d.ts +32 -0
  126. package/dist/core/opencode-model-catalog.js +153 -0
  127. package/dist/core/opencode-model-catalog.js.map +1 -0
  128. package/dist/core/opencode-server-runner.d.ts +32 -0
  129. package/dist/core/opencode-server-runner.js +535 -0
  130. package/dist/core/opencode-server-runner.js.map +1 -0
  131. package/dist/core/opencode-ui-mapper.d.ts +111 -0
  132. package/dist/core/opencode-ui-mapper.js +668 -0
  133. package/dist/core/opencode-ui-mapper.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +349 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +34 -0
  138. package/dist/core/pi-ui-mapper.js +270 -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 +28 -0
  153. package/dist/core/runner-model-catalog.js +62 -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 +332 -0
  165. package/dist/core/ui-events.js +22 -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 +684 -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 +78 -0
  204. package/dist/release/manifests.js +57 -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 +33 -0
  210. package/dist/release/stable.js +50 -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/arm-repo-handle.d.ts +17 -0
  216. package/dist/runs/arm-repo-handle.js +24 -0
  217. package/dist/runs/arm-repo-handle.js.map +1 -0
  218. package/dist/runs/auto-name.d.ts +75 -0
  219. package/dist/runs/auto-name.js +179 -0
  220. package/dist/runs/auto-name.js.map +1 -0
  221. package/dist/runs/event-history.d.ts +50 -0
  222. package/dist/runs/event-history.js +613 -0
  223. package/dist/runs/event-history.js.map +1 -0
  224. package/dist/runs/retention.d.ts +60 -0
  225. package/dist/runs/retention.js +86 -0
  226. package/dist/runs/retention.js.map +1 -0
  227. package/dist/runs/review-gate.d.ts +18 -0
  228. package/dist/runs/review-gate.js +21 -0
  229. package/dist/runs/review-gate.js.map +1 -0
  230. package/dist/runs/run-index.d.ts +19 -0
  231. package/dist/runs/run-index.js +43 -0
  232. package/dist/runs/run-index.js.map +1 -0
  233. package/dist/runs/store.d.ts +490 -0
  234. package/dist/runs/store.js +1283 -0
  235. package/dist/runs/store.js.map +1 -0
  236. package/dist/runs/task-markers.d.ts +28 -0
  237. package/dist/runs/task-markers.js +74 -0
  238. package/dist/runs/task-markers.js.map +1 -0
  239. package/dist/runs/task-refs.d.ts +25 -0
  240. package/dist/runs/task-refs.js +74 -0
  241. package/dist/runs/task-refs.js.map +1 -0
  242. package/dist/runs/ui-event-sink.d.ts +80 -0
  243. package/dist/runs/ui-event-sink.js +209 -0
  244. package/dist/runs/ui-event-sink.js.map +1 -0
  245. package/dist/server/app-type.d.ts +21 -0
  246. package/dist/server/app-type.js +2 -0
  247. package/dist/server/app-type.js.map +1 -0
  248. package/dist/server/capabilities.d.ts +70 -0
  249. package/dist/server/capabilities.js +152 -0
  250. package/dist/server/capabilities.js.map +1 -0
  251. package/dist/server/checkout.d.ts +128 -0
  252. package/dist/server/checkout.js +296 -0
  253. package/dist/server/checkout.js.map +1 -0
  254. package/dist/server/forge/github.d.ts +535 -0
  255. package/dist/server/forge/github.js +2544 -0
  256. package/dist/server/forge/github.js.map +1 -0
  257. package/dist/server/forge/index.d.ts +40 -0
  258. package/dist/server/forge/index.js +72 -0
  259. package/dist/server/forge/index.js.map +1 -0
  260. package/dist/server/forge/types.d.ts +267 -0
  261. package/dist/server/forge/types.js +2 -0
  262. package/dist/server/forge/types.js.map +1 -0
  263. package/dist/server/fs-browse.d.ts +105 -0
  264. package/dist/server/fs-browse.js +182 -0
  265. package/dist/server/fs-browse.js.map +1 -0
  266. package/dist/server/git-changes.d.ts +213 -0
  267. package/dist/server/git-changes.js +555 -0
  268. package/dist/server/git-changes.js.map +1 -0
  269. package/dist/server/git.d.ts +28 -0
  270. package/dist/server/git.js +112 -0
  271. package/dist/server/git.js.map +1 -0
  272. package/dist/server/github.d.ts +9 -0
  273. package/dist/server/github.js +8 -0
  274. package/dist/server/github.js.map +1 -0
  275. package/dist/server/launch-key.d.ts +7 -0
  276. package/dist/server/launch-key.js +33 -0
  277. package/dist/server/launch-key.js.map +1 -0
  278. package/dist/server/open-in-app.d.ts +66 -0
  279. package/dist/server/open-in-app.js +211 -0
  280. package/dist/server/open-in-app.js.map +1 -0
  281. package/dist/server/open-in-terminal.d.ts +70 -0
  282. package/dist/server/open-in-terminal.js +179 -0
  283. package/dist/server/open-in-terminal.js.map +1 -0
  284. package/dist/server/pr.d.ts +7 -0
  285. package/dist/server/pr.js +7 -0
  286. package/dist/server/pr.js.map +1 -0
  287. package/dist/server/project-context.d.ts +120 -0
  288. package/dist/server/project-context.js +192 -0
  289. package/dist/server/project-context.js.map +1 -0
  290. package/dist/server/provider-action-gate.d.ts +8 -0
  291. package/dist/server/provider-action-gate.js +56 -0
  292. package/dist/server/provider-action-gate.js.map +1 -0
  293. package/dist/server/provider-auth-runtime.d.ts +21 -0
  294. package/dist/server/provider-auth-runtime.js +66 -0
  295. package/dist/server/provider-auth-runtime.js.map +1 -0
  296. package/dist/server/server.d.ts +13578 -0
  297. package/dist/server/server.js +5284 -0
  298. package/dist/server/server.js.map +1 -0
  299. package/dist/server/static-ui.d.ts +49 -0
  300. package/dist/server/static-ui.js +92 -0
  301. package/dist/server/static-ui.js.map +1 -0
  302. package/dist/server/validators.d.ts +97 -0
  303. package/dist/server/validators.js +86 -0
  304. package/dist/server/validators.js.map +1 -0
  305. package/dist/server/ws.d.ts +83 -0
  306. package/dist/server/ws.js +216 -0
  307. package/dist/server/ws.js.map +1 -0
  308. package/dist/server/wsl.d.ts +25 -0
  309. package/dist/server/wsl.js +92 -0
  310. package/dist/server/wsl.js.map +1 -0
  311. package/dist/server-install/engine.d.ts +50 -0
  312. package/dist/server-install/engine.js +324 -0
  313. package/dist/server-install/engine.js.map +1 -0
  314. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  315. package/dist/server-install/platforms/macosx-ngrok.js +348 -0
  316. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  317. package/dist/server-install/platforms/ubuntu-vps.d.ts +63 -0
  318. package/dist/server-install/platforms/ubuntu-vps.js +997 -0
  319. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  320. package/dist/server-install/state.d.ts +52 -0
  321. package/dist/server-install/state.js +182 -0
  322. package/dist/server-install/state.js.map +1 -0
  323. package/dist/server-install/steps.d.ts +109 -0
  324. package/dist/server-install/steps.js +334 -0
  325. package/dist/server-install/steps.js.map +1 -0
  326. package/dist/server-install/strategies.d.ts +4 -0
  327. package/dist/server-install/strategies.js +20 -0
  328. package/dist/server-install/strategies.js.map +1 -0
  329. package/dist/server-install/types.d.ts +287 -0
  330. package/dist/server-install/types.js +121 -0
  331. package/dist/server-install/types.js.map +1 -0
  332. package/dist/server-install/ui.d.ts +42 -0
  333. package/dist/server-install/ui.js +130 -0
  334. package/dist/server-install/ui.js.map +1 -0
  335. package/dist/skills-banner.d.ts +22 -0
  336. package/dist/skills-banner.js +41 -0
  337. package/dist/skills-banner.js.map +1 -0
  338. package/dist/skills-remote.d.ts +84 -0
  339. package/dist/skills-remote.js +468 -0
  340. package/dist/skills-remote.js.map +1 -0
  341. package/dist/skills-update.d.ts +88 -0
  342. package/dist/skills-update.js +392 -0
  343. package/dist/skills-update.js.map +1 -0
  344. package/dist/skills.d.ts +82 -0
  345. package/dist/skills.js +251 -0
  346. package/dist/skills.js.map +1 -0
  347. package/dist/todos.d.ts +48 -0
  348. package/dist/todos.js +201 -0
  349. package/dist/todos.js.map +1 -0
  350. package/dist/ui-state.d.ts +26 -0
  351. package/dist/ui-state.js +38 -0
  352. package/dist/ui-state.js.map +1 -0
  353. package/dist/update-check.d.ts +12 -0
  354. package/dist/update-check.js +41 -0
  355. package/dist/update-check.js.map +1 -0
  356. package/dist/workflows/load.d.ts +15 -0
  357. package/dist/workflows/load.js +56 -0
  358. package/dist/workflows/load.js.map +1 -0
  359. package/dist/workflows/run.d.ts +803 -0
  360. package/dist/workflows/run.js +3483 -0
  361. package/dist/workflows/run.js.map +1 -0
  362. package/dist/workflows/types.d.ts +145 -0
  363. package/dist/workflows/types.js +194 -0
  364. package/dist/workflows/types.js.map +1 -0
  365. package/dist/workspace/agent-accounts.d.ts +153 -0
  366. package/dist/workspace/agent-accounts.js +304 -0
  367. package/dist/workspace/agent-accounts.js.map +1 -0
  368. package/dist/workspace/agent-profiles.d.ts +78 -0
  369. package/dist/workspace/agent-profiles.js +115 -0
  370. package/dist/workspace/agent-profiles.js.map +1 -0
  371. package/dist/workspace/config.d.ts +169 -0
  372. package/dist/workspace/config.js +379 -0
  373. package/dist/workspace/config.js.map +1 -0
  374. package/dist/workspace/migrations.d.ts +45 -0
  375. package/dist/workspace/migrations.js +147 -0
  376. package/dist/workspace/migrations.js.map +1 -0
  377. package/dist/workspace/projects-cli.d.ts +25 -0
  378. package/dist/workspace/projects-cli.js +172 -0
  379. package/dist/workspace/projects-cli.js.map +1 -0
  380. package/dist/workspace/projects.d.ts +109 -0
  381. package/dist/workspace/projects.js +250 -0
  382. package/dist/workspace/projects.js.map +1 -0
  383. package/dist/workspace/semaphore.d.ts +179 -0
  384. package/dist/workspace/semaphore.js +195 -0
  385. package/dist/workspace/semaphore.js.map +1 -0
  386. package/dist/workspace/ui-state.d.ts +34 -0
  387. package/dist/workspace/ui-state.js +53 -0
  388. package/dist/workspace/ui-state.js.map +1 -0
  389. package/package.json +85 -0
  390. package/scripts/check-pack.mjs +46 -0
  391. package/scripts/inline-contract.mjs +112 -0
  392. package/scripts/install-as-command.mjs +120 -0
  393. package/scripts/mock-claude.mjs +524 -0
  394. package/scripts/mock-pi-rpc.mjs +83 -0
  395. package/scripts/sync-readme.mjs +20 -0
  396. package/scripts/test-process-usage.mjs +47 -0
  397. package/web/dist/assets/alert-dialog-CGskMvgc.js +1 -0
  398. package/web/dist/assets/arrow-down-G8adPhbu.js +1 -0
  399. package/web/dist/assets/arrow-left-BJsIW6A0.js +1 -0
  400. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  401. package/web/dist/assets/centered-state-B_V_Ai2h.js +43 -0
  402. package/web/dist/assets/chevron-right-CFzn-von.js +1 -0
  403. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  404. package/web/dist/assets/collapsible-B_8uYwHb.js +1 -0
  405. package/web/dist/assets/commit-list-C4Dv6vUL.js +1 -0
  406. package/web/dist/assets/compare-variants-SR2zZfZq.js +1 -0
  407. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  408. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  409. package/web/dist/assets/diff-CbozNUJq.js +3 -0
  410. package/web/dist/assets/diff-stat-btAmKFJr.js +1 -0
  411. package/web/dist/assets/diff-view-BpFTcG3R.js +6 -0
  412. package/web/dist/assets/diff-woXpYk--.js +1 -0
  413. package/web/dist/assets/dropdown-menu-Z80KMInL.js +1 -0
  414. package/web/dist/assets/editable-title-wS5NWwob.js +1 -0
  415. package/web/dist/assets/ellipsis-vertical-Bmi2u2TG.js +1 -0
  416. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  417. package/web/dist/assets/file-DKoYWRsv.js +1 -0
  418. package/web/dist/assets/folder-u01HScRT.js +1 -0
  419. package/web/dist/assets/git-toolbar-DZlZjTGz.js +1 -0
  420. package/web/dist/assets/github-CFURo9kf.js +1 -0
  421. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  422. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  423. package/web/dist/assets/highlighter-C8DK1_sG.js +3 -0
  424. package/web/dist/assets/html-BY76lXLH.js +1 -0
  425. package/web/dist/assets/image-preview-BR3iIIhf.js +1 -0
  426. package/web/dist/assets/index-BcI5hug3.css +2 -0
  427. package/web/dist/assets/index-DlC81_GI.js +7 -0
  428. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  429. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  430. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  431. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  432. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  433. package/web/dist/assets/json-qhed-kSA.js +1 -0
  434. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  435. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  436. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  437. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  438. package/web/dist/assets/markdown-5FuCZDA4.js +2 -0
  439. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  440. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  441. package/web/dist/assets/new-task-form-BydHBbef.js +1 -0
  442. package/web/dist/assets/pill-vNzaaYxj.js +1 -0
  443. package/web/dist/assets/project-router-BbCzrHKs.js +1 -0
  444. package/web/dist/assets/prompt-templates-B7Fs2b1S.js +15 -0
  445. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  446. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  447. package/web/dist/assets/refresh-cw-DGliez3E.js +1 -0
  448. package/web/dist/assets/repo-git-CJFDMauC.js +1 -0
  449. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  450. package/web/dist/assets/run-diff-Bq9vkSNK.js +3 -0
  451. package/web/dist/assets/run-header-Cd8mSKBG.js +1 -0
  452. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  453. package/web/dist/assets/search-x-69n_672Y.js +1 -0
  454. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  455. package/web/dist/assets/skill-empty-hint-DTu0LzaJ.js +1 -0
  456. package/web/dist/assets/skills-Cs-auniL.js +1 -0
  457. package/web/dist/assets/skills-D4P-Hgey.js +1 -0
  458. package/web/dist/assets/sparkles-B8agSxBZ.js +1 -0
  459. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  460. package/web/dist/assets/square-terminal-Cf4Og6ct.js +1 -0
  461. package/web/dist/assets/tab-link-Cp2-CJS8.js +1 -0
  462. package/web/dist/assets/task-changes-DYgNXOyY.js +1 -0
  463. package/web/dist/assets/task-commits-BRpZSz1G.js +1 -0
  464. package/web/dist/assets/task-files-pKOwSyLh.js +2 -0
  465. package/web/dist/assets/task-thread-Bfyqqy-t.js +9 -0
  466. package/web/dist/assets/textarea--cpYshee.js +1 -0
  467. package/web/dist/assets/thread-loading-GyH2Atwo.js +1 -0
  468. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  469. package/web/dist/assets/trash-2--ZtrzUx3.js +1 -0
  470. package/web/dist/assets/triangle-alert-D5tJwRD2.js +1 -0
  471. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  472. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  473. package/web/dist/assets/upload-SnwVxKOA.js +1 -0
  474. package/web/dist/assets/use-desktop-C31lOFUD.js +1 -0
  475. package/web/dist/assets/use-submit-shortcut-JY8M_MPL.js +1 -0
  476. package/web/dist/assets/utils-Bb8ohcr3.js +64 -0
  477. package/web/dist/assets/workflows-BmOehP-A.js +11 -0
  478. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  479. package/web/dist/assets/zoomable-image-0G3IBXWC.js +1 -0
  480. package/web/dist/index.html +80 -0
  481. package/web/dist/xezar.svg +14 -0
@@ -0,0 +1,211 @@
1
+ /**
2
+ * The backend-agnostic seam for running one agent task. Adapted from
3
+ * @xezar/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. XEZ_HANDOFF_FILE / XEZ_TODOS_FILE / XEZ_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 xezar 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
+ * @xezar/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 xezar 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,115 @@
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…").
5
+ *
6
+ * The agent emits this as a `XEZ:ASK <compact-json>` control marker (a sibling
7
+ * of `XEZ:DONE` / `XEZ:MONITORING`), parsed on the assembled turn text in
8
+ * `src/workflows/run.ts` — uniform across claude, codex and opencode with no
9
+ * per-backend mapper work. The shape is modeled 1:1 on Claude Code's built-in
10
+ * `AskUserQuestion` (1–4 questions, 2–4 options each, `header` ≤12 chars,
11
+ * unique question texts and unique option labels) so a native bridge can map
12
+ * onto it later. A free-text "Other" is always available via the composer, so
13
+ * it is never an explicit option.
14
+ */
15
+ import { z } from 'zod';
16
+ export declare const askOptionSchema: z.ZodObject<{
17
+ label: z.ZodString;
18
+ description: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>;
20
+ export declare const askQuestionSchema: z.ZodObject<{
21
+ id: z.ZodOptional<z.ZodString>;
22
+ header: z.ZodString;
23
+ question: z.ZodString;
24
+ options: z.ZodArray<z.ZodObject<{
25
+ label: z.ZodString;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>>;
28
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
29
+ }, z.core.$strict>;
30
+ export declare const askRequestSchema: z.ZodObject<{
31
+ questions: z.ZodArray<z.ZodObject<{
32
+ id: z.ZodOptional<z.ZodString>;
33
+ header: z.ZodString;
34
+ question: z.ZodString;
35
+ options: z.ZodArray<z.ZodObject<{
36
+ label: z.ZodString;
37
+ description: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>>;
39
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
40
+ }, z.core.$strict>>;
41
+ }, z.core.$strict>;
42
+ export type AskOption = z.infer<typeof askOptionSchema>;
43
+ export type AskQuestion = z.infer<typeof askQuestionSchema>;
44
+ export type AskRequest = z.infer<typeof askRequestSchema>;
45
+ export interface AskParseIssue {
46
+ code: string;
47
+ path: PropertyKey[];
48
+ message: string;
49
+ }
50
+ /** The diagnostic parse result used at turn-end. The compatibility wrapper
51
+ * below deliberately keeps returning `AskRequest | null`. `repaired` marks a
52
+ * card that only exists because the payload's missing closers were appended
53
+ * (#936) — callers surface it as a note rather than claiming a clean parse. */
54
+ export type AskMarkerParseResult = {
55
+ kind: 'none';
56
+ } | {
57
+ kind: 'invalid-json';
58
+ message: string;
59
+ } | {
60
+ kind: 'invalid-structure';
61
+ issues: AskParseIssue[];
62
+ } | {
63
+ kind: 'valid';
64
+ request: AskRequest;
65
+ normalized: boolean;
66
+ repaired?: boolean;
67
+ };
68
+ /**
69
+ * Parse a value into a validated `AskRequest`, or `null` when it does not match
70
+ * (bad counts, over-length header, non-unique labels/questions, extra keys).
71
+ * Callers degrade to plain text on `null` — the feature never makes the prose
72
+ * fallback worse.
73
+ */
74
+ export declare function parseAskRequest(value: unknown): AskRequest | null;
75
+ /**
76
+ * The AskUser control marker: a trailing `XEZ:ASK <compact-json>` line (a
77
+ * sibling of `XEZ:DONE` / `XEZ:MONITORING`). Detected on the *assembled* turn
78
+ * text so delta-streaming backends can't split it — uniform across all three
79
+ * backends. The JSON is greedily captured from the first `{` after the keyword
80
+ * to the last `}` at end-of-text.
81
+ */
82
+ export declare const ASK_MARKER_RE: RegExp;
83
+ /**
84
+ * Parse a trailing marker with an actionable result for diagnostics. Two
85
+ * bounded forgiveness layers sit under the schema, and neither loosens it: a
86
+ * payload that fails `JSON.parse` only for missing closers is repaired
87
+ * (`closeUnbalancedJson`, #936), then a parseable near-valid request gets one
88
+ * normalization pass (`normalizeAskRequest`). Structural violations remain
89
+ * rejected so the raw fallback stays readable.
90
+ */
91
+ export declare function parseAskMarkerResult(turnText: string): AskMarkerParseResult;
92
+ /**
93
+ * Extract and validate a trailing `XEZ:ASK <json>` marker from assembled turn
94
+ * text. Returns a strict or safely normalized `AskRequest`, or `null` when
95
+ * there is no marker or its payload remains invalid (caller degrades to plain
96
+ * text — the prose fallback is never made worse).
97
+ */
98
+ export declare function parseAskMarker(turnText: string): AskRequest | null;
99
+ /**
100
+ * Strip a trailing `XEZ:ASK <json>` marker from one text event so transcripts
101
+ * stay free of protocol noise — but ONLY when the payload actually validates.
102
+ * An invalid payload never becomes an ask card (`parseAskMarker` → `null`), so
103
+ * stripping it would delete the agent's question from the transcript with
104
+ * nothing to replace it; it stays visible as raw text instead — degraded but
105
+ * answerable (the prose fallback is never made worse). Delta backends may split
106
+ * the marker across events — then it stays visible; detection on the assembled
107
+ * turn text is unaffected (same best-effort caveat as the `XEZ:DONE` /
108
+ * `XEZ:MONITORING` strippers).
109
+ *
110
+ * The strip runs from the `XEZ:ASK` keyword to end-of-text rather than to a
111
+ * trailing `}`: a repaired payload (#936) may end on `]`, or on the last
112
+ * character before the closers this module appended, and half a marker left
113
+ * under a rendered card is protocol noise the card already replaced.
114
+ */
115
+ export declare function stripAskMarker(text: string): string;
@@ -0,0 +1,256 @@
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…").
5
+ *
6
+ * The agent emits this as a `XEZ:ASK <compact-json>` control marker (a sibling
7
+ * of `XEZ:DONE` / `XEZ:MONITORING`), parsed on the assembled turn text in
8
+ * `src/workflows/run.ts` — uniform across claude, codex and opencode with no
9
+ * per-backend mapper work. The shape is modeled 1:1 on Claude Code's built-in
10
+ * `AskUserQuestion` (1–4 questions, 2–4 options each, `header` ≤12 chars,
11
+ * unique question texts and unique option labels) so a native bridge can map
12
+ * onto it later. A free-text "Other" is always available via the composer, so
13
+ * it is never an explicit option.
14
+ */
15
+ import { z } from 'zod';
16
+ export const askOptionSchema = z
17
+ .object({
18
+ label: z.string().min(1).max(60),
19
+ description: z.string().max(280).optional(),
20
+ })
21
+ .strict();
22
+ export const askQuestionSchema = z
23
+ .object({
24
+ /** Stable key for the answer; defaults to the array index when omitted. */
25
+ id: z.string().min(1).max(64).optional(),
26
+ /** ≤12-char chip label (matches AskUserQuestion's `header`). */
27
+ header: z.string().min(1).max(12),
28
+ question: z.string().min(1).max(400),
29
+ options: z
30
+ .array(askOptionSchema)
31
+ .min(2)
32
+ .max(4)
33
+ .refine((opts) => new Set(opts.map((o) => o.label)).size === opts.length, {
34
+ message: 'option labels must be unique within a question',
35
+ }),
36
+ multiSelect: z.boolean().optional(),
37
+ })
38
+ .strict();
39
+ export const askRequestSchema = z
40
+ .object({
41
+ questions: z
42
+ .array(askQuestionSchema)
43
+ .min(1)
44
+ .max(4)
45
+ .refine((qs) => new Set(qs.map((q) => q.question)).size === qs.length, {
46
+ message: 'question texts must be unique',
47
+ }),
48
+ })
49
+ .strict();
50
+ /**
51
+ * Parse a value into a validated `AskRequest`, or `null` when it does not match
52
+ * (bad counts, over-length header, non-unique labels/questions, extra keys).
53
+ * Callers degrade to plain text on `null` — the feature never makes the prose
54
+ * fallback worse.
55
+ */
56
+ export function parseAskRequest(value) {
57
+ const parsed = askRequestSchema.safeParse(value);
58
+ return parsed.success ? parsed.data : null;
59
+ }
60
+ /**
61
+ * The AskUser control marker: a trailing `XEZ:ASK <compact-json>` line (a
62
+ * sibling of `XEZ:DONE` / `XEZ:MONITORING`). Detected on the *assembled* turn
63
+ * text so delta-streaming backends can't split it — uniform across all three
64
+ * backends. The JSON is greedily captured from the first `{` after the keyword
65
+ * to the last `}` at end-of-text.
66
+ */
67
+ export const ASK_MARKER_RE = /XEZ:ASK[ \t]+(\{[\s\S]*\})\s*$/;
68
+ /** Looser than `ASK_MARKER_RE` so diagnostics can distinguish a malformed
69
+ * trailing marker from ordinary assistant prose. */
70
+ const ASK_MARKER_CANDIDATE_RE = /XEZ:ASK[ \t]+([\s\S]*)$/;
71
+ function isRecord(value) {
72
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
73
+ }
74
+ function hasOwn(record, key) {
75
+ return Object.prototype.hasOwnProperty.call(record, key);
76
+ }
77
+ /**
78
+ * Recover only presentation drift that cannot change the user's available
79
+ * choices. Unknown keys are discarded, and the display-only header and option
80
+ * description are clipped to their documented bounds. Counts, required text,
81
+ * types, and uniqueness remain schema-enforced; questions/options are never
82
+ * dropped to manufacture validity.
83
+ */
84
+ function normalizeAskRequest(value) {
85
+ if (!isRecord(value))
86
+ return value;
87
+ const request = {};
88
+ if (!hasOwn(value, 'questions'))
89
+ return request;
90
+ request.questions = Array.isArray(value.questions)
91
+ ? value.questions.map((question) => {
92
+ if (!isRecord(question))
93
+ return question;
94
+ const normalized = {};
95
+ for (const key of ['id', 'question', 'multiSelect']) {
96
+ if (hasOwn(question, key))
97
+ normalized[key] = question[key];
98
+ }
99
+ if (hasOwn(question, 'header')) {
100
+ normalized.header =
101
+ typeof question.header === 'string' ? question.header.slice(0, 12) : question.header;
102
+ }
103
+ if (hasOwn(question, 'options')) {
104
+ normalized.options = Array.isArray(question.options)
105
+ ? question.options.map((option) => {
106
+ if (!isRecord(option))
107
+ return option;
108
+ const next = {};
109
+ if (hasOwn(option, 'label'))
110
+ next.label = option.label;
111
+ if (hasOwn(option, 'description')) {
112
+ next.description =
113
+ typeof option.description === 'string'
114
+ ? option.description.slice(0, 280)
115
+ : option.description;
116
+ }
117
+ return next;
118
+ })
119
+ : question.options;
120
+ }
121
+ return normalized;
122
+ })
123
+ : value.questions;
124
+ return request;
125
+ }
126
+ /**
127
+ * Repair the one syntax slip that actually happens (#936): a payload complete
128
+ * except for its closing brackets, because an agent hand-writing a long
129
+ * one-line JSON blob dropped a trailing `}` or the output-token limit cut the
130
+ * stream. Scan `src` tracking string/escape state and the stack of open
131
+ * `{` / `[`, then append the missing closers in reverse. Returns `null` when
132
+ * the text is not *only* missing closers.
133
+ *
134
+ * The guards keep a genuinely truncated stream refused rather than silently
135
+ * turned into a half-question: the payload must end on a **completed**
136
+ * structural value (`}` or `]` — never mid-string, after a `,`, or after a
137
+ * `:`), the scan must end outside a string literal, every closer must match its
138
+ * opener, and at least one opener must still be unclosed (an already-balanced
139
+ * payload has nothing to repair — it failed `JSON.parse` for some other reason,
140
+ * e.g. a trailing comma, and stays rejected). Only syntax is repaired: the
141
+ * result goes through the unchanged `askRequestSchema`, so a repair that yields
142
+ * fewer than 2 options or a bad header still degrades to plain text.
143
+ */
144
+ function closeUnbalancedJson(src) {
145
+ const text = src.trimEnd();
146
+ if (!/[}\]]$/.test(text))
147
+ return null;
148
+ const stack = [];
149
+ let inString = false;
150
+ let escaped = false;
151
+ for (const ch of text) {
152
+ if (inString) {
153
+ if (escaped)
154
+ escaped = false;
155
+ else if (ch === '\\')
156
+ escaped = true;
157
+ else if (ch === '"')
158
+ inString = false;
159
+ continue;
160
+ }
161
+ if (ch === '"') {
162
+ inString = true;
163
+ continue;
164
+ }
165
+ if (ch === '{')
166
+ stack.push('}');
167
+ else if (ch === '[')
168
+ stack.push(']');
169
+ else if (ch === '}' || ch === ']') {
170
+ if (stack.pop() !== ch)
171
+ return null;
172
+ }
173
+ }
174
+ if (inString || stack.length === 0)
175
+ return null;
176
+ return text + stack.reverse().join('');
177
+ }
178
+ function issuesOf(error) {
179
+ return error.issues.map((issue) => ({
180
+ code: issue.code,
181
+ path: issue.path,
182
+ message: issue.message,
183
+ }));
184
+ }
185
+ /**
186
+ * Parse a trailing marker with an actionable result for diagnostics. Two
187
+ * bounded forgiveness layers sit under the schema, and neither loosens it: a
188
+ * payload that fails `JSON.parse` only for missing closers is repaired
189
+ * (`closeUnbalancedJson`, #936), then a parseable near-valid request gets one
190
+ * normalization pass (`normalizeAskRequest`). Structural violations remain
191
+ * rejected so the raw fallback stays readable.
192
+ */
193
+ export function parseAskMarkerResult(turnText) {
194
+ const match = ASK_MARKER_CANDIDATE_RE.exec(turnText.trimEnd());
195
+ if (!match || match[1] === undefined)
196
+ return { kind: 'none' };
197
+ let raw;
198
+ let repaired = false;
199
+ try {
200
+ raw = JSON.parse(match[1]);
201
+ }
202
+ catch (error) {
203
+ const closed = closeUnbalancedJson(match[1]);
204
+ try {
205
+ if (closed === null)
206
+ throw error;
207
+ raw = JSON.parse(closed);
208
+ repaired = true;
209
+ }
210
+ catch {
211
+ return {
212
+ kind: 'invalid-json',
213
+ message: error instanceof Error ? error.message : 'invalid JSON',
214
+ };
215
+ }
216
+ }
217
+ const strict = askRequestSchema.safeParse(raw);
218
+ if (strict.success)
219
+ return { kind: 'valid', request: strict.data, normalized: false, repaired };
220
+ const normalized = askRequestSchema.safeParse(normalizeAskRequest(raw));
221
+ if (normalized.success)
222
+ return { kind: 'valid', request: normalized.data, normalized: true, repaired };
223
+ return { kind: 'invalid-structure', issues: issuesOf(normalized.error) };
224
+ }
225
+ /**
226
+ * Extract and validate a trailing `XEZ:ASK <json>` marker from assembled turn
227
+ * text. Returns a strict or safely normalized `AskRequest`, or `null` when
228
+ * there is no marker or its payload remains invalid (caller degrades to plain
229
+ * text — the prose fallback is never made worse).
230
+ */
231
+ export function parseAskMarker(turnText) {
232
+ const parsed = parseAskMarkerResult(turnText);
233
+ return parsed.kind === 'valid' ? parsed.request : null;
234
+ }
235
+ /**
236
+ * Strip a trailing `XEZ:ASK <json>` marker from one text event so transcripts
237
+ * stay free of protocol noise — but ONLY when the payload actually validates.
238
+ * An invalid payload never becomes an ask card (`parseAskMarker` → `null`), so
239
+ * stripping it would delete the agent's question from the transcript with
240
+ * nothing to replace it; it stays visible as raw text instead — degraded but
241
+ * answerable (the prose fallback is never made worse). Delta backends may split
242
+ * the marker across events — then it stays visible; detection on the assembled
243
+ * turn text is unaffected (same best-effort caveat as the `XEZ:DONE` /
244
+ * `XEZ:MONITORING` strippers).
245
+ *
246
+ * The strip runs from the `XEZ:ASK` keyword to end-of-text rather than to a
247
+ * trailing `}`: a repaired payload (#936) may end on `]`, or on the last
248
+ * character before the closers this module appended, and half a marker left
249
+ * under a rendered card is protocol noise the card already replaced.
250
+ */
251
+ export function stripAskMarker(text) {
252
+ if (parseAskMarker(text) === null)
253
+ return text;
254
+ return text.replace(/\s*XEZ:ASK[ \t]+[\s\S]*$/, '');
255
+ }
256
+ //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