@iowarp/clio-coder 0.3.3 → 0.3.6

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 (370) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/CONTRIBUTING.md +7 -7
  3. package/README.md +3 -3
  4. package/dist/{acp-P2AQILE2.js → acp-2BEHC4DL.js} +9 -8
  5. package/dist/{agents-72W3BI7I.js → agents-LNNFTM53.js} +29 -24
  6. package/dist/assets/codewiki.json +1 -1
  7. package/dist/{auth-5TWEIYDN.js → auth-KXXFI2VS.js} +14 -10
  8. package/dist/{chunk-GGXXDWE4.js → chunk-22NAGB7X.js} +2 -2
  9. package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
  10. package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
  11. package/dist/chunk-3BPUFZDL.js +37 -0
  12. package/dist/chunk-43AOLP7E.js +375 -0
  13. package/dist/{chunk-ZDOOVTXZ.js → chunk-4OC57DA6.js} +27 -4
  14. package/dist/{chunk-6SGHMWE3.js → chunk-5JGRAMKL.js} +5 -5
  15. package/dist/{chunk-V6RTAOC2.js → chunk-6US73PDB.js} +572 -51
  16. package/dist/{chunk-5UFT4SUX.js → chunk-6XXKFVSN.js} +3 -3
  17. package/dist/{chunk-A3CYT5EX.js → chunk-AD2SYQYC.js} +55 -2
  18. package/dist/chunk-AOCYTWAV.js +449 -0
  19. package/dist/chunk-CFGTUFWB.js +67 -0
  20. package/dist/chunk-CJUB2JJ2.js +1478 -0
  21. package/dist/{chunk-FNTMWMX5.js → chunk-CKXWIANG.js} +14 -12
  22. package/dist/{chunk-PIWWS5BL.js → chunk-CYQKWTG3.js} +63 -78
  23. package/dist/{chunk-LZSJBIVT.js → chunk-DJVECN66.js} +271 -762
  24. package/dist/{chunk-CBCAPZAA.js → chunk-E25LMLRW.js} +2 -2
  25. package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
  26. package/dist/{chunk-STBPMHSX.js → chunk-EKY57CSP.js} +51 -84
  27. package/dist/{chunk-DUYJ5IO6.js → chunk-EYPA3EGJ.js} +12 -4
  28. package/dist/{chunk-M6SHUN7Q.js → chunk-FO5ZOVUY.js} +2 -2
  29. package/dist/chunk-FYYLNIL5.js +313 -0
  30. package/dist/{chunk-OQ33BKR3.js → chunk-G7MUEIGA.js} +3 -60
  31. package/dist/chunk-GEYXPTRF.js +613 -0
  32. package/dist/chunk-GOXNB3AO.js +261 -0
  33. package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
  34. package/dist/chunk-HWUFFB6L.js +83 -0
  35. package/dist/{chunk-4XUGQOHA.js → chunk-K7T3E2SR.js} +15 -8
  36. package/dist/chunk-K7VKOLQQ.js +15 -0
  37. package/dist/{chunk-UFIIWP2H.js → chunk-KHSFENX2.js} +8 -8
  38. package/dist/{chunk-BMEMKKIT.js → chunk-KOHPCX4K.js} +2 -2
  39. package/dist/chunk-LCGCVYZ4.js +57 -0
  40. package/dist/chunk-LL4KHSZI.js +22 -0
  41. package/dist/{chunk-PAJK6MAQ.js → chunk-LYF7OHWH.js} +42 -15
  42. package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
  43. package/dist/{chunk-5UUP6MWO.js → chunk-MV3K5QF2.js} +5 -436
  44. package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
  45. package/dist/{chunk-TZK7PACC.js → chunk-NILBFAPG.js} +14 -8
  46. package/dist/chunk-ODFEOB4F.js +1082 -0
  47. package/dist/{chunk-AGYYIBLL.js → chunk-OH3TOQTB.js} +6 -2
  48. package/dist/chunk-OZNBF4L3.js +23 -0
  49. package/dist/{chunk-DSELYM6W.js → chunk-PBTHKCPN.js} +30 -10
  50. package/dist/{verify-375KUB3Y.js → chunk-PCZJO5TI.js} +127 -42
  51. package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
  52. package/dist/{chunk-SRDMMSEP.js → chunk-QM3F2GKX.js} +1063 -1645
  53. package/dist/{chunk-X6IAEBZR.js → chunk-QNQHSOLF.js} +7 -7
  54. package/dist/{chunk-OC7FIQPC.js → chunk-R46L2BIR.js} +10 -7
  55. package/dist/{chunk-2TLUCQVG.js → chunk-RD5U66HV.js} +3 -3
  56. package/dist/{chunk-6N5PTWMY.js → chunk-RY3LY4J5.js} +50 -13
  57. package/dist/{chunk-OKGUZO2U.js → chunk-SPULKLCF.js} +4 -3
  58. package/dist/{chunk-OOJYHWRB.js → chunk-TSHXZTOQ.js} +6 -5
  59. package/dist/chunk-TZSKNMZG.js +434 -0
  60. package/dist/{chunk-7MNJORFF.js → chunk-UL3WSD3F.js} +6 -1
  61. package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
  62. package/dist/{chunk-COU2UHX6.js → chunk-VEZEGCGW.js} +170 -2
  63. package/dist/chunk-W6GROXXM.js +69 -0
  64. package/dist/{chunk-OAO4GE4M.js → chunk-WHGPSPT5.js} +2 -2
  65. package/dist/chunk-WHJYKASB.js +677 -0
  66. package/dist/{chunk-ORBHGJC5.js → chunk-WR67VIZY.js} +3 -3
  67. package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
  68. package/dist/{chunk-TZTZS7QK.js → chunk-XE2VEJHX.js} +5 -3
  69. package/dist/{chunk-LM5TQCJZ.js → chunk-XF5N4U5A.js} +8 -7
  70. package/dist/{chunk-LWLEKMDQ.js → chunk-XXQNGV4M.js} +1073 -552
  71. package/dist/{chunk-KZWTDYJF.js → chunk-XYDYPRZI.js} +7 -7
  72. package/dist/chunk-ZGVHUX3M.js +66 -0
  73. package/dist/{chunk-LW6DSM3M.js → chunk-ZRGEBJ4T.js} +1192 -1119
  74. package/dist/{chunk-2DJ2KNFG.js → chunk-ZXF4XRKW.js} +202 -40
  75. package/dist/chunk-ZZMN5OM4.js +122 -0
  76. package/dist/cli/index.js +34 -30
  77. package/dist/{clio-JOU4FXVA.js → clio-M2KGYUFZ.js} +7 -6
  78. package/dist/{code-nav-7AX6FYE6.js → code-nav-GQNL7XA6.js} +8 -6
  79. package/dist/codewiki/build-worker.js +4 -4
  80. package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
  81. package/dist/{config-XCDVKR23.js → config-XUUYQIWO.js} +47 -35
  82. package/dist/{configure-4GAP54ZW.js → configure-IHJ7YOMV.js} +18 -15
  83. package/dist/{context-77FM5DV5.js → context-74JLXAWD.js} +18 -10
  84. package/dist/{context-4UOGGLQ5.js → context-75MIWW3U.js} +41 -29
  85. package/dist/{context-5VKGUVJJ.js → context-ZQ7SIFJV.js} +85 -9
  86. package/dist/{context-clear-XXJRLCJJ.js → context-clear-GYKWNUML.js} +41 -29
  87. package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
  88. package/dist/context-working-set-UX5KEP4J.js +1553 -0
  89. package/dist/{dispatch-runner-QPRDDBDX.js → dispatch-runner-GIJBHNFL.js} +47 -32
  90. package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
  91. package/dist/{doctor-HR46URBJ.js → doctor-SVJ5BZCW.js} +12 -12
  92. package/dist/{eval-XSSNATB4.js → eval-CG6LLBLD.js} +54 -238
  93. package/dist/{evidence-6HG2PY2B.js → evidence-ZYFIEN42.js} +57 -28
  94. package/dist/{evolve-K7YU3NCY.js → evolve-QGEXEMDW.js} +36 -25
  95. package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
  96. package/dist/{fleet-VY3HHKN6.js → fleet-S5R4ZOQY.js} +73 -44
  97. package/dist/{fleet-preflight-DDN536IT.js → fleet-preflight-BHSNPBMH.js} +3 -3
  98. package/dist/{init-JYGXI3FK.js → init-5DRU55YR.js} +49 -37
  99. package/dist/memory-7YKKR6UC.js +467 -0
  100. package/dist/{models-I5QWSEOM.js → models-ZPOLRU2C.js} +24 -21
  101. package/dist/{monitor-GE4ID3IA.js → monitor-US5F5YGZ.js} +73 -46
  102. package/dist/{orchestrator-EM5MC3HM.js → orchestrator-E2AL4T5N.js} +1624 -1007
  103. package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
  104. package/dist/{reset-L2FQEE3E.js → reset-KZ652EK6.js} +6 -5
  105. package/dist/{run-ZU3QMZPZ.js → run-SRNBKDWD.js} +76 -54
  106. package/dist/{share-S5BZQC5I.js → share-CGZE33UP.js} +7 -6
  107. package/dist/{skills-X5VXCRNQ.js → skills-S2X4DLY5.js} +4 -4
  108. package/dist/{skills-eval-WKIHWTHR.js → skills-eval-W2GGIC4R.js} +40 -29
  109. package/dist/{targets-SNCPI2NR.js → targets-54SWINWB.js} +28 -23
  110. package/dist/{terminal-lease-BNAHVHBS.js → terminal-lease-SAIF2OGY.js} +6 -4
  111. package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
  112. package/dist/{upgrade-JQHHPQ4K.js → upgrade-JKAR27XC.js} +20 -19
  113. package/dist/{usage-OR4O5SMZ.js → usage-MSAWCLX4.js} +79 -36
  114. package/dist/verifiers-NCBTHHN2.js +1220 -0
  115. package/dist/verify-X5HDROLA.js +25 -0
  116. package/dist/{wiki-generate-UEXP2ARI.js → wiki-generate-GUSOQ6ZP.js} +50 -37
  117. package/dist/worker/entry.js +90 -70
  118. package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
  119. package/docs/README.md +8 -7
  120. package/docs/acp.md +1 -1
  121. package/docs/alcf-provider.md +1 -1
  122. package/docs/architecture.md +2 -2
  123. package/docs/artifact-placement.md +1 -2
  124. package/docs/artifact-versions.md +1 -1
  125. package/docs/built-in-agents.md +1 -1
  126. package/docs/capacity-and-scheduling.md +1 -1
  127. package/docs/commands-and-modes.md +60 -26
  128. package/docs/config-knobs-audit.md +1 -2
  129. package/docs/configuration-and-targets.md +26 -1
  130. package/docs/context-engine.md +67 -13
  131. package/docs/context-working-set.md +194 -0
  132. package/docs/development-pipeline.md +1 -1
  133. package/docs/documentation-coverage.md +6 -6
  134. package/docs/documentation-guide.md +7 -6
  135. package/docs/environment-variables.md +2 -1
  136. package/docs/eval-runner.md +1 -1
  137. package/docs/evals-internal.md +4 -32
  138. package/docs/evidence-and-memory.md +139 -7
  139. package/docs/evolution.md +1 -1
  140. package/docs/exit-codes-and-output.md +1 -1
  141. package/docs/extensions-and-sharing.md +2 -2
  142. package/docs/fleet-dispatch.md +49 -8
  143. package/docs/glossary.md +21 -1
  144. package/docs/installation-and-lifecycle.md +2 -2
  145. package/docs/middleware-and-components.md +19 -2
  146. package/docs/model-catalog.md +7 -9
  147. package/docs/observability.md +4 -4
  148. package/docs/proactive-memory.md +26 -16
  149. package/docs/prompt-envelope-and-tools.md +7 -5
  150. package/docs/provider-adapter-cookbook.md +1 -1
  151. package/docs/release-cut-checklist.md +43 -40
  152. package/docs/safety-model.md +49 -8
  153. package/docs/scientific-validation.md +21 -3
  154. package/docs/session-lifecycle.md +3 -3
  155. package/docs/skills-marketplace.md +1 -1
  156. package/docs/tool-usage.md +79 -12
  157. package/docs/trace-store.md +1 -1
  158. package/docs/troubleshooting.md +1 -1
  159. package/docs/tui-design.md +38 -4
  160. package/docs/worker-dispatch-mechanics.md +11 -1
  161. package/package.json +13 -13
  162. package/skills/meta/clio-test/SKILL.md +20 -17
  163. package/skills/meta/clio-test/evals.md +3 -3
  164. package/skills/meta/clio-test/references/harness.md +35 -6
  165. package/skills/meta/clio-test/references/test-map.md +20 -10
  166. package/skills/registry.yaml +2 -2
  167. package/skills/skill-marketplace.json +1 -1
  168. package/src/cli/agents.ts +2 -3
  169. package/src/cli/argv.ts +14 -1
  170. package/src/cli/context-working-set.ts +513 -0
  171. package/src/cli/context.ts +8 -0
  172. package/src/cli/evidence.ts +20 -2
  173. package/src/cli/fleet.ts +15 -0
  174. package/src/cli/index.ts +5 -1
  175. package/src/cli/memory.ts +272 -10
  176. package/src/cli/modes/json-stream.ts +2 -2
  177. package/src/cli/modes/print.ts +12 -1
  178. package/src/cli/run.ts +22 -2
  179. package/src/cli/targets.ts +12 -3
  180. package/src/cli/usage.ts +55 -7
  181. package/src/cli/verifiers.ts +325 -0
  182. package/src/core/bash-exec.ts +39 -14
  183. package/src/core/bus-events.ts +22 -4
  184. package/src/core/config.ts +54 -0
  185. package/src/core/defaults.ts +50 -3
  186. package/src/core/response-model-id.ts +134 -0
  187. package/src/core/toml.ts +62 -0
  188. package/src/core/verification-scripts.ts +6 -0
  189. package/src/core/workspace-files.ts +0 -1
  190. package/src/domains/agents/builtins/architect.md +1 -1
  191. package/src/domains/agents/builtins/verifier.md +3 -0
  192. package/src/domains/agents/catalog.ts +5 -4
  193. package/src/domains/agents/recipe.ts +54 -14
  194. package/src/domains/agents/result-contract.ts +7 -4
  195. package/src/domains/config/classify.ts +1 -0
  196. package/src/domains/context/bootstrap.ts +36 -27
  197. package/src/domains/context/project-metadata.ts +19 -63
  198. package/src/domains/context/prompt-context.ts +8 -0
  199. package/src/domains/context/working-set/contract.ts +161 -0
  200. package/src/domains/context/working-set/defaults.ts +28 -0
  201. package/src/domains/context/working-set/engine.ts +203 -0
  202. package/src/domains/context/working-set/fold.ts +62 -0
  203. package/src/domains/context/working-set/horizon.ts +38 -0
  204. package/src/domains/context/working-set/marker.ts +103 -0
  205. package/src/domains/context/working-set/path-index.ts +436 -0
  206. package/src/domains/context/working-set/payload.ts +152 -0
  207. package/src/domains/context/working-set/policies/age-horizon.ts +55 -0
  208. package/src/domains/context/working-set/policies/index.ts +20 -0
  209. package/src/domains/context/working-set/policies/structural.ts +160 -0
  210. package/src/domains/context/working-set/project.ts +132 -0
  211. package/src/domains/context/working-set/protect.ts +109 -0
  212. package/src/domains/context/working-set/recall.ts +177 -0
  213. package/src/domains/context/working-set/replay/controls.ts +112 -0
  214. package/src/domains/context/working-set/replay/load-clio.ts +199 -0
  215. package/src/domains/context/working-set/replay/metrics.ts +185 -0
  216. package/src/domains/context/working-set/replay/reference-graph.ts +79 -0
  217. package/src/domains/context/working-set/replay/report.ts +139 -0
  218. package/src/domains/context/working-set/replay/runner.ts +325 -0
  219. package/src/domains/context/working-set/replay/synthetic.ts +422 -0
  220. package/src/domains/context/working-set/replay/trace.ts +21 -0
  221. package/src/domains/context/working-set/visible.ts +54 -0
  222. package/src/domains/dispatch/budget-envelope.ts +396 -0
  223. package/src/domains/dispatch/contract.ts +2 -0
  224. package/src/domains/dispatch/extension.ts +81 -27
  225. package/src/domains/dispatch/orphan-recovery.ts +1 -0
  226. package/src/domains/dispatch/receipt-integrity.ts +4 -0
  227. package/src/domains/dispatch/state.ts +1 -0
  228. package/src/domains/dispatch/types.ts +10 -3
  229. package/src/domains/dispatch/validation.ts +14 -0
  230. package/src/domains/dispatch/worker-spawn.ts +14 -3
  231. package/src/domains/eval/metrics/evidence.ts +0 -116
  232. package/src/domains/eval/metrics/invariants.ts +1 -1
  233. package/src/domains/eval/runners/clio-run.ts +1 -10
  234. package/src/domains/eval/runners/external-command.ts +2 -29
  235. package/src/domains/eval/schema/suite.ts +0 -7
  236. package/src/domains/eval/suites/run.ts +1 -7
  237. package/src/domains/evidence/build.ts +112 -45
  238. package/src/domains/evidence/eval.ts +24 -7
  239. package/src/domains/evidence/index.ts +53 -0
  240. package/src/domains/evidence/ordering.ts +12 -0
  241. package/src/domains/evidence/run-trust.ts +221 -0
  242. package/src/domains/evidence/store.ts +46 -6
  243. package/src/domains/evidence/trust-status.ts +854 -0
  244. package/src/domains/evidence/types.ts +26 -0
  245. package/src/domains/memory/index.ts +22 -0
  246. package/src/domains/memory/operations.ts +58 -1
  247. package/src/domains/memory/promotion.ts +281 -0
  248. package/src/domains/memory/prompt-section.ts +25 -5
  249. package/src/domains/memory/proposal.ts +51 -7
  250. package/src/domains/memory/task-bank.ts +3 -2
  251. package/src/domains/memory/task-memory-handoff.ts +181 -24
  252. package/src/domains/memory/task-memory-policy.ts +3 -1
  253. package/src/domains/memory/types.ts +37 -0
  254. package/src/domains/memory/validate.ts +178 -0
  255. package/src/domains/middleware/memory-intervention.ts +38 -25
  256. package/src/domains/middleware/runtime.ts +6 -0
  257. package/src/domains/middleware/skills-reminder.ts +19 -4
  258. package/src/domains/middleware/stalled-turn.ts +208 -5
  259. package/src/domains/middleware/types.ts +10 -0
  260. package/src/domains/observability/contract.ts +6 -1
  261. package/src/domains/observability/cost.ts +20 -4
  262. package/src/domains/observability/extension.ts +2 -2
  263. package/src/domains/providers/index.ts +3 -0
  264. package/src/domains/providers/model-discovery.ts +9 -0
  265. package/src/domains/providers/runtime-resolution.ts +38 -1
  266. package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
  267. package/src/domains/providers/types/context-window-slots.ts +18 -0
  268. package/src/domains/providers/types/runtime-descriptor.ts +3 -1
  269. package/src/domains/safety/autonomy.ts +1 -1
  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/default-path-policy.ts +8 -0
  273. package/src/domains/safety/finish-contract.ts +4 -3
  274. package/src/domains/safety/policy-engine.ts +48 -6
  275. package/src/domains/safety/redaction.ts +73 -0
  276. package/src/domains/session/compaction/compact.ts +23 -1
  277. package/src/domains/session/compaction/cut-point.ts +2 -0
  278. package/src/domains/session/compaction/tokens.ts +16 -1
  279. package/src/domains/session/context-ledger.ts +12 -1
  280. package/src/domains/session/decision-board.ts +4 -0
  281. package/src/domains/session/entries.ts +110 -1
  282. package/src/domains/session/history.ts +68 -19
  283. package/src/domains/session/manager.ts +9 -2
  284. package/src/domains/session/migrations/index.ts +22 -3
  285. package/src/domains/session/usage.ts +24 -7
  286. package/src/engine/acp/event-mapper.ts +7 -0
  287. package/src/engine/acp/server.ts +32 -2
  288. package/src/engine/agent.ts +18 -1
  289. package/src/engine/apis/lmstudio.ts +25 -4
  290. package/src/engine/apis/openai-completions.ts +147 -22
  291. package/src/engine/claude/sdk-runtime.ts +8 -2
  292. package/src/engine/claude/tool-safety.ts +13 -0
  293. package/src/engine/loop-guard.ts +27 -3
  294. package/src/engine/session.ts +9 -3
  295. package/src/engine/worker-events.ts +4 -3
  296. package/src/engine/worker-runtime.ts +59 -54
  297. package/src/entry/orchestrator.ts +34 -5
  298. package/src/interactive/chat-loop-messages.ts +40 -6
  299. package/src/interactive/chat-loop.ts +13 -0
  300. package/src/interactive/chat-panel.ts +17 -1
  301. package/src/interactive/chat-renderer.ts +49 -24
  302. package/src/interactive/clio-editor.ts +44 -7
  303. package/src/interactive/context-meter.ts +10 -0
  304. package/src/interactive/context-overlay.ts +120 -7
  305. package/src/interactive/context-recall-command.ts +110 -0
  306. package/src/interactive/cost-overlay.ts +39 -8
  307. package/src/interactive/dispatch-board.ts +212 -35
  308. package/src/interactive/footer/widgets.ts +13 -0
  309. package/src/interactive/interactive-application.ts +6 -1
  310. package/src/interactive/interactive-input-runtime.ts +11 -1
  311. package/src/interactive/interactive-presentation.ts +11 -1
  312. package/src/interactive/interactive-slash-runtime.ts +37 -1
  313. package/src/interactive/memory-overlay.ts +89 -4
  314. package/src/interactive/model-session-replay.ts +21 -0
  315. package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
  316. package/src/interactive/overlay-frame.ts +5 -2
  317. package/src/interactive/overlay-general-openers.ts +46 -1
  318. package/src/interactive/overlay-key-routing.ts +41 -1
  319. package/src/interactive/overlay-lifecycle.ts +11 -4
  320. package/src/interactive/overlay-permission-lifecycle.ts +23 -8
  321. package/src/interactive/overlay-session-lifecycle.ts +8 -4
  322. package/src/interactive/overlay-transitions.ts +11 -0
  323. package/src/interactive/overlays/ask-user.ts +74 -30
  324. package/src/interactive/overlays/decisions.ts +3 -1
  325. package/src/interactive/permission-hint.ts +35 -0
  326. package/src/interactive/permission-overlay.ts +95 -45
  327. package/src/interactive/renderers/tool-execution.ts +37 -51
  328. package/src/interactive/session-last-turn.ts +8 -1
  329. package/src/interactive/session-transcript.ts +2 -2
  330. package/src/interactive/session-usage-reseed.ts +36 -10
  331. package/src/interactive/slash-commands.ts +31 -4
  332. package/src/interactive/status/summary.ts +5 -0
  333. package/src/interactive/status/types.ts +5 -0
  334. package/src/interactive/terminal-lease.ts +1 -0
  335. package/src/interactive/turn-context.ts +333 -110
  336. package/src/interactive/turn-middleware.ts +7 -6
  337. package/src/interactive/turn-runtime.ts +37 -8
  338. package/src/interactive/turn-state.ts +3 -0
  339. package/src/interactive/worker-progress.ts +440 -0
  340. package/src/interactive/worker-stream.ts +51 -110
  341. package/src/tools/agent-tools.ts +39 -7
  342. package/src/tools/ask-user.ts +21 -1
  343. package/src/tools/bash.ts +144 -82
  344. package/src/tools/builtin-tool-catalog.ts +11 -5
  345. package/src/tools/context/index.ts +107 -5
  346. package/src/tools/context/surface.ts +3 -2
  347. package/src/tools/core-bootstrap.ts +21 -0
  348. package/src/tools/dispatch-arguments.ts +8 -0
  349. package/src/tools/dispatch-event-text.ts +19 -0
  350. package/src/tools/dispatch-runner.ts +9 -7
  351. package/src/tools/dispatch.ts +24 -1
  352. package/src/tools/monitor.ts +43 -20
  353. package/src/tools/registry.ts +72 -10
  354. package/src/tools/result-disposition.ts +706 -0
  355. package/src/tools/result-shaping.ts +321 -20
  356. package/src/tools/safe-exec.ts +2 -0
  357. package/src/tools/verify/authoring.ts +1120 -0
  358. package/src/tools/verify/catalog.ts +346 -0
  359. package/src/tools/verify/index.ts +13 -3
  360. package/src/tools/verify/scripts.ts +135 -37
  361. package/src/tools/verify/surface.ts +9 -5
  362. package/src/tools/worker-evidence.ts +54 -12
  363. package/src/worker/spec-contract.ts +43 -3
  364. package/dist/chunk-J7CWMCQD.js +0 -255
  365. package/dist/chunk-T6YILFSB.js +0 -80
  366. package/dist/chunk-VAKQQHWR.js +0 -434
  367. package/dist/chunk-VPAYEGVX.js +0 -184
  368. package/dist/chunk-XBXAASKX.js +0 -18
  369. package/dist/memory-WFZMGYHX.js +0 -236
  370. package/src/domains/eval/metrics/chaos-stream.ts +0 -93
@@ -10,14 +10,14 @@ import {
10
10
  import {
11
11
  credentialWriteFailed,
12
12
  printPlaintextCredentialWarning
13
- } from "./chunk-YCWGATWI.js";
13
+ } from "./chunk-24I7BN55.js";
14
14
  import {
15
15
  columnWidths,
16
16
  formatColumnRow,
17
17
  formatColumns,
18
18
  printError,
19
19
  printOk
20
- } from "./chunk-ED4KHGC3.js";
20
+ } from "./chunk-PPAMZ32Z.js";
21
21
  import "./chunk-5TSRNF4G.js";
22
22
  import {
23
23
  EMPTY_CAPABILITIES,
@@ -26,11 +26,13 @@ import {
26
26
  registerBuiltinRuntimes,
27
27
  resolveProviderReference,
28
28
  supportGroupLabel
29
- } from "./chunk-LZSJBIVT.js";
29
+ } from "./chunk-DJVECN66.js";
30
+ import "./chunk-CFGTUFWB.js";
30
31
  import {
31
32
  readSettings
32
- } from "./chunk-A3CYT5EX.js";
33
- import "./chunk-ZDOOVTXZ.js";
33
+ } from "./chunk-AD2SYQYC.js";
34
+ import "./chunk-4OC57DA6.js";
35
+ import "./chunk-LL4KHSZI.js";
34
36
  import {
35
37
  authNotRequiredStatus,
36
38
  openAuthStorage,
@@ -38,19 +40,21 @@ import {
38
40
  resolveRuntimeAuthTarget,
39
41
  targetRequiresAuth
40
42
  } from "./chunk-4VP4KH3K.js";
41
- import "./chunk-M6SHUN7Q.js";
42
- import "./chunk-R346GLFC.js";
43
43
  import "./chunk-FQ4SKYE4.js";
44
44
  import "./chunk-IKCO5N3L.js";
45
45
  import "./chunk-3I7MS7N2.js";
46
+ import "./chunk-GEYXPTRF.js";
46
47
  import "./chunk-SST6Z5JA.js";
48
+ import "./chunk-FO5ZOVUY.js";
49
+ import "./chunk-R346GLFC.js";
47
50
  import "./chunk-4ZG3XFUR.js";
48
- import "./chunk-APJ265NV.js";
49
51
  import "./chunk-FCSXB6T2.js";
52
+ import "./chunk-APJ265NV.js";
50
53
  import "./chunk-YXLYO42X.js";
51
54
  import "./chunk-BNAZZHFG.js";
52
55
  import "./chunk-WEPFGWHJ.js";
53
- import "./chunk-OQ33BKR3.js";
56
+ import "./chunk-ZGVHUX3M.js";
57
+ import "./chunk-G7MUEIGA.js";
54
58
  import "./chunk-IWHMRKLL.js";
55
59
  import {
56
60
  init_esm_shims
@@ -533,4 +537,4 @@ async function runAuthCommand(args) {
533
537
  export {
534
538
  runAuthCommand
535
539
  };
536
- //# sourceMappingURL=auth-5TWEIYDN.js.map
540
+ //# sourceMappingURL=auth-KXXFI2VS.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
  isAgentCapabilityClass
4
- } from "./chunk-5UUP6MWO.js";
4
+ } from "./chunk-AOCYTWAV.js";
5
5
  import {
6
6
  init_esm_shims
7
7
  } from "./chunk-3R73A4XB.js";
@@ -1084,4 +1084,4 @@ export {
1084
1084
  routingIntentRejection,
1085
1085
  explainRouteDecision
1086
1086
  };
1087
- //# sourceMappingURL=chunk-GGXXDWE4.js.map
1087
+ //# sourceMappingURL=chunk-22NAGB7X.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
  printError
4
- } from "./chunk-ED4KHGC3.js";
4
+ } from "./chunk-PPAMZ32Z.js";
5
5
  import {
6
6
  source_default
7
7
  } from "./chunk-5TSRNF4G.js";
@@ -35,4 +35,4 @@ export {
35
35
  printPlaintextCredentialWarning,
36
36
  credentialWriteFailed
37
37
  };
38
- //# sourceMappingURL=chunk-YCWGATWI.js.map
38
+ //# sourceMappingURL=chunk-24I7BN55.js.map
@@ -94,8 +94,7 @@ var WORKSPACE_EXCLUDED_DIRS = /* @__PURE__ */ new Set([
94
94
  "vendor",
95
95
  ".superpowers",
96
96
  ".codex",
97
- ".claude",
98
- ".clio-coder-benchmark"
97
+ ".claude"
99
98
  ]);
100
99
  function comparePaths(a, b) {
101
100
  return a === b ? 0 : a < b ? -1 : 1;
@@ -337,4 +336,4 @@ export {
337
336
  enumerateWorkspaceFilesAsync,
338
337
  filterWorkspaceFileCandidates
339
338
  };
340
- //# sourceMappingURL=chunk-EKMEHE4H.js.map
339
+ //# sourceMappingURL=chunk-33YXPOE3.js.map
@@ -0,0 +1,37 @@
1
+ import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ durableAssistantTextFromEvent
4
+ } from "./chunk-QM3F2GKX.js";
5
+ import {
6
+ responseModelIdObservationFromRecord
7
+ } from "./chunk-CJUB2JJ2.js";
8
+ import {
9
+ init_esm_shims
10
+ } from "./chunk-3R73A4XB.js";
11
+
12
+ // src/tools/dispatch-event-text.ts
13
+ init_esm_shims();
14
+ function assistantTextFromEvent(event) {
15
+ return durableAssistantTextFromEvent(event).trim();
16
+ }
17
+ function receiptResponseModelIdObservationLabel(receipt) {
18
+ const responses = receipt.upstreamResponses ?? [];
19
+ if (responses.length === 0) return null;
20
+ const labels = responses.map((response) => {
21
+ const observation = responseModelIdObservationFromRecord(
22
+ response,
23
+ "legacy-difference-only"
24
+ );
25
+ if (observation.state === "reported") return `reported:${observation.reportedModelId}`;
26
+ if (observation.state === "not-reported") return "not-reported";
27
+ if (observation.state === "not-observed") return "not-observed";
28
+ return `legacy-difference-only:${observation.differingModelId ?? "none"}`;
29
+ });
30
+ return `response_model_id_observation=${labels.join(",")}`;
31
+ }
32
+
33
+ export {
34
+ assistantTextFromEvent,
35
+ receiptResponseModelIdObservationLabel
36
+ };
37
+ //# sourceMappingURL=chunk-3BPUFZDL.js.map
@@ -0,0 +1,375 @@
1
+ import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ isSessionEntry
4
+ } from "./chunk-GOXNB3AO.js";
5
+ import {
6
+ init_esm_shims
7
+ } from "./chunk-3R73A4XB.js";
8
+
9
+ // src/domains/session/task-board.ts
10
+ init_esm_shims();
11
+ import { randomUUID } from "node:crypto";
12
+ var TASK_BOARD_GOAL_ID = "board";
13
+ var LEGACY_TASK_BOARD_ID = "legacy";
14
+ function isOpenUserTask(task) {
15
+ return task.origin === "user" && (task.status === "pending" || task.status === "active");
16
+ }
17
+ function taskBoardCounts(board) {
18
+ const counts = {
19
+ total: board.tasks.length,
20
+ completed: 0,
21
+ active: 0,
22
+ pending: 0,
23
+ blocked: 0,
24
+ cancelled: 0,
25
+ open: 0
26
+ };
27
+ for (const task of board.tasks) {
28
+ if (task.status === "completed") counts.completed += 1;
29
+ else if (task.status === "active") counts.active += 1;
30
+ else if (task.status === "pending") counts.pending += 1;
31
+ else if (task.status === "blocked") counts.blocked += 1;
32
+ else counts.cancelled += 1;
33
+ }
34
+ counts.open = counts.pending + counts.active;
35
+ return counts;
36
+ }
37
+ function boardStatus(tasks) {
38
+ const counts = taskBoardCounts({ tasks });
39
+ if (counts.total === 0) return "pending";
40
+ if (counts.active > 0) return "active";
41
+ if (counts.open === 0 && counts.blocked === 0) return "completed";
42
+ if (counts.blocked > 0 && counts.open === 0) return "blocked";
43
+ return "pending";
44
+ }
45
+ function toTaskLedgerEntryFields(board, now) {
46
+ const evidence = [];
47
+ const subgoals = board.tasks.map((task) => {
48
+ if (task.status === "completed" && task.evidence) {
49
+ evidence.push({
50
+ id: `${task.id}.evidence`,
51
+ description: task.evidence,
52
+ status: "passed",
53
+ observedAt: now.toISOString()
54
+ });
55
+ }
56
+ const goal = {
57
+ id: task.id,
58
+ title: task.title,
59
+ status: task.status,
60
+ parentGoalId: TASK_BOARD_GOAL_ID
61
+ };
62
+ if (task.origin) goal.origin = task.origin;
63
+ if (task.userTaskId) goal.userTaskId = task.userTaskId;
64
+ if (task.reason) goal.description = task.reason;
65
+ return goal;
66
+ });
67
+ return {
68
+ kind: "taskLedger",
69
+ parentTurnId: null,
70
+ boardId: board.boardId,
71
+ goals: [{ id: TASK_BOARD_GOAL_ID, title: board.title, status: boardStatus(board.tasks) }],
72
+ subgoals,
73
+ activeRunIds: [...board.activeRunIds],
74
+ requiredValidationEvidence: evidence
75
+ };
76
+ }
77
+ function isTaskLedgerShaped(value) {
78
+ return isSessionEntry(value) && value.kind === "taskLedger";
79
+ }
80
+ function foldTaskBoard(entries) {
81
+ let last = null;
82
+ for (const raw of entries) {
83
+ if (isTaskLedgerShaped(raw)) last = toEntryView(raw);
84
+ }
85
+ return last;
86
+ }
87
+ function foldSessionTaskHistory(entries) {
88
+ const boards = /* @__PURE__ */ new Map();
89
+ for (const [index, raw] of entries.entries()) {
90
+ if (!isTaskLedgerShaped(raw)) continue;
91
+ const view = toEntryView(raw);
92
+ if (!view) continue;
93
+ const boardId = typeof raw.boardId === "string" && raw.boardId.length > 0 ? raw.boardId : LEGACY_TASK_BOARD_ID;
94
+ const timestamp = typeof raw.timestamp === "string" ? raw.timestamp : "";
95
+ if (boardId === LEGACY_TASK_BOARD_ID) {
96
+ boards.set(boardId, {
97
+ boardId,
98
+ title: view.title,
99
+ tasks: new Map(view.tasks.map((task) => [task.id, task])),
100
+ lastSnapshotAt: timestamp,
101
+ lastIndex: index
102
+ });
103
+ continue;
104
+ }
105
+ const existing = boards.get(boardId);
106
+ if (!existing) {
107
+ boards.set(boardId, {
108
+ boardId,
109
+ title: view.title,
110
+ tasks: new Map(view.tasks.map((task) => [task.id, task])),
111
+ lastSnapshotAt: timestamp,
112
+ lastIndex: index
113
+ });
114
+ continue;
115
+ }
116
+ existing.title = view.title;
117
+ for (const task of view.tasks) existing.tasks.set(task.id, task);
118
+ existing.lastSnapshotAt = timestamp;
119
+ existing.lastIndex = index;
120
+ }
121
+ return [...boards.values()].sort((left, right) => right.lastIndex - left.lastIndex).map(({ lastIndex: _lastIndex, tasks, ...board }) => ({ ...board, tasks: [...tasks.values()] }));
122
+ }
123
+ function toEntryView(entry) {
124
+ const boardGoal = entry.goals[0];
125
+ if (!boardGoal) return null;
126
+ const evidenceByTask = /* @__PURE__ */ new Map();
127
+ for (const item of entry.requiredValidationEvidence) {
128
+ const taskId = item.id.endsWith(".evidence") ? item.id.slice(0, -".evidence".length) : item.id;
129
+ evidenceByTask.set(taskId, item.description);
130
+ }
131
+ return {
132
+ boardId: entry.boardId ?? LEGACY_TASK_BOARD_ID,
133
+ title: boardGoal.title,
134
+ tasks: entry.subgoals.map((goal) => {
135
+ const task = {
136
+ id: goal.id,
137
+ title: goal.title,
138
+ status: goal.status,
139
+ origin: goal.origin ?? "agent"
140
+ };
141
+ if (goal.userTaskId) task.userTaskId = goal.userTaskId;
142
+ if (goal.description) task.reason = goal.description;
143
+ const evidence = evidenceByTask.get(goal.id);
144
+ if (evidence) task.evidence = evidence;
145
+ return task;
146
+ }),
147
+ // Run linkage is process-live: the runs recorded in old entries ended
148
+ // with the process that dispatched them, so a refold starts empty and
149
+ // the historical linkage stays readable in the earlier entries.
150
+ activeRunIds: []
151
+ };
152
+ }
153
+ function nextTaskId(tasks) {
154
+ let max = 0;
155
+ for (const task of tasks) {
156
+ const match = /^t(\d+)$/.exec(task.id);
157
+ if (match) max = Math.max(max, Number(match[1]));
158
+ }
159
+ return max + 1;
160
+ }
161
+ function normalizeTitles(titles) {
162
+ return titles.map((title) => title.trim()).filter((title) => title.length > 0);
163
+ }
164
+ function applyMutation(board, mutation) {
165
+ if (mutation.op === "plan") {
166
+ const titles = normalizeTitles(mutation.tasks);
167
+ if (mutation.title.trim().length === 0) return { error: "plan requires a non-empty title" };
168
+ if (titles.length === 0) return { error: "plan requires at least one task" };
169
+ const retained = board?.tasks.filter(isOpenUserTask) ?? [];
170
+ const notes2 = [];
171
+ const replacedOpen = board ? taskBoardCounts(board).open - retained.length : 0;
172
+ if (board && replacedOpen > 0) {
173
+ notes2.push(`replaced board "${board.title}" with ${replacedOpen} agent task(s) still open`);
174
+ }
175
+ if (retained.length > 0) notes2.push(`preserved ${retained.length} open operator task(s)`);
176
+ const start = nextTaskId(retained);
177
+ return {
178
+ board: {
179
+ boardId: "",
180
+ title: mutation.title.trim(),
181
+ tasks: [
182
+ ...retained,
183
+ ...titles.map((title, index) => ({
184
+ id: `t${start + index}`,
185
+ title,
186
+ status: "pending",
187
+ origin: "agent"
188
+ }))
189
+ ],
190
+ // Runs in flight outlive a board swap: they belong to the session,
191
+ // so the fresh board inherits the linkage until the runs finish.
192
+ activeRunIds: board?.activeRunIds ?? []
193
+ },
194
+ notes: notes2
195
+ };
196
+ }
197
+ if (mutation.op === "pick") {
198
+ const title = mutation.title.trim();
199
+ if (title.length === 0) return { error: "pick requires a non-empty operator task title" };
200
+ if (!/^u[1-9]\d*$/.test(mutation.userTaskId)) return { error: "pick requires an operator task id like u3" };
201
+ if (board?.tasks.some(
202
+ (task) => task.userTaskId === mutation.userTaskId && (task.status === "pending" || task.status === "active" || task.status === "completed")
203
+ )) {
204
+ return { error: `operator task ${mutation.userTaskId} is already linked to durable board work` };
205
+ }
206
+ const tasks2 = board?.tasks ?? [];
207
+ const picked = {
208
+ id: `t${nextTaskId(tasks2)}`,
209
+ title,
210
+ status: "pending",
211
+ origin: "user",
212
+ userTaskId: mutation.userTaskId
213
+ };
214
+ return {
215
+ board: {
216
+ boardId: board?.boardId ?? "",
217
+ title: board?.title ?? "Operator tasks",
218
+ tasks: [...tasks2, picked],
219
+ activeRunIds: board?.activeRunIds ?? []
220
+ },
221
+ notes: []
222
+ };
223
+ }
224
+ if (board === null) return { error: 'no task board yet; declare one with action="plan" first' };
225
+ if (mutation.op === "add") {
226
+ const titles = normalizeTitles(mutation.tasks);
227
+ if (titles.length === 0) return { error: "add requires at least one task" };
228
+ const start = nextTaskId(board.tasks);
229
+ const added = titles.map((title, index) => ({
230
+ id: `t${start + index}`,
231
+ title,
232
+ status: "pending",
233
+ origin: "agent"
234
+ }));
235
+ return { board: { ...board, tasks: [...board.tasks, ...added] }, notes: [] };
236
+ }
237
+ const target = board.tasks.find((task) => task.id === mutation.id);
238
+ if (!target) return { error: `task ${mutation.id} not found on the board` };
239
+ if (mutation.op === "block" && mutation.reason.trim().length === 0) {
240
+ return { error: "block requires a reason so the ledger records why work stopped" };
241
+ }
242
+ if (mutation.op === "done") {
243
+ if (mutation.evidence.trim().length === 0) {
244
+ return {
245
+ error: "done requires note as the evidence that the task actually finished (the command you ran, the file:line you verified). If the work did not happen, use block with a reason or drop it."
246
+ };
247
+ }
248
+ if (target.status === "pending") {
249
+ return {
250
+ error: `task ${target.id} was never started, so it cannot be completed. Start it and do the work, or record the truth with block (reason) or drop.`
251
+ };
252
+ }
253
+ }
254
+ const notes = [];
255
+ const tasks = board.tasks.map((task) => {
256
+ if (task.id !== target.id) {
257
+ if (mutation.op === "start" && task.status === "active") {
258
+ notes.push(`parked ${task.id} back to pending (one task active at a time)`);
259
+ return { ...task, status: "pending" };
260
+ }
261
+ return task;
262
+ }
263
+ return applyStatusMutation(task, mutation);
264
+ });
265
+ return { board: { ...board, tasks }, notes };
266
+ }
267
+ function applyStatusMutation(task, mutation) {
268
+ switch (mutation.op) {
269
+ case "start":
270
+ return { ...task, status: "active" };
271
+ case "done": {
272
+ const done = { ...task, status: "completed", evidence: mutation.evidence.trim() };
273
+ delete done.reason;
274
+ return done;
275
+ }
276
+ case "block":
277
+ return { ...task, status: "blocked", reason: mutation.reason.trim() };
278
+ case "drop": {
279
+ const dropped = { ...task, status: "cancelled" };
280
+ if (mutation.reason?.trim()) dropped.reason = mutation.reason.trim();
281
+ return dropped;
282
+ }
283
+ }
284
+ }
285
+ function createTaskBoardStore(deps = {}) {
286
+ let cachedSessionId;
287
+ let dirty = true;
288
+ let board = null;
289
+ const syncToSession = () => {
290
+ const sessionId = deps.getSessionId?.() ?? null;
291
+ if (!dirty && cachedSessionId === sessionId) return;
292
+ dirty = false;
293
+ cachedSessionId = sessionId;
294
+ try {
295
+ board = deps.readEntries ? foldTaskBoard(deps.readEntries()) : null;
296
+ } catch {
297
+ board = null;
298
+ }
299
+ };
300
+ const persist = (next) => {
301
+ try {
302
+ deps.appendEntry?.(toTaskLedgerEntryFields(next, deps.now?.() ?? /* @__PURE__ */ new Date()));
303
+ } catch {
304
+ }
305
+ };
306
+ const mutationRequiresAcknowledgement = (current, mutation) => {
307
+ if (mutation.op === "pick") return true;
308
+ if (mutation.op === "plan") return current?.tasks.some(isOpenUserTask) ?? false;
309
+ if (mutation.op !== "done") return false;
310
+ return current?.tasks.some((task) => task.id === mutation.id && task.origin === "user") ?? false;
311
+ };
312
+ return {
313
+ snapshot() {
314
+ syncToSession();
315
+ return board;
316
+ },
317
+ cachedSnapshot() {
318
+ const sessionId = deps.getSessionId?.() ?? null;
319
+ return !dirty && cachedSessionId === sessionId ? board : null;
320
+ },
321
+ historySnapshot() {
322
+ syncToSession();
323
+ try {
324
+ return deps.readEntries ? foldSessionTaskHistory(deps.readEntries()) : [];
325
+ } catch {
326
+ return [];
327
+ }
328
+ },
329
+ apply(mutation) {
330
+ syncToSession();
331
+ const result = applyMutation(board, mutation);
332
+ if ("error" in result) return { ok: false, message: result.error };
333
+ const needsBoardId = mutation.op === "plan" || result.board.boardId.length === 0;
334
+ const nextBoard = needsBoardId ? { ...result.board, boardId: deps.createBoardId?.() ?? randomUUID() } : result.board;
335
+ if (mutationRequiresAcknowledgement(board, mutation)) {
336
+ if (!deps.appendEntry) {
337
+ return { ok: false, message: "durable task-ledger persistence is unavailable for operator-linked work" };
338
+ }
339
+ try {
340
+ deps.appendEntry(toTaskLedgerEntryFields(nextBoard, deps.now?.() ?? /* @__PURE__ */ new Date()));
341
+ } catch (error) {
342
+ const message = error instanceof Error ? error.message : String(error);
343
+ return { ok: false, message: `could not persist operator-linked task board: ${message}` };
344
+ }
345
+ board = nextBoard;
346
+ return { ok: true, board: nextBoard, notes: result.notes };
347
+ }
348
+ board = nextBoard;
349
+ persist(nextBoard);
350
+ return { ok: true, board: nextBoard, notes: result.notes };
351
+ },
352
+ attachRun(runId) {
353
+ syncToSession();
354
+ if (board === null || runId.length === 0 || board.activeRunIds.includes(runId)) return;
355
+ board = { ...board, activeRunIds: [...board.activeRunIds, runId] };
356
+ persist(board);
357
+ },
358
+ detachRun(runId) {
359
+ syncToSession();
360
+ if (board === null || !board.activeRunIds.includes(runId)) return;
361
+ board = { ...board, activeRunIds: board.activeRunIds.filter((id) => id !== runId) };
362
+ persist(board);
363
+ },
364
+ invalidate() {
365
+ dirty = true;
366
+ }
367
+ };
368
+ }
369
+
370
+ export {
371
+ taskBoardCounts,
372
+ foldSessionTaskHistory,
373
+ createTaskBoardStore
374
+ };
375
+ //# sourceMappingURL=chunk-43AOLP7E.js.map
@@ -1,4 +1,7 @@
1
1
  import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ DEFAULT_WORKING_SET_SETTINGS
4
+ } from "./chunk-LL4KHSZI.js";
2
5
  import {
3
6
  GUARDRAIL_DEFAULTS
4
7
  } from "./chunk-4ZG3XFUR.js";
@@ -124,6 +127,9 @@ var DEFAULT_SETTINGS = {
124
127
  threshold: 0.8,
125
128
  excludeLastTurns: 6
126
129
  },
130
+ context: {
131
+ workingSet: DEFAULT_WORKING_SET_SETTINGS
132
+ },
127
133
  retry: {
128
134
  enabled: true,
129
135
  maxRetries: 3,
@@ -364,9 +370,9 @@ keybindings: {}
364
370
  # auto master switch for the pre-request compaction trigger.
365
371
  # Manual /context compact always runs the LLM summary.
366
372
  # threshold pressure = estimated_tokens / context_window. Crossing
367
- # it masks stale tool observations first, then runs a
368
- # full LLM summary if pressure stays above the threshold.
369
- # excludeLastTurns recent user turns protected from observation masking.
373
+ # it evicts from the working set first, then runs a full
374
+ # LLM summary if pressure stays above the threshold.
375
+ # excludeLastTurns recent turns protected only by the temporary legacy mask.
370
376
  # model optional pattern (e.g. provider/summary-model-id) for a
371
377
  # dedicated summarization model. Absent \u21D2 orchestrator target.
372
378
  # systemPrompt optional path to a prompt-override file.
@@ -377,6 +383,23 @@ compaction:
377
383
  # model: provider/summary-model-id
378
384
  # systemPrompt: ~/.config/clio-coder/prompts/compaction.md
379
385
 
386
+ # Non-destructive working-set eviction before summary compaction.
387
+ # enabled false skips eviction and goes directly to the summary stage.
388
+ # policy structural-v1 evicts by what the session did since
389
+ # (re-reads, edits, resolved failures, consumed listings)
390
+ # and falls back to age only under pressure;
391
+ # age-horizon is the previous age-based selection.
392
+ # target pressure ratio an applied eviction batches down to.
393
+ # protectLastTurns recent user turns whose observations remain in the working set.
394
+ # minEvictableTokens entries below this estimate remain in the working set.
395
+ context:
396
+ workingSet:
397
+ enabled: true
398
+ policy: structural-v1
399
+ target: 0.6
400
+ protectLastTurns: 6
401
+ minEvictableTokens: 200
402
+
380
403
  # Transient provider/stream retry controls for interactive chat.
381
404
  # Retryable errors include overloads, rate limits, 5xx responses, network
382
405
  # resets, and timeouts. Context overflow uses compaction recovery instead.
@@ -423,4 +446,4 @@ export {
423
446
  DEFAULT_SETTINGS,
424
447
  DEFAULT_SETTINGS_YAML
425
448
  };
426
- //# sourceMappingURL=chunk-ZDOOVTXZ.js.map
449
+ //# sourceMappingURL=chunk-4OC57DA6.js.map
@@ -1,20 +1,20 @@
1
1
  import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
2
  import {
3
3
  assistantTextFromEvent
4
- } from "./chunk-XBXAASKX.js";
4
+ } from "./chunk-3BPUFZDL.js";
5
5
  import {
6
6
  compileExecutionPlan,
7
7
  durableAssistantTextFromEvent
8
- } from "./chunk-SRDMMSEP.js";
8
+ } from "./chunk-QM3F2GKX.js";
9
9
  import {
10
10
  deriveExecutionRole
11
- } from "./chunk-GGXXDWE4.js";
11
+ } from "./chunk-22NAGB7X.js";
12
12
  import {
13
13
  truncateUtf8
14
14
  } from "./chunk-6XLNIQDB.js";
15
15
  import {
16
16
  BusChannels
17
- } from "./chunk-OQ33BKR3.js";
17
+ } from "./chunk-G7MUEIGA.js";
18
18
  import {
19
19
  init_esm_shims
20
20
  } from "./chunk-3R73A4XB.js";
@@ -274,4 +274,4 @@ export {
274
274
  compileScoutTransition,
275
275
  createDispatchRunEventRegistry
276
276
  };
277
- //# sourceMappingURL=chunk-6SGHMWE3.js.map
277
+ //# sourceMappingURL=chunk-5JGRAMKL.js.map