@wrongstack/core 0.313.1 → 0.316.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/chronicle/index.js +31 -31
  2. package/dist/chronicle/legacy-journal-import.d.ts +0 -6
  3. package/dist/chronicle/metrics-ingest.d.ts +14 -0
  4. package/dist/chronicle/metrics-schema.d.ts +10 -1
  5. package/dist/chronicle/metrics-store.d.ts +20 -2
  6. package/dist/chronicle/project-server.js +39 -31
  7. package/dist/chronicle/sink.d.ts +13 -0
  8. package/dist/chronicle/sqlite-journal.d.ts +20 -2
  9. package/dist/{chunk-WOEZV3Q4.js → chunk-25LSLC3G.js} +2 -1
  10. package/dist/{chunk-AI4LLQ2U.js → chunk-27QIURLN.js} +229 -12
  11. package/dist/{chunk-I45KAW2N.js → chunk-3AGWVSS7.js} +38 -450
  12. package/dist/chunk-3BDV7RL3.js +211 -0
  13. package/dist/{chunk-NFAYHPRH.js → chunk-3ECENVHL.js} +10 -8
  14. package/dist/{chunk-FW5LDDMJ.js → chunk-45WI72ZB.js} +1576 -1156
  15. package/dist/{chunk-AT4V4XGI.js → chunk-4BMVPOHO.js} +539 -313
  16. package/dist/{chunk-YBUJCZ57.js → chunk-4I7HGVVA.js} +17 -5
  17. package/dist/{chunk-JVGPR3TS.js → chunk-4LCZVJVF.js} +7 -55
  18. package/dist/{chunk-4ZHTKJHM.js → chunk-4SJNS7OB.js} +36 -2
  19. package/dist/{chunk-AD7ZFZCS.js → chunk-5BMIE7QG.js} +3 -3
  20. package/dist/{chunk-IQ35HMQL.js → chunk-5YPSXQXM.js} +71 -24
  21. package/dist/chunk-6FHWXLPT.js +10 -0
  22. package/dist/{chunk-FIV4IJL7.js → chunk-6H5GEOET.js} +163 -20
  23. package/dist/{chunk-VB3H5WWB.js → chunk-6NWEVFEL.js} +2 -2
  24. package/dist/{chunk-E6I5RXVK.js → chunk-AYW5YINX.js} +2 -2
  25. package/dist/{chunk-DEIQMBD2.js → chunk-B7F4WVP4.js} +2 -2
  26. package/dist/{chunk-XQ2XGIBF.js → chunk-BPBKKBUK.js} +6 -7
  27. package/dist/{chunk-K4YUNKU7.js → chunk-BYD345OX.js} +2 -2
  28. package/dist/{chunk-LZDDLNCZ.js → chunk-C27KDLOX.js} +4 -4
  29. package/dist/{chunk-6AKOTGLM.js → chunk-CU546ESW.js} +7 -7
  30. package/dist/{chunk-ZZ4V3WIZ.js → chunk-DLHHXUAM.js} +10 -1
  31. package/dist/{chunk-BAKVJLEV.js → chunk-DOTHQSJ2.js} +28 -16
  32. package/dist/{chunk-KBZGE6LN.js → chunk-DYLPMV4Q.js} +4 -3
  33. package/dist/{chunk-52RTVH4M.js → chunk-F3JWNST7.js} +2 -2
  34. package/dist/{chunk-WEBMSQP2.js → chunk-FC2ZGRF3.js} +21 -4
  35. package/dist/{chunk-FHAMQS7Q.js → chunk-FCBTO76Z.js} +76 -146
  36. package/dist/{chunk-4LJJYBAU.js → chunk-FHZVFYSL.js} +9 -1
  37. package/dist/{chunk-W4A6QA3D.js → chunk-FWNLEZYG.js} +4 -3
  38. package/dist/{chunk-OJZEX73F.js → chunk-GDQ7CZRQ.js} +5 -1
  39. package/dist/{chunk-QVOVMXJR.js → chunk-GJJGJB2R.js} +32 -9
  40. package/dist/{chunk-4XV6IR37.js → chunk-HI3JGZR2.js} +7 -6
  41. package/dist/{chunk-FSWCWSTS.js → chunk-HMLIGAU7.js} +26 -26
  42. package/dist/{chunk-PFXFQQRT.js → chunk-HXKZ7OBQ.js} +7 -43
  43. package/dist/{chunk-2FQL4PDC.js → chunk-I7DALG7J.js} +5 -5
  44. package/dist/{chunk-GM54GJBU.js → chunk-IRUTEHCE.js} +3 -3
  45. package/dist/{chunk-TYW2GI5I.js → chunk-J2WRWR37.js} +40 -13
  46. package/dist/{chunk-ZEHUCJHY.js → chunk-JFPJ6LLQ.js} +2 -2
  47. package/dist/chunk-JMULFFLN.js +9 -0
  48. package/dist/{chunk-RD6DEE36.js → chunk-JO4MGB6Z.js} +94 -8
  49. package/dist/{chunk-5DSMEVA4.js → chunk-K6BXGITA.js} +7 -7
  50. package/dist/{chunk-O74MJHXU.js → chunk-KZMSZV32.js} +2 -2
  51. package/dist/{chunk-GFJOMSHG.js → chunk-LA7CLDRW.js} +6 -2
  52. package/dist/{chunk-M2WF6AXG.js → chunk-LSMMOS2Z.js} +7 -3
  53. package/dist/{chunk-ASX6AW36.js → chunk-LXWCMQNJ.js} +3 -3
  54. package/dist/{chunk-WZO23AWO.js → chunk-M27LIEKV.js} +72 -22
  55. package/dist/{chunk-JTHKOYWU.js → chunk-MJPHJRAL.js} +15 -15
  56. package/dist/{chunk-G5AAKEEZ.js → chunk-MTL4O5YR.js} +5 -5
  57. package/dist/chunk-NHJ75HXY.js +1 -0
  58. package/dist/{chunk-ZYU2YOJ6.js → chunk-NIOAGFPB.js} +29 -15
  59. package/dist/{chunk-Y2GE5TSI.js → chunk-NS52ISWS.js} +2 -2
  60. package/dist/{chunk-UIWONWVG.js → chunk-NSOFPKGT.js} +541 -148
  61. package/dist/{chunk-RCQYT2I4.js → chunk-NVIZG63R.js} +2 -2
  62. package/dist/{chunk-EPC3GZD4.js → chunk-OOYZPOXM.js} +2 -2
  63. package/dist/{chunk-7ZHZE5EO.js → chunk-OSGLYW5J.js} +2 -2
  64. package/dist/{chunk-CE4ZOCOI.js → chunk-PFCMSSUF.js} +9 -9
  65. package/dist/{chunk-GFXZTHNI.js → chunk-PGRVXIMY.js} +5 -5
  66. package/dist/{chunk-JJPMWPB6.js → chunk-PISBFBJN.js} +6 -6
  67. package/dist/chunk-POOOIWE5.js +9 -0
  68. package/dist/{chunk-5RP3QTRL.js → chunk-PQNS3U7Z.js} +20 -3
  69. package/dist/{chunk-3E244UDA.js → chunk-QSTSJOCK.js} +52 -6
  70. package/dist/{chunk-YUPMXOGP.js → chunk-RFQMOKWK.js} +3 -3
  71. package/dist/chunk-RTOTNK3P.js +484 -0
  72. package/dist/{chunk-SN2DQRL6.js → chunk-RXKSDUAU.js} +7 -7
  73. package/dist/{chunk-T3KGZBU5.js → chunk-S45JPKQN.js} +189 -43
  74. package/dist/{chunk-YNCVSFGF.js → chunk-SAFHACFA.js} +4 -1
  75. package/dist/{chunk-KI4L2DUL.js → chunk-TCCHINEF.js} +114 -19
  76. package/dist/{chunk-AWNQ6ED6.js → chunk-THEGTRAG.js} +7 -2
  77. package/dist/{chunk-2KKODIQU.js → chunk-TR4LQE7L.js} +15 -15
  78. package/dist/{chunk-GPQ3NJPR.js → chunk-TWJMGXCI.js} +3 -3
  79. package/dist/{chunk-H72H4XDU.js → chunk-U45AXT5D.js} +9 -9
  80. package/dist/{chunk-62V2AFVG.js → chunk-U4FWBSO3.js} +160 -73
  81. package/dist/{chunk-A455ATZB.js → chunk-UBGDX6FI.js} +8 -1
  82. package/dist/chunk-UJILKYES.js +75 -0
  83. package/dist/{chunk-KSJ5UTP7.js → chunk-ULMAQV3T.js} +84 -4
  84. package/dist/{chunk-CB2HFKTP.js → chunk-VVBP6KGT.js} +1 -1
  85. package/dist/{chunk-RPOA7IAE.js → chunk-W5VITDM2.js} +43 -25
  86. package/dist/{chunk-QRTG4XTI.js → chunk-WAHQVNWT.js} +7 -1
  87. package/dist/{chunk-SQP64RCS.js → chunk-WGGYRBXH.js} +3019 -2976
  88. package/dist/{chunk-K3G6JBUC.js → chunk-WLYKU45P.js} +679 -141
  89. package/dist/chunk-WP7BVANJ.js +53 -0
  90. package/dist/{chunk-GAZEWQEZ.js → chunk-XF4VUMKW.js} +2 -2
  91. package/dist/{chunk-PAAWLLZX.js → chunk-Y5YXDM7D.js} +2 -2
  92. package/dist/{chunk-65RDIOR2.js → chunk-YOPAUVU4.js} +162 -44
  93. package/dist/{chunk-FFSX2QDQ.js → chunk-YPT4A46F.js} +3 -3
  94. package/dist/chunk-YWXT3JNM.js +425 -0
  95. package/dist/{chunk-EFEHDQGY.js → chunk-ZHZ2Y2DH.js} +64 -10
  96. package/dist/{chunk-CQQL4ZOQ.js → chunk-ZT7JNIGX.js} +4 -3
  97. package/dist/coordination/agent-monitor.d.ts +9 -1
  98. package/dist/coordination/agent-subagent-runner.d.ts +1 -1
  99. package/dist/coordination/agents/agent-prompts.d.ts +8 -0
  100. package/dist/coordination/agents/index.d.ts +33 -1
  101. package/dist/coordination/agents/index.js +52 -22
  102. package/dist/coordination/agents/phase3-wave1-platform.d.ts +1 -3
  103. package/dist/coordination/agents/phase3-wave2-meta.d.ts +1 -3
  104. package/dist/coordination/agents/phase8-wave3-products.d.ts +1 -3
  105. package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts +1 -3
  106. package/dist/coordination/agents/project-agent-identity.d.ts +11 -11
  107. package/dist/coordination/agents/types.d.ts +13 -2
  108. package/dist/coordination/brain-monitor.d.ts +30 -7
  109. package/dist/coordination/collab-debug.d.ts +1 -1
  110. package/dist/coordination/collab-pause.d.ts +1 -1
  111. package/dist/coordination/delegate-tool.d.ts +7 -5
  112. package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -0
  113. package/dist/coordination/director-options.d.ts +7 -0
  114. package/dist/coordination/director-spawn-model.d.ts +17 -0
  115. package/dist/coordination/director-tools.d.ts +2 -2
  116. package/dist/coordination/director.d.ts +12 -0
  117. package/dist/coordination/dispatcher.d.ts +8 -0
  118. package/dist/coordination/fleet-bus.d.ts +35 -4
  119. package/dist/coordination/fleet-supervisor.d.ts +10 -2
  120. package/dist/coordination/fleet.d.ts +16 -7
  121. package/dist/coordination/index.d.ts +4 -0
  122. package/dist/coordination/index.js +86 -49
  123. package/dist/coordination/kanban-dispatch-port.d.ts +2 -2
  124. package/dist/coordination/mailbox-http-router.d.ts +4 -3
  125. package/dist/coordination/mailbox-http-validation.d.ts +1 -1
  126. package/dist/coordination/mailbox-project-server.js +15 -15
  127. package/dist/coordination/mailbox-types.d.ts +24 -6
  128. package/dist/coordination/model-tier-leader.d.ts +122 -0
  129. package/dist/coordination/model-tier.d.ts +122 -0
  130. package/dist/coordination/multi-agent-coordinator.d.ts +24 -0
  131. package/dist/coordination/origin-session.d.ts +16 -0
  132. package/dist/coordination/provider-status-tracker.d.ts +37 -5
  133. package/dist/coordination/session-note-hub.d.ts +44 -0
  134. package/dist/coordination/session-note-tool.d.ts +10 -0
  135. package/dist/core/agent.d.ts +1 -1
  136. package/dist/core/context.d.ts +22 -3
  137. package/dist/core/index.d.ts +2 -0
  138. package/dist/core/index.js +130 -38
  139. package/dist/core/request-conversation-binding.d.ts +37 -0
  140. package/dist/core/session-notes.d.ts +25 -0
  141. package/dist/core/system-prompt-builder.d.ts +11 -2
  142. package/dist/core/system-prompt-variants.d.ts +78 -0
  143. package/dist/design/index.js +3 -3
  144. package/dist/execution/auto-compaction-middleware.d.ts +11 -0
  145. package/dist/execution/autonomy-brain.d.ts +2 -1
  146. package/dist/execution/autonomy-prompt-contributor.d.ts +7 -2
  147. package/dist/execution/compaction-core.d.ts +4 -4
  148. package/dist/execution/eternal-autonomy.d.ts +1 -1
  149. package/dist/execution/index.js +138 -129
  150. package/dist/execution/model-runtime.d.ts +0 -7
  151. package/dist/execution/parallel-eternal-engine.d.ts +7 -7
  152. package/dist/extension/index.js +3 -3
  153. package/dist/goal/index.js +6 -6
  154. package/dist/hooks/index.js +3 -3
  155. package/dist/hq/index.js +14 -12
  156. package/dist/hq/persistence/event-log.d.ts +0 -1
  157. package/dist/hq/persistence.d.ts +4 -4
  158. package/dist/hq/publisher.d.ts +2 -0
  159. package/dist/index.d.ts +14 -11
  160. package/dist/index.js +728 -635
  161. package/dist/infrastructure/index.d.ts +4 -4
  162. package/dist/infrastructure/index.js +281 -260
  163. package/dist/infrastructure/token-counter.d.ts +9 -0
  164. package/dist/kernel/events/agent-events.d.ts +77 -3
  165. package/dist/kernel/events/brain-events.d.ts +12 -0
  166. package/dist/kernel/events/provider-events.d.ts +7 -1
  167. package/dist/kernel/events/session-events.d.ts +14 -0
  168. package/dist/kernel/events/tool-events.d.ts +13 -0
  169. package/dist/kernel/index.js +4 -4
  170. package/dist/mailbox-attach.d.ts +1 -1
  171. package/dist/models/index.js +10 -9
  172. package/dist/observability/event-bridge.d.ts +25 -5
  173. package/dist/observability/index.d.ts +9 -8
  174. package/dist/observability/index.js +459 -351
  175. package/dist/observability/tool-usage-source.d.ts +65 -0
  176. package/dist/plugin/index.d.ts +5 -0
  177. package/dist/plugin/index.js +66 -50
  178. package/dist/plugins/auto-review-plugin.d.ts +3 -2
  179. package/dist/plugins/review-finding-commands.d.ts +0 -8
  180. package/dist/{review-finding-store-DKAV3AS6.js → plugins/review-finding-store.js} +7 -6
  181. package/dist/plugins/review-finding-types.js +19 -0
  182. package/dist/plugins/review-report-integration.js +21 -0
  183. package/dist/{review-report-store-OWY3EC3N.js → plugins/review-report-store.js} +7 -6
  184. package/dist/plugins/review-report-types.js +13 -0
  185. package/dist/prompts/index.js +5 -5
  186. package/dist/registry/index.js +3 -3
  187. package/dist/registry/tool-registry.d.ts +59 -9
  188. package/dist/{registry-R23UBE7H.js → registry-7N4O3E7W.js} +5 -5
  189. package/dist/security/capabilities.d.ts +6 -0
  190. package/dist/security/file-permissions.d.ts +1 -1
  191. package/dist/security/index.js +47 -33
  192. package/dist/security/permission-policy.d.ts +12 -1
  193. package/dist/security/secret-scrubber.d.ts +15 -0
  194. package/dist/session-catalog/index.d.ts +1 -0
  195. package/dist/session-catalog/index.js +19 -14
  196. package/dist/session-catalog/project-server.js +30 -13
  197. package/dist/session-catalog/protocol.d.ts +32 -1
  198. package/dist/session-catalog/registry.d.ts +17 -1
  199. package/dist/session-catalog/session-agents.d.ts +56 -0
  200. package/dist/session-catalog/store-rebuild.d.ts +14 -0
  201. package/dist/session-catalog/store-schema.d.ts +26 -0
  202. package/dist/session-catalog/store.d.ts +27 -1
  203. package/dist/session-note-attach.d.ts +9 -0
  204. package/dist/skills/index.js +5 -5
  205. package/dist/statusline/index.d.ts +43 -0
  206. package/dist/statusline/index.js +102 -0
  207. package/dist/storage/board-store-port.d.ts +2 -2
  208. package/dist/storage/config-loader/in-project-policy.d.ts +29 -0
  209. package/dist/storage/config-loader.d.ts +3 -2
  210. package/dist/storage/file-session-writer.d.ts +4 -2
  211. package/dist/storage/goal-coordination.d.ts +6 -1
  212. package/dist/storage/goal-kanban.d.ts +4 -1
  213. package/dist/storage/index.d.ts +12 -4
  214. package/dist/storage/index.js +76 -61
  215. package/dist/storage/input-history-store.d.ts +2 -4
  216. package/dist/storage/memory-curator.d.ts +133 -0
  217. package/dist/storage/session-agent-attribution.d.ts +39 -0
  218. package/dist/storage/session-doctor.d.ts +109 -0
  219. package/dist/storage/session-event-bridge.d.ts +5 -7
  220. package/dist/storage/session-outcome.d.ts +42 -0
  221. package/dist/storage/session-recovery.d.ts +55 -0
  222. package/dist/storage/session-store/load-session-data.d.ts +11 -0
  223. package/dist/storage/session-store/prune-helpers.d.ts +1 -1
  224. package/dist/storage/session-store/resume-session.d.ts +0 -2
  225. package/dist/storage/session-store/types.d.ts +8 -0
  226. package/dist/storage/session-store.d.ts +3 -3
  227. package/dist/storage/session-summary-tracker.d.ts +8 -1
  228. package/dist/storage/session-write-buffer.d.ts +18 -0
  229. package/dist/storage/session-writer-truncate.d.ts +2 -0
  230. package/dist/tasking/index.js +2 -2
  231. package/dist/tools/fallback-manage-tools.d.ts +6 -4
  232. package/dist/tools/index.js +21 -21
  233. package/dist/tools/model-tier-set-tool.d.ts +66 -0
  234. package/dist/types/agent-bridge.d.ts +2 -1
  235. package/dist/types/config/mcp-features.d.ts +7 -0
  236. package/dist/types/config/model-tiers.d.ts +148 -0
  237. package/dist/types/config/root.d.ts +9 -0
  238. package/dist/types/config/tools.d.ts +73 -0
  239. package/dist/types/config.d.ts +1 -0
  240. package/dist/types/context.d.ts +2 -0
  241. package/dist/types/default-config.d.ts +6 -0
  242. package/dist/types/errors.d.ts +2 -1
  243. package/dist/types/index.d.ts +11 -9
  244. package/dist/types/index.js +25 -15
  245. package/dist/types/multi-agent.d.ts +43 -0
  246. package/dist/types/plugin.d.ts +1 -1
  247. package/dist/types/provider.d.ts +15 -0
  248. package/dist/types/runtime-capability-manifest.d.ts +1 -1
  249. package/dist/types/secret-scrubber.d.ts +15 -0
  250. package/dist/types/session-markers.d.ts +37 -10
  251. package/dist/types/session-markers.js +1 -1
  252. package/dist/types/session-timeline.d.ts +197 -0
  253. package/dist/types/session-timeline.js +12 -0
  254. package/dist/types/session.d.ts +172 -11
  255. package/dist/types/system-prompt.d.ts +27 -0
  256. package/dist/utils/config-backup.d.ts +9 -1
  257. package/dist/utils/heap-watchdog.js +2 -2
  258. package/dist/utils/index.js +50 -48
  259. package/dist/utils/message-invariants.d.ts +4 -1
  260. package/dist/utils/regex-guard.d.ts +1 -1
  261. package/dist/utils/socket-path.d.ts +1 -1
  262. package/dist/utils/token-estimate.d.ts +6 -2
  263. package/dist/utils/wstack-paths.d.ts +2 -0
  264. package/dist/wiring/proxy-rewrite.d.ts +28 -0
  265. package/dist/wiring/proxy-rewrite.js +7 -1
  266. package/dist/worktree/index.js +2 -2
  267. package/instructions/agents/explore-companion.md +45 -18
  268. package/instructions/agents/memory-curator.md +34 -22
  269. package/instructions/coordination/director-preamble.md +12 -7
  270. package/instructions/coordination/subagent-baseline.md +26 -5
  271. package/instructions/leader-after-task.md +4 -1
  272. package/instructions/llm/chimera-review.md +30 -9
  273. package/instructions/llm/memory-curator.md +31 -0
  274. package/instructions/sections/tool/delegation-compact.md +2 -0
  275. package/instructions/sections/tool/delegation-full.md +5 -1
  276. package/instructions/sections/tool/mailbox-compact.md +5 -1
  277. package/instructions/sections/tool/mailbox-full.md +3 -0
  278. package/instructions/sections/tool/session-note-compact.md +3 -0
  279. package/instructions/sections/tool/session-note-full.md +15 -0
  280. package/instructions/system-lite.md +9 -4
  281. package/instructions/system-pro.md +66 -143
  282. package/instructions/system.md +73 -175
  283. package/package.json +32 -4
  284. package/dist/chunk-2BUUIMQB.js +0 -225
  285. package/dist/chunk-FAYRX2AD.js +0 -13
  286. package/dist/chunk-H5E77KUJ.js +0 -15
  287. package/dist/chunk-M7BS2K6U.js +0 -1
  288. package/dist/coordination/agents.d.ts +0 -8
  289. package/dist/coordination/transport.d.ts +0 -2
  290. package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +0 -28
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Hybrid stats source for the auto-thinning pipeline. The Chronicle rollup
3
+ * (`tool_daily`) is the cross-session source of truth; the in-process bridge
4
+ * Map fills the gap when Chronicle is unavailable (no node:sqlite at runtime)
5
+ * or hasn't been refreshed yet. The source returns a unified
6
+ * `UnderusedToolCandidate[]` so the policy layer never has to branch on
7
+ * which backend answered.
8
+ *
9
+ * The resolver prefers Chronicle whenever it has at least one row in the
10
+ * requested window — even when the in-process Map also has data, because the
11
+ * cross-session history is what the user actually wants to thin against.
12
+ */
13
+ import type { ChronicleMetricsStore } from '../chronicle/metrics-store.js';
14
+ import type { ToolUsageSnapshot } from './event-bridge.js';
15
+ export interface UnderusedToolCandidate {
16
+ /** Stable tool name. For MCP names, this is the full `mcp__server__tool` form. */
17
+ name: string;
18
+ invocations: number;
19
+ failures: number;
20
+ durationMsTotal: number;
21
+ /** Epoch ms; null when the tool has never been observed in the source's window. */
22
+ lastInvokedAt: number | null;
23
+ /** Calendar days since `lastInvokedAt`; null when the tool was never observed. */
24
+ daysSinceLastUse: number | null;
25
+ /** Which backend produced the row — useful for the slash command's "source" badge. */
26
+ source: 'chronicle' | 'in-process';
27
+ }
28
+ export interface UnderusedQueryOptions {
29
+ /** Calendar days of inactivity. Tools not invoked in this window are candidates. */
30
+ idleDays: number;
31
+ /** Tools with `invocations <= minInvocations` in the window are candidates. */
32
+ minInvocations: number;
33
+ /** Inclusive lower bound on the Chronicle day range (YYYY-MM-DD). */
34
+ fromDay?: string;
35
+ /** Inclusive upper bound on the Chronicle day range (YYYY-MM-DD). */
36
+ toDay?: string;
37
+ /** Cap on the returned candidate set. Default 500. */
38
+ limit?: number;
39
+ }
40
+ export interface ToolUsageSource {
41
+ kind: 'chronicle' | 'in-process';
42
+ candidates(opts: UnderusedQueryOptions): Promise<UnderusedToolCandidate[]>;
43
+ /** Force Chronicle to fold any new journal bytes before answering. */
44
+ refresh?(): Promise<void>;
45
+ }
46
+ export interface CreateToolUsageSourceDeps {
47
+ chronicle?: ChronicleMetricsStore | undefined;
48
+ bridge?: ToolUsageSnapshot | undefined;
49
+ /**
50
+ * Wall-clock anchor for "days since last use". Defaults to `Date.now()`. Tests
51
+ * pass a fixed value to make the boundary deterministic.
52
+ */
53
+ now?: () => number;
54
+ }
55
+ export declare function createToolUsageSource(deps: CreateToolUsageSourceDeps): ToolUsageSource;
56
+ /**
57
+ * Apply the auto-thinning policy to a candidate set: keep only tools that
58
+ * - have been seen (or never seen but the source is in-process),
59
+ * - sit at or below `minInvocations` in the window, AND
60
+ * - have not been invoked in the last `idleDays` days.
61
+ *
62
+ * Pure function so the policy is testable without I/O.
63
+ */
64
+ export declare function filterUnderused(candidates: readonly UnderusedToolCandidate[], opts: UnderusedQueryOptions, now?: number): UnderusedToolCandidate[];
65
+ //# sourceMappingURL=tool-usage-source.d.ts.map
@@ -13,6 +13,11 @@ export { type ParsedReviewReport, parseChimeraReviewReport, } from '../plugins/r
13
13
  export { verifyFindingsAgainstDisk, type VerifyFindingsOptions, } from '../plugins/review-finding-verification.js';
14
14
  export { persistReviewReport, type ReportIntegrationResult, updateReviewReportEvidence, } from '../plugins/review-report-integration.js';
15
15
  export { maybeCompactReviewStores, type ReviewStoreMaintenanceResult, } from '../plugins/review-store-maintenance.js';
16
+ export { FINDING_STORE_FILE, JsonlFindingStore, resolveFindingStorePath, type FindingStore, type UpsertContext, type UpsertResult, type ListOptions as FindingListOptions, } from '../plugins/review-finding-store.js';
17
+ export { REPORT_STORE_FILE, JsonlReportStore, resolveReportStorePath, type ReportStore, type PersistReportInput, type ListReportsOptions, } from '../plugins/review-report-store.js';
18
+ export { syncReportCompletion, syncReportReopen, type ReportSyncResult, type ReportReopenResult, } from '../plugins/review-report-integration.js';
19
+ export type { ChimeraFinding, ChimeraFindingLocation, ChimeraFindingOrigin, ChimeraFindingResolution, FindingCategory, FindingConfidence, FindingEventType, FindingLifecycleEvent, FindingSeverity, FindingSource, FindingStatus, FindingVerification, FindingVerificationStatus, ResolutionOutcome, } from '../plugins/review-finding-types.js';
20
+ export type { ReportActorKind, ReportEventType, ReportLifecycleStatus, ReviewReport, ReviewReportCounts, ReviewReportEvent, ReviewReportFile, } from '../plugins/review-report-types.js';
16
21
  export { createSkillsPlugin } from '../plugins/skills-plugin.js';
17
22
  export { createSyncPlugin } from '../plugins/sync-plugin.js';
18
23
  export { createCloudConfigSyncPlugin } from '../plugins/cloud-config-sync-plugin.js';
@@ -3,7 +3,6 @@ import {
3
3
  DefaultPluginAPI,
4
4
  KERNEL_API_VERSION,
5
5
  buildReviewerModelPool,
6
- classifyChimeraReviewSource,
7
6
  createAutoReviewPlugin,
8
7
  createChimeraPlugin,
9
8
  createCloudConfigSyncPlugin,
@@ -12,23 +11,15 @@ import {
12
11
  createSyncPlugin,
13
12
  definePlugin,
14
13
  emitReviewIfChanged,
15
- integrateFindings,
16
14
  loadPlugins,
17
- parseChimeraReviewReport,
18
15
  parseReviewSeverity,
19
- persistReviewReport,
20
16
  recordCompletedReview,
21
17
  recordStartedReview,
22
18
  selectRoundRobinReviewerAssignment,
23
- unloadPlugins,
24
- updateReviewReportEvidence
25
- } from "../chunk-I45KAW2N.js";
26
- import {
27
- JsonlFindingStore,
28
- resolveFindingStorePath
29
- } from "../chunk-JVGPR3TS.js";
30
- import "../chunk-SN2DQRL6.js";
31
- import "../chunk-QVOVMXJR.js";
19
+ unloadPlugins
20
+ } from "../chunk-3AGWVSS7.js";
21
+ import "../chunk-RXKSDUAU.js";
22
+ import "../chunk-GJJGJB2R.js";
32
23
  import "../chunk-YY6APYUM.js";
33
24
  import {
34
25
  diffPluginConfig,
@@ -39,63 +30,80 @@ import {
39
30
  resolvePluginManifestConfig,
40
31
  validatePluginConfigMetadata
41
32
  } from "../chunk-3XPVB7BA.js";
42
- import "../chunk-ASX6AW36.js";
43
- import "../chunk-AT4V4XGI.js";
44
- import "../chunk-GAZEWQEZ.js";
45
- import "../chunk-JVKB2TBL.js";
46
- import "../chunk-GFXZTHNI.js";
33
+ import "../chunk-LXWCMQNJ.js";
34
+ import "../chunk-4BMVPOHO.js";
47
35
  import {
48
- JsonlReportStore,
49
- resolveReportStorePath
50
- } from "../chunk-PFXFQQRT.js";
51
- import "../chunk-G5AAKEEZ.js";
52
- import "../chunk-WQQON3SV.js";
53
- import "../chunk-H5E77KUJ.js";
54
- import "../chunk-RJIZEJ42.js";
55
- import "../chunk-KDQJCT2J.js";
56
- import "../chunk-TYW2GI5I.js";
36
+ classifyChimeraReviewSource,
37
+ integrateFindings,
38
+ parseChimeraReviewReport,
39
+ persistReviewReport,
40
+ syncReportCompletion,
41
+ syncReportReopen,
42
+ updateReviewReportEvidence
43
+ } from "../chunk-YWXT3JNM.js";
44
+ import {
45
+ FINDING_STORE_FILE,
46
+ JsonlFindingStore,
47
+ resolveFindingStorePath
48
+ } from "../chunk-4LCZVJVF.js";
49
+ import "../chunk-UJILKYES.js";
50
+ import "../chunk-XF4VUMKW.js";
51
+ import "../chunk-JVKB2TBL.js";
52
+ import "../chunk-PGRVXIMY.js";
53
+ import "../chunk-J2WRWR37.js";
57
54
  import "../chunk-LHOA5DWA.js";
58
- import "../chunk-GFJOMSHG.js";
59
- import "../chunk-QRTG4XTI.js";
55
+ import "../chunk-LA7CLDRW.js";
56
+ import "../chunk-WAHQVNWT.js";
60
57
  import "../chunk-EODDVJBM.js";
61
- import "../chunk-CQQL4ZOQ.js";
62
- import "../chunk-RPOA7IAE.js";
63
- import "../chunk-FFSX2QDQ.js";
64
- import "../chunk-DEIQMBD2.js";
65
- import "../chunk-FNXVT7HF.js";
58
+ import "../chunk-ZT7JNIGX.js";
59
+ import "../chunk-W5VITDM2.js";
60
+ import "../chunk-YPT4A46F.js";
61
+ import "../chunk-B7F4WVP4.js";
66
62
  import "../chunk-WQTOVMGV.js";
67
- import "../chunk-AD7ZFZCS.js";
68
- import "../chunk-KBZGE6LN.js";
63
+ import "../chunk-FNXVT7HF.js";
64
+ import "../chunk-5BMIE7QG.js";
65
+ import "../chunk-DYLPMV4Q.js";
69
66
  import "../chunk-5S437PRC.js";
70
- import "../chunk-WZO23AWO.js";
67
+ import "../chunk-MTL4O5YR.js";
68
+ import {
69
+ JsonlReportStore,
70
+ REPORT_STORE_FILE,
71
+ resolveReportStorePath
72
+ } from "../chunk-HXKZ7OBQ.js";
73
+ import "../chunk-WP7BVANJ.js";
74
+ import "../chunk-WQQON3SV.js";
75
+ import "../chunk-6FHWXLPT.js";
76
+ import "../chunk-M27LIEKV.js";
71
77
  import "../chunk-XEBHSJLT.js";
72
- import "../chunk-VB3H5WWB.js";
73
- import "../chunk-M2WF6AXG.js";
74
- import "../chunk-4XV6IR37.js";
78
+ import "../chunk-6NWEVFEL.js";
79
+ import "../chunk-LSMMOS2Z.js";
75
80
  import "../chunk-4VWO3ZXL.js";
76
- import "../chunk-EFEHDQGY.js";
77
- import "../chunk-AWNQ6ED6.js";
78
- import "../chunk-FSWCWSTS.js";
81
+ import "../chunk-ZHZ2Y2DH.js";
82
+ import "../chunk-HI3JGZR2.js";
83
+ import "../chunk-HMLIGAU7.js";
79
84
  import "../chunk-TRT2HRWZ.js";
80
85
  import "../chunk-LX5QWLBL.js";
81
- import "../chunk-FAYRX2AD.js";
86
+ import "../chunk-POOOIWE5.js";
82
87
  import {
83
88
  atomicWrite,
84
89
  withFileLock
85
- } from "../chunk-7ZHZE5EO.js";
90
+ } from "../chunk-OSGLYW5J.js";
91
+ import "../chunk-FC2ZGRF3.js";
92
+ import "../chunk-THEGTRAG.js";
86
93
  import "../chunk-SVT4RNTR.js";
87
- import "../chunk-WEBMSQP2.js";
88
- import "../chunk-YNCVSFGF.js";
89
- import "../chunk-CB2HFKTP.js";
94
+ import "../chunk-SAFHACFA.js";
95
+ import "../chunk-RJIZEJ42.js";
96
+ import "../chunk-KDQJCT2J.js";
97
+ import "../chunk-VVBP6KGT.js";
90
98
  import "../chunk-KJ2ZTQSL.js";
91
99
  import "../chunk-B4AMLZPB.js";
100
+ import "../chunk-PFZO3C6H.js";
92
101
  import "../chunk-O37BQ65S.js";
93
102
  import {
94
103
  ERROR_CODES,
95
104
  FsError
96
- } from "../chunk-WOEZV3Q4.js";
105
+ } from "../chunk-25LSLC3G.js";
97
106
  import "../chunk-TBRL2RCC.js";
98
- import "../chunk-PFZO3C6H.js";
99
107
 
100
108
  // src/plugin/discovery.ts
101
109
  var DEFAULT_PLUGIN_DISCOVERY_IO = {
@@ -670,7 +678,11 @@ export {
670
678
  CHIMERA_REVIEW_PROMPT,
671
679
  DEFAULT_PLUGIN_DISCOVERY_IO,
672
680
  DefaultPluginAPI,
681
+ FINDING_STORE_FILE,
682
+ JsonlFindingStore,
683
+ JsonlReportStore,
673
684
  KERNEL_API_VERSION,
685
+ REPORT_STORE_FILE,
674
686
  buildReviewerModelPool,
675
687
  classifyChimeraReviewSource,
676
688
  createAutoReviewPlugin,
@@ -698,12 +710,16 @@ export {
698
710
  recordCompletedReview,
699
711
  recordStartedReview,
700
712
  redactPluginConfig,
713
+ resolveFindingStorePath,
701
714
  resolvePluginConfig,
702
715
  resolvePluginEnablement,
703
716
  resolvePluginEntryPath,
704
717
  resolvePluginManifestConfig,
705
718
  resolvePluginTarget,
719
+ resolveReportStorePath,
706
720
  selectRoundRobinReviewerAssignment,
721
+ syncReportCompletion,
722
+ syncReportReopen,
707
723
  unloadPlugins,
708
724
  unpinPluginTrust,
709
725
  updateReviewReportEvidence,
@@ -1,5 +1,6 @@
1
1
  import type { Plugin } from '../types/plugin.js';
2
- import { type AutoReviewConfig, buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, type ResolvedAutoReviewConfig, type ReviewerModelAssignment, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints } from './auto-review-config.js';
3
- export { buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints, type AutoReviewConfig, type ResolvedAutoReviewConfig, type ReviewerModelAssignment, };
2
+ import { buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, type ReviewerModelAssignment, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints } from './auto-review-config.js';
3
+ export type { ReviewerModelAssignment };
4
+ export { buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints };
4
5
  export declare function createAutoReviewPlugin(): Plugin;
5
6
  //# sourceMappingURL=auto-review-plugin.d.ts.map
@@ -6,7 +6,6 @@
6
6
  *
7
7
  * @module review-finding-commands
8
8
  */
9
- import type { ReviewReport } from './review-report-types.js';
10
9
  /**
11
10
  * Run the review findings command.
12
11
  *
@@ -25,12 +24,6 @@ export interface FindingCommandContext {
25
24
  * Execute a finding-store command.
26
25
  */
27
26
  export declare function executeFindingCommand(args: string[], ctx: FindingCommandContext): Promise<string>;
28
- declare function loadReportStore(ctx: FindingCommandContext): Promise<import("./review-report-store.js").JsonlReportStore>;
29
- /**
30
- * Resolve a report by exact ID or short-ID prefix (≥8 chars).
31
- * Exported for integration testing.
32
- */
33
- export declare function resolveReportId(store: Awaited<ReturnType<typeof loadReportStore>>, id: string): Promise<ReviewReport | null>;
34
27
  /**
35
28
  * Manually transition a report's lifecycle.
36
29
  *
@@ -41,5 +34,4 @@ export declare function resolveReportId(store: Awaited<ReturnType<typeof loadRep
41
34
  * Maps to: complete → completed, skip → skipped, action → actioned.
42
35
  */
43
36
  export declare function transitionReport(id: string, action: 'complete' | 'skip' | 'action', extraArgs: string[], ctx: FindingCommandContext): Promise<string>;
44
- export {};
45
37
  //# sourceMappingURL=review-finding-commands.d.ts.map
@@ -5,11 +5,12 @@ import {
5
5
  FINDING_STORE_FILE,
6
6
  JsonlFindingStore,
7
7
  resolveFindingStorePath
8
- } from "./chunk-JVGPR3TS.js";
9
- import "./chunk-H5E77KUJ.js";
10
- import "./chunk-7ZHZE5EO.js";
11
- import "./chunk-WOEZV3Q4.js";
12
- import "./chunk-TBRL2RCC.js";
8
+ } from "../chunk-4LCZVJVF.js";
9
+ import "../chunk-UJILKYES.js";
10
+ import "../chunk-6FHWXLPT.js";
11
+ import "../chunk-OSGLYW5J.js";
12
+ import "../chunk-25LSLC3G.js";
13
+ import "../chunk-TBRL2RCC.js";
13
14
  export {
14
15
  FINDING_DEFAULT_PAGE_SIZE,
15
16
  FINDING_IGNORED_RETENTION_MS,
@@ -18,4 +19,4 @@ export {
18
19
  JsonlFindingStore,
19
20
  resolveFindingStorePath
20
21
  };
21
- //# sourceMappingURL=review-finding-store-DKAV3AS6.js.map
22
+ //# sourceMappingURL=review-finding-store.js.map
@@ -0,0 +1,19 @@
1
+ import {
2
+ FindingNotFoundError,
3
+ FindingStoreLockError,
4
+ InvalidTransitionError,
5
+ computeFindingFingerprint,
6
+ normalizeFingerprintTitle,
7
+ validateResolution,
8
+ validateTransition
9
+ } from "../chunk-UJILKYES.js";
10
+ export {
11
+ FindingNotFoundError,
12
+ FindingStoreLockError,
13
+ InvalidTransitionError,
14
+ computeFindingFingerprint,
15
+ normalizeFingerprintTitle,
16
+ validateResolution,
17
+ validateTransition
18
+ };
19
+ //# sourceMappingURL=review-finding-types.js.map
@@ -0,0 +1,21 @@
1
+ import {
2
+ persistReviewReport,
3
+ syncReportCompletion,
4
+ syncReportReopen,
5
+ updateReviewReportEvidence
6
+ } from "../chunk-YWXT3JNM.js";
7
+ import "../chunk-4LCZVJVF.js";
8
+ import "../chunk-UJILKYES.js";
9
+ import "../chunk-HXKZ7OBQ.js";
10
+ import "../chunk-WP7BVANJ.js";
11
+ import "../chunk-6FHWXLPT.js";
12
+ import "../chunk-OSGLYW5J.js";
13
+ import "../chunk-25LSLC3G.js";
14
+ import "../chunk-TBRL2RCC.js";
15
+ export {
16
+ persistReviewReport,
17
+ syncReportCompletion,
18
+ syncReportReopen,
19
+ updateReviewReportEvidence
20
+ };
21
+ //# sourceMappingURL=review-report-integration.js.map
@@ -4,11 +4,12 @@ import {
4
4
  REPORT_RETENTION_MS,
5
5
  REPORT_STORE_FILE,
6
6
  resolveReportStorePath
7
- } from "./chunk-PFXFQQRT.js";
8
- import "./chunk-H5E77KUJ.js";
9
- import "./chunk-7ZHZE5EO.js";
10
- import "./chunk-WOEZV3Q4.js";
11
- import "./chunk-TBRL2RCC.js";
7
+ } from "../chunk-HXKZ7OBQ.js";
8
+ import "../chunk-WP7BVANJ.js";
9
+ import "../chunk-6FHWXLPT.js";
10
+ import "../chunk-OSGLYW5J.js";
11
+ import "../chunk-25LSLC3G.js";
12
+ import "../chunk-TBRL2RCC.js";
12
13
  export {
13
14
  JsonlReportStore,
14
15
  REPORT_DEFAULT_PAGE_SIZE,
@@ -16,4 +17,4 @@ export {
16
17
  REPORT_STORE_FILE,
17
18
  resolveReportStorePath
18
19
  };
19
- //# sourceMappingURL=review-report-store-OWY3EC3N.js.map
20
+ //# sourceMappingURL=review-report-store.js.map
@@ -0,0 +1,13 @@
1
+ import {
2
+ InvalidReportTransitionError,
3
+ ReportNotFoundError,
4
+ reportEventTypeFor,
5
+ validateReportTransition
6
+ } from "../chunk-WP7BVANJ.js";
7
+ export {
8
+ InvalidReportTransitionError,
9
+ ReportNotFoundError,
10
+ reportEventTypeFor,
11
+ validateReportTransition
12
+ };
13
+ //# sourceMappingURL=review-report-types.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  PromptInstaller,
3
3
  PromptManifestStore
4
- } from "../chunk-JJPMWPB6.js";
4
+ } from "../chunk-PISBFBJN.js";
5
5
  import {
6
6
  PROMPT_JOURNAL_RAW_MARKER,
7
7
  ensureGitignore,
8
8
  getPromptJournalEntries,
9
9
  recordPromptJournalEntry
10
- } from "../chunk-YUPMXOGP.js";
11
- import "../chunk-3E244UDA.js";
10
+ } from "../chunk-RFQMOKWK.js";
11
+ import "../chunk-QSTSJOCK.js";
12
+ import "../chunk-OSGLYW5J.js";
12
13
  import "../chunk-IYFBFX34.js";
13
- import "../chunk-7ZHZE5EO.js";
14
- import "../chunk-WOEZV3Q4.js";
14
+ import "../chunk-25LSLC3G.js";
15
15
  import "../chunk-TBRL2RCC.js";
16
16
  export {
17
17
  PROMPT_JOURNAL_RAW_MARKER,
@@ -2,10 +2,10 @@ import {
2
2
  ProviderRegistry,
3
3
  SlashCommandRegistry,
4
4
  ToolRegistry
5
- } from "../chunk-KI4L2DUL.js";
5
+ } from "../chunk-TCCHINEF.js";
6
6
  import "../chunk-WQTOVMGV.js";
7
- import "../chunk-FSWCWSTS.js";
8
- import "../chunk-WOEZV3Q4.js";
7
+ import "../chunk-HMLIGAU7.js";
8
+ import "../chunk-25LSLC3G.js";
9
9
  import "../chunk-TBRL2RCC.js";
10
10
  export {
11
11
  ProviderRegistry,
@@ -1,4 +1,5 @@
1
- import type { ToolDescriptionMode, ToolDescriptionModeConfig } from '../types/config.js';
1
+ import type { EventBus } from '../kernel/events.js';
2
+ import type { DisabledToolMeta, ToolDescriptionMode, ToolDescriptionModeConfig } from '../types/config.js';
2
3
  import type { Tool } from '../types/tool.js';
3
4
  /**
4
5
  * A function that wraps (decorates) an existing tool. Receives the
@@ -26,11 +27,20 @@ export declare class ToolRegistry {
26
27
  private readonly tools;
27
28
  private readonly descriptionModes;
28
29
  /**
29
- * Set of tool names that are disabled (hidden from list(), get() and all
30
- * other public accessors). The underlying tool data stays in `_tools` so
31
- * re-enable is a constant-time operation.
30
+ * Disabled tool names plus the audit-trail metadata explaining WHY each
31
+ * one was disabled. `user` is the historical default (manual
32
+ * `/tool disable`); `auto-thinned` is the new path the auto-thinning
33
+ * pipeline writes so `/tool autothin undo` can restore the right subset.
34
+ * The underlying tool data stays in `_tools` so re-enable is constant-time.
32
35
  */
33
36
  private readonly _disabled;
37
+ /**
38
+ * Optional EventBus used by `thinUnderused()` to emit `tool.thinned`.
39
+ * Set via `setEventBus()` at boot — optional so the registry stays
40
+ * usable in pure unit tests and in code paths that never run the
41
+ * auto-thinning pipeline.
42
+ */
43
+ private _events;
34
44
  /** Monotonic version bumped on every registry mutation. */
35
45
  private _version;
36
46
  /** Cached `list()` result, frozen after build. Invalidated on _version change. */
@@ -99,16 +109,26 @@ export declare class ToolRegistry {
99
109
  };
100
110
  get(name: string): Tool | undefined;
101
111
  ownerOf(name: string): string | undefined;
112
+ /** Attach the EventBus so `thinUnderused()` can emit `tool.thinned`.
113
+ * Idempotent; safe to call multiple times at boot. */
114
+ setEventBus(events: EventBus | undefined): void;
102
115
  /**
103
116
  * Disable a tool by name. The tool is removed from all public accessors
104
117
  * (list(), get(), listByCategory(), listWithOwner()) so it does NOT
105
118
  * appear in the system prompt or provider request. The underlying
106
119
  * registration is preserved in memory — use `enable()` to restore it.
107
120
  *
121
+ * `reason` defaults to `'user'` for backward compatibility — every
122
+ * historical caller (CLI `/tool disable`, WebUI, subagent filter)
123
+ * writes a user-authored disable. The auto-thinning pipeline always
124
+ * passes `'auto-thinned'`.
125
+ *
108
126
  * @returns `true` if the tool was found and disabled; `false` if the
109
127
  * tool is not registered or is already disabled.
110
128
  */
111
- disable(name: string): boolean;
129
+ disable(name: string, reason?: 'user' | 'auto-thinned', meta?: {
130
+ caller?: string;
131
+ }): boolean;
112
132
  /**
113
133
  * Re-enable a previously disabled tool. The tool reappears in all
114
134
  * public accessors and will be included in the next system prompt /
@@ -123,24 +143,54 @@ export declare class ToolRegistry {
123
143
  * of tools that were re-enabled.
124
144
  */
125
145
  enableAll(): number;
146
+ /**
147
+ * Re-enable only the tools that were disabled by the auto-thinning
148
+ * pipeline (`reason === 'auto-thinned'` in `disabledToolMeta`). Manual
149
+ * user disables are preserved. Returns the names that were re-enabled.
150
+ */
151
+ enableAutoThinned(): string[];
126
152
  /**
127
153
  * Check whether a tool is currently disabled.
128
154
  */
129
155
  isDisabled(name: string): boolean;
156
+ /** Return the audit-trail metadata for a disabled tool, if any. */
157
+ disabledMeta(name: string): DisabledToolMeta | undefined;
130
158
  /**
131
159
  * Apply a list of tool names to disable. Tools not in the registry
132
160
  * are silently ignored so config can reference future tools without
133
- * error. Returns the number of tools actually disabled.
161
+ * error. Returns the number of tools actually disabled. Always
162
+ * tagged `reason: 'user'` — the auto-thinning pipeline uses
163
+ * `thinUnderused()` instead.
134
164
  */
135
165
  applyDisabled(names: readonly string[]): number;
136
166
  /**
137
- * Return the list of all disabled tool entries (tool + owner). Useful
138
- * for the /tools slash command to show disabled tools alongside
139
- * enabled ones.
167
+ * Apply the audit-trail metadata for a previously-disabled tool.
168
+ * Used at boot to restore `disabledToolMeta` (so the auto-thinned
169
+ * decision survives a restart). Does NOT mutate the disabled set
170
+ * itself — pair with `applyDisabled()` on the same names.
171
+ */
172
+ applyDisabledMeta(meta: Readonly<Record<string, DisabledToolMeta>>): number;
173
+ /**
174
+ * Disable every name in `candidates` that is currently registered and
175
+ * not already disabled, tagged with `reason: 'auto-thinned'`. Emits
176
+ * a `tool.thinned` event with the names that actually flipped.
177
+ *
178
+ * @returns `{ thinned, skipped }` so the caller can persist the
179
+ * decision to `disabledToolMeta` and report what was changed.
180
+ */
181
+ thinUnderused(candidates: readonly string[], caller: string): {
182
+ thinned: string[];
183
+ skipped: string[];
184
+ };
185
+ /**
186
+ * Return the list of all disabled tool entries (tool + owner + reason).
187
+ * Useful for the /tools slash command to show disabled tools alongside
188
+ * enabled ones, and for `/tool autothin status` to count the auto-thinned subset.
140
189
  */
141
190
  listDisabled(): {
142
191
  tool: Tool;
143
192
  owner: string;
193
+ meta: DisabledToolMeta;
144
194
  }[];
145
195
  list(): Tool[];
146
196
  /** Replace the direct provider surface. Pass `undefined` to expose the catalog. */
@@ -2,13 +2,13 @@ import {
2
2
  ProjectSessionRegistry,
3
3
  getProjectSessionRegistry,
4
4
  hasProjectSessionRegistry
5
- } from "./chunk-YBUJCZ57.js";
6
- import "./chunk-52RTVH4M.js";
7
- import "./chunk-E6I5RXVK.js";
8
- import "./chunk-FAYRX2AD.js";
5
+ } from "./chunk-4I7HGVVA.js";
6
+ import "./chunk-F3JWNST7.js";
7
+ import "./chunk-AYW5YINX.js";
8
+ import "./chunk-POOOIWE5.js";
9
9
  export {
10
10
  ProjectSessionRegistry,
11
11
  getProjectSessionRegistry,
12
12
  hasProjectSessionRegistry
13
13
  };
14
- //# sourceMappingURL=registry-R23UBE7H.js.map
14
+ //# sourceMappingURL=registry-7N4O3E7W.js.map
@@ -45,6 +45,12 @@ export declare const ToolCapabilities: {
45
45
  readonly NET_OUTBOUND: 'net.outbound';
46
46
  /** Can mutate in-memory session todos only. */
47
47
  readonly SESSION_TODO: 'session.todo';
48
+ /**
49
+ * Can post an ephemeral same-session note to the leader or a peer
50
+ * (`session_note` / `session.note`). In-process only — not the durable
51
+ * cross-session mailbox (`coordination.mail`).
52
+ */
53
+ readonly SESSION_NOTE: 'session.note';
48
54
  /** Can park after-task `<nextsteps>` suggestions for the current turn. */
49
55
  readonly SESSION_NEXTSTEPS: 'session.nextsteps';
50
56
  /** Can mutate in-memory session mode only. */
@@ -14,5 +14,5 @@
14
14
  *
15
15
  * @module security/file-permissions
16
16
  */
17
- export { restrictDirPermissions, restrictFilePermissions, SECRET_DIR_MODE, SECRET_FILE_MODE, type RestrictPermissionsOptions, } from '@wrongstack/persistence';
17
+ export { restrictDirPermissions, restrictFilePermissions, SECRET_DIR_MODE, SECRET_FILE_MODE } from '@wrongstack/persistence';
18
18
  //# sourceMappingURL=file-permissions.d.ts.map