@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,1033 @@
|
|
|
1
|
+
import { readFile, mkdir, writeFile, readdir, stat } from "fs/promises";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { join, dirname, basename } from "path";
|
|
4
|
+
import matter from "gray-matter";
|
|
5
|
+
import { createLogger } from "../utils/logger.js";
|
|
6
|
+
const logger = createLogger("seed-generator");
|
|
7
|
+
class SeedGenerator {
|
|
8
|
+
vaultContext;
|
|
9
|
+
projectRoot;
|
|
10
|
+
startTime = 0;
|
|
11
|
+
filesScanned = 0;
|
|
12
|
+
constructor(vaultContext, projectRoot) {
|
|
13
|
+
this.vaultContext = vaultContext;
|
|
14
|
+
this.projectRoot = projectRoot;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a SeedGenerator from project paths
|
|
18
|
+
*/
|
|
19
|
+
static async create(projectRoot, docsPath) {
|
|
20
|
+
const vaultRoot = join(projectRoot, docsPath);
|
|
21
|
+
const allFiles = await SeedGenerator.collectVaultFiles(vaultRoot);
|
|
22
|
+
let primitives;
|
|
23
|
+
let features;
|
|
24
|
+
let techSpecs;
|
|
25
|
+
try {
|
|
26
|
+
primitives = await readFile(join(vaultRoot, "PRIMITIVES.md"), "utf-8");
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
features = await readFile(join(vaultRoot, "features.md"), "utf-8");
|
|
31
|
+
} catch {
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
techSpecs = await readFile(join(vaultRoot, "tech-specs.md"), "utf-8");
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
const vaultContext = {
|
|
38
|
+
vaultRoot,
|
|
39
|
+
allFiles,
|
|
40
|
+
primitives,
|
|
41
|
+
features,
|
|
42
|
+
techSpecs
|
|
43
|
+
};
|
|
44
|
+
return new SeedGenerator(vaultContext, projectRoot);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Collect all markdown files in vault
|
|
48
|
+
*/
|
|
49
|
+
static async collectVaultFiles(vaultRoot) {
|
|
50
|
+
const files = [];
|
|
51
|
+
async function walk(dir) {
|
|
52
|
+
try {
|
|
53
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
const fullPath = join(dir, entry.name);
|
|
56
|
+
if (entry.isDirectory() && !entry.name.startsWith(".")) {
|
|
57
|
+
await walk(fullPath);
|
|
58
|
+
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
59
|
+
files.push(fullPath);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await walk(vaultRoot);
|
|
66
|
+
return files;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Analyze entire codebase and generate seed data
|
|
70
|
+
*/
|
|
71
|
+
async analyze() {
|
|
72
|
+
this.startTime = Date.now();
|
|
73
|
+
this.filesScanned = 0;
|
|
74
|
+
logger.info("Starting codebase analysis", { projectRoot: this.projectRoot });
|
|
75
|
+
const analysis = {
|
|
76
|
+
dependencies: [],
|
|
77
|
+
services: [],
|
|
78
|
+
frameworks: [],
|
|
79
|
+
languages: [],
|
|
80
|
+
deployments: [],
|
|
81
|
+
existingConcepts: [],
|
|
82
|
+
existingFeatures: [],
|
|
83
|
+
metadata: {
|
|
84
|
+
analyzedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
85
|
+
projectRoot: this.projectRoot,
|
|
86
|
+
filesScanned: 0,
|
|
87
|
+
duration: 0
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
await this.analyzeDependencies(analysis);
|
|
91
|
+
await this.analyzeVaultDocuments(analysis);
|
|
92
|
+
await this.analyzeServices(analysis);
|
|
93
|
+
await this.analyzeDeployments(analysis);
|
|
94
|
+
this.classifyDependencies(analysis);
|
|
95
|
+
analysis.languages = [...new Set(analysis.languages)];
|
|
96
|
+
analysis.metadata.filesScanned = this.filesScanned;
|
|
97
|
+
analysis.metadata.duration = Date.now() - this.startTime;
|
|
98
|
+
logger.info("Analysis complete", {
|
|
99
|
+
dependencies: analysis.dependencies.length,
|
|
100
|
+
frameworks: analysis.frameworks.length,
|
|
101
|
+
services: analysis.services.length,
|
|
102
|
+
languages: analysis.languages.length,
|
|
103
|
+
duration: analysis.metadata.duration
|
|
104
|
+
});
|
|
105
|
+
return analysis;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Generate primitive nodes from seed analysis
|
|
109
|
+
*/
|
|
110
|
+
async generatePrimitives(analysis) {
|
|
111
|
+
const documents = [];
|
|
112
|
+
const frameworkNames = new Set(analysis.frameworks.map((f) => f.name.toLowerCase()));
|
|
113
|
+
logger.info("Generating primitives", {
|
|
114
|
+
frameworks: analysis.frameworks.length,
|
|
115
|
+
dependencies: analysis.dependencies.length,
|
|
116
|
+
services: analysis.services.length
|
|
117
|
+
});
|
|
118
|
+
for (const framework of analysis.frameworks) {
|
|
119
|
+
const doc = this.generateFrameworkNode(framework, analysis);
|
|
120
|
+
documents.push(doc);
|
|
121
|
+
}
|
|
122
|
+
for (const dep of analysis.dependencies) {
|
|
123
|
+
if (frameworkNames.has(dep.name.toLowerCase())) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (this.shouldGenerateNode(dep)) {
|
|
127
|
+
const doc = this.generateDependencyNode(dep, analysis);
|
|
128
|
+
documents.push(doc);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
for (const service of analysis.services) {
|
|
132
|
+
const doc = this.generateServiceNode(service, analysis);
|
|
133
|
+
documents.push(doc);
|
|
134
|
+
}
|
|
135
|
+
for (const language of analysis.languages) {
|
|
136
|
+
const doc = this.generateLanguageNode(language, analysis);
|
|
137
|
+
documents.push(doc);
|
|
138
|
+
}
|
|
139
|
+
logger.info("Generated primitives", { count: documents.length });
|
|
140
|
+
return documents;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Write generated documents to disk
|
|
144
|
+
*/
|
|
145
|
+
async writePrimitives(documents) {
|
|
146
|
+
const result = {
|
|
147
|
+
success: true,
|
|
148
|
+
analysis: {
|
|
149
|
+
dependencies: [],
|
|
150
|
+
services: [],
|
|
151
|
+
frameworks: [],
|
|
152
|
+
languages: [],
|
|
153
|
+
deployments: [],
|
|
154
|
+
existingConcepts: [],
|
|
155
|
+
existingFeatures: [],
|
|
156
|
+
metadata: {
|
|
157
|
+
analyzedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
158
|
+
projectRoot: this.projectRoot,
|
|
159
|
+
filesScanned: 0,
|
|
160
|
+
duration: 0
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
documentsGenerated: [],
|
|
164
|
+
directoriesCreated: [],
|
|
165
|
+
errors: [],
|
|
166
|
+
warnings: []
|
|
167
|
+
};
|
|
168
|
+
const createdDirs = /* @__PURE__ */ new Set();
|
|
169
|
+
for (const doc of documents) {
|
|
170
|
+
try {
|
|
171
|
+
const dir = dirname(doc.path);
|
|
172
|
+
if (!createdDirs.has(dir) && !existsSync(dir)) {
|
|
173
|
+
await mkdir(dir, { recursive: true });
|
|
174
|
+
createdDirs.add(dir);
|
|
175
|
+
result.directoriesCreated.push(dir);
|
|
176
|
+
}
|
|
177
|
+
if (existsSync(doc.path)) {
|
|
178
|
+
result.warnings.push(`File already exists, skipping: ${doc.path}`);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const frontmatterStr = matter.stringify(doc.content, doc.frontmatter);
|
|
182
|
+
await writeFile(doc.path, frontmatterStr, "utf-8");
|
|
183
|
+
result.documentsGenerated.push(doc);
|
|
184
|
+
logger.debug("Created primitive", { path: doc.path, title: doc.title });
|
|
185
|
+
} catch (error) {
|
|
186
|
+
const errorMsg = `Failed to write ${doc.path}: ${String(error)}`;
|
|
187
|
+
result.errors.push(errorMsg);
|
|
188
|
+
logger.error(errorMsg);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
result.success = result.errors.length === 0;
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Full init-primitives workflow
|
|
196
|
+
*/
|
|
197
|
+
async initPrimitives(options) {
|
|
198
|
+
const analysis = await this.analyze();
|
|
199
|
+
const documents = await this.generatePrimitives(analysis);
|
|
200
|
+
if (options?.dryRun) {
|
|
201
|
+
return {
|
|
202
|
+
success: true,
|
|
203
|
+
analysis,
|
|
204
|
+
documentsGenerated: documents,
|
|
205
|
+
directoriesCreated: [],
|
|
206
|
+
errors: [],
|
|
207
|
+
warnings: ["Dry run - no files written"]
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const result = await this.writePrimitives(documents);
|
|
211
|
+
result.analysis = analysis;
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
// ============================================================================
|
|
215
|
+
// Dependency Analysis Methods
|
|
216
|
+
// ============================================================================
|
|
217
|
+
async analyzeDependencies(analysis) {
|
|
218
|
+
await this.analyzePackageJson(analysis);
|
|
219
|
+
await this.analyzePython(analysis);
|
|
220
|
+
await this.analyzeComposer(analysis);
|
|
221
|
+
await this.analyzeCargo(analysis);
|
|
222
|
+
await this.analyzeGoMod(analysis);
|
|
223
|
+
await this.analyzeJava(analysis);
|
|
224
|
+
}
|
|
225
|
+
async analyzePackageJson(analysis) {
|
|
226
|
+
const packageJsonPaths = [
|
|
227
|
+
join(this.projectRoot, "package.json"),
|
|
228
|
+
join(this.projectRoot, "packages/*/package.json")
|
|
229
|
+
];
|
|
230
|
+
for (const path of [packageJsonPaths[0]]) {
|
|
231
|
+
try {
|
|
232
|
+
const content = await readFile(path, "utf-8");
|
|
233
|
+
const pkg = JSON.parse(content);
|
|
234
|
+
this.filesScanned++;
|
|
235
|
+
if (!analysis.languages.includes("javascript")) {
|
|
236
|
+
analysis.languages.push("javascript");
|
|
237
|
+
}
|
|
238
|
+
if (pkg.devDependencies?.typescript || pkg.dependencies?.typescript) {
|
|
239
|
+
if (!analysis.languages.includes("typescript")) {
|
|
240
|
+
analysis.languages.push("typescript");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
for (const [name, version] of Object.entries(pkg.dependencies || {})) {
|
|
244
|
+
const dep = this.createDependencyInfo(name, version, "nodejs", false);
|
|
245
|
+
analysis.dependencies.push(dep);
|
|
246
|
+
}
|
|
247
|
+
for (const [name, version] of Object.entries(pkg.devDependencies || {})) {
|
|
248
|
+
const dep = this.createDependencyInfo(name, version, "nodejs", true);
|
|
249
|
+
analysis.dependencies.push(dep);
|
|
250
|
+
}
|
|
251
|
+
} catch {
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
const packagesDir = join(this.projectRoot, "packages");
|
|
256
|
+
const entries = await readdir(packagesDir, { withFileTypes: true });
|
|
257
|
+
for (const entry of entries) {
|
|
258
|
+
if (entry.isDirectory()) {
|
|
259
|
+
const pkgPath = join(packagesDir, entry.name, "package.json");
|
|
260
|
+
try {
|
|
261
|
+
const content = await readFile(pkgPath, "utf-8");
|
|
262
|
+
const pkg = JSON.parse(content);
|
|
263
|
+
this.filesScanned++;
|
|
264
|
+
for (const [name, version] of Object.entries(pkg.dependencies || {})) {
|
|
265
|
+
if (!analysis.dependencies.some((d) => d.name === name && d.ecosystem === "nodejs")) {
|
|
266
|
+
const dep = this.createDependencyInfo(name, version, "nodejs", false);
|
|
267
|
+
analysis.dependencies.push(dep);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
} catch {
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} catch {
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
async analyzePython(analysis) {
|
|
278
|
+
const requirementsPaths = [
|
|
279
|
+
join(this.projectRoot, "requirements.txt"),
|
|
280
|
+
join(this.projectRoot, "requirements-dev.txt")
|
|
281
|
+
];
|
|
282
|
+
for (const path of requirementsPaths) {
|
|
283
|
+
try {
|
|
284
|
+
const content = await readFile(path, "utf-8");
|
|
285
|
+
const isDev = path.includes("dev");
|
|
286
|
+
this.filesScanned++;
|
|
287
|
+
if (!analysis.languages.includes("python")) {
|
|
288
|
+
analysis.languages.push("python");
|
|
289
|
+
}
|
|
290
|
+
for (const line of content.split("\n")) {
|
|
291
|
+
const trimmed = line.trim();
|
|
292
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
293
|
+
const match = trimmed.match(/^([a-zA-Z0-9-_]+)(?:==|>=|<=|~=|>|<)?(.+)?$/);
|
|
294
|
+
if (match) {
|
|
295
|
+
const [, name, version] = match;
|
|
296
|
+
const dep = this.createDependencyInfo(name, version?.trim() || "latest", "python", isDev);
|
|
297
|
+
analysis.dependencies.push(dep);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
} catch {
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
try {
|
|
304
|
+
const content = await readFile(join(this.projectRoot, "pyproject.toml"), "utf-8");
|
|
305
|
+
this.filesScanned++;
|
|
306
|
+
const depMatch = content.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?=\[|$)/);
|
|
307
|
+
if (depMatch) {
|
|
308
|
+
for (const line of depMatch[1].split("\n")) {
|
|
309
|
+
const match = line.match(/^([a-zA-Z0-9-_]+)\s*=\s*"([^"]+)"/);
|
|
310
|
+
if (match) {
|
|
311
|
+
const [, name, version] = match;
|
|
312
|
+
if (name !== "python") {
|
|
313
|
+
const dep = this.createDependencyInfo(name, version, "python", false);
|
|
314
|
+
analysis.dependencies.push(dep);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
} catch {
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
async analyzeComposer(analysis) {
|
|
323
|
+
try {
|
|
324
|
+
const content = await readFile(join(this.projectRoot, "composer.json"), "utf-8");
|
|
325
|
+
const composer = JSON.parse(content);
|
|
326
|
+
this.filesScanned++;
|
|
327
|
+
if (!analysis.languages.includes("php")) {
|
|
328
|
+
analysis.languages.push("php");
|
|
329
|
+
}
|
|
330
|
+
for (const [name, version] of Object.entries(composer.require || {})) {
|
|
331
|
+
if (name === "php") continue;
|
|
332
|
+
const dep = this.createDependencyInfo(name, version, "php", false);
|
|
333
|
+
analysis.dependencies.push(dep);
|
|
334
|
+
}
|
|
335
|
+
for (const [name, version] of Object.entries(composer["require-dev"] || {})) {
|
|
336
|
+
const dep = this.createDependencyInfo(name, version, "php", true);
|
|
337
|
+
analysis.dependencies.push(dep);
|
|
338
|
+
}
|
|
339
|
+
} catch {
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async analyzeCargo(analysis) {
|
|
343
|
+
try {
|
|
344
|
+
const content = await readFile(join(this.projectRoot, "Cargo.toml"), "utf-8");
|
|
345
|
+
this.filesScanned++;
|
|
346
|
+
if (!analysis.languages.includes("rust")) {
|
|
347
|
+
analysis.languages.push("rust");
|
|
348
|
+
}
|
|
349
|
+
const depMatch = content.match(/\[dependencies\]([\s\S]*?)(?=\[|$)/);
|
|
350
|
+
if (depMatch) {
|
|
351
|
+
for (const line of depMatch[1].split("\n")) {
|
|
352
|
+
const match = line.match(/^([a-zA-Z0-9-_]+)\s*=\s*"([^"]+)"/);
|
|
353
|
+
if (match) {
|
|
354
|
+
const [, name, version] = match;
|
|
355
|
+
const dep = this.createDependencyInfo(name, version, "rust", false);
|
|
356
|
+
dep.repository = `https://crates.io/crates/${name}`;
|
|
357
|
+
analysis.dependencies.push(dep);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
} catch {
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
async analyzeGoMod(analysis) {
|
|
365
|
+
try {
|
|
366
|
+
const content = await readFile(join(this.projectRoot, "go.mod"), "utf-8");
|
|
367
|
+
this.filesScanned++;
|
|
368
|
+
if (!analysis.languages.includes("go")) {
|
|
369
|
+
analysis.languages.push("go");
|
|
370
|
+
}
|
|
371
|
+
let inRequire = false;
|
|
372
|
+
for (const line of content.split("\n")) {
|
|
373
|
+
if (line.trim() === "require (") {
|
|
374
|
+
inRequire = true;
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (line.trim() === ")") {
|
|
378
|
+
inRequire = false;
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
if (inRequire || line.trim().startsWith("require ")) {
|
|
382
|
+
const match = line.match(/([a-zA-Z0-9.-]+\/[a-zA-Z0-9.-/]+)\s+v([0-9.]+)/);
|
|
383
|
+
if (match) {
|
|
384
|
+
const [, name, version] = match;
|
|
385
|
+
const dep = this.createDependencyInfo(name, version, "go", false);
|
|
386
|
+
dep.documentation = [`https://pkg.go.dev/${name}`];
|
|
387
|
+
dep.repository = `https://${name}`;
|
|
388
|
+
analysis.dependencies.push(dep);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
} catch {
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async analyzeJava(analysis) {
|
|
396
|
+
try {
|
|
397
|
+
const content = await readFile(join(this.projectRoot, "pom.xml"), "utf-8");
|
|
398
|
+
this.filesScanned++;
|
|
399
|
+
if (!analysis.languages.includes("java")) {
|
|
400
|
+
analysis.languages.push("java");
|
|
401
|
+
}
|
|
402
|
+
const depMatches = content.matchAll(
|
|
403
|
+
/<dependency>[\s\S]*?<groupId>([^<]+)<\/groupId>[\s\S]*?<artifactId>([^<]+)<\/artifactId>[\s\S]*?(?:<version>([^<]+)<\/version>)?[\s\S]*?<\/dependency>/g
|
|
404
|
+
);
|
|
405
|
+
for (const match of depMatches) {
|
|
406
|
+
const [, groupId, artifactId, version] = match;
|
|
407
|
+
const name = `${groupId}:${artifactId}`;
|
|
408
|
+
const dep = this.createDependencyInfo(name, version || "latest", "java", false);
|
|
409
|
+
dep.documentation = [`https://mvnrepository.com/artifact/${groupId}/${artifactId}`];
|
|
410
|
+
analysis.dependencies.push(dep);
|
|
411
|
+
}
|
|
412
|
+
} catch {
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
const content = await readFile(join(this.projectRoot, "build.gradle"), "utf-8");
|
|
416
|
+
this.filesScanned++;
|
|
417
|
+
if (!analysis.languages.includes("java")) {
|
|
418
|
+
analysis.languages.push("java");
|
|
419
|
+
}
|
|
420
|
+
} catch {
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
createDependencyInfo(name, version, ecosystem, isDev) {
|
|
424
|
+
return {
|
|
425
|
+
name,
|
|
426
|
+
version,
|
|
427
|
+
type: this.inferDependencyType(name),
|
|
428
|
+
category: this.inferCategory(name),
|
|
429
|
+
ecosystem,
|
|
430
|
+
documentation: this.getDocumentationLinks(name, ecosystem),
|
|
431
|
+
repository: this.getRepositoryUrl(name, ecosystem),
|
|
432
|
+
usedBy: [],
|
|
433
|
+
relatedTo: [],
|
|
434
|
+
isDev
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
// ============================================================================
|
|
438
|
+
// Vault Document Analysis
|
|
439
|
+
// ============================================================================
|
|
440
|
+
async analyzeVaultDocuments(analysis) {
|
|
441
|
+
for (const filePath of this.vaultContext.allFiles) {
|
|
442
|
+
try {
|
|
443
|
+
const content = await readFile(filePath, "utf-8");
|
|
444
|
+
const { data } = matter(content);
|
|
445
|
+
this.filesScanned++;
|
|
446
|
+
if (data.type === "concept") {
|
|
447
|
+
analysis.existingConcepts.push(data.title || basename(filePath, ".md"));
|
|
448
|
+
} else if (data.type === "feature") {
|
|
449
|
+
analysis.existingFeatures.push(data.title || basename(filePath, ".md"));
|
|
450
|
+
}
|
|
451
|
+
const contentLower = content.toLowerCase();
|
|
452
|
+
for (const dep of analysis.dependencies) {
|
|
453
|
+
if (contentLower.includes(dep.name.toLowerCase())) {
|
|
454
|
+
dep.usedBy.push(data.title || basename(filePath, ".md"));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
} catch {
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
// ============================================================================
|
|
462
|
+
// Service Analysis
|
|
463
|
+
// ============================================================================
|
|
464
|
+
async analyzeServices(analysis) {
|
|
465
|
+
const serviceFiles = [
|
|
466
|
+
"docker-compose.yml",
|
|
467
|
+
"docker-compose.yaml",
|
|
468
|
+
"compose.yml",
|
|
469
|
+
"compose.yaml"
|
|
470
|
+
];
|
|
471
|
+
for (const file of serviceFiles) {
|
|
472
|
+
try {
|
|
473
|
+
const content = await readFile(join(this.projectRoot, file), "utf-8");
|
|
474
|
+
this.filesScanned++;
|
|
475
|
+
const lines = content.split("\n");
|
|
476
|
+
let inServices = false;
|
|
477
|
+
let currentService = null;
|
|
478
|
+
let currentIndent = 0;
|
|
479
|
+
const serviceData = /* @__PURE__ */ new Map();
|
|
480
|
+
for (const line of lines) {
|
|
481
|
+
if (line.match(/^services:\s*$/)) {
|
|
482
|
+
inServices = true;
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
if (inServices && line.match(/^[a-zA-Z]+:\s*$/)) {
|
|
486
|
+
inServices = false;
|
|
487
|
+
currentService = null;
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (!inServices) continue;
|
|
491
|
+
const serviceMatch = line.match(/^ ([a-zA-Z0-9-_]+):\s*$/);
|
|
492
|
+
if (serviceMatch) {
|
|
493
|
+
currentService = serviceMatch[1];
|
|
494
|
+
if (!["volumes", "networks", "secrets", "configs"].includes(currentService)) {
|
|
495
|
+
serviceData.set(currentService, { ports: [] });
|
|
496
|
+
} else {
|
|
497
|
+
currentService = null;
|
|
498
|
+
}
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (currentService && serviceData.has(currentService)) {
|
|
502
|
+
const data = serviceData.get(currentService);
|
|
503
|
+
const imageMatch = line.match(/^\s+image:\s*(.+)$/);
|
|
504
|
+
if (imageMatch) {
|
|
505
|
+
data.image = imageMatch[1].trim();
|
|
506
|
+
}
|
|
507
|
+
const portMatch = line.match(/^\s+-\s*["']?(\d+)(?::\d+)?["']?/);
|
|
508
|
+
if (portMatch) {
|
|
509
|
+
data.ports.push(portMatch[1]);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
for (const [name, data] of serviceData.entries()) {
|
|
514
|
+
const service = {
|
|
515
|
+
name,
|
|
516
|
+
type: this.inferServiceType(name, data.image),
|
|
517
|
+
technology: data.image?.split(":")[0] || "unknown",
|
|
518
|
+
dependencies: [],
|
|
519
|
+
ports: data.ports.map((p) => parseInt(p, 10))
|
|
520
|
+
};
|
|
521
|
+
analysis.services.push(service);
|
|
522
|
+
}
|
|
523
|
+
} catch {
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
extractPorts(portsSection) {
|
|
528
|
+
if (!portsSection) return [];
|
|
529
|
+
const ports = [];
|
|
530
|
+
const matches = portsSection.matchAll(/(\d+)(?::\d+)?/g);
|
|
531
|
+
for (const match of matches) {
|
|
532
|
+
ports.push(parseInt(match[1], 10));
|
|
533
|
+
}
|
|
534
|
+
return ports;
|
|
535
|
+
}
|
|
536
|
+
// ============================================================================
|
|
537
|
+
// Deployment Analysis
|
|
538
|
+
// ============================================================================
|
|
539
|
+
async analyzeDeployments(analysis) {
|
|
540
|
+
const deploymentIndicators = [
|
|
541
|
+
"Dockerfile",
|
|
542
|
+
"docker-compose.yml",
|
|
543
|
+
".github/workflows",
|
|
544
|
+
"vercel.json",
|
|
545
|
+
"netlify.toml",
|
|
546
|
+
"railway.json",
|
|
547
|
+
"fly.toml",
|
|
548
|
+
"render.yaml",
|
|
549
|
+
"kubernetes",
|
|
550
|
+
"k8s"
|
|
551
|
+
];
|
|
552
|
+
for (const indicator of deploymentIndicators) {
|
|
553
|
+
try {
|
|
554
|
+
await stat(join(this.projectRoot, indicator));
|
|
555
|
+
analysis.deployments.push(indicator);
|
|
556
|
+
} catch {
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
// ============================================================================
|
|
561
|
+
// Classification Methods
|
|
562
|
+
// ============================================================================
|
|
563
|
+
classifyDependencies(analysis) {
|
|
564
|
+
const frameworkKeywords = [
|
|
565
|
+
"express",
|
|
566
|
+
"fastify",
|
|
567
|
+
"koa",
|
|
568
|
+
"hapi",
|
|
569
|
+
"nest",
|
|
570
|
+
"react",
|
|
571
|
+
"vue",
|
|
572
|
+
"angular",
|
|
573
|
+
"svelte",
|
|
574
|
+
"solid",
|
|
575
|
+
"next",
|
|
576
|
+
"nuxt",
|
|
577
|
+
"gatsby",
|
|
578
|
+
"remix",
|
|
579
|
+
"astro",
|
|
580
|
+
"django",
|
|
581
|
+
"flask",
|
|
582
|
+
"fastapi",
|
|
583
|
+
"rails",
|
|
584
|
+
"laravel",
|
|
585
|
+
"spring",
|
|
586
|
+
"quarkus",
|
|
587
|
+
"micronaut",
|
|
588
|
+
"actix",
|
|
589
|
+
"rocket",
|
|
590
|
+
"axum",
|
|
591
|
+
"gin",
|
|
592
|
+
"echo",
|
|
593
|
+
"fiber"
|
|
594
|
+
];
|
|
595
|
+
for (const dep of analysis.dependencies) {
|
|
596
|
+
const nameLower = dep.name.toLowerCase();
|
|
597
|
+
if (frameworkKeywords.some((fw) => nameLower.includes(fw))) {
|
|
598
|
+
dep.type = "framework";
|
|
599
|
+
if (!analysis.frameworks.some((f) => f.name === dep.name)) {
|
|
600
|
+
analysis.frameworks.push(dep);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
inferDependencyType(name) {
|
|
606
|
+
const nameLower = name.toLowerCase();
|
|
607
|
+
if (nameLower.includes("eslint") || nameLower.includes("prettier") || nameLower.includes("webpack") || nameLower.includes("vite") || nameLower.includes("rollup") || nameLower.includes("esbuild")) {
|
|
608
|
+
return "tool";
|
|
609
|
+
}
|
|
610
|
+
return "library";
|
|
611
|
+
}
|
|
612
|
+
inferCategory(name) {
|
|
613
|
+
const nameLower = name.toLowerCase();
|
|
614
|
+
if (["react", "vue", "angular", "svelte", "solid"].some((fw) => nameLower.includes(fw))) {
|
|
615
|
+
return "components/ui";
|
|
616
|
+
}
|
|
617
|
+
if (["radix", "shadcn", "chakra", "mui", "antd"].some((ui) => nameLower.includes(ui))) {
|
|
618
|
+
return "components/ui";
|
|
619
|
+
}
|
|
620
|
+
if (["express", "fastapi", "django", "flask", "next", "fastify", "koa", "hapi"].some((fw) => nameLower.includes(fw))) {
|
|
621
|
+
return "services/api";
|
|
622
|
+
}
|
|
623
|
+
if (["prisma", "typeorm", "sequelize", "mongoose", "pg", "mysql", "sqlite", "drizzle"].some((db) => nameLower.includes(db))) {
|
|
624
|
+
return "integrations/databases";
|
|
625
|
+
}
|
|
626
|
+
if (["auth", "passport", "jwt", "oauth", "clerk", "auth0", "nextauth"].some((auth) => nameLower.includes(auth))) {
|
|
627
|
+
return "integrations/auth-providers";
|
|
628
|
+
}
|
|
629
|
+
if (["test", "jest", "mocha", "vitest", "cypress", "playwright"].some((test) => nameLower.includes(test))) {
|
|
630
|
+
return "guides/testing";
|
|
631
|
+
}
|
|
632
|
+
if (["webpack", "vite", "rollup", "esbuild", "turbo", "nx"].some((tool) => nameLower.includes(tool))) {
|
|
633
|
+
return "standards/build-tools";
|
|
634
|
+
}
|
|
635
|
+
if (["eslint", "prettier", "stylelint", "biome"].some((lint) => nameLower.includes(lint))) {
|
|
636
|
+
return "standards/coding-standards";
|
|
637
|
+
}
|
|
638
|
+
if (nameLower.includes("@types") || nameLower.includes("typescript")) {
|
|
639
|
+
return "components/utilities";
|
|
640
|
+
}
|
|
641
|
+
return "components/utilities";
|
|
642
|
+
}
|
|
643
|
+
getDocumentationLinks(name, ecosystem) {
|
|
644
|
+
const links = [];
|
|
645
|
+
switch (ecosystem) {
|
|
646
|
+
case "nodejs":
|
|
647
|
+
links.push(`https://www.npmjs.com/package/${name}`);
|
|
648
|
+
break;
|
|
649
|
+
case "python":
|
|
650
|
+
links.push(`https://pypi.org/project/${name}/`);
|
|
651
|
+
break;
|
|
652
|
+
case "php":
|
|
653
|
+
links.push(`https://packagist.org/packages/${name}`);
|
|
654
|
+
break;
|
|
655
|
+
case "rust":
|
|
656
|
+
links.push(`https://crates.io/crates/${name}`);
|
|
657
|
+
break;
|
|
658
|
+
case "go":
|
|
659
|
+
links.push(`https://pkg.go.dev/${name}`);
|
|
660
|
+
break;
|
|
661
|
+
case "java":
|
|
662
|
+
if (name.includes(":")) {
|
|
663
|
+
const [group, artifact] = name.split(":");
|
|
664
|
+
links.push(`https://mvnrepository.com/artifact/${group}/${artifact}`);
|
|
665
|
+
}
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
return links;
|
|
669
|
+
}
|
|
670
|
+
getRepositoryUrl(name, ecosystem) {
|
|
671
|
+
return void 0;
|
|
672
|
+
}
|
|
673
|
+
inferServiceType(name, image) {
|
|
674
|
+
const nameLower = name.toLowerCase();
|
|
675
|
+
const imageLower = image?.toLowerCase() || "";
|
|
676
|
+
if (nameLower.includes("db") || nameLower.includes("database") || ["postgres", "mysql", "mongo", "mariadb"].some((db) => imageLower.includes(db))) {
|
|
677
|
+
return "database";
|
|
678
|
+
}
|
|
679
|
+
if (nameLower.includes("cache") || imageLower.includes("redis") || imageLower.includes("memcached")) {
|
|
680
|
+
return "cache";
|
|
681
|
+
}
|
|
682
|
+
if (nameLower.includes("queue") || ["rabbitmq", "kafka", "nats"].some((q) => imageLower.includes(q))) {
|
|
683
|
+
return "queue";
|
|
684
|
+
}
|
|
685
|
+
if (nameLower.includes("search") || ["elastic", "meilisearch", "typesense"].some((s) => imageLower.includes(s))) {
|
|
686
|
+
return "search";
|
|
687
|
+
}
|
|
688
|
+
if (nameLower.includes("api") || nameLower.includes("backend") || nameLower.includes("server")) {
|
|
689
|
+
return "api";
|
|
690
|
+
}
|
|
691
|
+
if (nameLower.includes("storage") || imageLower.includes("minio") || imageLower.includes("s3")) {
|
|
692
|
+
return "storage";
|
|
693
|
+
}
|
|
694
|
+
if (["prometheus", "grafana", "jaeger", "datadog"].some((m) => imageLower.includes(m))) {
|
|
695
|
+
return "monitoring";
|
|
696
|
+
}
|
|
697
|
+
return "compute";
|
|
698
|
+
}
|
|
699
|
+
shouldGenerateNode(dep) {
|
|
700
|
+
if (dep.type === "framework") return true;
|
|
701
|
+
const majorPackages = [
|
|
702
|
+
"react",
|
|
703
|
+
"vue",
|
|
704
|
+
"angular",
|
|
705
|
+
"svelte",
|
|
706
|
+
"typescript",
|
|
707
|
+
"webpack",
|
|
708
|
+
"vite",
|
|
709
|
+
"esbuild",
|
|
710
|
+
"jest",
|
|
711
|
+
"vitest",
|
|
712
|
+
"mocha",
|
|
713
|
+
"playwright",
|
|
714
|
+
"cypress",
|
|
715
|
+
"express",
|
|
716
|
+
"fastify",
|
|
717
|
+
"koa",
|
|
718
|
+
"next",
|
|
719
|
+
"nuxt",
|
|
720
|
+
"prisma",
|
|
721
|
+
"typeorm",
|
|
722
|
+
"sequelize",
|
|
723
|
+
"drizzle",
|
|
724
|
+
"axios",
|
|
725
|
+
"graphql",
|
|
726
|
+
"trpc",
|
|
727
|
+
"zod"
|
|
728
|
+
];
|
|
729
|
+
return majorPackages.some((pkg) => dep.name.toLowerCase().includes(pkg));
|
|
730
|
+
}
|
|
731
|
+
// ============================================================================
|
|
732
|
+
// Node Generation Methods
|
|
733
|
+
// ============================================================================
|
|
734
|
+
generateFrameworkNode(framework, analysis) {
|
|
735
|
+
const title = this.formatTitle(framework.name);
|
|
736
|
+
const content = this.buildFrameworkContent(framework, analysis);
|
|
737
|
+
const frontmatter = {
|
|
738
|
+
title,
|
|
739
|
+
type: "primitive",
|
|
740
|
+
category: framework.category,
|
|
741
|
+
ecosystem: framework.ecosystem,
|
|
742
|
+
version: framework.version,
|
|
743
|
+
status: "active",
|
|
744
|
+
tags: ["framework", framework.ecosystem, framework.category.split("/").pop() || ""],
|
|
745
|
+
documentation: framework.documentation,
|
|
746
|
+
repository: framework.repository,
|
|
747
|
+
used_by: framework.usedBy.slice(0, 10),
|
|
748
|
+
created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
749
|
+
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
750
|
+
};
|
|
751
|
+
return {
|
|
752
|
+
type: "primitive",
|
|
753
|
+
path: join(this.vaultContext.vaultRoot, framework.category, `${this.slugify(framework.name)}.md`),
|
|
754
|
+
title,
|
|
755
|
+
content,
|
|
756
|
+
frontmatter,
|
|
757
|
+
backlinks: []
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
generateDependencyNode(dep, analysis) {
|
|
761
|
+
const title = this.formatTitle(dep.name);
|
|
762
|
+
const content = this.buildDependencyContent(dep, analysis);
|
|
763
|
+
const frontmatter = {
|
|
764
|
+
title,
|
|
765
|
+
type: "primitive",
|
|
766
|
+
category: dep.category,
|
|
767
|
+
ecosystem: dep.ecosystem,
|
|
768
|
+
version: dep.version,
|
|
769
|
+
status: "active",
|
|
770
|
+
tags: [dep.type, dep.ecosystem, dep.category.split("/").pop() || ""],
|
|
771
|
+
documentation: dep.documentation,
|
|
772
|
+
repository: dep.repository,
|
|
773
|
+
used_by: dep.usedBy.slice(0, 10),
|
|
774
|
+
created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
775
|
+
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
776
|
+
};
|
|
777
|
+
return {
|
|
778
|
+
type: "primitive",
|
|
779
|
+
path: join(this.vaultContext.vaultRoot, dep.category, `${this.slugify(dep.name)}.md`),
|
|
780
|
+
title,
|
|
781
|
+
content,
|
|
782
|
+
frontmatter,
|
|
783
|
+
backlinks: []
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
generateServiceNode(service, analysis) {
|
|
787
|
+
const title = this.formatTitle(service.name);
|
|
788
|
+
const content = this.buildServiceContent(service, analysis);
|
|
789
|
+
const frontmatter = {
|
|
790
|
+
title,
|
|
791
|
+
type: "service",
|
|
792
|
+
category: "service",
|
|
793
|
+
service_type: service.type,
|
|
794
|
+
technology: service.technology,
|
|
795
|
+
status: "active",
|
|
796
|
+
tags: ["service", service.type, service.technology],
|
|
797
|
+
created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
798
|
+
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
799
|
+
};
|
|
800
|
+
return {
|
|
801
|
+
type: "service",
|
|
802
|
+
path: join(this.vaultContext.vaultRoot, "services", service.type, `${this.slugify(service.name)}.md`),
|
|
803
|
+
title,
|
|
804
|
+
content,
|
|
805
|
+
frontmatter,
|
|
806
|
+
backlinks: []
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
generateLanguageNode(language, analysis) {
|
|
810
|
+
const title = this.formatTitle(language);
|
|
811
|
+
const content = this.buildLanguageContent(language, analysis);
|
|
812
|
+
const frontmatter = {
|
|
813
|
+
title,
|
|
814
|
+
type: "standard",
|
|
815
|
+
category: "language",
|
|
816
|
+
status: "active",
|
|
817
|
+
tags: ["language", "programming"],
|
|
818
|
+
created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
819
|
+
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
820
|
+
};
|
|
821
|
+
return {
|
|
822
|
+
type: "standard",
|
|
823
|
+
path: join(this.vaultContext.vaultRoot, "standards", "programming-languages", `${language.toLowerCase()}.md`),
|
|
824
|
+
title,
|
|
825
|
+
content,
|
|
826
|
+
frontmatter,
|
|
827
|
+
backlinks: []
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
// ============================================================================
|
|
831
|
+
// Content Building Methods
|
|
832
|
+
// ============================================================================
|
|
833
|
+
buildFrameworkContent(framework, analysis) {
|
|
834
|
+
const sections = [];
|
|
835
|
+
sections.push(`# ${this.formatTitle(framework.name)}
|
|
836
|
+
`);
|
|
837
|
+
sections.push(`${framework.category} framework for ${framework.ecosystem}.
|
|
838
|
+
`);
|
|
839
|
+
sections.push(`## Overview
|
|
840
|
+
`);
|
|
841
|
+
sections.push(`**Version:** ${framework.version}`);
|
|
842
|
+
sections.push(`**Type:** ${framework.type}`);
|
|
843
|
+
sections.push(`**Ecosystem:** ${framework.ecosystem}
|
|
844
|
+
`);
|
|
845
|
+
if (framework.usedBy.length > 0) {
|
|
846
|
+
sections.push(`## Usage in This Project
|
|
847
|
+
`);
|
|
848
|
+
framework.usedBy.slice(0, 10).forEach((feature) => {
|
|
849
|
+
sections.push(`- [[${this.slugify(feature)}|${feature}]]`);
|
|
850
|
+
});
|
|
851
|
+
sections.push("");
|
|
852
|
+
}
|
|
853
|
+
if (framework.documentation && framework.documentation.length > 0) {
|
|
854
|
+
sections.push(`## Documentation
|
|
855
|
+
`);
|
|
856
|
+
framework.documentation.forEach((url) => {
|
|
857
|
+
sections.push(`- [${this.getLinkText(url)}](${url})`);
|
|
858
|
+
});
|
|
859
|
+
sections.push("");
|
|
860
|
+
}
|
|
861
|
+
if (framework.repository) {
|
|
862
|
+
sections.push(`## Repository
|
|
863
|
+
`);
|
|
864
|
+
sections.push(`- [Source Code](${framework.repository})
|
|
865
|
+
`);
|
|
866
|
+
}
|
|
867
|
+
const related = this.findRelatedTechnologies(framework, analysis);
|
|
868
|
+
if (related.length > 0) {
|
|
869
|
+
sections.push(`## Related Primitives
|
|
870
|
+
`);
|
|
871
|
+
related.forEach((rel) => {
|
|
872
|
+
sections.push(`- [[${this.slugify(rel)}]]`);
|
|
873
|
+
});
|
|
874
|
+
sections.push("");
|
|
875
|
+
}
|
|
876
|
+
return sections.join("\n");
|
|
877
|
+
}
|
|
878
|
+
buildDependencyContent(dep, analysis) {
|
|
879
|
+
const sections = [];
|
|
880
|
+
sections.push(`# ${this.formatTitle(dep.name)}
|
|
881
|
+
`);
|
|
882
|
+
sections.push(`${dep.category} ${dep.type} for ${dep.ecosystem}.
|
|
883
|
+
`);
|
|
884
|
+
sections.push(`## Overview
|
|
885
|
+
`);
|
|
886
|
+
sections.push(`**Version:** ${dep.version}`);
|
|
887
|
+
sections.push(`**Type:** ${dep.type}
|
|
888
|
+
`);
|
|
889
|
+
if (dep.usedBy.length > 0) {
|
|
890
|
+
sections.push(`## Usage
|
|
891
|
+
`);
|
|
892
|
+
dep.usedBy.slice(0, 10).forEach((ref) => {
|
|
893
|
+
sections.push(`- [[${this.slugify(ref)}|${ref}]]`);
|
|
894
|
+
});
|
|
895
|
+
if (dep.usedBy.length > 10) {
|
|
896
|
+
sections.push(`- ...and ${dep.usedBy.length - 10} more`);
|
|
897
|
+
}
|
|
898
|
+
sections.push("");
|
|
899
|
+
}
|
|
900
|
+
if (dep.documentation && dep.documentation.length > 0) {
|
|
901
|
+
sections.push(`## Documentation
|
|
902
|
+
`);
|
|
903
|
+
dep.documentation.forEach((url) => {
|
|
904
|
+
sections.push(`- [${this.getLinkText(url)}](${url})`);
|
|
905
|
+
});
|
|
906
|
+
sections.push("");
|
|
907
|
+
}
|
|
908
|
+
return sections.join("\n");
|
|
909
|
+
}
|
|
910
|
+
buildServiceContent(service, analysis) {
|
|
911
|
+
const sections = [];
|
|
912
|
+
sections.push(`# ${this.formatTitle(service.name)}
|
|
913
|
+
`);
|
|
914
|
+
sections.push(`${service.type} service using ${service.technology}.
|
|
915
|
+
`);
|
|
916
|
+
sections.push(`## Service Details
|
|
917
|
+
`);
|
|
918
|
+
sections.push(`**Type:** ${service.type}`);
|
|
919
|
+
sections.push(`**Technology:** ${service.technology}`);
|
|
920
|
+
if (service.framework) {
|
|
921
|
+
sections.push(`**Framework:** [[${this.slugify(service.framework)}|${service.framework}]]`);
|
|
922
|
+
}
|
|
923
|
+
if (service.language) {
|
|
924
|
+
sections.push(`**Language:** [[${service.language}]]`);
|
|
925
|
+
}
|
|
926
|
+
sections.push("");
|
|
927
|
+
if (service.ports && service.ports.length > 0) {
|
|
928
|
+
sections.push(`## Ports
|
|
929
|
+
`);
|
|
930
|
+
service.ports.forEach((port) => {
|
|
931
|
+
sections.push(`- ${port}`);
|
|
932
|
+
});
|
|
933
|
+
sections.push("");
|
|
934
|
+
}
|
|
935
|
+
if (service.dependencies.length > 0) {
|
|
936
|
+
sections.push(`## Dependencies
|
|
937
|
+
`);
|
|
938
|
+
service.dependencies.forEach((dep) => {
|
|
939
|
+
sections.push(`- [[${this.slugify(dep)}]]`);
|
|
940
|
+
});
|
|
941
|
+
sections.push("");
|
|
942
|
+
}
|
|
943
|
+
return sections.join("\n");
|
|
944
|
+
}
|
|
945
|
+
buildLanguageContent(language, analysis) {
|
|
946
|
+
const sections = [];
|
|
947
|
+
const langLower = language.toLowerCase();
|
|
948
|
+
sections.push(`# ${this.formatTitle(language)}
|
|
949
|
+
`);
|
|
950
|
+
sections.push(`Programming language used in this project.
|
|
951
|
+
`);
|
|
952
|
+
const frameworks = analysis.frameworks.filter(
|
|
953
|
+
(f) => f.ecosystem === langLower || langLower === "javascript" && f.ecosystem === "nodejs" || langLower === "typescript" && f.ecosystem === "nodejs"
|
|
954
|
+
);
|
|
955
|
+
const dependencies = analysis.dependencies.filter(
|
|
956
|
+
(d) => d.ecosystem === langLower || langLower === "javascript" && d.ecosystem === "nodejs" || langLower === "typescript" && d.ecosystem === "nodejs"
|
|
957
|
+
);
|
|
958
|
+
if (frameworks.length > 0) {
|
|
959
|
+
sections.push(`## Frameworks
|
|
960
|
+
`);
|
|
961
|
+
frameworks.slice(0, 10).forEach((fw) => {
|
|
962
|
+
sections.push(`- [[${this.slugify(fw.name)}|${this.formatTitle(fw.name)}]]`);
|
|
963
|
+
});
|
|
964
|
+
sections.push("");
|
|
965
|
+
}
|
|
966
|
+
if (dependencies.length > 0) {
|
|
967
|
+
sections.push(`## Libraries (${dependencies.length})
|
|
968
|
+
`);
|
|
969
|
+
sections.push(`This project uses ${dependencies.length} ${language} dependencies.
|
|
970
|
+
`);
|
|
971
|
+
}
|
|
972
|
+
sections.push(`## Resources
|
|
973
|
+
`);
|
|
974
|
+
sections.push(`- [Official Documentation](${this.getLanguageDocUrl(language)})`);
|
|
975
|
+
sections.push("");
|
|
976
|
+
return sections.join("\n");
|
|
977
|
+
}
|
|
978
|
+
// ============================================================================
|
|
979
|
+
// Helper Methods
|
|
980
|
+
// ============================================================================
|
|
981
|
+
findRelatedTechnologies(dep, analysis) {
|
|
982
|
+
const related = [];
|
|
983
|
+
for (const other of analysis.frameworks) {
|
|
984
|
+
if (other.name !== dep.name && other.category === dep.category) {
|
|
985
|
+
related.push(other.name);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return related.slice(0, 5);
|
|
989
|
+
}
|
|
990
|
+
formatTitle(name) {
|
|
991
|
+
return name.split(/[-_/]/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
992
|
+
}
|
|
993
|
+
slugify(text) {
|
|
994
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
995
|
+
}
|
|
996
|
+
getLinkText(url) {
|
|
997
|
+
if (url.includes("github.com")) return "GitHub";
|
|
998
|
+
if (url.includes("npmjs.com")) return "NPM";
|
|
999
|
+
if (url.includes("pypi.org")) return "PyPI";
|
|
1000
|
+
if (url.includes("crates.io")) return "Crates.io";
|
|
1001
|
+
if (url.includes("pkg.go.dev")) return "Go Docs";
|
|
1002
|
+
if (url.includes("packagist.org")) return "Packagist";
|
|
1003
|
+
if (url.includes("mvnrepository.com")) return "Maven";
|
|
1004
|
+
return "Documentation";
|
|
1005
|
+
}
|
|
1006
|
+
getLanguageDocUrl(language) {
|
|
1007
|
+
const urls = {
|
|
1008
|
+
"javascript": "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
|
|
1009
|
+
"typescript": "https://www.typescriptlang.org/docs/",
|
|
1010
|
+
"python": "https://docs.python.org/",
|
|
1011
|
+
"php": "https://www.php.net/docs.php",
|
|
1012
|
+
"rust": "https://doc.rust-lang.org/",
|
|
1013
|
+
"go": "https://go.dev/doc/",
|
|
1014
|
+
"java": "https://docs.oracle.com/en/java/",
|
|
1015
|
+
"ruby": "https://www.ruby-lang.org/en/documentation/"
|
|
1016
|
+
};
|
|
1017
|
+
return urls[language.toLowerCase()] || `https://www.google.com/search?q=${language}+documentation`;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
async function analyzeSeed(projectRoot, docsPath) {
|
|
1021
|
+
const generator = await SeedGenerator.create(projectRoot, docsPath);
|
|
1022
|
+
return generator.analyze();
|
|
1023
|
+
}
|
|
1024
|
+
async function initPrimitives(projectRoot, docsPath, options) {
|
|
1025
|
+
const generator = await SeedGenerator.create(projectRoot, docsPath);
|
|
1026
|
+
return generator.initPrimitives(options);
|
|
1027
|
+
}
|
|
1028
|
+
export {
|
|
1029
|
+
SeedGenerator,
|
|
1030
|
+
analyzeSeed,
|
|
1031
|
+
initPrimitives
|
|
1032
|
+
};
|
|
1033
|
+
//# sourceMappingURL=seed-generator.js.map
|