@monoes/monomindcli 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.
- package/.claude/agents/core/coordinator.md +71 -0
- package/.claude/agents/generated/case-analyst.md +50 -0
- package/.claude/agents/generated/copy-editor.md +45 -0
- package/.claude/agents/generated/court-reporter.md +50 -0
- package/.claude/agents/generated/defender.md +51 -0
- package/.claude/agents/generated/editor-in-chief.md +45 -0
- package/.claude/agents/generated/fact-checker.md +45 -0
- package/.claude/agents/generated/judge.md +51 -0
- package/.claude/agents/generated/prosecutor.md +51 -0
- package/.claude/agents/generated/reporter.md +45 -0
- package/.claude/commands/hooks/README.md +1 -1
- package/.claude/commands/hooks/overview.md +1 -1
- package/.claude/commands/mastermind/_repeat.md +1 -1
- package/.claude/commands/mastermind/do.md +3 -1
- package/.claude/commands/mastermind/help.md +2 -2
- package/.claude/commands/mastermind/master.md +39 -6
- package/.claude/commands/mastermind/memory.md +1 -1
- package/.claude/commands/memory/memory-search.md +2 -2
- package/.claude/commands/monitoring/status.md +1 -1
- package/.claude/commands/{browse.md → monobrowse.md} +2 -2
- package/.claude/commands/sparc.md +1 -1
- package/.claude/helpers/handlers/graph-status-handler.cjs +1 -1
- package/.claude/helpers/loop-tracker.cjs +1 -1
- package/.claude/skills/agent-browser-testing/SKILL.md +1 -1
- package/.claude/skills/hooks-automation/SKILL.md +0 -3
- package/.claude/skills/mastermind/build.md +1 -1
- package/.claude/skills/mastermind/code-quality-reviewer-prompt.md +60 -0
- package/.claude/skills/mastermind/content.md +1 -1
- package/.claude/skills/mastermind/createorg.md +79 -2
- package/.claude/skills/mastermind/design.md +3 -1
- package/.claude/skills/mastermind/finance.md +1 -1
- package/.claude/skills/mastermind/implementer-prompt.md +109 -0
- package/.claude/skills/mastermind/marketing.md +1 -1
- package/.claude/skills/mastermind/ops.md +1 -1
- package/.claude/skills/mastermind/plan.md +20 -2
- package/.claude/skills/mastermind/release.md +1 -1
- package/.claude/skills/mastermind/research.md +1 -1
- package/.claude/skills/mastermind/review.md +1 -1
- package/.claude/skills/mastermind/sales.md +1 -1
- package/.claude/skills/mastermind/spec-reviewer-prompt.md +63 -0
- package/.claude/skills/sparc-methodology/SKILL.md +3 -3
- package/.claude/skills/swarm-advanced/SKILL.md +1 -4
- package/README.md +18 -32
- package/dist/src/agents/registry-builder.d.ts +1 -7
- package/dist/src/agents/registry-builder.d.ts.map +1 -1
- package/dist/src/agents/registry-builder.js +10 -6
- package/dist/src/agents/registry-builder.js.map +1 -1
- package/dist/src/benchmarks/benchmark-runner.d.ts +59 -12
- package/dist/src/benchmarks/benchmark-runner.d.ts.map +1 -1
- package/dist/src/benchmarks/benchmark-runner.js +67 -13
- package/dist/src/benchmarks/benchmark-runner.js.map +1 -1
- package/dist/src/benchmarks/metric-evaluators.d.ts.map +1 -1
- package/dist/src/benchmarks/metric-evaluators.js.map +1 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +0 -13
- package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -1
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent-wasm.d.ts +2 -2
- package/dist/src/commands/agent-wasm.js +5 -5
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +1 -6
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.d.ts +1 -1
- package/dist/src/commands/analyze.d.ts.map +1 -1
- package/dist/src/commands/analyze.js +8 -18
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +53 -3
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.d.ts.map +1 -1
- package/dist/src/commands/embeddings.js +9 -33
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +24 -76
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +4 -6
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +8 -15
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +2 -2
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.d.ts.map +1 -1
- package/dist/src/commands/issues.js +16 -11
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.d.ts +1 -1
- package/dist/src/commands/memory.js +6 -6
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.d.ts.map +1 -1
- package/dist/src/commands/migrate.js +1 -2
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/monograph.d.ts.map +1 -1
- package/dist/src/commands/monograph.js +18 -11
- package/dist/src/commands/monograph.js.map +1 -1
- package/dist/src/commands/monovector/backup.d.ts +11 -0
- package/dist/src/commands/monovector/backup.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/backup.js +25 -25
- package/dist/src/commands/monovector/backup.js.map +1 -0
- package/dist/src/commands/monovector/benchmark.d.ts +11 -0
- package/dist/src/commands/monovector/benchmark.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/benchmark.js +14 -14
- package/dist/src/commands/monovector/benchmark.js.map +1 -0
- package/dist/src/commands/monovector/import.d.ts +18 -0
- package/dist/src/commands/monovector/import.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/import.js +21 -21
- package/dist/src/commands/monovector/import.js.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/index.d.ts +6 -6
- package/dist/src/commands/monovector/index.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/index.js +22 -22
- package/dist/src/commands/monovector/index.js.map +1 -0
- package/dist/src/commands/monovector/init.d.ts +11 -0
- package/dist/src/commands/monovector/init.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/init.js +36 -36
- package/dist/src/commands/monovector/init.js.map +1 -0
- package/dist/src/commands/monovector/migrate.d.ts +11 -0
- package/dist/src/commands/monovector/migrate.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/migrate.js +16 -16
- package/dist/src/commands/monovector/migrate.js.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/optimize.d.ts +2 -2
- package/dist/src/commands/monovector/optimize.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/optimize.js +10 -10
- package/dist/src/commands/monovector/optimize.js.map +1 -0
- package/dist/src/commands/monovector/setup.d.ts +18 -0
- package/dist/src/commands/monovector/setup.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/setup.js +77 -77
- package/dist/src/commands/monovector/setup.js.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/status.d.ts +2 -2
- package/dist/src/commands/monovector/status.d.ts.map +1 -0
- package/dist/src/commands/{ruvector → monovector}/status.js +34 -34
- package/dist/src/commands/monovector/status.js.map +1 -0
- package/dist/src/commands/neural.d.ts +1 -1
- package/dist/src/commands/neural.d.ts.map +1 -1
- package/dist/src/commands/neural.js +31 -608
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.d.ts.map +1 -1
- package/dist/src/commands/performance.js +7 -10
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.d.ts.map +1 -1
- package/dist/src/commands/plugins.js +3 -4
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.d.ts.map +1 -1
- package/dist/src/commands/process.js +5 -12
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.d.ts.map +1 -1
- package/dist/src/commands/progress.js +16 -16
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/replay.d.ts.map +1 -1
- package/dist/src/commands/replay.js.map +1 -1
- package/dist/src/commands/route.d.ts +2 -2
- package/dist/src/commands/route.js +23 -23
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +0 -3
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +2 -3
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/update.d.ts +1 -1
- package/dist/src/config-adapter.d.ts.map +1 -1
- package/dist/src/config-adapter.js +27 -0
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/consensus/audit-writer.d.ts +44 -17
- package/dist/src/consensus/audit-writer.d.ts.map +1 -1
- package/dist/src/consensus/audit-writer.js.map +1 -1
- package/dist/src/dlq/dlq-replayer.d.ts +1 -1
- package/dist/src/dlq/dlq-replayer.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +10 -14
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +17 -27
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +1 -1
- package/dist/src/init/helpers-generator.js +2 -2
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +1 -7
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +9 -1
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +1 -52
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +5 -5
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts +4 -4
- package/dist/src/mcp-tools/autopilot-tools.d.ts +1 -1
- package/dist/src/mcp-tools/browser-tools.d.ts +1 -1
- package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +6 -5
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.d.ts +1 -1
- package/dist/src/mcp-tools/coordination-tools.d.ts +1 -1
- package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +51 -54
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.d.ts +1 -1
- package/dist/src/mcp-tools/daa-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +10 -10
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/guidance-tools.d.ts +1 -1
- package/dist/src/mcp-tools/guidance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/guidance-tools.js +0 -24
- package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +189 -446
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +0 -2
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +0 -2
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/monograph-compat.d.ts +334 -0
- package/dist/src/mcp-tools/monograph-compat.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph-compat.js +1108 -0
- package/dist/src/mcp-tools/monograph-compat.js.map +1 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.js +76 -34
- package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts +2 -2
- package/dist/src/mcp-tools/neural-tools.js +2 -2
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.d.ts +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.d.ts +2 -2
- package/dist/src/mcp-tools/ruvllm-tools.js +3 -3
- package/dist/src/mcp-tools/terminal-tools.d.ts +1 -1
- package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +29 -19
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.d.ts +1 -1
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/wasm-agent-tools.js +2 -2
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +14 -8
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +17 -2
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +76 -23
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +2 -2
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +37 -39
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/monovector/capabilities.d.ts +34 -0
- package/dist/src/monovector/capabilities.d.ts.map +1 -0
- package/dist/src/monovector/capabilities.js +37 -0
- package/dist/src/monovector/capabilities.js.map +1 -0
- package/dist/src/monovector/command-outcomes.d.ts +37 -0
- package/dist/src/monovector/command-outcomes.d.ts.map +1 -0
- package/dist/src/monovector/command-outcomes.js +87 -0
- package/dist/src/monovector/command-outcomes.js.map +1 -0
- package/dist/src/monovector/coverage-router.d.ts +103 -0
- package/dist/src/monovector/coverage-router.d.ts.map +1 -0
- package/dist/src/monovector/coverage-router.js +337 -0
- package/dist/src/monovector/coverage-router.js.map +1 -0
- package/dist/src/monovector/coverage-tools.d.ts +14 -0
- package/dist/src/monovector/coverage-tools.d.ts.map +1 -0
- package/dist/src/monovector/coverage-tools.js +112 -0
- package/dist/src/monovector/coverage-tools.js.map +1 -0
- package/dist/src/{ruvector → monovector}/diff-classifier.d.ts +2 -2
- package/dist/src/monovector/diff-classifier.d.ts.map +1 -0
- package/dist/src/monovector/diff-classifier.js.map +1 -0
- package/dist/src/monovector/index.d.ts +61 -0
- package/dist/src/monovector/index.d.ts.map +1 -0
- package/dist/src/monovector/index.js +67 -0
- package/dist/src/monovector/index.js.map +1 -0
- package/dist/src/monovector/init-state.d.ts +35 -0
- package/dist/src/monovector/init-state.d.ts.map +1 -0
- package/dist/src/monovector/init-state.js +36 -0
- package/dist/src/monovector/init-state.js.map +1 -0
- package/dist/src/monovector/route-outcomes.d.ts +55 -0
- package/dist/src/monovector/route-outcomes.d.ts.map +1 -0
- package/dist/src/monovector/route-outcomes.js +137 -0
- package/dist/src/monovector/route-outcomes.js.map +1 -0
- package/dist/src/parser.js +3 -3
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/store/discovery.d.ts.map +1 -1
- package/dist/src/plugins/store/discovery.js +0 -31
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/production/circuit-breaker.d.ts +26 -6
- package/dist/src/production/circuit-breaker.d.ts.map +1 -1
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.d.ts +55 -30
- package/dist/src/production/error-handler.d.ts.map +1 -1
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/index.d.ts +3 -20
- package/dist/src/production/index.d.ts.map +1 -1
- package/dist/src/production/index.js +3 -15
- package/dist/src/production/index.js.map +1 -1
- package/dist/src/production/monitoring.d.ts +54 -34
- package/dist/src/production/monitoring.d.ts.map +1 -1
- package/dist/src/production/monitoring.js +12 -14
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.d.ts +64 -19
- package/dist/src/production/rate-limiter.d.ts.map +1 -1
- package/dist/src/production/rate-limiter.js +5 -5
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.d.ts.map +1 -1
- package/dist/src/production/retry.js +4 -2
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/runtime/headless.d.ts +3 -3
- package/dist/src/services/claim-service.d.ts +50 -59
- package/dist/src/services/claim-service.d.ts.map +1 -1
- package/dist/src/services/claim-service.js +83 -50
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/config-file-manager.d.ts.map +1 -1
- package/dist/src/services/config-file-manager.js +8 -1
- package/dist/src/services/config-file-manager.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts.map +1 -1
- package/dist/src/services/worker-daemon.js +4 -0
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts +1 -1
- package/dist/src/transfer/storage/gcs.d.ts +1 -1
- package/dist/src/types.d.ts +13 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/ui/collector.mjs +51 -11
- package/dist/src/ui/dashboard.html +313 -88
- package/dist/src/ui/server.mjs +163 -8
- package/dist/src/update/checker.d.ts +1 -1
- package/dist/src/update/index.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/scripts/publish-registry.ts +0 -1
- package/.claude/commands/monomind/adr.md +0 -11
- package/.claude/commands/monomind/budget.md +0 -7
- package/.claude/commands/monomind/createtask.md +0 -277
- package/.claude/commands/monomind/do.md +0 -498
- package/.claude/commands/monomind/graph-status.md +0 -7
- package/.claude/commands/monomind/help.md +0 -118
- package/.claude/commands/monomind/idea.md +0 -273
- package/.claude/commands/monomind/improve.md +0 -352
- package/.claude/commands/monomind/loops.md +0 -7
- package/.claude/commands/monomind/memory.md +0 -230
- package/.claude/commands/monomind/repeat.md +0 -257
- package/.claude/commands/monomind/review.md +0 -317
- package/.claude/commands/monomind/specialagents.md +0 -125
- package/.claude/commands/monomind/swarm.md +0 -161
- package/.claude/commands/monomind/understand.md +0 -139
- package/.claude/commands/training/README.md +0 -39
- package/.claude/commands/training/neural-patterns.md +0 -73
- package/.claude/commands/training/neural-train.md +0 -79
- package/dist/src/commands/appliance-advanced.d.ts +0 -9
- package/dist/src/commands/appliance-advanced.d.ts.map +0 -1
- package/dist/src/commands/appliance-advanced.js +0 -238
- package/dist/src/commands/appliance-advanced.js.map +0 -1
- package/dist/src/commands/appliance.d.ts +0 -8
- package/dist/src/commands/appliance.d.ts.map +0 -1
- package/dist/src/commands/appliance.js +0 -406
- package/dist/src/commands/appliance.js.map +0 -1
- package/dist/src/commands/ruvector/backup.d.ts +0 -11
- package/dist/src/commands/ruvector/backup.d.ts.map +0 -1
- package/dist/src/commands/ruvector/backup.js.map +0 -1
- package/dist/src/commands/ruvector/benchmark.d.ts +0 -11
- package/dist/src/commands/ruvector/benchmark.d.ts.map +0 -1
- package/dist/src/commands/ruvector/benchmark.js.map +0 -1
- package/dist/src/commands/ruvector/import.d.ts +0 -18
- package/dist/src/commands/ruvector/import.d.ts.map +0 -1
- package/dist/src/commands/ruvector/import.js.map +0 -1
- package/dist/src/commands/ruvector/index.d.ts.map +0 -1
- package/dist/src/commands/ruvector/index.js.map +0 -1
- package/dist/src/commands/ruvector/init.d.ts +0 -11
- package/dist/src/commands/ruvector/init.d.ts.map +0 -1
- package/dist/src/commands/ruvector/init.js.map +0 -1
- package/dist/src/commands/ruvector/migrate.d.ts +0 -11
- package/dist/src/commands/ruvector/migrate.d.ts.map +0 -1
- package/dist/src/commands/ruvector/migrate.js.map +0 -1
- package/dist/src/commands/ruvector/optimize.d.ts.map +0 -1
- package/dist/src/commands/ruvector/optimize.js.map +0 -1
- package/dist/src/commands/ruvector/setup.d.ts +0 -18
- package/dist/src/commands/ruvector/setup.d.ts.map +0 -1
- package/dist/src/commands/ruvector/setup.js.map +0 -1
- package/dist/src/commands/ruvector/status.d.ts.map +0 -1
- package/dist/src/commands/ruvector/status.js.map +0 -1
- package/dist/src/ruvector/agent-wasm.d.ts +0 -182
- package/dist/src/ruvector/agent-wasm.d.ts.map +0 -1
- package/dist/src/ruvector/agent-wasm.js +0 -316
- package/dist/src/ruvector/agent-wasm.js.map +0 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/ast-analyzer.js +0 -277
- package/dist/src/ruvector/ast-analyzer.js.map +0 -1
- package/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
- package/dist/src/ruvector/coverage-router.js +0 -539
- package/dist/src/ruvector/coverage-router.js.map +0 -1
- package/dist/src/ruvector/coverage-tools.d.ts +0 -33
- package/dist/src/ruvector/coverage-tools.d.ts.map +0 -1
- package/dist/src/ruvector/coverage-tools.js +0 -157
- package/dist/src/ruvector/coverage-tools.js.map +0 -1
- package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
- package/dist/src/ruvector/diff-classifier.js.map +0 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
- package/dist/src/ruvector/enhanced-model-router.js +0 -551
- package/dist/src/ruvector/enhanced-model-router.js.map +0 -1
- package/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
- package/dist/src/ruvector/flash-attention.js +0 -643
- package/dist/src/ruvector/flash-attention.js.map +0 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/graph-analyzer.js +0 -929
- package/dist/src/ruvector/graph-analyzer.js.map +0 -1
- package/dist/src/ruvector/index.d.ts +0 -56
- package/dist/src/ruvector/index.d.ts.map +0 -1
- package/dist/src/ruvector/index.js +0 -58
- package/dist/src/ruvector/index.js.map +0 -1
- package/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
- package/dist/src/ruvector/lora-adapter.js +0 -455
- package/dist/src/ruvector/lora-adapter.js.map +0 -1
- package/dist/src/ruvector/model-router.d.ts +0 -222
- package/dist/src/ruvector/model-router.d.ts.map +0 -1
- package/dist/src/ruvector/model-router.js +0 -512
- package/dist/src/ruvector/model-router.js.map +0 -1
- package/dist/src/ruvector/moe-router.d.ts +0 -213
- package/dist/src/ruvector/moe-router.d.ts.map +0 -1
- package/dist/src/ruvector/moe-router.js +0 -649
- package/dist/src/ruvector/moe-router.js.map +0 -1
- package/dist/src/ruvector/q-learning-router.d.ts +0 -217
- package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
- package/dist/src/ruvector/q-learning-router.js +0 -712
- package/dist/src/ruvector/q-learning-router.js.map +0 -1
- package/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
- package/dist/src/ruvector/ruvllm-wasm.d.ts.map +0 -1
- package/dist/src/ruvector/ruvllm-wasm.js +0 -363
- package/dist/src/ruvector/ruvllm-wasm.js.map +0 -1
- package/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
- package/dist/src/ruvector/semantic-router.js +0 -178
- package/dist/src/ruvector/semantic-router.js.map +0 -1
- package/dist/src/ruvector/vector-db.d.ts +0 -69
- package/dist/src/ruvector/vector-db.d.ts.map +0 -1
- package/dist/src/ruvector/vector-db.js +0 -243
- package/dist/src/ruvector/vector-db.js.map +0 -1
- package/dist/src/services/ruvector-training.d.ts +0 -222
- package/dist/src/services/ruvector-training.d.ts.map +0 -1
- package/dist/src/services/ruvector-training.js +0 -696
- package/dist/src/services/ruvector-training.js.map +0 -1
- package/dist/src/ui/.monomind/loops/loop-1779095996252-mdjpp.json +0 -11
- package/dist/src/ui/data/agent-avatars.html +0 -763
- package/dist/src/ui/data/agent-avatars.json +0 -966
- package/dist/src/ui/data/avatars/account-strategist.svg +0 -58
- package/dist/src/ui/data/avatars/accounts-payable.svg +0 -54
- package/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -55
- package/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -54
- package/dist/src/ui/data/avatars/ai-citation.svg +0 -57
- package/dist/src/ui/data/avatars/ai-engineer.svg +0 -61
- package/dist/src/ui/data/avatars/analytics-reporter.svg +0 -53
- package/dist/src/ui/data/avatars/api-tester.svg +0 -53
- package/dist/src/ui/data/avatars/architecture.svg +0 -54
- package/dist/src/ui/data/avatars/automation-governance.svg +0 -55
- package/dist/src/ui/data/avatars/backend-dev.svg +0 -53
- package/dist/src/ui/data/avatars/benchmarker.svg +0 -54
- package/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -53
- package/dist/src/ui/data/avatars/byzantine-coord.svg +0 -57
- package/dist/src/ui/data/avatars/case-analyst.svg +0 -57
- package/dist/src/ui/data/avatars/cicd-engineer.svg +0 -55
- package/dist/src/ui/data/avatars/cloud-architect.svg +0 -54
- package/dist/src/ui/data/avatars/code-review-swarm.svg +0 -57
- package/dist/src/ui/data/avatars/coder-v119.svg +0 -57
- package/dist/src/ui/data/avatars/coder.svg +0 -58
- package/dist/src/ui/data/avatars/collective-coord.svg +0 -54
- package/dist/src/ui/data/avatars/compliance-auditor.svg +0 -58
- package/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -54
- package/dist/src/ui/data/avatars/content-creator.svg +0 -54
- package/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -53
- package/dist/src/ui/data/avatars/cro-specialist.svg +0 -58
- package/dist/src/ui/data/avatars/data-consolidator.svg +0 -54
- package/dist/src/ui/data/avatars/data-engineer.svg +0 -53
- package/dist/src/ui/data/avatars/database-optimizer.svg +0 -61
- package/dist/src/ui/data/avatars/deal-strategist.svg +0 -54
- package/dist/src/ui/data/avatars/defender.svg +0 -53
- package/dist/src/ui/data/avatars/devops-automator.svg +0 -56
- package/dist/src/ui/data/avatars/discovery-coach.svg +0 -54
- package/dist/src/ui/data/avatars/email-marketing.svg +0 -57
- package/dist/src/ui/data/avatars/embedded-firmware.svg +0 -61
- package/dist/src/ui/data/avatars/evidence-collector.svg +0 -57
- package/dist/src/ui/data/avatars/experiment-tracker.svg +0 -53
- package/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -54
- package/dist/src/ui/data/avatars/finance-tracker.svg +0 -54
- package/dist/src/ui/data/avatars/frontend-developer.svg +0 -54
- package/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -59
- package/dist/src/ui/data/avatars/game-designer.svg +0 -54
- package/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -54
- package/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -54
- package/dist/src/ui/data/avatars/incident-commander.svg +0 -57
- package/dist/src/ui/data/avatars/infrastructure.svg +0 -54
- package/dist/src/ui/data/avatars/input-validator.svg +0 -53
- package/dist/src/ui/data/avatars/ios-developer.svg +0 -54
- package/dist/src/ui/data/avatars/issue-tracker.svg +0 -53
- package/dist/src/ui/data/avatars/judge.svg +0 -55
- package/dist/src/ui/data/avatars/launch-strategist.svg +0 -54
- package/dist/src/ui/data/avatars/legal-compliance.svg +0 -53
- package/dist/src/ui/data/avatars/level-designer.svg +0 -53
- package/dist/src/ui/data/avatars/load-balancer.svg +0 -57
- package/dist/src/ui/data/avatars/mcp-builder.svg +0 -53
- package/dist/src/ui/data/avatars/memory-coordinator.svg +0 -55
- package/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -55
- package/dist/src/ui/data/avatars/ml-developer.svg +0 -58
- package/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -53
- package/dist/src/ui/data/avatars/mobile-dev.svg +0 -54
- package/dist/src/ui/data/avatars/model-qa.svg +0 -58
- package/dist/src/ui/data/avatars/narrative-designer.svg +0 -58
- package/dist/src/ui/data/avatars/outbound-strategist.svg +0 -55
- package/dist/src/ui/data/avatars/path-validator.svg +0 -54
- package/dist/src/ui/data/avatars/payment-agent.svg +0 -53
- package/dist/src/ui/data/avatars/perf-analyzer.svg +0 -58
- package/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -54
- package/dist/src/ui/data/avatars/planner.svg +0 -55
- package/dist/src/ui/data/avatars/pr-manager.svg +0 -54
- package/dist/src/ui/data/avatars/pricing-strategist.svg +0 -54
- package/dist/src/ui/data/avatars/product-manager.svg +0 -54
- package/dist/src/ui/data/avatars/production-validator.svg +0 -54
- package/dist/src/ui/data/avatars/project-shepherd.svg +0 -54
- package/dist/src/ui/data/avatars/proposal-strategist.svg +0 -54
- package/dist/src/ui/data/avatars/prosecutor.svg +0 -57
- package/dist/src/ui/data/avatars/pseudocode.svg +0 -53
- package/dist/src/ui/data/avatars/queen-coordinator.svg +0 -55
- package/dist/src/ui/data/avatars/quorum-manager.svg +0 -53
- package/dist/src/ui/data/avatars/raft-manager.svg +0 -53
- package/dist/src/ui/data/avatars/reality-checker.svg +0 -58
- package/dist/src/ui/data/avatars/recruitment.svg +0 -58
- package/dist/src/ui/data/avatars/refinement.svg +0 -53
- package/dist/src/ui/data/avatars/release-manager.svg +0 -54
- package/dist/src/ui/data/avatars/repo-architect.svg +0 -54
- package/dist/src/ui/data/avatars/researcher.svg +0 -58
- package/dist/src/ui/data/avatars/resource-allocator.svg +0 -53
- package/dist/src/ui/data/avatars/reviewer.svg +0 -53
- package/dist/src/ui/data/avatars/safe-executor.svg +0 -53
- package/dist/src/ui/data/avatars/sales-coach.svg +0 -53
- package/dist/src/ui/data/avatars/sales-engineer.svg +0 -58
- package/dist/src/ui/data/avatars/scout-explorer.svg +0 -58
- package/dist/src/ui/data/avatars/security-architect.svg +0 -54
- package/dist/src/ui/data/avatars/security-auditor.svg +0 -55
- package/dist/src/ui/data/avatars/senior-developer.svg +0 -58
- package/dist/src/ui/data/avatars/senior-pm.svg +0 -58
- package/dist/src/ui/data/avatars/seo-specialist.svg +0 -57
- package/dist/src/ui/data/avatars/social-media.svg +0 -54
- package/dist/src/ui/data/avatars/solidity-engineer.svg +0 -58
- package/dist/src/ui/data/avatars/sparc-coder.svg +0 -58
- package/dist/src/ui/data/avatars/sparc-coord.svg +0 -56
- package/dist/src/ui/data/avatars/specification.svg +0 -57
- package/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -53
- package/dist/src/ui/data/avatars/sre.svg +0 -54
- package/dist/src/ui/data/avatars/studio-operations.svg +0 -53
- package/dist/src/ui/data/avatars/studio-producer.svg +0 -55
- package/dist/src/ui/data/avatars/support-responder.svg +0 -56
- package/dist/src/ui/data/avatars/system-architect.svg +0 -54
- package/dist/src/ui/data/avatars/task-orchestrator.svg +0 -56
- package/dist/src/ui/data/avatars/technical-artist.svg +0 -53
- package/dist/src/ui/data/avatars/technical-writer.svg +0 -59
- package/dist/src/ui/data/avatars/tester.svg +0 -53
- package/dist/src/ui/data/avatars/threat-detection.svg +0 -61
- package/dist/src/ui/data/avatars/trend-researcher.svg +0 -54
- package/dist/src/ui/data/avatars/trial-director.svg +0 -55
- package/dist/src/ui/data/avatars/unity-architect.svg +0 -54
- package/dist/src/ui/data/avatars/visionos-engineer.svg +0 -57
- package/dist/src/ui/data/avatars/worker-specialist.svg +0 -55
- package/dist/src/ui/data/avatars/workflow-architect.svg +0 -57
- package/dist/src/ui/data/avatars/workflow-automation.svg +0 -54
- package/dist/src/ui/data/avatars/zk-steward.svg +0 -54
- package/dist/src/ui/data/known-projects.json +0 -1
- /package/dist/src/{ruvector → monovector}/diff-classifier.js +0 -0
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
import { mkdirSync, writeFileSync, renameSync, existsSync, readFileSync, statSync, unlinkSync, readdirSync } from 'fs';
|
|
6
6
|
import { dirname, join, resolve, sep } from 'path';
|
|
7
7
|
import { getProjectCwd } from './types.js';
|
|
8
|
+
import { getCapabilities } from '../monovector/capabilities.js';
|
|
9
|
+
import { randomUUID } from 'node:crypto';
|
|
10
|
+
import { recordRoute, joinOutcome, joinLatestUnresolved } from '../monovector/route-outcomes.js';
|
|
11
|
+
import { recordCommand, deriveRecentSuccess } from '../monovector/command-outcomes.js';
|
|
12
|
+
// Base dir for per-route outcome records — sits alongside routing-outcomes.json
|
|
13
|
+
function getRouteOutcomesBaseDir() {
|
|
14
|
+
return join(getProjectCwd(), '.monomind');
|
|
15
|
+
}
|
|
8
16
|
// Real vector search functions - lazy loaded to avoid circular imports
|
|
9
17
|
let searchEntriesFn = null;
|
|
10
18
|
async function getRealSearchFunction() {
|
|
@@ -64,29 +72,6 @@ async function getEWCConsolidator() {
|
|
|
64
72
|
}
|
|
65
73
|
return ewcConsolidator;
|
|
66
74
|
}
|
|
67
|
-
// MoE Router - lazy loaded
|
|
68
|
-
let moeRouter = null;
|
|
69
|
-
async function getMoERouter() {
|
|
70
|
-
if (!moeRouter) {
|
|
71
|
-
try {
|
|
72
|
-
const { getMoERouter: getMoE } = await import('../ruvector/moe-router.js');
|
|
73
|
-
moeRouter = await getMoE();
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
moeRouter = null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return moeRouter;
|
|
80
|
-
}
|
|
81
|
-
// Semantic Router - lazy loaded
|
|
82
|
-
// Tries native VectorDb first (16k+ routes/s HNSW), falls back to pure JS (47k routes/s cosine)
|
|
83
|
-
let semanticRouter = null;
|
|
84
|
-
let nativeVectorDb = null;
|
|
85
|
-
let semanticRouterInitialized = false;
|
|
86
|
-
let routerBackend = 'none';
|
|
87
|
-
// Pre-computed embeddings for common task patterns (cached, capped to prevent unbounded growth)
|
|
88
|
-
const MAX_PATTERN_EMBEDDINGS = 2000;
|
|
89
|
-
const TASK_PATTERN_EMBEDDINGS = new Map();
|
|
90
75
|
function generateSimpleEmbedding(text, dimension = 384) {
|
|
91
76
|
// Simple deterministic embedding based on character codes
|
|
92
77
|
// This is for routing purposes where we need consistent, fast embeddings
|
|
@@ -125,7 +110,10 @@ function generateSimpleEmbedding(text, dimension = 384) {
|
|
|
125
110
|
}
|
|
126
111
|
// ── Runtime routing outcome persistence ──────────────────────────────
|
|
127
112
|
// Closes the learning loop: post-task records outcomes → route loads them.
|
|
128
|
-
|
|
113
|
+
// Evaluated lazily via getter so it uses runtime CWD, not import-time CWD
|
|
114
|
+
function getRoutingOutcomesPath() {
|
|
115
|
+
return join(getProjectCwd(), '.monomind', 'routing-outcomes.json');
|
|
116
|
+
}
|
|
129
117
|
const ROUTING_STOPWORDS = new Set([
|
|
130
118
|
'the', 'a', 'an', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had',
|
|
131
119
|
'do', 'does', 'did', 'will', 'would', 'could', 'should', 'may', 'might', 'shall', 'can',
|
|
@@ -146,8 +134,8 @@ function extractKeywords(text) {
|
|
|
146
134
|
}
|
|
147
135
|
function loadRoutingOutcomes() {
|
|
148
136
|
try {
|
|
149
|
-
if (existsSync(
|
|
150
|
-
const data = JSON.parse(readFileSync(
|
|
137
|
+
if (existsSync(getRoutingOutcomesPath())) {
|
|
138
|
+
const data = JSON.parse(readFileSync(getRoutingOutcomesPath(), 'utf-8'));
|
|
151
139
|
return data.outcomes || [];
|
|
152
140
|
}
|
|
153
141
|
}
|
|
@@ -156,14 +144,14 @@ function loadRoutingOutcomes() {
|
|
|
156
144
|
}
|
|
157
145
|
function saveRoutingOutcomes(outcomes) {
|
|
158
146
|
try {
|
|
159
|
-
const dir = dirname(
|
|
147
|
+
const dir = dirname(getRoutingOutcomesPath());
|
|
160
148
|
if (!existsSync(dir))
|
|
161
149
|
mkdirSync(dir, { recursive: true });
|
|
162
150
|
// Cap at 500 entries to bound file size
|
|
163
151
|
const capped = outcomes.slice(-500);
|
|
164
|
-
const tmp =
|
|
152
|
+
const tmp = getRoutingOutcomesPath() + '.tmp';
|
|
165
153
|
writeFileSync(tmp, JSON.stringify({ outcomes: capped }, null, 2));
|
|
166
|
-
renameSync(tmp,
|
|
154
|
+
renameSync(tmp, getRoutingOutcomesPath());
|
|
167
155
|
}
|
|
168
156
|
catch { /* non-critical */ }
|
|
169
157
|
}
|
|
@@ -257,107 +245,6 @@ const TASK_PATTERNS = {
|
|
|
257
245
|
agents: ['memory-specialist', 'architect', 'coder'],
|
|
258
246
|
},
|
|
259
247
|
};
|
|
260
|
-
/**
|
|
261
|
-
* Get the semantic router with environment detection.
|
|
262
|
-
* Tries native VectorDb first (HNSW, 16k routes/s), falls back to pure JS (47k routes/s cosine).
|
|
263
|
-
*/
|
|
264
|
-
async function getSemanticRouter() {
|
|
265
|
-
if (semanticRouterInitialized) {
|
|
266
|
-
return { router: semanticRouter, backend: routerBackend, native: nativeVectorDb };
|
|
267
|
-
}
|
|
268
|
-
semanticRouterInitialized = true;
|
|
269
|
-
// STEP 1: Try native VectorDb from @ruvector/router (HNSW-backed)
|
|
270
|
-
// Note: Native VectorDb uses a persistent database file which can have lock issues
|
|
271
|
-
// in concurrent environments. We try it first but fall back gracefully to pure JS.
|
|
272
|
-
try {
|
|
273
|
-
// Use createRequire for ESM compatibility with native modules
|
|
274
|
-
const { createRequire } = await import('module');
|
|
275
|
-
const require = createRequire(import.meta.url);
|
|
276
|
-
const router = require('@ruvector/router');
|
|
277
|
-
if (router.VectorDb && router.DistanceMetric) {
|
|
278
|
-
// Try to create VectorDb - may fail with lock error in concurrent envs
|
|
279
|
-
const db = new router.VectorDb({
|
|
280
|
-
dimensions: 384,
|
|
281
|
-
distanceMetric: router.DistanceMetric.Cosine,
|
|
282
|
-
hnswM: 16,
|
|
283
|
-
hnswEfConstruction: 200,
|
|
284
|
-
hnswEfSearch: 100,
|
|
285
|
-
});
|
|
286
|
-
// Initialize with static + runtime-learned task patterns
|
|
287
|
-
for (const [patternName, { keywords }] of Object.entries(getMergedTaskPatterns())) {
|
|
288
|
-
for (const keyword of keywords) {
|
|
289
|
-
const embedding = generateSimpleEmbedding(keyword);
|
|
290
|
-
db.insert(`${patternName}:${keyword}`, embedding);
|
|
291
|
-
if (TASK_PATTERN_EMBEDDINGS.size < MAX_PATTERN_EMBEDDINGS) {
|
|
292
|
-
TASK_PATTERN_EMBEDDINGS.set(`${patternName}:${keyword}`, embedding);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
nativeVectorDb = db;
|
|
297
|
-
routerBackend = 'native';
|
|
298
|
-
return { router: null, backend: routerBackend, native: nativeVectorDb };
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
catch (err) {
|
|
302
|
-
// Native not available or database locked - fall back to pure JS
|
|
303
|
-
// Common errors: "Database already open. Cannot acquire lock." or "MODULE_NOT_FOUND"
|
|
304
|
-
// This is expected in concurrent environments or when binary isn't installed
|
|
305
|
-
}
|
|
306
|
-
// STEP 2: Fall back to pure JS SemanticRouter
|
|
307
|
-
try {
|
|
308
|
-
const { SemanticRouter } = await import('../ruvector/semantic-router.js');
|
|
309
|
-
semanticRouter = new SemanticRouter({ dimension: 384 });
|
|
310
|
-
for (const [patternName, { keywords, agents }] of Object.entries(getMergedTaskPatterns())) {
|
|
311
|
-
const embeddings = keywords.map(kw => generateSimpleEmbedding(kw));
|
|
312
|
-
semanticRouter.addIntentWithEmbeddings(patternName, embeddings, { agents, keywords });
|
|
313
|
-
// Cache embeddings for keywords (capped)
|
|
314
|
-
keywords.forEach((kw, i) => {
|
|
315
|
-
if (TASK_PATTERN_EMBEDDINGS.size < MAX_PATTERN_EMBEDDINGS) {
|
|
316
|
-
TASK_PATTERN_EMBEDDINGS.set(kw, embeddings[i]);
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
routerBackend = 'pure-js';
|
|
321
|
-
}
|
|
322
|
-
catch {
|
|
323
|
-
semanticRouter = null;
|
|
324
|
-
routerBackend = 'none';
|
|
325
|
-
}
|
|
326
|
-
return { router: semanticRouter, backend: routerBackend, native: nativeVectorDb };
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Get router backend info for status display.
|
|
330
|
-
*/
|
|
331
|
-
function getRouterBackendInfo() {
|
|
332
|
-
switch (routerBackend) {
|
|
333
|
-
case 'native':
|
|
334
|
-
return { backend: 'native VectorDb (HNSW)', speed: '16k+ routes/s' };
|
|
335
|
-
case 'pure-js':
|
|
336
|
-
return { backend: 'pure JS (cosine)', speed: '47k routes/s' };
|
|
337
|
-
default:
|
|
338
|
-
return { backend: 'none', speed: 'N/A' };
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// Flash Attention - lazy loaded
|
|
342
|
-
let flashAttention = null;
|
|
343
|
-
async function getFlashAttention() {
|
|
344
|
-
if (!flashAttention) {
|
|
345
|
-
try {
|
|
346
|
-
const { getFlashAttention: getFlash } = await import('../ruvector/flash-attention.js');
|
|
347
|
-
flashAttention = await getFlash();
|
|
348
|
-
}
|
|
349
|
-
catch {
|
|
350
|
-
flashAttention = null;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
return flashAttention;
|
|
354
|
-
}
|
|
355
|
-
// LoRA Adapter removed — superseded by SONA instant adaptation
|
|
356
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
357
|
-
let loraAdapter = null;
|
|
358
|
-
async function getLoRAAdapter() {
|
|
359
|
-
return loraAdapter;
|
|
360
|
-
}
|
|
361
248
|
// In-memory trajectory tracking (persisted on end)
|
|
362
249
|
const activeTrajectories = new Map();
|
|
363
250
|
const MEMORY_DIR = '.monomind/memory';
|
|
@@ -533,6 +420,12 @@ function suggestAgentsForTask(task) {
|
|
|
533
420
|
// Canonical set of valid monomind agent type strings.
|
|
534
421
|
// Patterns whose type is not in this set (e.g. 'action', 'observation', 'routing')
|
|
535
422
|
// are structural labels, not agent names, and must be excluded from routing.
|
|
423
|
+
//
|
|
424
|
+
// Lean teardown: the SONA neural LoRA routing adaptation (applyNeuralAdaptation +
|
|
425
|
+
// the @monomind/neural NeuralLearningSystem singleton) has been removed. Routing now
|
|
426
|
+
// uses the pure keyword path plus the deterministic generateSimpleEmbedding query
|
|
427
|
+
// against the pattern index, with outcomes recorded via route-outcomes. No ONNX /
|
|
428
|
+
// LoRA inference happens on the routing hot path anymore.
|
|
536
429
|
const VALID_AGENT_TYPES = new Set([
|
|
537
430
|
'coder', 'reviewer', 'tester', 'planner', 'researcher',
|
|
538
431
|
'architect', 'security-architect', 'security-auditor',
|
|
@@ -668,6 +561,9 @@ export const hooksPostEdit = {
|
|
|
668
561
|
success,
|
|
669
562
|
quality: success ? 0.85 : 0.3,
|
|
670
563
|
agent,
|
|
564
|
+
// B1.2: give the SONA embedder real semantics (the edited file) instead of
|
|
565
|
+
// the opaque task ID.
|
|
566
|
+
task: `edit ${filePath}`,
|
|
671
567
|
});
|
|
672
568
|
}
|
|
673
569
|
catch {
|
|
@@ -735,6 +631,14 @@ export const hooksPostCommand = {
|
|
|
735
631
|
const command = params.command;
|
|
736
632
|
const exitCode = params.exitCode || 0;
|
|
737
633
|
const success = exitCode === 0;
|
|
634
|
+
// Record the real exit code in the time-windowed command-outcome store so
|
|
635
|
+
// post-task can derive a MEASURED success signal (grounded in actual exit
|
|
636
|
+
// codes) when the caller does not explicitly assert --success. Non-fatal.
|
|
637
|
+
await recordCommand(getRouteOutcomesBaseDir(), {
|
|
638
|
+
ts: Date.now(),
|
|
639
|
+
command: typeof command === 'string' ? command.slice(0, 200) : String(command).slice(0, 200),
|
|
640
|
+
exitCode,
|
|
641
|
+
});
|
|
738
642
|
// Persist command outcome via AgentDB
|
|
739
643
|
let _storedIn = 'none';
|
|
740
644
|
try {
|
|
@@ -798,10 +702,26 @@ export const hooksRoute = {
|
|
|
798
702
|
if (agentdbRoute && agentdbRoute.confidence > 0.5) {
|
|
799
703
|
const agents = agentdbRoute.agents.length > 0 ? agentdbRoute.agents : ['coder', 'researcher'];
|
|
800
704
|
const complexity = task.length > 200 ? 'high' : task.length < 50 ? 'low' : 'medium';
|
|
705
|
+
const agentdbMethod = `agentdb-${agentdbRoute.controller}`;
|
|
706
|
+
const agentdbConfidence = Math.round(agentdbRoute.confidence * 100) / 100;
|
|
707
|
+
// Record the route recommendation so post-task can join the actual outcome
|
|
708
|
+
const routeId = randomUUID();
|
|
709
|
+
const caps = await getCapabilities();
|
|
710
|
+
const learningMode = (caps.sona || caps.router === 'native' || caps.attention) ? 'native' : 'js';
|
|
711
|
+
await recordRoute(getRouteOutcomesBaseDir(), {
|
|
712
|
+
routeId,
|
|
713
|
+
ts: Date.now(),
|
|
714
|
+
task,
|
|
715
|
+
recommendedAgent: agents[0],
|
|
716
|
+
routingMethod: agentdbMethod,
|
|
717
|
+
confidence: agentdbConfidence,
|
|
718
|
+
learningMode,
|
|
719
|
+
});
|
|
801
720
|
return {
|
|
721
|
+
routeId,
|
|
802
722
|
task,
|
|
803
723
|
routing: {
|
|
804
|
-
method:
|
|
724
|
+
method: agentdbMethod,
|
|
805
725
|
backend: agentdbRoute.controller,
|
|
806
726
|
latencyMs: 0,
|
|
807
727
|
throughput: 'N/A',
|
|
@@ -831,81 +751,16 @@ export const hooksRoute = {
|
|
|
831
751
|
// AgentDB router not available — fall through to local routing
|
|
832
752
|
}
|
|
833
753
|
}
|
|
834
|
-
//
|
|
835
|
-
const
|
|
836
|
-
? await getSemanticRouter()
|
|
837
|
-
: { router: null, backend: 'none', native: null };
|
|
838
|
-
let semanticResult = [];
|
|
754
|
+
// Deterministic keyword routing is the baseline (and only) local path.
|
|
755
|
+
const semanticResult = [];
|
|
839
756
|
let routingMethod = 'keyword';
|
|
840
|
-
|
|
757
|
+
const routingLatencyMs = 0;
|
|
841
758
|
let backendInfo = '';
|
|
842
|
-
|
|
843
|
-
// Apply LoRA adaptations from the neural system when available.
|
|
844
|
-
// This is the path where learned weights actually influence routing:
|
|
845
|
-
// the query embedding is transformed by the session-trained LoRA before
|
|
846
|
-
// being compared against the semantic router's pattern embeddings.
|
|
847
|
-
let queryEmbedding = generateSimpleEmbedding(queryText);
|
|
848
|
-
try {
|
|
849
|
-
const neural = await import('@monomind/neural').catch(() => null);
|
|
850
|
-
if (neural?.createNeuralLearningSystem) {
|
|
851
|
-
const sys = neural.createNeuralLearningSystem('balanced');
|
|
852
|
-
await sys.initialize();
|
|
853
|
-
// applyAdaptations uses the LoRA weights from learned-state.json
|
|
854
|
-
// (loaded during initialize()) to transform the query embedding.
|
|
855
|
-
const base = generateSimpleEmbedding(queryText, 768);
|
|
856
|
-
const adapted = await sys.getSONAManager().applyAdaptations(base);
|
|
857
|
-
// Down-project to 384 to match the semantic router's expected dimension
|
|
858
|
-
queryEmbedding = adapted.slice(0, 384);
|
|
859
|
-
await sys.cleanup();
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
catch { /* fall through to hash embedding */ }
|
|
863
|
-
// Try native VectorDb (HNSW-backed)
|
|
864
|
-
if (native && backend === 'native') {
|
|
865
|
-
const routeStart = performance.now();
|
|
866
|
-
try {
|
|
867
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
868
|
-
const results = native.search(queryEmbedding, 5);
|
|
869
|
-
routingLatencyMs = performance.now() - routeStart;
|
|
870
|
-
routingMethod = 'semantic-native';
|
|
871
|
-
backendInfo = 'native VectorDb (HNSW)';
|
|
872
|
-
// Convert results to semantic format
|
|
873
|
-
const mergedPatterns = getMergedTaskPatterns();
|
|
874
|
-
semanticResult = results.map((r) => {
|
|
875
|
-
const [patternName] = r.id.split(':');
|
|
876
|
-
const pattern = mergedPatterns[patternName];
|
|
877
|
-
return {
|
|
878
|
-
intent: patternName,
|
|
879
|
-
score: 1 - r.score, // Native uses distance (lower is better), convert to similarity
|
|
880
|
-
metadata: {
|
|
881
|
-
agents: pattern?.agents || (patternName.startsWith('learned-') ? [patternName.slice(8)] : ['coder']),
|
|
882
|
-
},
|
|
883
|
-
};
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
catch {
|
|
887
|
-
// Native failed, try pure JS fallback
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
// Try pure JS SemanticRouter fallback
|
|
891
|
-
if (router && backend === 'pure-js' && semanticResult.length === 0) {
|
|
892
|
-
const routeStart = performance.now();
|
|
893
|
-
semanticResult = router.routeWithEmbedding(queryEmbedding, 3);
|
|
894
|
-
routingLatencyMs = performance.now() - routeStart;
|
|
895
|
-
routingMethod = 'semantic-pure-js';
|
|
896
|
-
backendInfo = 'pure JS (cosine similarity)';
|
|
897
|
-
}
|
|
898
|
-
// Get agents from semantic routing or fall back to keyword
|
|
759
|
+
// Get agents from keyword routing
|
|
899
760
|
let agents;
|
|
900
761
|
let confidence;
|
|
901
762
|
let matchedPattern = '';
|
|
902
|
-
|
|
903
|
-
const topMatch = semanticResult[0];
|
|
904
|
-
agents = topMatch.metadata.agents || ['coder', 'researcher'];
|
|
905
|
-
confidence = topMatch.score;
|
|
906
|
-
matchedPattern = topMatch.intent;
|
|
907
|
-
}
|
|
908
|
-
else {
|
|
763
|
+
{
|
|
909
764
|
// Keyword fallback is the baseline
|
|
910
765
|
const keywordSuggestion = suggestAgentsForTask(task);
|
|
911
766
|
agents = keywordSuggestion.agents;
|
|
@@ -939,7 +794,22 @@ export const hooksRoute = {
|
|
|
939
794
|
: taskLower.includes('simple') || taskLower.includes('fix') || task.length < 50
|
|
940
795
|
? 'low'
|
|
941
796
|
: 'medium';
|
|
797
|
+
const primaryConfidence = Math.round(confidence * 100) / 100;
|
|
798
|
+
// Record the route recommendation so post-task can join the actual outcome
|
|
799
|
+
const routeId = randomUUID();
|
|
800
|
+
const caps = await getCapabilities();
|
|
801
|
+
const learningMode = (caps.sona || caps.router === 'native' || caps.attention) ? 'native' : 'js';
|
|
802
|
+
await recordRoute(getRouteOutcomesBaseDir(), {
|
|
803
|
+
routeId,
|
|
804
|
+
ts: Date.now(),
|
|
805
|
+
task,
|
|
806
|
+
recommendedAgent: agents[0],
|
|
807
|
+
routingMethod,
|
|
808
|
+
confidence: primaryConfidence,
|
|
809
|
+
learningMode,
|
|
810
|
+
});
|
|
942
811
|
return {
|
|
812
|
+
routeId,
|
|
943
813
|
task,
|
|
944
814
|
routing: {
|
|
945
815
|
method: routingMethod,
|
|
@@ -1102,43 +972,8 @@ export const hooksPreTask = {
|
|
|
1102
972
|
: descLower.includes('simple') || descLower.includes('fix') || description.length < 50
|
|
1103
973
|
? 'low'
|
|
1104
974
|
: 'medium';
|
|
1105
|
-
// Enhanced model routing
|
|
1106
|
-
|
|
1107
|
-
try {
|
|
1108
|
-
const { getEnhancedModelRouter } = await import('../ruvector/enhanced-model-router.js');
|
|
1109
|
-
const router = getEnhancedModelRouter();
|
|
1110
|
-
const routeResult = await router.route(description, { filePath });
|
|
1111
|
-
if (routeResult.tier === 1) {
|
|
1112
|
-
// Agent Booster can handle this task
|
|
1113
|
-
modelRouting = {
|
|
1114
|
-
tier: 1,
|
|
1115
|
-
handler: 'agent-booster',
|
|
1116
|
-
canSkipLLM: true,
|
|
1117
|
-
agentBoosterIntent: routeResult.agentBoosterIntent?.type,
|
|
1118
|
-
intentDescription: routeResult.agentBoosterIntent?.description,
|
|
1119
|
-
confidence: routeResult.confidence,
|
|
1120
|
-
estimatedLatencyMs: routeResult.estimatedLatencyMs,
|
|
1121
|
-
estimatedCost: routeResult.estimatedCost,
|
|
1122
|
-
recommendation: `[AGENT_BOOSTER_AVAILABLE] Skip LLM - use Agent Booster for "${routeResult.agentBoosterIntent?.type}"`,
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
else {
|
|
1126
|
-
// LLM required
|
|
1127
|
-
modelRouting = {
|
|
1128
|
-
tier: routeResult.tier,
|
|
1129
|
-
handler: routeResult.handler,
|
|
1130
|
-
model: routeResult.model,
|
|
1131
|
-
complexity: routeResult.complexity,
|
|
1132
|
-
confidence: routeResult.confidence,
|
|
1133
|
-
estimatedLatencyMs: routeResult.estimatedLatencyMs,
|
|
1134
|
-
estimatedCost: routeResult.estimatedCost,
|
|
1135
|
-
recommendation: `[TASK_MODEL_RECOMMENDATION] Use model="${routeResult.model}" for this task`,
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
catch {
|
|
1140
|
-
// Enhanced router not available
|
|
1141
|
-
}
|
|
975
|
+
// Enhanced model routing module was never shipped — modelRouting stays undefined.
|
|
976
|
+
const modelRouting = undefined;
|
|
1142
977
|
// ERL: Retrieve past heuristics to inject into recommendations
|
|
1143
978
|
// Source: https://arxiv.org/abs/2603.24639
|
|
1144
979
|
const erlHints = [];
|
|
@@ -1212,12 +1047,37 @@ export const hooksPostTask = {
|
|
|
1212
1047
|
quality: { type: 'number', description: 'Quality score (0-1)' },
|
|
1213
1048
|
task: { type: 'string', description: 'Task description text (used for learning keyword extraction)' },
|
|
1214
1049
|
storeDecisions: { type: 'boolean', description: 'Also store routing decision in memory DB' },
|
|
1050
|
+
routeId: { type: 'string', description: 'Route ID from a prior hooks_route call — joins the recommendation to this outcome' },
|
|
1215
1051
|
},
|
|
1216
1052
|
required: ['taskId'],
|
|
1217
1053
|
},
|
|
1218
1054
|
handler: async (params) => {
|
|
1219
1055
|
const taskId = params.taskId;
|
|
1220
|
-
|
|
1056
|
+
// The success flag, when the caller asserts it (--success true), is taken as
|
|
1057
|
+
// ground truth. But callers usually do NOT pass it. Rather than treating every
|
|
1058
|
+
// unverified task as "unknown" (and thus excluding it from learning), we now
|
|
1059
|
+
// derive a MEASURED success signal from the real command exit codes recorded by
|
|
1060
|
+
// post-command within a recent time window. post-command appends each exit code
|
|
1061
|
+
// to the command-outcome store keyed by timestamp; deriveRecentSuccess returns:
|
|
1062
|
+
// true → recent commands exist and ALL exited 0
|
|
1063
|
+
// false → recent commands exist and ANY exited non-zero
|
|
1064
|
+
// null → no recent commands (genuinely no signal → stays unknown)
|
|
1065
|
+
// Precedence: an explicit --success ALWAYS wins; the derived signal only fills
|
|
1066
|
+
// in when no explicit flag is given; only when there is also no recent command
|
|
1067
|
+
// signal does the outcome stay unknown (and excluded from SONA + route join,
|
|
1068
|
+
// per the existing "unknown ≠ success" principle).
|
|
1069
|
+
const explicitSuccess = typeof params.success === 'boolean';
|
|
1070
|
+
let outcomeKnown = explicitSuccess;
|
|
1071
|
+
let success = params.success !== false;
|
|
1072
|
+
let successSource = explicitSuccess ? 'explicit' : 'unknown';
|
|
1073
|
+
if (!explicitSuccess) {
|
|
1074
|
+
const derived = await deriveRecentSuccess(getRouteOutcomesBaseDir());
|
|
1075
|
+
if (derived !== null) {
|
|
1076
|
+
outcomeKnown = true;
|
|
1077
|
+
success = derived;
|
|
1078
|
+
successSource = 'derived-commands';
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1221
1081
|
const agent = params.agent;
|
|
1222
1082
|
const quality = params.quality || (success ? 0.85 : 0.3);
|
|
1223
1083
|
const startTime = Date.now();
|
|
@@ -1230,6 +1090,11 @@ export const hooksPostTask = {
|
|
|
1230
1090
|
success,
|
|
1231
1091
|
quality,
|
|
1232
1092
|
agent,
|
|
1093
|
+
// B1.2: thread the real task description into the SONA trajectory so the
|
|
1094
|
+
// embedder encodes meaning, not the opaque task ID.
|
|
1095
|
+
task: params.task || undefined,
|
|
1096
|
+
// B1.3: only feed the SONA LoRA update when the outcome is actually known.
|
|
1097
|
+
outcomeKnown,
|
|
1233
1098
|
duration: params.duration || undefined,
|
|
1234
1099
|
patterns: params.patterns || undefined,
|
|
1235
1100
|
});
|
|
@@ -1250,11 +1115,14 @@ export const hooksPostTask = {
|
|
|
1250
1115
|
catch {
|
|
1251
1116
|
// Non-fatal
|
|
1252
1117
|
}
|
|
1253
|
-
// Persist routing outcome for runtime learning (file-based, always reliable)
|
|
1118
|
+
// Persist routing outcome for runtime learning (file-based, always reliable).
|
|
1119
|
+
// B1.3: also gate this sibling learning sink on a known outcome — an unverified
|
|
1120
|
+
// task must not train the router as a success either. When the caller did not
|
|
1121
|
+
// assert success, the outcome is unknown and we skip persisting a labeled sample.
|
|
1254
1122
|
const taskText = params.task || '';
|
|
1255
1123
|
const outcomeKeywords = extractKeywords(taskText);
|
|
1256
1124
|
let outcomePersisted = false;
|
|
1257
|
-
if (taskText && agent && agent.length <= 100 && /^[a-zA-Z0-9_-]+$/.test(agent)) {
|
|
1125
|
+
if (outcomeKnown && taskText && agent && agent.length <= 100 && /^[a-zA-Z0-9_-]+$/.test(agent)) {
|
|
1258
1126
|
try {
|
|
1259
1127
|
const outcomes = loadRoutingOutcomes();
|
|
1260
1128
|
outcomes.push({
|
|
@@ -1270,6 +1138,26 @@ export const hooksPostTask = {
|
|
|
1270
1138
|
}
|
|
1271
1139
|
catch { /* non-critical */ }
|
|
1272
1140
|
}
|
|
1141
|
+
// Join this outcome back onto the original route recommendation. This is the
|
|
1142
|
+
// recommendation→actual→success link that routing-accuracy metrics and SONA
|
|
1143
|
+
// labels depend on. When the caller threads an explicit routeId we join that
|
|
1144
|
+
// record; otherwise we auto-correlate to the most recent unresolved route
|
|
1145
|
+
// (within a 10-min window) so the loop closes without the LLM manually
|
|
1146
|
+
// threading the routeId. Only join when the outcome is actually measured —
|
|
1147
|
+
// per "unknown ≠ success", an unverified task must not pollute the metric.
|
|
1148
|
+
if (outcomeKnown) {
|
|
1149
|
+
const outcome = {
|
|
1150
|
+
agentActuallyUsed: agent,
|
|
1151
|
+
measuredSuccess: success,
|
|
1152
|
+
quality: typeof params.quality === 'number' ? params.quality : undefined,
|
|
1153
|
+
};
|
|
1154
|
+
if (params.routeId) {
|
|
1155
|
+
await joinOutcome(getRouteOutcomesBaseDir(), params.routeId, outcome);
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
await joinLatestUnresolved(getRouteOutcomesBaseDir(), outcome);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1273
1161
|
// ERL: Extract and persist structured heuristic for future pre-task injection
|
|
1274
1162
|
// Source: https://arxiv.org/abs/2603.24639
|
|
1275
1163
|
if (taskText && agent && success !== undefined) {
|
|
@@ -1342,6 +1230,8 @@ export const hooksPostTask = {
|
|
|
1342
1230
|
return {
|
|
1343
1231
|
taskId,
|
|
1344
1232
|
success,
|
|
1233
|
+
outcomeKnown,
|
|
1234
|
+
successSource,
|
|
1345
1235
|
duration,
|
|
1346
1236
|
learningUpdates: {
|
|
1347
1237
|
patternsUpdated: feedbackResult?.updated || (success ? 2 : 1),
|
|
@@ -1393,7 +1283,7 @@ export const hooksExplain = {
|
|
|
1393
1283
|
let historicalSuccess = null;
|
|
1394
1284
|
let historicalNote = 'No historical data yet';
|
|
1395
1285
|
try {
|
|
1396
|
-
const outcomesPath =
|
|
1286
|
+
const outcomesPath = getRoutingOutcomesPath();
|
|
1397
1287
|
if (existsSync(outcomesPath)) {
|
|
1398
1288
|
const data = JSON.parse(readFileSync(outcomesPath, 'utf-8'));
|
|
1399
1289
|
const outcomes = data.outcomes || [];
|
|
@@ -1809,7 +1699,11 @@ export const hooksSessionEnd = {
|
|
|
1809
1699
|
handler: async (params) => {
|
|
1810
1700
|
const saveState = params.saveState !== false;
|
|
1811
1701
|
const shouldStopDaemon = params.stopDaemon !== false;
|
|
1812
|
-
|
|
1702
|
+
// Use caller-supplied sessionId if provided, otherwise generate a current-time ID.
|
|
1703
|
+
// The -3600000 offset was incorrect — it prevented matching session-start IDs.
|
|
1704
|
+
const sessionId = typeof params.sessionId === 'string' && params.sessionId
|
|
1705
|
+
? params.sessionId
|
|
1706
|
+
: `session-${Date.now()}`;
|
|
1813
1707
|
// Stop daemon if enabled
|
|
1814
1708
|
let daemonStopped = false;
|
|
1815
1709
|
if (shouldStopDaemon) {
|
|
@@ -1832,7 +1726,7 @@ export const hooksSessionEnd = {
|
|
|
1832
1726
|
// Check for pending-insights.jsonl
|
|
1833
1727
|
let insightCount = 0;
|
|
1834
1728
|
try {
|
|
1835
|
-
const insightsPath =
|
|
1729
|
+
const insightsPath = join(getProjectCwd(), '.monomind', 'data', 'pending-insights.jsonl');
|
|
1836
1730
|
if (existsSync(insightsPath)) {
|
|
1837
1731
|
const content = readFileSync(insightsPath, 'utf-8').trim();
|
|
1838
1732
|
insightCount = content ? content.split('\n').length : 0;
|
|
@@ -1985,10 +1879,10 @@ export const hooksInit = {
|
|
|
1985
1879
|
};
|
|
1986
1880
|
},
|
|
1987
1881
|
};
|
|
1988
|
-
// Intelligence hook -
|
|
1882
|
+
// Intelligence hook - JS pattern/trajectory logging
|
|
1989
1883
|
export const hooksIntelligence = {
|
|
1990
1884
|
name: 'hooks_intelligence',
|
|
1991
|
-
description: '
|
|
1885
|
+
description: 'Intelligence status: pattern/trajectory logging metrics from the memory store',
|
|
1992
1886
|
inputSchema: {
|
|
1993
1887
|
type: 'object',
|
|
1994
1888
|
properties: {
|
|
@@ -2009,29 +1903,25 @@ export const hooksIntelligence = {
|
|
|
2009
1903
|
const realStats = getIntelligenceStatsFromMemory();
|
|
2010
1904
|
// Check actual implementation availability
|
|
2011
1905
|
const sonaAvailable = (await getSONAOptimizer()) !== null;
|
|
2012
|
-
const moeAvailable = (await getMoERouter()) !== null;
|
|
2013
|
-
const flashAvailable = (await getFlashAttention()) !== null;
|
|
2014
|
-
const ewcAvailable = (await getEWCConsolidator()) !== null;
|
|
2015
|
-
const loraAvailable = (await getLoRAAdapter()) !== null;
|
|
2016
1906
|
return {
|
|
2017
1907
|
mode,
|
|
2018
1908
|
status: 'active',
|
|
2019
1909
|
components: {
|
|
2020
1910
|
sona: {
|
|
2021
1911
|
enabled: enableSona,
|
|
2022
|
-
status: sonaAvailable ? 'active' : '
|
|
2023
|
-
implemented: true,
|
|
1912
|
+
status: sonaAvailable ? 'active' : 'idle',
|
|
1913
|
+
implemented: true,
|
|
2024
1914
|
trajectoriesRecorded: realStats.trajectories.total,
|
|
2025
1915
|
trajectoriesSuccessful: realStats.trajectories.successful,
|
|
2026
1916
|
patternsLearned: realStats.patterns.learned,
|
|
2027
|
-
note:
|
|
1917
|
+
note: 'Trajectory + pattern logging (no neural training in the lean build)',
|
|
2028
1918
|
},
|
|
2029
1919
|
moe: {
|
|
2030
|
-
enabled:
|
|
2031
|
-
status:
|
|
2032
|
-
implemented:
|
|
1920
|
+
enabled: false,
|
|
1921
|
+
status: 'removed',
|
|
1922
|
+
implemented: false,
|
|
2033
1923
|
routingDecisions: realStats.routing.decisions,
|
|
2034
|
-
note:
|
|
1924
|
+
note: 'MoE removed in lean build; keyword routing is used instead (see monoes-full-loop)',
|
|
2035
1925
|
},
|
|
2036
1926
|
hnsw: {
|
|
2037
1927
|
enabled: enableHnsw,
|
|
@@ -2039,25 +1929,25 @@ export const hooksIntelligence = {
|
|
|
2039
1929
|
implemented: true,
|
|
2040
1930
|
indexSize: realStats.memory.indexSize,
|
|
2041
1931
|
memorySizeBytes: realStats.memory.memorySizeBytes,
|
|
2042
|
-
note: 'HNSW vector indexing
|
|
1932
|
+
note: 'Pure-JS HNSW vector indexing (O(log n) vs O(n))',
|
|
2043
1933
|
},
|
|
2044
1934
|
flashAttention: {
|
|
2045
|
-
enabled:
|
|
2046
|
-
status:
|
|
2047
|
-
implemented:
|
|
2048
|
-
note:
|
|
1935
|
+
enabled: false,
|
|
1936
|
+
status: 'removed',
|
|
1937
|
+
implemented: false,
|
|
1938
|
+
note: 'Flash Attention removed in lean build; lives on monoes-full-loop branch',
|
|
2049
1939
|
},
|
|
2050
1940
|
ewc: {
|
|
2051
|
-
enabled:
|
|
2052
|
-
status:
|
|
2053
|
-
implemented:
|
|
2054
|
-
note:
|
|
1941
|
+
enabled: false,
|
|
1942
|
+
status: 'removed',
|
|
1943
|
+
implemented: false,
|
|
1944
|
+
note: 'EWC++ removed in lean build; lives on monoes-full-loop branch',
|
|
2055
1945
|
},
|
|
2056
1946
|
lora: {
|
|
2057
|
-
enabled:
|
|
2058
|
-
status:
|
|
2059
|
-
implemented:
|
|
2060
|
-
note:
|
|
1947
|
+
enabled: false,
|
|
1948
|
+
status: 'removed',
|
|
1949
|
+
implemented: false,
|
|
1950
|
+
note: 'LoRA removed in lean build; lives on monoes-full-loop branch',
|
|
2061
1951
|
},
|
|
2062
1952
|
embeddings: {
|
|
2063
1953
|
provider: 'transformers',
|
|
@@ -2076,11 +1966,13 @@ export const hooksIntelligence = {
|
|
|
2076
1966
|
implementationStatus: {
|
|
2077
1967
|
working: [
|
|
2078
1968
|
'memory-store', 'embeddings', 'trajectory-recording', 'claims', 'swarm-coordination',
|
|
2079
|
-
'hnsw-index', 'pattern-storage', '
|
|
2080
|
-
'flash-attention', 'lora-adapter'
|
|
1969
|
+
'hnsw-index', 'pattern-storage', 'keyword-routing'
|
|
2081
1970
|
],
|
|
2082
1971
|
partial: [],
|
|
2083
1972
|
notImplemented: [],
|
|
1973
|
+
removed: [
|
|
1974
|
+
'sona-optimizer', 'ewc-consolidation', 'moe-routing', 'flash-attention', 'lora-adapter'
|
|
1975
|
+
],
|
|
2084
1976
|
},
|
|
2085
1977
|
version: '3.0.0-alpha.102',
|
|
2086
1978
|
};
|
|
@@ -2541,7 +2433,7 @@ export const hooksPatternSearch = {
|
|
|
2541
2433
|
// Intelligence stats hook
|
|
2542
2434
|
export const hooksIntelligenceStats = {
|
|
2543
2435
|
name: 'hooks_intelligence_stats',
|
|
2544
|
-
description: 'Get
|
|
2436
|
+
description: 'Get intelligence-layer statistics (pattern/trajectory logging)',
|
|
2545
2437
|
inputSchema: {
|
|
2546
2438
|
type: 'object',
|
|
2547
2439
|
properties: {
|
|
@@ -2553,9 +2445,6 @@ export const hooksIntelligenceStats = {
|
|
|
2553
2445
|
// Get REAL statistics from actual implementations
|
|
2554
2446
|
const sona = await getSONAOptimizer();
|
|
2555
2447
|
const ewc = await getEWCConsolidator();
|
|
2556
|
-
const moe = await getMoERouter();
|
|
2557
|
-
const flash = await getFlashAttention();
|
|
2558
|
-
const lora = await getLoRAAdapter();
|
|
2559
2448
|
// Fallback to memory store for legacy data
|
|
2560
2449
|
const memoryStats = getIntelligenceStatsFromMemory();
|
|
2561
2450
|
// SONA stats from real implementation
|
|
@@ -2613,59 +2502,21 @@ export const hooksIntelligenceStats = {
|
|
|
2613
2502
|
loadBalance: null,
|
|
2614
2503
|
implementation: 'not-loaded',
|
|
2615
2504
|
};
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
const activeExperts = Object.values(loadBalance.routingCounts).filter((u) => u > 0).length;
|
|
2619
|
-
// Calculate average utilization as proxy for confidence
|
|
2620
|
-
const utilValues = Object.values(loadBalance.utilization);
|
|
2621
|
-
const avgUtil = utilValues.length > 0 ? utilValues.reduce((a, b) => a + b, 0) / utilValues.length : 0;
|
|
2622
|
-
moeStats = {
|
|
2623
|
-
expertsTotal: 8,
|
|
2624
|
-
expertsActive: activeExperts,
|
|
2625
|
-
routingDecisions: loadBalance.totalRoutings,
|
|
2626
|
-
avgRoutingTimeMs: 0.15, // Theoretical performance
|
|
2627
|
-
avgConfidence: Math.round(avgUtil * 100) / 100,
|
|
2628
|
-
loadBalance: {
|
|
2629
|
-
giniCoefficient: Math.round(loadBalance.giniCoefficient * 1000) / 1000,
|
|
2630
|
-
coefficientOfVariation: Math.round(loadBalance.coefficientOfVariation * 1000) / 1000,
|
|
2631
|
-
expertUsage: loadBalance.routingCounts,
|
|
2632
|
-
},
|
|
2633
|
-
implementation: 'real-moe',
|
|
2634
|
-
};
|
|
2635
|
-
}
|
|
2636
|
-
// Flash Attention stats from real implementation
|
|
2637
|
-
let flashStats = {
|
|
2505
|
+
// Flash Attention stats (native MoE/Flash removed in lean build — defaults only)
|
|
2506
|
+
const flashStats = {
|
|
2638
2507
|
speedup: 1.0,
|
|
2639
2508
|
avgComputeTimeMs: 0,
|
|
2640
2509
|
blockSize: 64,
|
|
2641
2510
|
implementation: 'not-loaded',
|
|
2642
2511
|
};
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
speedup: Math.round(flash.getSpeedup() * 100) / 100,
|
|
2646
|
-
avgComputeTimeMs: 0, // Would need benchmarking
|
|
2647
|
-
blockSize: 64,
|
|
2648
|
-
implementation: 'real-flash-attention',
|
|
2649
|
-
};
|
|
2650
|
-
}
|
|
2651
|
-
// LoRA stats from real implementation
|
|
2652
|
-
let loraStats = {
|
|
2512
|
+
// LoRA Adapter removed — superseded by SONA instant adaptation
|
|
2513
|
+
const loraStats = {
|
|
2653
2514
|
rank: 8,
|
|
2654
2515
|
alpha: 16,
|
|
2655
2516
|
adaptations: 0,
|
|
2656
2517
|
avgLoss: 0,
|
|
2657
2518
|
implementation: 'not-loaded',
|
|
2658
2519
|
};
|
|
2659
|
-
if (lora) {
|
|
2660
|
-
const realLora = lora.getStats();
|
|
2661
|
-
loraStats = {
|
|
2662
|
-
rank: realLora.rank,
|
|
2663
|
-
alpha: 16, // Default alpha from config
|
|
2664
|
-
adaptations: realLora.totalAdaptations,
|
|
2665
|
-
avgLoss: Math.round(realLora.avgAdaptationNorm * 10000) / 10000,
|
|
2666
|
-
implementation: 'real-lora',
|
|
2667
|
-
};
|
|
2668
|
-
}
|
|
2669
2520
|
const stats = {
|
|
2670
2521
|
sona: sonaStats,
|
|
2671
2522
|
moe: moeStats,
|
|
@@ -2689,9 +2540,9 @@ export const hooksIntelligenceStats = {
|
|
|
2689
2540
|
implementationStatus: {
|
|
2690
2541
|
sona: sona ? 'loaded' : 'not-loaded',
|
|
2691
2542
|
ewc: ewc ? 'loaded' : 'not-loaded',
|
|
2692
|
-
moe:
|
|
2693
|
-
flash:
|
|
2694
|
-
lora:
|
|
2543
|
+
moe: 'not-loaded',
|
|
2544
|
+
flash: 'not-loaded',
|
|
2545
|
+
lora: 'not-loaded',
|
|
2695
2546
|
},
|
|
2696
2547
|
performance: {
|
|
2697
2548
|
sonaLearningMs: sonaStats.avgLearningTimeMs,
|
|
@@ -2778,7 +2629,7 @@ export const hooksIntelligenceLearn = {
|
|
|
2778
2629
|
// Intelligence attention hook
|
|
2779
2630
|
export const hooksIntelligenceAttention = {
|
|
2780
2631
|
name: 'hooks_intelligence_attention',
|
|
2781
|
-
description: 'Compute attention-weighted similarity
|
|
2632
|
+
description: 'Compute attention-weighted similarity (pure-JS cosine/hyperbolic)',
|
|
2782
2633
|
inputSchema: {
|
|
2783
2634
|
type: 'object',
|
|
2784
2635
|
properties: {
|
|
@@ -2795,76 +2646,9 @@ export const hooksIntelligenceAttention = {
|
|
|
2795
2646
|
const startTime = performance.now();
|
|
2796
2647
|
let implementation = 'placeholder';
|
|
2797
2648
|
const results = [];
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
if (moe) {
|
|
2802
|
-
try {
|
|
2803
|
-
// Generate a simple embedding from query (hash-based for demo)
|
|
2804
|
-
const embedding = new Float32Array(384);
|
|
2805
|
-
for (let i = 0; i < 384; i++) {
|
|
2806
|
-
embedding[i] = Math.sin(query.charCodeAt(i % query.length) * (i + 1) * 0.01);
|
|
2807
|
-
}
|
|
2808
|
-
const routingResult = moe.route(embedding);
|
|
2809
|
-
for (let i = 0; i < Math.min(topK, routingResult.experts.length); i++) {
|
|
2810
|
-
const expert = routingResult.experts[i];
|
|
2811
|
-
results.push({
|
|
2812
|
-
index: i,
|
|
2813
|
-
weight: expert.weight,
|
|
2814
|
-
pattern: `Expert: ${expert.name}`,
|
|
2815
|
-
expert: expert.name,
|
|
2816
|
-
});
|
|
2817
|
-
}
|
|
2818
|
-
implementation = 'real-moe-router';
|
|
2819
|
-
}
|
|
2820
|
-
catch {
|
|
2821
|
-
// Fall back to placeholder
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
else if (mode === 'flash') {
|
|
2826
|
-
// Try Flash Attention
|
|
2827
|
-
const flash = await getFlashAttention();
|
|
2828
|
-
if (flash) {
|
|
2829
|
-
try {
|
|
2830
|
-
// Generate query/key/value embeddings
|
|
2831
|
-
const q = new Float32Array(384);
|
|
2832
|
-
const keys = [];
|
|
2833
|
-
const values = [];
|
|
2834
|
-
for (let i = 0; i < 384; i++) {
|
|
2835
|
-
q[i] = Math.sin(query.charCodeAt(i % query.length) * (i + 1) * 0.01);
|
|
2836
|
-
}
|
|
2837
|
-
// Generate some keys/values
|
|
2838
|
-
for (let k = 0; k < topK; k++) {
|
|
2839
|
-
const key = new Float32Array(384);
|
|
2840
|
-
const value = new Float32Array(384);
|
|
2841
|
-
for (let i = 0; i < 384; i++) {
|
|
2842
|
-
key[i] = Math.cos((k + 1) * (i + 1) * 0.01);
|
|
2843
|
-
value[i] = k + 1;
|
|
2844
|
-
}
|
|
2845
|
-
keys.push(key);
|
|
2846
|
-
values.push(value);
|
|
2847
|
-
}
|
|
2848
|
-
const attentionResult = flash.attention([q], keys, values);
|
|
2849
|
-
// Compute softmax weights from output magnitudes
|
|
2850
|
-
const outputMags = attentionResult.output[0]
|
|
2851
|
-
? Array.from(attentionResult.output[0]).slice(0, topK).map(v => Math.abs(v))
|
|
2852
|
-
: new Array(topK).fill(1);
|
|
2853
|
-
const sumMags = outputMags.reduce((a, b) => a + b, 0) || 1;
|
|
2854
|
-
for (let i = 0; i < topK; i++) {
|
|
2855
|
-
results.push({
|
|
2856
|
-
index: i,
|
|
2857
|
-
weight: outputMags[i] / sumMags,
|
|
2858
|
-
pattern: `Flash attention target #${i + 1}`,
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
implementation = 'real-flash-attention';
|
|
2862
|
-
}
|
|
2863
|
-
catch {
|
|
2864
|
-
// Fall back to placeholder
|
|
2865
|
-
}
|
|
2866
|
-
}
|
|
2867
|
-
}
|
|
2649
|
+
// Native MoE-router / Flash-attention backends were removed in the lean build.
|
|
2650
|
+
// Both modes degrade to the honest empty result handled below.
|
|
2651
|
+
void mode;
|
|
2868
2652
|
// If no real implementation worked, return empty with honest marker
|
|
2869
2653
|
if (results.length === 0) {
|
|
2870
2654
|
implementation = 'none';
|
|
@@ -2876,10 +2660,8 @@ export const hooksIntelligenceAttention = {
|
|
|
2876
2660
|
results,
|
|
2877
2661
|
stats: {
|
|
2878
2662
|
computeTimeMs,
|
|
2879
|
-
speedup: implementation.startsWith('real-') ? (mode === 'flash' ? '2.49x-7.47x' : '1.5x-3x') : null,
|
|
2880
|
-
memoryReduction: implementation.startsWith('real-') ? (mode === 'flash' ? '50-75%' : '25-40%') : null,
|
|
2881
2663
|
_stub: implementation === 'none',
|
|
2882
|
-
_note: implementation === 'none' ? '
|
|
2664
|
+
_note: implementation === 'none' ? 'Pure-JS similarity only; native attention backends are not part of the lean build.' : undefined,
|
|
2883
2665
|
},
|
|
2884
2666
|
implementation,
|
|
2885
2667
|
};
|
|
@@ -3327,20 +3109,6 @@ export const hooksWorkerDetect = {
|
|
|
3327
3109
|
return result;
|
|
3328
3110
|
},
|
|
3329
3111
|
};
|
|
3330
|
-
// Model router - lazy loaded
|
|
3331
|
-
let modelRouterInstance = null;
|
|
3332
|
-
async function getModelRouterInstance() {
|
|
3333
|
-
if (!modelRouterInstance) {
|
|
3334
|
-
try {
|
|
3335
|
-
const { getModelRouter } = await import('../ruvector/model-router.js');
|
|
3336
|
-
modelRouterInstance = getModelRouter();
|
|
3337
|
-
}
|
|
3338
|
-
catch {
|
|
3339
|
-
modelRouterInstance = null;
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
return modelRouterInstance;
|
|
3343
|
-
}
|
|
3344
3112
|
// Model route tool - intelligent model selection
|
|
3345
3113
|
export const hooksModelRoute = {
|
|
3346
3114
|
name: 'hooks_model-route',
|
|
@@ -3356,29 +3124,14 @@ export const hooksModelRoute = {
|
|
|
3356
3124
|
},
|
|
3357
3125
|
handler: async (params) => {
|
|
3358
3126
|
const task = params.task;
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
// Fallback to simple heuristic
|
|
3362
|
-
const complexity = analyzeComplexityFallback(task);
|
|
3363
|
-
return {
|
|
3364
|
-
model: complexity > 0.7 ? 'opus' : complexity > 0.4 ? 'sonnet' : 'haiku',
|
|
3365
|
-
confidence: 0.7,
|
|
3366
|
-
complexity,
|
|
3367
|
-
reasoning: 'Fallback heuristic (model router not available)',
|
|
3368
|
-
implementation: 'fallback',
|
|
3369
|
-
};
|
|
3370
|
-
}
|
|
3371
|
-
const result = await router.route(task);
|
|
3127
|
+
// Native neural model-router removed in the lean build — keyword complexity heuristic.
|
|
3128
|
+
const complexity = analyzeComplexityFallback(task);
|
|
3372
3129
|
return {
|
|
3373
|
-
model:
|
|
3374
|
-
confidence:
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
alternatives: result.alternatives,
|
|
3379
|
-
inferenceTimeUs: result.inferenceTimeUs,
|
|
3380
|
-
costMultiplier: result.costMultiplier,
|
|
3381
|
-
implementation: 'tiny-dancer-neural',
|
|
3130
|
+
model: complexity > 0.7 ? 'opus' : complexity > 0.4 ? 'sonnet' : 'haiku',
|
|
3131
|
+
confidence: 0.7,
|
|
3132
|
+
complexity,
|
|
3133
|
+
reasoning: 'Keyword complexity heuristic',
|
|
3134
|
+
implementation: 'heuristic',
|
|
3382
3135
|
};
|
|
3383
3136
|
},
|
|
3384
3137
|
};
|
|
@@ -3408,10 +3161,8 @@ export const hooksModelOutcome = {
|
|
|
3408
3161
|
? (exitCode === 0 ? 'success' : 'failure')
|
|
3409
3162
|
: params.outcome;
|
|
3410
3163
|
const outcome = effectiveOutcome;
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
router.recordOutcome(task, model, outcome);
|
|
3414
|
-
}
|
|
3164
|
+
// Native model-router removed in the lean build — outcome is acknowledged but not
|
|
3165
|
+
// fed to a neural learner (keyword routing has no online-learning store).
|
|
3415
3166
|
return {
|
|
3416
3167
|
recorded: true,
|
|
3417
3168
|
task: task.slice(0, 50),
|
|
@@ -3430,18 +3181,10 @@ export const hooksModelStats = {
|
|
|
3430
3181
|
properties: {},
|
|
3431
3182
|
},
|
|
3432
3183
|
handler: async () => {
|
|
3433
|
-
|
|
3434
|
-
if (!router) {
|
|
3435
|
-
return {
|
|
3436
|
-
available: false,
|
|
3437
|
-
message: 'Model router not initialized',
|
|
3438
|
-
};
|
|
3439
|
-
}
|
|
3440
|
-
const stats = router.getStats();
|
|
3184
|
+
// Native model-router removed in the lean build — no neural routing stats to report.
|
|
3441
3185
|
return {
|
|
3442
|
-
available:
|
|
3443
|
-
|
|
3444
|
-
timestamp: new Date().toISOString(),
|
|
3186
|
+
available: false,
|
|
3187
|
+
message: 'Model router not available in the lean build (keyword routing has no stats)',
|
|
3445
3188
|
};
|
|
3446
3189
|
},
|
|
3447
3190
|
};
|