agentdb 1.0.12 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -838
- package/dist/benchmarks/comprehensive-benchmark.js +664 -0
- package/dist/benchmarks/frontier-benchmark.js +419 -0
- package/dist/benchmarks/reflexion-benchmark.js +370 -0
- package/dist/cli/agentdb-cli.d.ts +117 -0
- package/dist/cli/agentdb-cli.d.ts.map +1 -0
- package/dist/cli/agentdb-cli.js +724 -0
- package/dist/cli/agentdb-cli.js.map +1 -0
- package/dist/controllers/CausalMemoryGraph.d.ts +125 -0
- package/dist/controllers/CausalMemoryGraph.d.ts.map +1 -0
- package/dist/controllers/CausalMemoryGraph.js +323 -0
- package/dist/controllers/CausalMemoryGraph.js.map +1 -0
- package/dist/controllers/CausalRecall.d.ts +111 -0
- package/dist/controllers/CausalRecall.d.ts.map +1 -0
- package/dist/controllers/CausalRecall.js +282 -0
- package/dist/controllers/CausalRecall.js.map +1 -0
- package/dist/controllers/EmbeddingService.d.ts +37 -0
- package/dist/controllers/EmbeddingService.d.ts.map +1 -0
- package/dist/controllers/EmbeddingService.js +119 -0
- package/dist/controllers/EmbeddingService.js.map +1 -0
- package/dist/controllers/ExplainableRecall.d.ts +138 -0
- package/dist/controllers/ExplainableRecall.d.ts.map +1 -0
- package/dist/controllers/ExplainableRecall.js +388 -0
- package/dist/controllers/ExplainableRecall.js.map +1 -0
- package/dist/controllers/NightlyLearner.d.ts +113 -0
- package/dist/controllers/NightlyLearner.d.ts.map +1 -0
- package/dist/controllers/NightlyLearner.js +383 -0
- package/dist/controllers/NightlyLearner.js.map +1 -0
- package/dist/controllers/ReflexionMemory.d.ts +84 -0
- package/dist/controllers/ReflexionMemory.d.ts.map +1 -0
- package/dist/controllers/ReflexionMemory.js +240 -0
- package/dist/controllers/ReflexionMemory.js.map +1 -0
- package/dist/controllers/SkillLibrary.d.ts +96 -0
- package/dist/controllers/SkillLibrary.d.ts.map +1 -0
- package/dist/controllers/SkillLibrary.js +277 -0
- package/dist/controllers/SkillLibrary.js.map +1 -0
- package/dist/controllers/frontier-index.d.ts +14 -0
- package/dist/controllers/frontier-index.d.ts.map +1 -0
- package/dist/controllers/frontier-index.js +10 -0
- package/dist/controllers/frontier-index.js.map +1 -0
- package/dist/controllers/index.d.ts +12 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +9 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/optimizations/BatchOperations.d.ts +61 -0
- package/dist/optimizations/BatchOperations.d.ts.map +1 -0
- package/dist/optimizations/BatchOperations.js +199 -0
- package/dist/optimizations/BatchOperations.js.map +1 -0
- package/dist/optimizations/QueryOptimizer.d.ts +82 -0
- package/dist/optimizations/QueryOptimizer.d.ts.map +1 -0
- package/dist/optimizations/QueryOptimizer.js +226 -0
- package/dist/optimizations/QueryOptimizer.js.map +1 -0
- package/dist/optimizations/index.d.ts +10 -0
- package/dist/optimizations/index.d.ts.map +1 -0
- package/dist/optimizations/index.js +8 -0
- package/dist/optimizations/index.js.map +1 -0
- package/dist/schemas/frontier-schema.sql +341 -0
- package/dist/schemas/schema.sql +382 -0
- package/dist/tests/frontier-features.test.js +665 -0
- package/package.json +54 -117
- package/src/cli/agentdb-cli.ts +861 -0
- package/src/cli/examples.sh +83 -0
- package/src/controllers/CausalMemoryGraph.ts +504 -0
- package/src/controllers/CausalRecall.ts +395 -0
- package/src/controllers/EmbeddingService.ts +141 -0
- package/src/controllers/ExplainableRecall.ts +577 -0
- package/src/controllers/NightlyLearner.ts +475 -0
- package/src/controllers/ReflexionMemory.ts +349 -0
- package/src/controllers/SkillLibrary.ts +391 -0
- package/src/controllers/frontier-index.ts +35 -0
- package/src/controllers/index.ts +13 -0
- package/src/optimizations/BatchOperations.ts +292 -0
- package/src/optimizations/QueryOptimizer.ts +294 -0
- package/src/optimizations/index.ts +11 -0
- package/src/schemas/frontier-schema.sql +341 -0
- package/src/schemas/schema.sql +382 -0
- package/CHANGELOG.md +0 -166
- package/LICENSE +0 -38
- package/LICENSE-APACHE +0 -190
- package/LICENSE-MIT +0 -21
- package/bin/agentdb.js +0 -733
- package/bin/benchmark.js +0 -165
- package/bin/plugin-cli-wrapper.mjs +0 -21
- package/dist/agentdb.js +0 -5352
- package/dist/agentdb.js.map +0 -7
- package/dist/agentdb.min.js +0 -143
- package/dist/agentdb.min.js.map +0 -7
- package/dist/cache/query-cache.d.ts +0 -105
- package/dist/cache/query-cache.d.ts.map +0 -1
- package/dist/cache/query-cache.js +0 -224
- package/dist/cache/query-cache.js.map +0 -1
- package/dist/cache/query-cache.mjs +0 -219
- package/dist/cli/cache/query-cache.d.ts +0 -104
- package/dist/cli/cache/query-cache.js +0 -244
- package/dist/cli/cli/db-commands.d.ts +0 -48
- package/dist/cli/cli/db-commands.js +0 -613
- package/dist/cli/commands.d.ts +0 -7
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js +0 -113
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/commands.mjs +0 -104
- package/dist/cli/core/backend-interface.d.ts +0 -70
- package/dist/cli/core/backend-interface.js +0 -15
- package/dist/cli/core/native-backend.d.ts +0 -140
- package/dist/cli/core/native-backend.js +0 -432
- package/dist/cli/core/vector-db.d.ts +0 -126
- package/dist/cli/core/vector-db.js +0 -338
- package/dist/cli/core/wasm-backend.d.ts +0 -95
- package/dist/cli/core/wasm-backend.js +0 -418
- package/dist/cli/db-commands.d.ts +0 -49
- package/dist/cli/db-commands.d.ts.map +0 -1
- package/dist/cli/db-commands.js +0 -533
- package/dist/cli/db-commands.js.map +0 -1
- package/dist/cli/db-commands.mjs +0 -522
- package/dist/cli/generator.d.ts +0 -11
- package/dist/cli/generator.d.ts.map +0 -1
- package/dist/cli/generator.js +0 -567
- package/dist/cli/generator.js.map +0 -1
- package/dist/cli/generator.mjs +0 -527
- package/dist/cli/help.d.ts +0 -18
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -676
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/help.mjs +0 -667
- package/dist/cli/index/hnsw.d.ts +0 -164
- package/dist/cli/index/hnsw.js +0 -558
- package/dist/cli/plugin-cli.d.ts +0 -7
- package/dist/cli/plugin-cli.d.ts.map +0 -1
- package/dist/cli/plugin-cli.js +0 -295
- package/dist/cli/plugin-cli.js.map +0 -1
- package/dist/cli/plugin-cli.mjs +0 -289
- package/dist/cli/quantization/product-quantization.d.ts +0 -108
- package/dist/cli/quantization/product-quantization.js +0 -350
- package/dist/cli/query/query-builder.d.ts +0 -322
- package/dist/cli/query/query-builder.js +0 -600
- package/dist/cli/templates.d.ts +0 -14
- package/dist/cli/templates.d.ts.map +0 -1
- package/dist/cli/templates.js +0 -182
- package/dist/cli/templates.js.map +0 -1
- package/dist/cli/templates.mjs +0 -176
- package/dist/cli/types/index.d.ts +0 -116
- package/dist/cli/types/index.js +0 -5
- package/dist/cli/types.d.ts +0 -91
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/types.js +0 -6
- package/dist/cli/types.js.map +0 -1
- package/dist/cli/types.mjs +0 -4
- package/dist/cli/wizard/index.d.ts +0 -6
- package/dist/cli/wizard/index.d.ts.map +0 -1
- package/dist/cli/wizard/index.js +0 -138
- package/dist/cli/wizard/index.js.map +0 -1
- package/dist/cli/wizard/index.mjs +0 -131
- package/dist/cli/wizard/prompts.d.ts +0 -11
- package/dist/cli/wizard/prompts.d.ts.map +0 -1
- package/dist/cli/wizard/prompts.js +0 -482
- package/dist/cli/wizard/prompts.js.map +0 -1
- package/dist/cli/wizard/prompts.mjs +0 -470
- package/dist/cli/wizard/validator.d.ts +0 -13
- package/dist/cli/wizard/validator.d.ts.map +0 -1
- package/dist/cli/wizard/validator.js +0 -234
- package/dist/cli/wizard/validator.js.map +0 -1
- package/dist/cli/wizard/validator.mjs +0 -224
- package/dist/core/backend-interface.d.ts +0 -71
- package/dist/core/backend-interface.d.ts.map +0 -1
- package/dist/core/backend-interface.js +0 -16
- package/dist/core/backend-interface.js.map +0 -1
- package/dist/core/backend-interface.mjs +0 -12
- package/dist/core/native-backend.d.ts +0 -141
- package/dist/core/native-backend.d.ts.map +0 -1
- package/dist/core/native-backend.js +0 -457
- package/dist/core/native-backend.js.map +0 -1
- package/dist/core/native-backend.mjs +0 -449
- package/dist/core/vector-db.d.ts +0 -127
- package/dist/core/vector-db.d.ts.map +0 -1
- package/dist/core/vector-db.js +0 -270
- package/dist/core/vector-db.js.map +0 -1
- package/dist/core/vector-db.mjs +0 -265
- package/dist/core/wasm-backend.d.ts +0 -96
- package/dist/core/wasm-backend.d.ts.map +0 -1
- package/dist/core/wasm-backend.js +0 -393
- package/dist/core/wasm-backend.js.map +0 -1
- package/dist/core/wasm-backend.mjs +0 -385
- package/dist/index/hnsw-optimized.d.ts +0 -75
- package/dist/index/hnsw-optimized.d.ts.map +0 -1
- package/dist/index/hnsw-optimized.js +0 -412
- package/dist/index/hnsw-optimized.js.map +0 -1
- package/dist/index/hnsw-optimized.mjs +0 -407
- package/dist/index/hnsw.d.ts +0 -165
- package/dist/index/hnsw.d.ts.map +0 -1
- package/dist/index/hnsw.js +0 -521
- package/dist/index/hnsw.js.map +0 -1
- package/dist/index/hnsw.mjs +0 -516
- package/dist/index.browser.d.ts +0 -47
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js +0 -72
- package/dist/index.browser.js.map +0 -1
- package/dist/index.browser.mjs +0 -54
- package/dist/index.d.ts +0 -59
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -84
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -65
- package/dist/mcp/learning/core/experience-buffer.d.ts +0 -61
- package/dist/mcp/learning/core/experience-buffer.d.ts.map +0 -1
- package/dist/mcp/learning/core/experience-buffer.js +0 -175
- package/dist/mcp/learning/core/experience-buffer.js.map +0 -1
- package/dist/mcp/learning/core/experience-buffer.mjs +0 -170
- package/dist/mcp/learning/core/experience-recorder.d.ts +0 -40
- package/dist/mcp/learning/core/experience-recorder.d.ts.map +0 -1
- package/dist/mcp/learning/core/experience-recorder.js +0 -200
- package/dist/mcp/learning/core/experience-recorder.js.map +0 -1
- package/dist/mcp/learning/core/experience-recorder.mjs +0 -195
- package/dist/mcp/learning/core/learning-manager.d.ts +0 -66
- package/dist/mcp/learning/core/learning-manager.d.ts.map +0 -1
- package/dist/mcp/learning/core/learning-manager.js +0 -252
- package/dist/mcp/learning/core/learning-manager.js.map +0 -1
- package/dist/mcp/learning/core/learning-manager.mjs +0 -247
- package/dist/mcp/learning/core/policy-optimizer.d.ts +0 -53
- package/dist/mcp/learning/core/policy-optimizer.d.ts.map +0 -1
- package/dist/mcp/learning/core/policy-optimizer.js +0 -251
- package/dist/mcp/learning/core/policy-optimizer.js.map +0 -1
- package/dist/mcp/learning/core/policy-optimizer.mjs +0 -246
- package/dist/mcp/learning/core/reward-estimator.d.ts +0 -44
- package/dist/mcp/learning/core/reward-estimator.d.ts.map +0 -1
- package/dist/mcp/learning/core/reward-estimator.js +0 -158
- package/dist/mcp/learning/core/reward-estimator.js.map +0 -1
- package/dist/mcp/learning/core/reward-estimator.mjs +0 -153
- package/dist/mcp/learning/core/session-manager.d.ts +0 -63
- package/dist/mcp/learning/core/session-manager.d.ts.map +0 -1
- package/dist/mcp/learning/core/session-manager.js +0 -202
- package/dist/mcp/learning/core/session-manager.js.map +0 -1
- package/dist/mcp/learning/core/session-manager.mjs +0 -197
- package/dist/mcp/learning/index.d.ts +0 -19
- package/dist/mcp/learning/index.d.ts.map +0 -1
- package/dist/mcp/learning/index.js +0 -30
- package/dist/mcp/learning/index.js.map +0 -1
- package/dist/mcp/learning/index.mjs +0 -19
- package/dist/mcp/learning/tools/mcp-learning-tools.d.ts +0 -369
- package/dist/mcp/learning/tools/mcp-learning-tools.d.ts.map +0 -1
- package/dist/mcp/learning/tools/mcp-learning-tools.js +0 -361
- package/dist/mcp/learning/tools/mcp-learning-tools.js.map +0 -1
- package/dist/mcp/learning/tools/mcp-learning-tools.mjs +0 -356
- package/dist/mcp/learning/types/index.d.ts +0 -138
- package/dist/mcp/learning/types/index.d.ts.map +0 -1
- package/dist/mcp/learning/types/index.js +0 -6
- package/dist/mcp/learning/types/index.js.map +0 -1
- package/dist/mcp/learning/types/index.mjs +0 -4
- package/dist/mcp-server.d.ts +0 -29
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -862
- package/dist/mcp-server.js.map +0 -1
- package/dist/mcp-server.mjs +0 -857
- package/dist/plugins/base-plugin.d.ts +0 -114
- package/dist/plugins/base-plugin.d.ts.map +0 -1
- package/dist/plugins/base-plugin.js +0 -313
- package/dist/plugins/base-plugin.js.map +0 -1
- package/dist/plugins/base-plugin.mjs +0 -275
- package/dist/plugins/implementations/active-learning.d.ts +0 -135
- package/dist/plugins/implementations/active-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/active-learning.js +0 -372
- package/dist/plugins/implementations/active-learning.js.map +0 -1
- package/dist/plugins/implementations/active-learning.mjs +0 -367
- package/dist/plugins/implementations/actor-critic.d.ts +0 -64
- package/dist/plugins/implementations/actor-critic.d.ts.map +0 -1
- package/dist/plugins/implementations/actor-critic.js +0 -363
- package/dist/plugins/implementations/actor-critic.js.map +0 -1
- package/dist/plugins/implementations/actor-critic.mjs +0 -358
- package/dist/plugins/implementations/adversarial-training.d.ts +0 -133
- package/dist/plugins/implementations/adversarial-training.d.ts.map +0 -1
- package/dist/plugins/implementations/adversarial-training.js +0 -409
- package/dist/plugins/implementations/adversarial-training.js.map +0 -1
- package/dist/plugins/implementations/adversarial-training.mjs +0 -404
- package/dist/plugins/implementations/curriculum-learning.d.ts +0 -132
- package/dist/plugins/implementations/curriculum-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/curriculum-learning.js +0 -354
- package/dist/plugins/implementations/curriculum-learning.js.map +0 -1
- package/dist/plugins/implementations/curriculum-learning.mjs +0 -349
- package/dist/plugins/implementations/decision-transformer.d.ts +0 -77
- package/dist/plugins/implementations/decision-transformer.d.ts.map +0 -1
- package/dist/plugins/implementations/decision-transformer.js +0 -422
- package/dist/plugins/implementations/decision-transformer.js.map +0 -1
- package/dist/plugins/implementations/decision-transformer.mjs +0 -417
- package/dist/plugins/implementations/federated-learning.d.ts +0 -126
- package/dist/plugins/implementations/federated-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/federated-learning.js +0 -436
- package/dist/plugins/implementations/federated-learning.js.map +0 -1
- package/dist/plugins/implementations/federated-learning.mjs +0 -431
- package/dist/plugins/implementations/index.d.ts +0 -30
- package/dist/plugins/implementations/index.d.ts.map +0 -1
- package/dist/plugins/implementations/index.js +0 -45
- package/dist/plugins/implementations/index.js.map +0 -1
- package/dist/plugins/implementations/index.mjs +0 -31
- package/dist/plugins/implementations/multi-task-learning.d.ts +0 -115
- package/dist/plugins/implementations/multi-task-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/multi-task-learning.js +0 -369
- package/dist/plugins/implementations/multi-task-learning.js.map +0 -1
- package/dist/plugins/implementations/multi-task-learning.mjs +0 -364
- package/dist/plugins/implementations/neural-architecture-search.d.ts +0 -148
- package/dist/plugins/implementations/neural-architecture-search.d.ts.map +0 -1
- package/dist/plugins/implementations/neural-architecture-search.js +0 -379
- package/dist/plugins/implementations/neural-architecture-search.js.map +0 -1
- package/dist/plugins/implementations/neural-architecture-search.mjs +0 -374
- package/dist/plugins/implementations/q-learning.d.ts +0 -98
- package/dist/plugins/implementations/q-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/q-learning.js +0 -435
- package/dist/plugins/implementations/q-learning.js.map +0 -1
- package/dist/plugins/implementations/q-learning.mjs +0 -430
- package/dist/plugins/implementations/sarsa.d.ts +0 -103
- package/dist/plugins/implementations/sarsa.d.ts.map +0 -1
- package/dist/plugins/implementations/sarsa.js +0 -347
- package/dist/plugins/implementations/sarsa.js.map +0 -1
- package/dist/plugins/implementations/sarsa.mjs +0 -342
- package/dist/plugins/index.d.ts +0 -107
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -179
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/index.mjs +0 -168
- package/dist/plugins/interface.d.ts +0 -439
- package/dist/plugins/interface.d.ts.map +0 -1
- package/dist/plugins/interface.js +0 -12
- package/dist/plugins/interface.js.map +0 -1
- package/dist/plugins/interface.mjs +0 -10
- package/dist/plugins/learning-plugin.interface.d.ts +0 -257
- package/dist/plugins/learning-plugin.interface.d.ts.map +0 -1
- package/dist/plugins/learning-plugin.interface.js +0 -7
- package/dist/plugins/learning-plugin.interface.js.map +0 -1
- package/dist/plugins/learning-plugin.interface.mjs +0 -5
- package/dist/plugins/plugin-exports.d.ts +0 -71
- package/dist/plugins/plugin-exports.d.ts.map +0 -1
- package/dist/plugins/plugin-exports.js +0 -78
- package/dist/plugins/plugin-exports.js.map +0 -1
- package/dist/plugins/plugin-exports.mjs +0 -69
- package/dist/plugins/registry.d.ts +0 -206
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -365
- package/dist/plugins/registry.js.map +0 -1
- package/dist/plugins/registry.mjs +0 -356
- package/dist/plugins/validator.d.ts +0 -63
- package/dist/plugins/validator.d.ts.map +0 -1
- package/dist/plugins/validator.js +0 -464
- package/dist/plugins/validator.js.map +0 -1
- package/dist/plugins/validator.mjs +0 -458
- package/dist/presets.d.ts +0 -65
- package/dist/presets.d.ts.map +0 -1
- package/dist/presets.js +0 -145
- package/dist/presets.js.map +0 -1
- package/dist/presets.mjs +0 -140
- package/dist/quantization/binary-quantization.d.ts +0 -104
- package/dist/quantization/binary-quantization.d.ts.map +0 -1
- package/dist/quantization/binary-quantization.js +0 -246
- package/dist/quantization/binary-quantization.js.map +0 -1
- package/dist/quantization/binary-quantization.mjs +0 -240
- package/dist/quantization/optimized-pq.d.ts +0 -138
- package/dist/quantization/optimized-pq.d.ts.map +0 -1
- package/dist/quantization/optimized-pq.js +0 -320
- package/dist/quantization/optimized-pq.js.map +0 -1
- package/dist/quantization/optimized-pq.mjs +0 -313
- package/dist/quantization/product-quantization.d.ts +0 -109
- package/dist/quantization/product-quantization.d.ts.map +0 -1
- package/dist/quantization/product-quantization.js +0 -287
- package/dist/quantization/product-quantization.js.map +0 -1
- package/dist/quantization/product-quantization.mjs +0 -282
- package/dist/quantization/scalar-quantization.d.ts +0 -100
- package/dist/quantization/scalar-quantization.d.ts.map +0 -1
- package/dist/quantization/scalar-quantization.js +0 -324
- package/dist/quantization/scalar-quantization.js.map +0 -1
- package/dist/quantization/scalar-quantization.mjs +0 -319
- package/dist/query/index.d.ts +0 -6
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -9
- package/dist/query/index.js.map +0 -1
- package/dist/query/index.mjs +0 -4
- package/dist/query/query-builder.d.ts +0 -323
- package/dist/query/query-builder.d.ts.map +0 -1
- package/dist/query/query-builder.js +0 -524
- package/dist/query/query-builder.js.map +0 -1
- package/dist/query/query-builder.mjs +0 -519
- package/dist/reasoning/context-synthesizer.d.ts +0 -57
- package/dist/reasoning/context-synthesizer.d.ts.map +0 -1
- package/dist/reasoning/context-synthesizer.js +0 -224
- package/dist/reasoning/context-synthesizer.js.map +0 -1
- package/dist/reasoning/context-synthesizer.mjs +0 -219
- package/dist/reasoning/experience-curator.d.ts +0 -66
- package/dist/reasoning/experience-curator.d.ts.map +0 -1
- package/dist/reasoning/experience-curator.js +0 -288
- package/dist/reasoning/experience-curator.js.map +0 -1
- package/dist/reasoning/experience-curator.mjs +0 -283
- package/dist/reasoning/memory-optimizer.d.ts +0 -69
- package/dist/reasoning/memory-optimizer.d.ts.map +0 -1
- package/dist/reasoning/memory-optimizer.js +0 -331
- package/dist/reasoning/memory-optimizer.js.map +0 -1
- package/dist/reasoning/memory-optimizer.mjs +0 -326
- package/dist/reasoning/pattern-matcher.d.ts +0 -59
- package/dist/reasoning/pattern-matcher.d.ts.map +0 -1
- package/dist/reasoning/pattern-matcher.js +0 -229
- package/dist/reasoning/pattern-matcher.js.map +0 -1
- package/dist/reasoning/pattern-matcher.mjs +0 -224
- package/dist/reasoningbank/adapter/agentdb-adapter.d.ts +0 -118
- package/dist/reasoningbank/adapter/agentdb-adapter.d.ts.map +0 -1
- package/dist/reasoningbank/adapter/agentdb-adapter.js +0 -477
- package/dist/reasoningbank/adapter/agentdb-adapter.js.map +0 -1
- package/dist/reasoningbank/adapter/types.d.ts +0 -113
- package/dist/reasoningbank/adapter/types.d.ts.map +0 -1
- package/dist/reasoningbank/adapter/types.js +0 -9
- package/dist/reasoningbank/adapter/types.js.map +0 -1
- package/dist/reasoningbank/cli/commands.d.ts +0 -16
- package/dist/reasoningbank/cli/commands.d.ts.map +0 -1
- package/dist/reasoningbank/cli/commands.js +0 -272
- package/dist/reasoningbank/cli/commands.js.map +0 -1
- package/dist/reasoningbank/mcp/agentdb-tools.d.ts +0 -319
- package/dist/reasoningbank/mcp/agentdb-tools.d.ts.map +0 -1
- package/dist/reasoningbank/mcp/agentdb-tools.js +0 -301
- package/dist/reasoningbank/mcp/agentdb-tools.js.map +0 -1
- package/dist/reasoningbank/migration/migrate.d.ts +0 -25
- package/dist/reasoningbank/migration/migrate.d.ts.map +0 -1
- package/dist/reasoningbank/migration/migrate.js +0 -178
- package/dist/reasoningbank/migration/migrate.js.map +0 -1
- package/dist/reasoningbank/reasoning/context-synthesizer.d.ts +0 -37
- package/dist/reasoningbank/reasoning/context-synthesizer.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/context-synthesizer.js +0 -114
- package/dist/reasoningbank/reasoning/context-synthesizer.js.map +0 -1
- package/dist/reasoningbank/reasoning/experience-curator.d.ts +0 -39
- package/dist/reasoningbank/reasoning/experience-curator.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/experience-curator.js +0 -98
- package/dist/reasoningbank/reasoning/experience-curator.js.map +0 -1
- package/dist/reasoningbank/reasoning/memory-optimizer.d.ts +0 -44
- package/dist/reasoningbank/reasoning/memory-optimizer.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/memory-optimizer.js +0 -184
- package/dist/reasoningbank/reasoning/memory-optimizer.js.map +0 -1
- package/dist/reasoningbank/reasoning/pattern-matcher.d.ts +0 -40
- package/dist/reasoningbank/reasoning/pattern-matcher.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/pattern-matcher.js +0 -87
- package/dist/reasoningbank/reasoning/pattern-matcher.js.map +0 -1
- package/dist/reasoningbank/sync/quic-sync.d.ts +0 -77
- package/dist/reasoningbank/sync/quic-sync.d.ts.map +0 -1
- package/dist/reasoningbank/sync/quic-sync.js +0 -165
- package/dist/reasoningbank/sync/quic-sync.js.map +0 -1
- package/dist/sync/conflict.d.ts +0 -78
- package/dist/sync/conflict.d.ts.map +0 -1
- package/dist/sync/conflict.js +0 -202
- package/dist/sync/conflict.js.map +0 -1
- package/dist/sync/conflict.mjs +0 -196
- package/dist/sync/coordinator.d.ts +0 -111
- package/dist/sync/coordinator.d.ts.map +0 -1
- package/dist/sync/coordinator.js +0 -256
- package/dist/sync/coordinator.js.map +0 -1
- package/dist/sync/coordinator.mjs +0 -250
- package/dist/sync/delta.d.ts +0 -81
- package/dist/sync/delta.d.ts.map +0 -1
- package/dist/sync/delta.js +0 -245
- package/dist/sync/delta.js.map +0 -1
- package/dist/sync/delta.mjs +0 -238
- package/dist/sync/index.d.ts +0 -11
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js +0 -22
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/index.mjs +0 -9
- package/dist/sync/quic-sync.d.ts +0 -81
- package/dist/sync/quic-sync.d.ts.map +0 -1
- package/dist/sync/quic-sync.js +0 -329
- package/dist/sync/quic-sync.js.map +0 -1
- package/dist/sync/quic-sync.mjs +0 -323
- package/dist/sync/types.d.ts +0 -168
- package/dist/sync/types.d.ts.map +0 -1
- package/dist/sync/types.js +0 -8
- package/dist/sync/types.js.map +0 -1
- package/dist/sync/types.mjs +0 -6
- package/dist/types/index.d.ts +0 -117
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -4
- package/dist/wasm/sql-wasm-debug.js +0 -6989
- package/dist/wasm/sql-wasm-debug.wasm +0 -0
- package/dist/wasm/sql-wasm.js +0 -188
- package/dist/wasm/sql-wasm.wasm +0 -0
- package/dist/wasm-loader.d.ts +0 -32
- package/dist/wasm-loader.d.ts.map +0 -1
- package/dist/wasm-loader.js +0 -78
- package/dist/wasm-loader.js.map +0 -1
- package/dist/wasm-loader.mjs +0 -67
- package/examples/adaptive-learning.ts +0 -284
- package/examples/browser/README.md +0 -732
- package/examples/browser/adaptive-recommendations/index.html +0 -427
- package/examples/browser/collaborative-filtering/index.html +0 -310
- package/examples/browser/continual-learning/index.html +0 -736
- package/examples/browser/experience-replay/index.html +0 -616
- package/examples/browser/index.html +0 -369
- package/examples/browser/meta-learning/index.html +0 -789
- package/examples/browser/neuro-symbolic/index.html +0 -692
- package/examples/browser/pattern-learning/index.html +0 -620
- package/examples/browser/quantum-inspired/index.html +0 -728
- package/examples/browser/rag/index.html +0 -624
- package/examples/browser/swarm-intelligence/index.html +0 -811
- package/examples/browser-basic.html +0 -170
- package/examples/browser-wasm-real.html +0 -231
- package/examples/hnsw-example.ts +0 -148
- package/examples/mcp-learning-example.ts +0 -220
- package/examples/node-basic.js +0 -70
- package/examples/quic-sync-example.ts +0 -310
- package/examples/quick-start.js +0 -68
- package/examples/test-v1.0.7-cdn.html +0 -190
- package/examples/wasm-example.ts +0 -222
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Configuration Validator
|
|
3
|
-
*
|
|
4
|
-
* This module provides validation utilities for plugin configurations,
|
|
5
|
-
* ensuring they meet required schemas and constraints.
|
|
6
|
-
*
|
|
7
|
-
* @module plugins/validator
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Plugin name regex (kebab-case)
|
|
11
|
-
*/
|
|
12
|
-
const PLUGIN_NAME_REGEX = /^[a-z0-9-]+$/;
|
|
13
|
-
/**
|
|
14
|
-
* Semantic version regex
|
|
15
|
-
*/
|
|
16
|
-
const VERSION_REGEX = /^\d+\.\d+\.\d+$/;
|
|
17
|
-
/**
|
|
18
|
-
* Validate plugin configuration
|
|
19
|
-
*
|
|
20
|
-
* @param config - Plugin configuration to validate
|
|
21
|
-
* @returns Validation result
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const result = validatePluginConfig(config);
|
|
26
|
-
* if (!result.valid) {
|
|
27
|
-
* console.error('Validation errors:', result.errors);
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export function validatePluginConfig(config) {
|
|
32
|
-
const errors = [];
|
|
33
|
-
const warnings = [];
|
|
34
|
-
// ============ Required Fields ============
|
|
35
|
-
if (!config.name) {
|
|
36
|
-
errors.push({
|
|
37
|
-
field: 'name',
|
|
38
|
-
message: 'Plugin name is required',
|
|
39
|
-
value: config.name
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
else if (!PLUGIN_NAME_REGEX.test(config.name)) {
|
|
43
|
-
errors.push({
|
|
44
|
-
field: 'name',
|
|
45
|
-
message: 'Plugin name must be kebab-case (lowercase letters, numbers, and hyphens)',
|
|
46
|
-
value: config.name,
|
|
47
|
-
expected: 'e.g., my-plugin-name'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
else if (config.name.length < 3 || config.name.length > 50) {
|
|
51
|
-
errors.push({
|
|
52
|
-
field: 'name',
|
|
53
|
-
message: 'Plugin name must be between 3 and 50 characters',
|
|
54
|
-
value: config.name,
|
|
55
|
-
expected: '3-50 characters'
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (!config.version) {
|
|
59
|
-
errors.push({
|
|
60
|
-
field: 'version',
|
|
61
|
-
message: 'Plugin version is required',
|
|
62
|
-
value: config.version
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
else if (!VERSION_REGEX.test(config.version)) {
|
|
66
|
-
errors.push({
|
|
67
|
-
field: 'version',
|
|
68
|
-
message: 'Plugin version must follow semantic versioning (X.Y.Z)',
|
|
69
|
-
value: config.version,
|
|
70
|
-
expected: 'e.g., 1.0.0'
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (!config.description) {
|
|
74
|
-
errors.push({
|
|
75
|
-
field: 'description',
|
|
76
|
-
message: 'Plugin description is required',
|
|
77
|
-
value: config.description
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else if (config.description.length < 10 || config.description.length > 200) {
|
|
81
|
-
errors.push({
|
|
82
|
-
field: 'description',
|
|
83
|
-
message: 'Description must be between 10 and 200 characters',
|
|
84
|
-
value: config.description,
|
|
85
|
-
expected: '10-200 characters'
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if (!config.baseAlgorithm) {
|
|
89
|
-
errors.push({
|
|
90
|
-
field: 'baseAlgorithm',
|
|
91
|
-
message: 'Base algorithm is required',
|
|
92
|
-
value: config.baseAlgorithm
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
const validAlgorithms = ['decision_transformer', 'q_learning', 'sarsa', 'actor_critic', 'custom'];
|
|
97
|
-
if (!validAlgorithms.includes(config.baseAlgorithm)) {
|
|
98
|
-
errors.push({
|
|
99
|
-
field: 'baseAlgorithm',
|
|
100
|
-
message: 'Invalid base algorithm',
|
|
101
|
-
value: config.baseAlgorithm,
|
|
102
|
-
expected: validAlgorithms.join(', ')
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// ============ Algorithm Configuration ============
|
|
107
|
-
if (!config.algorithm) {
|
|
108
|
-
errors.push({
|
|
109
|
-
field: 'algorithm',
|
|
110
|
-
message: 'Algorithm configuration is required',
|
|
111
|
-
value: config.algorithm
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
if (!config.algorithm.type) {
|
|
116
|
-
errors.push({
|
|
117
|
-
field: 'algorithm.type',
|
|
118
|
-
message: 'Algorithm type is required',
|
|
119
|
-
value: config.algorithm.type
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (config.algorithm.learningRate !== undefined) {
|
|
123
|
-
if (config.algorithm.learningRate <= 0 || config.algorithm.learningRate > 1) {
|
|
124
|
-
errors.push({
|
|
125
|
-
field: 'algorithm.learningRate',
|
|
126
|
-
message: 'Learning rate must be between 0 and 1',
|
|
127
|
-
value: config.algorithm.learningRate,
|
|
128
|
-
expected: '0 < learningRate <= 1'
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (config.algorithm.discountFactor !== undefined) {
|
|
133
|
-
if (config.algorithm.discountFactor < 0 || config.algorithm.discountFactor > 1) {
|
|
134
|
-
errors.push({
|
|
135
|
-
field: 'algorithm.discountFactor',
|
|
136
|
-
message: 'Discount factor must be between 0 and 1',
|
|
137
|
-
value: config.algorithm.discountFactor,
|
|
138
|
-
expected: '0 <= discountFactor <= 1'
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
// ============ State Configuration ============
|
|
144
|
-
if (config.state) {
|
|
145
|
-
if (!config.state.dimension || config.state.dimension <= 0) {
|
|
146
|
-
errors.push({
|
|
147
|
-
field: 'state.dimension',
|
|
148
|
-
message: 'State dimension must be a positive integer',
|
|
149
|
-
value: config.state.dimension,
|
|
150
|
-
expected: 'dimension > 0'
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// ============ Action Configuration ============
|
|
155
|
-
if (config.action) {
|
|
156
|
-
if (!config.action.type) {
|
|
157
|
-
errors.push({
|
|
158
|
-
field: 'action.type',
|
|
159
|
-
message: 'Action type is required',
|
|
160
|
-
value: config.action.type
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
else if (!['discrete', 'continuous'].includes(config.action.type)) {
|
|
164
|
-
errors.push({
|
|
165
|
-
field: 'action.type',
|
|
166
|
-
message: 'Action type must be discrete or continuous',
|
|
167
|
-
value: config.action.type,
|
|
168
|
-
expected: 'discrete, continuous'
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
if (config.action.type === 'discrete' && !config.action.spaceSize) {
|
|
172
|
-
errors.push({
|
|
173
|
-
field: 'action.spaceSize',
|
|
174
|
-
message: 'Space size is required for discrete actions',
|
|
175
|
-
value: config.action.spaceSize
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
if (config.action.type === 'continuous' && !config.action.spaceBounds) {
|
|
179
|
-
warnings.push({
|
|
180
|
-
field: 'action.spaceBounds',
|
|
181
|
-
message: 'Space bounds recommended for continuous actions',
|
|
182
|
-
value: config.action.spaceBounds
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (!config.action.selectionStrategy) {
|
|
186
|
-
errors.push({
|
|
187
|
-
field: 'action.selectionStrategy',
|
|
188
|
-
message: 'Action selection strategy is required',
|
|
189
|
-
value: config.action.selectionStrategy
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
// ============ Reward Configuration ============
|
|
194
|
-
if (config.reward) {
|
|
195
|
-
const validRewardTypes = ['success_based', 'time_aware', 'token_aware', 'custom'];
|
|
196
|
-
if (!validRewardTypes.includes(config.reward.type)) {
|
|
197
|
-
errors.push({
|
|
198
|
-
field: 'reward.type',
|
|
199
|
-
message: 'Invalid reward type',
|
|
200
|
-
value: config.reward.type,
|
|
201
|
-
expected: validRewardTypes.join(', ')
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
if (config.reward.type === 'custom' && !config.reward.function) {
|
|
205
|
-
errors.push({
|
|
206
|
-
field: 'reward.function',
|
|
207
|
-
message: 'Custom reward function is required when type is custom',
|
|
208
|
-
value: config.reward.function
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// ============ Experience Replay Configuration ============
|
|
213
|
-
if (config.experienceReplay) {
|
|
214
|
-
const validReplayTypes = ['none', 'uniform', 'prioritized'];
|
|
215
|
-
if (!validReplayTypes.includes(config.experienceReplay.type)) {
|
|
216
|
-
errors.push({
|
|
217
|
-
field: 'experienceReplay.type',
|
|
218
|
-
message: 'Invalid experience replay type',
|
|
219
|
-
value: config.experienceReplay.type,
|
|
220
|
-
expected: validReplayTypes.join(', ')
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
if (config.experienceReplay.type !== 'none') {
|
|
224
|
-
if (!config.experienceReplay.capacity || config.experienceReplay.capacity <= 0) {
|
|
225
|
-
errors.push({
|
|
226
|
-
field: 'experienceReplay.capacity',
|
|
227
|
-
message: 'Replay capacity must be a positive integer',
|
|
228
|
-
value: config.experienceReplay.capacity,
|
|
229
|
-
expected: 'capacity > 0'
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (config.experienceReplay.type === 'prioritized') {
|
|
234
|
-
if (config.experienceReplay.alpha !== undefined) {
|
|
235
|
-
if (config.experienceReplay.alpha < 0 || config.experienceReplay.alpha > 1) {
|
|
236
|
-
errors.push({
|
|
237
|
-
field: 'experienceReplay.alpha',
|
|
238
|
-
message: 'Priority alpha must be between 0 and 1',
|
|
239
|
-
value: config.experienceReplay.alpha,
|
|
240
|
-
expected: '0 <= alpha <= 1'
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
if (config.experienceReplay.beta !== undefined) {
|
|
245
|
-
if (config.experienceReplay.beta < 0 || config.experienceReplay.beta > 1) {
|
|
246
|
-
errors.push({
|
|
247
|
-
field: 'experienceReplay.beta',
|
|
248
|
-
message: 'Priority beta must be between 0 and 1',
|
|
249
|
-
value: config.experienceReplay.beta,
|
|
250
|
-
expected: '0 <= beta <= 1'
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
// ============ Storage Configuration ============
|
|
257
|
-
if (!config.storage) {
|
|
258
|
-
errors.push({
|
|
259
|
-
field: 'storage',
|
|
260
|
-
message: 'Storage configuration is required',
|
|
261
|
-
value: config.storage
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
if (!config.storage.backend) {
|
|
266
|
-
errors.push({
|
|
267
|
-
field: 'storage.backend',
|
|
268
|
-
message: 'Storage backend is required',
|
|
269
|
-
value: config.storage.backend
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
else if (config.storage.backend !== 'agentdb') {
|
|
273
|
-
errors.push({
|
|
274
|
-
field: 'storage.backend',
|
|
275
|
-
message: 'Only agentdb backend is supported',
|
|
276
|
-
value: config.storage.backend,
|
|
277
|
-
expected: 'agentdb'
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
if (!config.storage.path) {
|
|
281
|
-
errors.push({
|
|
282
|
-
field: 'storage.path',
|
|
283
|
-
message: 'Storage path is required',
|
|
284
|
-
value: config.storage.path
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
if (config.storage.hnsw) {
|
|
288
|
-
if (config.storage.hnsw.M && (config.storage.hnsw.M < 2 || config.storage.hnsw.M > 100)) {
|
|
289
|
-
warnings.push({
|
|
290
|
-
field: 'storage.hnsw.M',
|
|
291
|
-
message: 'HNSW M parameter typically between 2 and 100',
|
|
292
|
-
value: config.storage.hnsw.M,
|
|
293
|
-
expected: '2 <= M <= 100'
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
if (config.storage.hnsw.efConstruction && config.storage.hnsw.efConstruction < 10) {
|
|
297
|
-
warnings.push({
|
|
298
|
-
field: 'storage.hnsw.efConstruction',
|
|
299
|
-
message: 'HNSW efConstruction should be at least 10 for good quality',
|
|
300
|
-
value: config.storage.hnsw.efConstruction,
|
|
301
|
-
expected: 'efConstruction >= 10'
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (config.storage.quantization?.enabled && config.storage.quantization.bits) {
|
|
306
|
-
if (![8, 16].includes(config.storage.quantization.bits)) {
|
|
307
|
-
errors.push({
|
|
308
|
-
field: 'storage.quantization.bits',
|
|
309
|
-
message: 'Quantization bits must be 8 or 16',
|
|
310
|
-
value: config.storage.quantization.bits,
|
|
311
|
-
expected: '8, 16'
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// ============ Training Configuration ============
|
|
317
|
-
if (!config.training) {
|
|
318
|
-
errors.push({
|
|
319
|
-
field: 'training',
|
|
320
|
-
message: 'Training configuration is required',
|
|
321
|
-
value: config.training
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
if (!config.training.batchSize || config.training.batchSize < 1) {
|
|
326
|
-
errors.push({
|
|
327
|
-
field: 'training.batchSize',
|
|
328
|
-
message: 'Batch size must be at least 1',
|
|
329
|
-
value: config.training.batchSize,
|
|
330
|
-
expected: 'batchSize >= 1'
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
else if (config.training.batchSize > 1024) {
|
|
334
|
-
warnings.push({
|
|
335
|
-
field: 'training.batchSize',
|
|
336
|
-
message: 'Large batch size may cause memory issues',
|
|
337
|
-
value: config.training.batchSize,
|
|
338
|
-
expected: 'batchSize <= 1024 recommended'
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
if (config.training.epochs && config.training.epochs < 1) {
|
|
342
|
-
errors.push({
|
|
343
|
-
field: 'training.epochs',
|
|
344
|
-
message: 'Epochs must be at least 1',
|
|
345
|
-
value: config.training.epochs,
|
|
346
|
-
expected: 'epochs >= 1'
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
if (config.training.validationSplit !== undefined) {
|
|
350
|
-
if (config.training.validationSplit < 0 || config.training.validationSplit >= 1) {
|
|
351
|
-
errors.push({
|
|
352
|
-
field: 'training.validationSplit',
|
|
353
|
-
message: 'Validation split must be between 0 and 1',
|
|
354
|
-
value: config.training.validationSplit,
|
|
355
|
-
expected: '0 <= validationSplit < 1'
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
if (!config.training.minExperiences || config.training.minExperiences < 1) {
|
|
360
|
-
errors.push({
|
|
361
|
-
field: 'training.minExperiences',
|
|
362
|
-
message: 'Minimum experiences must be at least 1',
|
|
363
|
-
value: config.training.minExperiences,
|
|
364
|
-
expected: 'minExperiences >= 1'
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
if (config.training.trainEvery && config.training.trainEvery < 1) {
|
|
368
|
-
errors.push({
|
|
369
|
-
field: 'training.trainEvery',
|
|
370
|
-
message: 'Train every must be at least 1',
|
|
371
|
-
value: config.training.trainEvery,
|
|
372
|
-
expected: 'trainEvery >= 1'
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
// ============ Monitoring Configuration ============
|
|
377
|
-
if (config.monitoring) {
|
|
378
|
-
if (!config.monitoring.trackMetrics || config.monitoring.trackMetrics.length === 0) {
|
|
379
|
-
warnings.push({
|
|
380
|
-
field: 'monitoring.trackMetrics',
|
|
381
|
-
message: 'No metrics are being tracked',
|
|
382
|
-
value: config.monitoring.trackMetrics
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
if (config.monitoring.logInterval && config.monitoring.logInterval < 1) {
|
|
386
|
-
errors.push({
|
|
387
|
-
field: 'monitoring.logInterval',
|
|
388
|
-
message: 'Log interval must be at least 1',
|
|
389
|
-
value: config.monitoring.logInterval,
|
|
390
|
-
expected: 'logInterval >= 1'
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
if (config.monitoring.saveCheckpoints && !config.monitoring.checkpointInterval) {
|
|
394
|
-
warnings.push({
|
|
395
|
-
field: 'monitoring.checkpointInterval',
|
|
396
|
-
message: 'Checkpoint interval not set, will checkpoint every episode',
|
|
397
|
-
value: config.monitoring.checkpointInterval
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
// ============ Extensions Configuration ============
|
|
402
|
-
if (config.extensions) {
|
|
403
|
-
config.extensions.forEach((ext, index) => {
|
|
404
|
-
if (!ext.name) {
|
|
405
|
-
errors.push({
|
|
406
|
-
field: `extensions[${index}].name`,
|
|
407
|
-
message: 'Extension name is required',
|
|
408
|
-
value: ext.name
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
if (ext.enabled === undefined) {
|
|
412
|
-
warnings.push({
|
|
413
|
-
field: `extensions[${index}].enabled`,
|
|
414
|
-
message: 'Extension enabled flag not set, defaulting to false',
|
|
415
|
-
value: ext.enabled
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
return {
|
|
421
|
-
valid: errors.length === 0,
|
|
422
|
-
errors,
|
|
423
|
-
warnings
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Validate required configuration fields only
|
|
428
|
-
*
|
|
429
|
-
* @param config - Partial plugin configuration
|
|
430
|
-
* @returns Whether required fields are present
|
|
431
|
-
*/
|
|
432
|
-
export function validateRequired(config) {
|
|
433
|
-
return !!(config.name &&
|
|
434
|
-
config.version &&
|
|
435
|
-
config.description &&
|
|
436
|
-
config.baseAlgorithm &&
|
|
437
|
-
config.algorithm &&
|
|
438
|
-
config.storage &&
|
|
439
|
-
config.training);
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Get validation error summary
|
|
443
|
-
*
|
|
444
|
-
* @param result - Validation result
|
|
445
|
-
* @returns Human-readable error summary
|
|
446
|
-
*/
|
|
447
|
-
export function getErrorSummary(result) {
|
|
448
|
-
if (result.valid) {
|
|
449
|
-
return 'Configuration is valid';
|
|
450
|
-
}
|
|
451
|
-
const errorList = result.errors.map(err => ` - ${err.field}: ${err.message}${err.expected ? ` (expected: ${err.expected})` : ''}`).join('\n');
|
|
452
|
-
let summary = `Found ${result.errors.length} validation error(s):\n${errorList}`;
|
|
453
|
-
if (result.warnings && result.warnings.length > 0) {
|
|
454
|
-
const warningList = result.warnings.map(warn => ` - ${warn.field}: ${warn.message}`).join('\n');
|
|
455
|
-
summary += `\n\nWarnings (${result.warnings.length}):\n${warningList}`;
|
|
456
|
-
}
|
|
457
|
-
return summary;
|
|
458
|
-
}
|
package/dist/presets.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Database configuration presets for common use cases
|
|
3
|
-
* Provides convenient factory functions for different dataset sizes
|
|
4
|
-
*
|
|
5
|
-
* Note: Vector dimension is not part of DatabaseConfig - it's determined
|
|
6
|
-
* by the actual vectors inserted. These presets configure database behavior,
|
|
7
|
-
* caching, and optimization settings.
|
|
8
|
-
*/
|
|
9
|
-
import { DatabaseConfig } from './types';
|
|
10
|
-
export declare class Presets {
|
|
11
|
-
/**
|
|
12
|
-
* Small dataset preset (< 10K vectors)
|
|
13
|
-
* Optimized for quick initialization and small-scale testing
|
|
14
|
-
*
|
|
15
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
16
|
-
* @param path - Database file path (omit or use undefined for in-memory)
|
|
17
|
-
* @returns Database configuration optimized for small datasets
|
|
18
|
-
*/
|
|
19
|
-
static smallDataset(dimension?: number, path?: string): DatabaseConfig;
|
|
20
|
-
/**
|
|
21
|
-
* Medium dataset preset (10K - 100K vectors)
|
|
22
|
-
* Balanced configuration for moderate-scale applications
|
|
23
|
-
*
|
|
24
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
25
|
-
* @param path - Database file path (omit or use undefined for in-memory)
|
|
26
|
-
* @returns Database configuration optimized for medium datasets
|
|
27
|
-
*/
|
|
28
|
-
static mediumDataset(dimension?: number, path?: string): DatabaseConfig;
|
|
29
|
-
/**
|
|
30
|
-
* Large dataset preset (100K+ vectors)
|
|
31
|
-
* High-performance configuration for large-scale production use
|
|
32
|
-
*
|
|
33
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
34
|
-
* @param path - Database file path
|
|
35
|
-
* @returns Database configuration optimized for large datasets
|
|
36
|
-
*/
|
|
37
|
-
static largeDataset(dimension?: number, path?: string): DatabaseConfig;
|
|
38
|
-
/**
|
|
39
|
-
* In-memory preset
|
|
40
|
-
* Fast, ephemeral database for testing and temporary operations
|
|
41
|
-
*
|
|
42
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
43
|
-
* @returns Database configuration for in-memory database
|
|
44
|
-
*/
|
|
45
|
-
static inMemory(dimension?: number): DatabaseConfig;
|
|
46
|
-
/**
|
|
47
|
-
* High-accuracy preset
|
|
48
|
-
* Larger cache and longer TTL for better accuracy
|
|
49
|
-
*
|
|
50
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
51
|
-
* @param path - Database file path
|
|
52
|
-
* @returns Database configuration optimized for accuracy
|
|
53
|
-
*/
|
|
54
|
-
static highAccuracy(dimension?: number, path?: string): DatabaseConfig;
|
|
55
|
-
/**
|
|
56
|
-
* Fast search preset
|
|
57
|
-
* Optimized for speed with minimal caching
|
|
58
|
-
*
|
|
59
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
60
|
-
* @param path - Database file path
|
|
61
|
-
* @returns Database configuration optimized for speed
|
|
62
|
-
*/
|
|
63
|
-
static fastSearch(dimension?: number, path?: string): DatabaseConfig;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=presets.d.ts.map
|
package/dist/presets.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,OAAO;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;IAetE;;;;;;;OAOG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;IAevE;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;IAgBtE;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc;IAanD;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;IAetE;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;CAcrE"}
|
package/dist/presets.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Database configuration presets for common use cases
|
|
4
|
-
* Provides convenient factory functions for different dataset sizes
|
|
5
|
-
*
|
|
6
|
-
* Note: Vector dimension is not part of DatabaseConfig - it's determined
|
|
7
|
-
* by the actual vectors inserted. These presets configure database behavior,
|
|
8
|
-
* caching, and optimization settings.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.Presets = void 0;
|
|
12
|
-
class Presets {
|
|
13
|
-
/**
|
|
14
|
-
* Small dataset preset (< 10K vectors)
|
|
15
|
-
* Optimized for quick initialization and small-scale testing
|
|
16
|
-
*
|
|
17
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
18
|
-
* @param path - Database file path (omit or use undefined for in-memory)
|
|
19
|
-
* @returns Database configuration optimized for small datasets
|
|
20
|
-
*/
|
|
21
|
-
static smallDataset(dimension, path) {
|
|
22
|
-
return {
|
|
23
|
-
path: path || undefined,
|
|
24
|
-
memoryMode: !path || path === ':memory:',
|
|
25
|
-
cacheSize: 100, // 100MB cache for small datasets
|
|
26
|
-
walMode: true,
|
|
27
|
-
queryCache: {
|
|
28
|
-
enabled: true,
|
|
29
|
-
maxSize: 1000,
|
|
30
|
-
ttl: 60000, // 1 minute
|
|
31
|
-
enableStats: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Medium dataset preset (10K - 100K vectors)
|
|
37
|
-
* Balanced configuration for moderate-scale applications
|
|
38
|
-
*
|
|
39
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
40
|
-
* @param path - Database file path (omit or use undefined for in-memory)
|
|
41
|
-
* @returns Database configuration optimized for medium datasets
|
|
42
|
-
*/
|
|
43
|
-
static mediumDataset(dimension, path) {
|
|
44
|
-
return {
|
|
45
|
-
path: path || undefined,
|
|
46
|
-
memoryMode: !path || path === ':memory:',
|
|
47
|
-
cacheSize: 500, // 500MB cache for medium datasets
|
|
48
|
-
walMode: true,
|
|
49
|
-
queryCache: {
|
|
50
|
-
enabled: true,
|
|
51
|
-
maxSize: 5000,
|
|
52
|
-
ttl: 300000, // 5 minutes
|
|
53
|
-
enableStats: true
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Large dataset preset (100K+ vectors)
|
|
59
|
-
* High-performance configuration for large-scale production use
|
|
60
|
-
*
|
|
61
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
62
|
-
* @param path - Database file path
|
|
63
|
-
* @returns Database configuration optimized for large datasets
|
|
64
|
-
*/
|
|
65
|
-
static largeDataset(dimension, path) {
|
|
66
|
-
return {
|
|
67
|
-
path: path || undefined,
|
|
68
|
-
memoryMode: !path || path === ':memory:',
|
|
69
|
-
cacheSize: 2000, // 2GB cache for large datasets
|
|
70
|
-
walMode: true,
|
|
71
|
-
mmapSize: 1073741824, // 1GB mmap
|
|
72
|
-
queryCache: {
|
|
73
|
-
enabled: true,
|
|
74
|
-
maxSize: 10000,
|
|
75
|
-
ttl: 600000, // 10 minutes
|
|
76
|
-
enableStats: true
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* In-memory preset
|
|
82
|
-
* Fast, ephemeral database for testing and temporary operations
|
|
83
|
-
*
|
|
84
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
85
|
-
* @returns Database configuration for in-memory database
|
|
86
|
-
*/
|
|
87
|
-
static inMemory(dimension) {
|
|
88
|
-
return {
|
|
89
|
-
memoryMode: true,
|
|
90
|
-
cacheSize: 100,
|
|
91
|
-
queryCache: {
|
|
92
|
-
enabled: true,
|
|
93
|
-
maxSize: 500,
|
|
94
|
-
ttl: 60000,
|
|
95
|
-
enableStats: true
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* High-accuracy preset
|
|
101
|
-
* Larger cache and longer TTL for better accuracy
|
|
102
|
-
*
|
|
103
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
104
|
-
* @param path - Database file path
|
|
105
|
-
* @returns Database configuration optimized for accuracy
|
|
106
|
-
*/
|
|
107
|
-
static highAccuracy(dimension, path) {
|
|
108
|
-
return {
|
|
109
|
-
path: path || undefined,
|
|
110
|
-
memoryMode: !path || path === ':memory:',
|
|
111
|
-
cacheSize: 1000,
|
|
112
|
-
walMode: true,
|
|
113
|
-
queryCache: {
|
|
114
|
-
enabled: true,
|
|
115
|
-
maxSize: 20000,
|
|
116
|
-
ttl: 1800000, // 30 minutes
|
|
117
|
-
enableStats: true
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Fast search preset
|
|
123
|
-
* Optimized for speed with minimal caching
|
|
124
|
-
*
|
|
125
|
-
* @param dimension - Vector dimension (for backward compatibility, not used)
|
|
126
|
-
* @param path - Database file path
|
|
127
|
-
* @returns Database configuration optimized for speed
|
|
128
|
-
*/
|
|
129
|
-
static fastSearch(dimension, path) {
|
|
130
|
-
return {
|
|
131
|
-
path: path || undefined,
|
|
132
|
-
memoryMode: !path || path === ':memory:',
|
|
133
|
-
cacheSize: 50, // Minimal cache
|
|
134
|
-
walMode: true,
|
|
135
|
-
queryCache: {
|
|
136
|
-
enabled: true,
|
|
137
|
-
maxSize: 100,
|
|
138
|
-
ttl: 10000, // 10 seconds
|
|
139
|
-
enableStats: false
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
exports.Presets = Presets;
|
|
145
|
-
//# sourceMappingURL=presets.js.map
|
package/dist/presets.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAIH,MAAa,OAAO;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAkB,EAAE,IAAa;QACnD,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,SAAS;YACvB,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU;YACxC,SAAS,EAAE,GAAG,EAAE,iCAAiC;YACjD,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,KAAK,EAAE,WAAW;gBACvB,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,aAAa,CAAC,SAAkB,EAAE,IAAa;QACpD,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,SAAS;YACvB,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU;YACxC,SAAS,EAAE,GAAG,EAAE,kCAAkC;YAClD,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,MAAM,EAAE,YAAY;gBACzB,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAkB,EAAE,IAAa;QACnD,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,SAAS;YACvB,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU;YACxC,SAAS,EAAE,IAAI,EAAE,+BAA+B;YAChD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU,EAAE,WAAW;YACjC,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,KAAK;gBACd,GAAG,EAAE,MAAM,EAAE,aAAa;gBAC1B,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAkB;QAChC,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,GAAG;YACd,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,GAAG;gBACZ,GAAG,EAAE,KAAK;gBACV,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAkB,EAAE,IAAa;QACnD,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,SAAS;YACvB,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU;YACxC,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,KAAK;gBACd,GAAG,EAAE,OAAO,EAAE,aAAa;gBAC3B,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,SAAkB,EAAE,IAAa;QACjD,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,SAAS;YACvB,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU;YACxC,SAAS,EAAE,EAAE,EAAE,gBAAgB;YAC/B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,GAAG;gBACZ,GAAG,EAAE,KAAK,EAAE,aAAa;gBACzB,WAAW,EAAE,KAAK;aACnB;SACF,CAAC;IACJ,CAAC;CACF;AAxID,0BAwIC"}
|