agentdb 3.0.0-alpha.2 → 3.0.0-alpha.4
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/README.md +978 -2342
- package/dist/agentdb.browser.js +1492 -0
- package/dist/agentdb.browser.js.map +7 -0
- package/dist/agentdb.browser.min.js +3 -0
- package/dist/agentdb.browser.min.js.map +7 -0
- package/dist/agentdb.wasm-loader.js +207 -0
- package/dist/schemas/frontier-schema.sql +0 -7
- package/dist/schemas/schema.sql +0 -7
- package/dist/simulation/cli.d.ts +9 -0
- package/dist/simulation/cli.d.ts.map +1 -0
- package/dist/simulation/cli.js +68 -0
- package/dist/simulation/cli.js.map +1 -0
- package/dist/simulation/runner.d.ts +21 -0
- package/dist/simulation/runner.d.ts.map +1 -0
- package/dist/simulation/runner.js +241 -0
- package/dist/simulation/runner.js.map +1 -0
- package/dist/simulation/scenarios/aidefence-integration.d.ts +24 -0
- package/dist/simulation/scenarios/aidefence-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/aidefence-integration.js +124 -0
- package/dist/simulation/scenarios/aidefence-integration.js.map +1 -0
- package/dist/simulation/scenarios/bmssp-integration.d.ts +23 -0
- package/dist/simulation/scenarios/bmssp-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/bmssp-integration.js +104 -0
- package/dist/simulation/scenarios/bmssp-integration.js.map +1 -0
- package/dist/simulation/scenarios/causal-reasoning.d.ts +16 -0
- package/dist/simulation/scenarios/causal-reasoning.d.ts.map +1 -0
- package/dist/simulation/scenarios/causal-reasoning.js +108 -0
- package/dist/simulation/scenarios/causal-reasoning.js.map +1 -0
- package/dist/simulation/scenarios/consciousness-explorer.d.ts +25 -0
- package/dist/simulation/scenarios/consciousness-explorer.d.ts.map +1 -0
- package/dist/simulation/scenarios/consciousness-explorer.js +108 -0
- package/dist/simulation/scenarios/consciousness-explorer.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts +135 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js +158 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/index.d.ts +14 -0
- package/dist/simulation/scenarios/domain-examples/index.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/index.js +14 -0
- package/dist/simulation/scenarios/domain-examples/index.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts +178 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js +218 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts +122 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.js +129 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts +166 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.js +161 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts +151 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.js +187 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts +102 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.js +100 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.js.map +1 -0
- package/dist/simulation/scenarios/goalie-integration.d.ts +24 -0
- package/dist/simulation/scenarios/goalie-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/goalie-integration.js +121 -0
- package/dist/simulation/scenarios/goalie-integration.js.map +1 -0
- package/dist/simulation/scenarios/graph-traversal.d.ts +17 -0
- package/dist/simulation/scenarios/graph-traversal.d.ts.map +1 -0
- package/dist/simulation/scenarios/graph-traversal.js +101 -0
- package/dist/simulation/scenarios/graph-traversal.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts +45 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.js +435 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts +55 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.js +606 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts +74 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.js +391 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts +51 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js +536 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/index.d.ts +35 -0
- package/dist/simulation/scenarios/latent-space/index.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/index.js +35 -0
- package/dist/simulation/scenarios/latent-space/index.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts +52 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.js +472 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts +53 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.js +391 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts +52 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js +514 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts +53 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.js +595 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.js.map +1 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.d.ts +18 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.js +132 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.js.map +1 -0
- package/dist/simulation/scenarios/multi-agent-swarm.d.ts +17 -0
- package/dist/simulation/scenarios/multi-agent-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/multi-agent-swarm.js +111 -0
- package/dist/simulation/scenarios/multi-agent-swarm.js.map +1 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts +23 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts.map +1 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.js +98 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.js.map +1 -0
- package/dist/simulation/scenarios/reflexion-learning.d.ts +16 -0
- package/dist/simulation/scenarios/reflexion-learning.d.ts.map +1 -0
- package/dist/simulation/scenarios/reflexion-learning.js +98 -0
- package/dist/simulation/scenarios/reflexion-learning.js.map +1 -0
- package/dist/simulation/scenarios/research-swarm.d.ts +24 -0
- package/dist/simulation/scenarios/research-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/research-swarm.js +146 -0
- package/dist/simulation/scenarios/research-swarm.js.map +1 -0
- package/dist/simulation/scenarios/skill-evolution.d.ts +16 -0
- package/dist/simulation/scenarios/skill-evolution.d.ts.map +1 -0
- package/dist/simulation/scenarios/skill-evolution.js +109 -0
- package/dist/simulation/scenarios/skill-evolution.js.map +1 -0
- package/dist/simulation/scenarios/stock-market-emergence.d.ts +33 -0
- package/dist/simulation/scenarios/stock-market-emergence.d.ts.map +1 -0
- package/dist/simulation/scenarios/stock-market-emergence.js +246 -0
- package/dist/simulation/scenarios/stock-market-emergence.js.map +1 -0
- package/dist/simulation/scenarios/strange-loops.d.ts +18 -0
- package/dist/simulation/scenarios/strange-loops.d.ts.map +1 -0
- package/dist/simulation/scenarios/strange-loops.js +133 -0
- package/dist/simulation/scenarios/strange-loops.js.map +1 -0
- package/dist/simulation/scenarios/sublinear-solver.d.ts +22 -0
- package/dist/simulation/scenarios/sublinear-solver.d.ts.map +1 -0
- package/dist/simulation/scenarios/sublinear-solver.js +82 -0
- package/dist/simulation/scenarios/sublinear-solver.js.map +1 -0
- package/dist/simulation/scenarios/temporal-lead-solver.d.ts +23 -0
- package/dist/simulation/scenarios/temporal-lead-solver.d.ts.map +1 -0
- package/dist/simulation/scenarios/temporal-lead-solver.js +90 -0
- package/dist/simulation/scenarios/temporal-lead-solver.js.map +1 -0
- package/dist/simulation/scenarios/voting-system-consensus.d.ts +27 -0
- package/dist/simulation/scenarios/voting-system-consensus.d.ts.map +1 -0
- package/dist/simulation/scenarios/voting-system-consensus.js +175 -0
- package/dist/simulation/scenarios/voting-system-consensus.js.map +1 -0
- package/dist/simulation/types.d.ts +162 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +5 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/simulation/utils/PerformanceOptimizer.d.ts +115 -0
- package/dist/simulation/utils/PerformanceOptimizer.d.ts.map +1 -0
- package/dist/simulation/utils/PerformanceOptimizer.js +223 -0
- package/dist/simulation/utils/PerformanceOptimizer.js.map +1 -0
- package/dist/src/backends/GraphBackend.d.ts +8 -8
- package/dist/src/backends/GraphBackend.d.ts.map +1 -1
- package/dist/src/backends/GraphBackend.js +15 -16
- package/dist/src/backends/GraphBackend.js.map +1 -1
- package/dist/src/backends/LearningBackend.d.ts +2 -2
- package/dist/src/backends/LearningBackend.d.ts.map +1 -1
- package/dist/src/backends/LearningBackend.js +10 -11
- package/dist/src/backends/LearningBackend.js.map +1 -1
- package/dist/src/backends/VectorBackend.d.ts +6 -31
- package/dist/src/backends/VectorBackend.d.ts.map +1 -1
- package/dist/src/backends/detector.d.ts +3 -25
- package/dist/src/backends/detector.d.ts.map +1 -1
- package/dist/src/backends/detector.js +15 -119
- package/dist/src/backends/detector.js.map +1 -1
- package/dist/src/backends/factory.d.ts +32 -16
- package/dist/src/backends/factory.d.ts.map +1 -1
- package/dist/src/backends/factory.js +70 -133
- package/dist/src/backends/factory.js.map +1 -1
- package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts +1 -1
- package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts.map +1 -1
- package/dist/src/backends/graph/GraphDatabaseAdapter.js +1 -5
- package/dist/src/backends/graph/GraphDatabaseAdapter.js.map +1 -1
- package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts +2 -2
- package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts.map +1 -1
- package/dist/src/backends/hnswlib/HNSWLibBackend.js +13 -49
- package/dist/src/backends/hnswlib/HNSWLibBackend.js.map +1 -1
- package/dist/src/backends/index.d.ts +3 -25
- package/dist/src/backends/index.d.ts.map +1 -1
- package/dist/src/backends/index.js +1 -23
- package/dist/src/backends/index.js.map +1 -1
- package/dist/src/backends/ruvector/GuardedVectorBackend.d.ts +93 -0
- package/dist/src/backends/ruvector/GuardedVectorBackend.d.ts.map +1 -0
- package/dist/src/backends/ruvector/GuardedVectorBackend.js +182 -0
- package/dist/src/backends/ruvector/GuardedVectorBackend.js.map +1 -0
- package/dist/src/backends/ruvector/RuVectorBackend.d.ts +16 -187
- package/dist/src/backends/ruvector/RuVectorBackend.d.ts.map +1 -1
- package/dist/src/backends/ruvector/RuVectorBackend.js +94 -576
- package/dist/src/backends/ruvector/RuVectorBackend.js.map +1 -1
- package/dist/src/backends/ruvector/RuVectorLearning.d.ts +4 -0
- package/dist/src/backends/ruvector/RuVectorLearning.d.ts.map +1 -1
- package/dist/src/backends/ruvector/RuVectorLearning.js +11 -10
- package/dist/src/backends/ruvector/RuVectorLearning.js.map +1 -1
- package/dist/src/benchmarks/wasm-vector-benchmark.d.ts +10 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.d.ts.map +1 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.js +196 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.js.map +1 -0
- package/dist/src/browser/AdvancedFeatures.d.ts.map +1 -1
- package/dist/src/browser/AdvancedFeatures.js +10 -3
- package/dist/src/browser/AdvancedFeatures.js.map +1 -1
- package/dist/src/browser/AttentionBrowser.d.ts.map +1 -1
- package/dist/src/browser/AttentionBrowser.js +12 -5
- package/dist/src/browser/AttentionBrowser.js.map +1 -1
- package/dist/src/browser/HNSWIndex.d.ts +1 -31
- package/dist/src/browser/HNSWIndex.d.ts.map +1 -1
- package/dist/src/browser/HNSWIndex.js +18 -136
- package/dist/src/browser/HNSWIndex.js.map +1 -1
- package/dist/src/browser/ProductQuantization.d.ts.map +1 -1
- package/dist/src/browser/ProductQuantization.js +1 -0
- package/dist/src/browser/ProductQuantization.js.map +1 -1
- package/dist/src/browser/index.d.ts +3 -3
- package/dist/src/browser/index.d.ts.map +1 -1
- package/dist/src/browser/index.js +1 -2
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/cli/agentdb-cli.d.ts +2 -16
- package/dist/src/cli/agentdb-cli.d.ts.map +1 -1
- package/dist/src/cli/agentdb-cli.js +216 -853
- package/dist/src/cli/agentdb-cli.js.map +1 -1
- package/dist/src/cli/commands/attention.js +3 -3
- package/dist/src/cli/commands/attention.js.map +1 -1
- package/dist/src/cli/commands/doctor.d.ts +0 -2
- package/dist/src/cli/commands/doctor.d.ts.map +1 -1
- package/dist/src/cli/commands/doctor.js +1 -106
- package/dist/src/cli/commands/doctor.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +1 -2
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +7 -30
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/install-embeddings.d.ts.map +1 -1
- package/dist/src/cli/commands/install-embeddings.js.map +1 -1
- package/dist/src/cli/commands/migrate.d.ts +0 -15
- package/dist/src/cli/commands/migrate.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate.js +5 -164
- package/dist/src/cli/commands/migrate.js.map +1 -1
- package/dist/src/cli/commands/simulate-report.js.map +1 -1
- package/dist/src/cli/commands/simulate-wizard.js.map +1 -1
- package/dist/src/cli/commands/simulate.d.ts +7 -0
- package/dist/src/cli/commands/simulate.d.ts.map +1 -0
- package/dist/src/cli/commands/simulate.js +100 -0
- package/dist/src/cli/commands/simulate.js.map +1 -0
- package/dist/src/cli/commands/status.js +1 -5
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/lib/attention-config.d.ts +2 -2
- package/dist/src/cli/lib/attention-config.d.ts.map +1 -1
- package/dist/src/cli/lib/attention-config.js +1 -2
- package/dist/src/cli/lib/attention-config.js.map +1 -1
- package/dist/src/cli/lib/config-manager.d.ts +110 -0
- package/dist/src/cli/lib/config-manager.d.ts.map +1 -0
- package/dist/src/cli/lib/config-manager.js +512 -0
- package/dist/src/cli/lib/config-manager.js.map +1 -0
- package/dist/src/cli/lib/config-validator.d.ts +1 -1
- package/dist/src/cli/lib/config-validator.d.ts.map +1 -1
- package/dist/src/cli/lib/health-monitor.d.ts +149 -0
- package/dist/src/cli/lib/health-monitor.d.ts.map +1 -0
- package/dist/src/cli/lib/health-monitor.js +380 -0
- package/dist/src/cli/lib/health-monitor.js.map +1 -0
- package/dist/src/cli/lib/history-tracker.d.ts +103 -0
- package/dist/src/cli/lib/history-tracker.d.ts.map +1 -0
- package/dist/src/cli/lib/history-tracker.js +352 -0
- package/dist/src/cli/lib/history-tracker.js.map +1 -0
- package/dist/src/cli/lib/report-store.d.ts +1 -2
- package/dist/src/cli/lib/report-store.d.ts.map +1 -1
- package/dist/src/cli/lib/report-store.js +65 -87
- package/dist/src/cli/lib/report-store.js.map +1 -1
- package/dist/src/cli/lib/simulation-registry.d.ts +1 -1
- package/dist/src/cli/lib/simulation-registry.d.ts.map +1 -1
- package/dist/src/cli/lib/simulation-registry.js +0 -1
- package/dist/src/cli/lib/simulation-registry.js.map +1 -1
- package/dist/src/cli/lib/simulation-runner.d.ts +4 -41
- package/dist/src/cli/lib/simulation-runner.d.ts.map +1 -1
- package/dist/src/cli/lib/simulation-runner.js +6 -251
- package/dist/src/cli/lib/simulation-runner.js.map +1 -1
- package/dist/src/controllers/AttentionService.d.ts.map +1 -1
- package/dist/src/controllers/AttentionService.js +5 -3
- package/dist/src/controllers/AttentionService.js.map +1 -1
- package/dist/src/controllers/CausalMemoryGraph.d.ts +8 -33
- package/dist/src/controllers/CausalMemoryGraph.d.ts.map +1 -1
- package/dist/src/controllers/CausalMemoryGraph.js +16 -93
- package/dist/src/controllers/CausalMemoryGraph.js.map +1 -1
- package/dist/src/controllers/CausalRecall.d.ts +3 -6
- package/dist/src/controllers/CausalRecall.d.ts.map +1 -1
- package/dist/src/controllers/CausalRecall.js +8 -14
- package/dist/src/controllers/CausalRecall.js.map +1 -1
- package/dist/src/controllers/ContextSynthesizer.d.ts +1 -1
- package/dist/src/controllers/ContextSynthesizer.d.ts.map +1 -1
- package/dist/src/controllers/EmbeddingService.d.ts.map +1 -1
- package/dist/src/controllers/EmbeddingService.js +3 -10
- package/dist/src/controllers/EmbeddingService.js.map +1 -1
- package/dist/src/controllers/EnhancedEmbeddingService.d.ts +0 -4
- package/dist/src/controllers/EnhancedEmbeddingService.d.ts.map +1 -1
- package/dist/src/controllers/EnhancedEmbeddingService.js +3 -10
- package/dist/src/controllers/EnhancedEmbeddingService.js.map +1 -1
- package/dist/src/controllers/ExplainableRecall.d.ts +6 -5
- package/dist/src/controllers/ExplainableRecall.d.ts.map +1 -1
- package/dist/src/controllers/ExplainableRecall.js +13 -21
- package/dist/src/controllers/ExplainableRecall.js.map +1 -1
- package/dist/src/controllers/HNSWIndex.d.ts +7 -24
- package/dist/src/controllers/HNSWIndex.d.ts.map +1 -1
- package/dist/src/controllers/HNSWIndex.js +10 -89
- package/dist/src/controllers/HNSWIndex.js.map +1 -1
- package/dist/src/controllers/LearningSystem.d.ts +10 -106
- package/dist/src/controllers/LearningSystem.d.ts.map +1 -1
- package/dist/src/controllers/LearningSystem.js +14 -39
- package/dist/src/controllers/LearningSystem.js.map +1 -1
- package/dist/src/controllers/MMRDiversityRanker.d.ts +1 -1
- package/dist/src/controllers/MMRDiversityRanker.d.ts.map +1 -1
- package/dist/src/controllers/MetadataFilter.d.ts +3 -3
- package/dist/src/controllers/MetadataFilter.d.ts.map +1 -1
- package/dist/src/controllers/MetadataFilter.js +6 -9
- package/dist/src/controllers/MetadataFilter.js.map +1 -1
- package/dist/src/controllers/NightlyLearner.d.ts +4 -9
- package/dist/src/controllers/NightlyLearner.d.ts.map +1 -1
- package/dist/src/controllers/NightlyLearner.js +9 -28
- package/dist/src/controllers/NightlyLearner.js.map +1 -1
- package/dist/src/controllers/QUICClient.d.ts +2 -50
- package/dist/src/controllers/QUICClient.d.ts.map +1 -1
- package/dist/src/controllers/QUICClient.js +3 -193
- package/dist/src/controllers/QUICClient.js.map +1 -1
- package/dist/src/controllers/QUICServer.d.ts +4 -4
- package/dist/src/controllers/QUICServer.d.ts.map +1 -1
- package/dist/src/controllers/QUICServer.js +14 -22
- package/dist/src/controllers/QUICServer.js.map +1 -1
- package/dist/src/controllers/ReasoningBank.d.ts +4 -14
- package/dist/src/controllers/ReasoningBank.d.ts.map +1 -1
- package/dist/src/controllers/ReasoningBank.js +46 -59
- package/dist/src/controllers/ReasoningBank.js.map +1 -1
- package/dist/src/controllers/ReflexionMemory.d.ts +7 -80
- package/dist/src/controllers/ReflexionMemory.d.ts.map +1 -1
- package/dist/src/controllers/ReflexionMemory.js +214 -372
- package/dist/src/controllers/ReflexionMemory.js.map +1 -1
- package/dist/src/controllers/SkillLibrary.d.ts +7 -37
- package/dist/src/controllers/SkillLibrary.d.ts.map +1 -1
- package/dist/src/controllers/SkillLibrary.js +96 -212
- package/dist/src/controllers/SkillLibrary.js.map +1 -1
- package/dist/src/controllers/SyncCoordinator.d.ts +3 -2
- package/dist/src/controllers/SyncCoordinator.d.ts.map +1 -1
- package/dist/src/controllers/SyncCoordinator.js +5 -117
- package/dist/src/controllers/SyncCoordinator.js.map +1 -1
- package/dist/src/controllers/WASMVectorSearch.d.ts +9 -20
- package/dist/src/controllers/WASMVectorSearch.d.ts.map +1 -1
- package/dist/src/controllers/WASMVectorSearch.js +29 -154
- package/dist/src/controllers/WASMVectorSearch.js.map +1 -1
- package/dist/src/controllers/frontier-index.d.ts +14 -0
- package/dist/src/controllers/frontier-index.d.ts.map +1 -0
- package/dist/src/controllers/frontier-index.js +10 -0
- package/dist/src/controllers/frontier-index.js.map +1 -0
- package/dist/src/controllers/index.d.ts +17 -8
- package/dist/src/controllers/index.d.ts.map +1 -1
- package/dist/src/controllers/index.js +12 -6
- package/dist/src/controllers/index.js.map +1 -1
- package/dist/src/core/AgentDB.d.ts +25 -57
- package/dist/src/core/AgentDB.d.ts.map +1 -1
- package/dist/src/core/AgentDB.js +115 -137
- package/dist/src/core/AgentDB.js.map +1 -1
- package/dist/src/db-fallback.d.ts +1 -10
- package/dist/src/db-fallback.d.ts.map +1 -1
- package/dist/src/db-fallback.js +4 -171
- package/dist/src/db-fallback.js.map +1 -1
- package/dist/src/db-test.d.ts +13 -0
- package/dist/src/db-test.d.ts.map +1 -0
- package/dist/src/db-test.js +55 -0
- package/dist/src/db-test.js.map +1 -0
- package/dist/src/db-unified.d.ts +76 -0
- package/dist/src/db-unified.d.ts.map +1 -0
- package/dist/src/db-unified.js +279 -0
- package/dist/src/db-unified.js.map +1 -0
- package/dist/src/examples/quic-sync-example.d.ts +9 -0
- package/dist/src/examples/quic-sync-example.d.ts.map +1 -0
- package/dist/src/examples/quic-sync-example.js +169 -0
- package/dist/src/examples/quic-sync-example.js.map +1 -0
- package/dist/src/examples/wasm-vector-usage.d.ts +12 -0
- package/dist/src/examples/wasm-vector-usage.d.ts.map +1 -0
- package/dist/src/examples/wasm-vector-usage.js +190 -0
- package/dist/src/examples/wasm-vector-usage.js.map +1 -0
- package/dist/src/index.d.ts +12 -38
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -46
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/agentdb-mcp-server.js +63 -219
- package/dist/src/mcp/agentdb-mcp-server.js.map +1 -1
- package/dist/src/mcp/learning-tools-handlers.d.ts +16 -0
- package/dist/src/mcp/learning-tools-handlers.d.ts.map +1 -0
- package/dist/src/mcp/learning-tools-handlers.js +105 -0
- package/dist/src/mcp/learning-tools-handlers.js.map +1 -0
- package/dist/src/optimizations/BatchOperations.d.ts +5 -52
- package/dist/src/optimizations/BatchOperations.d.ts.map +1 -1
- package/dist/src/optimizations/BatchOperations.js +33 -186
- package/dist/src/optimizations/BatchOperations.js.map +1 -1
- package/dist/src/optimizations/QueryOptimizer.d.ts +4 -4
- package/dist/src/optimizations/QueryOptimizer.d.ts.map +1 -1
- package/dist/src/optimizations/QueryOptimizer.js +1 -3
- package/dist/src/optimizations/QueryOptimizer.js.map +1 -1
- package/dist/src/optimizations/ToolCache.d.ts +4 -4
- package/dist/src/optimizations/ToolCache.d.ts.map +1 -1
- package/dist/src/optimizations/ToolCache.js.map +1 -1
- package/dist/src/optimizations/index.d.ts +1 -1
- package/dist/src/optimizations/index.d.ts.map +1 -1
- package/dist/src/security/AttestationLog.d.ts +70 -0
- package/dist/src/security/AttestationLog.d.ts.map +1 -0
- package/dist/src/security/AttestationLog.js +174 -0
- package/dist/src/security/AttestationLog.js.map +1 -0
- package/dist/src/security/MutationGuard.d.ts +83 -0
- package/dist/src/security/MutationGuard.d.ts.map +1 -0
- package/dist/src/security/MutationGuard.js +379 -0
- package/dist/src/security/MutationGuard.js.map +1 -0
- package/dist/src/security/index.d.ts +15 -0
- package/dist/src/security/index.d.ts.map +1 -0
- package/dist/src/security/index.js +18 -0
- package/dist/src/security/index.js.map +1 -0
- package/dist/src/security/input-validation.d.ts +12 -12
- package/dist/src/security/input-validation.d.ts.map +1 -1
- package/dist/src/security/input-validation.js +0 -1
- package/dist/src/security/input-validation.js.map +1 -1
- package/dist/src/security/limits.d.ts +150 -0
- package/dist/src/security/limits.d.ts.map +1 -0
- package/dist/src/security/limits.js +288 -0
- package/dist/src/security/limits.js.map +1 -0
- package/dist/src/security/path-security.d.ts +100 -0
- package/dist/src/security/path-security.d.ts.map +1 -0
- package/dist/src/security/path-security.js +337 -0
- package/dist/src/security/path-security.js.map +1 -0
- package/dist/src/security/validation.d.ts +95 -0
- package/dist/src/security/validation.d.ts.map +1 -0
- package/dist/src/security/validation.js +315 -0
- package/dist/src/security/validation.js.map +1 -0
- package/dist/src/services/GraphTransformerService.d.ts +79 -0
- package/dist/src/services/GraphTransformerService.d.ts.map +1 -0
- package/dist/src/services/GraphTransformerService.js +331 -0
- package/dist/src/services/GraphTransformerService.js.map +1 -0
- package/dist/src/services/LLMRouter.d.ts +7 -61
- package/dist/src/services/LLMRouter.d.ts.map +1 -1
- package/dist/src/services/LLMRouter.js +25 -295
- package/dist/src/services/LLMRouter.js.map +1 -1
- package/dist/src/services/SemanticRouter.d.ts +78 -0
- package/dist/src/services/SemanticRouter.d.ts.map +1 -0
- package/dist/src/services/SemanticRouter.js +149 -0
- package/dist/src/services/SemanticRouter.js.map +1 -0
- package/dist/src/services/SonaTrajectoryService.d.ts +100 -0
- package/dist/src/services/SonaTrajectoryService.d.ts.map +1 -0
- package/dist/src/services/SonaTrajectoryService.js +231 -0
- package/dist/src/services/SonaTrajectoryService.js.map +1 -0
- package/dist/src/types/attention.d.ts +249 -0
- package/dist/src/types/attention.d.ts.map +1 -0
- package/dist/src/types/attention.js +43 -0
- package/dist/src/types/attention.js.map +1 -0
- package/dist/src/types/quic.d.ts +518 -0
- package/dist/src/types/quic.d.ts.map +1 -0
- package/dist/src/types/quic.js +272 -0
- package/dist/src/types/quic.js.map +1 -0
- package/dist/src/utils/LegacyAttentionAdapter.d.ts +93 -0
- package/dist/src/utils/LegacyAttentionAdapter.d.ts.map +1 -0
- package/dist/src/utils/LegacyAttentionAdapter.js +241 -0
- package/dist/src/utils/LegacyAttentionAdapter.js.map +1 -0
- package/dist/src/utils/attention-metrics.d.ts +76 -0
- package/dist/src/utils/attention-metrics.d.ts.map +1 -0
- package/dist/src/utils/attention-metrics.js +178 -0
- package/dist/src/utils/attention-metrics.js.map +1 -0
- package/dist/src/utils/vector-math.d.ts +29 -0
- package/dist/src/utils/vector-math.d.ts.map +1 -0
- package/dist/src/utils/vector-math.js +66 -0
- package/dist/src/utils/vector-math.js.map +1 -0
- package/examples/README.md +105 -0
- package/examples/browser/attention-demo.html +499 -0
- package/examples/browser/flash-consolidation.html +598 -0
- package/examples/browser/hyperbolic-hierarchy.html +497 -0
- package/examples/quickstart.js +43 -0
- package/package.json +53 -56
- package/simulation/.claude-flow/metrics/agent-metrics.json +1 -0
- package/simulation/.claude-flow/metrics/performance.json +87 -0
- package/simulation/.claude-flow/metrics/task-metrics.json +10 -0
- package/simulation/COMPLETION-STATUS.md +139 -0
- package/simulation/FINAL-RESULTS.md +414 -0
- package/simulation/FINAL-STATUS.md +281 -0
- package/simulation/INTEGRATION-COMPLETE.md +452 -0
- package/simulation/MIGRATION-STATUS.md +231 -0
- package/simulation/OPTIMIZATION-RESULTS.md +397 -0
- package/simulation/PHASE1-COMPLETE.md +163 -0
- package/simulation/README.md +848 -0
- package/simulation/SIMULATION-RESULTS.md +239 -0
- package/simulation/cli.ts +78 -0
- package/simulation/configs/default.json +37 -0
- package/simulation/data/advanced/aidefence.graph +0 -0
- package/simulation/data/advanced/bmssp.graph +0 -0
- package/simulation/data/advanced/consciousness.graph +0 -0
- package/simulation/data/advanced/goalie.graph +0 -0
- package/simulation/data/advanced/psycho-symbolic.graph +0 -0
- package/simulation/data/advanced/research-swarm.graph +0 -0
- package/simulation/data/advanced/sublinear.graph +0 -0
- package/simulation/data/advanced/temporal.graph +0 -0
- package/simulation/data/causal.graph +0 -0
- package/simulation/data/graph-traversal.graph +0 -0
- package/simulation/data/lean-agentic.graph +0 -0
- package/simulation/data/reflexion.graph +0 -0
- package/simulation/data/skills.graph +0 -0
- package/simulation/data/stock-market.graph +0 -0
- package/simulation/data/strange-loops.graph +0 -0
- package/simulation/data/swarm.graph +0 -0
- package/simulation/data/voting-consensus.graph +0 -0
- package/simulation/docs/CLI-INTEGRATION-PLAN.md +1038 -0
- package/simulation/docs/COMPREHENSIVE-LATENT-SPACE-COMPLETION.md +354 -0
- package/simulation/docs/DOCUMENTATION-INDEX.md +226 -0
- package/simulation/docs/IMPLEMENTATION-COMPLETE.md +521 -0
- package/simulation/docs/OPTIMIZATION-SUMMARY.md +279 -0
- package/simulation/docs/README.md +229 -0
- package/simulation/docs/SWARM-5-INTEGRATION-SUMMARY.md +528 -0
- package/simulation/docs/TESTING-SUMMARY.md +304 -0
- package/simulation/docs/architecture/EXTENSION-API.md +868 -0
- package/simulation/docs/architecture/INTEGRATION-ARCHITECTURE.md +1138 -0
- package/simulation/docs/architecture/OPTIMIZATION-STRATEGY.md +778 -0
- package/simulation/docs/architecture/SIMULATION-ARCHITECTURE.md +892 -0
- package/simulation/docs/guides/CLI-REFERENCE.md +896 -0
- package/simulation/docs/guides/CUSTOM-SIMULATIONS.md +931 -0
- package/simulation/docs/guides/DEPLOYMENT.md +832 -0
- package/simulation/docs/guides/IMPLEMENTATION-SUMMARY.md +544 -0
- package/simulation/docs/guides/MIGRATION-GUIDE.md +591 -0
- package/simulation/docs/guides/QUICK-START.md +361 -0
- package/simulation/docs/guides/README.md +736 -0
- package/simulation/docs/guides/TROUBLESHOOTING.md +817 -0
- package/simulation/docs/guides/WIZARD-GUIDE.md +869 -0
- package/simulation/docs/reports/latent-space/MASTER-SYNTHESIS.md +345 -0
- package/simulation/docs/reports/latent-space/README.md +132 -0
- package/simulation/docs/reports/latent-space/attention-analysis-RESULTS.md +238 -0
- package/simulation/docs/reports/latent-space/clustering-analysis-RESULTS.md +210 -0
- package/simulation/docs/reports/latent-space/hnsw-exploration-RESULTS.md +332 -0
- package/simulation/docs/reports/latent-space/hypergraph-exploration-RESULTS.md +37 -0
- package/simulation/docs/reports/latent-space/neural-augmentation-RESULTS.md +69 -0
- package/simulation/docs/reports/latent-space/quantum-hybrid-RESULTS.md +91 -0
- package/simulation/docs/reports/latent-space/self-organizing-hnsw-RESULTS.md +51 -0
- package/simulation/docs/reports/latent-space/traversal-optimization-RESULTS.md +238 -0
- package/simulation/reports/README.md +397 -0
- package/simulation/reports/advanced-simulations-performance.md +1241 -0
- package/simulation/reports/aidefence-integration-2025-11-30T01-36-53-486Z.json +30 -0
- package/simulation/reports/architecture-analysis.md +1396 -0
- package/simulation/reports/basic-scenarios-performance.md +1840 -0
- package/simulation/reports/bmssp-integration-2025-11-30T01-36-27-193Z.json +30 -0
- package/simulation/reports/bmssp-integration-2025-11-30T03-38-12-887Z.json +30 -0
- package/simulation/reports/causal-reasoning-2025-11-29T23-35-21-795Z.json +36 -0
- package/simulation/reports/causal-reasoning-2025-11-30T00-58-42-862Z.json +30 -0
- package/simulation/reports/causal-reasoning-2025-11-30T00-59-12-546Z.json +40 -0
- package/simulation/reports/consciousness-explorer-2025-11-30T01-36-51-269Z.json +31 -0
- package/simulation/reports/core-benchmarks.md +727 -0
- package/simulation/reports/goalie-integration-2025-11-30T01-36-52-377Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-29T23-35-35-279Z.json +78 -0
- package/simulation/reports/graph-traversal-2025-11-29T23-37-36-697Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-03-59-716Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-05-10-984Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-06-16-334Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-06-53-312Z.json +30 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-07-51-075Z.json +24 -0
- package/simulation/reports/graph-traversal-2025-11-30T01-08-22-179Z.json +42 -0
- package/simulation/reports/lean-agentic-swarm-2025-11-29T23-37-23-804Z.json +148 -0
- package/simulation/reports/lean-agentic-swarm-2025-11-30T01-31-24-401Z.json +31 -0
- package/simulation/reports/lean-agentic-swarm-2025-11-30T03-38-01-470Z.json +31 -0
- package/simulation/reports/multi-agent-swarm-2025-11-29T23-35-28-093Z.json +78 -0
- package/simulation/reports/multi-agent-swarm-2025-11-30T01-03-54-062Z.json +42 -0
- package/simulation/reports/multi-agent-swarm-2025-11-30T01-05-06-092Z.json +42 -0
- package/simulation/reports/psycho-symbolic-reasoner-2025-11-30T01-36-50-180Z.json +30 -0
- package/simulation/reports/quality-metrics.md +727 -0
- package/simulation/reports/reflexion-learning-2025-11-29T23-35-09-774Z.json +48 -0
- package/simulation/reports/reflexion-learning-2025-11-29T23-37-16-934Z.json +36 -0
- package/simulation/reports/reflexion-learning-2025-11-30T00-07-49-259Z.json +30 -0
- package/simulation/reports/reflexion-learning-2025-11-30T00-09-29-319Z.json +51 -0
- package/simulation/reports/reflexion-learning-2025-11-30T00-28-37-659Z.json +51 -0
- package/simulation/reports/reflexion-learning-2025-11-30T01-31-30-690Z.json +29 -0
- package/simulation/reports/reflexion-learning-2025-11-30T03-38-06-937Z.json +29 -0
- package/simulation/reports/research-foundations.md +2004 -0
- package/simulation/reports/research-swarm-2025-11-30T01-36-54-647Z.json +30 -0
- package/simulation/reports/scalability-deployment.md +2404 -0
- package/simulation/reports/skill-evolution-2025-11-29T23-35-15-945Z.json +36 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-03-17-995Z.json +30 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-03-48-441Z.json +30 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-05-00-554Z.json +30 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-06-11-436Z.json +30 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-06-51-979Z.json +30 -0
- package/simulation/reports/skill-evolution-2025-11-30T01-07-32-695Z.json +40 -0
- package/simulation/reports/stock-market-emergence-2025-11-30T00-11-43-865Z.json +56 -0
- package/simulation/reports/stock-market-emergence-2025-11-30T00-28-57-495Z.json +56 -0
- package/simulation/reports/strange-loops-2025-11-29T23-37-30-621Z.json +78 -0
- package/simulation/reports/strange-loops-2025-11-30T00-07-55-415Z.json +30 -0
- package/simulation/reports/strange-loops-2025-11-30T00-09-35-133Z.json +30 -0
- package/simulation/reports/strange-loops-2025-11-30T00-48-50-744Z.json +24 -0
- package/simulation/reports/strange-loops-2025-11-30T00-54-48-044Z.json +24 -0
- package/simulation/reports/strange-loops-2025-11-30T00-57-27-633Z.json +24 -0
- package/simulation/reports/strange-loops-2025-11-30T00-57-59-135Z.json +42 -0
- package/simulation/reports/sublinear-solver-2025-11-30T01-36-33-134Z.json +30 -0
- package/simulation/reports/temporal-lead-solver-2025-11-30T01-36-38-628Z.json +30 -0
- package/simulation/reports/use-cases-applications.md +2212 -0
- package/simulation/reports/voting-system-consensus-2025-11-30T00-11-37-199Z.json +58 -0
- package/simulation/reports/voting-system-consensus-2025-11-30T00-28-47-735Z.json +58 -0
- package/simulation/runner.ts +300 -0
- package/simulation/scenarios/README-advanced/aidefence-integration.md +63 -0
- package/simulation/scenarios/README-advanced/bmssp-integration.md +58 -0
- package/simulation/scenarios/README-advanced/consciousness-explorer.md +53 -0
- package/simulation/scenarios/README-advanced/goalie-integration.md +61 -0
- package/simulation/scenarios/README-advanced/psycho-symbolic-reasoner.md +55 -0
- package/simulation/scenarios/README-advanced/research-swarm.md +63 -0
- package/simulation/scenarios/README-advanced/sublinear-solver.md +58 -0
- package/simulation/scenarios/README-advanced/temporal-lead-solver.md +55 -0
- package/simulation/scenarios/README-basic/causal-reasoning.md +39 -0
- package/simulation/scenarios/README-basic/graph-traversal.md +41 -0
- package/simulation/scenarios/README-basic/lean-agentic-swarm.md +122 -0
- package/simulation/scenarios/README-basic/multi-agent-swarm.md +34 -0
- package/simulation/scenarios/README-basic/reflexion-learning.md +41 -0
- package/simulation/scenarios/README-basic/skill-evolution.md +38 -0
- package/simulation/scenarios/README-basic/stock-market-emergence.md +28 -0
- package/simulation/scenarios/README-basic/strange-loops.md +36 -0
- package/simulation/scenarios/README-basic/voting-system-consensus.md +28 -0
- package/simulation/scenarios/README.md +438 -0
- package/simulation/scenarios/aidefence-integration.ts +165 -0
- package/simulation/scenarios/bmssp-integration.ts +137 -0
- package/simulation/scenarios/causal-reasoning.ts +143 -0
- package/simulation/scenarios/consciousness-explorer.ts +139 -0
- package/simulation/scenarios/domain-examples/.claude-flow/metrics/agent-metrics.json +1 -0
- package/simulation/scenarios/domain-examples/.claude-flow/metrics/performance.json +87 -0
- package/simulation/scenarios/domain-examples/.claude-flow/metrics/task-metrics.json +10 -0
- package/simulation/scenarios/domain-examples/README.md +525 -0
- package/simulation/scenarios/domain-examples/e-commerce-recommendations.ts +220 -0
- package/simulation/scenarios/domain-examples/index.ts +81 -0
- package/simulation/scenarios/domain-examples/iot-sensor-networks.ts +290 -0
- package/simulation/scenarios/domain-examples/medical-imaging.ts +181 -0
- package/simulation/scenarios/domain-examples/robotics-navigation.ts +214 -0
- package/simulation/scenarios/domain-examples/scientific-research.ts +250 -0
- package/simulation/scenarios/domain-examples/trading-systems.ts +138 -0
- package/simulation/scenarios/goalie-integration.ts +161 -0
- package/simulation/scenarios/graph-traversal.ts +129 -0
- package/simulation/scenarios/latent-space/OPTIMIZATION-COMPLETE.md +287 -0
- package/simulation/scenarios/latent-space/README-attention-analysis.md +170 -0
- package/simulation/scenarios/latent-space/README-clustering-analysis.md +239 -0
- package/simulation/scenarios/latent-space/README-hnsw-exploration.md +199 -0
- package/simulation/scenarios/latent-space/README-hypergraph-exploration.md +279 -0
- package/simulation/scenarios/latent-space/README-neural-augmentation.md +267 -0
- package/simulation/scenarios/latent-space/README-quantum-hybrid.md +276 -0
- package/simulation/scenarios/latent-space/README-self-organizing-hnsw.md +244 -0
- package/simulation/scenarios/latent-space/README-traversal-optimization.md +212 -0
- package/simulation/scenarios/latent-space/attention-analysis.ts +598 -0
- package/simulation/scenarios/latent-space/clustering-analysis.ts +796 -0
- package/simulation/scenarios/latent-space/hnsw-exploration.ts +526 -0
- package/simulation/scenarios/latent-space/hypergraph-exploration.ts +706 -0
- package/simulation/scenarios/latent-space/index.ts +47 -0
- package/simulation/scenarios/latent-space/neural-augmentation.ts +604 -0
- package/simulation/scenarios/latent-space/quantum-hybrid.ts +508 -0
- package/simulation/scenarios/latent-space/self-organizing-hnsw.ts +680 -0
- package/simulation/scenarios/latent-space/traversal-optimization.ts +782 -0
- package/simulation/scenarios/lean-agentic-swarm.ts +182 -0
- package/simulation/scenarios/multi-agent-swarm.ts +146 -0
- package/simulation/scenarios/psycho-symbolic-reasoner.ts +136 -0
- package/simulation/scenarios/reflexion-learning.ts +132 -0
- package/simulation/scenarios/research-swarm.ts +187 -0
- package/simulation/scenarios/skill-evolution.ts +135 -0
- package/simulation/scenarios/stock-market-emergence.ts +323 -0
- package/simulation/scenarios/strange-loops.ts +175 -0
- package/simulation/scenarios/sublinear-solver.ts +108 -0
- package/simulation/scenarios/temporal-lead-solver.ts +121 -0
- package/simulation/scenarios/voting-system-consensus.ts +251 -0
- package/simulation/tests/latent-space/attention-analysis.test.ts +204 -0
- package/simulation/tests/latent-space/clustering-analysis.test.ts +281 -0
- package/simulation/tests/latent-space/hnsw-exploration.test.ts +253 -0
- package/simulation/tests/latent-space/hypergraph-exploration.test.ts +295 -0
- package/simulation/tests/latent-space/neural-augmentation.test.ts +326 -0
- package/simulation/tests/latent-space/quantum-hybrid.test.ts +307 -0
- package/simulation/tests/latent-space/self-organizing-hnsw.test.ts +291 -0
- package/simulation/tests/latent-space/traversal-optimization.test.ts +261 -0
- package/simulation/types.ts +177 -0
- package/simulation/utils/PerformanceOptimizer.ts +269 -0
- package/src/backends/GraphBackend.ts +290 -0
- package/src/backends/LearningBackend.ts +210 -0
- package/src/backends/README.md +389 -0
- package/src/backends/VectorBackend.ts +147 -0
- package/src/backends/detector.ts +283 -0
- package/src/backends/factory.ts +279 -0
- package/src/backends/graph/GraphDatabaseAdapter.ts +334 -0
- package/src/backends/hnswlib/HNSWLibBackend.ts +419 -0
- package/src/backends/hnswlib/index.ts +7 -0
- package/src/backends/index.ts +32 -0
- package/src/backends/ruvector/GuardedVectorBackend.ts +219 -0
- package/src/backends/ruvector/RuVectorBackend.ts +343 -0
- package/src/backends/ruvector/RuVectorLearning.ts +254 -0
- package/src/backends/ruvector/index.ts +9 -0
- package/src/benchmarks/wasm-vector-benchmark.ts +250 -0
- package/src/browser/AdvancedFeatures.ts +565 -0
- package/src/browser/AttentionBrowser.ts +387 -0
- package/src/browser/HNSWIndex.ts +494 -0
- package/src/browser/ProductQuantization.ts +419 -0
- package/src/browser/index.ts +317 -0
- package/src/cli/agentdb-cli.ts +2712 -0
- package/src/cli/attention-cli-integration.ts +91 -0
- package/src/cli/commands/attention.ts +656 -0
- package/src/cli/commands/doctor.ts +322 -0
- package/src/cli/commands/init.ts +176 -0
- package/src/cli/commands/install-embeddings.ts +81 -0
- package/src/cli/commands/migrate.ts +545 -0
- package/src/cli/commands/simulate-custom.ts +232 -0
- package/src/cli/commands/simulate-report.ts +171 -0
- package/src/cli/commands/simulate-wizard.ts +379 -0
- package/src/cli/commands/simulate.ts +115 -0
- package/src/cli/commands/status.ts +156 -0
- package/src/cli/examples.sh +83 -0
- package/src/cli/lib/attention-config.ts +326 -0
- package/src/cli/lib/config-manager.ts +627 -0
- package/src/cli/lib/config-validator.ts +261 -0
- package/src/cli/lib/health-monitor.ts +513 -0
- package/src/cli/lib/help-formatter.ts +406 -0
- package/src/cli/lib/history-tracker.ts +503 -0
- package/src/cli/lib/report-generator.ts +455 -0
- package/src/cli/lib/report-store.ts +582 -0
- package/src/cli/lib/simulation-registry.ts +503 -0
- package/src/cli/lib/simulation-runner.ts +291 -0
- package/src/cli/tests/agentdb-cli.test.ts +58 -0
- package/src/cli/tests/attention-cli.test.ts +335 -0
- package/src/controllers/AttentionService.ts +770 -0
- package/src/controllers/CausalMemoryGraph.ts +773 -0
- package/src/controllers/CausalRecall.ts +484 -0
- package/src/controllers/ContextSynthesizer.ts +285 -0
- package/src/controllers/EmbeddingService.ts +161 -0
- package/src/controllers/EnhancedEmbeddingService.ts +143 -0
- package/src/controllers/ExplainableRecall.ts +746 -0
- package/src/controllers/HNSWIndex.ts +495 -0
- package/src/controllers/LearningSystem.ts +1270 -0
- package/src/controllers/MMRDiversityRanker.ts +187 -0
- package/src/controllers/MetadataFilter.ts +280 -0
- package/src/controllers/NightlyLearner.ts +647 -0
- package/src/controllers/QUICClient.ts +413 -0
- package/src/controllers/QUICServer.ts +498 -0
- package/src/controllers/ReasoningBank.ts +665 -0
- package/src/controllers/ReflexionMemory.ts +872 -0
- package/src/controllers/SkillLibrary.ts +795 -0
- package/src/controllers/SyncCoordinator.ts +597 -0
- package/src/controllers/WASMVectorSearch.ts +292 -0
- package/src/controllers/frontier-index.ts +35 -0
- package/src/controllers/index.ts +57 -0
- package/src/coordination/MultiDatabaseCoordinator.ts +1107 -0
- package/src/coordination/index.ts +24 -0
- package/src/core/AgentDB.ts +211 -0
- package/src/db-fallback.ts +296 -0
- package/src/db-test.ts +59 -0
- package/src/db-unified.ts +327 -0
- package/src/examples/quic-sync-example.ts +198 -0
- package/src/examples/wasm-vector-usage.ts +245 -0
- package/src/index.ts +69 -0
- package/src/mcp/agentdb-mcp-server.ts +2318 -0
- package/src/mcp/attention-mcp-integration.ts +145 -0
- package/src/mcp/attention-tools-handlers.ts +586 -0
- package/src/mcp/learning-tools-handlers.ts +106 -0
- package/src/optimizations/BatchOperations.ts +594 -0
- package/src/optimizations/QueryOptimizer.ts +297 -0
- package/src/optimizations/ToolCache.ts +355 -0
- package/src/optimizations/index.ts +11 -0
- package/src/schemas/frontier-schema.sql +378 -0
- package/src/schemas/schema.sql +382 -0
- package/src/security/AttestationLog.ts +252 -0
- package/src/security/MutationGuard.ts +420 -0
- package/src/security/index.ts +52 -0
- package/src/security/input-validation.ts +543 -0
- package/src/security/limits.ts +375 -0
- package/src/security/path-security.ts +436 -0
- package/src/security/validation.ts +556 -0
- package/src/services/GraphTransformerService.ts +389 -0
- package/src/services/LLMRouter.ts +380 -0
- package/src/services/SemanticRouter.ts +169 -0
- package/src/services/SonaTrajectoryService.ts +264 -0
- package/src/tests/attention-service.test.ts +492 -0
- package/src/tests/wasm-vector-search.test.ts +240 -0
- package/src/types/attention.ts +392 -0
- package/src/types/quic.ts +772 -0
- package/src/utils/LegacyAttentionAdapter.ts +393 -0
- package/src/utils/NodeIdMapper.ts +64 -0
- package/src/utils/attention-metrics.ts +253 -0
- package/src/utils/vector-math.ts +71 -0
- package/LICENSE +0 -21
- package/dist/src/backends/rvf/AdaptiveIndexTuner.d.ts +0 -175
- package/dist/src/backends/rvf/AdaptiveIndexTuner.d.ts.map +0 -1
- package/dist/src/backends/rvf/AdaptiveIndexTuner.js +0 -559
- package/dist/src/backends/rvf/AdaptiveIndexTuner.js.map +0 -1
- package/dist/src/backends/rvf/ContrastiveTrainer.d.ts +0 -148
- package/dist/src/backends/rvf/ContrastiveTrainer.d.ts.map +0 -1
- package/dist/src/backends/rvf/ContrastiveTrainer.js +0 -438
- package/dist/src/backends/rvf/ContrastiveTrainer.js.map +0 -1
- package/dist/src/backends/rvf/FederatedSessionManager.d.ts +0 -211
- package/dist/src/backends/rvf/FederatedSessionManager.d.ts.map +0 -1
- package/dist/src/backends/rvf/FederatedSessionManager.js +0 -389
- package/dist/src/backends/rvf/FederatedSessionManager.js.map +0 -1
- package/dist/src/backends/rvf/FilterBuilder.d.ts +0 -136
- package/dist/src/backends/rvf/FilterBuilder.d.ts.map +0 -1
- package/dist/src/backends/rvf/FilterBuilder.js +0 -157
- package/dist/src/backends/rvf/FilterBuilder.js.map +0 -1
- package/dist/src/backends/rvf/NativeAccelerator.d.ts +0 -140
- package/dist/src/backends/rvf/NativeAccelerator.d.ts.map +0 -1
- package/dist/src/backends/rvf/NativeAccelerator.js +0 -630
- package/dist/src/backends/rvf/NativeAccelerator.js.map +0 -1
- package/dist/src/backends/rvf/RvfBackend.d.ts +0 -194
- package/dist/src/backends/rvf/RvfBackend.d.ts.map +0 -1
- package/dist/src/backends/rvf/RvfBackend.js +0 -607
- package/dist/src/backends/rvf/RvfBackend.js.map +0 -1
- package/dist/src/backends/rvf/RvfSolver.d.ts +0 -175
- package/dist/src/backends/rvf/RvfSolver.d.ts.map +0 -1
- package/dist/src/backends/rvf/RvfSolver.js +0 -176
- package/dist/src/backends/rvf/RvfSolver.js.map +0 -1
- package/dist/src/backends/rvf/SelfLearningRvfBackend.d.ts +0 -143
- package/dist/src/backends/rvf/SelfLearningRvfBackend.d.ts.map +0 -1
- package/dist/src/backends/rvf/SelfLearningRvfBackend.js +0 -569
- package/dist/src/backends/rvf/SelfLearningRvfBackend.js.map +0 -1
- package/dist/src/backends/rvf/SemanticQueryRouter.d.ts +0 -128
- package/dist/src/backends/rvf/SemanticQueryRouter.d.ts.map +0 -1
- package/dist/src/backends/rvf/SemanticQueryRouter.js +0 -415
- package/dist/src/backends/rvf/SemanticQueryRouter.js.map +0 -1
- package/dist/src/backends/rvf/SimdFallbacks.d.ts +0 -25
- package/dist/src/backends/rvf/SimdFallbacks.d.ts.map +0 -1
- package/dist/src/backends/rvf/SimdFallbacks.js +0 -287
- package/dist/src/backends/rvf/SimdFallbacks.js.map +0 -1
- package/dist/src/backends/rvf/SolverBandit.d.ts +0 -100
- package/dist/src/backends/rvf/SolverBandit.d.ts.map +0 -1
- package/dist/src/backends/rvf/SolverBandit.js +0 -216
- package/dist/src/backends/rvf/SolverBandit.js.map +0 -1
- package/dist/src/backends/rvf/SonaLearningBackend.d.ts +0 -157
- package/dist/src/backends/rvf/SonaLearningBackend.d.ts.map +0 -1
- package/dist/src/backends/rvf/SonaLearningBackend.js +0 -283
- package/dist/src/backends/rvf/SonaLearningBackend.js.map +0 -1
- package/dist/src/backends/rvf/SqlJsRvfBackend.d.ts +0 -77
- package/dist/src/backends/rvf/SqlJsRvfBackend.d.ts.map +0 -1
- package/dist/src/backends/rvf/SqlJsRvfBackend.js +0 -382
- package/dist/src/backends/rvf/SqlJsRvfBackend.js.map +0 -1
- package/dist/src/backends/rvf/WasmStoreBridge.d.ts +0 -27
- package/dist/src/backends/rvf/WasmStoreBridge.d.ts.map +0 -1
- package/dist/src/backends/rvf/WasmStoreBridge.js +0 -87
- package/dist/src/backends/rvf/WasmStoreBridge.js.map +0 -1
- package/dist/src/backends/rvf/validation.d.ts +0 -20
- package/dist/src/backends/rvf/validation.d.ts.map +0 -1
- package/dist/src/backends/rvf/validation.js +0 -78
- package/dist/src/backends/rvf/validation.js.map +0 -1
- package/dist/src/benchmark/BenchmarkSuite.d.ts +0 -318
- package/dist/src/benchmark/BenchmarkSuite.d.ts.map +0 -1
- package/dist/src/benchmark/BenchmarkSuite.js +0 -986
- package/dist/src/benchmark/BenchmarkSuite.js.map +0 -1
- package/dist/src/benchmark/index.d.ts +0 -29
- package/dist/src/benchmark/index.d.ts.map +0 -1
- package/dist/src/benchmark/index.js +0 -39
- package/dist/src/benchmark/index.js.map +0 -1
- package/dist/src/cli/commands/hyperbolic.d.ts +0 -11
- package/dist/src/cli/commands/hyperbolic.d.ts.map +0 -1
- package/dist/src/cli/commands/hyperbolic.js +0 -428
- package/dist/src/cli/commands/hyperbolic.js.map +0 -1
- package/dist/src/cli/commands/learn.d.ts +0 -11
- package/dist/src/cli/commands/learn.d.ts.map +0 -1
- package/dist/src/cli/commands/learn.js +0 -404
- package/dist/src/cli/commands/learn.js.map +0 -1
- package/dist/src/cli/commands/route.d.ts +0 -11
- package/dist/src/cli/commands/route.d.ts.map +0 -1
- package/dist/src/cli/commands/route.js +0 -414
- package/dist/src/cli/commands/route.js.map +0 -1
- package/dist/src/cli/commands/rvf.d.ts +0 -21
- package/dist/src/cli/commands/rvf.d.ts.map +0 -1
- package/dist/src/cli/commands/rvf.js +0 -448
- package/dist/src/cli/commands/rvf.js.map +0 -1
- package/dist/src/cli/tests/agentdb-cli.test.d.ts +0 -8
- package/dist/src/cli/tests/agentdb-cli.test.d.ts.map +0 -1
- package/dist/src/cli/tests/agentdb-cli.test.js +0 -50
- package/dist/src/cli/tests/agentdb-cli.test.js.map +0 -1
- package/dist/src/cli/tests/attention-cli.test.d.ts +0 -5
- package/dist/src/cli/tests/attention-cli.test.d.ts.map +0 -1
- package/dist/src/cli/tests/attention-cli.test.js +0 -257
- package/dist/src/cli/tests/attention-cli.test.js.map +0 -1
- package/dist/src/compatibility/DeprecationWarnings.d.ts +0 -54
- package/dist/src/compatibility/DeprecationWarnings.d.ts.map +0 -1
- package/dist/src/compatibility/DeprecationWarnings.js +0 -131
- package/dist/src/compatibility/DeprecationWarnings.js.map +0 -1
- package/dist/src/compatibility/MigrationUtilities.d.ts +0 -30
- package/dist/src/compatibility/MigrationUtilities.d.ts.map +0 -1
- package/dist/src/compatibility/MigrationUtilities.js +0 -184
- package/dist/src/compatibility/MigrationUtilities.js.map +0 -1
- package/dist/src/compatibility/V1toV2Adapter.d.ts +0 -76
- package/dist/src/compatibility/V1toV2Adapter.d.ts.map +0 -1
- package/dist/src/compatibility/V1toV2Adapter.js +0 -198
- package/dist/src/compatibility/V1toV2Adapter.js.map +0 -1
- package/dist/src/compatibility/VersionDetector.d.ts +0 -32
- package/dist/src/compatibility/VersionDetector.d.ts.map +0 -1
- package/dist/src/compatibility/VersionDetector.js +0 -144
- package/dist/src/compatibility/VersionDetector.js.map +0 -1
- package/dist/src/compatibility/index.d.ts +0 -11
- package/dist/src/compatibility/index.d.ts.map +0 -1
- package/dist/src/compatibility/index.js +0 -10
- package/dist/src/compatibility/index.js.map +0 -1
- package/dist/src/compatibility/types.d.ts +0 -103
- package/dist/src/compatibility/types.d.ts.map +0 -1
- package/dist/src/compatibility/types.js +0 -5
- package/dist/src/compatibility/types.js.map +0 -1
- package/dist/src/controllers/MemoryController.d.ts +0 -161
- package/dist/src/controllers/MemoryController.d.ts.map +0 -1
- package/dist/src/controllers/MemoryController.js +0 -290
- package/dist/src/controllers/MemoryController.js.map +0 -1
- package/dist/src/controllers/attention/CrossAttentionController.d.ts +0 -141
- package/dist/src/controllers/attention/CrossAttentionController.d.ts.map +0 -1
- package/dist/src/controllers/attention/CrossAttentionController.js +0 -325
- package/dist/src/controllers/attention/CrossAttentionController.js.map +0 -1
- package/dist/src/controllers/attention/MultiHeadAttentionController.d.ts +0 -137
- package/dist/src/controllers/attention/MultiHeadAttentionController.d.ts.map +0 -1
- package/dist/src/controllers/attention/MultiHeadAttentionController.js +0 -339
- package/dist/src/controllers/attention/MultiHeadAttentionController.js.map +0 -1
- package/dist/src/controllers/attention/SelfAttentionController.d.ts +0 -117
- package/dist/src/controllers/attention/SelfAttentionController.d.ts.map +0 -1
- package/dist/src/controllers/attention/SelfAttentionController.js +0 -205
- package/dist/src/controllers/attention/SelfAttentionController.js.map +0 -1
- package/dist/src/controllers/attention/index.d.ts +0 -15
- package/dist/src/controllers/attention/index.d.ts.map +0 -1
- package/dist/src/controllers/attention/index.js +0 -12
- package/dist/src/controllers/attention/index.js.map +0 -1
- package/dist/src/core/QueryCache.d.ts +0 -138
- package/dist/src/core/QueryCache.d.ts.map +0 -1
- package/dist/src/core/QueryCache.js +0 -313
- package/dist/src/core/QueryCache.js.map +0 -1
- package/dist/src/observability/index.d.ts +0 -8
- package/dist/src/observability/index.d.ts.map +0 -1
- package/dist/src/observability/index.js +0 -8
- package/dist/src/observability/index.js.map +0 -1
- package/dist/src/observability/integration.d.ts +0 -32
- package/dist/src/observability/integration.d.ts.map +0 -1
- package/dist/src/observability/integration.js +0 -157
- package/dist/src/observability/integration.js.map +0 -1
- package/dist/src/observability/telemetry.d.ts +0 -137
- package/dist/src/observability/telemetry.d.ts.map +0 -1
- package/dist/src/observability/telemetry.js +0 -420
- package/dist/src/observability/telemetry.js.map +0 -1
- package/dist/src/quantization/index.d.ts +0 -7
- package/dist/src/quantization/index.d.ts.map +0 -1
- package/dist/src/quantization/index.js +0 -15
- package/dist/src/quantization/index.js.map +0 -1
- package/dist/src/quantization/vector-quantization.d.ts +0 -388
- package/dist/src/quantization/vector-quantization.d.ts.map +0 -1
- package/dist/src/quantization/vector-quantization.js +0 -1136
- package/dist/src/quantization/vector-quantization.js.map +0 -1
- package/dist/src/search/HybridSearch.d.ts +0 -311
- package/dist/src/search/HybridSearch.d.ts.map +0 -1
- package/dist/src/search/HybridSearch.js +0 -712
- package/dist/src/search/HybridSearch.js.map +0 -1
- package/dist/src/search/index.d.ts +0 -12
- package/dist/src/search/index.d.ts.map +0 -1
- package/dist/src/search/index.js +0 -16
- package/dist/src/search/index.js.map +0 -1
- package/dist/src/services/AttentionService.d.ts +0 -303
- package/dist/src/services/AttentionService.d.ts.map +0 -1
- package/dist/src/services/AttentionService.js +0 -1167
- package/dist/src/services/AttentionService.js.map +0 -1
- package/dist/src/simd/index.d.ts +0 -9
- package/dist/src/simd/index.d.ts.map +0 -1
- package/dist/src/simd/index.js +0 -27
- package/dist/src/simd/index.js.map +0 -1
- package/dist/src/simd/simd-vector-ops.d.ts +0 -332
- package/dist/src/simd/simd-vector-ops.d.ts.map +0 -1
- package/dist/src/simd/simd-vector-ops.js +0 -947
- package/dist/src/simd/simd-vector-ops.js.map +0 -1
- package/dist/src/tests/attention-service.test.d.ts +0 -7
- package/dist/src/tests/attention-service.test.d.ts.map +0 -1
- package/dist/src/tests/attention-service.test.js +0 -401
- package/dist/src/tests/attention-service.test.js.map +0 -1
- package/dist/src/tests/integration/compatibility/backwards-compat.integration.test.d.ts +0 -7
- package/dist/src/tests/integration/compatibility/backwards-compat.integration.test.d.ts.map +0 -1
- package/dist/src/tests/integration/compatibility/backwards-compat.integration.test.js +0 -283
- package/dist/src/tests/integration/compatibility/backwards-compat.integration.test.js.map +0 -1
- package/dist/src/tests/query-cache.test.d.ts +0 -7
- package/dist/src/tests/query-cache.test.d.ts.map +0 -1
- package/dist/src/tests/query-cache.test.js +0 -343
- package/dist/src/tests/query-cache.test.js.map +0 -1
- package/dist/src/tests/ruvector-integration.test.d.ts +0 -14
- package/dist/src/tests/ruvector-integration.test.d.ts.map +0 -1
- package/dist/src/tests/ruvector-integration.test.js +0 -1156
- package/dist/src/tests/ruvector-integration.test.js.map +0 -1
- package/dist/src/tests/unit/auth/crypto.utils.test.d.ts +0 -6
- package/dist/src/tests/unit/auth/crypto.utils.test.d.ts.map +0 -1
- package/dist/src/tests/unit/auth/crypto.utils.test.js +0 -310
- package/dist/src/tests/unit/auth/crypto.utils.test.js.map +0 -1
- package/dist/src/tests/unit/compatibility/deprecation-warnings.test.d.ts +0 -5
- package/dist/src/tests/unit/compatibility/deprecation-warnings.test.d.ts.map +0 -1
- package/dist/src/tests/unit/compatibility/deprecation-warnings.test.js +0 -207
- package/dist/src/tests/unit/compatibility/deprecation-warnings.test.js.map +0 -1
- package/dist/src/tests/unit/compatibility/migration-utils.test.d.ts +0 -5
- package/dist/src/tests/unit/compatibility/migration-utils.test.d.ts.map +0 -1
- package/dist/src/tests/unit/compatibility/migration-utils.test.js +0 -264
- package/dist/src/tests/unit/compatibility/migration-utils.test.js.map +0 -1
- package/dist/src/tests/unit/compatibility/v1-adapter.test.d.ts +0 -7
- package/dist/src/tests/unit/compatibility/v1-adapter.test.d.ts.map +0 -1
- package/dist/src/tests/unit/compatibility/v1-adapter.test.js +0 -228
- package/dist/src/tests/unit/compatibility/v1-adapter.test.js.map +0 -1
- package/dist/src/tests/unit/compatibility/version-detector.test.d.ts +0 -10
- package/dist/src/tests/unit/compatibility/version-detector.test.d.ts.map +0 -1
- package/dist/src/tests/unit/compatibility/version-detector.test.js +0 -162
- package/dist/src/tests/unit/compatibility/version-detector.test.js.map +0 -1
- package/dist/src/tests/vector-quantization.test.d.ts +0 -5
- package/dist/src/tests/vector-quantization.test.d.ts.map +0 -1
- package/dist/src/tests/vector-quantization.test.js +0 -338
- package/dist/src/tests/vector-quantization.test.js.map +0 -1
- package/dist/src/tests/wasm-vector-search.test.d.ts +0 -7
- package/dist/src/tests/wasm-vector-search.test.d.ts.map +0 -1
- package/dist/src/tests/wasm-vector-search.test.js +0 -193
- package/dist/src/tests/wasm-vector-search.test.js.map +0 -1
- package/dist/src/types/database.types.d.ts +0 -275
- package/dist/src/types/database.types.d.ts.map +0 -1
- package/dist/src/types/database.types.js +0 -57
- package/dist/src/types/database.types.js.map +0 -1
- package/dist/src/utils/chalk-fallback.d.ts +0 -3
- package/dist/src/utils/chalk-fallback.d.ts.map +0 -1
- package/dist/src/utils/chalk-fallback.js +0 -20
- package/dist/src/utils/chalk-fallback.js.map +0 -1
- package/dist/src/utils/crypto.utils.d.ts +0 -122
- package/dist/src/utils/crypto.utils.d.ts.map +0 -1
- package/dist/src/utils/crypto.utils.js +0 -296
- package/dist/src/utils/crypto.utils.js.map +0 -1
- package/dist/src/utils/similarity.d.ts +0 -11
- package/dist/src/utils/similarity.d.ts.map +0 -1
- package/dist/src/utils/similarity.js +0 -25
- package/dist/src/utils/similarity.js.map +0 -1
- package/dist/src/wasm-loader.d.ts +0 -67
- package/dist/src/wasm-loader.d.ts.map +0 -1
- package/dist/src/wasm-loader.js +0 -78
- package/dist/src/wasm-loader.js.map +0 -1
- package/dist/src/wrappers/agentdb-fast.d.ts +0 -139
- package/dist/src/wrappers/agentdb-fast.d.ts.map +0 -1
- package/dist/src/wrappers/agentdb-fast.js +0 -316
- package/dist/src/wrappers/agentdb-fast.js.map +0 -1
- package/dist/src/wrappers/attention-fallbacks.d.ts +0 -351
- package/dist/src/wrappers/attention-fallbacks.d.ts.map +0 -1
- package/dist/src/wrappers/attention-fallbacks.js +0 -1487
- package/dist/src/wrappers/attention-fallbacks.js.map +0 -1
- package/dist/src/wrappers/embedding-service.d.ts +0 -117
- package/dist/src/wrappers/embedding-service.d.ts.map +0 -1
- package/dist/src/wrappers/embedding-service.js +0 -376
- package/dist/src/wrappers/embedding-service.js.map +0 -1
- package/dist/src/wrappers/gnn-wrapper.d.ts +0 -71
- package/dist/src/wrappers/gnn-wrapper.d.ts.map +0 -1
- package/dist/src/wrappers/gnn-wrapper.js +0 -240
- package/dist/src/wrappers/gnn-wrapper.js.map +0 -1
- package/dist/src/wrappers/index.d.ts +0 -48
- package/dist/src/wrappers/index.d.ts.map +0 -1
- package/dist/src/wrappers/index.js +0 -83
- package/dist/src/wrappers/index.js.map +0 -1
|
@@ -19,19 +19,11 @@ import { EmbeddingService } from '../controllers/EmbeddingService.js';
|
|
|
19
19
|
import { MMRDiversityRanker } from '../controllers/MMRDiversityRanker.js';
|
|
20
20
|
import { ContextSynthesizer } from '../controllers/ContextSynthesizer.js';
|
|
21
21
|
import { MetadataFilter } from '../controllers/MetadataFilter.js';
|
|
22
|
-
import { QUICServer } from '../controllers/QUICServer.js';
|
|
23
|
-
import { QUICClient } from '../controllers/QUICClient.js';
|
|
24
|
-
import { SyncCoordinator } from '../controllers/SyncCoordinator.js';
|
|
25
22
|
import { initCommand } from './commands/init.js';
|
|
26
23
|
import { statusCommand } from './commands/status.js';
|
|
27
24
|
import { installEmbeddingsCommand } from './commands/install-embeddings.js';
|
|
28
25
|
import { migrateCommand } from './commands/migrate.js';
|
|
29
26
|
import { doctorCommand } from './commands/doctor.js';
|
|
30
|
-
import { attentionCommand } from './commands/attention.js';
|
|
31
|
-
import { learnCommand } from './commands/learn.js';
|
|
32
|
-
import { routeCommand } from './commands/route.js';
|
|
33
|
-
import { hyperbolicCommand } from './commands/hyperbolic.js';
|
|
34
|
-
import { rvfCommand } from './commands/rvf.js';
|
|
35
27
|
import * as fs from 'fs';
|
|
36
28
|
import * as path from 'path';
|
|
37
29
|
import * as zlib from 'zlib';
|
|
@@ -56,65 +48,7 @@ const log = {
|
|
|
56
48
|
warning: (msg) => console.log(`${colors.yellow}⚠ ${msg}${colors.reset}`),
|
|
57
49
|
header: (msg) => console.log(`${colors.bright}${colors.cyan}${msg}${colors.reset}`)
|
|
58
50
|
};
|
|
59
|
-
// Spinner utility for progress indication
|
|
60
|
-
class Spinner {
|
|
61
|
-
frames = ['|', '/', '-', '\\'];
|
|
62
|
-
current = 0;
|
|
63
|
-
interval = null;
|
|
64
|
-
message = '';
|
|
65
|
-
start(message) {
|
|
66
|
-
this.message = message;
|
|
67
|
-
this.current = 0;
|
|
68
|
-
process.stdout.write(`\r${this.frames[0]} ${message}`);
|
|
69
|
-
this.interval = setInterval(() => {
|
|
70
|
-
this.current = (this.current + 1) % this.frames.length;
|
|
71
|
-
process.stdout.write(`\r${this.frames[this.current]} ${this.message}`);
|
|
72
|
-
}, 100);
|
|
73
|
-
}
|
|
74
|
-
update(message) {
|
|
75
|
-
this.message = message;
|
|
76
|
-
process.stdout.write(`\r${this.frames[this.current]} ${this.message}`);
|
|
77
|
-
}
|
|
78
|
-
succeed(message) {
|
|
79
|
-
this.stop();
|
|
80
|
-
console.log(`\r${colors.green}v${colors.reset} ${message}`);
|
|
81
|
-
}
|
|
82
|
-
fail(message) {
|
|
83
|
-
this.stop();
|
|
84
|
-
console.log(`\r${colors.red}x${colors.reset} ${message}`);
|
|
85
|
-
}
|
|
86
|
-
stop() {
|
|
87
|
-
if (this.interval) {
|
|
88
|
-
clearInterval(this.interval);
|
|
89
|
-
this.interval = null;
|
|
90
|
-
}
|
|
91
|
-
process.stdout.write('\r' + ' '.repeat(this.message.length + 10) + '\r');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// Progress bar utility
|
|
95
|
-
class ProgressBar {
|
|
96
|
-
width = 40;
|
|
97
|
-
current = 0;
|
|
98
|
-
total = 100;
|
|
99
|
-
message = '';
|
|
100
|
-
update(current, total, message) {
|
|
101
|
-
this.current = current;
|
|
102
|
-
this.total = total;
|
|
103
|
-
if (message)
|
|
104
|
-
this.message = message;
|
|
105
|
-
const percent = Math.round((current / total) * 100);
|
|
106
|
-
const filled = Math.round((current / total) * this.width);
|
|
107
|
-
const empty = this.width - filled;
|
|
108
|
-
const bar = `${colors.green}${'='.repeat(filled)}${colors.reset}${'-'.repeat(empty)}`;
|
|
109
|
-
process.stdout.write(`\r[${bar}] ${percent}% ${this.message}`);
|
|
110
|
-
}
|
|
111
|
-
complete(message) {
|
|
112
|
-
const bar = `${colors.green}${'='.repeat(this.width)}${colors.reset}`;
|
|
113
|
-
console.log(`\r[${bar}] 100% ${message}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
51
|
class AgentDBCLI {
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
52
|
db; // Database instance from createDatabase (public for init command)
|
|
119
53
|
causalGraph;
|
|
120
54
|
causalRecall;
|
|
@@ -123,10 +57,6 @@ class AgentDBCLI {
|
|
|
123
57
|
reflexion;
|
|
124
58
|
skills;
|
|
125
59
|
embedder;
|
|
126
|
-
// QUIC sync controllers
|
|
127
|
-
quicServer;
|
|
128
|
-
quicClient;
|
|
129
|
-
syncCoordinator;
|
|
130
60
|
async initialize(dbPath = './agentdb.db') {
|
|
131
61
|
// Initialize database
|
|
132
62
|
this.db = await createDatabase(dbPath);
|
|
@@ -281,8 +211,8 @@ class AgentDBCLI {
|
|
|
281
211
|
throw new Error(`Experiment ${experimentId} not found`);
|
|
282
212
|
}
|
|
283
213
|
log.info(`Experiment: ${experiment.hypothesis || 'Unknown'}`);
|
|
284
|
-
log.info(`Treatment Mean: ${
|
|
285
|
-
log.info(`Control Mean: ${
|
|
214
|
+
log.info(`Treatment Mean: ${experiment.treatment_mean?.toFixed(3) || 'N/A'}`);
|
|
215
|
+
log.info(`Control Mean: ${experiment.control_mean?.toFixed(3) || 'N/A'}`);
|
|
286
216
|
log.success(`Uplift: ${result?.uplift?.toFixed(3) || 'N/A'}`);
|
|
287
217
|
if (result?.confidenceInterval && result.confidenceInterval.length === 2) {
|
|
288
218
|
log.info(`95% CI: [${result.confidenceInterval[0]?.toFixed(3) || 'N/A'}, ${result.confidenceInterval[1]?.toFixed(3) || 'N/A'}]`);
|
|
@@ -295,9 +225,7 @@ class AgentDBCLI {
|
|
|
295
225
|
if (!counts) {
|
|
296
226
|
throw new Error(`Failed to get observation counts for experiment ${experimentId}`);
|
|
297
227
|
}
|
|
298
|
-
|
|
299
|
-
const treatmentCount = counts.treatment || 0;
|
|
300
|
-
log.info(`Sample Sizes: ${treatmentCount} treatment, ${totalCount - treatmentCount} control`);
|
|
228
|
+
log.info(`Sample Sizes: ${counts.treatment || 0} treatment, ${(counts.total || 0) - (counts.treatment || 0)} control`);
|
|
301
229
|
if (result && result.pValue !== undefined && result.pValue < 0.05) {
|
|
302
230
|
log.success('Result is statistically significant (p < 0.05)');
|
|
303
231
|
}
|
|
@@ -379,10 +307,9 @@ class AgentDBCLI {
|
|
|
379
307
|
if (discovered.length > 0) {
|
|
380
308
|
console.log('\n' + '═'.repeat(80));
|
|
381
309
|
discovered.slice(0, 10).forEach((edge, i) => {
|
|
382
|
-
|
|
383
|
-
console.log(
|
|
384
|
-
console.log(`
|
|
385
|
-
console.log(` Sample size: ${e.sampleSize}`);
|
|
310
|
+
console.log(`${colors.bright}#${i + 1}: ${edge.cause} → ${edge.effect}${colors.reset}`);
|
|
311
|
+
console.log(` Uplift: ${colors.green}${edge.uplift.toFixed(3)}${colors.reset} (CI: ${edge.confidence.toFixed(2)})`);
|
|
312
|
+
console.log(` Sample size: ${edge.sampleSize}`);
|
|
386
313
|
console.log('─'.repeat(80));
|
|
387
314
|
});
|
|
388
315
|
}
|
|
@@ -574,8 +501,8 @@ class AgentDBCLI {
|
|
|
574
501
|
console.log(` Description: ${skill.description}`);
|
|
575
502
|
console.log(` Success Rate: ${colors.green}${(skill.successRate * 100).toFixed(1)}%${colors.reset}`);
|
|
576
503
|
console.log(` Uses: ${skill.uses}`);
|
|
577
|
-
console.log(` Avg Reward: ${
|
|
578
|
-
console.log(` Avg Latency: ${
|
|
504
|
+
console.log(` Avg Reward: ${skill.avgReward.toFixed(2)}`);
|
|
505
|
+
console.log(` Avg Latency: ${skill.avgLatencyMs.toFixed(0)}ms`);
|
|
579
506
|
console.log('─'.repeat(80));
|
|
580
507
|
});
|
|
581
508
|
log.success(`Found ${skills.length} matching skills`);
|
|
@@ -638,658 +565,134 @@ class AgentDBCLI {
|
|
|
638
565
|
// QUIC Synchronization Commands
|
|
639
566
|
// ============================================================================
|
|
640
567
|
async quicStartServer(params) {
|
|
641
|
-
|
|
642
|
-
throw new Error('Not initialized');
|
|
643
|
-
log.header('\n[QUIC] Starting QUIC Sync Server');
|
|
644
|
-
const spinner = new Spinner();
|
|
568
|
+
log.header('\n🚀 Starting QUIC Sync Server');
|
|
645
569
|
const port = params.port || 4433;
|
|
646
570
|
const authToken = params.authToken || this.generateAuthToken();
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
console.log('='.repeat(80));
|
|
650
|
-
console.log(` Host: ${colors.cyan}0.0.0.0${colors.reset}`);
|
|
651
|
-
console.log(` Port: ${colors.cyan}${port}${colors.reset}`);
|
|
652
|
-
console.log(` Auth Token: ${colors.cyan}${authToken.substring(0, 8)}...${colors.reset}`);
|
|
653
|
-
console.log(` Max Connections: ${colors.cyan}${params.maxConnections || 100}${colors.reset}`);
|
|
571
|
+
log.info(`Port: ${port}`);
|
|
572
|
+
log.info(`Auth Token: ${authToken}`);
|
|
654
573
|
if (params.cert && params.key) {
|
|
655
|
-
|
|
656
|
-
|
|
574
|
+
log.info(`TLS Certificate: ${params.cert}`);
|
|
575
|
+
log.info(`TLS Key: ${params.key}`);
|
|
657
576
|
}
|
|
658
577
|
else {
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
console.log('='.repeat(80));
|
|
662
|
-
try {
|
|
663
|
-
spinner.start('Initializing QUIC server...');
|
|
664
|
-
// Create QUIC server configuration
|
|
665
|
-
const serverConfig = {
|
|
666
|
-
host: '0.0.0.0',
|
|
667
|
-
port,
|
|
668
|
-
maxConnections: params.maxConnections || 100,
|
|
669
|
-
authToken,
|
|
670
|
-
tlsConfig: {
|
|
671
|
-
cert: params.cert,
|
|
672
|
-
key: params.key,
|
|
673
|
-
},
|
|
674
|
-
rateLimit: {
|
|
675
|
-
maxRequestsPerMinute: 60,
|
|
676
|
-
maxBytesPerMinute: 10 * 1024 * 1024, // 10MB
|
|
677
|
-
},
|
|
678
|
-
};
|
|
679
|
-
// Initialize the QUIC server with database
|
|
680
|
-
this.quicServer = new QUICServer(this.db, serverConfig);
|
|
681
|
-
spinner.update('Starting server...');
|
|
682
|
-
await this.quicServer.start();
|
|
683
|
-
spinner.succeed('QUIC server started successfully');
|
|
684
|
-
console.log('\n' + '-'.repeat(80));
|
|
685
|
-
console.log(`${colors.bright}Server Status${colors.reset}`);
|
|
686
|
-
console.log('-'.repeat(80));
|
|
687
|
-
const status = this.quicServer.getStatus();
|
|
688
|
-
console.log(` Status: ${colors.green}Running${colors.reset}`);
|
|
689
|
-
console.log(` Active Connections: ${colors.cyan}${status.activeConnections}${colors.reset}`);
|
|
690
|
-
console.log(` Rate Limit: ${colors.cyan}${status.config.rateLimit?.maxRequestsPerMinute} req/min${colors.reset}`);
|
|
691
|
-
console.log('-'.repeat(80));
|
|
692
|
-
log.info('\nServer is ready to accept connections.');
|
|
693
|
-
log.info(`Clients can connect using: agentdb sync connect <host> ${port} --auth-token ${authToken}`);
|
|
694
|
-
log.info('\nPress Ctrl+C to stop the server');
|
|
695
|
-
// Handle graceful shutdown
|
|
696
|
-
const shutdown = async () => {
|
|
697
|
-
console.log('\n');
|
|
698
|
-
log.info('Shutting down server...');
|
|
699
|
-
const shutdownSpinner = new Spinner();
|
|
700
|
-
shutdownSpinner.start('Closing connections...');
|
|
701
|
-
try {
|
|
702
|
-
if (this.quicServer) {
|
|
703
|
-
await this.quicServer.stop();
|
|
704
|
-
}
|
|
705
|
-
shutdownSpinner.succeed('Server stopped gracefully');
|
|
706
|
-
}
|
|
707
|
-
catch (error) {
|
|
708
|
-
shutdownSpinner.fail(`Error during shutdown: ${error.message}`);
|
|
709
|
-
}
|
|
710
|
-
process.exit(0);
|
|
711
|
-
};
|
|
712
|
-
process.on('SIGINT', shutdown);
|
|
713
|
-
process.on('SIGTERM', shutdown);
|
|
714
|
-
// Monitor server status periodically
|
|
715
|
-
const monitorInterval = setInterval(() => {
|
|
716
|
-
if (this.quicServer) {
|
|
717
|
-
const currentStatus = this.quicServer.getStatus();
|
|
718
|
-
if (currentStatus.activeConnections > 0) {
|
|
719
|
-
process.stdout.write(`\r${colors.cyan}[${new Date().toLocaleTimeString()}]${colors.reset} Active connections: ${currentStatus.activeConnections} | Total requests: ${currentStatus.totalRequests} `);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
}, 5000);
|
|
723
|
-
// Keep process alive
|
|
724
|
-
await new Promise((resolve) => {
|
|
725
|
-
process.on('SIGINT', () => {
|
|
726
|
-
clearInterval(monitorInterval);
|
|
727
|
-
resolve();
|
|
728
|
-
});
|
|
729
|
-
process.on('SIGTERM', () => {
|
|
730
|
-
clearInterval(monitorInterval);
|
|
731
|
-
resolve();
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
catch (error) {
|
|
736
|
-
spinner.fail(`Failed to start server: ${error.message}`);
|
|
737
|
-
throw error;
|
|
578
|
+
log.warning('No TLS certificate provided - using self-signed certificate');
|
|
738
579
|
}
|
|
580
|
+
// TODO: Implement QUIC server using existing QUICSync controller
|
|
581
|
+
log.info('\nServer started. Waiting for connections...');
|
|
582
|
+
log.info('Press Ctrl+C to stop');
|
|
583
|
+
// Keep process alive
|
|
584
|
+
await new Promise(() => { });
|
|
739
585
|
}
|
|
740
586
|
async quicConnect(params) {
|
|
741
|
-
log.header('\n
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
console.log(` Authentication: ${params.authToken ? colors.green + 'Enabled' : colors.yellow + 'Disabled'}${colors.reset}`);
|
|
748
|
-
console.log(` Timeout: ${colors.cyan}${params.timeout || 30000}ms${colors.reset}`);
|
|
587
|
+
log.header('\n🔌 Connecting to QUIC Sync Server');
|
|
588
|
+
log.info(`Host: ${params.host}`);
|
|
589
|
+
log.info(`Port: ${params.port}`);
|
|
590
|
+
if (params.authToken) {
|
|
591
|
+
log.info('Authentication: Enabled');
|
|
592
|
+
}
|
|
749
593
|
if (params.cert) {
|
|
750
|
-
|
|
594
|
+
log.info(`TLS Certificate: ${params.cert}`);
|
|
751
595
|
}
|
|
752
596
|
else {
|
|
753
|
-
|
|
754
|
-
}
|
|
755
|
-
console.log('='.repeat(80));
|
|
756
|
-
try {
|
|
757
|
-
spinner.start('Initializing QUIC client...');
|
|
758
|
-
// Create QUIC client configuration
|
|
759
|
-
const clientConfig = {
|
|
760
|
-
serverHost: params.host,
|
|
761
|
-
serverPort: params.port,
|
|
762
|
-
authToken: params.authToken,
|
|
763
|
-
maxRetries: 3,
|
|
764
|
-
retryDelayMs: 1000,
|
|
765
|
-
timeoutMs: params.timeout || 30000,
|
|
766
|
-
poolSize: 5,
|
|
767
|
-
tlsConfig: {
|
|
768
|
-
cert: params.cert,
|
|
769
|
-
rejectUnauthorized: !!params.cert,
|
|
770
|
-
},
|
|
771
|
-
};
|
|
772
|
-
// Initialize the QUIC client
|
|
773
|
-
this.quicClient = new QUICClient(clientConfig);
|
|
774
|
-
spinner.update('Establishing connection...');
|
|
775
|
-
await this.quicClient.connect();
|
|
776
|
-
spinner.update('Testing connection (ping)...');
|
|
777
|
-
const pingResult = await this.quicClient.ping();
|
|
778
|
-
if (!pingResult.success) {
|
|
779
|
-
throw new Error(pingResult.error || 'Ping failed');
|
|
780
|
-
}
|
|
781
|
-
spinner.succeed('Connected to remote server successfully');
|
|
782
|
-
console.log('\n' + '-'.repeat(80));
|
|
783
|
-
console.log(`${colors.bright}Connection Status${colors.reset}`);
|
|
784
|
-
console.log('-'.repeat(80));
|
|
785
|
-
const status = this.quicClient.getStatus();
|
|
786
|
-
console.log(` Status: ${colors.green}Connected${colors.reset}`);
|
|
787
|
-
console.log(` Latency: ${colors.cyan}${pingResult.latencyMs}ms${colors.reset}`);
|
|
788
|
-
console.log(` Pool Size: ${colors.cyan}${status.poolSize}${colors.reset}`);
|
|
789
|
-
console.log(` Active Connections: ${colors.cyan}${status.activeConnections}${colors.reset}`);
|
|
790
|
-
console.log('-'.repeat(80));
|
|
791
|
-
// Initialize the SyncCoordinator for subsequent push/pull operations
|
|
792
|
-
if (this.db) {
|
|
793
|
-
this.syncCoordinator = new SyncCoordinator({
|
|
794
|
-
db: this.db,
|
|
795
|
-
client: this.quicClient,
|
|
796
|
-
});
|
|
797
|
-
log.info('\nSync coordinator initialized. Ready for push/pull operations.');
|
|
798
|
-
}
|
|
799
|
-
log.success('\nConnection established.');
|
|
800
|
-
log.info('Use "agentdb sync push" or "agentdb sync pull" to sync data.');
|
|
801
|
-
}
|
|
802
|
-
catch (error) {
|
|
803
|
-
spinner.fail(`Connection failed: ${error.message}`);
|
|
804
|
-
console.log('\n' + '-'.repeat(80));
|
|
805
|
-
console.log(`${colors.bright}Troubleshooting${colors.reset}`);
|
|
806
|
-
console.log('-'.repeat(80));
|
|
807
|
-
console.log(' 1. Verify the server is running and accessible');
|
|
808
|
-
console.log(' 2. Check firewall settings allow traffic on the specified port');
|
|
809
|
-
console.log(' 3. Ensure the auth token matches the server configuration');
|
|
810
|
-
console.log(' 4. For TLS connections, verify the certificate is valid');
|
|
811
|
-
console.log('-'.repeat(80));
|
|
812
|
-
throw error;
|
|
597
|
+
log.warning('No TLS certificate provided - using insecure connection');
|
|
813
598
|
}
|
|
599
|
+
// TODO: Implement QUIC client connection
|
|
600
|
+
log.success('Connected to remote server');
|
|
601
|
+
log.info('Server info: AgentDB QUIC Sync v1.0');
|
|
814
602
|
}
|
|
815
603
|
async quicPush(params) {
|
|
816
604
|
if (!this.db)
|
|
817
605
|
throw new Error('Not initialized');
|
|
818
|
-
log.header('\n
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
// Parse server address
|
|
822
|
-
const [host, portStr] = params.server.split(':');
|
|
823
|
-
const port = parseInt(portStr) || 4433;
|
|
824
|
-
console.log('\n' + '='.repeat(80));
|
|
825
|
-
console.log(`${colors.bright}Push Configuration${colors.reset}`);
|
|
826
|
-
console.log('='.repeat(80));
|
|
827
|
-
console.log(` Server: ${colors.cyan}${host}:${port}${colors.reset}`);
|
|
828
|
-
console.log(` Mode: ${colors.cyan}${params.incremental ? 'Incremental' : 'Full Sync'}${colors.reset}`);
|
|
829
|
-
console.log(` Batch Size: ${colors.cyan}${params.batchSize || 100}${colors.reset}`);
|
|
606
|
+
log.header('\n⬆️ Pushing Changes to Remote');
|
|
607
|
+
log.info(`Server: ${params.server}`);
|
|
608
|
+
log.info(`Mode: ${params.incremental ? 'Incremental' : 'Full'}`);
|
|
830
609
|
if (params.filter) {
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
console.log('='.repeat(80));
|
|
834
|
-
try {
|
|
835
|
-
// Step 1: Analyze pending changes
|
|
836
|
-
spinner.start('Analyzing local changes...');
|
|
837
|
-
const pendingChanges = this.getPendingChangesDetailed(params.incremental, params.filter);
|
|
838
|
-
spinner.succeed(`Found ${pendingChanges.totalItems} items to push`);
|
|
839
|
-
console.log('\n' + '-'.repeat(80));
|
|
840
|
-
console.log(`${colors.bright}Pending Changes${colors.reset}`);
|
|
841
|
-
console.log('-'.repeat(80));
|
|
842
|
-
console.log(` Episodes: ${colors.cyan}${pendingChanges.episodes.length}${colors.reset}`);
|
|
843
|
-
console.log(` Skills: ${colors.cyan}${pendingChanges.skills.length}${colors.reset}`);
|
|
844
|
-
console.log(` Edges: ${colors.cyan}${pendingChanges.edges.length}${colors.reset}`);
|
|
845
|
-
console.log(` Total Size: ${colors.cyan}${(pendingChanges.totalSize / 1024).toFixed(2)} KB${colors.reset}`);
|
|
846
|
-
console.log('-'.repeat(80));
|
|
847
|
-
if (pendingChanges.totalItems === 0) {
|
|
848
|
-
log.info('\nNo changes to push. Database is up to date.');
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
// Step 2: Establish connection if not already connected
|
|
852
|
-
spinner.start('Connecting to server...');
|
|
853
|
-
if (!this.quicClient) {
|
|
854
|
-
const clientConfig = {
|
|
855
|
-
serverHost: host,
|
|
856
|
-
serverPort: port,
|
|
857
|
-
authToken: params.authToken,
|
|
858
|
-
maxRetries: 3,
|
|
859
|
-
retryDelayMs: 1000,
|
|
860
|
-
timeoutMs: 30000,
|
|
861
|
-
poolSize: 5,
|
|
862
|
-
};
|
|
863
|
-
this.quicClient = new QUICClient(clientConfig);
|
|
864
|
-
await this.quicClient.connect();
|
|
865
|
-
}
|
|
866
|
-
spinner.succeed('Connected to server');
|
|
867
|
-
// Step 3: Initialize sync coordinator if not exists
|
|
868
|
-
if (!this.syncCoordinator) {
|
|
869
|
-
this.syncCoordinator = new SyncCoordinator({
|
|
870
|
-
db: this.db,
|
|
871
|
-
client: this.quicClient,
|
|
872
|
-
batchSize: params.batchSize || 100,
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
// Step 4: Push changes with progress tracking
|
|
876
|
-
console.log('\n' + '-'.repeat(80));
|
|
877
|
-
console.log(`${colors.bright}Push Progress${colors.reset}`);
|
|
878
|
-
console.log('-'.repeat(80));
|
|
879
|
-
const startTime = Date.now();
|
|
880
|
-
// Perform sync with progress callback
|
|
881
|
-
const syncReport = await this.syncCoordinator.sync((progress) => {
|
|
882
|
-
if (progress.phase === 'pushing') {
|
|
883
|
-
progressBar.update(progress.current, progress.total, progress.itemType || 'items');
|
|
884
|
-
}
|
|
885
|
-
else if (progress.phase === 'completed') {
|
|
886
|
-
progressBar.complete('Push completed');
|
|
887
|
-
}
|
|
888
|
-
else if (progress.phase === 'error') {
|
|
889
|
-
console.log(`\n${colors.red}Error: ${progress.error}${colors.reset}`);
|
|
890
|
-
}
|
|
891
|
-
});
|
|
892
|
-
const duration = Date.now() - startTime;
|
|
893
|
-
console.log('\n' + '='.repeat(80));
|
|
894
|
-
console.log(`${colors.bright}Push Summary${colors.reset}`);
|
|
895
|
-
console.log('='.repeat(80));
|
|
896
|
-
console.log(` Status: ${syncReport.success ? colors.green + 'Success' : colors.red + 'Failed'}${colors.reset}`);
|
|
897
|
-
console.log(` Items Pushed: ${colors.cyan}${syncReport.itemsPushed}${colors.reset}`);
|
|
898
|
-
console.log(` Bytes Transferred: ${colors.cyan}${(syncReport.bytesTransferred / 1024).toFixed(2)} KB${colors.reset}`);
|
|
899
|
-
console.log(` Duration: ${colors.cyan}${duration}ms${colors.reset}`);
|
|
900
|
-
console.log(` Throughput: ${colors.cyan}${((syncReport.bytesTransferred / 1024) / (duration / 1000)).toFixed(2)} KB/s${colors.reset}`);
|
|
901
|
-
if (syncReport.errors.length > 0) {
|
|
902
|
-
console.log(` Errors: ${colors.red}${syncReport.errors.length}${colors.reset}`);
|
|
903
|
-
syncReport.errors.forEach((err, i) => {
|
|
904
|
-
console.log(` ${i + 1}. ${err}`);
|
|
905
|
-
});
|
|
906
|
-
}
|
|
907
|
-
console.log('='.repeat(80));
|
|
908
|
-
if (syncReport.success) {
|
|
909
|
-
log.success('\nChanges pushed successfully');
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
log.error('\nPush completed with errors');
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
catch (error) {
|
|
916
|
-
spinner.fail(`Push failed: ${error.message}`);
|
|
917
|
-
throw error;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
// Helper to get detailed pending changes with actual data
|
|
921
|
-
getPendingChangesDetailed(incremental, _filter) {
|
|
922
|
-
if (!this.db) {
|
|
923
|
-
return { episodes: [], skills: [], edges: [], totalItems: 0, totalSize: 0 };
|
|
924
|
-
}
|
|
925
|
-
try {
|
|
926
|
-
// Get last sync time
|
|
927
|
-
let lastSyncTime = 0;
|
|
928
|
-
if (incremental) {
|
|
929
|
-
try {
|
|
930
|
-
const syncState = this.db.prepare('SELECT last_sync_at FROM sync_state WHERE id = 1').get();
|
|
931
|
-
if (syncState) {
|
|
932
|
-
lastSyncTime = syncState.last_sync_at || 0;
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
catch {
|
|
936
|
-
// Table might not exist
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
// Query episodes
|
|
940
|
-
let episodesQuery = 'SELECT * FROM episodes WHERE 1=1';
|
|
941
|
-
const episodeParams = [];
|
|
942
|
-
if (incremental && lastSyncTime > 0) {
|
|
943
|
-
episodesQuery += ' AND ts > ?';
|
|
944
|
-
episodeParams.push(lastSyncTime);
|
|
945
|
-
}
|
|
946
|
-
const episodes = this.db.prepare(episodesQuery).all(...episodeParams) || [];
|
|
947
|
-
// Query skills
|
|
948
|
-
let skillsQuery = 'SELECT * FROM skills WHERE 1=1';
|
|
949
|
-
const skillParams = [];
|
|
950
|
-
if (incremental && lastSyncTime > 0) {
|
|
951
|
-
skillsQuery += ' AND ts > ?';
|
|
952
|
-
skillParams.push(lastSyncTime);
|
|
953
|
-
}
|
|
954
|
-
let skills = [];
|
|
955
|
-
try {
|
|
956
|
-
skills = this.db.prepare(skillsQuery).all(...skillParams) || [];
|
|
957
|
-
}
|
|
958
|
-
catch {
|
|
959
|
-
// Skills table might not exist
|
|
960
|
-
}
|
|
961
|
-
// Query edges
|
|
962
|
-
let edgesQuery = 'SELECT * FROM skill_edges WHERE 1=1';
|
|
963
|
-
const edgeParams = [];
|
|
964
|
-
if (incremental && lastSyncTime > 0) {
|
|
965
|
-
edgesQuery += ' AND ts > ?';
|
|
966
|
-
edgeParams.push(lastSyncTime);
|
|
967
|
-
}
|
|
968
|
-
let edges = [];
|
|
969
|
-
try {
|
|
970
|
-
edges = this.db.prepare(edgesQuery).all(...edgeParams) || [];
|
|
971
|
-
}
|
|
972
|
-
catch {
|
|
973
|
-
// Edges table might not exist
|
|
974
|
-
}
|
|
975
|
-
// Calculate total size
|
|
976
|
-
const totalSize = JSON.stringify(episodes).length +
|
|
977
|
-
JSON.stringify(skills).length +
|
|
978
|
-
JSON.stringify(edges).length;
|
|
979
|
-
return {
|
|
980
|
-
episodes,
|
|
981
|
-
skills,
|
|
982
|
-
edges,
|
|
983
|
-
totalItems: episodes.length + skills.length + edges.length,
|
|
984
|
-
totalSize,
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
catch (error) {
|
|
988
|
-
log.warning(`Error analyzing changes: ${error.message}`);
|
|
989
|
-
return { episodes: [], skills: [], edges: [], totalItems: 0, totalSize: 0 };
|
|
610
|
+
log.info(`Filter: ${params.filter}`);
|
|
990
611
|
}
|
|
612
|
+
// Get pending changes
|
|
613
|
+
const changes = this.getPendingChanges(params.incremental, params.filter);
|
|
614
|
+
console.log('\n' + '═'.repeat(80));
|
|
615
|
+
console.log(`${colors.bright}Pending Changes${colors.reset}`);
|
|
616
|
+
console.log('═'.repeat(80));
|
|
617
|
+
console.log(` Episodes: ${changes.episodes}`);
|
|
618
|
+
console.log(` Skills: ${changes.skills}`);
|
|
619
|
+
console.log(` Causal Edges: ${changes.causalEdges}`);
|
|
620
|
+
console.log(` Total Size: ${(changes.totalSize / 1024).toFixed(2)} KB`);
|
|
621
|
+
console.log('═'.repeat(80));
|
|
622
|
+
// TODO: Implement QUIC push
|
|
623
|
+
log.success('Changes pushed successfully');
|
|
624
|
+
log.info(`Transferred: ${(changes.totalSize / 1024).toFixed(2)} KB`);
|
|
991
625
|
}
|
|
992
626
|
async quicPull(params) {
|
|
993
627
|
if (!this.db)
|
|
994
628
|
throw new Error('Not initialized');
|
|
995
|
-
log.header('\n
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
// Parse server address
|
|
999
|
-
const [host, portStr] = params.server.split(':');
|
|
1000
|
-
const port = parseInt(portStr) || 4433;
|
|
1001
|
-
console.log('\n' + '='.repeat(80));
|
|
1002
|
-
console.log(`${colors.bright}Pull Configuration${colors.reset}`);
|
|
1003
|
-
console.log('='.repeat(80));
|
|
1004
|
-
console.log(` Server: ${colors.cyan}${host}:${port}${colors.reset}`);
|
|
1005
|
-
console.log(` Mode: ${colors.cyan}${params.incremental ? 'Incremental' : 'Full Sync'}${colors.reset}`);
|
|
1006
|
-
console.log(` Conflict Strategy: ${colors.cyan}${params.conflictStrategy || 'latest-wins'}${colors.reset}`);
|
|
1007
|
-
console.log(` Batch Size: ${colors.cyan}${params.batchSize || 100}${colors.reset}`);
|
|
629
|
+
log.header('\n⬇️ Pulling Changes from Remote');
|
|
630
|
+
log.info(`Server: ${params.server}`);
|
|
631
|
+
log.info(`Mode: ${params.incremental ? 'Incremental' : 'Full'}`);
|
|
1008
632
|
if (params.filter) {
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
spinner.succeed('Connected to server');
|
|
1029
|
-
// Step 2: Initialize sync coordinator if not exists
|
|
1030
|
-
if (!this.syncCoordinator) {
|
|
1031
|
-
this.syncCoordinator = new SyncCoordinator({
|
|
1032
|
-
db: this.db,
|
|
1033
|
-
client: this.quicClient,
|
|
1034
|
-
batchSize: params.batchSize || 100,
|
|
1035
|
-
conflictStrategy: params.conflictStrategy || 'latest-wins',
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
// Step 3: Pull changes with progress tracking
|
|
1039
|
-
console.log('\n' + '-'.repeat(80));
|
|
1040
|
-
console.log(`${colors.bright}Pull Progress${colors.reset}`);
|
|
1041
|
-
console.log('-'.repeat(80));
|
|
1042
|
-
const startTime = Date.now();
|
|
1043
|
-
let currentPhase = '';
|
|
1044
|
-
let episodesReceived = 0;
|
|
1045
|
-
let skillsReceived = 0;
|
|
1046
|
-
let edgesReceived = 0;
|
|
1047
|
-
// Perform sync with progress callback
|
|
1048
|
-
const syncReport = await this.syncCoordinator.sync((progress) => {
|
|
1049
|
-
if (progress.phase === 'pulling') {
|
|
1050
|
-
currentPhase = progress.itemType || 'items';
|
|
1051
|
-
progressBar.update(progress.current, progress.total, `Pulling ${currentPhase}...`);
|
|
1052
|
-
// Track received items
|
|
1053
|
-
if (progress.itemType === 'episodes')
|
|
1054
|
-
episodesReceived = progress.current;
|
|
1055
|
-
if (progress.itemType === 'skills')
|
|
1056
|
-
skillsReceived = progress.current;
|
|
1057
|
-
if (progress.itemType === 'edges')
|
|
1058
|
-
edgesReceived = progress.current;
|
|
1059
|
-
}
|
|
1060
|
-
else if (progress.phase === 'resolving') {
|
|
1061
|
-
progressBar.update(progress.current, progress.total, 'Resolving conflicts...');
|
|
1062
|
-
}
|
|
1063
|
-
else if (progress.phase === 'applying') {
|
|
1064
|
-
progressBar.update(progress.current, progress.total, 'Applying changes...');
|
|
1065
|
-
}
|
|
1066
|
-
else if (progress.phase === 'completed') {
|
|
1067
|
-
progressBar.complete('Pull completed');
|
|
1068
|
-
}
|
|
1069
|
-
else if (progress.phase === 'error') {
|
|
1070
|
-
console.log(`\n${colors.red}Error: ${progress.error}${colors.reset}`);
|
|
1071
|
-
}
|
|
1072
|
-
});
|
|
1073
|
-
const duration = Date.now() - startTime;
|
|
1074
|
-
console.log('\n' + '='.repeat(80));
|
|
1075
|
-
console.log(`${colors.bright}Pull Summary${colors.reset}`);
|
|
1076
|
-
console.log('='.repeat(80));
|
|
1077
|
-
console.log(` Status: ${syncReport.success ? colors.green + 'Success' : colors.red + 'Failed'}${colors.reset}`);
|
|
1078
|
-
console.log(` Items Pulled: ${colors.cyan}${syncReport.itemsPulled}${colors.reset}`);
|
|
1079
|
-
console.log(` Conflicts Resolved: ${colors.cyan}${syncReport.conflictsResolved}${colors.reset}`);
|
|
1080
|
-
console.log(` Bytes Transferred: ${colors.cyan}${(syncReport.bytesTransferred / 1024).toFixed(2)} KB${colors.reset}`);
|
|
1081
|
-
console.log(` Duration: ${colors.cyan}${duration}ms${colors.reset}`);
|
|
1082
|
-
console.log(` Throughput: ${colors.cyan}${((syncReport.bytesTransferred / 1024) / (duration / 1000)).toFixed(2)} KB/s${colors.reset}`);
|
|
1083
|
-
console.log('\n' + '-'.repeat(80));
|
|
1084
|
-
console.log(`${colors.bright}Received Data${colors.reset}`);
|
|
1085
|
-
console.log('-'.repeat(80));
|
|
1086
|
-
console.log(` Episodes: ${colors.cyan}${episodesReceived}${colors.reset}`);
|
|
1087
|
-
console.log(` Skills: ${colors.cyan}${skillsReceived}${colors.reset}`);
|
|
1088
|
-
console.log(` Edges: ${colors.cyan}${edgesReceived}${colors.reset}`);
|
|
1089
|
-
console.log('-'.repeat(80));
|
|
1090
|
-
if (syncReport.errors.length > 0) {
|
|
1091
|
-
console.log(`\n${colors.bright}Errors${colors.reset}`);
|
|
1092
|
-
console.log('-'.repeat(80));
|
|
1093
|
-
syncReport.errors.forEach((err, i) => {
|
|
1094
|
-
console.log(` ${colors.red}${i + 1}. ${err}${colors.reset}`);
|
|
1095
|
-
});
|
|
1096
|
-
console.log('-'.repeat(80));
|
|
1097
|
-
}
|
|
1098
|
-
console.log('='.repeat(80));
|
|
1099
|
-
if (syncReport.success) {
|
|
1100
|
-
log.success('\nChanges pulled and merged successfully');
|
|
1101
|
-
}
|
|
1102
|
-
else {
|
|
1103
|
-
log.error('\nPull completed with errors');
|
|
1104
|
-
}
|
|
1105
|
-
// Display local database status after pull
|
|
1106
|
-
spinner.start('Verifying local database...');
|
|
1107
|
-
const localStatus = this.getLocalDatabaseStatus();
|
|
1108
|
-
spinner.succeed('Local database verified');
|
|
1109
|
-
console.log('\n' + '-'.repeat(80));
|
|
1110
|
-
console.log(`${colors.bright}Local Database Status${colors.reset}`);
|
|
1111
|
-
console.log('-'.repeat(80));
|
|
1112
|
-
console.log(` Total Episodes: ${colors.cyan}${localStatus.episodes}${colors.reset}`);
|
|
1113
|
-
console.log(` Total Skills: ${colors.cyan}${localStatus.skills}${colors.reset}`);
|
|
1114
|
-
console.log(` Total Edges: ${colors.cyan}${localStatus.edges}${colors.reset}`);
|
|
1115
|
-
console.log('-'.repeat(80));
|
|
1116
|
-
}
|
|
1117
|
-
catch (error) {
|
|
1118
|
-
spinner.fail(`Pull failed: ${error.message}`);
|
|
1119
|
-
throw error;
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
// Helper to get local database status
|
|
1123
|
-
getLocalDatabaseStatus() {
|
|
1124
|
-
if (!this.db) {
|
|
1125
|
-
return { episodes: 0, skills: 0, edges: 0 };
|
|
1126
|
-
}
|
|
1127
|
-
let episodes = 0;
|
|
1128
|
-
let skills = 0;
|
|
1129
|
-
let edges = 0;
|
|
1130
|
-
try {
|
|
1131
|
-
const episodeCount = this.db.prepare('SELECT COUNT(*) as count FROM episodes').get();
|
|
1132
|
-
episodes = episodeCount?.count || 0;
|
|
1133
|
-
}
|
|
1134
|
-
catch {
|
|
1135
|
-
// Table might not exist
|
|
1136
|
-
}
|
|
1137
|
-
try {
|
|
1138
|
-
const skillCount = this.db.prepare('SELECT COUNT(*) as count FROM skills').get();
|
|
1139
|
-
skills = skillCount?.count || 0;
|
|
1140
|
-
}
|
|
1141
|
-
catch {
|
|
1142
|
-
// Table might not exist
|
|
1143
|
-
}
|
|
1144
|
-
try {
|
|
1145
|
-
const edgeCount = this.db.prepare('SELECT COUNT(*) as count FROM skill_edges').get();
|
|
1146
|
-
edges = edgeCount?.count || 0;
|
|
1147
|
-
}
|
|
1148
|
-
catch {
|
|
1149
|
-
// Table might not exist
|
|
1150
|
-
}
|
|
1151
|
-
return { episodes, skills, edges };
|
|
633
|
+
log.info(`Filter: ${params.filter}`);
|
|
634
|
+
}
|
|
635
|
+
// TODO: Implement QUIC pull
|
|
636
|
+
const changes = {
|
|
637
|
+
episodes: 5,
|
|
638
|
+
skills: 2,
|
|
639
|
+
causalEdges: 3,
|
|
640
|
+
totalSize: 12800
|
|
641
|
+
};
|
|
642
|
+
console.log('\n' + '═'.repeat(80));
|
|
643
|
+
console.log(`${colors.bright}Received Changes${colors.reset}`);
|
|
644
|
+
console.log('═'.repeat(80));
|
|
645
|
+
console.log(` Episodes: ${changes.episodes}`);
|
|
646
|
+
console.log(` Skills: ${changes.skills}`);
|
|
647
|
+
console.log(` Causal Edges: ${changes.causalEdges}`);
|
|
648
|
+
console.log(` Total Size: ${(changes.totalSize / 1024).toFixed(2)} KB`);
|
|
649
|
+
console.log('═'.repeat(80));
|
|
650
|
+
log.success('Changes pulled and merged successfully');
|
|
651
|
+
log.info(`Downloaded: ${(changes.totalSize / 1024).toFixed(2)} KB`);
|
|
1152
652
|
}
|
|
1153
653
|
async quicStatus() {
|
|
1154
654
|
if (!this.db)
|
|
1155
655
|
throw new Error('Not initialized');
|
|
1156
|
-
log.header('\n
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
console.log('\n' + '='.repeat(80));
|
|
1165
|
-
console.log(`${colors.bright}Sync Overview${colors.reset}`);
|
|
1166
|
-
console.log('='.repeat(80));
|
|
1167
|
-
// Last sync information
|
|
1168
|
-
if (syncMeta.lastSyncAt > 0) {
|
|
1169
|
-
const lastSync = new Date(syncMeta.lastSyncAt);
|
|
656
|
+
log.header('\n📊 QUIC Sync Status');
|
|
657
|
+
// Get sync metadata
|
|
658
|
+
const syncMeta = this.getSyncMetadata();
|
|
659
|
+
console.log('\n' + '═'.repeat(80));
|
|
660
|
+
console.log(`${colors.bright}Sync Status${colors.reset}`);
|
|
661
|
+
console.log('═'.repeat(80));
|
|
662
|
+
if (syncMeta.lastSyncTime) {
|
|
663
|
+
const lastSync = new Date(syncMeta.lastSyncTime * 1000);
|
|
1170
664
|
console.log(` Last Sync: ${colors.cyan}${lastSync.toLocaleString()}${colors.reset}`);
|
|
1171
|
-
console.log(` Time Ago: ${
|
|
665
|
+
console.log(` Time Ago: ${this.timeAgo(syncMeta.lastSyncTime)}`);
|
|
1172
666
|
}
|
|
1173
667
|
else {
|
|
1174
668
|
console.log(` Last Sync: ${colors.yellow}Never${colors.reset}`);
|
|
1175
669
|
}
|
|
1176
|
-
console.log(
|
|
1177
|
-
console.log(
|
|
1178
|
-
console.log(
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
}
|
|
1182
|
-
console.log('\n' + '
|
|
1183
|
-
console.log(`${colors.bright}
|
|
1184
|
-
console.log('
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
console.log(` Edges: ${colors.cyan}${pendingChanges.edges.length}${colors.reset}`);
|
|
1188
|
-
console.log(` Total Size: ${colors.cyan}${(pendingChanges.totalSize / 1024).toFixed(2)} KB${colors.reset}`);
|
|
1189
|
-
console.log('\n' + '-'.repeat(80));
|
|
1190
|
-
console.log(`${colors.bright}Local Database${colors.reset}`);
|
|
1191
|
-
console.log('-'.repeat(80));
|
|
1192
|
-
const localStatus = this.getLocalDatabaseStatus();
|
|
1193
|
-
console.log(` Episodes: ${colors.cyan}${localStatus.episodes}${colors.reset}`);
|
|
1194
|
-
console.log(` Skills: ${colors.cyan}${localStatus.skills}${colors.reset}`);
|
|
1195
|
-
console.log(` Edges: ${colors.cyan}${localStatus.edges}${colors.reset}`);
|
|
1196
|
-
console.log('\n' + '-'.repeat(80));
|
|
1197
|
-
console.log(`${colors.bright}Controller Status${colors.reset}`);
|
|
1198
|
-
console.log('-'.repeat(80));
|
|
1199
|
-
// Server status
|
|
1200
|
-
if (this.quicServer) {
|
|
1201
|
-
const serverStatus = this.quicServer.getStatus();
|
|
1202
|
-
console.log(` QUIC Server: ${serverStatus.isRunning ? colors.green + 'Running' : colors.yellow + 'Stopped'}${colors.reset}`);
|
|
1203
|
-
if (serverStatus.isRunning) {
|
|
1204
|
-
console.log(` Active Connections: ${colors.cyan}${serverStatus.activeConnections}${colors.reset}`);
|
|
1205
|
-
console.log(` Total Requests: ${colors.cyan}${serverStatus.totalRequests}${colors.reset}`);
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
else {
|
|
1209
|
-
console.log(` QUIC Server: ${colors.yellow}Not initialized${colors.reset}`);
|
|
1210
|
-
}
|
|
1211
|
-
// Client status
|
|
1212
|
-
if (this.quicClient) {
|
|
1213
|
-
const clientStatus = this.quicClient.getStatus();
|
|
1214
|
-
console.log(` QUIC Client: ${clientStatus.isConnected ? colors.green + 'Connected' : colors.yellow + 'Disconnected'}${colors.reset}`);
|
|
1215
|
-
if (clientStatus.isConnected) {
|
|
1216
|
-
console.log(` Server: ${colors.cyan}${clientStatus.config.serverHost}:${clientStatus.config.serverPort}${colors.reset}`);
|
|
1217
|
-
console.log(` Pool Size: ${colors.cyan}${clientStatus.poolSize}${colors.reset}`);
|
|
1218
|
-
console.log(` Total Requests: ${colors.cyan}${clientStatus.totalRequests}${colors.reset}`);
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
else {
|
|
1222
|
-
console.log(` QUIC Client: ${colors.yellow}Not initialized${colors.reset}`);
|
|
1223
|
-
}
|
|
1224
|
-
// Sync coordinator status
|
|
1225
|
-
if (this.syncCoordinator) {
|
|
1226
|
-
const coordStatus = this.syncCoordinator.getStatus();
|
|
1227
|
-
console.log(` Sync Coordinator: ${colors.green}Ready${colors.reset}`);
|
|
1228
|
-
console.log(` Auto-Sync: ${coordStatus.autoSyncEnabled ? colors.green + 'Enabled' : colors.yellow + 'Disabled'}${colors.reset}`);
|
|
1229
|
-
console.log(` Currently Syncing: ${coordStatus.isSyncing ? colors.yellow + 'Yes' : colors.cyan + 'No'}${colors.reset}`);
|
|
670
|
+
console.log('\n' + '─'.repeat(80));
|
|
671
|
+
console.log(`${colors.bright}Pending Changes${colors.reset}`);
|
|
672
|
+
console.log('─'.repeat(80));
|
|
673
|
+
console.log(` Episodes: ${colors.green}${syncMeta.pendingEpisodes}${colors.reset}`);
|
|
674
|
+
console.log(` Skills: ${colors.green}${syncMeta.pendingSkills}${colors.reset}`);
|
|
675
|
+
console.log(` Causal Edges: ${colors.green}${syncMeta.pendingCausalEdges}${colors.reset}`);
|
|
676
|
+
console.log('\n' + '─'.repeat(80));
|
|
677
|
+
console.log(`${colors.bright}Connected Servers${colors.reset}`);
|
|
678
|
+
console.log('─'.repeat(80));
|
|
679
|
+
if (syncMeta.servers.length === 0) {
|
|
680
|
+
console.log(` ${colors.yellow}No servers connected${colors.reset}`);
|
|
1230
681
|
}
|
|
1231
682
|
else {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
log.info(`\nTip: You have ${pendingChanges.totalItems} unsynced items. Use "agentdb sync push" to sync them.`);
|
|
1238
|
-
}
|
|
1239
|
-
if (!this.quicClient && !this.quicServer) {
|
|
1240
|
-
log.info('\nTo start syncing:');
|
|
1241
|
-
log.info(' - Start a server: agentdb sync start-server --port 4433');
|
|
1242
|
-
log.info(' - Or connect to one: agentdb sync connect <host> <port>');
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
// Get sync metadata from database
|
|
1246
|
-
getSyncMetadataFromDb() {
|
|
1247
|
-
if (!this.db) {
|
|
1248
|
-
return {
|
|
1249
|
-
lastSyncAt: 0,
|
|
1250
|
-
lastEpisodeSync: 0,
|
|
1251
|
-
lastSkillSync: 0,
|
|
1252
|
-
lastEdgeSync: 0,
|
|
1253
|
-
totalItemsSynced: 0,
|
|
1254
|
-
totalBytesSynced: 0,
|
|
1255
|
-
syncCount: 0,
|
|
1256
|
-
};
|
|
1257
|
-
}
|
|
1258
|
-
try {
|
|
1259
|
-
const row = this.db
|
|
1260
|
-
.prepare('SELECT * FROM sync_state WHERE id = 1')
|
|
1261
|
-
.get();
|
|
1262
|
-
if (row) {
|
|
1263
|
-
return {
|
|
1264
|
-
lastSyncAt: row.last_sync_at || 0,
|
|
1265
|
-
lastEpisodeSync: row.last_episode_sync || 0,
|
|
1266
|
-
lastSkillSync: row.last_skill_sync || 0,
|
|
1267
|
-
lastEdgeSync: row.last_edge_sync || 0,
|
|
1268
|
-
totalItemsSynced: row.total_items_synced || 0,
|
|
1269
|
-
totalBytesSynced: row.total_bytes_synced || 0,
|
|
1270
|
-
syncCount: row.sync_count || 0,
|
|
1271
|
-
lastError: row.last_error || undefined,
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
catch {
|
|
1276
|
-
// Table might not exist
|
|
683
|
+
syncMeta.servers.forEach((server) => {
|
|
684
|
+
console.log(` ${colors.cyan}${server.host}:${server.port}${colors.reset}`);
|
|
685
|
+
console.log(` Status: ${server.connected ? colors.green + 'Connected' : colors.red + 'Disconnected'}${colors.reset}`);
|
|
686
|
+
console.log(` Last Seen: ${new Date(server.lastSeen * 1000).toLocaleString()}`);
|
|
687
|
+
});
|
|
1277
688
|
}
|
|
1278
|
-
|
|
1279
|
-
lastSyncAt: 0,
|
|
1280
|
-
lastEpisodeSync: 0,
|
|
1281
|
-
lastSkillSync: 0,
|
|
1282
|
-
lastEdgeSync: 0,
|
|
1283
|
-
totalItemsSynced: 0,
|
|
1284
|
-
totalBytesSynced: 0,
|
|
1285
|
-
syncCount: 0,
|
|
1286
|
-
};
|
|
689
|
+
console.log('═'.repeat(80));
|
|
1287
690
|
}
|
|
1288
691
|
generateAuthToken() {
|
|
1289
692
|
// Generate a random 32-character token
|
|
1290
693
|
return Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
1291
694
|
}
|
|
1292
|
-
getPendingChanges(
|
|
695
|
+
getPendingChanges(incremental, filter) {
|
|
1293
696
|
// Mock implementation - would query sync metadata table
|
|
1294
697
|
return {
|
|
1295
698
|
episodes: 10,
|
|
@@ -1344,14 +747,6 @@ class AgentDBCLI {
|
|
|
1344
747
|
// ============================================================================
|
|
1345
748
|
// CLI Entry Point
|
|
1346
749
|
// ============================================================================
|
|
1347
|
-
/**
|
|
1348
|
-
* Helper function to execute Commander-based commands
|
|
1349
|
-
*/
|
|
1350
|
-
async function handleCommanderCommand(command, args) {
|
|
1351
|
-
// Parse directly using the command instance without wrapping in a parent program
|
|
1352
|
-
// This avoids issues with subcommand routing
|
|
1353
|
-
await command.parseAsync(['node', command.name(), ...args], { from: 'user' });
|
|
1354
|
-
}
|
|
1355
750
|
async function main() {
|
|
1356
751
|
const args = process.argv.slice(2);
|
|
1357
752
|
// Handle version flag
|
|
@@ -1418,9 +813,6 @@ async function main() {
|
|
|
1418
813
|
else if (arg === '--db' && i + 1 < args.length) {
|
|
1419
814
|
options.dbPath = args[++i];
|
|
1420
815
|
}
|
|
1421
|
-
else if (arg === '--rvf-path' && i + 1 < args.length) {
|
|
1422
|
-
options.rvfPath = args[++i];
|
|
1423
|
-
}
|
|
1424
816
|
else if (!arg.startsWith('--')) {
|
|
1425
817
|
options.dbPath = arg;
|
|
1426
818
|
}
|
|
@@ -1469,12 +861,6 @@ async function main() {
|
|
|
1469
861
|
else if (arg === '--target' && i + 1 < args.length) {
|
|
1470
862
|
options.targetDb = args[++i];
|
|
1471
863
|
}
|
|
1472
|
-
else if (arg === '--to' && i + 1 < args.length) {
|
|
1473
|
-
options.to = args[++i];
|
|
1474
|
-
}
|
|
1475
|
-
else if (arg === '--rvf-path' && i + 1 < args.length) {
|
|
1476
|
-
options.rvfPath = args[++i];
|
|
1477
|
-
}
|
|
1478
864
|
else if (arg === '--no-optimize') {
|
|
1479
865
|
options.optimize = false;
|
|
1480
866
|
}
|
|
@@ -1490,7 +876,7 @@ async function main() {
|
|
|
1490
876
|
}
|
|
1491
877
|
if (!options.sourceDb) {
|
|
1492
878
|
log.error('Source database path required');
|
|
1493
|
-
console.log('Usage: agentdb migrate <source-db> [--
|
|
879
|
+
console.log('Usage: agentdb migrate <source-db> [--target <target-db>] [--no-optimize] [--dry-run] [--verbose]');
|
|
1494
880
|
process.exit(1);
|
|
1495
881
|
}
|
|
1496
882
|
await migrateCommand(options);
|
|
@@ -1504,15 +890,9 @@ async function main() {
|
|
|
1504
890
|
if (arg === '--db' && i + 1 < args.length) {
|
|
1505
891
|
options.dbPath = args[++i];
|
|
1506
892
|
}
|
|
1507
|
-
else if (arg === '--rvf-path' && i + 1 < args.length) {
|
|
1508
|
-
options.rvfPath = args[++i];
|
|
1509
|
-
}
|
|
1510
893
|
else if (arg === '--verbose' || arg === '-v') {
|
|
1511
894
|
options.verbose = true;
|
|
1512
895
|
}
|
|
1513
|
-
else if (arg === '--fix') {
|
|
1514
|
-
options.fix = true;
|
|
1515
|
-
}
|
|
1516
896
|
else if (!arg.startsWith('--')) {
|
|
1517
897
|
options.dbPath = arg;
|
|
1518
898
|
}
|
|
@@ -1537,28 +917,6 @@ async function main() {
|
|
|
1537
917
|
await handleStatsCommand(args.slice(1));
|
|
1538
918
|
return;
|
|
1539
919
|
}
|
|
1540
|
-
// Handle advanced neural commands (WASM-accelerated when available)
|
|
1541
|
-
if (command === 'attention') {
|
|
1542
|
-
await handleCommanderCommand(attentionCommand, args.slice(1));
|
|
1543
|
-
return;
|
|
1544
|
-
}
|
|
1545
|
-
if (command === 'learn') {
|
|
1546
|
-
await handleCommanderCommand(learnCommand, args.slice(1));
|
|
1547
|
-
return;
|
|
1548
|
-
}
|
|
1549
|
-
if (command === 'route') {
|
|
1550
|
-
await handleCommanderCommand(routeCommand, args.slice(1));
|
|
1551
|
-
return;
|
|
1552
|
-
}
|
|
1553
|
-
if (command === 'hyperbolic') {
|
|
1554
|
-
await handleCommanderCommand(hyperbolicCommand, args.slice(1));
|
|
1555
|
-
return;
|
|
1556
|
-
}
|
|
1557
|
-
// Handle RVF store management commands
|
|
1558
|
-
if (command === 'rvf') {
|
|
1559
|
-
await handleCommanderCommand(rvfCommand, args.slice(1));
|
|
1560
|
-
return;
|
|
1561
|
-
}
|
|
1562
920
|
// Handle simulate command - run simulation CLI
|
|
1563
921
|
if (command === 'simulate') {
|
|
1564
922
|
// Use pathToFileURL for proper ESM module resolution
|
|
@@ -1687,6 +1045,110 @@ async function main() {
|
|
|
1687
1045
|
}
|
|
1688
1046
|
}
|
|
1689
1047
|
// Command handlers
|
|
1048
|
+
// Init command handler
|
|
1049
|
+
async function handleInitCommand(args) {
|
|
1050
|
+
// Parse arguments
|
|
1051
|
+
let dbPath = './agentdb.db';
|
|
1052
|
+
let dimension = 1536; // Default OpenAI ada-002
|
|
1053
|
+
let preset = null;
|
|
1054
|
+
let inMemory = false;
|
|
1055
|
+
for (let i = 0; i < args.length; i++) {
|
|
1056
|
+
const arg = args[i];
|
|
1057
|
+
if (arg === '--dimension' && i + 1 < args.length) {
|
|
1058
|
+
dimension = parseInt(args[++i]);
|
|
1059
|
+
}
|
|
1060
|
+
else if (arg === '--preset' && i + 1 < args.length) {
|
|
1061
|
+
preset = args[++i];
|
|
1062
|
+
}
|
|
1063
|
+
else if (arg === '--in-memory') {
|
|
1064
|
+
inMemory = true;
|
|
1065
|
+
dbPath = ':memory:';
|
|
1066
|
+
}
|
|
1067
|
+
else if (!arg.startsWith('--')) {
|
|
1068
|
+
dbPath = arg;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
// Apply preset configurations
|
|
1072
|
+
if (preset) {
|
|
1073
|
+
if (preset === 'small') {
|
|
1074
|
+
log.info('Using SMALL preset (<10K vectors)');
|
|
1075
|
+
}
|
|
1076
|
+
else if (preset === 'medium') {
|
|
1077
|
+
log.info('Using MEDIUM preset (10K-100K vectors)');
|
|
1078
|
+
}
|
|
1079
|
+
else if (preset === 'large') {
|
|
1080
|
+
log.info('Using LARGE preset (>100K vectors)');
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
log.info(`Initializing AgentDB at: ${dbPath}`);
|
|
1084
|
+
log.info(`Embedding dimension: ${dimension}`);
|
|
1085
|
+
if (inMemory) {
|
|
1086
|
+
log.info('Using in-memory database (data will not persist)');
|
|
1087
|
+
}
|
|
1088
|
+
// Check if database already exists
|
|
1089
|
+
if (!inMemory && fs.existsSync(dbPath)) {
|
|
1090
|
+
log.warning(`Database already exists at ${dbPath}`);
|
|
1091
|
+
log.info('Use a different path or remove the existing file to reinitialize');
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
// Create parent directories if needed
|
|
1095
|
+
if (!inMemory) {
|
|
1096
|
+
const parentDir = path.dirname(dbPath);
|
|
1097
|
+
if (parentDir !== '.' && !fs.existsSync(parentDir)) {
|
|
1098
|
+
log.info(`Creating directory: ${parentDir}`);
|
|
1099
|
+
fs.mkdirSync(parentDir, { recursive: true });
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
// Create new database with schemas
|
|
1103
|
+
const cli = new AgentDBCLI();
|
|
1104
|
+
await cli.initialize(dbPath);
|
|
1105
|
+
// CRITICAL: Save the database to disk (unless in-memory)
|
|
1106
|
+
// sql.js keeps everything in memory until explicitly saved
|
|
1107
|
+
if (!inMemory) {
|
|
1108
|
+
if (cli.db && typeof cli.db.save === 'function') {
|
|
1109
|
+
cli.db.save();
|
|
1110
|
+
}
|
|
1111
|
+
else if (cli.db && typeof cli.db.close === 'function') {
|
|
1112
|
+
// close() calls save() internally
|
|
1113
|
+
cli.db.close();
|
|
1114
|
+
}
|
|
1115
|
+
// Verify database file was created
|
|
1116
|
+
if (!fs.existsSync(dbPath)) {
|
|
1117
|
+
log.error(`Failed to create database file at ${dbPath}`);
|
|
1118
|
+
log.error('The database may be in memory only');
|
|
1119
|
+
process.exit(1);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
// Verify database has tables
|
|
1123
|
+
try {
|
|
1124
|
+
const db = await createDatabase(dbPath);
|
|
1125
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table'").all();
|
|
1126
|
+
db.close();
|
|
1127
|
+
if (tables.length === 0) {
|
|
1128
|
+
log.warning('Database file created but no tables found');
|
|
1129
|
+
log.warning('Schemas may not have been loaded correctly');
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
log.success(`Database created with ${tables.length} tables`);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
catch (error) {
|
|
1136
|
+
log.warning(`Could not verify database tables: ${error.message}`);
|
|
1137
|
+
}
|
|
1138
|
+
log.success(`✅ AgentDB initialized successfully at ${dbPath}`);
|
|
1139
|
+
log.info('Database includes:');
|
|
1140
|
+
log.info(' - Core vector tables (episodes, embeddings)');
|
|
1141
|
+
log.info(' - Causal memory graph');
|
|
1142
|
+
log.info(' - Reflexion memory');
|
|
1143
|
+
log.info(' - Skill library');
|
|
1144
|
+
log.info(' - Learning system');
|
|
1145
|
+
log.info('');
|
|
1146
|
+
log.info('Next steps:');
|
|
1147
|
+
log.info(' - Use "agentdb mcp start" to start MCP server');
|
|
1148
|
+
log.info(' - Use "agentdb causal add" to add causal edges');
|
|
1149
|
+
log.info(' - Use "agentdb reflexion add" to store episodes');
|
|
1150
|
+
log.info(' - See "agentdb help" for all commands');
|
|
1151
|
+
}
|
|
1690
1152
|
async function handleMcpCommand(args) {
|
|
1691
1153
|
const subcommand = args[0];
|
|
1692
1154
|
if (subcommand === 'start' || !subcommand) {
|
|
@@ -1820,7 +1282,7 @@ async function handleReflexionCommands(cli, subcommand, args) {
|
|
|
1820
1282
|
}
|
|
1821
1283
|
else if (subcommand === 'retrieve') {
|
|
1822
1284
|
// Parse retrieve command with new flags
|
|
1823
|
-
|
|
1285
|
+
let task = args[0];
|
|
1824
1286
|
let k = undefined;
|
|
1825
1287
|
let minReward = undefined;
|
|
1826
1288
|
let onlyFailures = undefined;
|
|
@@ -1930,7 +1392,7 @@ async function handleSkillCommands(cli, subcommand, args) {
|
|
|
1930
1392
|
printHelp();
|
|
1931
1393
|
}
|
|
1932
1394
|
}
|
|
1933
|
-
async function handleDbCommands(cli, subcommand,
|
|
1395
|
+
async function handleDbCommands(cli, subcommand, args) {
|
|
1934
1396
|
if (subcommand === 'stats') {
|
|
1935
1397
|
await cli.dbStats();
|
|
1936
1398
|
}
|
|
@@ -1946,7 +1408,6 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
1946
1408
|
let cert;
|
|
1947
1409
|
let key;
|
|
1948
1410
|
let authToken;
|
|
1949
|
-
let maxConnections;
|
|
1950
1411
|
for (let i = 0; i < args.length; i++) {
|
|
1951
1412
|
if (args[i] === '--port' && i + 1 < args.length) {
|
|
1952
1413
|
port = parseInt(args[++i]);
|
|
@@ -1960,11 +1421,8 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
1960
1421
|
else if (args[i] === '--auth-token' && i + 1 < args.length) {
|
|
1961
1422
|
authToken = args[++i];
|
|
1962
1423
|
}
|
|
1963
|
-
else if (args[i] === '--max-connections' && i + 1 < args.length) {
|
|
1964
|
-
maxConnections = parseInt(args[++i]);
|
|
1965
|
-
}
|
|
1966
1424
|
}
|
|
1967
|
-
await cli.quicStartServer({ port, cert, key, authToken
|
|
1425
|
+
await cli.quicStartServer({ port, cert, key, authToken });
|
|
1968
1426
|
}
|
|
1969
1427
|
else if (subcommand === 'connect') {
|
|
1970
1428
|
// Parse host and port
|
|
@@ -1972,12 +1430,11 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
1972
1430
|
const port = parseInt(args[1]);
|
|
1973
1431
|
if (!host || !port) {
|
|
1974
1432
|
log.error('Missing required arguments: host and port');
|
|
1975
|
-
log.info('Usage: agentdb sync connect <host> <port> [--auth-token <token>] [--cert <path>]
|
|
1433
|
+
log.info('Usage: agentdb sync connect <host> <port> [--auth-token <token>] [--cert <path>]');
|
|
1976
1434
|
process.exit(1);
|
|
1977
1435
|
}
|
|
1978
1436
|
let authToken;
|
|
1979
1437
|
let cert;
|
|
1980
|
-
let timeout;
|
|
1981
1438
|
for (let i = 2; i < args.length; i++) {
|
|
1982
1439
|
if (args[i] === '--auth-token' && i + 1 < args.length) {
|
|
1983
1440
|
authToken = args[++i];
|
|
@@ -1985,19 +1442,14 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
1985
1442
|
else if (args[i] === '--cert' && i + 1 < args.length) {
|
|
1986
1443
|
cert = args[++i];
|
|
1987
1444
|
}
|
|
1988
|
-
else if (args[i] === '--timeout' && i + 1 < args.length) {
|
|
1989
|
-
timeout = parseInt(args[++i]);
|
|
1990
|
-
}
|
|
1991
1445
|
}
|
|
1992
|
-
await cli.quicConnect({ host, port, authToken, cert
|
|
1446
|
+
await cli.quicConnect({ host, port, authToken, cert });
|
|
1993
1447
|
}
|
|
1994
1448
|
else if (subcommand === 'push') {
|
|
1995
1449
|
// Parse options
|
|
1996
1450
|
let server;
|
|
1997
1451
|
let incremental = false;
|
|
1998
1452
|
let filter;
|
|
1999
|
-
let authToken;
|
|
2000
|
-
let batchSize;
|
|
2001
1453
|
for (let i = 0; i < args.length; i++) {
|
|
2002
1454
|
if (args[i] === '--server' && i + 1 < args.length) {
|
|
2003
1455
|
server = args[++i];
|
|
@@ -2008,31 +1460,22 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
2008
1460
|
else if (args[i] === '--filter' && i + 1 < args.length) {
|
|
2009
1461
|
filter = args[++i];
|
|
2010
1462
|
}
|
|
2011
|
-
else if (args[i] === '--auth-token' && i + 1 < args.length) {
|
|
2012
|
-
authToken = args[++i];
|
|
2013
|
-
}
|
|
2014
|
-
else if (args[i] === '--batch-size' && i + 1 < args.length) {
|
|
2015
|
-
batchSize = parseInt(args[++i]);
|
|
2016
|
-
}
|
|
2017
1463
|
else if (!args[i].startsWith('--') && !server) {
|
|
2018
1464
|
server = args[i];
|
|
2019
1465
|
}
|
|
2020
1466
|
}
|
|
2021
1467
|
if (!server) {
|
|
2022
1468
|
log.error('Missing required --server parameter');
|
|
2023
|
-
log.info('Usage: agentdb sync push --server <host:port> [--incremental] [--filter <pattern>]
|
|
1469
|
+
log.info('Usage: agentdb sync push --server <host:port> [--incremental] [--filter <pattern>]');
|
|
2024
1470
|
process.exit(1);
|
|
2025
1471
|
}
|
|
2026
|
-
await cli.quicPush({ server, incremental, filter
|
|
1472
|
+
await cli.quicPush({ server, incremental, filter });
|
|
2027
1473
|
}
|
|
2028
1474
|
else if (subcommand === 'pull') {
|
|
2029
1475
|
// Parse options
|
|
2030
1476
|
let server;
|
|
2031
1477
|
let incremental = false;
|
|
2032
1478
|
let filter;
|
|
2033
|
-
let authToken;
|
|
2034
|
-
let batchSize;
|
|
2035
|
-
let conflictStrategy;
|
|
2036
1479
|
for (let i = 0; i < args.length; i++) {
|
|
2037
1480
|
if (args[i] === '--server' && i + 1 < args.length) {
|
|
2038
1481
|
server = args[++i];
|
|
@@ -2043,31 +1486,16 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
2043
1486
|
else if (args[i] === '--filter' && i + 1 < args.length) {
|
|
2044
1487
|
filter = args[++i];
|
|
2045
1488
|
}
|
|
2046
|
-
else if (args[i] === '--auth-token' && i + 1 < args.length) {
|
|
2047
|
-
authToken = args[++i];
|
|
2048
|
-
}
|
|
2049
|
-
else if (args[i] === '--batch-size' && i + 1 < args.length) {
|
|
2050
|
-
batchSize = parseInt(args[++i]);
|
|
2051
|
-
}
|
|
2052
|
-
else if (args[i] === '--conflict-strategy' && i + 1 < args.length) {
|
|
2053
|
-
const strategy = args[++i];
|
|
2054
|
-
if (strategy === 'local-wins' || strategy === 'remote-wins' || strategy === 'latest-wins') {
|
|
2055
|
-
conflictStrategy = strategy;
|
|
2056
|
-
}
|
|
2057
|
-
else {
|
|
2058
|
-
log.warning(`Unknown conflict strategy: ${strategy}. Using default: latest-wins`);
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
1489
|
else if (!args[i].startsWith('--') && !server) {
|
|
2062
1490
|
server = args[i];
|
|
2063
1491
|
}
|
|
2064
1492
|
}
|
|
2065
1493
|
if (!server) {
|
|
2066
1494
|
log.error('Missing required --server parameter');
|
|
2067
|
-
log.info('Usage: agentdb sync pull --server <host:port> [--incremental] [--filter <pattern>]
|
|
1495
|
+
log.info('Usage: agentdb sync pull --server <host:port> [--incremental] [--filter <pattern>]');
|
|
2068
1496
|
process.exit(1);
|
|
2069
1497
|
}
|
|
2070
|
-
await cli.quicPull({ server, incremental, filter
|
|
1498
|
+
await cli.quicPull({ server, incremental, filter });
|
|
2071
1499
|
}
|
|
2072
1500
|
else if (subcommand === 'status') {
|
|
2073
1501
|
await cli.quicStatus();
|
|
@@ -2075,13 +1503,6 @@ async function handleSyncCommands(cli, subcommand, args) {
|
|
|
2075
1503
|
else {
|
|
2076
1504
|
log.error(`Unknown sync subcommand: ${subcommand}`);
|
|
2077
1505
|
log.info('Available subcommands: start-server, connect, push, pull, status');
|
|
2078
|
-
log.info('');
|
|
2079
|
-
log.info('Examples:');
|
|
2080
|
-
log.info(' agentdb sync start-server --port 4433 --auth-token secret123');
|
|
2081
|
-
log.info(' agentdb sync connect localhost 4433 --auth-token secret123');
|
|
2082
|
-
log.info(' agentdb sync push --server localhost:4433 --incremental');
|
|
2083
|
-
log.info(' agentdb sync pull --server localhost:4433 --conflict-strategy latest-wins');
|
|
2084
|
-
log.info(' agentdb sync status');
|
|
2085
1506
|
printHelp();
|
|
2086
1507
|
}
|
|
2087
1508
|
}
|
|
@@ -2432,7 +1853,7 @@ async function handleVectorSearchCommand(args) {
|
|
|
2432
1853
|
scored = scored.slice(0, k);
|
|
2433
1854
|
}
|
|
2434
1855
|
// Remove embedding from output
|
|
2435
|
-
const output = scored.map(({ embedding
|
|
1856
|
+
const output = scored.map(({ embedding, ...rest }) => rest);
|
|
2436
1857
|
if (format === 'json') {
|
|
2437
1858
|
console.log(JSON.stringify(output, null, 2));
|
|
2438
1859
|
}
|
|
@@ -2598,9 +2019,8 @@ async function handleImportCommand(args) {
|
|
|
2598
2019
|
const cli = new AgentDBCLI();
|
|
2599
2020
|
await cli.initialize(dbPath);
|
|
2600
2021
|
let imported = 0;
|
|
2601
|
-
for (const
|
|
2022
|
+
for (const item of data) {
|
|
2602
2023
|
try {
|
|
2603
|
-
const item = rawItem;
|
|
2604
2024
|
// Import episode
|
|
2605
2025
|
const episodeQuery = `
|
|
2606
2026
|
INSERT INTO episodes (session_id, task, input, output, critique, reward, success, latency_ms, tokens_used, tags, metadata)
|
|
@@ -2687,14 +2107,15 @@ function printHelp() {
|
|
|
2687
2107
|
${colors.bright}${colors.cyan}█▀█ █▀▀ █▀▀ █▄░█ ▀█▀ █▀▄ █▄▄
|
|
2688
2108
|
█▀█ █▄█ ██▄ █░▀█ ░█░ █▄▀ █▄█${colors.reset}
|
|
2689
2109
|
|
|
2690
|
-
${colors.bright}${colors.cyan}AgentDB
|
|
2110
|
+
${colors.bright}${colors.cyan}AgentDB v2 CLI - Vector Intelligence with Auto Backend Detection${colors.reset}
|
|
2691
2111
|
|
|
2692
2112
|
${colors.bright}CORE COMMANDS:${colors.reset}
|
|
2693
2113
|
${colors.cyan}init${colors.reset} [options] Initialize database with backend detection
|
|
2694
|
-
--backend <type> Backend: auto (default), ruvector,
|
|
2114
|
+
--backend <type> Backend: auto (default), ruvector, hnswlib
|
|
2695
2115
|
--dimension <n> Vector dimension (default: 384)
|
|
2696
2116
|
--model <name> Embedding model (default: Xenova/all-MiniLM-L6-v2)
|
|
2697
|
-
|
|
2117
|
+
Popular: Xenova/bge-base-en-v1.5 (768d production)
|
|
2118
|
+
Xenova/bge-small-en-v1.5 (384d best quality)
|
|
2698
2119
|
--dry-run Show detection info without initializing
|
|
2699
2120
|
--db <path> Database path (default: ./agentdb.db)
|
|
2700
2121
|
|
|
@@ -2704,17 +2125,8 @@ ${colors.bright}CORE COMMANDS:${colors.reset}
|
|
|
2704
2125
|
|
|
2705
2126
|
${colors.cyan}doctor${colors.reset} [options] System diagnostics and health check
|
|
2706
2127
|
--db <path> Database path to check (optional)
|
|
2707
|
-
--rvf-path <path> RVF store to check (default: ./agentdb.rvf)
|
|
2708
|
-
--fix Auto-fix issues (compact RVF, repair DB)
|
|
2709
2128
|
--verbose, -v Show detailed system information
|
|
2710
2129
|
|
|
2711
|
-
${colors.cyan}rvf${colors.reset} <subcommand> RVF store management
|
|
2712
|
-
status <store> Show RVF store status and statistics
|
|
2713
|
-
compact <store> Compact store to reclaim dead space
|
|
2714
|
-
derive <parent> <child> Create a COW branch
|
|
2715
|
-
segments <store> List store segments
|
|
2716
|
-
detect Detect RVF SDK availability
|
|
2717
|
-
|
|
2718
2130
|
${colors.bright}USAGE:${colors.reset}
|
|
2719
2131
|
agentdb <command> <subcommand> [options]
|
|
2720
2132
|
|
|
@@ -2831,55 +2243,6 @@ ${colors.bright}QUIC SYNC COMMANDS:${colors.reset}
|
|
|
2831
2243
|
Show synchronization status, pending changes, and connected servers
|
|
2832
2244
|
Example: agentdb sync status
|
|
2833
2245
|
|
|
2834
|
-
${colors.bright}ADVANCED NEURAL COMMANDS (WASM-ACCELERATED):${colors.reset}
|
|
2835
|
-
agentdb attention <subcommand> [options]
|
|
2836
|
-
Attention mechanism operations: flash, hyperbolic, sparse, MoE
|
|
2837
|
-
Subcommands:
|
|
2838
|
-
init --mechanism <type> Initialize attention configuration
|
|
2839
|
-
compute --query <text> Compute attention for query-key-value
|
|
2840
|
-
benchmark --all Benchmark all mechanisms
|
|
2841
|
-
optimize --mechanism <type> Optimize parameters
|
|
2842
|
-
Example: agentdb attention benchmark --all --iterations 100
|
|
2843
|
-
|
|
2844
|
-
agentdb learn --mode <type> --data <file> [options]
|
|
2845
|
-
Advanced learning: curriculum, contrastive loss, hard negative mining
|
|
2846
|
-
Modes:
|
|
2847
|
-
curriculum Progressive difficulty training with cosine/linear schedules
|
|
2848
|
-
contrastive InfoNCE and local contrastive loss training
|
|
2849
|
-
hard-negatives Hard negative mining for contrastive learning
|
|
2850
|
-
Options:
|
|
2851
|
-
--schedule <type> Difficulty schedule: linear|cosine|exponential
|
|
2852
|
-
--temperature <n> InfoNCE temperature (default: 0.07)
|
|
2853
|
-
--strategy <type> Mining strategy: hard|semi-hard|distance-based
|
|
2854
|
-
Example: agentdb learn --mode curriculum --data train.json --schedule cosine
|
|
2855
|
-
Example: agentdb learn --mode contrastive --data pairs.json --epochs 15
|
|
2856
|
-
|
|
2857
|
-
agentdb route --prompt <text> [options]
|
|
2858
|
-
LLM routing with FastGRNN model selection (haiku/sonnet/opus)
|
|
2859
|
-
Options:
|
|
2860
|
-
--prompt <text> Prompt to route
|
|
2861
|
-
--prompt-file <path> File containing prompt
|
|
2862
|
-
--context <json> Conversation context (JSON)
|
|
2863
|
-
--explain Explain routing decision
|
|
2864
|
-
Subcommands:
|
|
2865
|
-
feedback --model <type> --outcome <result> Record feedback for learning
|
|
2866
|
-
stats View routing statistics
|
|
2867
|
-
Example: agentdb route --prompt "Explain quantum computing" --explain
|
|
2868
|
-
Example: agentdb route feedback --model sonnet --outcome success
|
|
2869
|
-
|
|
2870
|
-
agentdb hyperbolic --op <type> [options]
|
|
2871
|
-
Hyperbolic space operations: Poincaré ball geometry
|
|
2872
|
-
Operations:
|
|
2873
|
-
expmap Exponential map (tangent -> manifold)
|
|
2874
|
-
logmap Logarithmic map (manifold -> tangent)
|
|
2875
|
-
mobius-add Möbius addition (hyperbolic addition)
|
|
2876
|
-
distance Poincaré distance between points
|
|
2877
|
-
project Project point to Poincaré ball
|
|
2878
|
-
centroid Compute hyperbolic centroid
|
|
2879
|
-
dual-search Hybrid Euclidean + Hyperbolic search
|
|
2880
|
-
Example: agentdb hyperbolic --op distance --point-a "[0.3,0.4]" --point-b "[0.6,0.2]"
|
|
2881
|
-
Example: agentdb hyperbolic --op dual-search --query "[0.5,0.5]" --points vectors.json
|
|
2882
|
-
|
|
2883
2246
|
${colors.bright}CAUSAL COMMANDS:${colors.reset}
|
|
2884
2247
|
agentdb causal add-edge <cause> <effect> <uplift> [confidence] [sample-size]
|
|
2885
2248
|
Add a causal edge manually
|