@iowarp/clio-coder 0.3.4 → 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 (265) hide show
  1. package/CHANGELOG.md +37 -2
  2. package/CONTRIBUTING.md +6 -6
  3. package/README.md +2 -2
  4. package/dist/{acp-S5R4RR5B.js → acp-2BEHC4DL.js} +4 -4
  5. package/dist/{agents-P6DMMVZY.js → agents-LNNFTM53.js} +13 -11
  6. package/dist/assets/codewiki.json +1 -1
  7. package/dist/{auth-2XCZLPKS.js → auth-KXXFI2VS.js} +6 -6
  8. package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
  9. package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
  10. package/dist/chunk-3BPUFZDL.js +37 -0
  11. package/dist/{chunk-WPQLXFOZ.js → chunk-43AOLP7E.js} +2 -2
  12. package/dist/{chunk-N4CZJQRK.js → chunk-5JGRAMKL.js} +4 -4
  13. package/dist/{chunk-BRXQQJFP.js → chunk-6US73PDB.js} +568 -47
  14. package/dist/{chunk-K6WL7QZT.js → chunk-6XXKFVSN.js} +2 -2
  15. package/dist/{chunk-QQK64KLB.js → chunk-CJUB2JJ2.js} +138 -20
  16. package/dist/{chunk-HV5X7OR2.js → chunk-CKXWIANG.js} +12 -12
  17. package/dist/{chunk-UZHIZC5S.js → chunk-CYQKWTG3.js} +61 -76
  18. package/dist/{chunk-QWU7ZBO7.js → chunk-DJVECN66.js} +204 -45
  19. package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
  20. package/dist/{chunk-7RXG6QRZ.js → chunk-EKY57CSP.js} +2 -75
  21. package/dist/{chunk-EDRHSCIE.js → chunk-EYPA3EGJ.js} +10 -2
  22. package/dist/{chunk-TTNYS3EA.js → chunk-G7MUEIGA.js} +1 -1
  23. package/dist/{chunk-BPGS2WCQ.js → chunk-GEYXPTRF.js} +2 -1
  24. package/dist/{chunk-BEY543CS.js → chunk-GOXNB3AO.js} +5 -2
  25. package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
  26. package/dist/chunk-HWUFFB6L.js +83 -0
  27. package/dist/{chunk-35MKKU5R.js → chunk-K7T3E2SR.js} +15 -8
  28. package/dist/{chunk-VAWWTKDP.js → chunk-KHSFENX2.js} +2 -2
  29. package/dist/chunk-LCGCVYZ4.js +57 -0
  30. package/dist/{chunk-X6COSD2O.js → chunk-LYF7OHWH.js} +41 -14
  31. package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
  32. package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
  33. package/dist/{chunk-5M54SPOL.js → chunk-ODFEOB4F.js} +161 -5
  34. package/dist/{chunk-3JLKSKD7.js → chunk-OH3TOQTB.js} +5 -1
  35. package/dist/{chunk-MEQ45TQ4.js → chunk-PBTHKCPN.js} +18 -4
  36. package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
  37. package/dist/{chunk-QQL5RT5M.js → chunk-QM3F2GKX.js} +94 -36
  38. package/dist/{chunk-A2GZF7DC.js → chunk-QNQHSOLF.js} +4 -4
  39. package/dist/{chunk-KRPY7NTG.js → chunk-R46L2BIR.js} +3 -3
  40. package/dist/{chunk-BP4OYD6A.js → chunk-RY3LY4J5.js} +20 -2
  41. package/dist/{chunk-34475P3I.js → chunk-TSHXZTOQ.js} +5 -4
  42. package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
  43. package/dist/{chunk-2TZWSW76.js → chunk-WHGPSPT5.js} +2 -2
  44. package/dist/{chunk-TW3WDMVS.js → chunk-WHJYKASB.js} +2 -2
  45. package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
  46. package/dist/{chunk-HXG4IURW.js → chunk-XE2VEJHX.js} +2 -2
  47. package/dist/{chunk-3HZ5RWN2.js → chunk-XF5N4U5A.js} +7 -6
  48. package/dist/{chunk-ZYKPLLNQ.js → chunk-XXQNGV4M.js} +590 -32
  49. package/dist/{chunk-4JUF2NNX.js → chunk-XYDYPRZI.js} +4 -4
  50. package/dist/{chunk-VMNQ6OZA.js → chunk-ZRGEBJ4T.js} +971 -794
  51. package/dist/{chunk-2LZI5CAG.js → chunk-ZXF4XRKW.js} +75 -33
  52. package/dist/{chunk-VSNATDE6.js → chunk-ZZMN5OM4.js} +2 -2
  53. package/dist/cli/index.js +31 -31
  54. package/dist/{clio-J5JIOIDS.js → clio-M2KGYUFZ.js} +2 -2
  55. package/dist/{code-nav-AXCXSBHX.js → code-nav-GQNL7XA6.js} +5 -5
  56. package/dist/codewiki/build-worker.js +4 -4
  57. package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
  58. package/dist/{config-OEBMIN2U.js → config-XUUYQIWO.js} +27 -25
  59. package/dist/{configure-PUQOSIXQ.js → configure-IHJ7YOMV.js} +7 -7
  60. package/dist/{context-URSXPBCK.js → context-74JLXAWD.js} +12 -12
  61. package/dist/{context-MGSE4Z2T.js → context-75MIWW3U.js} +24 -22
  62. package/dist/{context-EKDCKUUZ.js → context-ZQ7SIFJV.js} +8 -7
  63. package/dist/{context-clear-KDAJRNUK.js → context-clear-GYKWNUML.js} +24 -22
  64. package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
  65. package/dist/{context-working-set-SBKMPPI2.js → context-working-set-UX5KEP4J.js} +11 -10
  66. package/dist/{dispatch-runner-MSWN72NK.js → dispatch-runner-GIJBHNFL.js} +21 -20
  67. package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
  68. package/dist/{doctor-7BSE27PJ.js → doctor-SVJ5BZCW.js} +4 -4
  69. package/dist/{eval-IZGDOO4H.js → eval-CG6LLBLD.js} +47 -232
  70. package/dist/{evidence-SR7WXB5B.js → evidence-ZYFIEN42.js} +19 -18
  71. package/dist/{evolve-K7VE2CBX.js → evolve-QGEXEMDW.js} +19 -18
  72. package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
  73. package/dist/{fleet-7XMJNQNF.js → fleet-S5R4ZOQY.js} +49 -30
  74. package/dist/{fleet-preflight-AQNAH644.js → fleet-preflight-BHSNPBMH.js} +2 -2
  75. package/dist/{init-JGNPAYXT.js → init-5DRU55YR.js} +31 -29
  76. package/dist/memory-7YKKR6UC.js +467 -0
  77. package/dist/{models-ZMMLFJNN.js → models-ZPOLRU2C.js} +10 -10
  78. package/dist/{monitor-2F3T5KHP.js → monitor-US5F5YGZ.js} +33 -18
  79. package/dist/{orchestrator-ORHT43JB.js → orchestrator-E2AL4T5N.js} +1092 -659
  80. package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
  81. package/dist/{reset-NXGTYNUO.js → reset-KZ652EK6.js} +3 -3
  82. package/dist/{run-RF4WJGMT.js → run-SRNBKDWD.js} +52 -40
  83. package/dist/{share-UT3W6E4M.js → share-CGZE33UP.js} +3 -3
  84. package/dist/{skills-PSACKC5Q.js → skills-S2X4DLY5.js} +4 -4
  85. package/dist/{skills-eval-WJSI55RZ.js → skills-eval-W2GGIC4R.js} +19 -18
  86. package/dist/{targets-PIIRAOYS.js → targets-54SWINWB.js} +14 -12
  87. package/dist/{terminal-lease-ULWXWNVY.js → terminal-lease-SAIF2OGY.js} +5 -4
  88. package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
  89. package/dist/{upgrade-346TZ6AV.js → upgrade-JKAR27XC.js} +8 -8
  90. package/dist/{usage-6KKXR32N.js → usage-MSAWCLX4.js} +60 -27
  91. package/dist/{verifiers-4UUM6TEE.js → verifiers-NCBTHHN2.js} +60 -54
  92. package/dist/{wiki-generate-7STOCIFZ.js → wiki-generate-GUSOQ6ZP.js} +30 -28
  93. package/dist/worker/entry.js +69 -58
  94. package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
  95. package/docs/README.md +3 -3
  96. package/docs/acp.md +1 -1
  97. package/docs/alcf-provider.md +1 -1
  98. package/docs/architecture.md +2 -2
  99. package/docs/artifact-placement.md +1 -2
  100. package/docs/artifact-versions.md +1 -1
  101. package/docs/built-in-agents.md +1 -1
  102. package/docs/capacity-and-scheduling.md +1 -1
  103. package/docs/commands-and-modes.md +9 -7
  104. package/docs/configuration-and-targets.md +12 -1
  105. package/docs/context-engine.md +4 -2
  106. package/docs/context-working-set.md +4 -4
  107. package/docs/development-pipeline.md +1 -1
  108. package/docs/documentation-coverage.md +3 -3
  109. package/docs/documentation-guide.md +2 -2
  110. package/docs/eval-runner.md +1 -1
  111. package/docs/evals-internal.md +4 -45
  112. package/docs/evidence-and-memory.md +67 -7
  113. package/docs/evolution.md +1 -1
  114. package/docs/exit-codes-and-output.md +1 -1
  115. package/docs/extensions-and-sharing.md +2 -2
  116. package/docs/fleet-dispatch.md +28 -2
  117. package/docs/installation-and-lifecycle.md +2 -2
  118. package/docs/middleware-and-components.md +19 -2
  119. package/docs/model-catalog.md +1 -1
  120. package/docs/observability.md +3 -3
  121. package/docs/proactive-memory.md +26 -16
  122. package/docs/prompt-envelope-and-tools.md +4 -2
  123. package/docs/provider-adapter-cookbook.md +1 -1
  124. package/docs/release-cut-checklist.md +38 -35
  125. package/docs/safety-model.md +29 -7
  126. package/docs/scientific-validation.md +3 -3
  127. package/docs/session-lifecycle.md +1 -1
  128. package/docs/skills-marketplace.md +1 -1
  129. package/docs/tool-usage.md +2 -2
  130. package/docs/trace-store.md +1 -1
  131. package/docs/troubleshooting.md +1 -1
  132. package/docs/tui-design.md +38 -4
  133. package/docs/worker-dispatch-mechanics.md +1 -1
  134. package/package.json +7 -4
  135. package/src/cli/agents.ts +2 -3
  136. package/src/cli/argv.ts +14 -1
  137. package/src/cli/fleet.ts +15 -0
  138. package/src/cli/index.ts +1 -1
  139. package/src/cli/memory.ts +272 -10
  140. package/src/cli/modes/json-stream.ts +2 -2
  141. package/src/cli/modes/print.ts +12 -1
  142. package/src/cli/run.ts +22 -2
  143. package/src/cli/targets.ts +12 -3
  144. package/src/cli/usage.ts +55 -7
  145. package/src/core/bus-events.ts +3 -0
  146. package/src/core/response-model-id.ts +134 -0
  147. package/src/core/toml.ts +62 -0
  148. package/src/core/workspace-files.ts +0 -1
  149. package/src/domains/agents/builtins/architect.md +1 -1
  150. package/src/domains/agents/catalog.ts +5 -4
  151. package/src/domains/agents/recipe.ts +54 -14
  152. package/src/domains/agents/result-contract.ts +7 -4
  153. package/src/domains/context/bootstrap.ts +36 -27
  154. package/src/domains/context/project-metadata.ts +19 -63
  155. package/src/domains/context/prompt-context.ts +8 -0
  156. package/src/domains/context/working-set/policies/index.ts +3 -4
  157. package/src/domains/dispatch/budget-envelope.ts +396 -0
  158. package/src/domains/dispatch/contract.ts +2 -0
  159. package/src/domains/dispatch/extension.ts +81 -27
  160. package/src/domains/dispatch/orphan-recovery.ts +1 -0
  161. package/src/domains/dispatch/receipt-integrity.ts +4 -0
  162. package/src/domains/dispatch/state.ts +1 -0
  163. package/src/domains/dispatch/types.ts +10 -3
  164. package/src/domains/dispatch/validation.ts +14 -0
  165. package/src/domains/dispatch/worker-spawn.ts +14 -3
  166. package/src/domains/eval/metrics/evidence.ts +0 -116
  167. package/src/domains/eval/metrics/invariants.ts +1 -1
  168. package/src/domains/eval/runners/clio-run.ts +1 -10
  169. package/src/domains/eval/runners/external-command.ts +2 -29
  170. package/src/domains/eval/schema/suite.ts +0 -7
  171. package/src/domains/eval/suites/run.ts +1 -7
  172. package/src/domains/memory/index.ts +22 -0
  173. package/src/domains/memory/operations.ts +58 -1
  174. package/src/domains/memory/promotion.ts +281 -0
  175. package/src/domains/memory/prompt-section.ts +25 -5
  176. package/src/domains/memory/proposal.ts +51 -7
  177. package/src/domains/memory/task-bank.ts +3 -2
  178. package/src/domains/memory/task-memory-handoff.ts +181 -24
  179. package/src/domains/memory/task-memory-policy.ts +3 -1
  180. package/src/domains/memory/types.ts +37 -0
  181. package/src/domains/memory/validate.ts +178 -0
  182. package/src/domains/middleware/memory-intervention.ts +35 -25
  183. package/src/domains/middleware/runtime.ts +6 -0
  184. package/src/domains/middleware/skills-reminder.ts +19 -4
  185. package/src/domains/middleware/stalled-turn.ts +43 -1
  186. package/src/domains/middleware/types.ts +10 -0
  187. package/src/domains/observability/contract.ts +6 -1
  188. package/src/domains/observability/cost.ts +20 -4
  189. package/src/domains/observability/extension.ts +2 -2
  190. package/src/domains/providers/index.ts +3 -0
  191. package/src/domains/providers/model-discovery.ts +9 -0
  192. package/src/domains/providers/runtime-resolution.ts +38 -1
  193. package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
  194. package/src/domains/providers/types/context-window-slots.ts +18 -0
  195. package/src/domains/providers/types/runtime-descriptor.ts +3 -1
  196. package/src/domains/safety/call-target.ts +211 -14
  197. package/src/domains/safety/decision-presentation.ts +268 -0
  198. package/src/domains/safety/redaction.ts +73 -0
  199. package/src/domains/session/context-ledger.ts +10 -1
  200. package/src/domains/session/decision-board.ts +4 -0
  201. package/src/domains/session/entries.ts +3 -0
  202. package/src/domains/session/history.ts +68 -19
  203. package/src/domains/session/usage.ts +24 -7
  204. package/src/engine/acp/event-mapper.ts +7 -0
  205. package/src/engine/acp/server.ts +29 -2
  206. package/src/engine/apis/lmstudio.ts +25 -4
  207. package/src/engine/apis/openai-completions.ts +147 -22
  208. package/src/engine/claude/sdk-runtime.ts +8 -2
  209. package/src/engine/claude/tool-safety.ts +13 -0
  210. package/src/engine/loop-guard.ts +27 -3
  211. package/src/engine/worker-events.ts +4 -3
  212. package/src/engine/worker-runtime.ts +59 -54
  213. package/src/entry/orchestrator.ts +18 -1
  214. package/src/interactive/chat-loop-messages.ts +22 -0
  215. package/src/interactive/chat-loop.ts +13 -0
  216. package/src/interactive/chat-renderer.ts +19 -3
  217. package/src/interactive/clio-editor.ts +44 -7
  218. package/src/interactive/context-overlay.ts +43 -5
  219. package/src/interactive/cost-overlay.ts +39 -8
  220. package/src/interactive/dispatch-board.ts +212 -35
  221. package/src/interactive/footer/widgets.ts +13 -0
  222. package/src/interactive/interactive-application.ts +6 -1
  223. package/src/interactive/interactive-input-runtime.ts +11 -1
  224. package/src/interactive/interactive-presentation.ts +11 -1
  225. package/src/interactive/memory-overlay.ts +89 -4
  226. package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
  227. package/src/interactive/overlay-frame.ts +5 -2
  228. package/src/interactive/overlay-general-openers.ts +40 -1
  229. package/src/interactive/overlay-key-routing.ts +41 -1
  230. package/src/interactive/overlay-lifecycle.ts +11 -4
  231. package/src/interactive/overlay-permission-lifecycle.ts +23 -8
  232. package/src/interactive/overlay-transitions.ts +11 -0
  233. package/src/interactive/overlays/ask-user.ts +74 -30
  234. package/src/interactive/overlays/decisions.ts +3 -1
  235. package/src/interactive/permission-hint.ts +35 -0
  236. package/src/interactive/permission-overlay.ts +95 -45
  237. package/src/interactive/renderers/tool-execution.ts +19 -49
  238. package/src/interactive/session-last-turn.ts +8 -1
  239. package/src/interactive/session-usage-reseed.ts +36 -10
  240. package/src/interactive/slash-commands.ts +2 -2
  241. package/src/interactive/status/summary.ts +5 -0
  242. package/src/interactive/status/types.ts +5 -0
  243. package/src/interactive/terminal-lease.ts +1 -0
  244. package/src/interactive/turn-context.ts +96 -23
  245. package/src/interactive/turn-middleware.ts +1 -0
  246. package/src/interactive/turn-runtime.ts +37 -8
  247. package/src/interactive/turn-state.ts +3 -0
  248. package/src/interactive/worker-progress.ts +440 -0
  249. package/src/interactive/worker-stream.ts +51 -110
  250. package/src/tools/agent-tools.ts +28 -3
  251. package/src/tools/ask-user.ts +21 -1
  252. package/src/tools/context/index.ts +2 -2
  253. package/src/tools/dispatch-arguments.ts +8 -0
  254. package/src/tools/dispatch-event-text.ts +19 -0
  255. package/src/tools/dispatch.ts +24 -1
  256. package/src/tools/monitor.ts +15 -0
  257. package/src/tools/registry.ts +15 -5
  258. package/src/tools/result-disposition.ts +156 -0
  259. package/src/tools/result-shaping.ts +59 -1
  260. package/src/tools/verify/authoring.ts +55 -54
  261. package/src/tools/worker-evidence.ts +19 -0
  262. package/src/worker/spec-contract.ts +43 -3
  263. package/dist/chunk-EFADSJET.js +0 -18
  264. package/dist/memory-4ALKDJ4Q.js +0 -246
  265. package/src/domains/eval/metrics/chaos-stream.ts +0 -93
@@ -0,0 +1,467 @@
1
+ import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ approveMemoryRecord,
4
+ canonicalMemoryRepositoryIdentity,
5
+ loadMemoryRecords,
6
+ memoryAgentIdentity,
7
+ memoryRuntimeIdentity,
8
+ memoryStatus,
9
+ parseTaskMemoryHandoffSnapshot,
10
+ proposeMemoryFromEvidence,
11
+ proposeMemoryPromotion,
12
+ pruneStaleMemory,
13
+ rejectMemoryRecord
14
+ } from "./chunk-6US73PDB.js";
15
+ import "./chunk-QM3F2GKX.js";
16
+ import "./chunk-CJUB2JJ2.js";
17
+ import "./chunk-QKMUKYO7.js";
18
+ import "./chunk-OH3TOQTB.js";
19
+ import "./chunk-TSHXZTOQ.js";
20
+ import "./chunk-TXOTCRLG.js";
21
+ import "./chunk-HVDIIIQW.js";
22
+ import "./chunk-W6GROXXM.js";
23
+ import "./chunk-WHGPSPT5.js";
24
+ import "./chunk-XXQNGV4M.js";
25
+ import "./chunk-43AOLP7E.js";
26
+ import "./chunk-EKY57CSP.js";
27
+ import "./chunk-22NAGB7X.js";
28
+ import "./chunk-AOCYTWAV.js";
29
+ import "./chunk-MV3K5QF2.js";
30
+ import "./chunk-CMZWFGD2.js";
31
+ import "./chunk-I4HZDVNP.js";
32
+ import "./chunk-FYYLNIL5.js";
33
+ import "./chunk-UL3WSD3F.js";
34
+ import "./chunk-OQE5J4C6.js";
35
+ import "./chunk-ECH6PKUQ.js";
36
+ import "./chunk-GOXNB3AO.js";
37
+ import "./chunk-HWUFFB6L.js";
38
+ import "./chunk-ODFEOB4F.js";
39
+ import "./chunk-OZNBF4L3.js";
40
+ import "./chunk-4BJ5BYCE.js";
41
+ import "./chunk-6XLNIQDB.js";
42
+ import "./chunk-5B2AEOW5.js";
43
+ import "./chunk-CGKSTWHD.js";
44
+ import "./chunk-XAKHZX5N.js";
45
+ import "./chunk-33YXPOE3.js";
46
+ import "./chunk-24I7BN55.js";
47
+ import {
48
+ printError,
49
+ printOk
50
+ } from "./chunk-PPAMZ32Z.js";
51
+ import "./chunk-5TSRNF4G.js";
52
+ import "./chunk-DJVECN66.js";
53
+ import "./chunk-CFGTUFWB.js";
54
+ import "./chunk-AD2SYQYC.js";
55
+ import "./chunk-4OC57DA6.js";
56
+ import "./chunk-LL4KHSZI.js";
57
+ import "./chunk-4VP4KH3K.js";
58
+ import "./chunk-VEZEGCGW.js";
59
+ import "./chunk-FQ4SKYE4.js";
60
+ import "./chunk-IKCO5N3L.js";
61
+ import "./chunk-3I7MS7N2.js";
62
+ import "./chunk-IHXBNWMM.js";
63
+ import "./chunk-GEYXPTRF.js";
64
+ import "./chunk-SST6Z5JA.js";
65
+ import "./chunk-FO5ZOVUY.js";
66
+ import "./chunk-R346GLFC.js";
67
+ import "./chunk-4ZG3XFUR.js";
68
+ import "./chunk-FCSXB6T2.js";
69
+ import "./chunk-APJ265NV.js";
70
+ import "./chunk-YXLYO42X.js";
71
+ import {
72
+ clioDataDir
73
+ } from "./chunk-BNAZZHFG.js";
74
+ import "./chunk-6EJMN2Y3.js";
75
+ import "./chunk-WEPFGWHJ.js";
76
+ import "./chunk-ZGVHUX3M.js";
77
+ import "./chunk-G7MUEIGA.js";
78
+ import "./chunk-7CR24IG7.js";
79
+ import "./chunk-IWHMRKLL.js";
80
+ import {
81
+ init_esm_shims
82
+ } from "./chunk-3R73A4XB.js";
83
+
84
+ // src/cli/memory.ts
85
+ init_esm_shims();
86
+ import { readFile, stat } from "node:fs/promises";
87
+ var HELP = `clio-coder memory list
88
+ clio-coder memory propose --from-evidence <evidenceId> [scope options]
89
+ clio-coder memory promote --from-handoff <path> [--entry <id>...] --scope <scope> [scope options]
90
+ clio-coder memory approve <memoryId>
91
+ clio-coder memory reject <memoryId>
92
+ clio-coder memory prune --stale
93
+
94
+ Manage scoped, approved, evidence-linked local memory records.
95
+
96
+ Scope options:
97
+ --scope repo --repository <canonical-absolute-path>
98
+ --scope global --acknowledge-global
99
+ --scope runtime --runtime <source-runtime-id>
100
+ --scope agent --agent <source-agent-id>
101
+
102
+ Omit scope options from propose to preserve evidence-inferred scope. Promotion
103
+ always requires an explicit scope and creates unapproved records for review.
104
+ `;
105
+ function parseMemoryArgs(args) {
106
+ const parsed = { entryIds: [], acknowledgeGlobal: false, stale: false, help: false };
107
+ for (let index = 0; index < args.length; index += 1) {
108
+ const arg = args[index];
109
+ if (arg === void 0) continue;
110
+ if (arg === "--help" || arg === "-h") {
111
+ parsed.help = true;
112
+ continue;
113
+ }
114
+ if (parsed.command === void 0) {
115
+ if (arg === "list" || arg === "propose" || arg === "promote" || arg === "approve" || arg === "reject" || arg === "prune") {
116
+ parsed.command = arg;
117
+ continue;
118
+ }
119
+ throw new Error(`unknown memory command: ${arg}`);
120
+ }
121
+ if (parsed.command === "propose" || parsed.command === "promote") {
122
+ if (arg === "--from-evidence") {
123
+ if (parsed.command !== "propose") throw new Error("--from-evidence is valid only for memory propose");
124
+ const value = args[index + 1];
125
+ if (value === void 0 || value.startsWith("-")) throw new Error("--from-evidence requires an evidence id");
126
+ parsed.evidenceId = value;
127
+ index += 1;
128
+ continue;
129
+ }
130
+ if (arg === "--from-handoff") {
131
+ if (parsed.command !== "promote") throw new Error("--from-handoff is valid only for memory promote");
132
+ const value = requireOptionValue(args, index, "--from-handoff", "a path");
133
+ parsed.handoffPath = value;
134
+ index += 1;
135
+ continue;
136
+ }
137
+ if (arg === "--entry") {
138
+ if (parsed.command !== "promote") throw new Error("--entry is valid only for memory promote");
139
+ parsed.entryIds.push(requireOptionValue(args, index, "--entry", "an entry id"));
140
+ index += 1;
141
+ continue;
142
+ }
143
+ if (arg === "--scope") {
144
+ const value = requireOptionValue(args, index, "--scope", "repo, global, runtime, or agent");
145
+ if (value !== "repo" && value !== "global" && value !== "runtime" && value !== "agent") {
146
+ throw new Error("--scope requires repo, global, runtime, or agent");
147
+ }
148
+ parsed.scope = value;
149
+ index += 1;
150
+ continue;
151
+ }
152
+ if (arg === "--repository") {
153
+ parsed.repositoryPath = requireOptionValue(args, index, "--repository", "a canonical absolute path");
154
+ index += 1;
155
+ continue;
156
+ }
157
+ if (arg === "--acknowledge-global") {
158
+ parsed.acknowledgeGlobal = true;
159
+ continue;
160
+ }
161
+ if (arg === "--runtime") {
162
+ parsed.runtimeId = requireOptionValue(args, index, "--runtime", "a runtime id");
163
+ index += 1;
164
+ continue;
165
+ }
166
+ if (arg === "--agent") {
167
+ parsed.agentId = requireOptionValue(args, index, "--agent", "an agent id");
168
+ index += 1;
169
+ continue;
170
+ }
171
+ throw new Error(`unknown memory ${parsed.command} argument: ${arg}`);
172
+ }
173
+ if (parsed.command === "approve" || parsed.command === "reject") {
174
+ if (parsed.memoryId === void 0 && !arg.startsWith("-")) {
175
+ parsed.memoryId = arg;
176
+ continue;
177
+ }
178
+ throw new Error(`unexpected memory ${parsed.command} argument: ${arg}`);
179
+ }
180
+ if (parsed.command === "prune") {
181
+ if (arg === "--stale") {
182
+ parsed.stale = true;
183
+ continue;
184
+ }
185
+ throw new Error(`unknown memory prune argument: ${arg}`);
186
+ }
187
+ throw new Error(`unexpected memory argument: ${arg}`);
188
+ }
189
+ if (parsed.help) return parsed;
190
+ if (parsed.command === void 0) throw new Error("memory requires list, propose, promote, approve, reject, or prune");
191
+ if (parsed.command === "propose" && parsed.evidenceId === void 0) {
192
+ throw new Error("propose requires --from-evidence <evidenceId>");
193
+ }
194
+ if (parsed.command === "promote" && parsed.handoffPath === void 0) {
195
+ throw new Error("promote requires --from-handoff <path>");
196
+ }
197
+ if ((parsed.command === "approve" || parsed.command === "reject") && parsed.memoryId === void 0) {
198
+ throw new Error(`${parsed.command} requires a memory id`);
199
+ }
200
+ if (parsed.command === "prune" && !parsed.stale) throw new Error("prune requires --stale");
201
+ if (parsed.command === "promote" && parsed.scope === void 0) {
202
+ throw new Error("promote requires --scope <repo|global|runtime|agent>");
203
+ }
204
+ validateScopeArguments(parsed);
205
+ if (parsed.command === "list" && (parsed.evidenceId !== void 0 || parsed.handoffPath !== void 0 || parsed.entryIds.length > 0 || parsed.memoryId !== void 0 || parsed.stale || parsed.scope !== void 0)) {
206
+ throw new Error("list does not accept extra arguments");
207
+ }
208
+ return parsed;
209
+ }
210
+ function requireOptionValue(args, index, option, expected) {
211
+ const value = args[index + 1];
212
+ if (value === void 0 || value.startsWith("-")) throw new Error(`${option} requires ${expected}`);
213
+ return value;
214
+ }
215
+ function validateScopeArguments(parsed) {
216
+ const hasIdentityOption = parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.runtimeId !== void 0 || parsed.agentId !== void 0;
217
+ if (parsed.scope === void 0) {
218
+ if (hasIdentityOption) throw new Error("scope identity options require --scope");
219
+ return;
220
+ }
221
+ if (parsed.scope === "repo") {
222
+ if (parsed.repositoryPath === void 0)
223
+ throw new Error("repo scope requires --repository <canonical-absolute-path>");
224
+ if (parsed.acknowledgeGlobal || parsed.runtimeId !== void 0 || parsed.agentId !== void 0) {
225
+ throw new Error("repo scope accepts only --repository");
226
+ }
227
+ return;
228
+ }
229
+ if (parsed.scope === "global") {
230
+ if (!parsed.acknowledgeGlobal) throw new Error("global scope requires --acknowledge-global");
231
+ if (parsed.repositoryPath !== void 0 || parsed.runtimeId !== void 0 || parsed.agentId !== void 0) {
232
+ throw new Error("global scope accepts only --acknowledge-global");
233
+ }
234
+ return;
235
+ }
236
+ if (parsed.scope === "runtime") {
237
+ if (parsed.runtimeId === void 0) throw new Error("runtime scope requires --runtime <source-runtime-id>");
238
+ if (parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.agentId !== void 0) {
239
+ throw new Error("runtime scope accepts only --runtime");
240
+ }
241
+ return;
242
+ }
243
+ if (parsed.agentId === void 0) throw new Error("agent scope requires --agent <source-agent-id>");
244
+ if (parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.runtimeId !== void 0) {
245
+ throw new Error("agent scope accepts only --agent");
246
+ }
247
+ }
248
+ async function runMemoryCommand(args) {
249
+ let parsed;
250
+ try {
251
+ parsed = parseMemoryArgs(args);
252
+ } catch (error) {
253
+ printError(error instanceof Error ? error.message : String(error));
254
+ process.stderr.write(HELP);
255
+ return 2;
256
+ }
257
+ if (parsed.help) {
258
+ process.stdout.write(HELP);
259
+ return 0;
260
+ }
261
+ const dataDir = clioDataDir();
262
+ try {
263
+ if (parsed.command === "list") {
264
+ renderMemoryList(await loadMemoryRecords(dataDir));
265
+ return 0;
266
+ }
267
+ if (parsed.command === "propose") {
268
+ const evidenceId = parsed.evidenceId;
269
+ if (evidenceId === void 0) {
270
+ printError("propose requires --from-evidence <evidenceId>");
271
+ return 2;
272
+ }
273
+ const result = await proposeMemoryFromEvidence(dataDir, evidenceId, scopeSelection(parsed));
274
+ renderProposal(result.record, result.created);
275
+ return 0;
276
+ }
277
+ if (parsed.command === "promote") {
278
+ const handoffPath = parsed.handoffPath;
279
+ const selection = scopeSelection(parsed);
280
+ if (handoffPath === void 0 || selection === void 0) {
281
+ printError("promote requires a handoff and explicit scope");
282
+ return 2;
283
+ }
284
+ const snapshot = await readReviewedHandoff(handoffPath);
285
+ const entries = selectHandoffEntries(snapshot, parsed.entryIds);
286
+ for (const entry of entries) {
287
+ const result = await proposeMemoryPromotion(
288
+ dataDir,
289
+ {
290
+ kind: "handoff-snapshot",
291
+ sessionId: snapshot.source.sessionId,
292
+ evidenceRefs: snapshot.source.evidenceRefs,
293
+ runtimeIds: snapshot.source.runtimeIds,
294
+ agentIds: snapshot.source.agentIds,
295
+ entry: handoffTaskEntry(entry),
296
+ redaction: {
297
+ replacementCount: snapshot.redaction.replacementCount,
298
+ sourceFields: snapshot.redaction.sourceFields
299
+ }
300
+ },
301
+ selection
302
+ );
303
+ renderProposal(result.record, result.created);
304
+ }
305
+ return 0;
306
+ }
307
+ if (parsed.command === "approve") {
308
+ const memoryId = parsed.memoryId;
309
+ if (memoryId === void 0) {
310
+ printError("approve requires a memory id");
311
+ return 2;
312
+ }
313
+ const record = await approveMemoryRecord(dataDir, memoryId);
314
+ printOk(`approved ${record.id}`);
315
+ return 0;
316
+ }
317
+ if (parsed.command === "reject") {
318
+ const memoryId = parsed.memoryId;
319
+ if (memoryId === void 0) {
320
+ printError("reject requires a memory id");
321
+ return 2;
322
+ }
323
+ const record = await rejectMemoryRecord(dataDir, memoryId);
324
+ printOk(`rejected ${record.id}`);
325
+ return 0;
326
+ }
327
+ if (parsed.command === "prune") {
328
+ const pruned = await pruneStaleMemory(dataDir);
329
+ printOk(`pruned ${pruned.length} stale memory record${pruned.length === 1 ? "" : "s"}`);
330
+ return 0;
331
+ }
332
+ printError("memory requires list, propose, promote, approve, reject, or prune");
333
+ return 2;
334
+ } catch (error) {
335
+ printError(error instanceof Error ? error.message : String(error));
336
+ return 1;
337
+ }
338
+ }
339
+ function scopeSelection(parsed) {
340
+ if (parsed.scope === void 0) return void 0;
341
+ if (parsed.scope === "repo") {
342
+ const repositoryPath = parsed.repositoryPath;
343
+ if (repositoryPath === void 0) throw new Error("repo scope requires --repository");
344
+ const repository = canonicalMemoryRepositoryIdentity(repositoryPath);
345
+ if (repository === null || repository.key !== repositoryPath) {
346
+ throw new Error("--repository must be an existing canonical absolute repository path");
347
+ }
348
+ return { scope: "repo", repository };
349
+ }
350
+ if (parsed.scope === "global") {
351
+ if (!parsed.acknowledgeGlobal) throw new Error("global scope requires --acknowledge-global");
352
+ return { scope: "global", acknowledgeGlobal: true };
353
+ }
354
+ if (parsed.scope === "runtime") {
355
+ if (parsed.runtimeId === void 0) throw new Error("runtime scope requires --runtime");
356
+ return { scope: "runtime", runtime: memoryRuntimeIdentity(parsed.runtimeId) };
357
+ }
358
+ if (parsed.agentId === void 0) throw new Error("agent scope requires --agent");
359
+ return { scope: "agent", agent: memoryAgentIdentity(parsed.agentId) };
360
+ }
361
+ async function readReviewedHandoff(path) {
362
+ const info = await stat(path);
363
+ if (!info.isFile()) throw new Error(`task-memory handoff is not a file: ${path}`);
364
+ if (info.size > 1e6) throw new Error(`task-memory handoff exceeds 1000000 bytes: ${path}`);
365
+ const snapshot = parseTaskMemoryHandoffSnapshot(await readFile(path, "utf8"));
366
+ if (snapshot === null) throw new Error(`task-memory handoff is invalid: ${path}`);
367
+ if (snapshot.version !== 2) {
368
+ throw new Error("task-memory handoff lacks source session and evidence provenance; create a new redacted handoff");
369
+ }
370
+ return snapshot;
371
+ }
372
+ function selectHandoffEntries(snapshot, entryIds) {
373
+ const entries = [
374
+ ...snapshot.knowledge.map((entry) => ({ kind: "knowledge", entry })),
375
+ ...snapshot.procedural.map((entry) => ({ kind: "procedural", entry }))
376
+ ];
377
+ if (entries.length === 0) throw new Error("task-memory handoff contains no promotable entries");
378
+ if (entryIds.length === 0) return entries;
379
+ const requested = new Set(entryIds);
380
+ const selected = entries.filter(({ entry }) => requested.has(entry.id));
381
+ const missing = [...requested].filter((id) => !selected.some(({ entry }) => entry.id === id));
382
+ if (missing.length > 0) throw new Error(`task-memory handoff entry not found: ${missing.join(", ")}`);
383
+ return selected;
384
+ }
385
+ function handoffTaskEntry(selected) {
386
+ const createdAt = selected.entry.createdAt;
387
+ const lastTouchedAt = selected.entry.lastTouchedAt;
388
+ if (createdAt === void 0 || lastTouchedAt === void 0) {
389
+ throw new Error(`task-memory handoff entry lacks timestamps: ${selected.entry.id}`);
390
+ }
391
+ return {
392
+ id: selected.entry.id,
393
+ kind: selected.kind,
394
+ content: selected.entry.content,
395
+ createdAt,
396
+ lastTouchedAt,
397
+ injectionCount: selected.entry.injectionCount
398
+ };
399
+ }
400
+ function renderProposal(record, created) {
401
+ process.stdout.write(`memory: ${record.id}
402
+ `);
403
+ process.stdout.write(`status: ${created ? "proposed" : memoryStatus(record)}
404
+ `);
405
+ process.stdout.write(`scope: ${record.scope}
406
+ `);
407
+ if (record.repository !== void 0) process.stdout.write(`repository: ${record.repository.key}
408
+ `);
409
+ if (record.runtime !== void 0) process.stdout.write(`runtime: ${record.runtime.key}
410
+ `);
411
+ if (record.agent !== void 0) process.stdout.write(`agent: ${record.agent.key}
412
+ `);
413
+ process.stdout.write(`key: ${record.key}
414
+ `);
415
+ process.stdout.write(`evidence: ${record.evidenceRefs.join(", ")}
416
+ `);
417
+ process.stdout.write(`confidence: ${record.confidence.toFixed(2)}
418
+ `);
419
+ process.stdout.write(`lesson: ${record.lesson}
420
+ `);
421
+ if (record.provenance !== void 0) {
422
+ process.stdout.write(`source: ${record.provenance.sourceKind}
423
+ `);
424
+ if (record.provenance.sourceSessionId !== void 0) {
425
+ process.stdout.write(`source-session: ${record.provenance.sourceSessionId}
426
+ `);
427
+ }
428
+ if (record.provenance.sourceEntryId !== void 0) {
429
+ process.stdout.write(`source-entry: ${record.provenance.sourceEntryId}
430
+ `);
431
+ }
432
+ if (record.provenance.redaction !== void 0) {
433
+ process.stdout.write(
434
+ `redaction: ${record.provenance.redaction.replacementCount} replacement${record.provenance.redaction.replacementCount === 1 ? "" : "s"}; fields=${record.provenance.redaction.sourceFields.join(",") || "none"}
435
+ `
436
+ );
437
+ }
438
+ }
439
+ process.stdout.write(`review: clio-coder memory approve ${record.id}
440
+ `);
441
+ }
442
+ function renderMemoryList(records) {
443
+ process.stdout.write(`${records.length} memory record${records.length === 1 ? "" : "s"}
444
+ `);
445
+ if (records.length === 0) return;
446
+ process.stdout.write("\n");
447
+ for (const record of records) {
448
+ process.stdout.write(
449
+ [
450
+ record.id.padEnd(21),
451
+ memoryStatus(record).padEnd(10),
452
+ record.scope.padEnd(13),
453
+ `confidence=${record.confidence.toFixed(2)}`.padEnd(16),
454
+ `evidence=${record.evidenceRefs.join(",")}`
455
+ ].join("")
456
+ );
457
+ process.stdout.write("\n");
458
+ process.stdout.write(` key: ${record.key}
459
+ `);
460
+ process.stdout.write(` lesson: ${record.lesson}
461
+ `);
462
+ }
463
+ }
464
+ export {
465
+ runMemoryCommand
466
+ };
467
+ //# sourceMappingURL=memory-7YKKR6UC.js.map
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
- import "./chunk-K6WL7QZT.js";
2
+ import "./chunk-6XXKFVSN.js";
3
3
  import {
4
4
  ensureClioState
5
- } from "./chunk-VAWWTKDP.js";
5
+ } from "./chunk-KHSFENX2.js";
6
6
  import {
7
7
  ConfigDomainModule,
8
8
  loadDomains
9
- } from "./chunk-KRPY7NTG.js";
9
+ } from "./chunk-R46L2BIR.js";
10
10
  import "./chunk-E25LMLRW.js";
11
11
  import "./chunk-4BPJXDWC.js";
12
12
  import "./chunk-2SFS6XQE.js";
@@ -15,10 +15,10 @@ import "./chunk-CGKSTWHD.js";
15
15
  import "./chunk-XPLRXC72.js";
16
16
  import "./chunk-RD5U66HV.js";
17
17
  import "./chunk-KOHPCX4K.js";
18
- import "./chunk-YCWGATWI.js";
18
+ import "./chunk-24I7BN55.js";
19
19
  import {
20
20
  printError
21
- } from "./chunk-ED4KHGC3.js";
21
+ } from "./chunk-PPAMZ32Z.js";
22
22
  import {
23
23
  source_default
24
24
  } from "./chunk-5TSRNF4G.js";
@@ -26,7 +26,7 @@ import {
26
26
  ProvidersDomainModule,
27
27
  modelCandidatesForStatus,
28
28
  resolveModelCapabilities
29
- } from "./chunk-QWU7ZBO7.js";
29
+ } from "./chunk-DJVECN66.js";
30
30
  import "./chunk-CFGTUFWB.js";
31
31
  import "./chunk-AD2SYQYC.js";
32
32
  import "./chunk-4OC57DA6.js";
@@ -37,7 +37,7 @@ import "./chunk-FQ4SKYE4.js";
37
37
  import "./chunk-IKCO5N3L.js";
38
38
  import "./chunk-3I7MS7N2.js";
39
39
  import "./chunk-IHXBNWMM.js";
40
- import "./chunk-BPGS2WCQ.js";
40
+ import "./chunk-GEYXPTRF.js";
41
41
  import "./chunk-SST6Z5JA.js";
42
42
  import "./chunk-FO5ZOVUY.js";
43
43
  import "./chunk-R346GLFC.js";
@@ -48,9 +48,9 @@ import "./chunk-YXLYO42X.js";
48
48
  import "./chunk-BNAZZHFG.js";
49
49
  import "./chunk-6EJMN2Y3.js";
50
50
  import "./chunk-WEPFGWHJ.js";
51
- import "./chunk-HXG4IURW.js";
51
+ import "./chunk-XE2VEJHX.js";
52
52
  import "./chunk-ZGVHUX3M.js";
53
- import "./chunk-TTNYS3EA.js";
53
+ import "./chunk-G7MUEIGA.js";
54
54
  import "./chunk-IWHMRKLL.js";
55
55
  import {
56
56
  init_esm_shims
@@ -262,4 +262,4 @@ export {
262
262
  modelTableLines,
263
263
  runModelsCommand
264
264
  };
265
- //# sourceMappingURL=models-ZMMLFJNN.js.map
265
+ //# sourceMappingURL=models-ZPOLRU2C.js.map
@@ -3,7 +3,7 @@ import {
3
3
  receiptEvidenceLabels,
4
4
  workerTextLabel,
5
5
  workerTextNonEvidenceNotices
6
- } from "./chunk-BP4OYD6A.js";
6
+ } from "./chunk-RY3LY4J5.js";
7
7
  import {
8
8
  monitorToolSurface
9
9
  } from "./chunk-FJ3H4MN5.js";
@@ -11,27 +11,32 @@ import {
11
11
  COST_NOT_MEASURED,
12
12
  costAggregateForAmount,
13
13
  formatCostAggregate
14
- } from "./chunk-35MKKU5R.js";
14
+ } from "./chunk-K7T3E2SR.js";
15
15
  import "./chunk-HC4CLZ2Y.js";
16
16
  import "./chunk-HFSBBKSQ.js";
17
+ import "./chunk-3BPUFZDL.js";
17
18
  import {
18
19
  UNVERIFIABLE_RECEIPT_VERIFICATION,
19
20
  adaptRunReceiptTrustStatus,
20
21
  inspectRunReceiptTrustStatus,
21
22
  renderAgentLedgerBoard
22
- } from "./chunk-QQL5RT5M.js";
23
- import "./chunk-QQK64KLB.js";
23
+ } from "./chunk-QM3F2GKX.js";
24
+ import "./chunk-CJUB2JJ2.js";
24
25
  import "./chunk-QKMUKYO7.js";
25
- import "./chunk-3JLKSKD7.js";
26
- import "./chunk-34475P3I.js";
26
+ import "./chunk-OH3TOQTB.js";
27
+ import "./chunk-TSHXZTOQ.js";
27
28
  import "./chunk-TXOTCRLG.js";
28
- import "./chunk-G4BMMOKF.js";
29
+ import "./chunk-HVDIIIQW.js";
29
30
  import "./chunk-W6GROXXM.js";
30
31
  import {
32
+ formatBudgetPolicy,
33
+ formatBudgetReasons,
34
+ formatBudgetRequest,
35
+ formatEffectiveBudget,
31
36
  isTerminalRunEnvelope
32
- } from "./chunk-ZYKPLLNQ.js";
33
- import "./chunk-WPQLXFOZ.js";
34
- import "./chunk-7RXG6QRZ.js";
37
+ } from "./chunk-XXQNGV4M.js";
38
+ import "./chunk-43AOLP7E.js";
39
+ import "./chunk-EKY57CSP.js";
35
40
  import "./chunk-22NAGB7X.js";
36
41
  import "./chunk-AOCYTWAV.js";
37
42
  import "./chunk-MV3K5QF2.js";
@@ -41,8 +46,9 @@ import "./chunk-FYYLNIL5.js";
41
46
  import "./chunk-UL3WSD3F.js";
42
47
  import "./chunk-OQE5J4C6.js";
43
48
  import "./chunk-ECH6PKUQ.js";
44
- import "./chunk-BEY543CS.js";
45
- import "./chunk-5M54SPOL.js";
49
+ import "./chunk-GOXNB3AO.js";
50
+ import "./chunk-HWUFFB6L.js";
51
+ import "./chunk-ODFEOB4F.js";
46
52
  import "./chunk-OZNBF4L3.js";
47
53
  import "./chunk-4BJ5BYCE.js";
48
54
  import {
@@ -50,9 +56,9 @@ import {
50
56
  } from "./chunk-6XLNIQDB.js";
51
57
  import "./chunk-5B2AEOW5.js";
52
58
  import "./chunk-CGKSTWHD.js";
53
- import "./chunk-YHZX5GEU.js";
54
- import "./chunk-EKMEHE4H.js";
55
- import "./chunk-QWU7ZBO7.js";
59
+ import "./chunk-XAKHZX5N.js";
60
+ import "./chunk-33YXPOE3.js";
61
+ import "./chunk-DJVECN66.js";
56
62
  import "./chunk-CFGTUFWB.js";
57
63
  import "./chunk-AD2SYQYC.js";
58
64
  import "./chunk-4OC57DA6.js";
@@ -65,7 +71,7 @@ import {
65
71
  import "./chunk-IKCO5N3L.js";
66
72
  import "./chunk-3I7MS7N2.js";
67
73
  import "./chunk-IHXBNWMM.js";
68
- import "./chunk-BPGS2WCQ.js";
74
+ import "./chunk-GEYXPTRF.js";
69
75
  import "./chunk-SST6Z5JA.js";
70
76
  import "./chunk-FO5ZOVUY.js";
71
77
  import "./chunk-R346GLFC.js";
@@ -77,7 +83,7 @@ import "./chunk-BNAZZHFG.js";
77
83
  import "./chunk-6EJMN2Y3.js";
78
84
  import "./chunk-WEPFGWHJ.js";
79
85
  import "./chunk-ZGVHUX3M.js";
80
- import "./chunk-TTNYS3EA.js";
86
+ import "./chunk-G7MUEIGA.js";
81
87
  import "./chunk-7CR24IG7.js";
82
88
  import "./chunk-IWHMRKLL.js";
83
89
  import {
@@ -149,6 +155,14 @@ function runStatus(deps, runId) {
149
155
  `started=${run.startedAt} ended=${run.endedAt ?? "n/a"} exit=${run.exitCode ?? "n/a"}`,
150
156
  `tokens=${run.tokenCount} cost=${formatCostAggregate(costAggregateForAmount(run.costUsd, run.costProvenance)) ?? COST_NOT_MEASURED} receipt=${run.receiptPath ?? "n/a"}`
151
157
  ];
158
+ if (run.budget !== void 0) {
159
+ lines.push(
160
+ `recipe policy: ${formatBudgetPolicy(run.budget)}`,
161
+ `requested envelope: ${formatBudgetRequest(run.budget)}`,
162
+ `effective envelope: ${formatEffectiveBudget(run.budget)}`,
163
+ `clamp or escalation reason: ${formatBudgetReasons(run.budget)}`
164
+ );
165
+ }
152
166
  if (live) {
153
167
  lines.push(
154
168
  `live: phase=${live.outcomePhase} heartbeat=${live.heartbeat} elapsed=${Math.round(live.elapsedMs / 1e3)}s tokens=${live.tokens.total}`
@@ -173,6 +187,7 @@ function runStatus(deps, runId) {
173
187
  tokenCount: run.tokenCount,
174
188
  costUsd: run.costUsd,
175
189
  costProvenance: run.costProvenance ?? "unknown",
190
+ budget: run.budget ?? null,
176
191
  receiptPath: run.receiptPath,
177
192
  running: live !== null
178
193
  }
@@ -670,4 +685,4 @@ function createMonitorTool(deps) {
670
685
  export {
671
686
  createMonitorTool
672
687
  };
673
- //# sourceMappingURL=monitor-2F3T5KHP.js.map
688
+ //# sourceMappingURL=monitor-US5F5YGZ.js.map