openlore 2.0.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/LICENSE +21 -0
- package/README.md +268 -0
- package/dist/api/analyze.d.ts +17 -0
- package/dist/api/analyze.d.ts.map +1 -0
- package/dist/api/analyze.js +143 -0
- package/dist/api/analyze.js.map +1 -0
- package/dist/api/audit.d.ts +10 -0
- package/dist/api/audit.d.ts.map +1 -0
- package/dist/api/audit.js +117 -0
- package/dist/api/audit.js.map +1 -0
- package/dist/api/decisions.d.ts +55 -0
- package/dist/api/decisions.d.ts.map +1 -0
- package/dist/api/decisions.js +157 -0
- package/dist/api/decisions.js.map +1 -0
- package/dist/api/drift.d.ts +21 -0
- package/dist/api/drift.d.ts.map +1 -0
- package/dist/api/drift.js +152 -0
- package/dist/api/drift.js.map +1 -0
- package/dist/api/generate.d.ts +18 -0
- package/dist/api/generate.d.ts.map +1 -0
- package/dist/api/generate.js +259 -0
- package/dist/api/generate.js.map +1 -0
- package/dist/api/index.d.ts +41 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +34 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/init.d.ts +18 -0
- package/dist/api/init.d.ts.map +1 -0
- package/dist/api/init.js +83 -0
- package/dist/api/init.js.map +1 -0
- package/dist/api/run.d.ts +19 -0
- package/dist/api/run.d.ts.map +1 -0
- package/dist/api/run.js +312 -0
- package/dist/api/run.js.map +1 -0
- package/dist/api/specs.d.ts +49 -0
- package/dist/api/specs.d.ts.map +1 -0
- package/dist/api/specs.js +137 -0
- package/dist/api/specs.js.map +1 -0
- package/dist/api/types.d.ts +201 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +9 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/verify.d.ts +20 -0
- package/dist/api/verify.d.ts.map +1 -0
- package/dist/api/verify.js +117 -0
- package/dist/api/verify.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +30 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +683 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +98 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/decisions.d.ts +16 -0
- package/dist/cli/commands/decisions.d.ts.map +1 -0
- package/dist/cli/commands/decisions.js +864 -0
- package/dist/cli/commands/decisions.js.map +1 -0
- package/dist/cli/commands/digest.d.ts +9 -0
- package/dist/cli/commands/digest.d.ts.map +1 -0
- package/dist/cli/commands/digest.js +61 -0
- package/dist/cli/commands/digest.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +398 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/drift.d.ts +9 -0
- package/dist/cli/commands/drift.d.ts.map +1 -0
- package/dist/cli/commands/drift.js +550 -0
- package/dist/cli/commands/drift.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +9 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +565 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +173 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +2235 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +1384 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/refresh-stories.d.ts +10 -0
- package/dist/cli/commands/refresh-stories.d.ts.map +1 -0
- package/dist/cli/commands/refresh-stories.js +314 -0
- package/dist/cli/commands/refresh-stories.js.map +1 -0
- package/dist/cli/commands/run.d.ts +9 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +459 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +19 -0
- package/dist/cli/commands/setup.d.ts.map +1 -0
- package/dist/cli/commands/setup.js +355 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/commands/test.d.ts +22 -0
- package/dist/cli/commands/test.d.ts.map +1 -0
- package/dist/cli/commands/test.js +180 -0
- package/dist/cli/commands/test.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +9 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +383 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/commands/view.d.ts +13 -0
- package/dist/cli/commands/view.d.ts.map +1 -0
- package/dist/cli/commands/view.js +547 -0
- package/dist/cli/commands/view.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +118 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/tui-approval.d.ts +11 -0
- package/dist/cli/tui-approval.d.ts.map +1 -0
- package/dist/cli/tui-approval.js +129 -0
- package/dist/cli/tui-approval.js.map +1 -0
- package/dist/constants.d.ts +314 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +382 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/analyzer/ai-config-generator.d.ts +54 -0
- package/dist/core/analyzer/ai-config-generator.d.ts.map +1 -0
- package/dist/core/analyzer/ai-config-generator.js +98 -0
- package/dist/core/analyzer/ai-config-generator.js.map +1 -0
- package/dist/core/analyzer/architecture-writer.d.ts +67 -0
- package/dist/core/analyzer/architecture-writer.d.ts.map +1 -0
- package/dist/core/analyzer/architecture-writer.js +209 -0
- package/dist/core/analyzer/architecture-writer.js.map +1 -0
- package/dist/core/analyzer/artifact-generator.d.ts +261 -0
- package/dist/core/analyzer/artifact-generator.d.ts.map +1 -0
- package/dist/core/analyzer/artifact-generator.js +909 -0
- package/dist/core/analyzer/artifact-generator.js.map +1 -0
- package/dist/core/analyzer/ast-chunker.d.ts +24 -0
- package/dist/core/analyzer/ast-chunker.d.ts.map +1 -0
- package/dist/core/analyzer/ast-chunker.js +198 -0
- package/dist/core/analyzer/ast-chunker.js.map +1 -0
- package/dist/core/analyzer/call-graph.d.ts +162 -0
- package/dist/core/analyzer/call-graph.d.ts.map +1 -0
- package/dist/core/analyzer/call-graph.js +2040 -0
- package/dist/core/analyzer/call-graph.js.map +1 -0
- package/dist/core/analyzer/code-shaper.d.ts +33 -0
- package/dist/core/analyzer/code-shaper.d.ts.map +1 -0
- package/dist/core/analyzer/code-shaper.js +154 -0
- package/dist/core/analyzer/code-shaper.js.map +1 -0
- package/dist/core/analyzer/codebase-digest.d.ts +40 -0
- package/dist/core/analyzer/codebase-digest.d.ts.map +1 -0
- package/dist/core/analyzer/codebase-digest.js +195 -0
- package/dist/core/analyzer/codebase-digest.js.map +1 -0
- package/dist/core/analyzer/cpp-header-resolver.d.ts +30 -0
- package/dist/core/analyzer/cpp-header-resolver.d.ts.map +1 -0
- package/dist/core/analyzer/cpp-header-resolver.js +71 -0
- package/dist/core/analyzer/cpp-header-resolver.js.map +1 -0
- package/dist/core/analyzer/dependency-graph.d.ts +230 -0
- package/dist/core/analyzer/dependency-graph.d.ts.map +1 -0
- package/dist/core/analyzer/dependency-graph.js +752 -0
- package/dist/core/analyzer/dependency-graph.js.map +1 -0
- package/dist/core/analyzer/duplicate-detector.d.ts +52 -0
- package/dist/core/analyzer/duplicate-detector.d.ts.map +1 -0
- package/dist/core/analyzer/duplicate-detector.js +289 -0
- package/dist/core/analyzer/duplicate-detector.js.map +1 -0
- package/dist/core/analyzer/embedding-service.d.ts +56 -0
- package/dist/core/analyzer/embedding-service.d.ts.map +1 -0
- package/dist/core/analyzer/embedding-service.js +118 -0
- package/dist/core/analyzer/embedding-service.js.map +1 -0
- package/dist/core/analyzer/env-extractor.d.ts +33 -0
- package/dist/core/analyzer/env-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/env-extractor.js +196 -0
- package/dist/core/analyzer/env-extractor.js.map +1 -0
- package/dist/core/analyzer/external-packages.d.ts +20 -0
- package/dist/core/analyzer/external-packages.d.ts.map +1 -0
- package/dist/core/analyzer/external-packages.js +175 -0
- package/dist/core/analyzer/external-packages.js.map +1 -0
- package/dist/core/analyzer/file-walker.d.ts +78 -0
- package/dist/core/analyzer/file-walker.d.ts.map +1 -0
- package/dist/core/analyzer/file-walker.js +532 -0
- package/dist/core/analyzer/file-walker.js.map +1 -0
- package/dist/core/analyzer/function-registry-trie.d.ts +21 -0
- package/dist/core/analyzer/function-registry-trie.d.ts.map +1 -0
- package/dist/core/analyzer/function-registry-trie.js +39 -0
- package/dist/core/analyzer/function-registry-trie.js.map +1 -0
- package/dist/core/analyzer/http-route-parser.d.ts +152 -0
- package/dist/core/analyzer/http-route-parser.d.ts.map +1 -0
- package/dist/core/analyzer/http-route-parser.js +971 -0
- package/dist/core/analyzer/http-route-parser.js.map +1 -0
- package/dist/core/analyzer/import-parser.d.ts +100 -0
- package/dist/core/analyzer/import-parser.d.ts.map +1 -0
- package/dist/core/analyzer/import-parser.js +952 -0
- package/dist/core/analyzer/import-parser.js.map +1 -0
- package/dist/core/analyzer/import-resolver-bridge.d.ts +25 -0
- package/dist/core/analyzer/import-resolver-bridge.d.ts.map +1 -0
- package/dist/core/analyzer/import-resolver-bridge.js +99 -0
- package/dist/core/analyzer/import-resolver-bridge.js.map +1 -0
- package/dist/core/analyzer/index.d.ts +10 -0
- package/dist/core/analyzer/index.d.ts.map +1 -0
- package/dist/core/analyzer/index.js +10 -0
- package/dist/core/analyzer/index.js.map +1 -0
- package/dist/core/analyzer/middleware-extractor.d.ts +29 -0
- package/dist/core/analyzer/middleware-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/middleware-extractor.js +195 -0
- package/dist/core/analyzer/middleware-extractor.js.map +1 -0
- package/dist/core/analyzer/refactor-analyzer.d.ts +83 -0
- package/dist/core/analyzer/refactor-analyzer.d.ts.map +1 -0
- package/dist/core/analyzer/refactor-analyzer.js +351 -0
- package/dist/core/analyzer/refactor-analyzer.js.map +1 -0
- package/dist/core/analyzer/repository-mapper.d.ts +150 -0
- package/dist/core/analyzer/repository-mapper.d.ts.map +1 -0
- package/dist/core/analyzer/repository-mapper.js +740 -0
- package/dist/core/analyzer/repository-mapper.js.map +1 -0
- package/dist/core/analyzer/schema-extractor.d.ts +41 -0
- package/dist/core/analyzer/schema-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/schema-extractor.js +229 -0
- package/dist/core/analyzer/schema-extractor.js.map +1 -0
- package/dist/core/analyzer/signature-extractor.d.ts +31 -0
- package/dist/core/analyzer/signature-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/signature-extractor.js +675 -0
- package/dist/core/analyzer/signature-extractor.js.map +1 -0
- package/dist/core/analyzer/significance-scorer.d.ts +79 -0
- package/dist/core/analyzer/significance-scorer.d.ts.map +1 -0
- package/dist/core/analyzer/significance-scorer.js +407 -0
- package/dist/core/analyzer/significance-scorer.js.map +1 -0
- package/dist/core/analyzer/spec-snapshot-generator.d.ts +17 -0
- package/dist/core/analyzer/spec-snapshot-generator.d.ts.map +1 -0
- package/dist/core/analyzer/spec-snapshot-generator.js +201 -0
- package/dist/core/analyzer/spec-snapshot-generator.js.map +1 -0
- package/dist/core/analyzer/spec-vector-index.d.ts +68 -0
- package/dist/core/analyzer/spec-vector-index.d.ts.map +1 -0
- package/dist/core/analyzer/spec-vector-index.js +340 -0
- package/dist/core/analyzer/spec-vector-index.js.map +1 -0
- package/dist/core/analyzer/subgraph-extractor.d.ts +51 -0
- package/dist/core/analyzer/subgraph-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/subgraph-extractor.js +147 -0
- package/dist/core/analyzer/subgraph-extractor.js.map +1 -0
- package/dist/core/analyzer/type-inference-engine.d.ts +23 -0
- package/dist/core/analyzer/type-inference-engine.d.ts.map +1 -0
- package/dist/core/analyzer/type-inference-engine.js +130 -0
- package/dist/core/analyzer/type-inference-engine.js.map +1 -0
- package/dist/core/analyzer/ui-component-extractor.d.ts +43 -0
- package/dist/core/analyzer/ui-component-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/ui-component-extractor.js +245 -0
- package/dist/core/analyzer/ui-component-extractor.js.map +1 -0
- package/dist/core/analyzer/unified-search.d.ts +116 -0
- package/dist/core/analyzer/unified-search.d.ts.map +1 -0
- package/dist/core/analyzer/unified-search.js +231 -0
- package/dist/core/analyzer/unified-search.js.map +1 -0
- package/dist/core/analyzer/vector-index.d.ts +92 -0
- package/dist/core/analyzer/vector-index.d.ts.map +1 -0
- package/dist/core/analyzer/vector-index.js +451 -0
- package/dist/core/analyzer/vector-index.js.map +1 -0
- package/dist/core/decisions/consolidator.d.ts +14 -0
- package/dist/core/decisions/consolidator.d.ts.map +1 -0
- package/dist/core/decisions/consolidator.js +169 -0
- package/dist/core/decisions/consolidator.js.map +1 -0
- package/dist/core/decisions/extractor.d.ts +26 -0
- package/dist/core/decisions/extractor.d.ts.map +1 -0
- package/dist/core/decisions/extractor.js +156 -0
- package/dist/core/decisions/extractor.js.map +1 -0
- package/dist/core/decisions/index.d.ts +19 -0
- package/dist/core/decisions/index.d.ts.map +1 -0
- package/dist/core/decisions/index.js +16 -0
- package/dist/core/decisions/index.js.map +1 -0
- package/dist/core/decisions/store.d.ts +36 -0
- package/dist/core/decisions/store.d.ts.map +1 -0
- package/dist/core/decisions/store.js +109 -0
- package/dist/core/decisions/store.js.map +1 -0
- package/dist/core/decisions/syncer.d.ts +27 -0
- package/dist/core/decisions/syncer.d.ts.map +1 -0
- package/dist/core/decisions/syncer.js +214 -0
- package/dist/core/decisions/syncer.js.map +1 -0
- package/dist/core/decisions/verifier.d.ts +20 -0
- package/dist/core/decisions/verifier.d.ts.map +1 -0
- package/dist/core/decisions/verifier.js +115 -0
- package/dist/core/decisions/verifier.js.map +1 -0
- package/dist/core/digest/digest-generator.d.ts +29 -0
- package/dist/core/digest/digest-generator.d.ts.map +1 -0
- package/dist/core/digest/digest-generator.js +181 -0
- package/dist/core/digest/digest-generator.js.map +1 -0
- package/dist/core/drift/drift-detector.d.ts +102 -0
- package/dist/core/drift/drift-detector.d.ts.map +1 -0
- package/dist/core/drift/drift-detector.js +598 -0
- package/dist/core/drift/drift-detector.js.map +1 -0
- package/dist/core/drift/git-diff.d.ts +60 -0
- package/dist/core/drift/git-diff.d.ts.map +1 -0
- package/dist/core/drift/git-diff.js +383 -0
- package/dist/core/drift/git-diff.js.map +1 -0
- package/dist/core/drift/index.d.ts +12 -0
- package/dist/core/drift/index.d.ts.map +1 -0
- package/dist/core/drift/index.js +9 -0
- package/dist/core/drift/index.js.map +1 -0
- package/dist/core/drift/spec-mapper.d.ts +73 -0
- package/dist/core/drift/spec-mapper.d.ts.map +1 -0
- package/dist/core/drift/spec-mapper.js +353 -0
- package/dist/core/drift/spec-mapper.js.map +1 -0
- package/dist/core/drift/test-suggester.d.ts +18 -0
- package/dist/core/drift/test-suggester.d.ts.map +1 -0
- package/dist/core/drift/test-suggester.js +107 -0
- package/dist/core/drift/test-suggester.js.map +1 -0
- package/dist/core/generator/adr-generator.d.ts +32 -0
- package/dist/core/generator/adr-generator.d.ts.map +1 -0
- package/dist/core/generator/adr-generator.js +192 -0
- package/dist/core/generator/adr-generator.js.map +1 -0
- package/dist/core/generator/index.d.ts +9 -0
- package/dist/core/generator/index.d.ts.map +1 -0
- package/dist/core/generator/index.js +12 -0
- package/dist/core/generator/index.js.map +1 -0
- package/dist/core/generator/mapping-generator.d.ts +54 -0
- package/dist/core/generator/mapping-generator.d.ts.map +1 -0
- package/dist/core/generator/mapping-generator.js +240 -0
- package/dist/core/generator/mapping-generator.js.map +1 -0
- package/dist/core/generator/openspec-compat.d.ts +160 -0
- package/dist/core/generator/openspec-compat.d.ts.map +1 -0
- package/dist/core/generator/openspec-compat.js +524 -0
- package/dist/core/generator/openspec-compat.js.map +1 -0
- package/dist/core/generator/openspec-format-generator.d.ts +131 -0
- package/dist/core/generator/openspec-format-generator.d.ts.map +1 -0
- package/dist/core/generator/openspec-format-generator.js +963 -0
- package/dist/core/generator/openspec-format-generator.js.map +1 -0
- package/dist/core/generator/openspec-writer.d.ts +130 -0
- package/dist/core/generator/openspec-writer.d.ts.map +1 -0
- package/dist/core/generator/openspec-writer.js +404 -0
- package/dist/core/generator/openspec-writer.js.map +1 -0
- package/dist/core/generator/prompts.d.ts +35 -0
- package/dist/core/generator/prompts.d.ts.map +1 -0
- package/dist/core/generator/prompts.js +212 -0
- package/dist/core/generator/prompts.js.map +1 -0
- package/dist/core/generator/rag-manifest-generator.d.ts +37 -0
- package/dist/core/generator/rag-manifest-generator.d.ts.map +1 -0
- package/dist/core/generator/rag-manifest-generator.js +134 -0
- package/dist/core/generator/rag-manifest-generator.js.map +1 -0
- package/dist/core/generator/schemas.d.ts +365 -0
- package/dist/core/generator/schemas.d.ts.map +1 -0
- package/dist/core/generator/schemas.js +190 -0
- package/dist/core/generator/schemas.js.map +1 -0
- package/dist/core/generator/spec-pipeline.d.ts +123 -0
- package/dist/core/generator/spec-pipeline.d.ts.map +1 -0
- package/dist/core/generator/spec-pipeline.js +699 -0
- package/dist/core/generator/spec-pipeline.js.map +1 -0
- package/dist/core/generator/stages/stage1-survey.d.ts +19 -0
- package/dist/core/generator/stages/stage1-survey.d.ts.map +1 -0
- package/dist/core/generator/stages/stage1-survey.js +171 -0
- package/dist/core/generator/stages/stage1-survey.js.map +1 -0
- package/dist/core/generator/stages/stage2-entities.d.ts +11 -0
- package/dist/core/generator/stages/stage2-entities.d.ts.map +1 -0
- package/dist/core/generator/stages/stage2-entities.js +74 -0
- package/dist/core/generator/stages/stage2-entities.js.map +1 -0
- package/dist/core/generator/stages/stage3-services.d.ts +11 -0
- package/dist/core/generator/stages/stage3-services.d.ts.map +1 -0
- package/dist/core/generator/stages/stage3-services.js +85 -0
- package/dist/core/generator/stages/stage3-services.js.map +1 -0
- package/dist/core/generator/stages/stage4-api.d.ts +11 -0
- package/dist/core/generator/stages/stage4-api.d.ts.map +1 -0
- package/dist/core/generator/stages/stage4-api.js +72 -0
- package/dist/core/generator/stages/stage4-api.js.map +1 -0
- package/dist/core/generator/stages/stage5-architecture.d.ts +11 -0
- package/dist/core/generator/stages/stage5-architecture.d.ts.map +1 -0
- package/dist/core/generator/stages/stage5-architecture.js +75 -0
- package/dist/core/generator/stages/stage5-architecture.js.map +1 -0
- package/dist/core/generator/stages/stage6-adr.d.ts +8 -0
- package/dist/core/generator/stages/stage6-adr.d.ts.map +1 -0
- package/dist/core/generator/stages/stage6-adr.js +47 -0
- package/dist/core/generator/stages/stage6-adr.js.map +1 -0
- package/dist/core/services/chat-agent.d.ts +50 -0
- package/dist/core/services/chat-agent.d.ts.map +1 -0
- package/dist/core/services/chat-agent.js +369 -0
- package/dist/core/services/chat-agent.js.map +1 -0
- package/dist/core/services/chat-tools.d.ts +32 -0
- package/dist/core/services/chat-tools.d.ts.map +1 -0
- package/dist/core/services/chat-tools.js +494 -0
- package/dist/core/services/chat-tools.js.map +1 -0
- package/dist/core/services/config-manager.d.ts +61 -0
- package/dist/core/services/config-manager.d.ts.map +1 -0
- package/dist/core/services/config-manager.js +149 -0
- package/dist/core/services/config-manager.js.map +1 -0
- package/dist/core/services/edge-store.d.ts +57 -0
- package/dist/core/services/edge-store.d.ts.map +1 -0
- package/dist/core/services/edge-store.js +419 -0
- package/dist/core/services/edge-store.js.map +1 -0
- package/dist/core/services/gitignore-manager.d.ts +29 -0
- package/dist/core/services/gitignore-manager.d.ts.map +1 -0
- package/dist/core/services/gitignore-manager.js +95 -0
- package/dist/core/services/gitignore-manager.js.map +1 -0
- package/dist/core/services/index.d.ts +8 -0
- package/dist/core/services/index.d.ts.map +1 -0
- package/dist/core/services/index.js +8 -0
- package/dist/core/services/index.js.map +1 -0
- package/dist/core/services/llm-service.d.ts +379 -0
- package/dist/core/services/llm-service.d.ts.map +1 -0
- package/dist/core/services/llm-service.js +1553 -0
- package/dist/core/services/llm-service.js.map +1 -0
- package/dist/core/services/mcp-handlers/analysis.d.ts +127 -0
- package/dist/core/services/mcp-handlers/analysis.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/analysis.js +1185 -0
- package/dist/core/services/mcp-handlers/analysis.js.map +1 -0
- package/dist/core/services/mcp-handlers/change.d.ts +14 -0
- package/dist/core/services/mcp-handlers/change.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/change.js +416 -0
- package/dist/core/services/mcp-handlers/change.js.map +1 -0
- package/dist/core/services/mcp-handlers/decisions.d.ts +16 -0
- package/dist/core/services/mcp-handlers/decisions.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/decisions.js +239 -0
- package/dist/core/services/mcp-handlers/decisions.js.map +1 -0
- package/dist/core/services/mcp-handlers/graph.d.ts +94 -0
- package/dist/core/services/mcp-handlers/graph.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/graph.js +693 -0
- package/dist/core/services/mcp-handlers/graph.js.map +1 -0
- package/dist/core/services/mcp-handlers/orient.d.ts +17 -0
- package/dist/core/services/mcp-handlers/orient.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/orient.js +357 -0
- package/dist/core/services/mcp-handlers/orient.js.map +1 -0
- package/dist/core/services/mcp-handlers/semantic.d.ts +66 -0
- package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/semantic.js +432 -0
- package/dist/core/services/mcp-handlers/semantic.js.map +1 -0
- package/dist/core/services/mcp-handlers/utils.d.ts +85 -0
- package/dist/core/services/mcp-handlers/utils.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/utils.js +262 -0
- package/dist/core/services/mcp-handlers/utils.js.map +1 -0
- package/dist/core/services/mcp-watcher.d.ts +41 -0
- package/dist/core/services/mcp-watcher.d.ts.map +1 -0
- package/dist/core/services/mcp-watcher.js +254 -0
- package/dist/core/services/mcp-watcher.js.map +1 -0
- package/dist/core/services/project-detector.d.ts +32 -0
- package/dist/core/services/project-detector.d.ts.map +1 -0
- package/dist/core/services/project-detector.js +100 -0
- package/dist/core/services/project-detector.js.map +1 -0
- package/dist/core/test-generator/coverage-analyzer.d.ts +27 -0
- package/dist/core/test-generator/coverage-analyzer.d.ts.map +1 -0
- package/dist/core/test-generator/coverage-analyzer.js +285 -0
- package/dist/core/test-generator/coverage-analyzer.js.map +1 -0
- package/dist/core/test-generator/framework-detector.d.ts +17 -0
- package/dist/core/test-generator/framework-detector.d.ts.map +1 -0
- package/dist/core/test-generator/framework-detector.js +65 -0
- package/dist/core/test-generator/framework-detector.js.map +1 -0
- package/dist/core/test-generator/index.d.ts +14 -0
- package/dist/core/test-generator/index.d.ts.map +1 -0
- package/dist/core/test-generator/index.js +11 -0
- package/dist/core/test-generator/index.js.map +1 -0
- package/dist/core/test-generator/renderers/catch2.d.ts +8 -0
- package/dist/core/test-generator/renderers/catch2.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/catch2.js +47 -0
- package/dist/core/test-generator/renderers/catch2.js.map +1 -0
- package/dist/core/test-generator/renderers/gtest.d.ts +8 -0
- package/dist/core/test-generator/renderers/gtest.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/gtest.js +45 -0
- package/dist/core/test-generator/renderers/gtest.js.map +1 -0
- package/dist/core/test-generator/renderers/index.d.ts +20 -0
- package/dist/core/test-generator/renderers/index.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/index.js +35 -0
- package/dist/core/test-generator/renderers/index.js.map +1 -0
- package/dist/core/test-generator/renderers/playwright.d.ts +8 -0
- package/dist/core/test-generator/renderers/playwright.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/playwright.js +44 -0
- package/dist/core/test-generator/renderers/playwright.js.map +1 -0
- package/dist/core/test-generator/renderers/pytest.d.ts +8 -0
- package/dist/core/test-generator/renderers/pytest.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/pytest.js +44 -0
- package/dist/core/test-generator/renderers/pytest.js.map +1 -0
- package/dist/core/test-generator/renderers/shared.d.ts +21 -0
- package/dist/core/test-generator/renderers/shared.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/shared.js +56 -0
- package/dist/core/test-generator/renderers/shared.js.map +1 -0
- package/dist/core/test-generator/renderers/vitest.d.ts +8 -0
- package/dist/core/test-generator/renderers/vitest.d.ts.map +1 -0
- package/dist/core/test-generator/renderers/vitest.js +52 -0
- package/dist/core/test-generator/renderers/vitest.js.map +1 -0
- package/dist/core/test-generator/scenario-parser.d.ts +33 -0
- package/dist/core/test-generator/scenario-parser.d.ts.map +1 -0
- package/dist/core/test-generator/scenario-parser.js +244 -0
- package/dist/core/test-generator/scenario-parser.js.map +1 -0
- package/dist/core/test-generator/test-generator.d.ts +30 -0
- package/dist/core/test-generator/test-generator.d.ts.map +1 -0
- package/dist/core/test-generator/test-generator.js +174 -0
- package/dist/core/test-generator/test-generator.js.map +1 -0
- package/dist/core/test-generator/test-writer.d.ts +25 -0
- package/dist/core/test-generator/test-writer.d.ts.map +1 -0
- package/dist/core/test-generator/test-writer.js +128 -0
- package/dist/core/test-generator/test-writer.js.map +1 -0
- package/dist/core/test-generator/then-matchers.d.ts +35 -0
- package/dist/core/test-generator/then-matchers.d.ts.map +1 -0
- package/dist/core/test-generator/then-matchers.js +211 -0
- package/dist/core/test-generator/then-matchers.js.map +1 -0
- package/dist/core/verifier/index.d.ts +5 -0
- package/dist/core/verifier/index.d.ts.map +1 -0
- package/dist/core/verifier/index.js +5 -0
- package/dist/core/verifier/index.js.map +1 -0
- package/dist/core/verifier/verification-engine.d.ts +293 -0
- package/dist/core/verifier/verification-engine.d.ts.map +1 -0
- package/dist/core/verifier/verification-engine.js +919 -0
- package/dist/core/verifier/verification-engine.js.map +1 -0
- package/dist/types/index.d.ts +368 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/pipeline.d.ts +167 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +5 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/types/test-generator.d.ts +103 -0
- package/dist/types/test-generator.d.ts.map +1 -0
- package/dist/types/test-generator.js +17 -0
- package/dist/types/test-generator.js.map +1 -0
- package/dist/utils/command-helpers.d.ts +68 -0
- package/dist/utils/command-helpers.d.ts.map +1 -0
- package/dist/utils/command-helpers.js +150 -0
- package/dist/utils/command-helpers.js.map +1 -0
- package/dist/utils/errors.d.ts +51 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +129 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +149 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +342 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/misc.d.ts +10 -0
- package/dist/utils/misc.d.ts.map +1 -0
- package/dist/utils/misc.js +21 -0
- package/dist/utils/misc.js.map +1 -0
- package/dist/utils/progress.d.ts +142 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +283 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/prompts.d.ts +53 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +199 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/shutdown.d.ts +89 -0
- package/dist/utils/shutdown.d.ts.map +1 -0
- package/dist/utils/shutdown.js +238 -0
- package/dist/utils/shutdown.js.map +1 -0
- package/examples/bmad/README.md +113 -0
- package/examples/bmad/agents/architect.md +226 -0
- package/examples/bmad/agents/dev-brownfield.md +69 -0
- package/examples/bmad/setup/architect.customize.yaml +14 -0
- package/examples/bmad/tasks/implement-story.md +254 -0
- package/examples/bmad/tasks/onboarding.md +169 -0
- package/examples/bmad/tasks/refactor.md +178 -0
- package/examples/bmad/tasks/sprint-planning.md +168 -0
- package/examples/bmad/templates/story.md +108 -0
- package/examples/cline-workflows/openlore-analyze-codebase.md +101 -0
- package/examples/cline-workflows/openlore-check-spec-drift.md +102 -0
- package/examples/cline-workflows/openlore-execute-refactor.md +212 -0
- package/examples/cline-workflows/openlore-implement-feature.md +266 -0
- package/examples/cline-workflows/openlore-plan-refactor.md +279 -0
- package/examples/cline-workflows/openlore-refactor-codebase.md +16 -0
- package/examples/cline-workflows/openlore-write-tests.md +177 -0
- package/examples/drift-demo/openspec/config.yaml +14 -0
- package/examples/drift-demo/openspec/specs/architecture/spec.md +30 -0
- package/examples/drift-demo/openspec/specs/auth/spec.md +71 -0
- package/examples/drift-demo/openspec/specs/database/spec.md +33 -0
- package/examples/drift-demo/openspec/specs/overview/spec.md +20 -0
- package/examples/drift-demo/openspec/specs/projects/spec.md +55 -0
- package/examples/drift-demo/openspec/specs/tasks/spec.md +78 -0
- package/examples/drift-demo/package.json +21 -0
- package/examples/drift-demo/src/auth/auth-middleware.ts +30 -0
- package/examples/drift-demo/src/auth/auth-routes.ts +29 -0
- package/examples/drift-demo/src/auth/auth-service.ts +45 -0
- package/examples/drift-demo/src/database/connection.ts +27 -0
- package/examples/drift-demo/src/index.ts +16 -0
- package/examples/drift-demo/src/projects/project-model.ts +15 -0
- package/examples/drift-demo/src/projects/project-service.ts +34 -0
- package/examples/drift-demo/src/tasks/task-model.ts +37 -0
- package/examples/drift-demo/src/tasks/task-routes.ts +53 -0
- package/examples/drift-demo/src/tasks/task-service.ts +60 -0
- package/examples/drift-demo/src/utils/validation.ts +11 -0
- package/examples/drift-demo/tests/auth.test.ts +4 -0
- package/examples/drift-demo/tests/tasks.test.ts +4 -0
- package/examples/drift-demo/tsconfig.json +10 -0
- package/examples/drift-test/run-drift-test.sh +1087 -0
- package/examples/gsd/README.md +119 -0
- package/examples/gsd/commands/gsd/openlore-drift.md +111 -0
- package/examples/gsd/commands/gsd/openlore-orient.md +191 -0
- package/examples/mistral-vibe/README.md +101 -0
- package/examples/mistral-vibe/antipatterns-template.md +18 -0
- package/examples/mistral-vibe/skills/openlore-analyze-codebase/SKILL.md +124 -0
- package/examples/mistral-vibe/skills/openlore-brainstorm/SKILL.md +379 -0
- package/examples/mistral-vibe/skills/openlore-debug/SKILL.md +330 -0
- package/examples/mistral-vibe/skills/openlore-execute-refactor/SKILL.md +291 -0
- package/examples/mistral-vibe/skills/openlore-generate/SKILL.md +245 -0
- package/examples/mistral-vibe/skills/openlore-implement-story/SKILL.md +326 -0
- package/examples/mistral-vibe/skills/openlore-plan-refactor/SKILL.md +365 -0
- package/examples/mistral-vibe/skills/openlore-review-changes/SKILL.md +128 -0
- package/examples/mistral-vibe/skills/openlore-write-tests/SKILL.md +261 -0
- package/examples/opencode/agent-guard.ts +170 -0
- package/examples/opencode/plugins/anti-laziness.ts +202 -0
- package/examples/opencode/plugins/lib/openlore-context-injector-helpers.ts +116 -0
- package/examples/opencode/plugins/lib/openlore-decision-extractor-helpers.ts +65 -0
- package/examples/opencode/plugins/openlore-context-injector.test.ts +211 -0
- package/examples/opencode/plugins/openlore-context-injector.ts +165 -0
- package/examples/opencode/plugins/openlore-decision-extractor.test.ts +131 -0
- package/examples/opencode/plugins/openlore-decision-extractor.ts +322 -0
- package/examples/opencode/plugins/openlore-enforcer.ts +227 -0
- package/examples/opencode/prompts/sisyphus-sdd.md +150 -0
- package/examples/opencode-skills/openlore-analyze-codebase/SKILL.md +101 -0
- package/examples/opencode-skills/openlore-brainstorm/SKILL.md +354 -0
- package/examples/opencode-skills/openlore-debug/SKILL.md +291 -0
- package/examples/opencode-skills/openlore-execute-refactor/SKILL.md +241 -0
- package/examples/opencode-skills/openlore-generate/SKILL.md +236 -0
- package/examples/opencode-skills/openlore-implement-story/SKILL.md +251 -0
- package/examples/opencode-skills/openlore-plan-refactor/SKILL.md +298 -0
- package/examples/opencode-skills/openlore-review-changes/SKILL.md +134 -0
- package/examples/opencode-skills/openlore-write-tests/SKILL.md +230 -0
- package/examples/openspec-analysis/README.md +59 -0
- package/examples/openspec-analysis/SUMMARY.md +72 -0
- package/examples/openspec-analysis/config.json +16 -0
- package/examples/openspec-analysis/dependencies.mermaid +35 -0
- package/examples/openspec-analysis/dependency-graph.json +12116 -0
- package/examples/openspec-analysis/llm-context.json +119 -0
- package/examples/openspec-analysis/repo-structure.json +871 -0
- package/examples/openspec-cli/README.md +67 -0
- package/examples/openspec-cli/openspec/config.yaml +26 -0
- package/examples/openspec-cli/openspec/specs/architecture/spec.md +178 -0
- package/examples/openspec-cli/openspec/specs/artifact-graph/spec.md +143 -0
- package/examples/openspec-cli/openspec/specs/cli/spec.md +138 -0
- package/examples/openspec-cli/openspec/specs/overview/spec.md +60 -0
- package/examples/openspec-cli/openspec/specs/parsing/spec.md +123 -0
- package/examples/openspec-cli/openspec/specs/validation/spec.md +108 -0
- package/examples/spec-kit/README.md +104 -0
- package/examples/spec-kit/commands/drift.md +87 -0
- package/examples/spec-kit/commands/orient.md +138 -0
- package/examples/spec-kit/extension.yml +54 -0
- package/package.json +125 -0
- package/src/viewer/InteractiveGraphViewer.jsx +1600 -0
- package/src/viewer/app/index.html +17 -0
- package/src/viewer/app/main.jsx +13 -0
- package/src/viewer/components/ArchitectureView.jsx +177 -0
- package/src/viewer/components/ChatPanel.jsx +450 -0
- package/src/viewer/components/ClassGraph.jsx +782 -0
- package/src/viewer/components/ClusterGraph.jsx +469 -0
- package/src/viewer/components/FilterBar.jsx +179 -0
- package/src/viewer/components/FlatGraph.jsx +282 -0
- package/src/viewer/components/MicroComponents.jsx +85 -0
- package/src/viewer/hooks/usePanZoom.js +79 -0
- package/src/viewer/utils/constants.js +64 -0
- package/src/viewer/utils/graph-helpers.js +303 -0
- package/src/viewer/utils/graph-helpers.test.ts +39 -0
- package/src/viewer/utils/themes.js +206 -0
- package/stubs/tree-sitter-cli-stub/package.json +6 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { CLUSTER_PALETTE } from './constants.js';
|
|
2
|
+
export { CLUSTER_PALETTE } from './constants.js';
|
|
3
|
+
export { CLUSTER_PALETTE_LIGHT } from './constants.js';
|
|
4
|
+
|
|
5
|
+
export function parseSpecRequirements(mdText) {
|
|
6
|
+
const reqs = {};
|
|
7
|
+
if (!mdText) return reqs;
|
|
8
|
+
const sections = mdText.split(/^#{3,4}\s+Requirement:\s*/m);
|
|
9
|
+
for (let i = 1; i < sections.length; i++) {
|
|
10
|
+
const lines = sections[i].split('\n');
|
|
11
|
+
const rawTitle = lines[0].trim();
|
|
12
|
+
if (!rawTitle) continue;
|
|
13
|
+
const body = lines.slice(1).join('\n').trim();
|
|
14
|
+
reqs[rawTitle] = { title: rawTitle, body };
|
|
15
|
+
}
|
|
16
|
+
return reqs;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function buildMappingIndex(mappingJson) {
|
|
20
|
+
const index = {};
|
|
21
|
+
if (!mappingJson?.mappings) return index;
|
|
22
|
+
for (const m of mappingJson.mappings) {
|
|
23
|
+
for (const fn of m.functions || []) {
|
|
24
|
+
const key = fn.file.replace(/\\/g, '/');
|
|
25
|
+
if (!index[key]) index[key] = [];
|
|
26
|
+
index[key].push({
|
|
27
|
+
requirement: m.requirement,
|
|
28
|
+
service: m.service,
|
|
29
|
+
domain: m.domain,
|
|
30
|
+
specFile: m.specFile,
|
|
31
|
+
fnName: fn.name,
|
|
32
|
+
fnLine: fn.line,
|
|
33
|
+
confidence: fn.confidence,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return index;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function normalizePath(p) {
|
|
41
|
+
return (p || '').replace(/\\/g, '/').replace(/^\/+/, '');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function parseGraph(raw, palette = CLUSTER_PALETTE) {
|
|
45
|
+
const clusterByNode = {};
|
|
46
|
+
(raw.clusters || []).forEach((cl, ci) => {
|
|
47
|
+
cl.files.forEach((fid) => {
|
|
48
|
+
clusterByNode[fid] = {
|
|
49
|
+
name: cl.name,
|
|
50
|
+
index: ci,
|
|
51
|
+
id: cl.id,
|
|
52
|
+
color: palette[ci % palette.length],
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const nodes = (raw.nodes || []).map((n) => ({
|
|
58
|
+
id: n.id,
|
|
59
|
+
label: n.file.name,
|
|
60
|
+
path: n.file.path,
|
|
61
|
+
ext: n.file.extension,
|
|
62
|
+
dir: n.file.directory,
|
|
63
|
+
lines: n.file.lines,
|
|
64
|
+
size: n.file.size,
|
|
65
|
+
isEntry: n.isEntryPoint,
|
|
66
|
+
isConfig: n.isConfig,
|
|
67
|
+
isTest: n.isTest,
|
|
68
|
+
score: n.importanceScore ?? 0,
|
|
69
|
+
cluster: clusterByNode[n.id] || { name: '?', index: 0, id: 'unknown', color: '#555' },
|
|
70
|
+
exports: n.exports || [],
|
|
71
|
+
tags: n.tags || [],
|
|
72
|
+
metrics: n.metrics || {},
|
|
73
|
+
refactor: null,
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
const edges = (raw.edges || []).map((e) => ({
|
|
77
|
+
id: `${e.source}->${e.target}`,
|
|
78
|
+
source: e.source,
|
|
79
|
+
target: e.target,
|
|
80
|
+
isType: e.isTypeOnly || false,
|
|
81
|
+
isCall: e.isCallEdge || false,
|
|
82
|
+
importedNames: e.importedNames || [],
|
|
83
|
+
}));
|
|
84
|
+
|
|
85
|
+
const clusters = (raw.clusters || []).map((cl, ci) => ({
|
|
86
|
+
id: cl.id,
|
|
87
|
+
name: cl.name,
|
|
88
|
+
files: cl.files,
|
|
89
|
+
color: palette[ci % palette.length],
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
nodes,
|
|
94
|
+
edges,
|
|
95
|
+
clusters,
|
|
96
|
+
structuralClusters: raw.structuralClusters || clusters.filter(c => c.internalEdges > 0),
|
|
97
|
+
directoryClusters: raw.directoryClusters || [],
|
|
98
|
+
statistics: raw.statistics || {},
|
|
99
|
+
rankings: raw.rankings || {},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function enrichGraphWithRefactors(graph, refReport) {
|
|
104
|
+
if (!graph || !refReport || !refReport.priorities) return graph;
|
|
105
|
+
|
|
106
|
+
const byFile = new Map();
|
|
107
|
+
refReport.priorities.forEach((entry) => {
|
|
108
|
+
const list = byFile.get(entry.file) || [];
|
|
109
|
+
list.push(entry);
|
|
110
|
+
byFile.set(entry.file, list);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const nodes = graph.nodes.map((n) => {
|
|
114
|
+
const entries = byFile.get(n.path) || [];
|
|
115
|
+
if (!entries.length) return { ...n, refactor: null };
|
|
116
|
+
|
|
117
|
+
let maxPriority = 0;
|
|
118
|
+
const issuesSet = new Set();
|
|
119
|
+
entries.forEach((e) => {
|
|
120
|
+
if (typeof e.priorityScore === 'number') {
|
|
121
|
+
maxPriority = Math.max(maxPriority, e.priorityScore);
|
|
122
|
+
}
|
|
123
|
+
(e.issues || []).forEach((iss) => issuesSet.add(iss));
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
...n,
|
|
128
|
+
refactor: {
|
|
129
|
+
functions: entries.length,
|
|
130
|
+
maxPriority,
|
|
131
|
+
issues: Array.from(issuesSet),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
...graph,
|
|
138
|
+
nodes,
|
|
139
|
+
refactorStats: refReport.stats || null,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function computeBlast(edges, nodeId) {
|
|
144
|
+
const affected = new Set();
|
|
145
|
+
const q = [nodeId];
|
|
146
|
+
while (q.length) {
|
|
147
|
+
const cur = q.shift();
|
|
148
|
+
edges.forEach((e) => {
|
|
149
|
+
if (e.source === cur && !affected.has(e.target)) {
|
|
150
|
+
affected.add(e.target);
|
|
151
|
+
q.push(e.target);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return [...affected];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function computeLayout(nodes, edges, W = 900, H = 540) {
|
|
159
|
+
if (!nodes.length) return {};
|
|
160
|
+
const pos = {};
|
|
161
|
+
|
|
162
|
+
const byCluster = {};
|
|
163
|
+
nodes.forEach((n) => {
|
|
164
|
+
if (!byCluster[n.cluster.id]) byCluster[n.cluster.id] = [];
|
|
165
|
+
byCluster[n.cluster.id].push(n.id);
|
|
166
|
+
});
|
|
167
|
+
const clIds = Object.keys(byCluster);
|
|
168
|
+
clIds.forEach((cid, ci) => {
|
|
169
|
+
const angle = (ci / clIds.length) * Math.PI * 2 - Math.PI / 2;
|
|
170
|
+
const cx = W / 2 + Math.cos(angle) * W * 0.33;
|
|
171
|
+
const cy = H / 2 + Math.sin(angle) * H * 0.3;
|
|
172
|
+
byCluster[cid].forEach((nid, mi) => {
|
|
173
|
+
const a2 = (mi / Math.max(byCluster[cid].length, 1)) * Math.PI * 2;
|
|
174
|
+
const r = Math.min(60, 13 * Math.sqrt(byCluster[cid].length));
|
|
175
|
+
pos[nid] = { x: cx + Math.cos(a2) * r, y: cy + Math.sin(a2) * r };
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const k = 55;
|
|
180
|
+
for (let iter = 0; iter < 80; iter++) {
|
|
181
|
+
const disp = {};
|
|
182
|
+
nodes.forEach((n) => {
|
|
183
|
+
disp[n.id] = { x: 0, y: 0 };
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
187
|
+
for (let j = i + 1; j < nodes.length; j++) {
|
|
188
|
+
const a = nodes[i],
|
|
189
|
+
b = nodes[j];
|
|
190
|
+
const dx = pos[a.id].x - pos[b.id].x;
|
|
191
|
+
const dy = pos[a.id].y - pos[b.id].y;
|
|
192
|
+
const d = Math.max(Math.sqrt(dx * dx + dy * dy), 0.01);
|
|
193
|
+
const f = (k * k) / d;
|
|
194
|
+
disp[a.id].x += (dx / d) * f;
|
|
195
|
+
disp[a.id].y += (dy / d) * f;
|
|
196
|
+
disp[b.id].x -= (dx / d) * f;
|
|
197
|
+
disp[b.id].y -= (dy / d) * f;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
edges.forEach((e) => {
|
|
202
|
+
if (!pos[e.source] || !pos[e.target]) return;
|
|
203
|
+
const dx = pos[e.source].x - pos[e.target].x;
|
|
204
|
+
const dy = pos[e.source].y - pos[e.target].y;
|
|
205
|
+
const d = Math.max(Math.sqrt(dx * dx + dy * dy), 0.01);
|
|
206
|
+
const f = (d * d) / (k * (e.isType ? 2 : 1));
|
|
207
|
+
disp[e.source].x -= (dx / d) * f;
|
|
208
|
+
disp[e.source].y -= (dy / d) * f;
|
|
209
|
+
disp[e.target].x += (dx / d) * f;
|
|
210
|
+
disp[e.target].y += (dy / d) * f;
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// Gravity toward center
|
|
214
|
+
const gravity = 0.04;
|
|
215
|
+
nodes.forEach((n) => {
|
|
216
|
+
disp[n.id].x += (W / 2 - pos[n.id].x) * gravity;
|
|
217
|
+
disp[n.id].y += (H / 2 - pos[n.id].y) * gravity;
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const temp = k * Math.max(0.05, 1 - iter / 80) * 0.5;
|
|
221
|
+
nodes.forEach((n) => {
|
|
222
|
+
const d = Math.sqrt(disp[n.id].x ** 2 + disp[n.id].y ** 2);
|
|
223
|
+
if (d > 0) {
|
|
224
|
+
pos[n.id].x += (disp[n.id].x / d) * Math.min(d, temp);
|
|
225
|
+
pos[n.id].y += (disp[n.id].y / d) * Math.min(d, temp);
|
|
226
|
+
}
|
|
227
|
+
pos[n.id].x = Math.max(36, Math.min(W - 36, pos[n.id].x));
|
|
228
|
+
pos[n.id].y = Math.max(36, Math.min(H - 36, pos[n.id].y));
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return pos;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function computeClusterLayout(clusters, W = 900, H = 540) {
|
|
235
|
+
const pos = {};
|
|
236
|
+
clusters.forEach((cl, i) => {
|
|
237
|
+
const angle = (i / clusters.length) * Math.PI * 2 - Math.PI / 2;
|
|
238
|
+
pos[cl.id] = {
|
|
239
|
+
x: W / 2 + Math.cos(angle) * W * 0.34,
|
|
240
|
+
y: H / 2 + Math.sin(angle) * H * 0.32,
|
|
241
|
+
};
|
|
242
|
+
});
|
|
243
|
+
return pos;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function inferClusterRole(entryCount, hubCount, fileCount) {
|
|
247
|
+
if (entryCount > fileCount * 0.5) return 'entry_layer';
|
|
248
|
+
if (hubCount > 0 && entryCount > 0) return 'orchestrator';
|
|
249
|
+
if (hubCount > 0) return 'core_utilities';
|
|
250
|
+
if (entryCount > 0) return 'api_layer';
|
|
251
|
+
return 'internal';
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function computeArchOverview(graph, llmCtx) {
|
|
255
|
+
if (!graph) return null;
|
|
256
|
+
|
|
257
|
+
const hubFiles = new Set((llmCtx?.callGraph?.hubFunctions ?? []).map(h => h.filePath));
|
|
258
|
+
const entryFiles = new Set((llmCtx?.callGraph?.entryPoints ?? []).map(e => e.filePath));
|
|
259
|
+
|
|
260
|
+
const clusterOfNode = {};
|
|
261
|
+
(graph.nodes ?? []).forEach(n => {
|
|
262
|
+
if (n.cluster?.id) clusterOfNode[n.id] = n.cluster.id;
|
|
263
|
+
const rel = n.path?.replace(/^\/+/, '') ?? '';
|
|
264
|
+
if (rel && n.cluster?.id) clusterOfNode[rel] = n.cluster.id;
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
const clusterEdges = {};
|
|
268
|
+
(graph.edges ?? []).forEach(e => {
|
|
269
|
+
const from = clusterOfNode[e.source];
|
|
270
|
+
const to = clusterOfNode[e.target];
|
|
271
|
+
if (from && to && from !== to) {
|
|
272
|
+
if (!clusterEdges[from]) clusterEdges[from] = new Set();
|
|
273
|
+
clusterEdges[from].add(to);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
const clusters = (graph.clusters ?? []).map(cl => {
|
|
278
|
+
const clNodes = (graph.nodes ?? []).filter(n => n.cluster?.id === cl.id);
|
|
279
|
+
const relPaths = clNodes.map(n => n.path?.replace(/^\/+/, '') ?? '');
|
|
280
|
+
const hubCount = relPaths.filter(p => hubFiles.has(p)).length;
|
|
281
|
+
const entryCount = relPaths.filter(p => entryFiles.has(p)).length;
|
|
282
|
+
const role = inferClusterRole(entryCount, hubCount, clNodes.length || cl.files?.length || 1);
|
|
283
|
+
const dependsOn = [...(clusterEdges[cl.id] ?? [])];
|
|
284
|
+
const keyFiles = relPaths.filter(p => hubFiles.has(p) || entryFiles.has(p)).slice(0, 5);
|
|
285
|
+
return { id: cl.id, name: cl.name ?? cl.id, fileCount: clNodes.length || cl.files?.length || 0, role, entryPointCount: entryCount, hubCount, dependsOn, keyFiles, color: cl.color };
|
|
286
|
+
}).sort((a, b) => b.fileCount - a.fileCount);
|
|
287
|
+
|
|
288
|
+
const globalEntryPoints = (llmCtx?.callGraph?.entryPoints ?? []).slice(0, 20).map(n => ({ name: n.name, file: n.filePath, language: n.language }));
|
|
289
|
+
const criticalHubs = (llmCtx?.callGraph?.hubFunctions ?? []).slice(0, 10).map(n => ({ name: n.name, file: n.filePath, fanIn: n.fanIn, fanOut: n.fanOut }));
|
|
290
|
+
|
|
291
|
+
return {
|
|
292
|
+
summary: {
|
|
293
|
+
totalFiles: graph.statistics?.nodeCount ?? (graph.nodes?.length ?? 0),
|
|
294
|
+
totalClusters: clusters.length,
|
|
295
|
+
totalEdges: graph.statistics?.edgeCount ?? (graph.edges?.length ?? 0),
|
|
296
|
+
cycles: graph.statistics?.cycleCount ?? 0,
|
|
297
|
+
layerViolations: llmCtx?.callGraph?.layerViolations?.length ?? 0,
|
|
298
|
+
},
|
|
299
|
+
clusters,
|
|
300
|
+
globalEntryPoints,
|
|
301
|
+
criticalHubs,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { parseGraph } from './graph-helpers.js';
|
|
2
|
+
|
|
3
|
+
describe('parseGraph', () => {
|
|
4
|
+
it('should parse structuralClusters and directoryClusters from raw data', () => {
|
|
5
|
+
const raw = {
|
|
6
|
+
nodes: [],
|
|
7
|
+
edges: [],
|
|
8
|
+
clusters: [],
|
|
9
|
+
structuralClusters: [
|
|
10
|
+
{ id: 'cluster1', name: 'Structural Cluster 1', files: ['file1.js'], color: '#ff0000' },
|
|
11
|
+
],
|
|
12
|
+
directoryClusters: [
|
|
13
|
+
{ id: 'dir1', name: 'Directory Cluster 1', files: ['dir/file.js'], color: '#00ff00' },
|
|
14
|
+
],
|
|
15
|
+
statistics: {},
|
|
16
|
+
rankings: {},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const result = parseGraph(raw);
|
|
20
|
+
|
|
21
|
+
expect(result.structuralClusters).toEqual(raw.structuralClusters);
|
|
22
|
+
expect(result.directoryClusters).toEqual(raw.directoryClusters);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should provide empty arrays for missing structuralClusters and directoryClusters', () => {
|
|
26
|
+
const raw = {
|
|
27
|
+
nodes: [],
|
|
28
|
+
edges: [],
|
|
29
|
+
clusters: [],
|
|
30
|
+
statistics: {},
|
|
31
|
+
rankings: {},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const result = parseGraph(raw);
|
|
35
|
+
|
|
36
|
+
expect(result.structuralClusters).toEqual([]);
|
|
37
|
+
expect(result.directoryClusters).toEqual([]);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewer themes — each theme is a map of CSS custom properties.
|
|
3
|
+
*
|
|
4
|
+
* The root <div> of InteractiveGraphViewer applies `theme.vars` as inline style,
|
|
5
|
+
* making all CSS variables available to every descendant via `var(--xxx)`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const THEMES = {
|
|
9
|
+
space: {
|
|
10
|
+
label: '⬡ space',
|
|
11
|
+
vars: {
|
|
12
|
+
'--lc-cyan': '#3ecfcf',
|
|
13
|
+
'--lc-yellow': '#f7c76a',
|
|
14
|
+
'--lc-green': '#4ade80',
|
|
15
|
+
'--lc-orange': '#f97316',
|
|
16
|
+
'--lc-purple': '#7c6af7',
|
|
17
|
+
'--lc-red': '#f77c6a',
|
|
18
|
+
'--lc-pink': '#f76ac8',
|
|
19
|
+
'--bg-base': '#07091a',
|
|
20
|
+
'--bg-panel': '#080a1c',
|
|
21
|
+
'--bg-raised': '#0e1028',
|
|
22
|
+
'--bg-input': '#0d0f22',
|
|
23
|
+
'--bg-hover': '#131630',
|
|
24
|
+
'--bg-select': '#181b38',
|
|
25
|
+
'--bg-deep': '#080b1e',
|
|
26
|
+
'--bg-node': '#0b0d1e',
|
|
27
|
+
'--bd-faint': '#0f1224',
|
|
28
|
+
'--bd-muted': '#1a1f38',
|
|
29
|
+
'--bd-dim': '#0e1025',
|
|
30
|
+
'--bd-edge': '#181c36',
|
|
31
|
+
'--tx-primary': '#c8cde8',
|
|
32
|
+
'--tx-secondary': '#8890b0',
|
|
33
|
+
'--tx-bright': '#e0e4f0',
|
|
34
|
+
'--tx-muted': '#6a70a0',
|
|
35
|
+
'--tx-dim': '#3a4060',
|
|
36
|
+
'--tx-faint': '#2a2f4a',
|
|
37
|
+
'--tx-ghost': '#3a3f5c',
|
|
38
|
+
'--tx-node': '#5a6090',
|
|
39
|
+
'--tx-node-sel': '#ffffff',
|
|
40
|
+
'--ac-primary': '#7c6af7',
|
|
41
|
+
'--ac-teal': '#3ecfcf',
|
|
42
|
+
'--ac-edge-type': '#252a4a',
|
|
43
|
+
'--ac-arrow': '#1e2340',
|
|
44
|
+
'--ac-cluster-arr': '#2a3060',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
terminal: {
|
|
49
|
+
label: '▶ terminal',
|
|
50
|
+
vars: {
|
|
51
|
+
'--lc-cyan': '#00d4aa',
|
|
52
|
+
'--lc-yellow': '#c8e050',
|
|
53
|
+
'--lc-green': '#4ade80',
|
|
54
|
+
'--lc-orange': '#f0a040',
|
|
55
|
+
'--lc-purple': '#90d0ff',
|
|
56
|
+
'--lc-red': '#f07070',
|
|
57
|
+
'--lc-pink': '#d080c0',
|
|
58
|
+
'--bg-base': '#010d01',
|
|
59
|
+
'--bg-panel': '#020e02',
|
|
60
|
+
'--bg-raised': '#061206',
|
|
61
|
+
'--bg-input': '#041004',
|
|
62
|
+
'--bg-hover': '#0a1a0a',
|
|
63
|
+
'--bg-select': '#0d200d',
|
|
64
|
+
'--bg-deep': '#030e03',
|
|
65
|
+
'--bg-node': '#040f04',
|
|
66
|
+
'--bd-faint': '#071807',
|
|
67
|
+
'--bd-muted': '#0f2f0f',
|
|
68
|
+
'--bd-dim': '#061806',
|
|
69
|
+
'--bd-edge': '#0d200d',
|
|
70
|
+
'--tx-primary': '#80ee80',
|
|
71
|
+
'--tx-secondary': '#50a050',
|
|
72
|
+
'--tx-bright': '#c0ffc0',
|
|
73
|
+
'--tx-muted': '#408040',
|
|
74
|
+
'--tx-dim': '#285028',
|
|
75
|
+
'--tx-faint': '#1a3a1a',
|
|
76
|
+
'--tx-ghost': '#204020',
|
|
77
|
+
'--tx-node': '#40704a',
|
|
78
|
+
'--tx-node-sel': '#c0ffc0',
|
|
79
|
+
'--ac-primary': '#4ade80',
|
|
80
|
+
'--ac-teal': '#00d4aa',
|
|
81
|
+
'--ac-edge-type': '#103020',
|
|
82
|
+
'--ac-arrow': '#0d2010',
|
|
83
|
+
'--ac-cluster-arr': '#143820',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
midnight: {
|
|
88
|
+
label: '◈ midnight',
|
|
89
|
+
vars: {
|
|
90
|
+
'--lc-cyan': '#00e5ff',
|
|
91
|
+
'--lc-yellow': '#ffe066',
|
|
92
|
+
'--lc-green': '#00ff88',
|
|
93
|
+
'--lc-orange': '#ff9040',
|
|
94
|
+
'--lc-purple': '#b090ff',
|
|
95
|
+
'--lc-red': '#ff6060',
|
|
96
|
+
'--lc-pink': '#ff60c0',
|
|
97
|
+
'--bg-base': '#000000',
|
|
98
|
+
'--bg-panel': '#050505',
|
|
99
|
+
'--bg-raised': '#0a0a0a',
|
|
100
|
+
'--bg-input': '#080808',
|
|
101
|
+
'--bg-hover': '#111111',
|
|
102
|
+
'--bg-select': '#161616',
|
|
103
|
+
'--bg-deep': '#060606',
|
|
104
|
+
'--bg-node': '#090909',
|
|
105
|
+
'--bd-faint': '#0e0e0e',
|
|
106
|
+
'--bd-muted': '#1c1c1c',
|
|
107
|
+
'--bd-dim': '#0c0c0c',
|
|
108
|
+
'--bd-edge': '#141414',
|
|
109
|
+
'--tx-primary': '#00d4e8',
|
|
110
|
+
'--tx-secondary': '#007a88',
|
|
111
|
+
'--tx-bright': '#80eeff',
|
|
112
|
+
'--tx-muted': '#005060',
|
|
113
|
+
'--tx-dim': '#003040',
|
|
114
|
+
'--tx-faint': '#001a20',
|
|
115
|
+
'--tx-ghost': '#002530',
|
|
116
|
+
'--tx-node': '#004558',
|
|
117
|
+
'--tx-node-sel': '#80eeff',
|
|
118
|
+
'--ac-primary': '#00e5ff',
|
|
119
|
+
'--ac-teal': '#00ff88',
|
|
120
|
+
'--ac-edge-type': '#001828',
|
|
121
|
+
'--ac-arrow': '#001020',
|
|
122
|
+
'--ac-cluster-arr': '#001e30',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
warm: {
|
|
127
|
+
label: '☀ warm',
|
|
128
|
+
vars: {
|
|
129
|
+
'--lc-cyan': '#40c0a0',
|
|
130
|
+
'--lc-yellow': '#e8c040',
|
|
131
|
+
'--lc-green': '#70c050',
|
|
132
|
+
'--lc-orange': '#e87020',
|
|
133
|
+
'--lc-purple': '#c090e0',
|
|
134
|
+
'--lc-red': '#e06040',
|
|
135
|
+
'--lc-pink': '#e080a0',
|
|
136
|
+
'--bg-base': '#1c1711',
|
|
137
|
+
'--bg-panel': '#221e17',
|
|
138
|
+
'--bg-raised': '#2a2318',
|
|
139
|
+
'--bg-input': '#261f14',
|
|
140
|
+
'--bg-hover': '#302818',
|
|
141
|
+
'--bg-select': '#38301e',
|
|
142
|
+
'--bg-deep': '#201b11',
|
|
143
|
+
'--bg-node': '#201a0e',
|
|
144
|
+
'--bd-faint': '#2a2218',
|
|
145
|
+
'--bd-muted': '#3a3020',
|
|
146
|
+
'--bd-dim': '#281f14',
|
|
147
|
+
'--bd-edge': '#302810',
|
|
148
|
+
'--tx-primary': '#d4c59a',
|
|
149
|
+
'--tx-secondary': '#9a8060',
|
|
150
|
+
'--tx-bright': '#ede0c0',
|
|
151
|
+
'--tx-muted': '#806840',
|
|
152
|
+
'--tx-dim': '#605038',
|
|
153
|
+
'--tx-faint': '#483820',
|
|
154
|
+
'--tx-ghost': '#504030',
|
|
155
|
+
'--tx-node': '#706040',
|
|
156
|
+
'--tx-node-sel': '#ede0c0',
|
|
157
|
+
'--ac-primary': '#e8a020',
|
|
158
|
+
'--ac-teal': '#50b060',
|
|
159
|
+
'--ac-edge-type': '#382808',
|
|
160
|
+
'--ac-arrow': '#302408',
|
|
161
|
+
'--ac-cluster-arr': '#402808',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
light: {
|
|
166
|
+
label: '○ light',
|
|
167
|
+
vars: {
|
|
168
|
+
'--lc-cyan': '#0a7a8a',
|
|
169
|
+
'--lc-yellow': '#8a6000',
|
|
170
|
+
'--lc-green': '#1a7a3a',
|
|
171
|
+
'--lc-orange': '#b04000',
|
|
172
|
+
'--lc-purple': '#4a28c0',
|
|
173
|
+
'--lc-red': '#b03020',
|
|
174
|
+
'--lc-pink': '#a01870',
|
|
175
|
+
'--bg-base': '#f4f5f9',
|
|
176
|
+
'--bg-panel': '#eef0f6',
|
|
177
|
+
'--bg-raised': '#ffffff',
|
|
178
|
+
'--bg-input': '#ffffff',
|
|
179
|
+
'--bg-hover': '#e8eaf2',
|
|
180
|
+
'--bg-select': '#dde0ef',
|
|
181
|
+
'--bg-deep': '#f0f1f8',
|
|
182
|
+
'--bg-node': '#f8f9fd',
|
|
183
|
+
'--bd-faint': '#dde0ec',
|
|
184
|
+
'--bd-muted': '#8890c8',
|
|
185
|
+
'--bd-dim': '#d0d4e8',
|
|
186
|
+
'--bd-edge': '#6870b0',
|
|
187
|
+
'--tx-primary': '#1a1c2e',
|
|
188
|
+
'--tx-secondary': '#3a3f60',
|
|
189
|
+
'--tx-bright': '#0a0c1a',
|
|
190
|
+
'--tx-muted': '#505580',
|
|
191
|
+
'--tx-dim': '#7880a8',
|
|
192
|
+
'--tx-faint': '#9098b8',
|
|
193
|
+
'--tx-ghost': '#a8aec8',
|
|
194
|
+
'--tx-node': '#1a1f40',
|
|
195
|
+
'--tx-node-sel': '#0a0c1a',
|
|
196
|
+
'--ac-primary': '#5b4de0',
|
|
197
|
+
'--ac-teal': '#0e9e9e',
|
|
198
|
+
'--ac-edge-type': '#8890c8',
|
|
199
|
+
'--ac-arrow': '#6870b0',
|
|
200
|
+
'--ac-cluster-arr': '#5b4de0',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const THEME_KEYS = Object.keys(THEMES);
|
|
206
|
+
export const DEFAULT_THEME = 'space';
|