monomind 1.10.56 → 1.11.0

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 (247) hide show
  1. package/.claude/agents/core/coordinator.md +71 -0
  2. package/.claude/agents/generated/case-analyst.md +50 -0
  3. package/.claude/agents/generated/copy-editor.md +45 -0
  4. package/.claude/agents/generated/court-reporter.md +50 -0
  5. package/.claude/agents/generated/defender.md +51 -0
  6. package/.claude/agents/generated/editor-in-chief.md +45 -0
  7. package/.claude/agents/generated/fact-checker.md +45 -0
  8. package/.claude/agents/generated/judge.md +51 -0
  9. package/.claude/agents/generated/prosecutor.md +51 -0
  10. package/.claude/agents/generated/reporter.md +45 -0
  11. package/.claude/commands/hooks/README.md +1 -1
  12. package/.claude/commands/hooks/overview.md +1 -1
  13. package/.claude/commands/mastermind/_repeat.md +1 -1
  14. package/.claude/commands/mastermind/do.md +3 -1
  15. package/.claude/commands/mastermind/help.md +2 -2
  16. package/.claude/commands/mastermind/master.md +39 -6
  17. package/.claude/commands/mastermind/memory.md +1 -1
  18. package/.claude/commands/memory/memory-search.md +2 -2
  19. package/.claude/commands/monitoring/status.md +1 -1
  20. package/.claude/commands/{browse.md → monobrowse.md} +2 -2
  21. package/.claude/commands/sparc.md +1 -1
  22. package/.claude/helpers/handlers/graph-status-handler.cjs +1 -1
  23. package/.claude/helpers/loop-tracker.cjs +1 -1
  24. package/.claude/scheduled_tasks.lock +1 -1
  25. package/.claude/skills/agent-browser-testing/SKILL.md +1 -1
  26. package/.claude/skills/hooks-automation/SKILL.md +0 -3
  27. package/.claude/skills/mastermind/build.md +1 -1
  28. package/.claude/skills/mastermind/code-quality-reviewer-prompt.md +60 -0
  29. package/.claude/skills/mastermind/content.md +1 -1
  30. package/.claude/skills/mastermind/createorg.md +79 -2
  31. package/.claude/skills/mastermind/design.md +3 -1
  32. package/.claude/skills/mastermind/finance.md +1 -1
  33. package/.claude/skills/mastermind/implementer-prompt.md +109 -0
  34. package/.claude/skills/mastermind/marketing.md +1 -1
  35. package/.claude/skills/mastermind/ops.md +1 -1
  36. package/.claude/skills/mastermind/plan.md +20 -2
  37. package/.claude/skills/mastermind/release.md +1 -1
  38. package/.claude/skills/mastermind/research.md +1 -1
  39. package/.claude/skills/mastermind/review.md +1 -1
  40. package/.claude/skills/mastermind/sales.md +1 -1
  41. package/.claude/skills/mastermind/spec-reviewer-prompt.md +63 -0
  42. package/.claude/skills/sparc-methodology/SKILL.md +3 -3
  43. package/.claude/skills/swarm-advanced/SKILL.md +1 -4
  44. package/.claude-plugin/README.md +1 -2
  45. package/.claude-plugin/docs/PLUGIN_SUMMARY.md +0 -1
  46. package/README.md +18 -32
  47. package/package.json +1 -1
  48. package/packages/@monomind/cli/README.md +18 -32
  49. package/packages/@monomind/cli/dist/src/agents/registry-builder.d.ts +1 -7
  50. package/packages/@monomind/cli/dist/src/agents/registry-builder.js +10 -6
  51. package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.d.ts +59 -12
  52. package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +67 -13
  53. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -13
  54. package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +2 -2
  55. package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +5 -5
  56. package/packages/@monomind/cli/dist/src/commands/agent.js +1 -6
  57. package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +1 -1
  58. package/packages/@monomind/cli/dist/src/commands/analyze.js +8 -18
  59. package/packages/@monomind/cli/dist/src/commands/doctor.js +53 -3
  60. package/packages/@monomind/cli/dist/src/commands/embeddings.js +9 -33
  61. package/packages/@monomind/cli/dist/src/commands/hooks.js +24 -76
  62. package/packages/@monomind/cli/dist/src/commands/index.d.ts +4 -6
  63. package/packages/@monomind/cli/dist/src/commands/index.js +8 -15
  64. package/packages/@monomind/cli/dist/src/commands/init.js +2 -2
  65. package/packages/@monomind/cli/dist/src/commands/issues.js +16 -11
  66. package/packages/@monomind/cli/dist/src/commands/mcp.d.ts +1 -1
  67. package/packages/@monomind/cli/dist/src/commands/memory.js +6 -6
  68. package/packages/@monomind/cli/dist/src/commands/migrate.js +1 -2
  69. package/packages/@monomind/cli/dist/src/commands/monograph.js +18 -11
  70. package/packages/@monomind/cli/dist/src/commands/monovector/backup.d.ts +11 -0
  71. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/backup.js +25 -25
  72. package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.d.ts +11 -0
  73. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/benchmark.js +14 -14
  74. package/packages/@monomind/cli/dist/src/commands/monovector/import.d.ts +18 -0
  75. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/import.js +21 -21
  76. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/index.d.ts +6 -6
  77. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/index.js +22 -22
  78. package/packages/@monomind/cli/dist/src/commands/monovector/init.d.ts +11 -0
  79. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/init.js +36 -36
  80. package/packages/@monomind/cli/dist/src/commands/monovector/migrate.d.ts +11 -0
  81. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/migrate.js +16 -16
  82. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/optimize.d.ts +2 -2
  83. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/optimize.js +10 -10
  84. package/packages/@monomind/cli/dist/src/commands/monovector/setup.d.ts +18 -0
  85. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/setup.js +77 -77
  86. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/status.d.ts +2 -2
  87. package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/status.js +34 -34
  88. package/packages/@monomind/cli/dist/src/commands/neural.d.ts +1 -1
  89. package/packages/@monomind/cli/dist/src/commands/neural.js +31 -608
  90. package/packages/@monomind/cli/dist/src/commands/performance.js +7 -10
  91. package/packages/@monomind/cli/dist/src/commands/plugins.js +3 -4
  92. package/packages/@monomind/cli/dist/src/commands/process.js +5 -12
  93. package/packages/@monomind/cli/dist/src/commands/progress.js +16 -16
  94. package/packages/@monomind/cli/dist/src/commands/route.d.ts +2 -2
  95. package/packages/@monomind/cli/dist/src/commands/route.js +23 -23
  96. package/packages/@monomind/cli/dist/src/commands/status.js +0 -3
  97. package/packages/@monomind/cli/dist/src/commands/swarm.js +2 -3
  98. package/packages/@monomind/cli/dist/src/commands/update.d.ts +1 -1
  99. package/packages/@monomind/cli/dist/src/config-adapter.js +27 -0
  100. package/packages/@monomind/cli/dist/src/consensus/audit-writer.d.ts +44 -17
  101. package/packages/@monomind/cli/dist/src/dlq/dlq-replayer.d.ts +1 -1
  102. package/packages/@monomind/cli/dist/src/index.d.ts +1 -1
  103. package/packages/@monomind/cli/dist/src/index.js +5 -5
  104. package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +10 -14
  105. package/packages/@monomind/cli/dist/src/init/executor.js +17 -27
  106. package/packages/@monomind/cli/dist/src/init/helpers-generator.d.ts +1 -1
  107. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +2 -2
  108. package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -1
  109. package/packages/@monomind/cli/dist/src/mcp-client.js +1 -7
  110. package/packages/@monomind/cli/dist/src/mcp-server.js +9 -1
  111. package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +1 -52
  112. package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.js +5 -5
  113. package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.d.ts +4 -4
  114. package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.d.ts +1 -1
  115. package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.d.ts +1 -1
  116. package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +6 -5
  117. package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.d.ts +1 -1
  118. package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.d.ts +1 -1
  119. package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.js +51 -54
  120. package/packages/@monomind/cli/dist/src/mcp-tools/daa-tools.d.ts +1 -1
  121. package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +10 -10
  122. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.d.ts +1 -1
  123. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +0 -24
  124. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +189 -446
  125. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -2
  126. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -2
  127. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.d.ts +334 -0
  128. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.js +1108 -0
  129. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +76 -34
  130. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +2 -2
  131. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +2 -2
  132. package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.d.ts +1 -1
  133. package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +2 -2
  134. package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.js +3 -3
  135. package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.d.ts +1 -1
  136. package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.js +29 -19
  137. package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.d.ts +1 -1
  138. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +1 -1
  139. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +2 -2
  140. package/packages/@monomind/cli/dist/src/memory/intelligence.js +14 -8
  141. package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +17 -2
  142. package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +76 -23
  143. package/packages/@monomind/cli/dist/src/memory/memory-initializer.d.ts +2 -2
  144. package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +37 -39
  145. package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +34 -0
  146. package/packages/@monomind/cli/dist/src/monovector/capabilities.js +37 -0
  147. package/packages/@monomind/cli/dist/src/monovector/command-outcomes.d.ts +37 -0
  148. package/packages/@monomind/cli/dist/src/monovector/command-outcomes.js +87 -0
  149. package/packages/@monomind/cli/dist/src/monovector/coverage-router.d.ts +103 -0
  150. package/packages/@monomind/cli/dist/src/monovector/coverage-router.js +337 -0
  151. package/packages/@monomind/cli/dist/src/monovector/coverage-tools.d.ts +14 -0
  152. package/packages/@monomind/cli/dist/src/monovector/coverage-tools.js +112 -0
  153. package/packages/@monomind/cli/dist/src/{ruvector → monovector}/diff-classifier.d.ts +2 -2
  154. package/packages/@monomind/cli/dist/src/monovector/index.d.ts +61 -0
  155. package/packages/@monomind/cli/dist/src/monovector/index.js +67 -0
  156. package/packages/@monomind/cli/dist/src/monovector/init-state.d.ts +35 -0
  157. package/packages/@monomind/cli/dist/src/monovector/init-state.js +36 -0
  158. package/packages/@monomind/cli/dist/src/monovector/route-outcomes.d.ts +55 -0
  159. package/packages/@monomind/cli/dist/src/monovector/route-outcomes.js +137 -0
  160. package/packages/@monomind/cli/dist/src/parser.js +3 -3
  161. package/packages/@monomind/cli/dist/src/plugins/store/discovery.js +0 -31
  162. package/packages/@monomind/cli/dist/src/production/circuit-breaker.d.ts +26 -6
  163. package/packages/@monomind/cli/dist/src/production/error-handler.d.ts +55 -30
  164. package/packages/@monomind/cli/dist/src/production/index.d.ts +3 -20
  165. package/packages/@monomind/cli/dist/src/production/index.js +3 -15
  166. package/packages/@monomind/cli/dist/src/production/monitoring.d.ts +54 -34
  167. package/packages/@monomind/cli/dist/src/production/monitoring.js +12 -14
  168. package/packages/@monomind/cli/dist/src/production/rate-limiter.d.ts +64 -19
  169. package/packages/@monomind/cli/dist/src/production/rate-limiter.js +5 -5
  170. package/packages/@monomind/cli/dist/src/production/retry.js +4 -2
  171. package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +3 -3
  172. package/packages/@monomind/cli/dist/src/services/claim-service.d.ts +50 -59
  173. package/packages/@monomind/cli/dist/src/services/claim-service.js +83 -50
  174. package/packages/@monomind/cli/dist/src/services/config-file-manager.js +8 -1
  175. package/packages/@monomind/cli/dist/src/services/worker-daemon.js +4 -0
  176. package/packages/@monomind/cli/dist/src/transfer/ipfs/upload.d.ts +1 -1
  177. package/packages/@monomind/cli/dist/src/transfer/storage/gcs.d.ts +1 -1
  178. package/packages/@monomind/cli/dist/src/types.d.ts +13 -0
  179. package/packages/@monomind/cli/dist/src/update/checker.d.ts +1 -1
  180. package/packages/@monomind/cli/dist/src/update/index.d.ts +1 -1
  181. package/packages/@monomind/cli/package.json +13 -13
  182. package/packages/@monomind/guidance/dist/index.d.ts +1 -1
  183. package/packages/@monomind/guidance/dist/index.js +1 -1
  184. package/packages/@monomind/guidance/package.json +1 -2
  185. package/scripts/build-monovector.sh +10 -0
  186. package/scripts/publish-monovector.sh +20 -0
  187. package/.claude/commands/monomind/adr.md +0 -11
  188. package/.claude/commands/monomind/budget.md +0 -7
  189. package/.claude/commands/monomind/createtask.md +0 -277
  190. package/.claude/commands/monomind/do.md +0 -498
  191. package/.claude/commands/monomind/graph-status.md +0 -7
  192. package/.claude/commands/monomind/help.md +0 -118
  193. package/.claude/commands/monomind/idea.md +0 -273
  194. package/.claude/commands/monomind/improve.md +0 -352
  195. package/.claude/commands/monomind/loops.md +0 -7
  196. package/.claude/commands/monomind/memory.md +0 -230
  197. package/.claude/commands/monomind/repeat.md +0 -257
  198. package/.claude/commands/monomind/review.md +0 -317
  199. package/.claude/commands/monomind/specialagents.md +0 -125
  200. package/.claude/commands/monomind/swarm.md +0 -161
  201. package/.claude/commands/monomind/understand.md +0 -139
  202. package/.claude/commands/training/README.md +0 -39
  203. package/.claude/commands/training/neural-patterns.md +0 -73
  204. package/.claude/commands/training/neural-train.md +0 -79
  205. package/packages/@monomind/cli/dist/src/commands/appliance-advanced.d.ts +0 -9
  206. package/packages/@monomind/cli/dist/src/commands/appliance-advanced.js +0 -238
  207. package/packages/@monomind/cli/dist/src/commands/appliance.d.ts +0 -8
  208. package/packages/@monomind/cli/dist/src/commands/appliance.js +0 -406
  209. package/packages/@monomind/cli/dist/src/commands/ruvector/backup.d.ts +0 -11
  210. package/packages/@monomind/cli/dist/src/commands/ruvector/benchmark.d.ts +0 -11
  211. package/packages/@monomind/cli/dist/src/commands/ruvector/import.d.ts +0 -18
  212. package/packages/@monomind/cli/dist/src/commands/ruvector/init.d.ts +0 -11
  213. package/packages/@monomind/cli/dist/src/commands/ruvector/migrate.d.ts +0 -11
  214. package/packages/@monomind/cli/dist/src/commands/ruvector/setup.d.ts +0 -18
  215. package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.d.ts +0 -182
  216. package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.js +0 -316
  217. package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.d.ts +0 -67
  218. package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.js +0 -277
  219. package/packages/@monomind/cli/dist/src/ruvector/coverage-router.d.ts +0 -160
  220. package/packages/@monomind/cli/dist/src/ruvector/coverage-router.js +0 -539
  221. package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.d.ts +0 -33
  222. package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.js +0 -157
  223. package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
  224. package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.js +0 -551
  225. package/packages/@monomind/cli/dist/src/ruvector/flash-attention.d.ts +0 -195
  226. package/packages/@monomind/cli/dist/src/ruvector/flash-attention.js +0 -643
  227. package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.d.ts +0 -187
  228. package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.js +0 -929
  229. package/packages/@monomind/cli/dist/src/ruvector/index.d.ts +0 -56
  230. package/packages/@monomind/cli/dist/src/ruvector/index.js +0 -58
  231. package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.d.ts +0 -218
  232. package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.js +0 -455
  233. package/packages/@monomind/cli/dist/src/ruvector/model-router.d.ts +0 -222
  234. package/packages/@monomind/cli/dist/src/ruvector/model-router.js +0 -512
  235. package/packages/@monomind/cli/dist/src/ruvector/moe-router.d.ts +0 -213
  236. package/packages/@monomind/cli/dist/src/ruvector/moe-router.js +0 -649
  237. package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.d.ts +0 -217
  238. package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.js +0 -712
  239. package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
  240. package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.js +0 -363
  241. package/packages/@monomind/cli/dist/src/ruvector/semantic-router.d.ts +0 -77
  242. package/packages/@monomind/cli/dist/src/ruvector/semantic-router.js +0 -178
  243. package/packages/@monomind/cli/dist/src/ruvector/vector-db.d.ts +0 -69
  244. package/packages/@monomind/cli/dist/src/ruvector/vector-db.js +0 -243
  245. package/packages/@monomind/cli/dist/src/services/ruvector-training.d.ts +0 -222
  246. package/packages/@monomind/cli/dist/src/services/ruvector-training.js +0 -696
  247. /package/packages/@monomind/cli/dist/src/{ruvector → monovector}/diff-classifier.js +0 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Coverage-Aware Routing (ADR-017)
3
+ *
4
+ * Reads real test-coverage data from disk (Jest/Istanbul `coverage-summary.json`,
5
+ * `lcov.info`, or nyc `out.json`), finds files below a coverage threshold, assigns
6
+ * each gap to an appropriate agent, and produces routing/suggestion decisions.
7
+ *
8
+ * Pure, dependency-light: no native packages, no network. Used by the
9
+ * `monomind route coverage` CLI command and the `coverage_*` MCP tools.
10
+ *
11
+ * @module @monomind/cli/monovector/coverage-router
12
+ */
13
+ /** Per-file coverage percentages (0–100). */
14
+ export interface CoverageEntry {
15
+ filePath: string;
16
+ lines: number;
17
+ branches: number;
18
+ functions: number;
19
+ statements: number;
20
+ }
21
+ export interface CoverageSummary {
22
+ totalFiles: number;
23
+ overallLineCoverage: number;
24
+ overallBranchCoverage: number;
25
+ overallFunctionCoverage: number;
26
+ overallStatementCoverage: number;
27
+ }
28
+ export interface CoverageData {
29
+ found: boolean;
30
+ source: string;
31
+ entries: CoverageEntry[];
32
+ summary: CoverageSummary;
33
+ }
34
+ /** A single file below threshold, with its assigned agent. */
35
+ export interface CoverageGap {
36
+ file: string;
37
+ currentCoverage: number;
38
+ gap: number;
39
+ suggestedAgent: string;
40
+ }
41
+ export interface CoverageGapsResult {
42
+ found: boolean;
43
+ totalGaps: number;
44
+ summary: string;
45
+ byAgent: Record<string, string[]>;
46
+ gaps: CoverageGap[];
47
+ }
48
+ export interface CoverageSuggestion {
49
+ file: string;
50
+ currentCoverage: number;
51
+ targetCoverage: number;
52
+ priority: number;
53
+ suggestedTests: string[];
54
+ }
55
+ export interface CoverageSuggestResult {
56
+ found: boolean;
57
+ path: string;
58
+ totalGap: number;
59
+ estimatedEffort: number;
60
+ suggestions: CoverageSuggestion[];
61
+ }
62
+ export type CoverageAction = 'add-tests' | 'review-coverage' | 'prioritize' | 'skip';
63
+ export interface CoverageRouteResult {
64
+ found: boolean;
65
+ action: CoverageAction;
66
+ priority: number;
67
+ impactScore: number;
68
+ estimatedEffort: number;
69
+ testTypes: string[];
70
+ targetFiles: string[];
71
+ gaps: Array<{
72
+ file: string;
73
+ currentCoverage: number;
74
+ gap: number;
75
+ }>;
76
+ }
77
+ interface CoverageOptions {
78
+ threshold?: number;
79
+ }
80
+ /**
81
+ * Read coverage data from disk. Checks, in order:
82
+ * 1. coverage/coverage-summary.json (Jest/Istanbul)
83
+ * 2. coverage-summary.json (repo root)
84
+ * 3. coverage/lcov.info / lcov.info (lcov)
85
+ * 4. .nyc_output/out.json (nyc)
86
+ * Returns `{ found: false }` when no coverage report exists.
87
+ */
88
+ export declare function readCoverage(cwd?: string): CoverageData;
89
+ /** Assign a coverage gap to the most appropriate agent based on file path. */
90
+ export declare function assignAgent(filePath: string): string;
91
+ /** List coverage gaps below threshold, grouped by assigned agent. */
92
+ export declare function coverageGaps(opts?: CoverageOptions & {
93
+ groupByAgent?: boolean;
94
+ path?: string;
95
+ }): Promise<CoverageGapsResult>;
96
+ /** Suggest concrete coverage improvements for a path. */
97
+ export declare function coverageSuggest(path?: string, opts?: CoverageOptions & {
98
+ limit?: number;
99
+ }): Promise<CoverageSuggestResult>;
100
+ /** Produce a coverage-aware routing decision. */
101
+ export declare function coverageRoute(path?: string, opts?: CoverageOptions): Promise<CoverageRouteResult>;
102
+ export {};
103
+ //# sourceMappingURL=coverage-router.d.ts.map
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Coverage-Aware Routing (ADR-017)
3
+ *
4
+ * Reads real test-coverage data from disk (Jest/Istanbul `coverage-summary.json`,
5
+ * `lcov.info`, or nyc `out.json`), finds files below a coverage threshold, assigns
6
+ * each gap to an appropriate agent, and produces routing/suggestion decisions.
7
+ *
8
+ * Pure, dependency-light: no native packages, no network. Used by the
9
+ * `monomind route coverage` CLI command and the `coverage_*` MCP tools.
10
+ *
11
+ * @module @monomind/cli/monovector/coverage-router
12
+ */
13
+ import { existsSync, readFileSync } from 'fs';
14
+ import { join } from 'path';
15
+ import { getProjectCwd } from '../mcp-tools/types.js';
16
+ // ============================================================================
17
+ // Coverage reader (Jest/Istanbul summary, lcov, nyc)
18
+ // ============================================================================
19
+ const EMPTY = {
20
+ found: false,
21
+ source: 'none',
22
+ entries: [],
23
+ summary: {
24
+ totalFiles: 0,
25
+ overallLineCoverage: 0,
26
+ overallBranchCoverage: 0,
27
+ overallFunctionCoverage: 0,
28
+ overallStatementCoverage: 0,
29
+ },
30
+ };
31
+ /**
32
+ * Read coverage data from disk. Checks, in order:
33
+ * 1. coverage/coverage-summary.json (Jest/Istanbul)
34
+ * 2. coverage-summary.json (repo root)
35
+ * 3. coverage/lcov.info / lcov.info (lcov)
36
+ * 4. .nyc_output/out.json (nyc)
37
+ * Returns `{ found: false }` when no coverage report exists.
38
+ */
39
+ export function readCoverage(cwd = getProjectCwd()) {
40
+ for (const rel of ['coverage/coverage-summary.json', 'coverage-summary.json']) {
41
+ const p = join(cwd, rel);
42
+ if (existsSync(p)) {
43
+ try {
44
+ return parseSummaryJson(JSON.parse(readFileSync(p, 'utf-8')), rel);
45
+ }
46
+ catch {
47
+ /* malformed — try next */
48
+ }
49
+ }
50
+ }
51
+ for (const rel of ['coverage/lcov.info', 'lcov.info']) {
52
+ const p = join(cwd, rel);
53
+ if (existsSync(p)) {
54
+ try {
55
+ return parseLcov(readFileSync(p, 'utf-8'), rel);
56
+ }
57
+ catch {
58
+ /* malformed — try next */
59
+ }
60
+ }
61
+ }
62
+ const nyc = join(cwd, '.nyc_output', 'out.json');
63
+ if (existsSync(nyc)) {
64
+ try {
65
+ return parseSummaryJson(JSON.parse(readFileSync(nyc, 'utf-8')), '.nyc_output/out.json');
66
+ }
67
+ catch {
68
+ /* malformed */
69
+ }
70
+ }
71
+ return EMPTY;
72
+ }
73
+ function pct(covered, total, fallback = 100) {
74
+ if (total == null || total === 0)
75
+ return fallback;
76
+ return ((covered ?? 0) / total) * 100;
77
+ }
78
+ function parseSummaryJson(data, source) {
79
+ const entries = [];
80
+ let tl = 0, cl = 0, tb = 0, cb = 0, tf = 0, cf = 0, ts = 0, cs = 0;
81
+ for (const [filePath, metrics] of Object.entries(data)) {
82
+ if (filePath === 'total')
83
+ continue;
84
+ const m = metrics;
85
+ if (!m || typeof m !== 'object')
86
+ continue;
87
+ entries.push({
88
+ filePath,
89
+ lines: m.lines?.pct ?? pct(m.lines?.covered, m.lines?.total, 0),
90
+ branches: m.branches?.pct ?? pct(m.branches?.covered, m.branches?.total),
91
+ functions: m.functions?.pct ?? pct(m.functions?.covered, m.functions?.total),
92
+ statements: m.statements?.pct ?? pct(m.statements?.covered, m.statements?.total),
93
+ });
94
+ tl += m.lines?.total ?? 0;
95
+ cl += m.lines?.covered ?? 0;
96
+ tb += m.branches?.total ?? 0;
97
+ cb += m.branches?.covered ?? 0;
98
+ tf += m.functions?.total ?? 0;
99
+ cf += m.functions?.covered ?? 0;
100
+ ts += m.statements?.total ?? 0;
101
+ cs += m.statements?.covered ?? 0;
102
+ }
103
+ const total = data['total'];
104
+ entries.sort((a, b) => a.lines - b.lines);
105
+ return {
106
+ found: true,
107
+ source,
108
+ entries,
109
+ summary: {
110
+ totalFiles: entries.length,
111
+ overallLineCoverage: total?.lines?.pct ?? pct(cl, tl, 0),
112
+ overallBranchCoverage: total?.branches?.pct ?? pct(cb, tb, 0),
113
+ overallFunctionCoverage: total?.functions?.pct ?? pct(cf, tf, 0),
114
+ overallStatementCoverage: total?.statements?.pct ?? pct(cs, ts, 0),
115
+ },
116
+ };
117
+ }
118
+ function parseLcov(raw, source) {
119
+ const entries = [];
120
+ let file = '';
121
+ let lf = 0, lh = 0, brf = 0, brh = 0, fnf = 0, fnh = 0;
122
+ let tl = 0, cl = 0, tb = 0, cb = 0, tf = 0, cf = 0;
123
+ const flush = () => {
124
+ if (!file)
125
+ return;
126
+ entries.push({
127
+ filePath: file,
128
+ lines: pct(lh, lf, 0),
129
+ branches: pct(brh, brf),
130
+ functions: pct(fnh, fnf),
131
+ statements: pct(lh, lf, 0),
132
+ });
133
+ tl += lf;
134
+ cl += lh;
135
+ tb += brf;
136
+ cb += brh;
137
+ tf += fnf;
138
+ cf += fnh;
139
+ file = '';
140
+ lf = lh = brf = brh = fnf = fnh = 0;
141
+ };
142
+ for (const line of raw.split('\n')) {
143
+ const t = line.trim();
144
+ if (t.startsWith('SF:')) {
145
+ flush();
146
+ file = t.slice(3);
147
+ }
148
+ else if (t.startsWith('LF:'))
149
+ lf = Number(t.slice(3)) || 0;
150
+ else if (t.startsWith('LH:'))
151
+ lh = Number(t.slice(3)) || 0;
152
+ else if (t.startsWith('BRF:'))
153
+ brf = Number(t.slice(4)) || 0;
154
+ else if (t.startsWith('BRH:'))
155
+ brh = Number(t.slice(4)) || 0;
156
+ else if (t.startsWith('FNF:'))
157
+ fnf = Number(t.slice(4)) || 0;
158
+ else if (t.startsWith('FNH:'))
159
+ fnh = Number(t.slice(4)) || 0;
160
+ else if (t === 'end_of_record')
161
+ flush();
162
+ }
163
+ flush();
164
+ entries.sort((a, b) => a.lines - b.lines);
165
+ return {
166
+ found: entries.length > 0,
167
+ source,
168
+ entries,
169
+ summary: {
170
+ totalFiles: entries.length,
171
+ overallLineCoverage: pct(cl, tl, 0),
172
+ overallBranchCoverage: pct(cb, tb, 0),
173
+ overallFunctionCoverage: pct(cf, tf, 0),
174
+ overallStatementCoverage: pct(cl, tl, 0),
175
+ },
176
+ };
177
+ }
178
+ // ============================================================================
179
+ // Agent assignment + heuristics
180
+ // ============================================================================
181
+ /** Assign a coverage gap to the most appropriate agent based on file path. */
182
+ export function assignAgent(filePath) {
183
+ const p = filePath.toLowerCase();
184
+ if (/(security|auth|crypto|password|token|permission|sanitiz)/.test(p))
185
+ return 'security-architect';
186
+ if (/(api|route|controller|endpoint|handler|server|http)/.test(p))
187
+ return 'backend-dev';
188
+ if (/(\.tsx|\.jsx|component|ui\/|view|page|render)/.test(p))
189
+ return 'frontend-developer';
190
+ if (/(db|database|migration|schema|model|repository|query)/.test(p))
191
+ return 'backend-dev';
192
+ if (/(util|helper|lib\/|common)/.test(p))
193
+ return 'coder';
194
+ return 'tester';
195
+ }
196
+ /** Suggest test types based on which coverage dimensions are weakest. */
197
+ function suggestTestTypes(entry) {
198
+ const types = [];
199
+ if (entry.lines < 80 || entry.statements < 80)
200
+ types.push('unit');
201
+ if (entry.branches < 80)
202
+ types.push('edge-case');
203
+ if (entry.functions < 80)
204
+ types.push('unit');
205
+ if (entry.lines < 50)
206
+ types.push('integration');
207
+ return Array.from(new Set(types.length ? types : ['unit']));
208
+ }
209
+ /** Concrete test suggestions for a file below threshold. */
210
+ function suggestTests(entry, target) {
211
+ const out = [];
212
+ const base = entry.filePath.replace(/\.[tj]sx?$/, '');
213
+ if (entry.functions < target)
214
+ out.push(`Add unit tests covering untested functions in ${entry.filePath}`);
215
+ if (entry.branches < target)
216
+ out.push(`Add tests for uncovered branches/conditionals (currently ${entry.branches.toFixed(0)}%)`);
217
+ if (entry.lines < 50)
218
+ out.push(`Add an integration test exercising the main path of ${entry.filePath}`);
219
+ out.push(`Create ${base}.test.ts with edge-case and error-path coverage`);
220
+ return out.slice(0, 4);
221
+ }
222
+ /** Effort estimate (hours) to close a coverage gap on a file. */
223
+ function estimateEffort(gap) {
224
+ // ~0.5h per 10% gap, floored at 0.25h, capped at 4h per file.
225
+ return Math.min(4, Math.max(0.25, (gap / 10) * 0.5));
226
+ }
227
+ function filterByPath(entries, path) {
228
+ if (!path || path === '.' || path === './')
229
+ return entries;
230
+ const norm = path.replace(/^\.\//, '');
231
+ return entries.filter(e => e.filePath.includes(norm));
232
+ }
233
+ // ============================================================================
234
+ // Public API (consumed by route.ts and coverage-tools.ts)
235
+ // ============================================================================
236
+ /** List coverage gaps below threshold, grouped by assigned agent. */
237
+ export async function coverageGaps(opts = {}) {
238
+ const threshold = opts.threshold ?? 80;
239
+ const data = readCoverage();
240
+ if (!data.found) {
241
+ return { found: false, totalGaps: 0, summary: 'No coverage report found. Run your test suite with coverage enabled.', byAgent: {}, gaps: [] };
242
+ }
243
+ const entries = filterByPath(data.entries, opts.path ?? '');
244
+ const gaps = entries
245
+ .filter(e => e.lines < threshold)
246
+ .map(e => ({
247
+ file: e.filePath,
248
+ currentCoverage: e.lines,
249
+ gap: threshold - e.lines,
250
+ suggestedAgent: assignAgent(e.filePath),
251
+ }))
252
+ .sort((a, b) => b.gap - a.gap);
253
+ const byAgent = {};
254
+ for (const g of gaps)
255
+ (byAgent[g.suggestedAgent] ??= []).push(g.file);
256
+ return {
257
+ found: true,
258
+ totalGaps: gaps.length,
259
+ summary: gaps.length === 0
260
+ ? `All ${entries.length} files meet the ${threshold}% threshold.`
261
+ : `${gaps.length} of ${entries.length} files below ${threshold}% (overall ${data.summary.overallLineCoverage.toFixed(1)}%).`,
262
+ byAgent,
263
+ gaps,
264
+ };
265
+ }
266
+ /** Suggest concrete coverage improvements for a path. */
267
+ export async function coverageSuggest(path = '.', opts = {}) {
268
+ const threshold = opts.threshold ?? 80;
269
+ const limit = opts.limit ?? 20;
270
+ const data = readCoverage();
271
+ if (!data.found) {
272
+ return { found: false, path, totalGap: 0, estimatedEffort: 0, suggestions: [] };
273
+ }
274
+ const entries = filterByPath(data.entries, path).filter(e => e.lines < threshold);
275
+ const suggestions = entries
276
+ .map(e => {
277
+ const gap = threshold - e.lines;
278
+ // priority 1–10 from gap size (a 40%+ gap → 10).
279
+ const priority = Math.min(10, Math.max(1, Math.round(gap / 4)));
280
+ return {
281
+ file: e.filePath,
282
+ currentCoverage: e.lines,
283
+ targetCoverage: threshold,
284
+ priority,
285
+ suggestedTests: suggestTests(e, threshold),
286
+ };
287
+ })
288
+ .sort((a, b) => b.priority - a.priority)
289
+ .slice(0, limit);
290
+ const totalGap = entries.reduce((s, e) => s + (threshold - e.lines), 0);
291
+ const estimatedEffort = entries.reduce((s, e) => s + estimateEffort(threshold - e.lines), 0);
292
+ return { found: true, path, totalGap, estimatedEffort, suggestions };
293
+ }
294
+ /** Produce a coverage-aware routing decision. */
295
+ export async function coverageRoute(path = '', opts = {}) {
296
+ const threshold = opts.threshold ?? 80;
297
+ const data = readCoverage();
298
+ if (!data.found) {
299
+ return { found: false, action: 'skip', priority: 0, impactScore: 0, estimatedEffort: 0, testTypes: [], targetFiles: [], gaps: [] };
300
+ }
301
+ const entries = filterByPath(data.entries, path);
302
+ const below = entries.filter(e => e.lines < threshold);
303
+ const overall = data.summary.overallLineCoverage;
304
+ const gaps = below
305
+ .map(e => ({ file: e.filePath, currentCoverage: e.lines, gap: threshold - e.lines }))
306
+ .sort((a, b) => b.gap - a.gap);
307
+ let action;
308
+ if (below.length === 0)
309
+ action = 'skip';
310
+ else if (overall < threshold - 20)
311
+ action = 'prioritize';
312
+ else if (overall < threshold)
313
+ action = 'add-tests';
314
+ else
315
+ action = 'review-coverage';
316
+ // priority 1–10: severity of the worst gap + breadth.
317
+ const worstGap = gaps[0]?.gap ?? 0;
318
+ const breadth = entries.length ? below.length / entries.length : 0;
319
+ const priority = action === 'skip' ? 0 : Math.min(10, Math.max(1, Math.round((worstGap / 5) + breadth * 4)));
320
+ // impactScore 0–100: how far overall coverage sits below threshold — i.e. the
321
+ // headroom (in coverage points) that closing these gaps would reclaim.
322
+ const impactScore = Math.round(Math.min(100, Math.max(0, threshold - overall)));
323
+ const estimatedEffort = Number(below.reduce((s, e) => s + estimateEffort(threshold - e.lines), 0).toFixed(1));
324
+ // aggregate test types across the worst files
325
+ const testTypes = Array.from(new Set(below.slice(0, 10).flatMap(suggestTestTypes)));
326
+ return {
327
+ found: true,
328
+ action,
329
+ priority,
330
+ impactScore,
331
+ estimatedEffort,
332
+ testTypes: testTypes.length ? testTypes : ['unit'],
333
+ targetFiles: gaps.map(g => g.file),
334
+ gaps,
335
+ };
336
+ }
337
+ //# sourceMappingURL=coverage-router.js.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Coverage Router MCP Tools (ADR-017)
3
+ *
4
+ * Exposes coverage-aware routing over MCP: analyze test-coverage data, list gaps
5
+ * with agent assignments, and suggest concrete test improvements. Thin wrappers
6
+ * around `./coverage-router.js` (the shared pure logic also used by the
7
+ * `monomind route coverage` CLI command).
8
+ *
9
+ * @module @monomind/cli/monovector/coverage-tools
10
+ */
11
+ import type { MCPTool } from '../mcp-tools/types.js';
12
+ export declare const coverageRouterTools: MCPTool[];
13
+ export default coverageRouterTools;
14
+ //# sourceMappingURL=coverage-tools.d.ts.map
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Coverage Router MCP Tools (ADR-017)
3
+ *
4
+ * Exposes coverage-aware routing over MCP: analyze test-coverage data, list gaps
5
+ * with agent assignments, and suggest concrete test improvements. Thin wrappers
6
+ * around `./coverage-router.js` (the shared pure logic also used by the
7
+ * `monomind route coverage` CLI command).
8
+ *
9
+ * @module @monomind/cli/monovector/coverage-tools
10
+ */
11
+ import { coverageRoute, coverageGaps, coverageSuggest } from './coverage-router.js';
12
+ function text(value) {
13
+ return { content: [{ type: 'text', text: typeof value === 'string' ? value : JSON.stringify(value, null, 2) }] };
14
+ }
15
+ function errorResult(message) {
16
+ return { content: [{ type: 'text', text: message }], isError: true };
17
+ }
18
+ export const coverageRouterTools = [
19
+ {
20
+ name: 'coverage_route',
21
+ description: 'Produce a coverage-aware routing decision from test-coverage data on disk ' +
22
+ '(Jest/Istanbul coverage-summary.json, lcov.info, or nyc out.json). Returns an ' +
23
+ 'action (add-tests/prioritize/review-coverage/skip), priority, impact score, ' +
24
+ 'estimated effort, suggested test types, and the target files below threshold.',
25
+ category: 'coverage',
26
+ tags: ['coverage', 'routing', 'testing'],
27
+ cacheable: true,
28
+ cacheTTL: 30_000,
29
+ inputSchema: {
30
+ type: 'object',
31
+ properties: {
32
+ path: { type: 'string', description: 'Optional path prefix to scope the analysis (e.g. "src/auth").' },
33
+ threshold: { type: 'number', description: 'Coverage threshold percentage (default 80).' },
34
+ },
35
+ },
36
+ handler: async (input) => {
37
+ try {
38
+ const result = await coverageRoute(input.path || '', { threshold: input.threshold ?? 80 });
39
+ if (!result.found) {
40
+ return text('No coverage report found. Run your test suite with coverage enabled (e.g. `vitest run --coverage`), then retry.');
41
+ }
42
+ return text(result);
43
+ }
44
+ catch (err) {
45
+ return errorResult(`coverage_route failed: ${err instanceof Error ? err.message : String(err)}`);
46
+ }
47
+ },
48
+ },
49
+ {
50
+ name: 'coverage_gaps',
51
+ description: 'List files whose line coverage is below the threshold, each assigned to an ' +
52
+ 'appropriate agent (tester, backend-dev, security-architect, frontend-developer, coder), ' +
53
+ 'grouped by agent. Useful for fanning out coverage work across a swarm.',
54
+ category: 'coverage',
55
+ tags: ['coverage', 'gaps', 'testing'],
56
+ cacheable: true,
57
+ cacheTTL: 30_000,
58
+ inputSchema: {
59
+ type: 'object',
60
+ properties: {
61
+ threshold: { type: 'number', description: 'Coverage threshold percentage (default 80).' },
62
+ path: { type: 'string', description: 'Optional path prefix to scope the gaps.' },
63
+ },
64
+ },
65
+ handler: async (input) => {
66
+ try {
67
+ const result = await coverageGaps({
68
+ threshold: input.threshold ?? 80,
69
+ path: input.path || undefined,
70
+ groupByAgent: true,
71
+ });
72
+ if (!result.found)
73
+ return text(result.summary);
74
+ return text(result);
75
+ }
76
+ catch (err) {
77
+ return errorResult(`coverage_gaps failed: ${err instanceof Error ? err.message : String(err)}`);
78
+ }
79
+ },
80
+ },
81
+ {
82
+ name: 'coverage_suggest',
83
+ description: 'Suggest concrete test improvements for files below the coverage threshold under a ' +
84
+ 'given path — prioritized, with estimated effort and per-file suggested tests.',
85
+ category: 'coverage',
86
+ tags: ['coverage', 'suggestions', 'testing'],
87
+ cacheable: true,
88
+ cacheTTL: 30_000,
89
+ inputSchema: {
90
+ type: 'object',
91
+ properties: {
92
+ path: { type: 'string', description: 'Path prefix to suggest improvements for (default ".").' },
93
+ threshold: { type: 'number', description: 'Coverage threshold percentage (default 80).' },
94
+ limit: { type: 'number', description: 'Max suggestions to return (default 20).' },
95
+ },
96
+ },
97
+ handler: async (input) => {
98
+ try {
99
+ const result = await coverageSuggest(input.path || '.', { threshold: input.threshold ?? 80, limit: input.limit ?? 20 });
100
+ if (!result.found) {
101
+ return text('No coverage report found. Run your test suite with coverage enabled, then retry.');
102
+ }
103
+ return text(result);
104
+ }
105
+ catch (err) {
106
+ return errorResult(`coverage_suggest failed: ${err instanceof Error ? err.message : String(err)}`);
107
+ }
108
+ },
109
+ },
110
+ ];
111
+ export default coverageRouterTools;
112
+ //# sourceMappingURL=coverage-tools.js.map
@@ -157,7 +157,7 @@ export declare function suggestReviewers(files: DiffFile[], fileRisks: FileRisk[
157
157
  */
158
158
  export declare function analyzeDiff(options: {
159
159
  ref?: string;
160
- useRuVector?: boolean;
160
+ useMonoVector?: boolean;
161
161
  skipCache?: boolean;
162
162
  }): Promise<DiffAnalysisResult>;
163
163
  /**
@@ -165,7 +165,7 @@ export declare function analyzeDiff(options: {
165
165
  */
166
166
  export declare function analyzeDiffSync(options: {
167
167
  ref?: string;
168
- useRuVector?: boolean;
168
+ useMonoVector?: boolean;
169
169
  }): DiffAnalysisResult;
170
170
  /**
171
171
  * Clear all diff-related caches
@@ -0,0 +1,61 @@
1
+ /**
2
+ * MonoVector Integration Module for Monomind CLI (lean)
3
+ *
4
+ * After the SONA / native / WASM teardown this module provides only the
5
+ * lightweight surface:
6
+ * - Capability probing: getCapabilities() — stubbed, always reports JS-only
7
+ * - Initialization state: createInitState()
8
+ * - Keyword-based task routing: createKeywordRouter()
9
+ * - Route recommendation→outcome records: recordRoute(), joinOutcome(), accuracy
10
+ * - AST diff classification: DiffClassifier
11
+ *
12
+ * @module @monomind/cli/monovector
13
+ */
14
+ export { getCapabilities, getCachedCapabilities, resetCapabilitiesCache, refreshCapabilities, type MonoesCapabilities } from './capabilities.js';
15
+ export { createInitState, type InitState, type InitStatus } from './init-state.js';
16
+ export { recordRoute, joinOutcome, joinLatestUnresolved, readOutcomes, computeRoutingAccuracy, computeAdherence, type RouteOutcomeRecord, type RoutingAccuracy, } from './route-outcomes.js';
17
+ export { DiffClassifier, createDiffClassifier, analyzeDiff, analyzeDiffSync, assessFileRisk, assessOverallRisk, classifyDiff, suggestReviewers, getGitDiffNumstat, getGitDiffNumstatAsync, clearDiffCache, clearAllDiffCaches, type DiffClassification, type DiffHunk, type DiffChange, type FileDiff, type DiffAnalysis, type DiffClassifierConfig, type DiffFile, type RiskLevel, type FileRisk, type OverallRisk, type DiffAnalysisResult, } from './diff-classifier.js';
18
+ /** A single alternative route suggestion. */
19
+ export interface RouteAlternative {
20
+ route: string;
21
+ score?: number;
22
+ }
23
+ /** Statistics surfaced by the keyword router (stub fields for CLI display). */
24
+ export interface KeywordRouterStats {
25
+ updateCount: number;
26
+ qTableSize: number;
27
+ stepCount: number;
28
+ epsilon: number;
29
+ avgTDError: number;
30
+ useNative: number;
31
+ [key: string]: unknown;
32
+ }
33
+ export interface KeywordRouter {
34
+ route: (task: string, useExploration?: boolean) => Promise<RouteDecision>;
35
+ initialize: () => Promise<void>;
36
+ getStats: () => KeywordRouterStats;
37
+ /** Record feedback; returns the TD-error (0 in the lean keyword stub). */
38
+ update: (task: string, agentId: string, reward: number, nextTask?: string) => number;
39
+ reset: () => void;
40
+ export: () => unknown;
41
+ import: (data: unknown) => void;
42
+ }
43
+ export interface RouteDecision {
44
+ agentType: string;
45
+ confidence: number;
46
+ reasoning?: string;
47
+ route: string;
48
+ qValues?: number[];
49
+ explored?: boolean;
50
+ alternatives?: RouteAlternative[];
51
+ }
52
+ export interface KeywordRouterConfig {
53
+ learningRate?: number;
54
+ discountFactor?: number;
55
+ }
56
+ export declare function createKeywordRouter(_config?: KeywordRouterConfig): KeywordRouter;
57
+ /** @deprecated Use (await getCapabilities()).sona */
58
+ export declare function isMonovectorAvailable(): Promise<boolean>;
59
+ /** @deprecated Use (await getCapabilities()).learningWasm */
60
+ export declare function isWasmBackendAvailable(): Promise<boolean>;
61
+ //# sourceMappingURL=index.d.ts.map