@monoes/monomindcli 1.10.57 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +31 -74
- 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/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/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.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 +57 -37
- 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.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/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/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.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 -480
- 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 +1126 -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 +1 -1
- 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/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/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/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/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/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- 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 -67
- package/dist/src/ruvector/index.d.ts.map +0 -1
- package/dist/src/ruvector/index.js +0 -88
- 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
|
@@ -1,696 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RuVector Training Service
|
|
3
|
-
* Real WASM-accelerated neural training using @ruvector packages
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - MicroLoRA: <1µs adaptation with rank-2 LoRA (2.3M ops/s)
|
|
7
|
-
* - SONA: Self-Optimizing Neural Architecture (624k learn/s, 60k search/s)
|
|
8
|
-
* - Flash Attention: 2.49x-7.47x speedup (9k ops/s)
|
|
9
|
-
* - Trajectory Buffer: Learning from success/failure
|
|
10
|
-
* - Contrastive Learning: InfoNCE loss
|
|
11
|
-
*
|
|
12
|
-
* Backward Compatible: All v1 APIs preserved, SONA adds new capabilities
|
|
13
|
-
*
|
|
14
|
-
* github.com/nokhodian/monomind
|
|
15
|
-
*/
|
|
16
|
-
const ALLOWED_RUVECTOR_PACKAGES = new Set([
|
|
17
|
-
'@ruvector/learning-wasm',
|
|
18
|
-
'@ruvector/attention',
|
|
19
|
-
'@ruvector/sona',
|
|
20
|
-
]);
|
|
21
|
-
/**
|
|
22
|
-
* ESM/CJS interop helper — handles `.default` for CJS modules.
|
|
23
|
-
* Uses `'default' in mod` check which is safer than `mod.default || mod`.
|
|
24
|
-
*/
|
|
25
|
-
async function importWithInterop(packageName) {
|
|
26
|
-
if (!ALLOWED_RUVECTOR_PACKAGES.has(packageName)) {
|
|
27
|
-
throw new Error(`Disallowed dynamic import: ${packageName}`);
|
|
28
|
-
}
|
|
29
|
-
const mod = await import(packageName);
|
|
30
|
-
return ('default' in mod) ? mod.default : mod;
|
|
31
|
-
}
|
|
32
|
-
// Lazy-loaded WASM modules
|
|
33
|
-
let microLoRA = null;
|
|
34
|
-
let scopedLoRA = null;
|
|
35
|
-
let trajectoryBuffer = null;
|
|
36
|
-
let flashAttention = null;
|
|
37
|
-
let moeAttention = null;
|
|
38
|
-
let hyperbolicAttention = null;
|
|
39
|
-
let optimizer = null;
|
|
40
|
-
let contrastiveLoss = null;
|
|
41
|
-
let curriculum = null;
|
|
42
|
-
let hardMiner = null;
|
|
43
|
-
// SONA engine (optional enhancement)
|
|
44
|
-
let sonaEngine = null;
|
|
45
|
-
let sonaAvailable = false;
|
|
46
|
-
// Training state
|
|
47
|
-
let initialized = false;
|
|
48
|
-
let totalAdaptations = 0;
|
|
49
|
-
let totalForwards = 0;
|
|
50
|
-
let totalSonaLearns = 0;
|
|
51
|
-
let totalSonaSearches = 0;
|
|
52
|
-
let lastBenchmark = null;
|
|
53
|
-
// Backend tracking
|
|
54
|
-
let activeBackend = 'js-fallback';
|
|
55
|
-
/**
|
|
56
|
-
* Get which backend is active for training
|
|
57
|
-
*/
|
|
58
|
-
export function getActiveBackend() {
|
|
59
|
-
return activeBackend;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Pure-JS fallback implementations for when WASM is unavailable.
|
|
63
|
-
* These provide the same API surface with basic linear algebra.
|
|
64
|
-
*/
|
|
65
|
-
class JsMicroLoRA {
|
|
66
|
-
_dim;
|
|
67
|
-
_alpha;
|
|
68
|
-
_lr;
|
|
69
|
-
_adaptCount = 0n;
|
|
70
|
-
_forwardCount = 0n;
|
|
71
|
-
_deltaNorm = 0;
|
|
72
|
-
_A; // Low-rank A (rank x dim)
|
|
73
|
-
_B; // Low-rank B (dim x rank)
|
|
74
|
-
RANK = 2;
|
|
75
|
-
constructor(dim, alpha, lr) {
|
|
76
|
-
this._dim = dim;
|
|
77
|
-
this._alpha = alpha;
|
|
78
|
-
this._lr = lr;
|
|
79
|
-
this._A = new Float32Array(this.RANK * dim);
|
|
80
|
-
this._B = new Float32Array(dim * this.RANK);
|
|
81
|
-
// Xavier initialization
|
|
82
|
-
const scale = Math.sqrt(2 / (dim + this.RANK));
|
|
83
|
-
for (let i = 0; i < this._A.length; i++)
|
|
84
|
-
this._A[i] = (Math.random() - 0.5) * scale;
|
|
85
|
-
for (let i = 0; i < this._B.length; i++)
|
|
86
|
-
this._B[i] = (Math.random() - 0.5) * scale;
|
|
87
|
-
}
|
|
88
|
-
adapt_array(gradient) {
|
|
89
|
-
// Simple gradient update on low-rank matrices
|
|
90
|
-
let norm = 0;
|
|
91
|
-
for (let i = 0; i < Math.min(gradient.length, this._A.length); i++) {
|
|
92
|
-
const delta = -this._lr * gradient[i % gradient.length] * this._alpha;
|
|
93
|
-
this._A[i] += delta;
|
|
94
|
-
norm += delta * delta;
|
|
95
|
-
}
|
|
96
|
-
this._deltaNorm = Math.sqrt(norm);
|
|
97
|
-
this._adaptCount++;
|
|
98
|
-
}
|
|
99
|
-
adapt_count() { return this._adaptCount; }
|
|
100
|
-
param_count() { return this._A.length + this._B.length; }
|
|
101
|
-
forward_array(input) {
|
|
102
|
-
const output = new Float32Array(this._dim);
|
|
103
|
-
// y = x + alpha * B @ A @ x (simplified low-rank)
|
|
104
|
-
for (let i = 0; i < this._dim; i++) {
|
|
105
|
-
output[i] = input[i];
|
|
106
|
-
let sum = 0;
|
|
107
|
-
for (let r = 0; r < this.RANK; r++) {
|
|
108
|
-
let dot = 0;
|
|
109
|
-
for (let j = 0; j < this._dim; j++) {
|
|
110
|
-
dot += this._A[r * this._dim + j] * input[j];
|
|
111
|
-
}
|
|
112
|
-
sum += this._B[i * this.RANK + r] * dot;
|
|
113
|
-
}
|
|
114
|
-
output[i] += this._alpha * sum;
|
|
115
|
-
}
|
|
116
|
-
this._forwardCount++;
|
|
117
|
-
return output;
|
|
118
|
-
}
|
|
119
|
-
forward_count() { return this._forwardCount; }
|
|
120
|
-
adapt_with_reward(improvement) {
|
|
121
|
-
const scale = improvement * this._lr * this._alpha;
|
|
122
|
-
let norm = 0;
|
|
123
|
-
for (let i = 0; i < this._A.length; i++) {
|
|
124
|
-
const delta = scale * (Math.random() - 0.5);
|
|
125
|
-
this._A[i] += delta;
|
|
126
|
-
norm += delta * delta;
|
|
127
|
-
}
|
|
128
|
-
this._deltaNorm = Math.sqrt(norm);
|
|
129
|
-
this._adaptCount++;
|
|
130
|
-
}
|
|
131
|
-
delta_norm() { return this._deltaNorm; }
|
|
132
|
-
dim() { return this._dim; }
|
|
133
|
-
reset() {
|
|
134
|
-
this._A.fill(0);
|
|
135
|
-
this._B.fill(0);
|
|
136
|
-
this._adaptCount = 0n;
|
|
137
|
-
this._forwardCount = 0n;
|
|
138
|
-
this._deltaNorm = 0;
|
|
139
|
-
}
|
|
140
|
-
free() { }
|
|
141
|
-
}
|
|
142
|
-
class JsScopedLoRA {
|
|
143
|
-
adapters = new Map();
|
|
144
|
-
_dim;
|
|
145
|
-
_alpha;
|
|
146
|
-
_lr;
|
|
147
|
-
_fallback = false;
|
|
148
|
-
constructor(dim, alpha, lr) {
|
|
149
|
-
this._dim = dim;
|
|
150
|
-
this._alpha = alpha;
|
|
151
|
-
this._lr = lr;
|
|
152
|
-
}
|
|
153
|
-
getAdapter(opType) {
|
|
154
|
-
if (!this.adapters.has(opType)) {
|
|
155
|
-
if (this._fallback && opType > 0 && this.adapters.has(0)) {
|
|
156
|
-
return this.adapters.get(0);
|
|
157
|
-
}
|
|
158
|
-
this.adapters.set(opType, new JsMicroLoRA(this._dim, this._alpha, this._lr));
|
|
159
|
-
}
|
|
160
|
-
return this.adapters.get(opType);
|
|
161
|
-
}
|
|
162
|
-
adapt_array(opType, gradient) { this.getAdapter(opType).adapt_array(gradient); }
|
|
163
|
-
adapt_count(opType) { return this.getAdapter(opType).adapt_count(); }
|
|
164
|
-
forward_array(opType, input) { return this.getAdapter(opType).forward_array(input); }
|
|
165
|
-
forward_count(opType) { return this.getAdapter(opType).forward_count(); }
|
|
166
|
-
adapt_with_reward(opType, improvement) { this.getAdapter(opType).adapt_with_reward(improvement); }
|
|
167
|
-
delta_norm(opType) { return this.getAdapter(opType).delta_norm(); }
|
|
168
|
-
set_category_fallback(enabled) { this._fallback = enabled; }
|
|
169
|
-
total_adapt_count() {
|
|
170
|
-
let total = 0n;
|
|
171
|
-
for (const a of this.adapters.values())
|
|
172
|
-
total += a.adapt_count();
|
|
173
|
-
return total;
|
|
174
|
-
}
|
|
175
|
-
total_forward_count() {
|
|
176
|
-
let total = 0n;
|
|
177
|
-
for (const a of this.adapters.values())
|
|
178
|
-
total += a.forward_count();
|
|
179
|
-
return total;
|
|
180
|
-
}
|
|
181
|
-
reset_all() { this.adapters.clear(); }
|
|
182
|
-
reset_scope(opType) { this.adapters.delete(opType); }
|
|
183
|
-
free() { this.adapters.clear(); }
|
|
184
|
-
}
|
|
185
|
-
class JsTrajectoryBuffer {
|
|
186
|
-
entries = [];
|
|
187
|
-
capacity;
|
|
188
|
-
constructor(capacity, _dim) {
|
|
189
|
-
this.capacity = capacity;
|
|
190
|
-
}
|
|
191
|
-
record(_embedding, _opType, _attType, executionMs, baselineMs) {
|
|
192
|
-
const improvement = baselineMs > 0 ? (baselineMs - executionMs) / baselineMs : 0;
|
|
193
|
-
if (this.entries.length >= this.capacity)
|
|
194
|
-
this.entries.shift();
|
|
195
|
-
this.entries.push({ improvement });
|
|
196
|
-
}
|
|
197
|
-
is_empty() { return this.entries.length === 0; }
|
|
198
|
-
total_count() { return BigInt(this.entries.length); }
|
|
199
|
-
success_rate() {
|
|
200
|
-
if (this.entries.length === 0)
|
|
201
|
-
return 0;
|
|
202
|
-
return this.entries.filter(e => e.improvement > 0).length / this.entries.length;
|
|
203
|
-
}
|
|
204
|
-
mean_improvement() {
|
|
205
|
-
if (this.entries.length === 0)
|
|
206
|
-
return 0;
|
|
207
|
-
return this.entries.reduce((s, e) => s + e.improvement, 0) / this.entries.length;
|
|
208
|
-
}
|
|
209
|
-
best_improvement() {
|
|
210
|
-
if (this.entries.length === 0)
|
|
211
|
-
return 0;
|
|
212
|
-
return Math.max(...this.entries.map(e => e.improvement));
|
|
213
|
-
}
|
|
214
|
-
high_quality_count(threshold) {
|
|
215
|
-
return this.entries.filter(e => e.improvement > threshold).length;
|
|
216
|
-
}
|
|
217
|
-
variance() {
|
|
218
|
-
if (this.entries.length < 2)
|
|
219
|
-
return 0;
|
|
220
|
-
const mean = this.mean_improvement();
|
|
221
|
-
return this.entries.reduce((s, e) => s + (e.improvement - mean) ** 2, 0) / (this.entries.length - 1);
|
|
222
|
-
}
|
|
223
|
-
reset() { this.entries = []; }
|
|
224
|
-
free() { this.entries = []; }
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Initialize the RuVector training system.
|
|
228
|
-
* Attempts to load @ruvector/learning-wasm for WASM-accelerated training.
|
|
229
|
-
* Falls back to a pure-JS implementation if WASM is unavailable.
|
|
230
|
-
*/
|
|
231
|
-
export async function initializeTraining(config = {}) {
|
|
232
|
-
const features = [];
|
|
233
|
-
const dim = Math.min(config.dim || 256, 256); // Max 256 for WASM
|
|
234
|
-
const lr = config.learningRate || 0.01;
|
|
235
|
-
const alpha = config.alpha || 0.1;
|
|
236
|
-
// --- Attempt WASM backend first ---
|
|
237
|
-
let wasmLoaded = false;
|
|
238
|
-
try {
|
|
239
|
-
const fs = await import('fs');
|
|
240
|
-
const { createRequire } = await import('module');
|
|
241
|
-
const require = createRequire(import.meta.url);
|
|
242
|
-
const wasmPath = require.resolve('@ruvector/learning-wasm/ruvector_learning_wasm_bg.wasm');
|
|
243
|
-
const wasmBuffer = fs.readFileSync(wasmPath);
|
|
244
|
-
const learningWasm = await import('@ruvector/learning-wasm');
|
|
245
|
-
learningWasm.initSync({ module: wasmBuffer });
|
|
246
|
-
microLoRA = new learningWasm.WasmMicroLoRA(dim, alpha, lr);
|
|
247
|
-
features.push(`MicroLoRA/WASM (${dim}-dim, <1μs adaptation)`);
|
|
248
|
-
scopedLoRA = new learningWasm.WasmScopedLoRA(dim, alpha, lr);
|
|
249
|
-
scopedLoRA.set_category_fallback(true);
|
|
250
|
-
features.push('ScopedLoRA/WASM (17 operators)');
|
|
251
|
-
trajectoryBuffer = new learningWasm.WasmTrajectoryBuffer(config.trajectoryCapacity || 10000, dim);
|
|
252
|
-
features.push('TrajectoryBuffer/WASM');
|
|
253
|
-
activeBackend = 'wasm';
|
|
254
|
-
wasmLoaded = true;
|
|
255
|
-
}
|
|
256
|
-
catch (wasmError) {
|
|
257
|
-
// WASM not available - fall back to JS implementation
|
|
258
|
-
const reason = wasmError instanceof Error ? wasmError.message : String(wasmError);
|
|
259
|
-
console.warn(`[ruvector] WASM backend unavailable (${reason}), using JS fallback`);
|
|
260
|
-
microLoRA = new JsMicroLoRA(dim, alpha, lr);
|
|
261
|
-
features.push(`MicroLoRA/JS (${dim}-dim, JS fallback)`);
|
|
262
|
-
scopedLoRA = new JsScopedLoRA(dim, alpha, lr);
|
|
263
|
-
scopedLoRA.set_category_fallback(true);
|
|
264
|
-
features.push('ScopedLoRA/JS (17 operators)');
|
|
265
|
-
trajectoryBuffer = new JsTrajectoryBuffer(config.trajectoryCapacity || 10000, dim);
|
|
266
|
-
features.push('TrajectoryBuffer/JS');
|
|
267
|
-
activeBackend = 'js-fallback';
|
|
268
|
-
}
|
|
269
|
-
// --- Attention mechanisms (optional, independent of WASM) ---
|
|
270
|
-
try {
|
|
271
|
-
const attention = await importWithInterop('@ruvector/attention');
|
|
272
|
-
if (config.useFlashAttention !== false) {
|
|
273
|
-
flashAttention = new attention.FlashAttention(dim, 64);
|
|
274
|
-
features.push('FlashAttention');
|
|
275
|
-
}
|
|
276
|
-
if (config.useMoE) {
|
|
277
|
-
moeAttention = attention.MoEAttention.simple(dim, 8, 2);
|
|
278
|
-
features.push('MoE (8 experts, top-2)');
|
|
279
|
-
}
|
|
280
|
-
if (config.useHyperbolic) {
|
|
281
|
-
hyperbolicAttention = new attention.HyperbolicAttention(dim, 1.0);
|
|
282
|
-
features.push('HyperbolicAttention');
|
|
283
|
-
}
|
|
284
|
-
optimizer = new attention.AdamWOptimizer(lr, 0.9, 0.999, 1e-8, 0.01);
|
|
285
|
-
features.push('AdamW Optimizer');
|
|
286
|
-
contrastiveLoss = new attention.InfoNceLoss(0.07);
|
|
287
|
-
features.push('InfoNCE Loss');
|
|
288
|
-
if (config.totalSteps) {
|
|
289
|
-
curriculum = new attention.CurriculumScheduler(config.totalSteps, config.warmupSteps || Math.floor(config.totalSteps * 0.1));
|
|
290
|
-
features.push('Curriculum Learning');
|
|
291
|
-
}
|
|
292
|
-
try {
|
|
293
|
-
hardMiner = new attention.HardNegativeMiner(5, 'semi_hard');
|
|
294
|
-
features.push('Hard Negative Mining');
|
|
295
|
-
}
|
|
296
|
-
catch {
|
|
297
|
-
// Mining not available, continue without it
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
catch (attentionError) {
|
|
301
|
-
// @ruvector/attention not available - attention features skipped
|
|
302
|
-
const reason = attentionError instanceof Error ? attentionError.message : String(attentionError);
|
|
303
|
-
console.warn(`[ruvector] @ruvector/attention unavailable (${reason}), attention features disabled`);
|
|
304
|
-
}
|
|
305
|
-
// --- SONA (optional, backward compatible) ---
|
|
306
|
-
if (config.useSona !== false) {
|
|
307
|
-
try {
|
|
308
|
-
const sona = await importWithInterop('@ruvector/sona');
|
|
309
|
-
const sonaRank = config.sonaRank || 4;
|
|
310
|
-
sonaEngine = new sona.SonaEngine(dim, sonaRank, alpha, lr);
|
|
311
|
-
sonaAvailable = true;
|
|
312
|
-
features.push(`SONA (${dim}-dim, rank-${sonaRank}, 624k learn/s)`);
|
|
313
|
-
}
|
|
314
|
-
catch (sonaError) {
|
|
315
|
-
sonaAvailable = false;
|
|
316
|
-
if (config.useSona === true) {
|
|
317
|
-
console.warn('SONA requested but not available:', sonaError);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
initialized = true;
|
|
322
|
-
return { success: true, features, backend: activeBackend };
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Operator types for scoped LoRA (0-16)
|
|
326
|
-
*/
|
|
327
|
-
export const OperatorType = {
|
|
328
|
-
GENERAL: 0,
|
|
329
|
-
ATTENTION: 1,
|
|
330
|
-
MLP: 2,
|
|
331
|
-
EMBEDDING: 3,
|
|
332
|
-
NORMALIZATION: 4,
|
|
333
|
-
PROJECTION: 5,
|
|
334
|
-
POOLING: 6,
|
|
335
|
-
CONVOLUTION: 7,
|
|
336
|
-
RECURRENT: 8,
|
|
337
|
-
ROUTING: 9,
|
|
338
|
-
MEMORY: 10,
|
|
339
|
-
REASONING: 11,
|
|
340
|
-
COORDINATION: 12,
|
|
341
|
-
OPTIMIZATION: 13,
|
|
342
|
-
SECURITY: 14,
|
|
343
|
-
TESTING: 15,
|
|
344
|
-
DEBUGGING: 16,
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* Train a pattern with MicroLoRA
|
|
348
|
-
*/
|
|
349
|
-
export async function trainPattern(embedding, gradient, operatorType) {
|
|
350
|
-
if (!initialized || !microLoRA) {
|
|
351
|
-
throw new Error('Training system not initialized');
|
|
352
|
-
}
|
|
353
|
-
// Use scoped LoRA if operator type specified
|
|
354
|
-
if (operatorType !== undefined && scopedLoRA) {
|
|
355
|
-
scopedLoRA.adapt_array(operatorType, gradient);
|
|
356
|
-
return {
|
|
357
|
-
deltaNorm: scopedLoRA.delta_norm(operatorType),
|
|
358
|
-
adaptCount: scopedLoRA.adapt_count(operatorType),
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
// Standard MicroLoRA adaptation
|
|
362
|
-
microLoRA.adapt_array(gradient);
|
|
363
|
-
totalAdaptations++;
|
|
364
|
-
return {
|
|
365
|
-
deltaNorm: microLoRA.delta_norm(),
|
|
366
|
-
adaptCount: microLoRA.adapt_count(),
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Forward pass through LoRA
|
|
371
|
-
*/
|
|
372
|
-
export function forward(input, operatorType) {
|
|
373
|
-
if (!initialized || !microLoRA) {
|
|
374
|
-
throw new Error('Training system not initialized');
|
|
375
|
-
}
|
|
376
|
-
totalForwards++;
|
|
377
|
-
if (operatorType !== undefined && scopedLoRA) {
|
|
378
|
-
return scopedLoRA.forward_array(operatorType, input);
|
|
379
|
-
}
|
|
380
|
-
return microLoRA.forward_array(input);
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Reward-based adaptation (reinforcement learning)
|
|
384
|
-
*/
|
|
385
|
-
export function adaptWithReward(improvement, operatorType) {
|
|
386
|
-
if (!initialized) {
|
|
387
|
-
throw new Error('Training system not initialized');
|
|
388
|
-
}
|
|
389
|
-
if (operatorType !== undefined && scopedLoRA) {
|
|
390
|
-
scopedLoRA.adapt_with_reward(operatorType, improvement);
|
|
391
|
-
}
|
|
392
|
-
else if (microLoRA) {
|
|
393
|
-
microLoRA.adapt_with_reward(improvement);
|
|
394
|
-
}
|
|
395
|
-
totalAdaptations++;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Record a learning trajectory
|
|
399
|
-
*/
|
|
400
|
-
export function recordTrajectory(embedding, operatorType, attentionType, executionMs, baselineMs) {
|
|
401
|
-
if (!trajectoryBuffer) {
|
|
402
|
-
throw new Error('Trajectory buffer not initialized');
|
|
403
|
-
}
|
|
404
|
-
trajectoryBuffer.record(embedding, operatorType, attentionType, executionMs, baselineMs);
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Get trajectory statistics
|
|
408
|
-
*/
|
|
409
|
-
export function getTrajectoryStats() {
|
|
410
|
-
if (!trajectoryBuffer || trajectoryBuffer.is_empty()) {
|
|
411
|
-
return null;
|
|
412
|
-
}
|
|
413
|
-
return {
|
|
414
|
-
successRate: trajectoryBuffer.success_rate(),
|
|
415
|
-
meanImprovement: trajectoryBuffer.mean_improvement(),
|
|
416
|
-
bestImprovement: trajectoryBuffer.best_improvement(),
|
|
417
|
-
totalCount: trajectoryBuffer.total_count(),
|
|
418
|
-
highQualityCount: trajectoryBuffer.high_quality_count(0.1),
|
|
419
|
-
variance: trajectoryBuffer.variance(),
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Compute attention with Flash Attention (2.49x-7.47x faster)
|
|
424
|
-
*/
|
|
425
|
-
export function computeFlashAttention(query, keys, values) {
|
|
426
|
-
if (!flashAttention) {
|
|
427
|
-
throw new Error('Flash attention not initialized');
|
|
428
|
-
}
|
|
429
|
-
return flashAttention.computeRaw(query, keys, values);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Compute MoE routing
|
|
433
|
-
*/
|
|
434
|
-
export function computeMoEAttention(query, keys, values) {
|
|
435
|
-
if (!moeAttention) {
|
|
436
|
-
throw new Error('MoE attention not initialized');
|
|
437
|
-
}
|
|
438
|
-
return moeAttention.computeRaw(query, keys, values);
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Compute hyperbolic attention (for hierarchical patterns)
|
|
442
|
-
*/
|
|
443
|
-
export function computeHyperbolicAttention(query, keys, values) {
|
|
444
|
-
if (!hyperbolicAttention) {
|
|
445
|
-
throw new Error('Hyperbolic attention not initialized');
|
|
446
|
-
}
|
|
447
|
-
return hyperbolicAttention.computeRaw(query, keys, values);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Compute contrastive loss for training
|
|
451
|
-
*/
|
|
452
|
-
export function computeContrastiveLoss(anchor, positives, negatives) {
|
|
453
|
-
if (!contrastiveLoss) {
|
|
454
|
-
throw new Error('Contrastive loss not initialized');
|
|
455
|
-
}
|
|
456
|
-
const loss = contrastiveLoss.compute(anchor, positives, negatives);
|
|
457
|
-
const gradient = contrastiveLoss.backward(anchor, positives, negatives);
|
|
458
|
-
return { loss, gradient };
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Optimizer step
|
|
462
|
-
*/
|
|
463
|
-
export function optimizerStep(params, gradients) {
|
|
464
|
-
if (!optimizer) {
|
|
465
|
-
throw new Error('Optimizer not initialized');
|
|
466
|
-
}
|
|
467
|
-
return optimizer.step(params, gradients);
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* Get curriculum difficulty for current step
|
|
471
|
-
*/
|
|
472
|
-
export function getCurriculumDifficulty(step) {
|
|
473
|
-
if (!curriculum) {
|
|
474
|
-
return 1.0; // Full difficulty if no curriculum
|
|
475
|
-
}
|
|
476
|
-
return curriculum.getDifficulty(step);
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Mine hard negatives for better training
|
|
480
|
-
*/
|
|
481
|
-
export function mineHardNegatives(anchor, candidates) {
|
|
482
|
-
if (!hardMiner) {
|
|
483
|
-
throw new Error('Hard negative miner not initialized');
|
|
484
|
-
}
|
|
485
|
-
return hardMiner.mine(anchor, candidates);
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Benchmark the training system
|
|
489
|
-
*/
|
|
490
|
-
export async function benchmarkTraining(dim, iterations) {
|
|
491
|
-
const attention = await importWithInterop('@ruvector/attention');
|
|
492
|
-
lastBenchmark = attention.benchmarkAttention(dim || 256, 100, iterations || 1000);
|
|
493
|
-
return lastBenchmark ?? [];
|
|
494
|
-
}
|
|
495
|
-
// ============================================
|
|
496
|
-
// SONA Functions (v2 enhancement, optional)
|
|
497
|
-
// ============================================
|
|
498
|
-
/**
|
|
499
|
-
* Check if SONA is available
|
|
500
|
-
*/
|
|
501
|
-
export function isSonaAvailable() {
|
|
502
|
-
return sonaAvailable && sonaEngine !== null;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Force-learn a pattern with SONA (1.6μs, 624k ops/s)
|
|
506
|
-
* This is a one-shot learning mechanism for immediate pattern storage
|
|
507
|
-
*/
|
|
508
|
-
export function sonaForceLearn(embedding, reward) {
|
|
509
|
-
if (!sonaEngine) {
|
|
510
|
-
throw new Error('SONA not initialized. Call initializeTraining with useSona: true');
|
|
511
|
-
}
|
|
512
|
-
sonaEngine.forceLearn(embedding, reward);
|
|
513
|
-
totalSonaLearns++;
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* Search for similar patterns with SONA (16.7μs, 60k searches/s)
|
|
517
|
-
* Returns the k most similar patterns from the pattern bank
|
|
518
|
-
*/
|
|
519
|
-
export function sonaFindPatterns(embedding, k = 5) {
|
|
520
|
-
if (!sonaEngine) {
|
|
521
|
-
throw new Error('SONA not initialized. Call initializeTraining with useSona: true');
|
|
522
|
-
}
|
|
523
|
-
// SONA requires Array, not Float32Array
|
|
524
|
-
const embeddingArray = Array.from(embedding);
|
|
525
|
-
totalSonaSearches++;
|
|
526
|
-
return sonaEngine.findPatterns(embeddingArray, k);
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Process SONA background tasks (0.13μs, 7.5M ticks/s)
|
|
530
|
-
* Call periodically to process background learning and consolidation
|
|
531
|
-
*/
|
|
532
|
-
export function sonaTick() {
|
|
533
|
-
if (!sonaEngine) {
|
|
534
|
-
return; // Silent no-op if SONA not available
|
|
535
|
-
}
|
|
536
|
-
sonaEngine.tick();
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Get SONA statistics
|
|
540
|
-
*/
|
|
541
|
-
export function getSonaStats() {
|
|
542
|
-
if (!sonaEngine) {
|
|
543
|
-
return {
|
|
544
|
-
available: false,
|
|
545
|
-
enabled: false,
|
|
546
|
-
stats: null,
|
|
547
|
-
totalLearns: totalSonaLearns,
|
|
548
|
-
totalSearches: totalSonaSearches,
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
try {
|
|
552
|
-
const statsJson = sonaEngine.getStats();
|
|
553
|
-
const stats = JSON.parse(statsJson);
|
|
554
|
-
return {
|
|
555
|
-
available: true,
|
|
556
|
-
enabled: sonaEngine.isEnabled(),
|
|
557
|
-
stats,
|
|
558
|
-
totalLearns: totalSonaLearns,
|
|
559
|
-
totalSearches: totalSonaSearches,
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
catch {
|
|
563
|
-
return {
|
|
564
|
-
available: true,
|
|
565
|
-
enabled: false,
|
|
566
|
-
stats: null,
|
|
567
|
-
totalLearns: totalSonaLearns,
|
|
568
|
-
totalSearches: totalSonaSearches,
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Enable/disable SONA learning
|
|
574
|
-
*/
|
|
575
|
-
export function setSonaEnabled(enabled) {
|
|
576
|
-
if (!sonaEngine) {
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
sonaEngine.setEnabled(enabled);
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* Flush SONA buffers (persist any pending patterns)
|
|
583
|
-
*/
|
|
584
|
-
export function sonaFlush() {
|
|
585
|
-
if (!sonaEngine) {
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
sonaEngine.flush();
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* Get training statistics
|
|
592
|
-
*/
|
|
593
|
-
export function getTrainingStats() {
|
|
594
|
-
const stats = {
|
|
595
|
-
initialized,
|
|
596
|
-
backend: activeBackend,
|
|
597
|
-
totalAdaptations,
|
|
598
|
-
totalForwards,
|
|
599
|
-
};
|
|
600
|
-
if (microLoRA) {
|
|
601
|
-
stats.microLoraStats = {
|
|
602
|
-
paramCount: microLoRA.param_count(),
|
|
603
|
-
adaptCount: microLoRA.adapt_count(),
|
|
604
|
-
forwardCount: microLoRA.forward_count(),
|
|
605
|
-
deltaNorm: microLoRA.delta_norm(),
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
if (scopedLoRA) {
|
|
609
|
-
stats.scopedLoraStats = {
|
|
610
|
-
totalAdaptCount: scopedLoRA.total_adapt_count(),
|
|
611
|
-
totalForwardCount: scopedLoRA.total_forward_count(),
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
if (trajectoryBuffer && !trajectoryBuffer.is_empty()) {
|
|
615
|
-
stats.trajectoryStats = getTrajectoryStats();
|
|
616
|
-
}
|
|
617
|
-
// Include SONA stats if available
|
|
618
|
-
if (sonaAvailable) {
|
|
619
|
-
stats.sonaStats = getSonaStats();
|
|
620
|
-
}
|
|
621
|
-
if (lastBenchmark) {
|
|
622
|
-
stats.lastBenchmark = lastBenchmark;
|
|
623
|
-
}
|
|
624
|
-
return stats;
|
|
625
|
-
}
|
|
626
|
-
/**
|
|
627
|
-
* Reset the training system
|
|
628
|
-
*/
|
|
629
|
-
export function resetTraining() {
|
|
630
|
-
if (microLoRA)
|
|
631
|
-
microLoRA.reset();
|
|
632
|
-
if (scopedLoRA)
|
|
633
|
-
scopedLoRA.reset_all();
|
|
634
|
-
if (trajectoryBuffer)
|
|
635
|
-
trajectoryBuffer.reset();
|
|
636
|
-
// Reset SONA stats (engine doesn't have reset, just flush)
|
|
637
|
-
if (sonaEngine) {
|
|
638
|
-
sonaEngine.flush();
|
|
639
|
-
}
|
|
640
|
-
totalAdaptations = 0;
|
|
641
|
-
totalForwards = 0;
|
|
642
|
-
totalSonaLearns = 0;
|
|
643
|
-
totalSonaSearches = 0;
|
|
644
|
-
activeBackend = 'js-fallback';
|
|
645
|
-
}
|
|
646
|
-
/**
|
|
647
|
-
* Export trained weights
|
|
648
|
-
*/
|
|
649
|
-
export function exportWeights() {
|
|
650
|
-
if (!initialized || !microLoRA) {
|
|
651
|
-
return null;
|
|
652
|
-
}
|
|
653
|
-
return {
|
|
654
|
-
dim: microLoRA.dim(),
|
|
655
|
-
deltaNorm: microLoRA.delta_norm(),
|
|
656
|
-
adaptCount: microLoRA.adapt_count(),
|
|
657
|
-
trajectoryStats: getTrajectoryStats(),
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Cleanup resources
|
|
662
|
-
*/
|
|
663
|
-
export function cleanup() {
|
|
664
|
-
if (microLoRA) {
|
|
665
|
-
microLoRA.free();
|
|
666
|
-
microLoRA = null;
|
|
667
|
-
}
|
|
668
|
-
if (scopedLoRA) {
|
|
669
|
-
scopedLoRA.free();
|
|
670
|
-
scopedLoRA = null;
|
|
671
|
-
}
|
|
672
|
-
if (trajectoryBuffer) {
|
|
673
|
-
trajectoryBuffer.free();
|
|
674
|
-
trajectoryBuffer = null;
|
|
675
|
-
}
|
|
676
|
-
// Cleanup SONA
|
|
677
|
-
if (sonaEngine) {
|
|
678
|
-
sonaEngine.flush();
|
|
679
|
-
sonaEngine = null;
|
|
680
|
-
sonaAvailable = false;
|
|
681
|
-
}
|
|
682
|
-
flashAttention = null;
|
|
683
|
-
moeAttention = null;
|
|
684
|
-
hyperbolicAttention = null;
|
|
685
|
-
optimizer = null;
|
|
686
|
-
contrastiveLoss = null;
|
|
687
|
-
curriculum = null;
|
|
688
|
-
hardMiner = null;
|
|
689
|
-
initialized = false;
|
|
690
|
-
totalAdaptations = 0;
|
|
691
|
-
totalForwards = 0;
|
|
692
|
-
totalSonaLearns = 0;
|
|
693
|
-
totalSonaSearches = 0;
|
|
694
|
-
lastBenchmark = null;
|
|
695
|
-
}
|
|
696
|
-
//# sourceMappingURL=ruvector-training.js.map
|