@weavelogic/knowledge-graph-agent 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +972 -303
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/additionalItems.js +5 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +5 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/ajv.js +6 -0
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/ajv2.js +5 -0
- package/dist/_virtual/ajv2.js.map +1 -0
- package/dist/_virtual/allOf.js +5 -0
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/anyOf.js +5 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/applicability.js +5 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/boolSchema.js +5 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/code.js +5 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +5 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/const.js +5 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/contains.js +5 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/core.js +5 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/dataType.js +5 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/defaults.js +5 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/dependencies.js +5 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/draft7.js +5 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/enum.js +5 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/equal.js +5 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/format.js +5 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/formats.js +5 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +5 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/if.js +5 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index12.js +5 -0
- package/dist/_virtual/index12.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +5 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +5 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2020.js +5 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/keyword.js +5 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/limit.js +5 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +5 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitLength.js +5 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitNumber.js +5 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitProperties.js +5 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/metadata.js +5 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/multipleOf.js +5 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/names.js +5 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/not.js +5 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/oneOf.js +5 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/pattern.js +5 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/patternProperties.js +5 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/prefixItems.js +5 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/properties.js +5 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/propertyNames.js +5 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/ref.js +5 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref_error.js +5 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/required.js +5 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/resolve.js +5 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/rules.js +5 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/scope.js +5 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/subschema.js +5 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/thenElse.js +5 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/types.js +5 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/ucs2length.js +5 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +5 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uri.js +5 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/util.js +5 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/validation_error.js +5 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/agents/analyst-agent.d.ts +230 -0
- package/dist/agents/analyst-agent.d.ts.map +1 -0
- package/dist/agents/analyst-agent.js +793 -0
- package/dist/agents/analyst-agent.js.map +1 -0
- package/dist/agents/architect-agent.d.ts +248 -0
- package/dist/agents/architect-agent.d.ts.map +1 -0
- package/dist/agents/architect-agent.js +685 -0
- package/dist/agents/architect-agent.js.map +1 -0
- package/dist/agents/base-agent.d.ts +169 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +441 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/coder-agent.d.ts +191 -0
- package/dist/agents/coder-agent.d.ts.map +1 -0
- package/dist/agents/coder-agent.js +1008 -0
- package/dist/agents/coder-agent.js.map +1 -0
- package/dist/agents/index.d.ts +18 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +40 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +213 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +419 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/researcher-agent.d.ts +226 -0
- package/dist/agents/researcher-agent.d.ts.map +1 -0
- package/dist/agents/researcher-agent.js +572 -0
- package/dist/agents/researcher-agent.js.map +1 -0
- package/dist/agents/rules-engine.d.ts +320 -0
- package/dist/agents/rules-engine.d.ts.map +1 -0
- package/dist/agents/rules-engine.js +552 -0
- package/dist/agents/rules-engine.js.map +1 -0
- package/dist/agents/tester-agent.d.ts +219 -0
- package/dist/agents/tester-agent.d.ts.map +1 -0
- package/dist/agents/tester-agent.js +683 -0
- package/dist/agents/tester-agent.js.map +1 -0
- package/dist/agents/types.d.ts +425 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +57 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/audit/config.d.ts +150 -0
- package/dist/audit/config.d.ts.map +1 -0
- package/dist/audit/config.js +111 -0
- package/dist/audit/config.js.map +1 -0
- package/dist/audit/index.d.ts +38 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.d.ts +276 -0
- package/dist/audit/services/audit-chain.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.js +502 -0
- package/dist/audit/services/audit-chain.js.map +1 -0
- package/dist/audit/services/index.d.ts +11 -0
- package/dist/audit/services/index.d.ts.map +1 -0
- package/dist/audit/services/syndication.d.ts +334 -0
- package/dist/audit/services/syndication.d.ts.map +1 -0
- package/dist/audit/services/syndication.js +589 -0
- package/dist/audit/services/syndication.js.map +1 -0
- package/dist/audit/types.d.ts +453 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/caching/index.d.ts +55 -0
- package/dist/caching/index.d.ts.map +1 -0
- package/dist/caching/index.js +206 -0
- package/dist/caching/index.js.map +1 -0
- package/dist/caching/lru-cache.d.ts +254 -0
- package/dist/caching/lru-cache.d.ts.map +1 -0
- package/dist/caching/types.d.ts +95 -0
- package/dist/caching/types.d.ts.map +1 -0
- package/dist/chunking/chunker.d.ts +94 -0
- package/dist/chunking/chunker.d.ts.map +1 -0
- package/dist/chunking/index.d.ts +125 -0
- package/dist/chunking/index.d.ts.map +1 -0
- package/dist/chunking/index.js +283 -0
- package/dist/chunking/index.js.map +1 -0
- package/dist/chunking/types.d.ts +92 -0
- package/dist/chunking/types.d.ts.map +1 -0
- package/dist/cli/commands/audit.d.ts +21 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +621 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/commit.d.ts +11 -0
- package/dist/cli/commands/commit.d.ts.map +1 -0
- package/dist/cli/commands/commit.js +379 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/config.d.ts +8 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +107 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/cultivate.d.ts +16 -0
- package/dist/cli/commands/cultivate.d.ts.map +1 -0
- package/dist/cli/commands/cultivate.js +254 -0
- package/dist/cli/commands/cultivate.js.map +1 -0
- package/dist/cli/commands/diagnostics.d.ts +8 -0
- package/dist/cli/commands/diagnostics.d.ts.map +1 -0
- package/dist/cli/commands/diagnostics.js +140 -0
- package/dist/cli/commands/diagnostics.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +13 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.d.ts +19 -0
- package/dist/cli/commands/init-primitives.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.js +208 -0
- package/dist/cli/commands/init-primitives.js.map +1 -0
- package/dist/cli/commands/sop.d.ts +14 -0
- package/dist/cli/commands/sop.d.ts.map +1 -0
- package/dist/cli/commands/sop.js +598 -0
- package/dist/cli/commands/sop.js.map +1 -0
- package/dist/cli/commands/vector.d.ts +14 -0
- package/dist/cli/commands/vector.d.ts.map +1 -0
- package/dist/cli/commands/vector.js +429 -0
- package/dist/cli/commands/vector.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +12 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +471 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +66 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +153 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +141 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manager.d.ts +136 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/types.d.ts +127 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/core/cache.d.ts +185 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +435 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/cultivation/deep-analyzer.d.ts +129 -0
- package/dist/cultivation/deep-analyzer.d.ts.map +1 -0
- package/dist/cultivation/deep-analyzer.js +322 -0
- package/dist/cultivation/deep-analyzer.js.map +1 -0
- package/dist/cultivation/index.d.ts +13 -0
- package/dist/cultivation/index.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.d.ts +92 -0
- package/dist/cultivation/seed-generator.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.js +1033 -0
- package/dist/cultivation/seed-generator.js.map +1 -0
- package/dist/cultivation/types.d.ts +230 -0
- package/dist/cultivation/types.d.ts.map +1 -0
- package/dist/database/schemas/index.d.ts +85 -0
- package/dist/database/schemas/index.d.ts.map +1 -0
- package/dist/generators/claude-md.d.ts +7 -0
- package/dist/generators/claude-md.d.ts.map +1 -1
- package/dist/generators/claude-md.js.map +1 -1
- package/dist/generators/docs-init.d.ts +6 -0
- package/dist/generators/docs-init.d.ts.map +1 -1
- package/dist/generators/docs-init.js.map +1 -1
- package/dist/health/checks.d.ts +135 -0
- package/dist/health/checks.d.ts.map +1 -0
- package/dist/health/index.d.ts +119 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +191 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/monitor.d.ts +146 -0
- package/dist/health/monitor.d.ts.map +1 -0
- package/dist/health/types.d.ts +135 -0
- package/dist/health/types.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +182 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/auto-commit.d.ts +175 -0
- package/dist/integrations/auto-commit.d.ts.map +1 -0
- package/dist/integrations/auto-commit.js +399 -0
- package/dist/integrations/auto-commit.js.map +1 -0
- package/dist/integrations/git.d.ts +299 -0
- package/dist/integrations/git.d.ts.map +1 -0
- package/dist/integrations/git.js +465 -0
- package/dist/integrations/git.js.map +1 -0
- package/dist/mcp-server/bin.d.ts +11 -0
- package/dist/mcp-server/bin.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.d.ts +57 -0
- package/dist/mcp-server/handlers/index.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.js +235 -0
- package/dist/mcp-server/handlers/index.js.map +1 -0
- package/dist/mcp-server/index.d.ts +28 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/server.d.ts +133 -0
- package/dist/mcp-server/server.d.ts.map +1 -0
- package/dist/mcp-server/server.js +280 -0
- package/dist/mcp-server/server.js.map +1 -0
- package/dist/mcp-server/tools/agents/index.d.ts +10 -0
- package/dist/mcp-server/tools/agents/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/list.d.ts +19 -0
- package/dist/mcp-server/tools/agents/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts +19 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/checkpoint.d.ts +58 -0
- package/dist/mcp-server/tools/audit/checkpoint.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/checkpoint.js +73 -0
- package/dist/mcp-server/tools/audit/checkpoint.js.map +1 -0
- package/dist/mcp-server/tools/audit/index.d.ts +53 -0
- package/dist/mcp-server/tools/audit/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/index.js +12 -0
- package/dist/mcp-server/tools/audit/index.js.map +1 -0
- package/dist/mcp-server/tools/audit/query.d.ts +58 -0
- package/dist/mcp-server/tools/audit/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/query.js +125 -0
- package/dist/mcp-server/tools/audit/query.js.map +1 -0
- package/dist/mcp-server/tools/audit/sync.d.ts +58 -0
- package/dist/mcp-server/tools/audit/sync.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/sync.js +126 -0
- package/dist/mcp-server/tools/audit/sync.js.map +1 -0
- package/dist/mcp-server/tools/graph/generate.d.ts +21 -0
- package/dist/mcp-server/tools/graph/generate.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/index.d.ts +11 -0
- package/dist/mcp-server/tools/graph/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/query.d.ts +22 -0
- package/dist/mcp-server/tools/graph/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/stats.d.ts +22 -0
- package/dist/mcp-server/tools/graph/stats.d.ts.map +1 -0
- package/dist/mcp-server/tools/health.d.ts +21 -0
- package/dist/mcp-server/tools/health.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +16 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.d.ts +90 -0
- package/dist/mcp-server/tools/registry.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.js +753 -0
- package/dist/mcp-server/tools/registry.js.map +1 -0
- package/dist/mcp-server/tools/search/index.d.ts +10 -0
- package/dist/mcp-server/tools/search/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/nodes.d.ts +22 -0
- package/dist/mcp-server/tools/search/nodes.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/tags.d.ts +22 -0
- package/dist/mcp-server/tools/search/tags.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/index.d.ts +12 -0
- package/dist/mcp-server/tools/vector/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/index.js +12 -0
- package/dist/mcp-server/tools/vector/index.js.map +1 -0
- package/dist/mcp-server/tools/vector/search.d.ts +41 -0
- package/dist/mcp-server/tools/vector/search.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/search.js +224 -0
- package/dist/mcp-server/tools/vector/search.js.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts +39 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.js +170 -0
- package/dist/mcp-server/tools/vector/trajectory.js.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts +44 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.js +175 -0
- package/dist/mcp-server/tools/vector/upsert.js.map +1 -0
- package/dist/mcp-server/tools/workflow/index.d.ts +29 -0
- package/dist/mcp-server/tools/workflow/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/index.js +12 -0
- package/dist/mcp-server/tools/workflow/index.js.map +1 -0
- package/dist/mcp-server/tools/workflow/list.d.ts +41 -0
- package/dist/mcp-server/tools/workflow/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/list.js +195 -0
- package/dist/mcp-server/tools/workflow/list.js.map +1 -0
- package/dist/mcp-server/tools/workflow/start.d.ts +40 -0
- package/dist/mcp-server/tools/workflow/start.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/start.js +165 -0
- package/dist/mcp-server/tools/workflow/start.js.map +1 -0
- package/dist/mcp-server/tools/workflow/status.d.ts +38 -0
- package/dist/mcp-server/tools/workflow/status.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/status.js +97 -0
- package/dist/mcp-server/tools/workflow/status.js.map +1 -0
- package/dist/mcp-server/types/index.d.ts +286 -0
- package/dist/mcp-server/types/index.d.ts.map +1 -0
- package/dist/memory/index.d.ts +10 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/vault-sync.d.ts +212 -0
- package/dist/memory/vault-sync.d.ts.map +1 -0
- package/dist/memory/vault-sync.js +463 -0
- package/dist/memory/vault-sync.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +296 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +26 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +407 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1332 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/ajv/dist/ajv.js +84 -0
- package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +160 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +728 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +152 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/errors.js +131 -0
- package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +234 -0
- package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/names.js +44 -0
- package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js +22 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js +163 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/rules.js +35 -0
- package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/util.js +173 -0
- package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +27 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +58 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +193 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +43 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js +522 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +126 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +89 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/ajv/dist/core.js +628 -0
- package/dist/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js +24 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +25 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +30 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +20 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +59 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +32 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +100 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +103 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +68 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +43 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +81 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +66 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +49 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +23 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js +140 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +132 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +18 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +31 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +95 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +16 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +56 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +52 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +39 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +37 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +33 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +89 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/formats.js +209 -0
- package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/index.js +51 -0
- package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/limit.js +80 -0
- package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/fast-deep-equal/index.js +39 -0
- package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/fast-uri/index.js +261 -0
- package/dist/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +215 -0
- package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/utils.js +261 -0
- package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/json-schema-traverse/index.js +92 -0
- package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.js +37 -0
- package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.js +43 -0
- package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.js +13 -0
- package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.js +688 -0
- package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/api.js +492 -0
- package/dist/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.js +405 -0
- package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/zod/v4/core/core.js +58 -0
- package/dist/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.js +82 -0
- package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.js +60 -0
- package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.js +87 -0
- package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.js +1283 -0
- package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/util.js +341 -0
- package/dist/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.js +9 -0
- package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +2 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/reasoning/index.d.ts +74 -0
- package/dist/reasoning/index.d.ts.map +1 -0
- package/dist/reasoning/index.js +124 -0
- package/dist/reasoning/index.js.map +1 -0
- package/dist/reasoning/tracker.d.ts +210 -0
- package/dist/reasoning/tracker.d.ts.map +1 -0
- package/dist/reasoning/types.d.ts +146 -0
- package/dist/reasoning/types.d.ts.map +1 -0
- package/dist/recovery/backup.d.ts +110 -0
- package/dist/recovery/backup.d.ts.map +1 -0
- package/dist/recovery/index.d.ts +70 -0
- package/dist/recovery/index.d.ts.map +1 -0
- package/dist/recovery/index.js +186 -0
- package/dist/recovery/index.js.map +1 -0
- package/dist/recovery/integrity.d.ts +74 -0
- package/dist/recovery/integrity.d.ts.map +1 -0
- package/dist/recovery/types.d.ts +94 -0
- package/dist/recovery/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +130 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +134 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/manager.d.ts +140 -0
- package/dist/services/manager.d.ts.map +1 -0
- package/dist/services/types.d.ts +106 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/services/watchers.d.ts +95 -0
- package/dist/services/watchers.d.ts.map +1 -0
- package/dist/sops/compliance-checker.d.ts +83 -0
- package/dist/sops/compliance-checker.d.ts.map +1 -0
- package/dist/sops/compliance-checker.js +399 -0
- package/dist/sops/compliance-checker.js.map +1 -0
- package/dist/sops/gap-analyzer.d.ts +124 -0
- package/dist/sops/gap-analyzer.d.ts.map +1 -0
- package/dist/sops/gap-analyzer.js +313 -0
- package/dist/sops/gap-analyzer.js.map +1 -0
- package/dist/sops/index.d.ts +14 -0
- package/dist/sops/index.d.ts.map +1 -0
- package/dist/sops/overlay-manager.d.ts +115 -0
- package/dist/sops/overlay-manager.d.ts.map +1 -0
- package/dist/sops/overlay-manager.js +394 -0
- package/dist/sops/overlay-manager.js.map +1 -0
- package/dist/sops/registry.d.ts +73 -0
- package/dist/sops/registry.d.ts.map +1 -0
- package/dist/sops/registry.js +919 -0
- package/dist/sops/registry.js.map +1 -0
- package/dist/sops/types.d.ts +377 -0
- package/dist/sops/types.d.ts.map +1 -0
- package/dist/sops/types.js +46 -0
- package/dist/sops/types.js.map +1 -0
- package/dist/utils/error-recovery.d.ts +230 -0
- package/dist/utils/error-recovery.d.ts.map +1 -0
- package/dist/utils/error-recovery.js +228 -0
- package/dist/utils/error-recovery.js.map +1 -0
- package/dist/utils/error-taxonomy.d.ts +149 -0
- package/dist/utils/error-taxonomy.d.ts.map +1 -0
- package/dist/utils/error-taxonomy.js +260 -0
- package/dist/utils/error-taxonomy.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +139 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +311 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/vector/config.d.ts +300 -0
- package/dist/vector/config.d.ts.map +1 -0
- package/dist/vector/config.js +124 -0
- package/dist/vector/config.js.map +1 -0
- package/dist/vector/index.d.ts +50 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/services/index.d.ts +13 -0
- package/dist/vector/services/index.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.d.ts +405 -0
- package/dist/vector/services/trajectory-tracker.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.js +445 -0
- package/dist/vector/services/trajectory-tracker.js.map +1 -0
- package/dist/vector/services/vector-store.d.ts +339 -0
- package/dist/vector/services/vector-store.d.ts.map +1 -0
- package/dist/vector/services/vector-store.js +748 -0
- package/dist/vector/services/vector-store.js.map +1 -0
- package/dist/vector/types.d.ts +677 -0
- package/dist/vector/types.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.d.ts +196 -0
- package/dist/workflow/adapters/goap-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.js +706 -0
- package/dist/workflow/adapters/goap-adapter.js.map +1 -0
- package/dist/workflow/adapters/index.d.ts +10 -0
- package/dist/workflow/adapters/index.d.ts.map +1 -0
- package/dist/workflow/config.d.ts +135 -0
- package/dist/workflow/config.d.ts.map +1 -0
- package/dist/workflow/config.js +92 -0
- package/dist/workflow/config.js.map +1 -0
- package/dist/workflow/handlers/index.d.ts +9 -0
- package/dist/workflow/handlers/index.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts +397 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.js +454 -0
- package/dist/workflow/handlers/webhook-handlers.js.map +1 -0
- package/dist/workflow/index.d.ts +42 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/services/index.d.ts +9 -0
- package/dist/workflow/services/index.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.d.ts +318 -0
- package/dist/workflow/services/workflow-service.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.js +577 -0
- package/dist/workflow/services/workflow-service.js.map +1 -0
- package/dist/workflow/types.d.ts +470 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/workflows/realtime-collab.d.ts +245 -0
- package/dist/workflow/workflows/realtime-collab.d.ts.map +1 -0
- package/dist/workflows/index.d.ts +11 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/registry.d.ts +118 -0
- package/dist/workflows/registry.d.ts.map +1 -0
- package/dist/workflows/registry.js +575 -0
- package/dist/workflows/registry.js.map +1 -0
- package/dist/workflows/types.d.ts +322 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +16 -0
- package/dist/workflows/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const DEFAULT_HNSW_CONFIG = {
|
|
2
|
+
m: 16,
|
|
3
|
+
efConstruction: 200,
|
|
4
|
+
efSearch: 100
|
|
5
|
+
};
|
|
6
|
+
const DEFAULT_INDEX_CONFIG = {
|
|
7
|
+
dimensions: 1536,
|
|
8
|
+
distanceMetric: "cosine",
|
|
9
|
+
indexType: "hnsw",
|
|
10
|
+
hnswConfig: DEFAULT_HNSW_CONFIG
|
|
11
|
+
};
|
|
12
|
+
function createRuVectorConfig() {
|
|
13
|
+
const backend = process.env.RUVECTOR_BACKEND || "memory";
|
|
14
|
+
const dimensions = parseInt(process.env.RUVECTOR_DIMENSIONS || "384", 10);
|
|
15
|
+
const baseConfig = {
|
|
16
|
+
backend,
|
|
17
|
+
index: {
|
|
18
|
+
...DEFAULT_INDEX_CONFIG,
|
|
19
|
+
dimensions
|
|
20
|
+
},
|
|
21
|
+
enableSona: process.env.RUVECTOR_ENABLE_SONA === "true",
|
|
22
|
+
enableTrajectoryTracking: process.env.RUVECTOR_ENABLE_TRAJECTORY === "true"
|
|
23
|
+
};
|
|
24
|
+
switch (backend) {
|
|
25
|
+
case "postgres":
|
|
26
|
+
return {
|
|
27
|
+
...baseConfig,
|
|
28
|
+
postgres: {
|
|
29
|
+
connectionString: process.env.DATABASE_URL || "postgres://localhost:5432/kg_agent",
|
|
30
|
+
schema: process.env.RUVECTOR_SCHEMA || "ruvector"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
case "cloud":
|
|
34
|
+
return {
|
|
35
|
+
...baseConfig,
|
|
36
|
+
cloud: {
|
|
37
|
+
url: process.env.RUVECTOR_CLOUD_URL || "",
|
|
38
|
+
apiKey: process.env.RUVECTOR_API_KEY
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
case "standalone":
|
|
42
|
+
return {
|
|
43
|
+
...baseConfig,
|
|
44
|
+
standalone: {
|
|
45
|
+
dataDir: process.env.RUVECTOR_DATA_DIR || ".ruvector"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
default:
|
|
49
|
+
return baseConfig;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function validateRuVectorConfig(config) {
|
|
53
|
+
const errors = [];
|
|
54
|
+
const warnings = [];
|
|
55
|
+
if (config.index.dimensions < 1) {
|
|
56
|
+
errors.push("Dimensions must be at least 1");
|
|
57
|
+
}
|
|
58
|
+
if (config.index.dimensions > 4096) {
|
|
59
|
+
warnings.push("Dimensions > 4096 may impact performance");
|
|
60
|
+
}
|
|
61
|
+
if (!Number.isInteger(config.index.dimensions)) {
|
|
62
|
+
errors.push("Vector dimensions must be an integer");
|
|
63
|
+
}
|
|
64
|
+
if (config.backend === "postgres" && !config.postgres?.connectionString) {
|
|
65
|
+
errors.push("PostgreSQL connection string required for postgres backend");
|
|
66
|
+
}
|
|
67
|
+
if (config.backend === "cloud" && !config.cloud?.url) {
|
|
68
|
+
errors.push("Cloud URL required for cloud backend");
|
|
69
|
+
}
|
|
70
|
+
if (config.backend === "standalone" && !config.standalone?.dataDir) {
|
|
71
|
+
errors.push("Data directory required for standalone backend");
|
|
72
|
+
}
|
|
73
|
+
if (config.index.indexType === "hnsw" && config.index.hnswConfig) {
|
|
74
|
+
const { m, efConstruction, efSearch } = config.index.hnswConfig;
|
|
75
|
+
if (m < 2 || m > 100) {
|
|
76
|
+
errors.push("HNSW m must be between 2 and 100");
|
|
77
|
+
}
|
|
78
|
+
if (efConstruction < m) {
|
|
79
|
+
warnings.push("efConstruction should be >= m for good index quality");
|
|
80
|
+
}
|
|
81
|
+
if (efSearch < 10) {
|
|
82
|
+
warnings.push("efSearch < 10 may result in poor recall");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (config.cache?.enabled) {
|
|
86
|
+
if (config.cache.maxSize < 1) {
|
|
87
|
+
errors.push("Cache maxSize must be at least 1");
|
|
88
|
+
}
|
|
89
|
+
if (config.cache.ttlSeconds < 1) {
|
|
90
|
+
errors.push("Cache TTL must be at least 1 second");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (config.performance) {
|
|
94
|
+
if (config.performance.batchSize < 1) {
|
|
95
|
+
errors.push("Batch size must be at least 1");
|
|
96
|
+
}
|
|
97
|
+
if (config.performance.maxConcurrency < 1) {
|
|
98
|
+
errors.push("Max concurrency must be at least 1");
|
|
99
|
+
}
|
|
100
|
+
if (config.performance.memoryLimitMb && config.performance.memoryLimitMb < 64) {
|
|
101
|
+
warnings.push("Memory limit < 64MB may cause issues");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (config.hybrid?.enabled && !config.hybrid.graphConnection) {
|
|
105
|
+
warnings.push("Hybrid search enabled but no graph connection configured");
|
|
106
|
+
}
|
|
107
|
+
const validMetrics = ["cosine", "euclidean", "dotProduct", "manhattan"];
|
|
108
|
+
if (!validMetrics.includes(config.index.distanceMetric)) {
|
|
109
|
+
errors.push(`Invalid distance metric: ${config.index.distanceMetric}`);
|
|
110
|
+
}
|
|
111
|
+
const validIndexTypes = ["hnsw", "flat", "ivf", "pq"];
|
|
112
|
+
if (!validIndexTypes.includes(config.index.indexType)) {
|
|
113
|
+
errors.push(`Invalid index type: ${config.index.indexType}`);
|
|
114
|
+
}
|
|
115
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
116
|
+
}
|
|
117
|
+
createRuVectorConfig();
|
|
118
|
+
export {
|
|
119
|
+
DEFAULT_HNSW_CONFIG,
|
|
120
|
+
DEFAULT_INDEX_CONFIG,
|
|
121
|
+
createRuVectorConfig,
|
|
122
|
+
validateRuVectorConfig
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../src/vector/config.ts"],"sourcesContent":["/**\n * Vector Configuration\n *\n * Configuration types and defaults for RuVector-compatible vector storage.\n * Supports multiple backends (memory, postgres, standalone) with HNSW indexing.\n *\n * @module vector/config\n */\n\nimport type { DistanceMetric, IndexType, VectorIndexConfig } from './types.js';\n\n/**\n * Backend storage type for vectors\n */\nexport type VectorBackend = 'memory' | 'postgres' | 'standalone' | 'sqlite' | 'cloud';\n\n/**\n * HNSW (Hierarchical Navigable Small World) index configuration\n *\n * HNSW provides fast approximate nearest neighbor search with\n * configurable accuracy/speed tradeoffs.\n */\nexport interface HNSWConfig {\n /**\n * Maximum number of connections per layer\n * Higher values improve recall but increase memory usage\n * @default 16\n */\n m: number;\n\n /**\n * Size of dynamic candidate list for construction\n * Higher values improve index quality but slow down construction\n * @default 200\n */\n efConstruction: number;\n\n /**\n * Size of dynamic candidate list for search\n * Higher values improve recall but slow down search\n * @default 100\n */\n efSearch: number;\n}\n\n/**\n * Re-export VectorIndexConfig from types for convenience\n */\nexport type { VectorIndexConfig } from './types.js';\n\n/**\n * PostgreSQL backend configuration\n */\nexport interface PostgresBackendConfig {\n /**\n * PostgreSQL connection string\n * @example 'postgres://user:pass@localhost:5432/dbname'\n */\n connectionString: string;\n\n /**\n * Database schema for vector tables\n * @default 'ruvector'\n */\n schema: string;\n}\n\n/**\n * Cloud backend configuration\n */\nexport interface CloudBackendConfig {\n /**\n * Cloud vector database endpoint URL\n */\n url: string;\n\n /**\n * API key for authentication\n */\n apiKey?: string;\n}\n\n/**\n * Standalone backend configuration\n */\nexport interface StandaloneBackendConfig {\n /**\n * Directory for vector data storage\n * @default '.ruvector'\n */\n dataDir: string;\n}\n\n/**\n * RuVector configuration\n *\n * Main configuration interface for the vector database system.\n */\nexport interface RuVectorConfig {\n /**\n * Storage backend type\n */\n backend: VectorBackend;\n\n /**\n * Vector index configuration\n */\n index: VectorIndexConfig;\n\n /**\n * PostgreSQL connection configuration\n * Required when backend is 'postgres'\n */\n postgres?: PostgresBackendConfig;\n\n /**\n * Cloud endpoint configuration\n * Required when backend is 'cloud'\n */\n cloud?: CloudBackendConfig;\n\n /**\n * Standalone file path configuration\n * Required when backend is 'standalone'\n */\n standalone?: StandaloneBackendConfig;\n\n /**\n * Enable self-learning SONA (Self-Optimizing Neural Architecture) engine\n * When enabled, the system learns from agent trajectories to improve performance\n * @default false\n */\n enableSona?: boolean;\n\n /**\n * Enable trajectory tracking for agents\n * Records agent actions for analysis and learning\n * @default false\n */\n enableTrajectoryTracking?: boolean;\n\n /**\n * Cache configuration\n */\n cache?: {\n /** Enable result caching */\n enabled: boolean;\n /** Maximum cache size in entries */\n maxSize: number;\n /** Cache TTL in seconds */\n ttlSeconds: number;\n };\n\n /**\n * Performance tuning\n */\n performance?: {\n /** Batch size for bulk operations */\n batchSize: number;\n /** Enable parallel processing */\n parallelProcessing: boolean;\n /** Maximum concurrent operations */\n maxConcurrency: number;\n /** Memory limit in MB for index */\n memoryLimitMb?: number;\n };\n\n /**\n * Hybrid search configuration\n */\n hybrid?: {\n /** Enable hybrid search */\n enabled: boolean;\n /** Default vector weight (0-1) */\n defaultVectorWeight: number;\n /** Graph database connection (for Cypher queries) */\n graphConnection?: {\n type: 'neo4j' | 'memgraph' | 'sqlite';\n uri?: string;\n database?: string;\n auth?: {\n user: string;\n password: string;\n };\n };\n };\n\n /**\n * Namespace configuration for multi-tenant support\n */\n namespace?: {\n /** Default namespace */\n defaultNamespace: string;\n /** Namespace isolation level */\n isolation: 'soft' | 'hard';\n };\n}\n\n/**\n * Default HNSW configuration\n * Balanced settings for most use cases\n */\nexport const DEFAULT_HNSW_CONFIG: HNSWConfig = {\n m: 16,\n efConstruction: 200,\n efSearch: 100,\n};\n\n/**\n * Default vector index configuration\n * Optimized for OpenAI/Claude embeddings (1536 dimensions)\n */\nexport const DEFAULT_INDEX_CONFIG: VectorIndexConfig = {\n dimensions: 1536,\n distanceMetric: 'cosine',\n indexType: 'hnsw',\n hnswConfig: DEFAULT_HNSW_CONFIG,\n};\n\n/**\n * Default cache configuration\n */\nexport const DEFAULT_CACHE_CONFIG = {\n enabled: true,\n maxSize: 1000,\n ttlSeconds: 300, // 5 minutes\n} as const;\n\n/**\n * Default performance configuration\n */\nexport const DEFAULT_PERFORMANCE_CONFIG = {\n batchSize: 100,\n parallelProcessing: true,\n maxConcurrency: 4,\n} as const;\n\n/**\n * Create RuVector configuration from environment variables\n *\n * Reads configuration from the following environment variables:\n * - RUVECTOR_BACKEND: Storage backend type (default: 'memory')\n * - RUVECTOR_DIMENSIONS: Vector dimensions (default: 384)\n * - RUVECTOR_ENABLE_SONA: Enable SONA learning (default: false)\n * - RUVECTOR_ENABLE_TRAJECTORY: Enable trajectory tracking (default: false)\n * - DATABASE_URL: PostgreSQL connection string (for postgres backend)\n * - RUVECTOR_SCHEMA: PostgreSQL schema (default: 'ruvector')\n * - RUVECTOR_CLOUD_URL: Cloud endpoint URL (for cloud backend)\n * - RUVECTOR_API_KEY: Cloud API key (for cloud backend)\n * - RUVECTOR_DATA_DIR: Data directory (for standalone backend)\n *\n * @returns RuVectorConfig configured from environment\n *\n * @example\n * ```typescript\n * // Set environment variables\n * process.env.RUVECTOR_BACKEND = 'postgres';\n * process.env.DATABASE_URL = 'postgres://localhost:5432/mydb';\n *\n * // Create configuration\n * const config = createRuVectorConfig();\n * ```\n */\nexport function createRuVectorConfig(): RuVectorConfig {\n const backend = (process.env.RUVECTOR_BACKEND || 'memory') as VectorBackend;\n const dimensions = parseInt(process.env.RUVECTOR_DIMENSIONS || '384', 10);\n\n const baseConfig: RuVectorConfig = {\n backend,\n index: {\n ...DEFAULT_INDEX_CONFIG,\n dimensions,\n },\n enableSona: process.env.RUVECTOR_ENABLE_SONA === 'true',\n enableTrajectoryTracking: process.env.RUVECTOR_ENABLE_TRAJECTORY === 'true',\n };\n\n switch (backend) {\n case 'postgres':\n return {\n ...baseConfig,\n postgres: {\n connectionString:\n process.env.DATABASE_URL || 'postgres://localhost:5432/kg_agent',\n schema: process.env.RUVECTOR_SCHEMA || 'ruvector',\n },\n };\n case 'cloud':\n return {\n ...baseConfig,\n cloud: {\n url: process.env.RUVECTOR_CLOUD_URL || '',\n apiKey: process.env.RUVECTOR_API_KEY,\n },\n };\n case 'standalone':\n return {\n ...baseConfig,\n standalone: {\n dataDir: process.env.RUVECTOR_DATA_DIR || '.ruvector',\n },\n };\n default:\n return baseConfig;\n }\n}\n\n/**\n * Validation result for RuVector configuration\n */\nexport interface ConfigValidationResult {\n /**\n * Whether the configuration is valid\n */\n valid: boolean;\n\n /**\n * List of validation errors (empty if valid)\n */\n errors: string[];\n\n /**\n * List of validation warnings\n */\n warnings: string[];\n}\n\n/**\n * Legacy alias for backwards compatibility\n */\nexport type ValidationResult = ConfigValidationResult;\n\n/**\n * Validate RuVector configuration\n *\n * Checks that all required fields are present and valid based on\n * the selected backend type.\n *\n * @param config - Configuration to validate\n * @returns Validation result with errors if invalid\n *\n * @example\n * ```typescript\n * const config = createRuVectorConfig();\n * const result = validateRuVectorConfig(config);\n *\n * if (!result.valid) {\n * console.error('Configuration errors:', result.errors);\n * process.exit(1);\n * }\n * ```\n */\nexport function validateRuVectorConfig(config: RuVectorConfig): ConfigValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n // Validate dimensions\n if (config.index.dimensions < 1) {\n errors.push('Dimensions must be at least 1');\n }\n if (config.index.dimensions > 4096) {\n warnings.push('Dimensions > 4096 may impact performance');\n }\n\n if (!Number.isInteger(config.index.dimensions)) {\n errors.push('Vector dimensions must be an integer');\n }\n\n // Validate backend-specific configuration\n if (config.backend === 'postgres' && !config.postgres?.connectionString) {\n errors.push('PostgreSQL connection string required for postgres backend');\n }\n\n if (config.backend === 'cloud' && !config.cloud?.url) {\n errors.push('Cloud URL required for cloud backend');\n }\n\n if (config.backend === 'standalone' && !config.standalone?.dataDir) {\n errors.push('Data directory required for standalone backend');\n }\n\n // Validate HNSW configuration\n if (config.index.indexType === 'hnsw' && config.index.hnswConfig) {\n const { m, efConstruction, efSearch } = config.index.hnswConfig;\n\n if (m < 2 || m > 100) {\n errors.push('HNSW m must be between 2 and 100');\n }\n\n if (efConstruction < m) {\n warnings.push('efConstruction should be >= m for good index quality');\n }\n\n if (efSearch < 10) {\n warnings.push('efSearch < 10 may result in poor recall');\n }\n }\n\n // Validate cache config\n if (config.cache?.enabled) {\n if (config.cache.maxSize < 1) {\n errors.push('Cache maxSize must be at least 1');\n }\n if (config.cache.ttlSeconds < 1) {\n errors.push('Cache TTL must be at least 1 second');\n }\n }\n\n // Validate performance config\n if (config.performance) {\n if (config.performance.batchSize < 1) {\n errors.push('Batch size must be at least 1');\n }\n if (config.performance.maxConcurrency < 1) {\n errors.push('Max concurrency must be at least 1');\n }\n if (config.performance.memoryLimitMb && config.performance.memoryLimitMb < 64) {\n warnings.push('Memory limit < 64MB may cause issues');\n }\n }\n\n // Validate hybrid config\n if (config.hybrid?.enabled && !config.hybrid.graphConnection) {\n warnings.push('Hybrid search enabled but no graph connection configured');\n }\n\n // Validate distance metric\n const validMetrics: DistanceMetric[] = ['cosine', 'euclidean', 'dotProduct', 'manhattan'];\n if (!validMetrics.includes(config.index.distanceMetric)) {\n errors.push(`Invalid distance metric: ${config.index.distanceMetric}`);\n }\n\n // Validate index type\n const validIndexTypes = ['hnsw', 'flat', 'ivf', 'pq'];\n if (!validIndexTypes.includes(config.index.indexType)) {\n errors.push(`Invalid index type: ${config.index.indexType}`);\n }\n\n return { valid: errors.length === 0, errors, warnings };\n}\n\n/**\n * Default configuration instance\n * Created from environment variables at module load time\n */\nexport const defaultConfig = createRuVectorConfig();\n\n/**\n * Create configuration for high-performance scenarios\n *\n * Optimized for large-scale deployments with many vectors\n */\nexport function createHighPerformanceConfig(\n dimensions: number = 1536\n): RuVectorConfig {\n return {\n ...createRuVectorConfig(),\n backend: 'memory',\n index: {\n dimensions,\n indexType: 'hnsw',\n distanceMetric: 'cosine',\n hnswConfig: {\n m: 32, // More connections for better recall\n efConstruction: 400, // Higher quality index\n efSearch: 200, // Better search accuracy\n },\n },\n cache: {\n enabled: true,\n maxSize: 10000,\n ttlSeconds: 600,\n },\n performance: {\n batchSize: 500,\n parallelProcessing: true,\n maxConcurrency: 8,\n },\n };\n}\n\n/**\n * Create configuration for memory-constrained environments\n *\n * Optimized for minimal memory usage\n */\nexport function createLowMemoryConfig(\n dimensions: number = 1536\n): RuVectorConfig {\n return {\n ...createRuVectorConfig(),\n backend: 'memory',\n index: {\n dimensions,\n indexType: 'hnsw',\n distanceMetric: 'cosine',\n hnswConfig: {\n m: 8, // Fewer connections\n efConstruction: 100, // Faster construction\n efSearch: 50, // Faster search\n },\n },\n cache: {\n enabled: false,\n maxSize: 100,\n ttlSeconds: 60,\n },\n performance: {\n batchSize: 50,\n parallelProcessing: false,\n maxConcurrency: 2,\n memoryLimitMb: 256,\n },\n };\n}\n\n/**\n * Create configuration for hybrid search with graph integration\n */\nexport function createHybridSearchConfig(\n dimensions: number = 1536,\n graphType: 'neo4j' | 'memgraph' | 'sqlite' = 'sqlite'\n): RuVectorConfig {\n return {\n ...createRuVectorConfig(),\n backend: 'memory',\n index: {\n dimensions,\n indexType: 'hnsw',\n distanceMetric: 'cosine',\n hnswConfig: DEFAULT_HNSW_CONFIG,\n },\n hybrid: {\n enabled: true,\n defaultVectorWeight: 0.7,\n graphConnection: {\n type: graphType,\n },\n },\n };\n}\n\n/**\n * Get recommended configuration based on vector count\n *\n * @param estimatedVectorCount - Estimated number of vectors to store\n * @param dimensions - Vector dimensions\n * @returns Recommended configuration\n */\nexport function getRecommendedConfig(\n estimatedVectorCount: number,\n dimensions: number = 1536\n): RuVectorConfig {\n if (estimatedVectorCount < 1000) {\n // Small scale - flat index is fine\n return createLowMemoryConfig(dimensions);\n } else if (estimatedVectorCount < 100000) {\n // Medium scale - standard HNSW\n return {\n ...createRuVectorConfig(),\n index: { ...DEFAULT_INDEX_CONFIG, dimensions },\n };\n } else {\n // Large scale - optimized HNSW\n return createHighPerformanceConfig(dimensions);\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vector Module
|
|
3
|
+
*
|
|
4
|
+
* Exports all vector-related functionality for the knowledge-graph-agent.
|
|
5
|
+
* This module provides configuration, types, services, and utilities for working
|
|
6
|
+
* with vector embeddings, similarity search, and agent trajectory tracking.
|
|
7
|
+
*
|
|
8
|
+
* @module vector
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import {
|
|
13
|
+
* createRuVectorConfig,
|
|
14
|
+
* validateRuVectorConfig,
|
|
15
|
+
* createVectorStore,
|
|
16
|
+
* createTrajectoryTracker,
|
|
17
|
+
* type VectorEntry,
|
|
18
|
+
* type SearchResult,
|
|
19
|
+
* type HybridSearchQuery,
|
|
20
|
+
* } from './vector/index.js';
|
|
21
|
+
*
|
|
22
|
+
* // Create and validate configuration
|
|
23
|
+
* const config = createRuVectorConfig();
|
|
24
|
+
* const validation = validateRuVectorConfig(config);
|
|
25
|
+
*
|
|
26
|
+
* if (!validation.valid) {
|
|
27
|
+
* throw new Error(`Invalid config: ${validation.errors.join(', ')}`);
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* // Create a trajectory tracker for agent operations
|
|
31
|
+
* const tracker = createTrajectoryTracker({
|
|
32
|
+
* maxTrajectories: 1000,
|
|
33
|
+
* enableAutoLearning: true,
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Track agent operations
|
|
37
|
+
* const trajectoryId = tracker.startTrajectory('agent-1');
|
|
38
|
+
* tracker.addStep(trajectoryId, {
|
|
39
|
+
* action: 'search',
|
|
40
|
+
* state: { query: 'example' },
|
|
41
|
+
* outcome: 'success',
|
|
42
|
+
* duration: 100
|
|
43
|
+
* });
|
|
44
|
+
* tracker.finalizeTrajectory(trajectoryId, { success: true });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export { createRuVectorConfig, createHighPerformanceConfig, createLowMemoryConfig, createHybridSearchConfig, validateRuVectorConfig, getRecommendedConfig, DEFAULT_HNSW_CONFIG, DEFAULT_INDEX_CONFIG, DEFAULT_CACHE_CONFIG, DEFAULT_PERFORMANCE_CONFIG, defaultConfig, type RuVectorConfig, type VectorBackend, type ConfigValidationResult, type ValidationResult, type HNSWConfig, type PostgresBackendConfig, type CloudBackendConfig, type StandaloneBackendConfig, } from './config.js';
|
|
48
|
+
export type { DistanceMetric, IndexType, SearchSource, VectorEntry, SearchResult, HybridSearchQuery, HybridSearchResult, BatchInsertEntry, BatchInsertOperation, BatchInsertResult, VectorIndexStats, VectorSearchOptions, VectorIndexConfig, VectorStoreEvent, VectorStoreEventListener, IVectorStore, TrajectoryStep, AgentTrajectory, SonaLearningRecord, GraphNode, GraphEdge, CypherQueryResult, VectorUpdateOperation, VectorDeleteOperation, VectorDeleteResult, VectorNamespace, } from './types.js';
|
|
49
|
+
export { EnhancedVectorStore, createVectorStore, TrajectoryTracker, createTrajectoryTracker, type TrajectoryTrackerConfig, type DetectedPattern, } from './services/index.js';
|
|
50
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vector Services
|
|
3
|
+
*
|
|
4
|
+
* Exports all vector service modules for the knowledge-graph-agent.
|
|
5
|
+
* Includes:
|
|
6
|
+
* - Vector store for HNSW-based similarity search
|
|
7
|
+
* - Trajectory tracker for agent operation logging and self-learning
|
|
8
|
+
*
|
|
9
|
+
* @module vector/services
|
|
10
|
+
*/
|
|
11
|
+
export { EnhancedVectorStore, createVectorStore } from './vector-store.js';
|
|
12
|
+
export { TrajectoryTracker, createTrajectoryTracker, type TrajectoryTrackerConfig, type DetectedPattern, } from './trajectory-tracker.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vector/services/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trajectory Tracker
|
|
3
|
+
*
|
|
4
|
+
* Records agent operation sequences for pattern learning.
|
|
5
|
+
* Integrates with the SONA (Self-Optimizing Neural Architecture) engine.
|
|
6
|
+
*
|
|
7
|
+
* The trajectory tracker provides:
|
|
8
|
+
* - Recording of agent operation trajectories
|
|
9
|
+
* - Pattern detection from historical trajectories
|
|
10
|
+
* - Learning records for SONA integration
|
|
11
|
+
* - Success/failure analysis
|
|
12
|
+
* - Recommendations based on learned patterns
|
|
13
|
+
*
|
|
14
|
+
* @module vector/services/trajectory-tracker
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { createTrajectoryTracker } from './trajectory-tracker.js';
|
|
19
|
+
*
|
|
20
|
+
* const tracker = createTrajectoryTracker({
|
|
21
|
+
* maxTrajectories: 1000,
|
|
22
|
+
* enableAutoLearning: true,
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Start a new trajectory
|
|
26
|
+
* const trajectoryId = tracker.startTrajectory('agent-1', 'workflow-1');
|
|
27
|
+
*
|
|
28
|
+
* // Add steps as the agent works
|
|
29
|
+
* tracker.addStep(trajectoryId, {
|
|
30
|
+
* action: 'analyze_document',
|
|
31
|
+
* state: { documentId: 'doc-123', status: 'processing' },
|
|
32
|
+
* outcome: 'success',
|
|
33
|
+
* duration: 1500,
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Finalize when done
|
|
37
|
+
* tracker.finalizeTrajectory(trajectoryId, { success: true });
|
|
38
|
+
*
|
|
39
|
+
* // Get recommendations for future actions
|
|
40
|
+
* const recommendations = tracker.getRecommendedActions('analyze_document');
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
import type { TrajectoryStep, AgentTrajectory, SonaLearningRecord } from '../types.js';
|
|
44
|
+
/**
|
|
45
|
+
* Trajectory tracker configuration
|
|
46
|
+
*
|
|
47
|
+
* @property maxTrajectories - Maximum number of trajectories to keep in memory
|
|
48
|
+
* @property maxStepsPerTrajectory - Maximum steps per trajectory
|
|
49
|
+
* @property enableAutoLearning - Enable auto-learning from successful trajectories
|
|
50
|
+
* @property minSuccessRateForLearning - Minimum success rate to learn from
|
|
51
|
+
* @property patternThreshold - Number of occurrences before pattern is learned
|
|
52
|
+
*/
|
|
53
|
+
export interface TrajectoryTrackerConfig {
|
|
54
|
+
/** Maximum number of trajectories to keep in memory */
|
|
55
|
+
maxTrajectories?: number;
|
|
56
|
+
/** Maximum steps per trajectory */
|
|
57
|
+
maxStepsPerTrajectory?: number;
|
|
58
|
+
/** Enable auto-learning from successful trajectories */
|
|
59
|
+
enableAutoLearning?: boolean;
|
|
60
|
+
/** Minimum success rate to learn from */
|
|
61
|
+
minSuccessRateForLearning?: number;
|
|
62
|
+
/** Pattern extraction threshold */
|
|
63
|
+
patternThreshold?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pattern detected from trajectories
|
|
67
|
+
*
|
|
68
|
+
* Represents a sequence of actions that has been observed multiple times
|
|
69
|
+
* and can be used to predict or recommend future actions.
|
|
70
|
+
*/
|
|
71
|
+
export interface DetectedPattern {
|
|
72
|
+
/** Unique identifier for this pattern */
|
|
73
|
+
id: string;
|
|
74
|
+
/** Type of pattern (success, failure, or optimization opportunity) */
|
|
75
|
+
type: 'success' | 'failure' | 'optimization';
|
|
76
|
+
/** Sequence of actions in this pattern */
|
|
77
|
+
actions: string[];
|
|
78
|
+
/** Number of times this pattern has been observed */
|
|
79
|
+
frequency: number;
|
|
80
|
+
/** Average duration of trajectories with this pattern */
|
|
81
|
+
avgDuration: number;
|
|
82
|
+
/** Success rate of trajectories with this pattern */
|
|
83
|
+
successRate: number;
|
|
84
|
+
/** Confidence level in this pattern (0-1) */
|
|
85
|
+
confidence: number;
|
|
86
|
+
/** Additional metadata about the pattern */
|
|
87
|
+
metadata: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Trajectory Tracker class
|
|
91
|
+
*
|
|
92
|
+
* Provides comprehensive tracking and learning from agent operation sequences.
|
|
93
|
+
* This is a core component for the SONA (Self-Optimizing Neural Architecture)
|
|
94
|
+
* system, enabling agents to learn from past experiences and improve over time.
|
|
95
|
+
*
|
|
96
|
+
* Key capabilities:
|
|
97
|
+
* - **Recording**: Track agent operations as trajectories
|
|
98
|
+
* - **Pattern Detection**: Identify recurring action sequences
|
|
99
|
+
* - **Learning**: Create learning records from successful patterns
|
|
100
|
+
* - **Recommendations**: Suggest next actions based on patterns
|
|
101
|
+
* - **Analytics**: Provide statistics on trajectory performance
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const tracker = new TrajectoryTracker({
|
|
106
|
+
* maxTrajectories: 500,
|
|
107
|
+
* enableAutoLearning: true,
|
|
108
|
+
* patternThreshold: 5,
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* // Use throughout agent lifecycle
|
|
112
|
+
* const id = tracker.startTrajectory('my-agent');
|
|
113
|
+
* tracker.addStep(id, { action: 'step1', outcome: 'success' });
|
|
114
|
+
* tracker.addStep(id, { action: 'step2', outcome: 'success' });
|
|
115
|
+
* const trajectory = tracker.finalizeTrajectory(id, { success: true });
|
|
116
|
+
*
|
|
117
|
+
* // Analyze patterns
|
|
118
|
+
* const patterns = tracker.getPatterns({ minConfidence: 0.8 });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare class TrajectoryTracker {
|
|
122
|
+
private config;
|
|
123
|
+
private activeTrajectories;
|
|
124
|
+
private completedTrajectories;
|
|
125
|
+
private learningRecords;
|
|
126
|
+
private detectedPatterns;
|
|
127
|
+
/**
|
|
128
|
+
* Create a new TrajectoryTracker instance
|
|
129
|
+
*
|
|
130
|
+
* @param config - Configuration options for the tracker
|
|
131
|
+
*/
|
|
132
|
+
constructor(config?: TrajectoryTrackerConfig);
|
|
133
|
+
/**
|
|
134
|
+
* Start a new trajectory for an agent
|
|
135
|
+
*
|
|
136
|
+
* Creates a new trajectory record that will track the agent's operations.
|
|
137
|
+
* The trajectory must be finalized with `finalizeTrajectory` when complete.
|
|
138
|
+
*
|
|
139
|
+
* @param agentId - Unique identifier for the agent
|
|
140
|
+
* @param workflowId - Optional workflow this trajectory belongs to
|
|
141
|
+
* @param metadata - Optional additional metadata
|
|
142
|
+
* @returns The unique trajectory ID for tracking
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const trajectoryId = tracker.startTrajectory(
|
|
147
|
+
* 'researcher-agent-1',
|
|
148
|
+
* 'research-workflow-123',
|
|
149
|
+
* { priority: 'high', source: 'user-request' }
|
|
150
|
+
* );
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
startTrajectory(agentId: string, workflowId?: string, metadata?: Record<string, unknown>): string;
|
|
154
|
+
/**
|
|
155
|
+
* Add a step to an active trajectory
|
|
156
|
+
*
|
|
157
|
+
* Records a single operation/action taken by the agent as part of
|
|
158
|
+
* the trajectory. Steps are added in order and include timing information.
|
|
159
|
+
*
|
|
160
|
+
* @param trajectoryId - The trajectory to add the step to
|
|
161
|
+
* @param step - The step data (timestamp is auto-added)
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* tracker.addStep(trajectoryId, {
|
|
166
|
+
* action: 'analyze_document',
|
|
167
|
+
* state: { documentId: 'doc-123', status: 'processing', progress: 0.5 },
|
|
168
|
+
* outcome: 'success',
|
|
169
|
+
* duration: 2500,
|
|
170
|
+
* metadata: { model: 'claude-3-opus' }
|
|
171
|
+
* });
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
addStep(trajectoryId: string, step: Omit<TrajectoryStep, 'timestamp'>): void;
|
|
175
|
+
/**
|
|
176
|
+
* Finalize a trajectory
|
|
177
|
+
*
|
|
178
|
+
* Marks a trajectory as complete, calculates total duration, and
|
|
179
|
+
* optionally triggers pattern learning if auto-learning is enabled.
|
|
180
|
+
*
|
|
181
|
+
* @param trajectoryId - The trajectory to finalize
|
|
182
|
+
* @param options - Finalization options including success status
|
|
183
|
+
* @returns The finalized trajectory, or null if not found
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* const trajectory = tracker.finalizeTrajectory(trajectoryId, {
|
|
188
|
+
* success: true,
|
|
189
|
+
* metadata: { finalScore: 0.95 }
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* if (trajectory) {
|
|
193
|
+
* console.log(`Completed in ${trajectory.totalDuration}ms`);
|
|
194
|
+
* }
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
finalizeTrajectory(trajectoryId: string, options: {
|
|
198
|
+
success: boolean;
|
|
199
|
+
metadata?: Record<string, unknown>;
|
|
200
|
+
}): AgentTrajectory | null;
|
|
201
|
+
/**
|
|
202
|
+
* Learn patterns from a successful trajectory
|
|
203
|
+
*
|
|
204
|
+
* Extracts action sequences from the trajectory and updates pattern
|
|
205
|
+
* frequency and confidence metrics. Creates learning records when
|
|
206
|
+
* patterns exceed the configured threshold.
|
|
207
|
+
*
|
|
208
|
+
* @param trajectory - The trajectory to learn from
|
|
209
|
+
* @internal
|
|
210
|
+
*/
|
|
211
|
+
private learnFromTrajectory;
|
|
212
|
+
/**
|
|
213
|
+
* Generate a pattern ID from action sequence
|
|
214
|
+
*
|
|
215
|
+
* Creates a unique identifier for a pattern by joining action names.
|
|
216
|
+
*
|
|
217
|
+
* @param actions - Array of action names
|
|
218
|
+
* @returns Pattern identifier string
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
private generatePatternId;
|
|
222
|
+
/**
|
|
223
|
+
* Get recommended actions based on current state
|
|
224
|
+
*
|
|
225
|
+
* Analyzes detected patterns to suggest the most likely next actions
|
|
226
|
+
* based on the current action being performed.
|
|
227
|
+
*
|
|
228
|
+
* @param currentAction - The action currently being performed
|
|
229
|
+
* @param context - Optional context for more targeted recommendations
|
|
230
|
+
* @returns Array of recommended actions sorted by confidence
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const recommendations = tracker.getRecommendedActions('analyze_document');
|
|
235
|
+
*
|
|
236
|
+
* for (const rec of recommendations) {
|
|
237
|
+
* console.log(`Suggested: ${rec.action} (${rec.confidence.toFixed(2)} confidence)`);
|
|
238
|
+
* }
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
getRecommendedActions(currentAction: string, context?: Record<string, unknown>): Array<{
|
|
242
|
+
action: string;
|
|
243
|
+
confidence: number;
|
|
244
|
+
basedOn: string;
|
|
245
|
+
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Get trajectory by ID
|
|
248
|
+
*
|
|
249
|
+
* Retrieves a trajectory from either active or completed trajectories.
|
|
250
|
+
*
|
|
251
|
+
* @param trajectoryId - The trajectory ID to look up
|
|
252
|
+
* @returns The trajectory if found, null otherwise
|
|
253
|
+
*/
|
|
254
|
+
getTrajectory(trajectoryId: string): AgentTrajectory | null;
|
|
255
|
+
/**
|
|
256
|
+
* Get all trajectories for an agent
|
|
257
|
+
*
|
|
258
|
+
* Retrieves all completed trajectories that were executed by a specific agent.
|
|
259
|
+
*
|
|
260
|
+
* @param agentId - The agent ID to filter by
|
|
261
|
+
* @returns Array of trajectories for the agent
|
|
262
|
+
*/
|
|
263
|
+
getAgentTrajectories(agentId: string): AgentTrajectory[];
|
|
264
|
+
/**
|
|
265
|
+
* Get trajectories for a workflow
|
|
266
|
+
*
|
|
267
|
+
* Retrieves all completed trajectories that belong to a specific workflow.
|
|
268
|
+
*
|
|
269
|
+
* @param workflowId - The workflow ID to filter by
|
|
270
|
+
* @returns Array of trajectories for the workflow
|
|
271
|
+
*/
|
|
272
|
+
getWorkflowTrajectories(workflowId: string): AgentTrajectory[];
|
|
273
|
+
/**
|
|
274
|
+
* Get detected patterns
|
|
275
|
+
*
|
|
276
|
+
* Retrieves patterns that have been detected from trajectory analysis,
|
|
277
|
+
* optionally filtered by confidence level or pattern type.
|
|
278
|
+
*
|
|
279
|
+
* @param options - Filter options
|
|
280
|
+
* @returns Array of patterns sorted by confidence
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* // Get high-confidence success patterns
|
|
285
|
+
* const patterns = tracker.getPatterns({
|
|
286
|
+
* minConfidence: 0.8,
|
|
287
|
+
* type: 'success'
|
|
288
|
+
* });
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
291
|
+
getPatterns(options?: {
|
|
292
|
+
minConfidence?: number;
|
|
293
|
+
type?: 'success' | 'failure' | 'optimization';
|
|
294
|
+
}): DetectedPattern[];
|
|
295
|
+
/**
|
|
296
|
+
* Get learning records
|
|
297
|
+
*
|
|
298
|
+
* Retrieves SONA learning records, optionally filtered by pattern ID
|
|
299
|
+
* or time range.
|
|
300
|
+
*
|
|
301
|
+
* @param options - Filter options
|
|
302
|
+
* @returns Array of learning records
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* // Get recent learning records
|
|
307
|
+
* const records = tracker.getLearningRecords({
|
|
308
|
+
* since: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours
|
|
309
|
+
* });
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
312
|
+
getLearningRecords(options?: {
|
|
313
|
+
patternId?: string;
|
|
314
|
+
since?: Date;
|
|
315
|
+
}): SonaLearningRecord[];
|
|
316
|
+
/**
|
|
317
|
+
* Get statistics about trajectory tracking
|
|
318
|
+
*
|
|
319
|
+
* Provides aggregate statistics about trajectories, patterns,
|
|
320
|
+
* and learning performance.
|
|
321
|
+
*
|
|
322
|
+
* @returns Statistics object with counts and rates
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```typescript
|
|
326
|
+
* const stats = tracker.getStats();
|
|
327
|
+
* console.log(`Success rate: ${(stats.successRate * 100).toFixed(1)}%`);
|
|
328
|
+
* console.log(`Patterns detected: ${stats.detectedPatterns}`);
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
getStats(): {
|
|
332
|
+
activeTrajectories: number;
|
|
333
|
+
completedTrajectories: number;
|
|
334
|
+
detectedPatterns: number;
|
|
335
|
+
learningRecords: number;
|
|
336
|
+
successRate: number;
|
|
337
|
+
avgDuration: number;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Clear all trajectory data
|
|
341
|
+
*
|
|
342
|
+
* Removes all active trajectories, completed trajectories, learning records,
|
|
343
|
+
* and detected patterns. Use with caution as this is irreversible.
|
|
344
|
+
*/
|
|
345
|
+
clear(): void;
|
|
346
|
+
/**
|
|
347
|
+
* Export data for persistence
|
|
348
|
+
*
|
|
349
|
+
* Serializes all trajectory data for storage or transfer.
|
|
350
|
+
* Use with `import()` to restore data.
|
|
351
|
+
*
|
|
352
|
+
* @returns Exportable data object
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* const data = tracker.export();
|
|
357
|
+
* await fs.writeFile('trajectories.json', JSON.stringify(data));
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
export(): {
|
|
361
|
+
trajectories: AgentTrajectory[];
|
|
362
|
+
patterns: DetectedPattern[];
|
|
363
|
+
learningRecords: SonaLearningRecord[];
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Import data from persistence
|
|
367
|
+
*
|
|
368
|
+
* Restores trajectory data from a previous export.
|
|
369
|
+
*
|
|
370
|
+
* @param data - Previously exported data object
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```typescript
|
|
374
|
+
* const data = JSON.parse(await fs.readFile('trajectories.json', 'utf-8'));
|
|
375
|
+
* tracker.import(data);
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
import(data: {
|
|
379
|
+
trajectories?: AgentTrajectory[];
|
|
380
|
+
patterns?: DetectedPattern[];
|
|
381
|
+
learningRecords?: SonaLearningRecord[];
|
|
382
|
+
}): void;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Create a trajectory tracker instance
|
|
386
|
+
*
|
|
387
|
+
* Factory function for creating a TrajectoryTracker with the specified
|
|
388
|
+
* configuration.
|
|
389
|
+
*
|
|
390
|
+
* @param config - Optional configuration options
|
|
391
|
+
* @returns New TrajectoryTracker instance
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```typescript
|
|
395
|
+
* import { createTrajectoryTracker } from './trajectory-tracker.js';
|
|
396
|
+
*
|
|
397
|
+
* const tracker = createTrajectoryTracker({
|
|
398
|
+
* maxTrajectories: 500,
|
|
399
|
+
* enableAutoLearning: true,
|
|
400
|
+
* patternThreshold: 5,
|
|
401
|
+
* });
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
404
|
+
export declare function createTrajectoryTracker(config?: TrajectoryTrackerConfig): TrajectoryTracker;
|
|
405
|
+
//# sourceMappingURL=trajectory-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-tracker.d.ts","sourceRoot":"","sources":["../../../src/vector/services/trajectory-tracker.ts"],"names":[],"mappings":"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"}
|