@weavelogic/knowledge-graph-agent 0.2.0 → 0.3.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 +686 -304
- 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/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/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/index.d.ts.map +1 -1
- package/dist/cli/index.js +40 -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/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 +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +173 -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/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 +13 -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 +663 -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/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/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
package/README.md
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
# @weavelogic/knowledge-graph-agent
|
|
2
2
|
|
|
3
|
-
A powerful NPM library for creating and managing knowledge graphs for Claude Code. Integrates with Obsidian-style documentation
|
|
3
|
+
A powerful NPM library for creating and managing knowledge graphs for Claude Code. Integrates with Obsidian-style documentation, claude-flow for AI coordination, and provides enterprise-grade features for production deployments.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@weavelogic/knowledge-graph-agent)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
## Features
|
|
8
|
+
## Features at a Glance
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Claude-Flow Integration** - Sync knowledge graphs with claude-flow memory for cross-session persistence
|
|
17
|
-
- **Full-Text Search** - SQLite-backed search across all documentation
|
|
10
|
+
| Phase | Feature Area | Description |
|
|
11
|
+
|-------|--------------|-------------|
|
|
12
|
+
| 1 | Cultivation System | Codebase analysis, seed generation, deep analysis |
|
|
13
|
+
| 2 | Core Features | Agent system, rules engine, workflows, MCP server |
|
|
14
|
+
| 3 | Advanced Integration | Service management, config migrations, health monitoring |
|
|
15
|
+
| 4 | Enterprise Features | Chunking, backup/recovery, advanced caching, diagnostics |
|
|
18
16
|
|
|
19
17
|
## Installation
|
|
20
18
|
|
|
@@ -30,426 +28,810 @@ npx @weavelogic/knowledge-graph-agent init
|
|
|
30
28
|
|
|
31
29
|
## Quick Start
|
|
32
30
|
|
|
33
|
-
### 1. Initialize Knowledge Graph
|
|
34
|
-
|
|
35
31
|
```bash
|
|
36
|
-
# Initialize in
|
|
32
|
+
# Initialize knowledge graph in project
|
|
37
33
|
kg init
|
|
38
34
|
|
|
39
|
-
#
|
|
40
|
-
kg init
|
|
35
|
+
# Bootstrap primitives from codebase analysis
|
|
36
|
+
kg init-primitives
|
|
37
|
+
|
|
38
|
+
# Generate knowledge graph
|
|
39
|
+
kg graph
|
|
40
|
+
|
|
41
|
+
# Start MCP server for Claude integration
|
|
42
|
+
kg mcp start
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
---
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
## Phase 1: Cultivation System
|
|
48
|
+
|
|
49
|
+
### SeedGenerator
|
|
50
|
+
|
|
51
|
+
Analyzes codebases to bootstrap knowledge graphs with primitive nodes.
|
|
52
|
+
|
|
53
|
+
**Supported Ecosystems:**
|
|
54
|
+
- **Node.js**: `package.json` dependencies
|
|
55
|
+
- **Python**: `requirements.txt`, `pyproject.toml`
|
|
56
|
+
- **PHP**: `composer.json`
|
|
57
|
+
- **Rust**: `Cargo.toml`
|
|
58
|
+
- **Go**: `go.mod`
|
|
59
|
+
- **Java**: `pom.xml`, `build.gradle`
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { SeedGenerator, analyzeSeed, initPrimitives } from '@weavelogic/knowledge-graph-agent';
|
|
63
|
+
|
|
64
|
+
// Full analysis
|
|
65
|
+
const analysis = await analyzeSeed('/project', 'docs');
|
|
66
|
+
console.log(`Found ${analysis.frameworks.length} frameworks`);
|
|
67
|
+
console.log(`Found ${analysis.dependencies.length} dependencies`);
|
|
68
|
+
console.log(`Found ${analysis.services.length} services`);
|
|
69
|
+
|
|
70
|
+
// Generate primitive nodes
|
|
71
|
+
const result = await initPrimitives('/project', 'docs', { dryRun: false });
|
|
72
|
+
console.log(`Generated ${result.documentsGenerated.length} documents`);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### DeepAnalyzer with claude-flow Integration
|
|
48
76
|
|
|
49
|
-
|
|
50
|
-
kg analyze --dry-run --verbose
|
|
77
|
+
Advanced codebase analysis using multi-agent orchestration.
|
|
51
78
|
|
|
79
|
+
```bash
|
|
52
80
|
# Deep analysis with claude-flow agents
|
|
53
81
|
kg analyze deep
|
|
54
82
|
|
|
55
|
-
# Generate analysis report
|
|
56
|
-
kg analyze report
|
|
83
|
+
# Generate analysis report
|
|
57
84
|
kg analyze report --json
|
|
58
85
|
```
|
|
59
86
|
|
|
60
|
-
###
|
|
87
|
+
### Shadow Cache for File Tracking
|
|
61
88
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
Tracks file changes efficiently using SHA-256 hashing.
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { ShadowCache } from '@weavelogic/knowledge-graph-agent';
|
|
65
93
|
|
|
66
|
-
|
|
67
|
-
|
|
94
|
+
const cache = new ShadowCache('/project/.kg');
|
|
95
|
+
const changed = await cache.getChangedFiles('/project/docs');
|
|
96
|
+
console.log(`${changed.length} files changed since last sync`);
|
|
68
97
|
```
|
|
69
98
|
|
|
70
|
-
###
|
|
99
|
+
### CLI Commands (Phase 1)
|
|
71
100
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
kg
|
|
101
|
+
| Command | Description |
|
|
102
|
+
|---------|-------------|
|
|
103
|
+
| `kg init-primitives` | Bootstrap primitives from codebase analysis |
|
|
104
|
+
| `kg init-primitives --dry-run` | Preview without writing files |
|
|
105
|
+
| `kg analyze-codebase` | Analyze dependencies and services |
|
|
106
|
+
| `kg cultivate` | Run cultivation pipeline |
|
|
107
|
+
| `kg cultivate --deep` | Deep analysis with agents |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Phase 2: Core Features
|
|
112
|
+
|
|
113
|
+
### Agent System
|
|
114
|
+
|
|
115
|
+
A comprehensive agent framework with specialized agents for different tasks.
|
|
116
|
+
|
|
117
|
+
**Agent Types:**
|
|
118
|
+
- `ResearcherAgent` - Research and information gathering
|
|
119
|
+
- `CoderAgent` - Code generation and modification
|
|
120
|
+
- `TesterAgent` - Test creation and validation
|
|
121
|
+
- `AnalystAgent` - Analysis and recommendations
|
|
122
|
+
- `ArchitectAgent` - System design and architecture
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import {
|
|
126
|
+
BaseAgent,
|
|
127
|
+
getRegistry,
|
|
128
|
+
AgentType,
|
|
129
|
+
createTask
|
|
130
|
+
} from '@weavelogic/knowledge-graph-agent';
|
|
131
|
+
|
|
132
|
+
// Get the agent registry
|
|
133
|
+
const registry = getRegistry();
|
|
134
|
+
|
|
135
|
+
// Spawn a researcher agent
|
|
136
|
+
const agent = await registry.spawn(AgentType.RESEARCHER, {
|
|
137
|
+
name: 'docs-researcher',
|
|
138
|
+
claudeFlow: { enabled: true, namespace: 'kg' },
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Execute a task
|
|
142
|
+
const task = createTask('Research authentication patterns', {
|
|
143
|
+
priority: TaskPriority.HIGH,
|
|
144
|
+
input: { topic: 'OAuth2' },
|
|
145
|
+
});
|
|
75
146
|
|
|
76
|
-
|
|
77
|
-
|
|
147
|
+
const result = await agent.execute(task);
|
|
148
|
+
console.log(result.data);
|
|
78
149
|
```
|
|
79
150
|
|
|
80
|
-
|
|
151
|
+
**BaseAgent Features:**
|
|
152
|
+
- Task execution with timeout and retry handling
|
|
153
|
+
- Input validation
|
|
154
|
+
- Output formatting
|
|
155
|
+
- Error handling and logging
|
|
156
|
+
- Claude-flow hooks integration
|
|
157
|
+
- Message passing between agents
|
|
81
158
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
159
|
+
### RulesEngine for Automation
|
|
160
|
+
|
|
161
|
+
Define and execute automation rules based on triggers and conditions.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import { RulesEngine, RuleType, TriggerType } from '@weavelogic/knowledge-graph-agent';
|
|
85
165
|
|
|
86
|
-
|
|
87
|
-
kg frontmatter add docs/
|
|
166
|
+
const engine = new RulesEngine();
|
|
88
167
|
|
|
89
|
-
|
|
90
|
-
|
|
168
|
+
engine.registerRule({
|
|
169
|
+
id: 'auto-tag',
|
|
170
|
+
name: 'Auto-tag documentation',
|
|
171
|
+
type: RuleType.TRANSFORM,
|
|
172
|
+
trigger: { type: TriggerType.FILE_CHANGE, pattern: 'docs/**/*.md' },
|
|
173
|
+
condition: (context) => context.file.endsWith('.md'),
|
|
174
|
+
action: async (context) => { /* auto-tag logic */ },
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
engine.start();
|
|
91
178
|
```
|
|
92
179
|
|
|
93
|
-
###
|
|
180
|
+
### Workflow Registry
|
|
94
181
|
|
|
95
|
-
|
|
96
|
-
# Generate CLAUDE.md with knowledge graph integration
|
|
97
|
-
kg claude update
|
|
182
|
+
Multi-step workflow orchestration with dependencies.
|
|
98
183
|
|
|
99
|
-
|
|
100
|
-
|
|
184
|
+
```typescript
|
|
185
|
+
import { WorkflowRegistry } from '@weavelogic/knowledge-graph-agent';
|
|
186
|
+
|
|
187
|
+
const registry = new WorkflowRegistry();
|
|
188
|
+
|
|
189
|
+
registry.register({
|
|
190
|
+
id: 'documentation-sync',
|
|
191
|
+
name: 'Documentation Sync',
|
|
192
|
+
steps: [
|
|
193
|
+
{ id: 'analyze', action: 'analyze-docs' },
|
|
194
|
+
{ id: 'generate', action: 'generate-graph', dependsOn: ['analyze'] },
|
|
195
|
+
{ id: 'sync', action: 'sync-memory', dependsOn: ['generate'] },
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
await registry.execute('documentation-sync', { projectRoot: '/project' });
|
|
101
200
|
```
|
|
102
201
|
|
|
103
|
-
###
|
|
202
|
+
### VaultMemorySync
|
|
104
203
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
204
|
+
Synchronize knowledge graph with claude-flow memory.
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { VaultMemorySync } from '@weavelogic/knowledge-graph-agent';
|
|
208
|
+
|
|
209
|
+
const sync = new VaultMemorySync({
|
|
210
|
+
vaultPath: '/project/docs',
|
|
211
|
+
namespace: 'knowledge-graph',
|
|
212
|
+
});
|
|
108
213
|
|
|
109
|
-
|
|
110
|
-
kg sync --show-commands
|
|
214
|
+
await sync.syncAll();
|
|
111
215
|
```
|
|
112
216
|
|
|
113
|
-
|
|
217
|
+
### Git Integration
|
|
114
218
|
|
|
115
|
-
|
|
116
|
-
|---------|-------------|
|
|
117
|
-
| `kg init` | Initialize knowledge graph in project |
|
|
118
|
-
| `kg analyze` | **NEW** Analyze & migrate docs to knowledge graph structure |
|
|
119
|
-
| `kg analyze deep` | **NEW** Deep analysis with claude-flow agents |
|
|
120
|
-
| `kg analyze report` | **NEW** Generate analysis report without creating files |
|
|
121
|
-
| `kg graph` | Generate/update knowledge graph |
|
|
122
|
-
| `kg docs init` | Initialize docs directory |
|
|
123
|
-
| `kg docs status` | Show documentation status |
|
|
124
|
-
| `kg convert docs` | Convert existing docs to weave-nn structure |
|
|
125
|
-
| `kg frontmatter add` | Add frontmatter to markdown files |
|
|
126
|
-
| `kg frontmatter validate` | Validate frontmatter in files |
|
|
127
|
-
| `kg frontmatter update` | Update/regenerate frontmatter |
|
|
128
|
-
| `kg claude update` | Update CLAUDE.md |
|
|
129
|
-
| `kg claude preview` | Preview CLAUDE.md content |
|
|
130
|
-
| `kg sync` | Sync with claude-flow memory |
|
|
131
|
-
| `kg stats` | Display graph statistics |
|
|
132
|
-
| `kg search <query>` | Search the knowledge graph |
|
|
219
|
+
Automatic commit message generation and staged changes analysis.
|
|
133
220
|
|
|
134
|
-
|
|
221
|
+
```bash
|
|
222
|
+
# Show status with suggested commit message
|
|
223
|
+
kg commit
|
|
135
224
|
|
|
136
|
-
|
|
225
|
+
# Auto-commit with generated message
|
|
226
|
+
kg commit -a
|
|
137
227
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
3. **Generates frontmatter** with proper weave-nn fields
|
|
141
|
-
4. **Creates wikilinks** between related documents
|
|
142
|
-
5. **Builds MOC files** (Map of Content) for navigation
|
|
143
|
-
6. **Identifies research areas** and TODOs for follow-up
|
|
144
|
-
7. **Links to originals** for reference back to source documentation
|
|
228
|
+
# Interactive commit mode
|
|
229
|
+
kg commit -i
|
|
145
230
|
|
|
146
|
-
|
|
231
|
+
# Show recent commits
|
|
232
|
+
kg commit log
|
|
233
|
+
```
|
|
147
234
|
|
|
235
|
+
```typescript
|
|
236
|
+
import { analyzeGitChanges, generateCommitMessage } from '@weavelogic/knowledge-graph-agent';
|
|
237
|
+
|
|
238
|
+
const changes = await analyzeGitChanges('/project');
|
|
239
|
+
const message = generateCommitMessage(changes);
|
|
240
|
+
console.log(message);
|
|
148
241
|
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
├── integrations/
|
|
161
|
-
├── standards/
|
|
162
|
-
├── guides/
|
|
163
|
-
├── references/
|
|
164
|
-
├── _templates/
|
|
165
|
-
├── _attachments/
|
|
166
|
-
└── _archive/
|
|
242
|
+
|
|
243
|
+
### MCP Server with 20+ Tools
|
|
244
|
+
|
|
245
|
+
Model Context Protocol server for Claude integration.
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Start MCP server
|
|
249
|
+
kg mcp start
|
|
250
|
+
|
|
251
|
+
# Or via npx
|
|
252
|
+
npx @weavelogic/knowledge-graph-agent mcp start
|
|
167
253
|
```
|
|
168
254
|
|
|
169
|
-
|
|
255
|
+
**Available MCP Tools:**
|
|
170
256
|
|
|
171
|
-
|
|
257
|
+
| Category | Tools |
|
|
258
|
+
|----------|-------|
|
|
259
|
+
| Graph | `kg_query`, `kg_stats`, `kg_get_node`, `kg_list_tags` |
|
|
260
|
+
| Cache | `kg_cache_stats` |
|
|
261
|
+
| Agents | `kg_agent_spawn`, `kg_agent_list` |
|
|
262
|
+
| System | `kg_health`, `kg_health_check` |
|
|
263
|
+
| Search | `kg_search_nodes`, `kg_search_tags` |
|
|
172
264
|
|
|
173
|
-
```markdown
|
|
174
|
-
---
|
|
175
|
-
title: "Document Title"
|
|
176
|
-
type: concept
|
|
177
|
-
status: active
|
|
178
|
-
tags:
|
|
179
|
-
- tag1
|
|
180
|
-
- tag2
|
|
181
|
-
category: concepts
|
|
182
|
-
description: "Auto-generated summary"
|
|
183
|
-
created: 2025-01-01
|
|
184
|
-
updated: 2025-01-01
|
|
185
|
-
original: "docs/original-file.md"
|
|
186
|
-
related:
|
|
187
|
-
- "[[Related Document]]"
|
|
188
265
|
---
|
|
189
266
|
|
|
190
|
-
|
|
267
|
+
## Phase 3: Advanced Integration
|
|
268
|
+
|
|
269
|
+
### ServiceManager
|
|
191
270
|
|
|
192
|
-
|
|
271
|
+
Centralized management for background services with health monitoring.
|
|
193
272
|
|
|
194
|
-
|
|
273
|
+
```typescript
|
|
274
|
+
import { createServiceManager, ServiceHandler } from '@weavelogic/knowledge-graph-agent';
|
|
275
|
+
|
|
276
|
+
const manager = createServiceManager();
|
|
277
|
+
|
|
278
|
+
// Register a service
|
|
279
|
+
await manager.register(
|
|
280
|
+
{
|
|
281
|
+
id: 'file-watcher',
|
|
282
|
+
name: 'File Watcher',
|
|
283
|
+
type: 'watcher',
|
|
284
|
+
autoStart: true,
|
|
285
|
+
healthCheckInterval: 60000,
|
|
286
|
+
restartOnFailure: true,
|
|
287
|
+
maxRestarts: 3,
|
|
288
|
+
},
|
|
289
|
+
myWatcherService
|
|
290
|
+
);
|
|
195
291
|
|
|
196
|
-
|
|
197
|
-
|
|
292
|
+
// Listen for events
|
|
293
|
+
manager.on('started', (state) => console.log(`${state.name} started`));
|
|
294
|
+
manager.on('healthCheck', ({ id, healthy }) => console.log(`${id}: ${healthy}`));
|
|
198
295
|
|
|
199
|
-
|
|
296
|
+
// Graceful shutdown
|
|
297
|
+
process.on('SIGTERM', () => manager.shutdown());
|
|
298
|
+
```
|
|
200
299
|
|
|
201
|
-
|
|
202
|
-
- **Concept 2**
|
|
300
|
+
### ConfigManager with Migrations
|
|
203
301
|
|
|
204
|
-
|
|
302
|
+
Configuration management with version migrations and validation.
|
|
205
303
|
|
|
206
|
-
|
|
207
|
-
|
|
304
|
+
```typescript
|
|
305
|
+
import { createConfigManager } from '@weavelogic/knowledge-graph-agent';
|
|
208
306
|
|
|
209
|
-
|
|
307
|
+
const config = createConfigManager('/project');
|
|
210
308
|
|
|
211
|
-
|
|
212
|
-
|
|
309
|
+
// Get configuration
|
|
310
|
+
const dbConfig = config.get('database');
|
|
311
|
+
console.log(dbConfig.path);
|
|
213
312
|
|
|
214
|
-
|
|
313
|
+
// Update configuration
|
|
314
|
+
config.update({
|
|
315
|
+
cache: { maxSize: 2000, evictionPolicy: 'lfu' },
|
|
316
|
+
});
|
|
215
317
|
|
|
216
|
-
|
|
217
|
-
|
|
318
|
+
// Register and run migrations
|
|
319
|
+
config.registerMigration({
|
|
320
|
+
version: '1.1.0',
|
|
321
|
+
up: (cfg) => ({ ...cfg, newField: 'value' }),
|
|
322
|
+
down: (cfg) => { const { newField, ...rest } = cfg; return rest; },
|
|
323
|
+
});
|
|
218
324
|
|
|
219
|
-
|
|
325
|
+
config.migrate('1.1.0');
|
|
220
326
|
|
|
221
|
-
|
|
327
|
+
// Validate configuration
|
|
328
|
+
const { valid, errors } = config.validate();
|
|
222
329
|
```
|
|
223
330
|
|
|
224
|
-
|
|
331
|
+
### HealthMonitor
|
|
332
|
+
|
|
333
|
+
System health monitoring with alerts and history.
|
|
225
334
|
|
|
226
335
|
```typescript
|
|
227
|
-
import {
|
|
228
|
-
createKnowledgeGraph,
|
|
229
|
-
createDatabase,
|
|
230
|
-
initDocs,
|
|
231
|
-
generateClaudeMd,
|
|
232
|
-
quickInit,
|
|
233
|
-
// New in v0.2.0
|
|
234
|
-
analyzeDocs,
|
|
235
|
-
convertDocs,
|
|
236
|
-
addFrontmatter,
|
|
237
|
-
} from '@weavelogic/knowledge-graph-agent';
|
|
336
|
+
import { createHealthMonitor, createMemoryCheck, createDatabaseCheck } from '@weavelogic/knowledge-graph-agent';
|
|
238
337
|
|
|
239
|
-
|
|
240
|
-
const result = await quickInit({
|
|
241
|
-
projectRoot: '/path/to/project',
|
|
242
|
-
docsPath: 'docs',
|
|
243
|
-
generateGraph: true,
|
|
244
|
-
updateClaudeMd: true,
|
|
245
|
-
});
|
|
338
|
+
const monitor = createHealthMonitor({ checkInterval: 30000 });
|
|
246
339
|
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
linkOriginal: true,
|
|
255
|
-
dryRun: false,
|
|
340
|
+
// Register health checks
|
|
341
|
+
monitor.registerCheck(createMemoryCheck(85)); // Alert at 85% heap usage
|
|
342
|
+
monitor.registerCheck(createDatabaseCheck('/project/.kg/knowledge.db'));
|
|
343
|
+
|
|
344
|
+
// Listen for alerts
|
|
345
|
+
monitor.on('alert', (alert) => {
|
|
346
|
+
console.error(`[${alert.severity}] ${alert.component}: ${alert.message}`);
|
|
256
347
|
});
|
|
257
348
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
console.log(`MOC files: ${analyzeResult.mocFilesCreated}`);
|
|
349
|
+
// Start monitoring
|
|
350
|
+
monitor.start();
|
|
261
351
|
|
|
262
|
-
//
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
352
|
+
// Get current health
|
|
353
|
+
const health = await monitor.runAllChecks();
|
|
354
|
+
console.log(`System status: ${health.status}`);
|
|
355
|
+
console.log(`Uptime: ${health.uptime}ms`);
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### DecisionTracker for Explainability
|
|
359
|
+
|
|
360
|
+
Track and explain AI reasoning and decisions.
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
import { createDecisionTracker } from '@weavelogic/knowledge-graph-agent';
|
|
364
|
+
|
|
365
|
+
const tracker = createDecisionTracker();
|
|
366
|
+
|
|
367
|
+
// Start a reasoning chain
|
|
368
|
+
const chainId = tracker.startChain('Process user query');
|
|
369
|
+
|
|
370
|
+
// Record decisions
|
|
371
|
+
const decision = tracker.recordDecision({
|
|
372
|
+
action: 'Extract entities from query',
|
|
373
|
+
reasoning: [
|
|
374
|
+
'Query contains multiple noun phrases',
|
|
375
|
+
'NLP analysis identified 3 potential entities',
|
|
376
|
+
'Confidence scores above threshold',
|
|
377
|
+
],
|
|
378
|
+
confidence: 'high',
|
|
379
|
+
context: {
|
|
380
|
+
trigger: 'user_query',
|
|
381
|
+
inputs: { query: 'Tell me about React and TypeScript' },
|
|
382
|
+
constraints: ['max 10 entities'],
|
|
383
|
+
alternatives: [],
|
|
384
|
+
},
|
|
268
385
|
});
|
|
269
386
|
|
|
270
|
-
//
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
387
|
+
// Record outcome
|
|
388
|
+
tracker.recordOutcome(decision.id, {
|
|
389
|
+
success: true,
|
|
390
|
+
result: { entities: ['React', 'TypeScript'] },
|
|
391
|
+
duration: 150,
|
|
392
|
+
sideEffects: [],
|
|
276
393
|
});
|
|
277
394
|
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
395
|
+
// Get explanation
|
|
396
|
+
console.log(tracker.explainDecision(decision.id));
|
|
397
|
+
|
|
398
|
+
// End chain
|
|
399
|
+
tracker.endChain(chainId);
|
|
400
|
+
|
|
401
|
+
// Get statistics
|
|
402
|
+
const stats = tracker.getStats();
|
|
403
|
+
console.log(`Success rate: ${stats.successRate * 100}%`);
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Phase 4: Enterprise Features
|
|
281
409
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
410
|
+
### Chunker for Large Documents
|
|
411
|
+
|
|
412
|
+
Split large documents into manageable chunks with multiple strategies.
|
|
413
|
+
|
|
414
|
+
**Strategies:**
|
|
415
|
+
- `fixed` - Character-based chunking with overlap
|
|
416
|
+
- `semantic` - Paragraph-based chunking
|
|
417
|
+
- `markdown` - Respects markdown structure (headers, sections)
|
|
418
|
+
- `code` - Preserves code blocks as atomic units
|
|
419
|
+
- `adaptive` - Auto-selects best strategy based on content
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import { createChunker, chunkDocument } from '@weavelogic/knowledge-graph-agent';
|
|
423
|
+
|
|
424
|
+
// Quick usage
|
|
425
|
+
const result = chunkDocument(largeMarkdownContent, {
|
|
426
|
+
strategy: 'adaptive',
|
|
427
|
+
maxSize: 2000,
|
|
428
|
+
overlap: 50,
|
|
287
429
|
});
|
|
288
430
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
431
|
+
console.log(`Split into ${result.chunks.length} chunks`);
|
|
432
|
+
console.log(`Processing time: ${result.processingTime}ms`);
|
|
433
|
+
|
|
434
|
+
// With configuration
|
|
435
|
+
const chunker = createChunker({
|
|
436
|
+
defaultStrategy: 'markdown',
|
|
437
|
+
defaultMaxSize: 4000,
|
|
294
438
|
});
|
|
439
|
+
|
|
440
|
+
const chunks = chunker.chunk(content);
|
|
441
|
+
for (const chunk of chunks) {
|
|
442
|
+
console.log(`Chunk ${chunk.id}: ${chunk.metadata.wordCount} words`);
|
|
443
|
+
}
|
|
295
444
|
```
|
|
296
445
|
|
|
297
|
-
|
|
446
|
+
### BackupManager with Compression
|
|
298
447
|
|
|
299
|
-
|
|
448
|
+
Automatic backup with gzip compression and checksums.
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
import { createBackupManager } from '@weavelogic/knowledge-graph-agent';
|
|
452
|
+
|
|
453
|
+
const backup = createBackupManager('/project/.kg/knowledge.db', {
|
|
454
|
+
enabled: true,
|
|
455
|
+
interval: 86400000, // 24 hours
|
|
456
|
+
maxBackups: 5,
|
|
457
|
+
compress: true,
|
|
458
|
+
backupPath: '/project/.kg/backups',
|
|
459
|
+
});
|
|
300
460
|
|
|
461
|
+
// Create backup
|
|
462
|
+
const info = await backup.createBackup();
|
|
463
|
+
console.log(`Backup created: ${info.id}`);
|
|
464
|
+
console.log(`Size: ${info.size} bytes`);
|
|
465
|
+
console.log(`Checksum: ${info.checksum}`);
|
|
466
|
+
|
|
467
|
+
// List backups
|
|
468
|
+
const backups = backup.listBackups();
|
|
469
|
+
for (const b of backups) {
|
|
470
|
+
console.log(`${b.id}: ${b.timestamp.toISOString()}`);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Restore from backup
|
|
474
|
+
await backup.restore(backups[0].id);
|
|
475
|
+
|
|
476
|
+
// Start automatic backups
|
|
477
|
+
backup.startAutoBackup();
|
|
301
478
|
```
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
479
|
+
|
|
480
|
+
### IntegrityChecker for Database Validation
|
|
481
|
+
|
|
482
|
+
Comprehensive database integrity checking and repair.
|
|
483
|
+
|
|
484
|
+
```typescript
|
|
485
|
+
import { createIntegrityChecker, checkDatabaseIntegrity } from '@weavelogic/knowledge-graph-agent';
|
|
486
|
+
|
|
487
|
+
// Quick check
|
|
488
|
+
const result = checkDatabaseIntegrity('/project/.kg/knowledge.db');
|
|
489
|
+
console.log(`Valid: ${result.valid}`);
|
|
490
|
+
console.log(`Errors: ${result.errors.length}`);
|
|
491
|
+
console.log(`Warnings: ${result.warnings.length}`);
|
|
492
|
+
|
|
493
|
+
// Detailed check with repair
|
|
494
|
+
const checker = createIntegrityChecker('/project/.kg/knowledge.db');
|
|
495
|
+
const check = checker.check();
|
|
496
|
+
|
|
497
|
+
for (const table of check.tables) {
|
|
498
|
+
console.log(`${table.name}: ${table.rowCount} rows, valid: ${table.valid}`);
|
|
499
|
+
if (!table.valid) {
|
|
500
|
+
console.log(` Issues: ${table.issues.join(', ')}`);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Repair database
|
|
505
|
+
if (!check.valid) {
|
|
506
|
+
const repaired = checker.repair();
|
|
507
|
+
console.log(`Repair ${repaired ? 'successful' : 'failed'}`);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Get database stats
|
|
511
|
+
const stats = checker.getStats();
|
|
512
|
+
console.log(`Pages: ${stats.pageCount}, Free: ${stats.freePages}`);
|
|
513
|
+
console.log(`WAL mode: ${stats.walMode}`);
|
|
331
514
|
```
|
|
332
515
|
|
|
333
|
-
|
|
516
|
+
### AdvancedCache with Multiple Eviction Policies
|
|
517
|
+
|
|
518
|
+
High-performance caching with LRU, LFU, FIFO, and TTL eviction.
|
|
519
|
+
|
|
520
|
+
```typescript
|
|
521
|
+
import { createAdvancedCache } from '@weavelogic/knowledge-graph-agent';
|
|
522
|
+
|
|
523
|
+
const cache = createAdvancedCache<User>({
|
|
524
|
+
maxSize: 50 * 1024 * 1024, // 50MB
|
|
525
|
+
maxEntries: 1000,
|
|
526
|
+
defaultTTL: 300000, // 5 minutes
|
|
527
|
+
evictionPolicy: 'lru', // 'lru' | 'lfu' | 'fifo' | 'ttl'
|
|
528
|
+
onEvict: (key, value) => console.log(`Evicted: ${key}`),
|
|
529
|
+
});
|
|
334
530
|
|
|
335
|
-
|
|
531
|
+
// Basic operations
|
|
532
|
+
cache.set('user:123', userData, { tags: ['user', 'active'] });
|
|
533
|
+
const user = cache.get<User>('user:123');
|
|
336
534
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
| `technical` | Technical components and implementations |
|
|
341
|
-
| `feature` | Product features and capabilities |
|
|
342
|
-
| `primitive` | Base technology primitives |
|
|
343
|
-
| `service` | Backend services and APIs |
|
|
344
|
-
| `guide` | How-to guides and tutorials |
|
|
345
|
-
| `standard` | Coding standards and conventions |
|
|
346
|
-
| `integration` | External integrations |
|
|
535
|
+
// Tag-based operations
|
|
536
|
+
const activeUsers = cache.getByTag('active');
|
|
537
|
+
cache.deleteByTag('user');
|
|
347
538
|
|
|
348
|
-
|
|
539
|
+
// Get or set with factory
|
|
540
|
+
const result = await cache.getOrSet('expensive:key', async () => {
|
|
541
|
+
return await expensiveComputation();
|
|
542
|
+
}, { ttl: 60000 });
|
|
349
543
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
updated: 2025-01-01
|
|
358
|
-
aliases: [Alternative Name]
|
|
359
|
-
related: [other-document]
|
|
360
|
-
category: concepts
|
|
361
|
-
description: Brief description
|
|
362
|
-
original: docs/source-file.md
|
|
363
|
-
---
|
|
544
|
+
// Statistics
|
|
545
|
+
const stats = cache.getStats();
|
|
546
|
+
console.log(`Hit rate: ${(stats.hitRate * 100).toFixed(1)}%`);
|
|
547
|
+
console.log(`Evictions: ${stats.evictions}`);
|
|
548
|
+
|
|
549
|
+
// Change policy at runtime
|
|
550
|
+
cache.setEvictionPolicy('lfu');
|
|
364
551
|
```
|
|
365
552
|
|
|
366
|
-
|
|
553
|
+
### Diagnostics CLI
|
|
367
554
|
|
|
368
|
-
|
|
555
|
+
Comprehensive troubleshooting tools.
|
|
369
556
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
- **Deep Analysis**: Use claude-flow agents for comprehensive documentation analysis
|
|
557
|
+
```bash
|
|
558
|
+
# Run full diagnostics
|
|
559
|
+
kg diag run
|
|
374
560
|
|
|
375
|
-
|
|
561
|
+
# Attempt to fix issues
|
|
562
|
+
kg diag run --fix
|
|
376
563
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
mcp__claude-flow__memory_usage {
|
|
380
|
-
action: "store",
|
|
381
|
-
key: "node/<id>",
|
|
382
|
-
namespace: "knowledge-graph",
|
|
383
|
-
value: { ... }
|
|
384
|
-
}
|
|
564
|
+
# Check system health
|
|
565
|
+
kg diag health
|
|
385
566
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
action: "retrieve",
|
|
389
|
-
key: "node/<id>",
|
|
390
|
-
namespace: "knowledge-graph"
|
|
391
|
-
}
|
|
567
|
+
# Repair database issues
|
|
568
|
+
kg diag repair
|
|
392
569
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
570
|
+
# Create database backup
|
|
571
|
+
kg diag backup
|
|
572
|
+
|
|
573
|
+
# List existing backups
|
|
574
|
+
kg diag backup --list
|
|
575
|
+
|
|
576
|
+
# Show system information
|
|
577
|
+
kg diag info
|
|
398
578
|
```
|
|
399
579
|
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
## CLI Commands Reference
|
|
583
|
+
|
|
584
|
+
### Initialization
|
|
585
|
+
|
|
586
|
+
| Command | Description |
|
|
587
|
+
|---------|-------------|
|
|
588
|
+
| `kg init` | Initialize knowledge graph in project |
|
|
589
|
+
| `kg init-primitives` | Bootstrap primitives from codebase |
|
|
590
|
+
| `kg init-primitives --dry-run` | Preview without writing files |
|
|
591
|
+
| `kg analyze-codebase` | Analyze dependencies and services |
|
|
592
|
+
|
|
593
|
+
### Knowledge Graph
|
|
594
|
+
|
|
595
|
+
| Command | Description |
|
|
596
|
+
|---------|-------------|
|
|
597
|
+
| `kg graph` | Generate/update knowledge graph |
|
|
598
|
+
| `kg graph --update` | Incremental update |
|
|
599
|
+
| `kg stats` | Display graph statistics |
|
|
600
|
+
| `kg search <query>` | Search the knowledge graph |
|
|
601
|
+
|
|
602
|
+
### Documentation
|
|
603
|
+
|
|
604
|
+
| Command | Description |
|
|
605
|
+
|---------|-------------|
|
|
606
|
+
| `kg docs init` | Initialize docs directory |
|
|
607
|
+
| `kg docs status` | Show documentation status |
|
|
608
|
+
| `kg analyze` | Analyze & migrate to knowledge graph |
|
|
609
|
+
| `kg analyze deep` | Deep analysis with claude-flow |
|
|
610
|
+
| `kg analyze report` | Generate analysis report |
|
|
611
|
+
| `kg convert docs` | Convert docs/ to docs-nn/ |
|
|
612
|
+
|
|
613
|
+
### Frontmatter
|
|
614
|
+
|
|
615
|
+
| Command | Description |
|
|
616
|
+
|---------|-------------|
|
|
617
|
+
| `kg frontmatter add` | Add frontmatter to markdown files |
|
|
618
|
+
| `kg frontmatter validate` | Validate frontmatter |
|
|
619
|
+
| `kg frontmatter update` | Update/regenerate frontmatter |
|
|
620
|
+
|
|
621
|
+
### SOP Compliance
|
|
622
|
+
|
|
623
|
+
| Command | Description |
|
|
624
|
+
|---------|-------------|
|
|
625
|
+
| `kg sop init` | Initialize SOP standards layer |
|
|
626
|
+
| `kg sop check` | Check compliance against SOPs |
|
|
627
|
+
| `kg sop gaps` | Analyze compliance gaps |
|
|
628
|
+
| `kg sop report` | Generate compliance report |
|
|
629
|
+
| `kg sop list` | List available SOPs |
|
|
630
|
+
|
|
631
|
+
### Claude Integration
|
|
632
|
+
|
|
633
|
+
| Command | Description |
|
|
634
|
+
|---------|-------------|
|
|
635
|
+
| `kg claude update` | Update CLAUDE.md |
|
|
636
|
+
| `kg claude preview` | Preview CLAUDE.md content |
|
|
637
|
+
| `kg sync` | Sync with claude-flow memory |
|
|
638
|
+
|
|
639
|
+
### Git Integration
|
|
640
|
+
|
|
641
|
+
| Command | Description |
|
|
642
|
+
|---------|-------------|
|
|
643
|
+
| `kg commit` | Show status with suggested message |
|
|
644
|
+
| `kg commit -a` | Auto-commit with generated message |
|
|
645
|
+
| `kg commit -i` | Interactive commit mode |
|
|
646
|
+
| `kg commit -m "msg"` | Commit with custom message |
|
|
647
|
+
| `kg commit status` | Show git status with analysis |
|
|
648
|
+
| `kg commit log` | Show recent commits |
|
|
649
|
+
| `kg commit diff` | Show diff of changes |
|
|
650
|
+
|
|
651
|
+
### Configuration
|
|
652
|
+
|
|
653
|
+
| Command | Description |
|
|
654
|
+
|---------|-------------|
|
|
655
|
+
| `kg config show` | Show current configuration |
|
|
656
|
+
| `kg config set <key> <value>` | Set configuration value |
|
|
657
|
+
| `kg config reset` | Reset to defaults |
|
|
658
|
+
|
|
659
|
+
### Diagnostics
|
|
660
|
+
|
|
661
|
+
| Command | Description |
|
|
662
|
+
|---------|-------------|
|
|
663
|
+
| `kg diag run` | Run full diagnostics |
|
|
664
|
+
| `kg diag run --fix` | Attempt to fix issues |
|
|
665
|
+
| `kg diag health` | Check system health |
|
|
666
|
+
| `kg diag repair` | Repair database issues |
|
|
667
|
+
| `kg diag backup` | Create database backup |
|
|
668
|
+
| `kg diag backup --list` | List existing backups |
|
|
669
|
+
| `kg diag info` | Show system information |
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
400
673
|
## Configuration
|
|
401
674
|
|
|
402
675
|
Create `.kg/config.json` to customize behavior:
|
|
403
676
|
|
|
404
677
|
```json
|
|
405
678
|
{
|
|
679
|
+
"version": "1.0.0",
|
|
406
680
|
"projectRoot": ".",
|
|
407
|
-
"
|
|
408
|
-
"graph": {
|
|
409
|
-
"includePatterns": ["**/*.md"],
|
|
410
|
-
"excludePatterns": ["node_modules/**", "dist/**"]
|
|
411
|
-
},
|
|
681
|
+
"docsPath": "docs",
|
|
412
682
|
"database": {
|
|
413
|
-
"path": ".kg/knowledge.db"
|
|
683
|
+
"path": ".kg/knowledge.db",
|
|
684
|
+
"autoBackup": true,
|
|
685
|
+
"backupInterval": 86400000,
|
|
686
|
+
"maxBackups": 5
|
|
414
687
|
},
|
|
415
|
-
"
|
|
688
|
+
"cache": {
|
|
416
689
|
"enabled": true,
|
|
417
|
-
"
|
|
418
|
-
"
|
|
690
|
+
"maxSize": 1000,
|
|
691
|
+
"ttl": 3600000,
|
|
692
|
+
"evictionPolicy": "lru"
|
|
693
|
+
},
|
|
694
|
+
"agents": {
|
|
695
|
+
"maxConcurrent": 5,
|
|
696
|
+
"defaultTimeout": 30000,
|
|
697
|
+
"retryAttempts": 3,
|
|
698
|
+
"claudeFlowEnabled": true
|
|
699
|
+
},
|
|
700
|
+
"services": {
|
|
701
|
+
"watcherEnabled": true,
|
|
702
|
+
"schedulerEnabled": true,
|
|
703
|
+
"syncEnabled": true,
|
|
704
|
+
"healthCheckInterval": 60000
|
|
705
|
+
},
|
|
706
|
+
"logging": {
|
|
707
|
+
"level": "info",
|
|
708
|
+
"format": "text"
|
|
419
709
|
},
|
|
420
710
|
"analyzer": {
|
|
421
711
|
"targetDir": "docs-nn",
|
|
422
712
|
"createMOC": true,
|
|
423
713
|
"linkOriginal": true
|
|
714
|
+
},
|
|
715
|
+
"claudeFlow": {
|
|
716
|
+
"enabled": true,
|
|
717
|
+
"namespace": "knowledge-graph",
|
|
718
|
+
"syncOnChange": true
|
|
424
719
|
}
|
|
425
720
|
}
|
|
426
721
|
```
|
|
427
722
|
|
|
428
|
-
|
|
723
|
+
---
|
|
429
724
|
|
|
430
|
-
|
|
725
|
+
## Programmatic Usage
|
|
431
726
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
- **NEW**: Automatic categorization based on content analysis
|
|
438
|
-
- **NEW**: MOC (Map of Content) generation for navigation
|
|
439
|
-
- **NEW**: Obsidian-style callouts (`> [!info]`, `> [!warning]`)
|
|
440
|
-
- **NEW**: Research area detection and TODO extraction
|
|
441
|
-
- **NEW**: Cross-reference building between related documents
|
|
442
|
-
- **IMPROVED**: Enhanced frontmatter generation with more fields
|
|
727
|
+
```typescript
|
|
728
|
+
import {
|
|
729
|
+
// Core
|
|
730
|
+
createKnowledgeGraph,
|
|
731
|
+
createDatabase,
|
|
443
732
|
|
|
444
|
-
|
|
733
|
+
// Initialization
|
|
734
|
+
quickInit,
|
|
735
|
+
initDocs,
|
|
736
|
+
generateClaudeMd,
|
|
445
737
|
|
|
446
|
-
|
|
447
|
-
|
|
738
|
+
// Analysis
|
|
739
|
+
analyzeDocs,
|
|
740
|
+
convertDocs,
|
|
741
|
+
addFrontmatter,
|
|
742
|
+
analyzeSeed,
|
|
743
|
+
initPrimitives,
|
|
744
|
+
|
|
745
|
+
// Agents
|
|
746
|
+
BaseAgent,
|
|
747
|
+
getRegistry,
|
|
748
|
+
AgentType,
|
|
749
|
+
createTask,
|
|
750
|
+
|
|
751
|
+
// Services
|
|
752
|
+
createServiceManager,
|
|
753
|
+
createConfigManager,
|
|
754
|
+
createHealthMonitor,
|
|
755
|
+
|
|
756
|
+
// Enterprise
|
|
757
|
+
createChunker,
|
|
758
|
+
createBackupManager,
|
|
759
|
+
createIntegrityChecker,
|
|
760
|
+
createAdvancedCache,
|
|
761
|
+
|
|
762
|
+
// Reasoning
|
|
763
|
+
createDecisionTracker,
|
|
764
|
+
|
|
765
|
+
// Types
|
|
766
|
+
type KGConfiguration,
|
|
767
|
+
type AgentConfig,
|
|
768
|
+
type ChunkOptions,
|
|
769
|
+
} from '@weavelogic/knowledge-graph-agent';
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
---
|
|
773
|
+
|
|
774
|
+
## Changelog
|
|
775
|
+
|
|
776
|
+
### v0.4.0 (Phase 4 - Enterprise Features)
|
|
777
|
+
|
|
778
|
+
- **NEW**: `Chunker` with 5 chunking strategies (fixed, semantic, markdown, code, adaptive)
|
|
779
|
+
- **NEW**: `BackupManager` with gzip compression and SHA-256 checksums
|
|
780
|
+
- **NEW**: `IntegrityChecker` for database validation and repair
|
|
781
|
+
- **NEW**: `AdvancedCache` with LRU/LFU/FIFO/TTL eviction policies
|
|
782
|
+
- **NEW**: `kg diag` CLI commands for diagnostics and troubleshooting
|
|
783
|
+
- **NEW**: Tag-based cache operations
|
|
784
|
+
- **NEW**: Automatic backup scheduling
|
|
785
|
+
|
|
786
|
+
### v0.3.0 (Phase 3 - Advanced Integration)
|
|
787
|
+
|
|
788
|
+
- **NEW**: `ServiceManager` for background process management
|
|
789
|
+
- **NEW**: `ConfigManager` with migration support and validation
|
|
790
|
+
- **NEW**: `HealthMonitor` with component health checks and alerts
|
|
791
|
+
- **NEW**: `DecisionTracker` for AI reasoning explainability
|
|
792
|
+
- **NEW**: `kg config` CLI commands
|
|
793
|
+
- **IMPROVED**: Health check history and performance metrics
|
|
794
|
+
|
|
795
|
+
### v0.2.0 (Phase 2 - Core Features)
|
|
796
|
+
|
|
797
|
+
- **NEW**: Agent system with BaseAgent and specialized agents
|
|
798
|
+
- **NEW**: `RulesEngine` for automation
|
|
799
|
+
- **NEW**: `WorkflowRegistry` for multi-step workflows
|
|
800
|
+
- **NEW**: `VaultMemorySync` for memory synchronization
|
|
801
|
+
- **NEW**: Git integration with auto-commit
|
|
802
|
+
- **NEW**: MCP Server with 20+ tools
|
|
803
|
+
- **NEW**: `kg commit` CLI commands
|
|
804
|
+
|
|
805
|
+
### v0.1.0 (Phase 1 - Cultivation System)
|
|
806
|
+
|
|
807
|
+
- **NEW**: `SeedGenerator` for codebase analysis
|
|
808
|
+
- **NEW**: `DeepAnalyzer` with claude-flow integration
|
|
809
|
+
- **NEW**: `init-primitives` and `cultivate` CLI commands
|
|
810
|
+
- **NEW**: Shadow Cache for file change tracking
|
|
811
|
+
- Initial knowledge graph generation
|
|
448
812
|
- Docs initialization
|
|
449
813
|
- CLAUDE.md management
|
|
450
|
-
- Claude-flow integration
|
|
451
814
|
- Full-text search
|
|
452
815
|
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
## Roadmap
|
|
819
|
+
|
|
820
|
+
### Planned Features
|
|
821
|
+
|
|
822
|
+
- [ ] Real-time collaboration support
|
|
823
|
+
- [ ] Plugin system for custom analyzers
|
|
824
|
+
- [ ] GraphQL API for queries
|
|
825
|
+
- [ ] Web dashboard for visualization
|
|
826
|
+
- [ ] Distributed caching with Redis
|
|
827
|
+
- [ ] Webhook integrations
|
|
828
|
+
|
|
829
|
+
### Deprecated Features
|
|
830
|
+
|
|
831
|
+
- None currently
|
|
832
|
+
|
|
833
|
+
---
|
|
834
|
+
|
|
453
835
|
## API Reference
|
|
454
836
|
|
|
455
837
|
See [docs/API.md](./docs/API.md) for detailed API documentation.
|