@iowarp/clio-coder 0.3.4 → 0.3.7

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 (376) hide show
  1. package/CHANGELOG.md +65 -2
  2. package/CONTRIBUTING.md +6 -6
  3. package/README.md +16 -5
  4. package/dist/{acp-S5R4RR5B.js → acp-SK4MD6MM.js} +11 -11
  5. package/dist/{agents-P6DMMVZY.js → agents-2FN2K6ME.js} +33 -26
  6. package/dist/assets/codewiki.json +1 -1
  7. package/dist/{auth-2XCZLPKS.js → auth-QIYZWM5I.js} +15 -15
  8. package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
  9. package/dist/{chunk-VAWWTKDP.js → chunk-3HAPLH5M.js} +11 -11
  10. package/dist/{chunk-YCWGATWI.js → chunk-465YSENW.js} +3 -3
  11. package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
  12. package/dist/{chunk-UZHIZC5S.js → chunk-4DWFMQDR.js} +61 -76
  13. package/dist/{chunk-ZWMF7253.js → chunk-5C3AQNDW.js} +328 -9
  14. package/dist/{chunk-22NAGB7X.js → chunk-5C77SEEY.js} +5 -94
  15. package/dist/{chunk-WPQLXFOZ.js → chunk-5FR74PWO.js} +3 -2
  16. package/dist/{chunk-35MKKU5R.js → chunk-5UJ6ECTS.js} +18 -10
  17. package/dist/{chunk-BRXQQJFP.js → chunk-6M7VS3J3.js} +571 -50
  18. package/dist/{chunk-QQK64KLB.js → chunk-6TUKSZVF.js} +141 -23
  19. package/dist/{chunk-N4CZJQRK.js → chunk-AB4XIIVB.js} +8 -6
  20. package/dist/{chunk-KRPY7NTG.js → chunk-BMWK7ZIZ.js} +14 -20
  21. package/dist/{chunk-4BPJXDWC.js → chunk-C4JBQ5SR.js} +30 -14
  22. package/dist/{chunk-ZYKPLLNQ.js → chunk-CEYBNUGC.js} +821 -83
  23. package/dist/{chunk-VEZEGCGW.js → chunk-D4MDIG46.js} +20 -18
  24. package/dist/chunk-DJNLUABN.js +843 -0
  25. package/dist/{chunk-BP4OYD6A.js → chunk-DMD2AGVS.js} +21 -2
  26. package/dist/{chunk-KOHPCX4K.js → chunk-DOOEX22V.js} +2 -2
  27. package/dist/chunk-DQA7QLMD.js +123 -0
  28. package/dist/chunk-DR52UMZW.js +21 -0
  29. package/dist/{chunk-3HZ5RWN2.js → chunk-EBEFWSGL.js} +9 -7
  30. package/dist/{chunk-EDRHSCIE.js → chunk-EELBMBT6.js} +128 -13
  31. package/dist/{chunk-HV5X7OR2.js → chunk-EOOQZZDE.js} +16 -14
  32. package/dist/{chunk-WR67VIZY.js → chunk-FOT2FX5J.js} +63 -5
  33. package/dist/{chunk-BPGS2WCQ.js → chunk-GEYXPTRF.js} +2 -1
  34. package/dist/{chunk-FYYLNIL5.js → chunk-GH5622CP.js} +2 -2
  35. package/dist/{chunk-BEY543CS.js → chunk-GOXNB3AO.js} +5 -2
  36. package/dist/chunk-GWS3VEIW.js +195 -0
  37. package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
  38. package/dist/chunk-HWUFFB6L.js +83 -0
  39. package/dist/{chunk-X6COSD2O.js → chunk-J7PIKKWC.js} +8 -436
  40. package/dist/{chunk-NILBFAPG.js → chunk-JNXPYBB4.js} +2 -2
  41. package/dist/{chunk-4VP4KH3K.js → chunk-JRIO5UD2.js} +4 -4
  42. package/dist/{chunk-K6WL7QZT.js → chunk-JTSEDYVQ.js} +7 -7
  43. package/dist/{chunk-QKMUKYO7.js → chunk-KCMKRQX4.js} +236 -84
  44. package/dist/chunk-KZ2H5X4G.js +1026 -0
  45. package/dist/{chunk-A2GZF7DC.js → chunk-LADCF22A.js} +13 -13
  46. package/dist/chunk-LCGCVYZ4.js +57 -0
  47. package/dist/chunk-M4AKACEO.js +382 -0
  48. package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
  49. package/dist/{chunk-4JUF2NNX.js → chunk-MXI6J5JF.js} +7 -7
  50. package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
  51. package/dist/{chunk-TTNYS3EA.js → chunk-OB5HIGJY.js} +1 -1
  52. package/dist/{chunk-7RXG6QRZ.js → chunk-OBMAI2DP.js} +61 -840
  53. package/dist/{chunk-5M54SPOL.js → chunk-ODFEOB4F.js} +161 -5
  54. package/dist/chunk-PD3MESLB.js +242 -0
  55. package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
  56. package/dist/{chunk-VMNQ6OZA.js → chunk-QCTRSGHQ.js} +963 -786
  57. package/dist/chunk-RVG5JXAL.js +41 -0
  58. package/dist/{chunk-RD5U66HV.js → chunk-SROCI7ZU.js} +7 -7
  59. package/dist/{chunk-MFFY33HR.js → chunk-THKY7CD7.js} +466 -205
  60. package/dist/{chunk-34475P3I.js → chunk-TSHXZTOQ.js} +5 -4
  61. package/dist/{chunk-PCZJO5TI.js → chunk-UFQ3F4FW.js} +13 -178
  62. package/dist/{chunk-AD2SYQYC.js → chunk-UHXRNZ2J.js} +121 -3
  63. package/dist/chunk-UND3GU2L.js +103 -0
  64. package/dist/{chunk-QQL5RT5M.js → chunk-UUANF5CR.js} +2323 -2114
  65. package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
  66. package/dist/chunk-UVDSQ6LW.js +472 -0
  67. package/dist/{chunk-QWU7ZBO7.js → chunk-VQNODYQ4.js} +215 -56
  68. package/dist/chunk-VREKEFLL.js +37 -0
  69. package/dist/{chunk-2TZWSW76.js → chunk-WHGPSPT5.js} +2 -2
  70. package/dist/{chunk-TW3WDMVS.js → chunk-WHJYKASB.js} +2 -2
  71. package/dist/{chunk-MEQ45TQ4.js → chunk-WJHBC77E.js} +21 -7
  72. package/dist/{chunk-HXG4IURW.js → chunk-X2KV5FXT.js} +2 -2
  73. package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
  74. package/dist/{chunk-2LZI5CAG.js → chunk-XEGB6BCN.js} +228 -36
  75. package/dist/{chunk-E25LMLRW.js → chunk-YD734TPH.js} +2 -2
  76. package/dist/{verifiers-4UUM6TEE.js → chunk-YTYFXUI3.js} +121 -372
  77. package/dist/{chunk-3JLKSKD7.js → chunk-ZGH7FGS5.js} +17 -7
  78. package/dist/{chunk-VSNATDE6.js → chunk-ZZMN5OM4.js} +2 -2
  79. package/dist/cli/index.js +34 -32
  80. package/dist/{clio-J5JIOIDS.js → clio-WBVQEBKO.js} +7 -7
  81. package/dist/{code-nav-AXCXSBHX.js → code-nav-FGGFIE7L.js} +7 -7
  82. package/dist/codewiki/build-worker.js +4 -4
  83. package/dist/{components-KELWS457.js → components-F7OEATSO.js} +5 -5
  84. package/dist/{config-OEBMIN2U.js → config-TRBL3RCF.js} +48 -41
  85. package/dist/{configure-PUQOSIXQ.js → configure-OLCVPHNM.js} +17 -17
  86. package/dist/{context-URSXPBCK.js → context-MJIJ6GOX.js} +12 -12
  87. package/dist/{context-EKDCKUUZ.js → context-WFPKQSM6.js} +26 -9
  88. package/dist/{context-MGSE4Z2T.js → context-XEWE3MOJ.js} +44 -37
  89. package/dist/{context-clear-KDAJRNUK.js → context-clear-KNOS2JPB.js} +44 -37
  90. package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
  91. package/dist/{context-working-set-SBKMPPI2.js → context-working-set-EUXAZI6N.js} +14 -13
  92. package/dist/{dispatch-runner-MSWN72NK.js → dispatch-runner-B7MTOVKL.js} +321 -60
  93. package/dist/{docs-2C2LTVT2.js → docs-FLJTIDSE.js} +5 -5
  94. package/dist/{doctor-7BSE27PJ.js → doctor-RN4YKO2X.js} +15 -15
  95. package/dist/{eval-IZGDOO4H.js → eval-RUBJVSNQ.js} +52 -236
  96. package/dist/{evidence-SR7WXB5B.js → evidence-JZNBUOQZ.js} +39 -33
  97. package/dist/{evolve-K7VE2CBX.js → evolve-FJVC4KKI.js} +39 -33
  98. package/dist/{extensions-QVDOHDGJ.js → extensions-IQL36S7K.js} +5 -5
  99. package/dist/{fleet-7XMJNQNF.js → fleet-BDKYJFCP.js} +243 -370
  100. package/dist/fleet-commands-ZFIWZSB3.js +70 -0
  101. package/dist/fleet-graph-Y6HPXIVF.js +125 -0
  102. package/dist/fleet-new-RDVJLHHH.js +48 -0
  103. package/dist/{fleet-preflight-AQNAH644.js → fleet-preflight-BHSNPBMH.js} +2 -2
  104. package/dist/fleet-validate-BIYREGIK.js +79 -0
  105. package/dist/{init-JGNPAYXT.js → init-LQUB5COQ.js} +57 -48
  106. package/dist/library-NJAHIGG4.js +217 -0
  107. package/dist/memory-OG6HOYKM.js +472 -0
  108. package/dist/{models-ZMMLFJNN.js → models-5ZG5XY7J.js} +23 -22
  109. package/dist/{monitor-2F3T5KHP.js → monitor-TJ7AMTGB.js} +69 -35
  110. package/dist/{orchestrator-ORHT43JB.js → orchestrator-WZYB54DM.js} +4868 -1189
  111. package/dist/{paths-UXLN5YYZ.js → paths-XUC7GS6E.js} +5 -5
  112. package/dist/{reset-NXGTYNUO.js → reset-PXQT45IY.js} +8 -8
  113. package/dist/{run-RF4WJGMT.js → run-FQ74YF62.js} +82 -62
  114. package/dist/{share-UT3W6E4M.js → share-FW7SVCL3.js} +34 -10
  115. package/dist/{skills-PSACKC5Q.js → skills-7E7IRB3R.js} +25 -9
  116. package/dist/{skills-eval-WJSI55RZ.js → skills-eval-LI75W6OK.js} +43 -35
  117. package/dist/{targets-PIIRAOYS.js → targets-4CIFKCTW.js} +27 -24
  118. package/dist/{terminal-lease-ULWXWNVY.js → terminal-lease-WUZY7ZV5.js} +5 -4
  119. package/dist/{uninstall-FZCQCDKC.js → uninstall-7FV7IP4E.js} +5 -5
  120. package/dist/{upgrade-346TZ6AV.js → upgrade-K2HVIVMQ.js} +21 -20
  121. package/dist/{usage-6KKXR32N.js → usage-GTZELZQX.js} +159 -59
  122. package/dist/verifiers-RLAHT27O.js +336 -0
  123. package/dist/{verify-X5HDROLA.js → verify-BX3BRKH5.js} +7 -6
  124. package/dist/{wiki-generate-7STOCIFZ.js → wiki-generate-ASIFASCN.js} +58 -48
  125. package/dist/worker/entry.js +98 -84
  126. package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
  127. package/docs/README.md +4 -3
  128. package/docs/acp.md +1 -1
  129. package/docs/alcf-provider.md +1 -1
  130. package/docs/architecture.md +2 -2
  131. package/docs/artifact-placement.md +1 -2
  132. package/docs/artifact-versions.md +10 -6
  133. package/docs/built-in-agents.md +26 -2
  134. package/docs/capacity-and-scheduling.md +1 -1
  135. package/docs/commands-and-modes.md +90 -8
  136. package/docs/configuration-and-targets.md +90 -2
  137. package/docs/context-engine.md +4 -2
  138. package/docs/context-working-set.md +4 -4
  139. package/docs/development-pipeline.md +1 -1
  140. package/docs/dispatch-architecture-rationale.md +1 -1
  141. package/docs/documentation-coverage.md +4 -4
  142. package/docs/documentation-guide.md +4 -4
  143. package/docs/eval-runner.md +1 -1
  144. package/docs/evals-internal.md +4 -45
  145. package/docs/evidence-and-memory.md +70 -10
  146. package/docs/evolution.md +1 -1
  147. package/docs/exit-codes-and-output.md +4 -1
  148. package/docs/extensions-and-sharing.md +6 -2
  149. package/docs/fleet-demo-runbook.md +2 -2
  150. package/docs/fleet-dispatch.md +224 -11
  151. package/docs/git-commit-provenance.md +2 -2
  152. package/docs/glossary.md +1 -1
  153. package/docs/installation-and-lifecycle.md +2 -2
  154. package/docs/middleware-and-components.md +20 -2
  155. package/docs/model-catalog.md +1 -1
  156. package/docs/observability.md +55 -8
  157. package/docs/proactive-memory.md +26 -16
  158. package/docs/prompt-envelope-and-tools.md +4 -2
  159. package/docs/provider-adapter-cookbook.md +1 -1
  160. package/docs/release-cut-checklist.md +83 -65
  161. package/docs/resource-library.md +59 -0
  162. package/docs/safety-model.md +29 -7
  163. package/docs/scientific-validation.md +3 -3
  164. package/docs/session-lifecycle.md +37 -1
  165. package/docs/skills-marketplace.md +16 -3
  166. package/docs/tool-usage.md +14 -7
  167. package/docs/trace-store.md +1 -1
  168. package/docs/troubleshooting.md +1 -1
  169. package/docs/tui-design.md +38 -4
  170. package/docs/worker-dispatch-mechanics.md +3 -3
  171. package/package.json +7 -4
  172. package/src/cli/agents.ts +2 -3
  173. package/src/cli/argv.ts +14 -1
  174. package/src/cli/fleet-commands.ts +37 -0
  175. package/src/cli/fleet-graph.ts +102 -0
  176. package/src/cli/fleet-new.ts +36 -0
  177. package/src/cli/fleet-preflight.ts +121 -0
  178. package/src/cli/fleet-validate.ts +30 -0
  179. package/src/cli/fleet.ts +188 -335
  180. package/src/cli/index.ts +4 -2
  181. package/src/cli/library.ts +190 -0
  182. package/src/cli/memory.ts +272 -10
  183. package/src/cli/modes/json-stream.ts +2 -2
  184. package/src/cli/modes/print.ts +12 -1
  185. package/src/cli/run.ts +22 -2
  186. package/src/cli/share.ts +13 -1
  187. package/src/cli/targets.ts +12 -3
  188. package/src/cli/usage.ts +160 -20
  189. package/src/core/bus-events.ts +7 -0
  190. package/src/core/commit-attribution.ts +4 -4
  191. package/src/core/config.ts +130 -0
  192. package/src/core/defaults.ts +81 -0
  193. package/src/core/response-model-id.ts +134 -0
  194. package/src/core/toml.ts +62 -0
  195. package/src/core/workspace-files.ts +0 -1
  196. package/src/domains/agents/builtins/architect.md +2 -1
  197. package/src/domains/agents/builtins/oracle.md +33 -0
  198. package/src/domains/agents/catalog.ts +18 -5
  199. package/src/domains/agents/fleet-contract.ts +278 -16
  200. package/src/domains/agents/index.ts +14 -0
  201. package/src/domains/agents/recipe.ts +54 -14
  202. package/src/domains/agents/result-contract.ts +242 -5
  203. package/src/domains/config/classify.ts +4 -0
  204. package/src/domains/context/bootstrap.ts +36 -27
  205. package/src/domains/context/project-metadata.ts +19 -63
  206. package/src/domains/context/prompt-context.ts +8 -0
  207. package/src/domains/context/working-set/policies/index.ts +3 -4
  208. package/src/domains/dispatch/active-route-planner.ts +14 -0
  209. package/src/domains/dispatch/backoff.ts +2 -1
  210. package/src/domains/dispatch/budget-envelope.ts +396 -0
  211. package/src/domains/dispatch/capability-match.ts +1 -0
  212. package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
  213. package/src/domains/dispatch/contract.ts +36 -0
  214. package/src/domains/dispatch/delegation-plan.ts +167 -0
  215. package/src/domains/dispatch/execution-plan.ts +76 -5
  216. package/src/domains/dispatch/execution-role.ts +3 -1
  217. package/src/domains/dispatch/execution-scheduler.ts +183 -67
  218. package/src/domains/dispatch/extension.ts +339 -36
  219. package/src/domains/dispatch/fleet-gate.ts +14 -0
  220. package/src/domains/dispatch/fleet-plan.ts +63 -3
  221. package/src/domains/dispatch/fleet-run.ts +737 -0
  222. package/src/domains/dispatch/gate-role-prompts.ts +9 -0
  223. package/src/domains/dispatch/host-verification.ts +178 -0
  224. package/src/domains/dispatch/index.ts +38 -0
  225. package/src/domains/dispatch/intent.ts +159 -0
  226. package/src/domains/dispatch/orphan-recovery.ts +1 -0
  227. package/src/domains/dispatch/receipt-integrity.ts +12 -4
  228. package/src/domains/dispatch/state.ts +37 -3
  229. package/src/domains/dispatch/types.ts +61 -9
  230. package/src/domains/dispatch/validation.ts +80 -6
  231. package/src/domains/dispatch/worker-spawn.ts +14 -3
  232. package/src/domains/eval/metrics/evidence.ts +0 -116
  233. package/src/domains/eval/metrics/invariants.ts +1 -1
  234. package/src/domains/eval/runners/clio-run.ts +1 -10
  235. package/src/domains/eval/runners/external-command.ts +2 -29
  236. package/src/domains/eval/schema/suite.ts +0 -7
  237. package/src/domains/eval/suites/run.ts +1 -7
  238. package/src/domains/evidence/trust-status.ts +10 -1
  239. package/src/domains/memory/index.ts +22 -0
  240. package/src/domains/memory/operations.ts +58 -1
  241. package/src/domains/memory/promotion.ts +281 -0
  242. package/src/domains/memory/prompt-section.ts +25 -5
  243. package/src/domains/memory/proposal.ts +51 -7
  244. package/src/domains/memory/task-bank.ts +3 -2
  245. package/src/domains/memory/task-memory-handoff.ts +181 -24
  246. package/src/domains/memory/task-memory-policy.ts +3 -1
  247. package/src/domains/memory/types.ts +37 -0
  248. package/src/domains/memory/validate.ts +178 -0
  249. package/src/domains/middleware/index.ts +15 -0
  250. package/src/domains/middleware/memory-intervention.ts +35 -25
  251. package/src/domains/middleware/runtime.ts +6 -0
  252. package/src/domains/middleware/skills-reminder.ts +19 -4
  253. package/src/domains/middleware/stalled-turn.ts +43 -1
  254. package/src/domains/middleware/types.ts +10 -0
  255. package/src/domains/middleware/watchdog.ts +281 -0
  256. package/src/domains/observability/contract.ts +9 -2
  257. package/src/domains/observability/cost.ts +31 -4
  258. package/src/domains/observability/extension.ts +2 -2
  259. package/src/domains/observability/index.ts +10 -0
  260. package/src/domains/observability/out-of-turn-usage.ts +223 -0
  261. package/src/domains/providers/index.ts +3 -0
  262. package/src/domains/providers/model-discovery.ts +9 -0
  263. package/src/domains/providers/runtime-resolution.ts +38 -1
  264. package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
  265. package/src/domains/providers/types/context-window-slots.ts +18 -0
  266. package/src/domains/providers/types/runtime-descriptor.ts +3 -1
  267. package/src/domains/resources/index.ts +20 -0
  268. package/src/domains/resources/library.ts +326 -0
  269. package/src/domains/resources/skills/marketplace.ts +37 -12
  270. package/src/domains/safety/call-target.ts +211 -14
  271. package/src/domains/safety/decision-presentation.ts +268 -0
  272. package/src/domains/safety/redaction.ts +73 -0
  273. package/src/domains/session/context-ledger.ts +10 -1
  274. package/src/domains/session/decision-board.ts +4 -0
  275. package/src/domains/session/entries.ts +3 -0
  276. package/src/domains/session/handoff.ts +629 -0
  277. package/src/domains/session/history.ts +68 -19
  278. package/src/domains/session/usage.ts +24 -7
  279. package/src/domains/share/archive.ts +67 -2
  280. package/src/engine/acp/event-mapper.ts +7 -0
  281. package/src/engine/acp/server.ts +29 -2
  282. package/src/engine/apis/lmstudio.ts +25 -4
  283. package/src/engine/apis/openai-completions.ts +147 -22
  284. package/src/engine/claude/sdk-runtime.ts +8 -2
  285. package/src/engine/claude/tool-safety.ts +13 -0
  286. package/src/engine/loop-guard.ts +27 -3
  287. package/src/engine/worker-events.ts +4 -3
  288. package/src/engine/worker-runtime.ts +59 -54
  289. package/src/entry/orchestrator.ts +55 -1
  290. package/src/interactive/bus-notices.ts +26 -0
  291. package/src/interactive/chat-loop-messages.ts +22 -0
  292. package/src/interactive/chat-loop.ts +248 -1
  293. package/src/interactive/chat-renderer.ts +41 -3
  294. package/src/interactive/clio-editor.ts +44 -7
  295. package/src/interactive/context-overlay.ts +43 -5
  296. package/src/interactive/cost-overlay.ts +70 -11
  297. package/src/interactive/council-dispatch.ts +30 -0
  298. package/src/interactive/council-grid.ts +213 -0
  299. package/src/interactive/council.ts +99 -0
  300. package/src/interactive/dispatch-board.ts +471 -50
  301. package/src/interactive/fleet-run-preview.ts +307 -0
  302. package/src/interactive/footer/notifications.ts +219 -0
  303. package/src/interactive/footer/widgets.ts +13 -0
  304. package/src/interactive/handoff-round.ts +56 -0
  305. package/src/interactive/interactive-application.ts +49 -2
  306. package/src/interactive/interactive-event-projection.ts +9 -1
  307. package/src/interactive/interactive-input-runtime.ts +11 -1
  308. package/src/interactive/interactive-presentation.ts +11 -1
  309. package/src/interactive/interactive-slash-runtime.ts +52 -2
  310. package/src/interactive/interactive-subscriptions.ts +14 -2
  311. package/src/interactive/memory-overlay.ts +89 -4
  312. package/src/interactive/oracle.ts +179 -0
  313. package/src/interactive/overlay-ask-user-lifecycle.ts +7 -1
  314. package/src/interactive/overlay-frame.ts +5 -2
  315. package/src/interactive/overlay-general-openers.ts +230 -2
  316. package/src/interactive/overlay-key-routing.ts +58 -2
  317. package/src/interactive/overlay-lifecycle.ts +52 -5
  318. package/src/interactive/overlay-permission-lifecycle.ts +33 -8
  319. package/src/interactive/overlay-resource-openers.ts +11 -3
  320. package/src/interactive/overlay-session-lifecycle.ts +234 -2
  321. package/src/interactive/overlay-transitions.ts +11 -0
  322. package/src/interactive/overlays/ask-user.ts +74 -30
  323. package/src/interactive/overlays/decisions.ts +3 -1
  324. package/src/interactive/overlays/fleet-run-approval.ts +208 -0
  325. package/src/interactive/overlays/handoff-review.ts +185 -0
  326. package/src/interactive/overlays/library-install-confirm.ts +151 -0
  327. package/src/interactive/overlays/list-overlay.ts +168 -2
  328. package/src/interactive/overlays/settings.ts +101 -4
  329. package/src/interactive/overlays/side-question.ts +139 -0
  330. package/src/interactive/overlays/skills-hub.ts +401 -15
  331. package/src/interactive/permission-hint.ts +35 -0
  332. package/src/interactive/permission-overlay.ts +95 -45
  333. package/src/interactive/renderers/tool-execution.ts +19 -49
  334. package/src/interactive/session-last-turn.ts +8 -1
  335. package/src/interactive/session-usage-reseed.ts +36 -10
  336. package/src/interactive/side-question.ts +171 -0
  337. package/src/interactive/slash-commands.ts +434 -7
  338. package/src/interactive/slash-spec.ts +19 -6
  339. package/src/interactive/status/summary.ts +5 -0
  340. package/src/interactive/status/types.ts +5 -0
  341. package/src/interactive/terminal-lease.ts +1 -0
  342. package/src/interactive/theme/tokens.ts +30 -0
  343. package/src/interactive/turn-context.ts +96 -23
  344. package/src/interactive/turn-middleware.ts +16 -1
  345. package/src/interactive/turn-runtime.ts +37 -8
  346. package/src/interactive/turn-state.ts +3 -0
  347. package/src/interactive/watchdog-run.ts +75 -0
  348. package/src/interactive/worker-progress.ts +440 -0
  349. package/src/interactive/worker-share.ts +56 -1
  350. package/src/interactive/worker-stream.ts +58 -110
  351. package/src/tools/agent-tools.ts +28 -3
  352. package/src/tools/ask-user.ts +21 -1
  353. package/src/tools/bootstrap.ts +3 -0
  354. package/src/tools/compete-worktrees.ts +13 -79
  355. package/src/tools/context/index.ts +2 -2
  356. package/src/tools/dispatch-admission.ts +242 -8
  357. package/src/tools/dispatch-arguments.ts +65 -1
  358. package/src/tools/dispatch-event-text.ts +19 -0
  359. package/src/tools/dispatch-plan.ts +136 -6
  360. package/src/tools/dispatch-runner.ts +319 -13
  361. package/src/tools/dispatch-types.ts +20 -1
  362. package/src/tools/dispatch.ts +96 -3
  363. package/src/tools/monitor.ts +31 -0
  364. package/src/tools/profiles.ts +18 -4
  365. package/src/tools/registry.ts +15 -5
  366. package/src/tools/result-disposition.ts +156 -0
  367. package/src/tools/result-shaping.ts +59 -1
  368. package/src/tools/task-worktree.ts +238 -0
  369. package/src/tools/verify/authoring.ts +116 -55
  370. package/src/tools/verify/scripts.ts +62 -0
  371. package/src/tools/worker-evidence.ts +21 -1
  372. package/src/worker/spec-contract.ts +44 -3
  373. package/dist/chunk-EFADSJET.js +0 -18
  374. package/dist/chunk-HC4CLZ2Y.js +0 -68
  375. package/dist/memory-4ALKDJ4Q.js +0 -246
  376. package/src/domains/eval/metrics/chaos-stream.ts +0 -93
@@ -357,6 +357,22 @@ function createClioTheme(options = {}) {
357
357
  fgSequence: (token) => color ? `\x1B[${fgCode(TOKENS[token], truecolor)}m` : ""
358
358
  };
359
359
  }
360
+ function isClioToken(value) {
361
+ return Object.hasOwn(TOKENS, value);
362
+ }
363
+ var HEX_COLOR = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/u;
364
+ function paintHex(text, hex, options = {}) {
365
+ const match = HEX_COLOR.exec(hex);
366
+ if (match === null) return text;
367
+ if (!(options.color ?? !colorDisabled())) return text;
368
+ const truecolor = options.truecolor ?? detectTruecolor();
369
+ const red = Number.parseInt(match[1] ?? "0", 16);
370
+ const green = Number.parseInt(match[2] ?? "0", 16);
371
+ const blue = Number.parseInt(match[3] ?? "0", 16);
372
+ if (truecolor) return `\x1B[38;2;${red};${green};${blue}m${text}${SGR_RESET}`;
373
+ const cube = (channel) => Math.round(channel / 255 * 5);
374
+ return `\x1B[38;5;${16 + 36 * cube(red) + 6 * cube(green) + cube(blue)}m${text}${SGR_RESET}`;
375
+ }
360
376
 
361
377
  // src/interactive/theme/components.ts
362
378
  init_esm_shims();
@@ -549,8 +565,282 @@ function clioTheme() {
549
565
 
550
566
  // src/interactive/clio-editor.ts
551
567
  init_esm_shims();
568
+
569
+ // src/interactive/overlay-frame.ts
570
+ init_esm_shims();
571
+ var DEFAULT_SELECT_THEME = selectListTheme(clioTheme());
572
+ var DEFAULT_SETTINGS_THEME = settingsListTheme(clioTheme());
573
+ var FocusBox = class extends Box {
574
+ inputTarget;
575
+ onInput;
576
+ constructor(children, options) {
577
+ super(options?.x ?? 1, options?.y ?? 0);
578
+ const childList = Array.isArray(children) ? children : [children];
579
+ for (const child of childList) this.addChild(child);
580
+ this.inputTarget = options?.inputTarget === void 0 ? childList[0] ?? null : options.inputTarget;
581
+ this.onInput = options?.onInput;
582
+ }
583
+ handleInput(data) {
584
+ if (this.onInput) {
585
+ this.onInput(data);
586
+ return;
587
+ }
588
+ this.inputTarget?.handleInput?.(data);
589
+ }
590
+ };
591
+ function resolveTone(tone) {
592
+ return typeof tone === "function" ? tone() : tone;
593
+ }
594
+ function clioFrame(text, token = "frame") {
595
+ return clioTheme().fg(token, text);
596
+ }
597
+ function clioTitle(text, token) {
598
+ return token === void 0 ? screenTitle(clioTheme(), text) : clioTheme().style(token, text, { bold: true });
599
+ }
600
+ function clioError(text) {
601
+ return clioTheme().fg("error", text);
602
+ }
603
+ function brandedTopBorder(label, innerWidth, tone) {
604
+ const frame2 = (text) => clioFrame(text, tone ?? "frame");
605
+ const clean = label.replace(/^[┌┐└┘├┤─│\s]+/, "").replace(/[┌┐└┘├┤─│\s]+$/, "");
606
+ const formatted = clean.length > 0 ? `\u2500 ${clean} ` : "\u2500";
607
+ const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
608
+ const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
609
+ const cleanIndex = clipped.indexOf(clean);
610
+ if (cleanIndex !== -1) {
611
+ const prefix = clipped.slice(0, cleanIndex);
612
+ const suffix = clipped.slice(cleanIndex + clean.length);
613
+ return `${frame2("\u250C")}${frame2(prefix)}${clioTitle(clean, tone)}${frame2(suffix)}${frame2(fill)}${frame2("\u2510")}`;
614
+ }
615
+ return `${frame2("\u250C")}${frame2(clipped)}${frame2(fill)}${frame2("\u2510")}`;
616
+ }
617
+ function isCriticalHintKey(key) {
618
+ const canonical = canonicalizeKey(key);
619
+ return canonical === "Esc" || canonical === "Enter" || canonical === "Enter/Space" || canonical === "type";
620
+ }
621
+ function isCriticalEntry(entry) {
622
+ return entry.critical ?? isCriticalHintKey(entry.key);
623
+ }
624
+ function renderHintEntries(entries, short) {
625
+ return entries.map((entry) => `[${canonicalizeKey(entry.key)}] ${short ? entry.short ?? entry.verb : entry.verb}`).join(" \xB7 ");
626
+ }
627
+ function fitHintEntries(entries, maxWidth) {
628
+ if (entries.length === 0) return "";
629
+ for (const short of [false, true]) {
630
+ const rendered = renderHintEntries(entries, short);
631
+ if (visibleWidth(rendered) <= maxWidth) return rendered;
632
+ }
633
+ const kept = [...entries];
634
+ for (const criticalPass of [false, true]) {
635
+ while (kept.length > 1) {
636
+ const index = kept.findIndex((entry) => criticalPass || !isCriticalEntry(entry));
637
+ if (index === -1) break;
638
+ kept.splice(index, 1);
639
+ const rendered = renderHintEntries(kept, true);
640
+ if (visibleWidth(rendered) <= maxWidth) return rendered;
641
+ }
642
+ }
643
+ return renderHintEntries(kept, true);
644
+ }
645
+ var FILTER_HINT = { key: "type", verb: "filter" };
646
+ function canonicalizeKey(key) {
647
+ const trimmed = key.trim();
648
+ if (trimmed === "R") return "R";
649
+ const lower = trimmed.toLowerCase();
650
+ if (lower === "up/down" || lower === "updown" || lower === "\u2191/\u2193" || lower === "up/down/j/k" || lower === "\u2191\u2193")
651
+ return "\u2191\u2193";
652
+ if (lower === "enter/space") return "Enter/Space";
653
+ if (lower === "enter") return "Enter";
654
+ if (lower === "esc" || lower === "escape") return "Esc";
655
+ if (lower === "space") return "Space";
656
+ if (lower === "tab") return "Tab";
657
+ if (lower === "r") return "r";
658
+ if (lower === "type") return "type";
659
+ return trimmed;
660
+ }
661
+ function buildHint(entries, esc = "close") {
662
+ const finalEntries = [
663
+ ...entries.map((e) => ({ key: canonicalizeKey(e.key), verb: e.verb })),
664
+ { key: "Esc", verb: esc }
665
+ ];
666
+ return finalEntries.map((e) => `[${e.key}] ${e.verb}`).join(" \xB7 ");
667
+ }
668
+ function buildResponsiveHint(entries, esc = "close") {
669
+ const escEntry = esc === null ? null : typeof esc === "string" ? { key: "Esc", verb: esc } : esc;
670
+ const all = escEntry ? [...entries, escEntry] : [...entries];
671
+ return (innerWidth) => fitHintEntries(all, innerWidth - 3);
672
+ }
673
+ function elideHint(hint, maxCleanWidth) {
674
+ const parts = hint.split(" \xB7 ");
675
+ if (parts.length <= 2) return hint;
676
+ const entries = parts.map((part) => {
677
+ const match = /^\[([^\]]+)\] ([\s\S]+)$/u.exec(part);
678
+ if (!match) return { key: "", verb: part, critical: false };
679
+ return { key: match[1] ?? "", verb: match[2] ?? "" };
680
+ });
681
+ const rendered = fitHintEntries(entries, maxCleanWidth);
682
+ return rendered.replace(/\[\] /gu, "");
683
+ }
684
+ function brandedBottomBorder(innerWidth, hint, tone) {
685
+ const frame2 = (text) => clioFrame(text, tone ?? "frame");
686
+ if (!hint || hint.trim().length === 0) {
687
+ return `${frame2("\u2514")}${frame2("\u2500".repeat(innerWidth))}${frame2("\u2518")}`;
688
+ }
689
+ let clean = hint.trim();
690
+ const maxCleanWidth = innerWidth - 3;
691
+ if (clean.includes(" \xB7 ") && visibleWidth(`\u2500 ${clean} `) > innerWidth) {
692
+ clean = elideHint(clean, maxCleanWidth);
693
+ }
694
+ const formatted = `\u2500 ${clean} `;
695
+ const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
696
+ const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
697
+ const cleanIndex = clipped.indexOf(clean);
698
+ if (cleanIndex !== -1) {
699
+ const prefix = clipped.slice(0, cleanIndex);
700
+ const suffix = clipped.slice(cleanIndex + clean.length);
701
+ return `${frame2("\u2514")}${frame2(prefix)}${clioTheme().fg("dim", clean)}${frame2(suffix)}${frame2(fill)}${frame2("\u2518")}`;
702
+ }
703
+ return `${frame2("\u2514")}${frame2(clipped)}${frame2(fill)}${frame2("\u2518")}`;
704
+ }
705
+ function formatRuntimeResolutionDiagnostic(diagnostic) {
706
+ return `${diagnostic.severity}: ${diagnostic.code}: ${diagnostic.message}`;
707
+ }
708
+ function diagnosticSeverityToken(severity) {
709
+ return severity === "error" ? "error" : severity === "warning" ? "warning" : "muted";
710
+ }
711
+ function runtimeResolutionDiagnosticLine(diagnostic, width) {
712
+ return clioTheme().fg(diagnosticSeverityToken(diagnostic.severity), fitDiagnosticLine(diagnostic, width));
713
+ }
714
+ function fitDiagnosticLine(diagnostic, width) {
715
+ return padAnsi(formatRuntimeResolutionDiagnostic(diagnostic), Math.max(1, width));
716
+ }
717
+ function frameAlignForAnchor(anchor) {
718
+ if (anchor === void 0) return "center";
719
+ if (anchor === "left-center" || anchor.endsWith("-left")) return "left";
720
+ if (anchor === "right-center" || anchor.endsWith("-right")) return "right";
721
+ return "center";
722
+ }
723
+ function fitBody(lines, rowBudget, contentWidth) {
724
+ if (rowBudget <= 0) return lines;
725
+ const bodyBudget = Math.max(1, rowBudget - 2);
726
+ if (lines.length <= bodyBudget) return lines;
727
+ const kept = lines.slice(0, bodyBudget - 1);
728
+ const hidden = lines.length - kept.length;
729
+ return [...kept, clioTheme().fg("dim", truncateToWidth(`\u2026 ${hidden} more rows`, contentWidth, "", true))];
730
+ }
731
+ var ClioOverlayFrame = class {
732
+ constructor(child, title, footerHint, boxWidth = 0, align = "center", tone) {
733
+ this.child = child;
734
+ this.title = title;
735
+ this.footerHint = footerHint;
736
+ this.boxWidth = boxWidth;
737
+ this.align = align;
738
+ this.tone = tone;
739
+ }
740
+ child;
741
+ title;
742
+ footerHint;
743
+ boxWidth;
744
+ align;
745
+ tone;
746
+ /**
747
+ * Rows the box may occupy, or zero while unknown.
748
+ *
749
+ * `Component.render` is handed a width and nothing else, so the frame learns
750
+ * its height budget from the engine's `visible` predicate, which is called
751
+ * with the live terminal size immediately before the render pass that
752
+ * composites this overlay.
753
+ */
754
+ rowBudget = 0;
755
+ /**
756
+ * Last rendered box, keyed by everything that shapes it. `childLines` is
757
+ * compared by array identity: a child that rebuilds its rows returns a fresh
758
+ * array and correctly misses, and one that serves a cache returns the same
759
+ * array and correctly hits.
760
+ */
761
+ cachedRender;
762
+ setRowBudget(rows) {
763
+ this.rowBudget = Math.max(0, Math.floor(rows));
764
+ }
765
+ render(width) {
766
+ const boxWidth = Math.max(5, Math.min(this.boxWidth > 0 ? this.boxWidth : width, width));
767
+ const contentWidth = Math.max(1, boxWidth - 4);
768
+ const childLines = this.child.render(contentWidth);
769
+ const titleText = typeof this.title === "function" ? this.title() : this.title;
770
+ const hint = typeof this.footerHint === "function" ? this.footerHint(contentWidth + 2) : this.footerHint;
771
+ const tone = resolveTone(this.tone);
772
+ const cached = this.cachedRender;
773
+ if (cached !== void 0 && cached.width === width && cached.rowBudget === this.rowBudget && cached.childLines === childLines && cached.title === titleText && cached.hint === hint && cached.tone === tone) {
774
+ return cached.lines;
775
+ }
776
+ const label = titleText.length > 0 ? `\u2500 ${titleText} ` : "\u2500 ";
777
+ const side = clioFrame("\u2502", tone ?? "frame");
778
+ const boxLines = [
779
+ brandedTopBorder(label, contentWidth + 2, tone),
780
+ ...fitBody(childLines, this.rowBudget, contentWidth).map((line) => `${side} ${padAnsi(line, contentWidth)} ${side}`),
781
+ brandedBottomBorder(contentWidth + 2, hint, tone)
782
+ ];
783
+ const slack = Math.max(0, width - boxWidth);
784
+ const lines = (() => {
785
+ if (slack === 0) return boxLines;
786
+ const leading = this.align === "left" ? 0 : this.align === "right" ? slack : Math.floor(slack / 2);
787
+ const lead = " ".repeat(leading);
788
+ const trail = " ".repeat(slack - leading);
789
+ return boxLines.map((line) => `${lead}${line}${trail}`);
790
+ })();
791
+ this.cachedRender = { width, rowBudget: this.rowBudget, childLines, title: titleText, hint, tone, lines };
792
+ return lines;
793
+ }
794
+ handleInput(data) {
795
+ this.child.handleInput?.(data);
796
+ }
797
+ invalidate() {
798
+ this.cachedRender = void 0;
799
+ this.child.invalidate?.();
800
+ }
801
+ };
802
+ function showClioOverlayFrame(tui, child, options) {
803
+ const { title, footerHint, tone, width, visible, maxHeight, margin, ...overlayOptions } = options;
804
+ const boxWidth = typeof width === "number" ? width : 0;
805
+ const frame2 = new ClioOverlayFrame(child, title, footerHint, boxWidth, frameAlignForAnchor(options.anchor), tone);
806
+ return tui.showOverlay(frame2, {
807
+ ...overlayOptions,
808
+ ...margin !== void 0 ? { margin } : {},
809
+ width: "100%",
810
+ visible: (termWidth, termHeight) => {
811
+ const shown = visible ? visible(termWidth, termHeight) : true;
812
+ const marginRows = typeof margin === "number" ? margin * 2 : (margin?.top ?? 0) + (margin?.bottom ?? 0);
813
+ const available = Math.max(1, termHeight - marginRows);
814
+ const requested = resolveRowSize(maxHeight, termHeight);
815
+ frame2.setRowBudget(requested === null ? available : Math.min(requested, available));
816
+ return shown;
817
+ }
818
+ });
819
+ }
820
+ function resolveRowSize(value, termHeight) {
821
+ if (typeof value === "number") return Math.max(1, Math.floor(value));
822
+ if (typeof value !== "string") return null;
823
+ const percent = /^(\d+(?:\.\d+)?)%$/u.exec(value.trim());
824
+ if (!percent?.[1]) return null;
825
+ return Math.max(1, Math.floor(termHeight * Number.parseFloat(percent[1]) / 100));
826
+ }
827
+
828
+ // src/interactive/permission-hint.ts
829
+ init_esm_shims();
830
+ function permissionHintEntries(composerHasDraft = false) {
831
+ return [
832
+ composerHasDraft ? { key: "Backspace", verb: "clear the draft to allow", short: "clear draft", critical: true } : { key: "Enter", verb: "allow once", short: "allow", critical: true },
833
+ { key: "s", verb: "stop turn", short: "stop", critical: true },
834
+ // With a draft, deny and stop are the only immediate answers, so Esc
835
+ // outranks the narrowing that would otherwise drop it first.
836
+ { key: "Esc", verb: "deny", critical: composerHasDraft }
837
+ ];
838
+ }
839
+
840
+ // src/interactive/clio-editor.ts
552
841
  var REVERSE_VIDEO_BLANK = `${String.fromCharCode(27)}[7m ${String.fromCharCode(27)}[0m`;
553
842
  var EMPTY_PROMPT = "Ask Clio\u2026 / for commands";
843
+ var CONFIRM_PROMPT = "A parked call is waiting for your decision";
554
844
  var MIN_HINT_WIDTH = 60;
555
845
  function hasScrollIndicator(line) {
556
846
  const stripped = stripTerminalSequences(line);
@@ -579,6 +869,7 @@ function styledRailLabel(theme, chrome) {
579
869
  return `${theme.fg("dim", chrome.getModelLabel())} ${theme.fg("dim", "\xB7")} ${styledThinkingHint(theme, chrome.getThinkingLabel())}`;
580
870
  }
581
871
  function composerMode(chrome, text) {
872
+ if (chrome.isAwaitingApproval?.() ?? false) return "CONFIRM";
582
873
  if (!(chrome.isStreaming?.() ?? false)) return "MESSAGE";
583
874
  const willSteer = chrome.willEnterSteer?.(text) ?? text.trim().length > 0;
584
875
  return willSteer ? "STEER" : "FOLLOW-UP";
@@ -589,12 +880,20 @@ function lowerRailHint(theme, chrome) {
589
880
  `${chrome.getSubmitKeyLabel?.() ?? "Enter"} send \xB7 ${chrome.getNewlineKeyLabel?.() ?? "Shift+Enter"} newline`
590
881
  );
591
882
  }
592
- function renderEmptyPrompt(line, width, theme) {
883
+ function confirmRailHint(theme, width, hasDraft) {
884
+ return theme.fg("warning", fitHintEntries(permissionHintEntries(hasDraft), Math.max(1, width - 3)));
885
+ }
886
+ function modeToken(mode) {
887
+ if (mode === "STEER") return "action";
888
+ if (mode === "CONFIRM") return "warning";
889
+ return "accentDeep";
890
+ }
891
+ function renderEmptyPrompt(line, width, theme, text = EMPTY_PROMPT) {
593
892
  const cursorAt = line.indexOf(REVERSE_VIDEO_BLANK);
594
893
  if (cursorAt < 0) return line;
595
894
  const afterCursorAt = cursorAt + REVERSE_VIDEO_BLANK.length;
596
895
  const available = Math.max(0, width - 1);
597
- const prompt = truncateToWidth(theme.fg("dim", EMPTY_PROMPT), available, "\u2026", false);
896
+ const prompt = truncateToWidth(theme.fg("dim", text), available, "\u2026", false);
598
897
  const consumed = visibleWidth(prompt);
599
898
  return `${line.slice(0, afterCursorAt)}${prompt}${line.slice(afterCursorAt + consumed)}`;
600
899
  }
@@ -619,21 +918,30 @@ var ClioEditor = class extends Editor {
619
918
  const text = this.getText();
620
919
  const mode = composerMode(this.chrome, text);
621
920
  if (hasScrollIndicator(lines[0] ?? "")) {
622
- const modeLabel = theme.style(mode === "STEER" ? "action" : "accentDeep", mode, { bold: true });
921
+ const modeLabel = theme.style(modeToken(mode), mode, { bold: true });
623
922
  lines[0] = truncateToWidth(`${modeLabel} ${lines[0] ?? ""}`, safeWidth, "", true);
624
923
  } else {
625
924
  lines[0] = rule(theme, safeWidth, {
626
925
  left: mode,
627
- leftToken: mode === "STEER" ? "action" : "accentDeep",
926
+ leftToken: modeToken(mode),
628
927
  right: styledRailLabel(theme, this.chrome),
629
928
  fillToken: "frameStrong",
630
929
  rightRaw: true,
631
930
  rightTail: theme.style("frameStrong", "\u2500", { bold: true })
632
931
  });
633
932
  }
634
- if (text.length === 0 && lines[1]) lines[1] = renderEmptyPrompt(lines[1], safeWidth, theme);
933
+ if (text.length === 0 && lines[1]) {
934
+ lines[1] = renderEmptyPrompt(lines[1], safeWidth, theme, mode === "CONFIRM" ? CONFIRM_PROMPT : EMPTY_PROMPT);
935
+ }
635
936
  const bottomRail = findBottomRail(lines, safeWidth);
636
- if (bottomRail >= 0 && safeWidth >= MIN_HINT_WIDTH) {
937
+ if (bottomRail >= 0 && mode === "CONFIRM") {
938
+ lines[bottomRail] = rule(theme, safeWidth, {
939
+ right: confirmRailHint(theme, safeWidth, text.length > 0),
940
+ fillToken: "frameStrong",
941
+ rightRaw: true,
942
+ rightTail: theme.style("frameStrong", "\u2500", { bold: true })
943
+ });
944
+ } else if (bottomRail >= 0 && safeWidth >= MIN_HINT_WIDTH) {
637
945
  lines[bottomRail] = rule(theme, safeWidth, {
638
946
  right: lowerRailHint(theme, this.chrome),
639
947
  fillToken: "frameStrong",
@@ -1825,7 +2133,6 @@ function createKeybindingManager(settings, env = process.env) {
1825
2133
  export {
1826
2134
  SelectList,
1827
2135
  createAgentProgress,
1828
- Box,
1829
2136
  CombinedAutocompleteProvider,
1830
2137
  Container,
1831
2138
  fuzzyFilter,
@@ -1845,6 +2152,8 @@ export {
1845
2152
  SGR_RESET,
1846
2153
  SGR_DIM,
1847
2154
  fgSequence,
2155
+ isClioToken,
2156
+ paintHex,
1848
2157
  GLYPH,
1849
2158
  spinnerFrame,
1850
2159
  brandMark,
@@ -1857,7 +2166,6 @@ export {
1857
2166
  joinSections,
1858
2167
  markdownTheme,
1859
2168
  selectListTheme,
1860
- settingsListTheme,
1861
2169
  abbreviateModelId,
1862
2170
  formatTargetLabel,
1863
2171
  formatCompactMs,
@@ -1869,6 +2177,17 @@ export {
1869
2177
  frame,
1870
2178
  innerDivider,
1871
2179
  clioTheme,
2180
+ DEFAULT_SELECT_THEME,
2181
+ FocusBox,
2182
+ clioError,
2183
+ fitHintEntries,
2184
+ FILTER_HINT,
2185
+ buildHint,
2186
+ buildResponsiveHint,
2187
+ formatRuntimeResolutionDiagnostic,
2188
+ runtimeResolutionDiagnosticLine,
2189
+ showClioOverlayFrame,
2190
+ permissionHintEntries,
1872
2191
  ClioEditor,
1873
2192
  getActiveRenderTrace,
1874
2193
  createProcessInteractiveShell,
@@ -1879,4 +2198,4 @@ export {
1879
2198
  formatPlatformKeybindingNotice,
1880
2199
  createKeybindingManager
1881
2200
  };
1882
- //# sourceMappingURL=chunk-ZWMF7253.js.map
2201
+ //# sourceMappingURL=chunk-5C3AQNDW.js.map
@@ -1,4 +1,8 @@
1
1
  import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ gateRouteCorrelation,
4
+ isExecutionRole
5
+ } from "./chunk-UND3GU2L.js";
2
6
  import {
3
7
  isAgentCapabilityClass
4
8
  } from "./chunk-AOCYTWAV.js";
@@ -6,90 +10,6 @@ import {
6
10
  init_esm_shims
7
11
  } from "./chunk-3R73A4XB.js";
8
12
 
9
- // src/domains/dispatch/execution-role.ts
10
- init_esm_shims();
11
- var EXECUTION_ROLES = [
12
- "builder",
13
- "reviewer",
14
- "judge",
15
- "researcher",
16
- "verifier",
17
- "recovery"
18
- ];
19
- function isExecutionRole(value) {
20
- return typeof value === "string" && EXECUTION_ROLES.includes(value);
21
- }
22
- function deriveExecutionRole(input) {
23
- if (input.attempt > 0) return "recovery";
24
- if (input.gateRole === "reviewer") return "reviewer";
25
- if (input.gateRole === "judge") return "judge";
26
- if (input.gateRole === "builder" || input.gateRole === "candidate") return "builder";
27
- if (input.resultContractKind === "verifier-report") return "verifier";
28
- if (input.capabilityClass === "read-only") return "researcher";
29
- return "builder";
30
- }
31
- function agentRoleFactsResolver(getSpec) {
32
- return (agentId) => {
33
- const spec = getSpec(agentId);
34
- return spec === null ? null : { capabilityClass: spec.capabilityClass, resultContractKind: spec.resultContract.kind };
35
- };
36
- }
37
- function requestExecutionRole(input) {
38
- const facts = input.resolveFacts?.(input.agentId) ?? null;
39
- return deriveExecutionRole({
40
- attempt: 0,
41
- ...input.gateRole !== void 0 ? { gateRole: input.gateRole } : {},
42
- capabilityClass: facts?.capabilityClass ?? "workspace-edit",
43
- resultContractKind: facts?.resultContractKind ?? null
44
- });
45
- }
46
- function withAttemptRole(requestRole, attempt) {
47
- return attempt > 0 ? "recovery" : requestRole;
48
- }
49
- var DEFAULT_GATE_DECIDER_AGENT_ID = "verifier";
50
- function gateDeciderAgentId(requested) {
51
- const trimmed = requested?.trim() ?? "";
52
- return trimmed.length > 0 ? trimmed : DEFAULT_GATE_DECIDER_AGENT_ID;
53
- }
54
- function appliesRecipeResultContract(gateRole) {
55
- return gateRole !== "reviewer" && gateRole !== "judge";
56
- }
57
- function routeCorrelationFactsForRun(run) {
58
- return {
59
- agentId: run.agentId,
60
- targetId: run.targetId,
61
- wireModelId: run.wireModelId,
62
- runtimeId: run.runtimeId,
63
- nodeId: run.node?.id ?? "local"
64
- };
65
- }
66
- function modelFamily(model) {
67
- return model.trim().toLowerCase().replace(/[-_:]?\d{4}[-_]?\d{2}[-_]?\d{2}$/u, "");
68
- }
69
- function gateRouteCorrelation(subject, decider) {
70
- const agent = subject.agentId === decider.agentId;
71
- const target = subject.targetId === decider.targetId;
72
- const sameModelFamily = modelFamily(subject.wireModelId) === modelFamily(decider.wireModelId);
73
- const runtime = subject.runtimeId === decider.runtimeId;
74
- const node = subject.nodeId === decider.nodeId;
75
- const dimensions = [
76
- ...agent ? ["agent"] : [],
77
- ...target ? ["target"] : [],
78
- ...sameModelFamily ? ["model-family"] : [],
79
- ...runtime ? ["runtime"] : [],
80
- ...node ? ["node"] : []
81
- ].sort();
82
- return {
83
- agent,
84
- target,
85
- modelFamily: sameModelFamily,
86
- runtime,
87
- node,
88
- independent: !agent && !sameModelFamily,
89
- dimensions
90
- };
91
- }
92
-
93
13
  // src/domains/dispatch/routing-intent.ts
94
14
  init_esm_shims();
95
15
  var KEYS = /* @__PURE__ */ new Set([
@@ -1053,15 +973,6 @@ function evaluateRouteDecision(decision, realized) {
1053
973
  }
1054
974
 
1055
975
  export {
1056
- isExecutionRole,
1057
- deriveExecutionRole,
1058
- agentRoleFactsResolver,
1059
- requestExecutionRole,
1060
- withAttemptRole,
1061
- gateDeciderAgentId,
1062
- appliesRecipeResultContract,
1063
- routeCorrelationFactsForRun,
1064
- gateRouteCorrelation,
1065
976
  ROUTE_POLICY_VERSION,
1066
977
  routePriorForLatencyClass,
1067
978
  routeObservationFromHistory,
@@ -1084,4 +995,4 @@ export {
1084
995
  routingIntentRejection,
1085
996
  explainRouteDecision
1086
997
  };
1087
- //# sourceMappingURL=chunk-22NAGB7X.js.map
998
+ //# sourceMappingURL=chunk-5C77SEEY.js.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
2
  import {
3
3
  isSessionEntry
4
- } from "./chunk-BEY543CS.js";
4
+ } from "./chunk-GOXNB3AO.js";
5
5
  import {
6
6
  init_esm_shims
7
7
  } from "./chunk-3R73A4XB.js";
@@ -369,7 +369,8 @@ function createTaskBoardStore(deps = {}) {
369
369
 
370
370
  export {
371
371
  taskBoardCounts,
372
+ foldTaskBoard,
372
373
  foldSessionTaskHistory,
373
374
  createTaskBoardStore
374
375
  };
375
- //# sourceMappingURL=chunk-WPQLXFOZ.js.map
376
+ //# sourceMappingURL=chunk-5FR74PWO.js.map
@@ -2,7 +2,7 @@ import { createRequire as __clioCreateRequire } from "node:module"; const requir
2
2
  import {
3
3
  readEvidenceIndex,
4
4
  writeEvidenceIndexRowQueued
5
- } from "./chunk-HC4CLZ2Y.js";
5
+ } from "./chunk-GWS3VEIW.js";
6
6
  import {
7
7
  createDispatchTraceMirror,
8
8
  traceDatabasePath
@@ -10,17 +10,17 @@ import {
10
10
  import {
11
11
  FAILURE_CAUSE_TAGS,
12
12
  buildEvidence
13
- } from "./chunk-QQL5RT5M.js";
13
+ } from "./chunk-UUANF5CR.js";
14
14
  import {
15
15
  normalizeCostProvenance
16
- } from "./chunk-QWU7ZBO7.js";
16
+ } from "./chunk-VQNODYQ4.js";
17
17
  import {
18
18
  clioDataDir,
19
19
  clioStateDir
20
20
  } from "./chunk-BNAZZHFG.js";
21
21
  import {
22
22
  BusChannels
23
- } from "./chunk-TTNYS3EA.js";
23
+ } from "./chunk-OB5HIGJY.js";
24
24
  import {
25
25
  init_esm_shims
26
26
  } from "./chunk-3R73A4XB.js";
@@ -71,7 +71,7 @@ function createCostTracker() {
71
71
  let total = 0;
72
72
  const totals = emptyBreakdown();
73
73
  return {
74
- accumulate(providerId, modelId, tokens, usd, breakdown, costProvenance) {
74
+ accumulate(providerId, attributedModelId, tokens, usd, breakdown, costProvenance, modelIdFacts, label) {
75
75
  const resolvedUsd = usd ?? 0;
76
76
  const provenance = normalizeCostProvenance(costProvenance);
77
77
  const input = breakdown?.input ?? 0;
@@ -82,7 +82,14 @@ function createCostTracker() {
82
82
  const apiCalls = breakdown?.apiCalls;
83
83
  log.push({
84
84
  providerId,
85
- modelId,
85
+ attributedModelId,
86
+ requestedModelIds: [...modelIdFacts?.requestedModelIds ?? [attributedModelId]],
87
+ responseModelIdObservationCounts: modelIdFacts ? { ...modelIdFacts.responseModelIdObservationCounts } : {
88
+ reportedCalls: 0,
89
+ notReportedCalls: 0,
90
+ notObservedCalls: apiCalls ?? 1,
91
+ legacyDifferenceOnlyCalls: 0
92
+ },
86
93
  tokens,
87
94
  usd: resolvedUsd,
88
95
  provenance,
@@ -91,7 +98,8 @@ function createCostTracker() {
91
98
  cacheRead,
92
99
  cacheWrite,
93
100
  reasoningTokens,
94
- ...apiCalls !== void 0 ? { apiCalls } : {}
101
+ ...apiCalls !== void 0 ? { apiCalls } : {},
102
+ ...label !== void 0 ? { label } : {}
95
103
  });
96
104
  total += resolvedUsd;
97
105
  totals.input += input;
@@ -742,9 +750,9 @@ function createObservabilityBundle(context, options = {}) {
742
750
  latestThroughput = null;
743
751
  projection.refresh();
744
752
  },
745
- recordTokens(providerId, modelId, tokens, costUsd, breakdown, costProvenance) {
753
+ recordTokens(providerId, attributedModelId, tokens, costUsd, breakdown, costProvenance, modelIdFacts, label) {
746
754
  telemetry.record("counter", "tokens.total", tokens);
747
- cost.accumulate(providerId, modelId, tokens, costUsd, breakdown, costProvenance);
755
+ cost.accumulate(providerId, attributedModelId, tokens, costUsd, breakdown, costProvenance, modelIdFacts, label);
748
756
  projection.refresh();
749
757
  },
750
758
  recordSessionTurn(sessionTurn) {
@@ -794,4 +802,4 @@ export {
794
802
  ObservabilityDomainModule,
795
803
  createObservabilityDomainModule
796
804
  };
797
- //# sourceMappingURL=chunk-35MKKU5R.js.map
805
+ //# sourceMappingURL=chunk-5UJ6ECTS.js.map