@vpxa/kb 0.1.12 → 0.1.15
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 +56 -39
- package/package.json +10 -7
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -20
- package/packages/analyzers/dist/blast-radius-analyzer.js +6 -12
- package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -27
- package/packages/analyzers/dist/dependency-analyzer.js +7 -9
- package/packages/analyzers/dist/diagram-generator.d.ts +12 -8
- package/packages/analyzers/dist/diagram-generator.js +3 -4
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -17
- package/packages/analyzers/dist/entry-point-analyzer.js +5 -5
- package/packages/analyzers/dist/index.d.ts +12 -14
- package/packages/analyzers/dist/index.js +1 -1
- package/packages/analyzers/dist/knowledge-producer.d.ts +29 -25
- package/packages/analyzers/dist/knowledge-producer.js +16 -15
- package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -10
- package/packages/analyzers/dist/pattern-analyzer.js +3 -5
- package/packages/analyzers/dist/regex-call-graph.d.ts +6 -12
- package/packages/analyzers/dist/regex-call-graph.js +2 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +13 -9
- package/packages/analyzers/dist/structure-analyzer.js +3 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +12 -8
- package/packages/analyzers/dist/symbol-analyzer.js +8 -13
- package/packages/analyzers/dist/ts-call-graph.d.ts +16 -13
- package/packages/analyzers/dist/ts-call-graph.js +2 -1
- package/packages/analyzers/dist/types.d.ts +82 -79
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +13 -10
- package/packages/chunker/dist/call-graph-extractor.js +2 -1
- package/packages/chunker/dist/chunker-factory.d.ts +6 -2
- package/packages/chunker/dist/chunker-factory.js +2 -1
- package/packages/chunker/dist/chunker.interface.d.ts +8 -4
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +16 -12
- package/packages/chunker/dist/code-chunker.js +12 -14
- package/packages/chunker/dist/generic-chunker.d.ts +14 -10
- package/packages/chunker/dist/generic-chunker.js +6 -5
- package/packages/chunker/dist/index.d.ts +8 -8
- package/packages/chunker/dist/index.js +1 -1
- package/packages/chunker/dist/markdown-chunker.d.ts +16 -12
- package/packages/chunker/dist/markdown-chunker.js +4 -10
- package/packages/chunker/dist/treesitter-chunker.d.ts +28 -31
- package/packages/chunker/dist/treesitter-chunker.js +7 -8
- package/packages/cli/dist/commands/analyze.d.ts +6 -2
- package/packages/cli/dist/commands/analyze.js +3 -3
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -2
- package/packages/cli/dist/commands/context-cmds.js +2 -1
- package/packages/cli/dist/commands/environment.d.ts +6 -2
- package/packages/cli/dist/commands/environment.js +2 -2
- package/packages/cli/dist/commands/execution.d.ts +6 -2
- package/packages/cli/dist/commands/execution.js +2 -1
- package/packages/cli/dist/commands/graph.d.ts +6 -2
- package/packages/cli/dist/commands/graph.js +6 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +27 -0
- package/packages/cli/dist/commands/init/adapters.js +2 -0
- package/packages/cli/dist/commands/init/config.d.ts +11 -0
- package/packages/cli/dist/commands/init/config.js +4 -0
- package/packages/cli/dist/commands/init/curated.d.ts +8 -0
- package/packages/cli/dist/commands/init/curated.js +2 -0
- package/packages/cli/dist/commands/init/index.d.ts +23 -0
- package/packages/cli/dist/commands/init/index.js +3 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +24 -0
- package/packages/cli/dist/commands/init/scaffold.js +2 -0
- package/packages/cli/dist/commands/init/templates.d.ts +10 -0
- package/packages/cli/dist/commands/init/templates.js +302 -0
- package/packages/cli/dist/commands/init.d.ts +9 -3
- package/packages/cli/dist/commands/init.js +253 -197
- package/packages/cli/dist/commands/knowledge.d.ts +6 -2
- package/packages/cli/dist/commands/knowledge.js +2 -1
- package/packages/cli/dist/commands/search.d.ts +6 -2
- package/packages/cli/dist/commands/search.js +2 -8
- package/packages/cli/dist/commands/system.d.ts +6 -2
- package/packages/cli/dist/commands/system.js +5 -4
- package/packages/cli/dist/commands/workspace.d.ts +6 -2
- package/packages/cli/dist/commands/workspace.js +2 -2
- package/packages/cli/dist/context.d.ts +7 -4
- package/packages/cli/dist/context.js +2 -1
- package/packages/cli/dist/helpers.d.ts +51 -47
- package/packages/cli/dist/helpers.js +6 -3
- package/packages/cli/dist/index.d.ts +4 -1
- package/packages/cli/dist/index.js +3 -2
- package/packages/cli/dist/kb-init.d.ts +48 -50
- package/packages/cli/dist/kb-init.js +2 -1
- package/packages/cli/dist/types.d.ts +8 -5
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +36 -33
- package/packages/core/dist/constants.js +2 -1
- package/packages/core/dist/content-detector.d.ts +10 -5
- package/packages/core/dist/content-detector.js +2 -1
- package/packages/core/dist/errors.d.ts +15 -12
- package/packages/core/dist/errors.js +2 -1
- package/packages/core/dist/index.d.ts +6 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/core/dist/logger.d.ts +16 -7
- package/packages/core/dist/logger.js +2 -1
- package/packages/core/dist/types.d.ts +108 -90
- package/packages/core/dist/types.js +2 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +22 -19
- package/packages/embeddings/dist/embedder.interface.js +1 -0
- package/packages/embeddings/dist/index.d.ts +3 -3
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/embeddings/dist/onnx-embedder.d.ts +21 -22
- package/packages/embeddings/dist/onnx-embedder.js +2 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +29 -0
- package/packages/enterprise-bridge/dist/cache.js +2 -0
- package/packages/enterprise-bridge/dist/er-client.d.ts +38 -0
- package/packages/enterprise-bridge/dist/er-client.js +2 -0
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +63 -0
- package/packages/enterprise-bridge/dist/evolution-collector.js +2 -0
- package/packages/enterprise-bridge/dist/index.d.ts +8 -0
- package/packages/enterprise-bridge/dist/index.js +1 -0
- package/packages/enterprise-bridge/dist/policy-store.d.ts +46 -0
- package/packages/enterprise-bridge/dist/policy-store.js +2 -0
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +24 -0
- package/packages/enterprise-bridge/dist/push-adapter.js +2 -0
- package/packages/enterprise-bridge/dist/result-merger.d.ts +15 -0
- package/packages/enterprise-bridge/dist/result-merger.js +2 -0
- package/packages/enterprise-bridge/dist/types.d.ts +82 -0
- package/packages/enterprise-bridge/dist/types.js +2 -0
- package/packages/indexer/dist/file-hasher.d.ts +5 -2
- package/packages/indexer/dist/file-hasher.js +2 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +23 -20
- package/packages/indexer/dist/filesystem-crawler.js +2 -1
- package/packages/indexer/dist/graph-extractor.d.ts +9 -12
- package/packages/indexer/dist/graph-extractor.js +2 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +49 -43
- package/packages/indexer/dist/incremental-indexer.js +2 -1
- package/packages/indexer/dist/index.d.ts +5 -5
- package/packages/indexer/dist/index.js +1 -1
- package/packages/server/dist/api.d.ts +3 -8
- package/packages/server/dist/api.js +1 -1
- package/packages/server/dist/config.d.ts +6 -2
- package/packages/server/dist/config.js +2 -1
- package/packages/server/dist/curated-manager.d.ts +79 -76
- package/packages/server/dist/curated-manager.js +6 -10
- package/packages/server/dist/index.d.ts +1 -2
- package/packages/server/dist/index.js +2 -1
- package/packages/server/dist/replay-interceptor.d.ts +6 -6
- package/packages/server/dist/replay-interceptor.js +2 -1
- package/packages/server/dist/resources/resources.d.ts +7 -3
- package/packages/server/dist/resources/resources.js +3 -2
- package/packages/server/dist/server.d.ts +34 -24
- package/packages/server/dist/server.js +2 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -10
- package/packages/server/dist/tools/analyze.tools.js +2 -1
- package/packages/server/dist/tools/audit.tool.d.ts +9 -0
- package/packages/server/dist/tools/audit.tool.js +2 -0
- package/packages/server/dist/tools/bridge.tools.d.ts +35 -0
- package/packages/server/dist/tools/bridge.tools.js +16 -0
- package/packages/server/dist/tools/evolution.tools.d.ts +8 -0
- package/packages/server/dist/tools/evolution.tools.js +6 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -11
- package/packages/server/dist/tools/forge.tools.js +11 -13
- package/packages/server/dist/tools/forget.tool.d.ts +7 -3
- package/packages/server/dist/tools/forget.tool.js +2 -7
- package/packages/server/dist/tools/graph.tool.d.ts +7 -3
- package/packages/server/dist/tools/graph.tool.js +5 -5
- package/packages/server/dist/tools/list.tool.d.ts +7 -3
- package/packages/server/dist/tools/list.tool.js +3 -8
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -3
- package/packages/server/dist/tools/lookup.tool.js +3 -9
- package/packages/server/dist/tools/onboard.tool.d.ts +8 -4
- package/packages/server/dist/tools/onboard.tool.js +3 -2
- package/packages/server/dist/tools/policy.tools.d.ts +8 -0
- package/packages/server/dist/tools/policy.tools.js +3 -0
- package/packages/server/dist/tools/produce.tool.d.ts +6 -2
- package/packages/server/dist/tools/produce.tool.js +3 -2
- package/packages/server/dist/tools/read.tool.d.ts +7 -3
- package/packages/server/dist/tools/read.tool.js +3 -6
- package/packages/server/dist/tools/reindex.tool.d.ts +10 -6
- package/packages/server/dist/tools/reindex.tool.js +3 -2
- package/packages/server/dist/tools/remember.tool.d.ts +8 -3
- package/packages/server/dist/tools/remember.tool.js +4 -5
- package/packages/server/dist/tools/replay.tool.d.ts +6 -2
- package/packages/server/dist/tools/replay.tool.js +3 -6
- package/packages/server/dist/tools/search.tool.d.ts +10 -4
- package/packages/server/dist/tools/search.tool.js +7 -18
- package/packages/server/dist/tools/status.tool.d.ts +7 -3
- package/packages/server/dist/tools/status.tool.js +3 -3
- package/packages/server/dist/tools/toolkit.tools.d.ts +36 -34
- package/packages/server/dist/tools/toolkit.tools.js +20 -21
- package/packages/server/dist/tools/update.tool.d.ts +7 -3
- package/packages/server/dist/tools/update.tool.js +2 -6
- package/packages/server/dist/tools/utility.tools.d.ts +15 -14
- package/packages/server/dist/tools/utility.tools.js +11 -23
- package/packages/server/dist/version-check.d.ts +5 -1
- package/packages/server/dist/version-check.js +2 -1
- package/packages/store/dist/graph-store.interface.d.ts +89 -86
- package/packages/store/dist/graph-store.interface.js +1 -0
- package/packages/store/dist/index.d.ts +6 -6
- package/packages/store/dist/index.js +1 -1
- package/packages/store/dist/lance-store.d.ts +37 -30
- package/packages/store/dist/lance-store.js +2 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +43 -46
- package/packages/store/dist/sqlite-graph-store.js +14 -13
- package/packages/store/dist/store-factory.d.ts +11 -7
- package/packages/store/dist/store-factory.js +2 -1
- package/packages/store/dist/store.interface.d.ts +47 -44
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +66 -0
- package/packages/tools/dist/audit.js +7 -0
- package/packages/tools/dist/batch.d.ts +20 -17
- package/packages/tools/dist/batch.js +2 -1
- package/packages/tools/dist/changelog.d.ts +29 -26
- package/packages/tools/dist/changelog.js +3 -2
- package/packages/tools/dist/check.d.ts +45 -22
- package/packages/tools/dist/check.js +3 -2
- package/packages/tools/dist/checkpoint.d.ts +17 -14
- package/packages/tools/dist/checkpoint.js +2 -2
- package/packages/tools/dist/codemod.d.ts +35 -32
- package/packages/tools/dist/codemod.js +3 -2
- package/packages/tools/dist/compact.d.ts +34 -35
- package/packages/tools/dist/compact.js +3 -2
- package/packages/tools/dist/data-transform.d.ts +10 -7
- package/packages/tools/dist/data-transform.js +2 -1
- package/packages/tools/dist/dead-symbols.d.ts +29 -17
- package/packages/tools/dist/dead-symbols.js +3 -2
- package/packages/tools/dist/delegate.d.ts +26 -23
- package/packages/tools/dist/delegate.js +2 -5
- package/packages/tools/dist/diff-parse.d.ts +24 -21
- package/packages/tools/dist/diff-parse.js +4 -3
- package/packages/tools/dist/digest.d.ts +43 -45
- package/packages/tools/dist/digest.js +5 -5
- package/packages/tools/dist/encode.d.ts +11 -8
- package/packages/tools/dist/encode.js +2 -1
- package/packages/tools/dist/env-info.d.ts +25 -22
- package/packages/tools/dist/env-info.js +2 -1
- package/packages/tools/dist/eval.d.ts +13 -10
- package/packages/tools/dist/eval.js +3 -3
- package/packages/tools/dist/evidence-map.d.ts +64 -61
- package/packages/tools/dist/evidence-map.js +3 -3
- package/packages/tools/dist/file-cache.d.ts +42 -0
- package/packages/tools/dist/file-cache.js +4 -0
- package/packages/tools/dist/file-summary.d.ts +34 -29
- package/packages/tools/dist/file-summary.js +3 -2
- package/packages/tools/dist/file-walk.d.ts +6 -3
- package/packages/tools/dist/file-walk.js +2 -1
- package/packages/tools/dist/find-examples.d.ts +26 -21
- package/packages/tools/dist/find-examples.js +4 -3
- package/packages/tools/dist/find.d.ts +39 -40
- package/packages/tools/dist/find.js +2 -1
- package/packages/tools/dist/forge-classify.d.ts +35 -38
- package/packages/tools/dist/forge-classify.js +3 -2
- package/packages/tools/dist/forge-ground.d.ts +58 -60
- package/packages/tools/dist/forge-ground.js +2 -1
- package/packages/tools/dist/git-context.d.ts +22 -19
- package/packages/tools/dist/git-context.js +4 -3
- package/packages/tools/dist/graph-query.d.ts +75 -78
- package/packages/tools/dist/graph-query.js +2 -1
- package/packages/tools/dist/guide.d.ts +26 -0
- package/packages/tools/dist/guide.js +2 -0
- package/packages/tools/dist/health.d.ts +13 -10
- package/packages/tools/dist/health.js +3 -1
- package/packages/tools/dist/http-request.d.ts +20 -17
- package/packages/tools/dist/http-request.js +2 -1
- package/packages/tools/dist/index.d.ts +54 -49
- package/packages/tools/dist/index.js +1 -1
- package/packages/tools/dist/lane.d.ts +28 -25
- package/packages/tools/dist/lane.js +7 -7
- package/packages/tools/dist/measure.d.ts +32 -29
- package/packages/tools/dist/measure.js +3 -2
- package/packages/tools/dist/onboard.d.ts +29 -26
- package/packages/tools/dist/onboard.js +18 -41
- package/packages/tools/dist/parse-output.d.ts +48 -45
- package/packages/tools/dist/parse-output.js +3 -2
- package/packages/tools/dist/path-resolver.d.ts +15 -0
- package/packages/tools/dist/path-resolver.js +2 -0
- package/packages/tools/dist/process-manager.d.ts +18 -15
- package/packages/tools/dist/process-manager.js +2 -1
- package/packages/tools/dist/queue.d.ts +28 -25
- package/packages/tools/dist/queue.js +2 -2
- package/packages/tools/dist/regex-test.d.ts +26 -23
- package/packages/tools/dist/regex-test.js +2 -1
- package/packages/tools/dist/rename.d.ts +28 -25
- package/packages/tools/dist/rename.js +3 -2
- package/packages/tools/dist/replay.d.ts +33 -30
- package/packages/tools/dist/replay.js +5 -6
- package/packages/tools/dist/response-envelope.d.ts +44 -0
- package/packages/tools/dist/response-envelope.js +2 -0
- package/packages/tools/dist/schema-validate.d.ts +15 -12
- package/packages/tools/dist/schema-validate.js +2 -1
- package/packages/tools/dist/scope-map.d.ts +45 -45
- package/packages/tools/dist/scope-map.js +2 -1
- package/packages/tools/dist/snippet.d.ts +26 -24
- package/packages/tools/dist/snippet.js +2 -1
- package/packages/tools/dist/stash.d.ts +13 -10
- package/packages/tools/dist/stash.js +2 -2
- package/packages/tools/dist/stratum-card.d.ts +27 -27
- package/packages/tools/dist/stratum-card.js +4 -5
- package/packages/tools/dist/symbol.d.ts +29 -25
- package/packages/tools/dist/symbol.js +4 -3
- package/packages/tools/dist/test-run.d.ts +19 -15
- package/packages/tools/dist/test-run.js +3 -2
- package/packages/tools/dist/text-utils.d.ts +6 -3
- package/packages/tools/dist/text-utils.js +3 -2
- package/packages/tools/dist/time-utils.d.ts +15 -12
- package/packages/tools/dist/time-utils.js +2 -1
- package/packages/tools/dist/trace.d.ts +24 -20
- package/packages/tools/dist/trace.js +3 -2
- package/packages/tools/dist/truncation.d.ts +14 -2
- package/packages/tools/dist/truncation.js +8 -14
- package/packages/tools/dist/watch.d.ts +28 -25
- package/packages/tools/dist/watch.js +2 -1
- package/packages/tools/dist/web-fetch.d.ts +35 -32
- package/packages/tools/dist/web-fetch.js +7 -12
- package/packages/tools/dist/web-search.d.ts +16 -13
- package/packages/tools/dist/web-search.js +2 -1
- package/packages/tools/dist/workset.d.ts +19 -16
- package/packages/tools/dist/workset.js +2 -2
- package/packages/tui/dist/App-BAlmxCCw.js +3 -0
- package/packages/tui/dist/App.d.ts +11 -5
- package/packages/tui/dist/App.js +1 -450
- package/packages/tui/dist/CuratedPanel-sYdZAICX.js +3 -0
- package/packages/tui/dist/LogPanel-DVB8Sv46.js +4 -0
- package/packages/tui/dist/SearchPanel-DREo6zgt.js +3 -0
- package/packages/tui/dist/StatusPanel-2ex8fLOO.js +3 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DUyj952l.js +8 -0
- package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +29 -0
- package/packages/tui/dist/index-B9VpfVPP.d.ts +14 -0
- package/packages/tui/dist/index.d.ts +3 -19
- package/packages/tui/dist/index.js +2 -476
- package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +317 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -5
- package/packages/tui/dist/panels/CuratedPanel.js +1 -371
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -2
- package/packages/tui/dist/panels/LogPanel.js +1 -449
- package/packages/tui/dist/panels/SearchPanel.d.ts +14 -7
- package/packages/tui/dist/panels/SearchPanel.js +1 -372
- package/packages/tui/dist/panels/StatusPanel.d.ts +11 -5
- package/packages/tui/dist/panels/StatusPanel.js +1 -371
- package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +151 -0
- package/scaffold/adapters/claude-code.mjs +20 -0
- package/scaffold/adapters/copilot.mjs +320 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +14 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +14 -0
- package/scaffold/copilot/agents/Code-Reviewer-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Code-Reviewer-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Debugger.agent.md +31 -0
- package/scaffold/copilot/agents/Documenter.agent.md +35 -0
- package/scaffold/copilot/agents/Explorer.agent.md +50 -0
- package/scaffold/copilot/agents/Frontend.agent.md +29 -0
- package/scaffold/copilot/agents/Implementer.agent.md +31 -0
- package/scaffold/copilot/agents/Orchestrator.agent.md +96 -0
- package/scaffold/copilot/agents/Planner.agent.md +45 -0
- package/scaffold/copilot/agents/README.md +57 -0
- package/scaffold/copilot/agents/Refactor.agent.md +30 -0
- package/scaffold/copilot/agents/Researcher-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Delta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Gamma.agent.md +12 -0
- package/scaffold/copilot/agents/Security.agent.md +42 -0
- package/scaffold/copilot/agents/_shared/adr-protocol.md +91 -0
- package/scaffold/copilot/agents/_shared/architect-reviewer-base.md +50 -0
- package/scaffold/copilot/agents/_shared/code-agent-base.md +70 -0
- package/scaffold/copilot/agents/_shared/code-reviewer-base.md +54 -0
- package/scaffold/copilot/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/copilot/agents/_shared/forge-protocol.md +46 -0
- package/scaffold/copilot/agents/_shared/researcher-base.md +61 -0
- package/scaffold/copilot/agents/templates/adr-template.md +27 -0
- package/scaffold/copilot/agents/templates/execution-state.md +25 -0
- package/scaffold/copilot/prompts/ask.prompt.md +20 -0
- package/scaffold/copilot/prompts/debug.prompt.md +25 -0
- package/scaffold/copilot/prompts/design.prompt.md +22 -0
- package/scaffold/copilot/prompts/implement.prompt.md +26 -0
- package/scaffold/copilot/prompts/plan.prompt.md +24 -0
- package/scaffold/copilot/prompts/review.prompt.md +31 -0
- package/scaffold/definitions/agents.mjs +165 -0
- package/scaffold/definitions/bodies.mjs +292 -0
- package/scaffold/definitions/hooks.mjs +43 -0
- package/scaffold/definitions/models.mjs +56 -0
- package/scaffold/definitions/plugins.mjs +24 -0
- package/scaffold/definitions/prompts.mjs +145 -0
- package/scaffold/definitions/protocols.mjs +322 -0
- package/scaffold/definitions/tools.mjs +176 -0
- package/scaffold/generate.mjs +74 -0
- package/skills/brainstorming/SKILL.md +259 -0
- package/skills/brainstorming/scripts/frame-template.html +365 -0
- package/skills/brainstorming/scripts/helper.js +216 -0
- package/skills/brainstorming/scripts/server.cjs +9 -0
- package/skills/brainstorming/scripts/server.src.cjs +249 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +430 -0
- package/skills/knowledge-base/SKILL.md +34 -21
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ This is an **MCP (Model Context Protocol) server** that gives AI agents:
|
|
|
23
23
|
8. **Graph auto-population** — during indexing, a lightweight regex extractor builds the knowledge graph automatically from TS/JS source files (functions, classes, interfaces, types, imports)
|
|
24
24
|
9. **Optimized reindex** — full reindex skips redundant hash checks, batches graph writes (flush every 50 files), and skips per-file graph deletes when bulk-cleared
|
|
25
25
|
|
|
26
|
-
The KB auto-indexes configured source directories on startup, stores embeddings in a local LanceDB vector store, and exposes everything through 64 MCP tools,
|
|
26
|
+
The KB auto-indexes configured source directories on startup, stores embeddings in a local LanceDB vector store, and exposes everything through 64 MCP tools, 45 CLI commands, and 2 resources.
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
@@ -36,6 +36,12 @@ pnpm add -D @vpxa/kb
|
|
|
36
36
|
# Initialize in your project
|
|
37
37
|
npx @vpxa/kb init
|
|
38
38
|
|
|
39
|
+
# After upgrading, overwrite all scaffold/skill files
|
|
40
|
+
npx @vpxa/kb init --force
|
|
41
|
+
|
|
42
|
+
# Check which files are outdated (JSON report for LLM consumption)
|
|
43
|
+
npx @vpxa/kb init --guide
|
|
44
|
+
|
|
39
45
|
# Index your codebase
|
|
40
46
|
npx @vpxa/kb reindex
|
|
41
47
|
|
|
@@ -54,13 +60,12 @@ npx @vpxa/kb serve
|
|
|
54
60
|
| Tool | CLI | Description |
|
|
55
61
|
|------|-----|-------------|
|
|
56
62
|
| `kb_search` | `kb search` | Hybrid vector + keyword search |
|
|
57
|
-
| `kb_find` | `kb find` | Federated search (vector, FTS, glob, regex) |
|
|
63
|
+
| `kb_find` | `kb find` | Federated search (vector, FTS, glob, regex). Use `mode: 'examples'` to find usage examples. |
|
|
58
64
|
| `kb_symbol` | `kb symbol` | Resolve symbol definition, imports, references |
|
|
59
65
|
| `kb_lookup` | `kb lookup` | Look up indexed chunks by file path |
|
|
60
66
|
| `kb_trace` | `kb trace` | Forward/backward flow tracing |
|
|
61
|
-
| `kb_find_examples` | `kb examples` | Find usage examples of a symbol |
|
|
62
67
|
| `kb_scope_map` | `kb scope-map` | Generate task-scoped reading plan |
|
|
63
|
-
| `kb_dead_symbols` | `kb dead-symbols` | Find unused exported symbols |
|
|
68
|
+
| `kb_dead_symbols` | `kb dead-symbols` | Find unused exported symbols (source vs docs) |
|
|
64
69
|
| `kb_file_summary` | `kb summarize` | Structural file overview |
|
|
65
70
|
|
|
66
71
|
### Code Analysis
|
|
@@ -70,14 +75,14 @@ npx @vpxa/kb serve
|
|
|
70
75
|
| `kb_analyze_dependencies` | `kb analyze deps` | Dependency graph |
|
|
71
76
|
| `kb_analyze_symbols` | `kb analyze symbols` | Symbol extraction |
|
|
72
77
|
| `kb_analyze_patterns` | `kb analyze patterns` | Code pattern detection |
|
|
73
|
-
| `kb_analyze_entry_points` | `kb analyze entry-points` | Entry point discovery |
|
|
78
|
+
| `kb_analyze_entry_points` | `kb analyze entry-points` | Entry point discovery: handlers, CDK constructs, test suites, package exports (walks monorepo workspaces) |
|
|
74
79
|
| `kb_analyze_diagram` | `kb analyze diagram` | Mermaid diagram generation |
|
|
75
80
|
| `kb_blast_radius` | `kb analyze blast-radius` | Change impact analysis |
|
|
76
81
|
|
|
77
82
|
### Context Management
|
|
78
83
|
| Tool | CLI | Description |
|
|
79
84
|
|------|-----|-------------|
|
|
80
|
-
| `kb_compact` | `kb compact` | Compress text to relevant sections |
|
|
85
|
+
| `kb_compact` | `kb compact` | Compress text/file to relevant sections (accepts `path`) |
|
|
81
86
|
| `kb_workset` | `kb workset` | Named file set management |
|
|
82
87
|
| `kb_stash` | `kb stash` | Named key-value store |
|
|
83
88
|
| `kb_checkpoint` | `kb checkpoint` | Session checkpoint save/restore |
|
|
@@ -104,9 +109,10 @@ npx @vpxa/kb serve
|
|
|
104
109
|
| Tool | CLI | Description |
|
|
105
110
|
|------|-----|-------------|
|
|
106
111
|
| `kb_eval` | `kb eval` | Sandboxed JavaScript/TypeScript execution |
|
|
107
|
-
| `kb_check` | `kb check` | Incremental typecheck + lint |
|
|
112
|
+
| `kb_check` | `kb check` | Incremental typecheck + lint (`detail`: summary/errors/full) |
|
|
108
113
|
| `kb_test_run` | `kb test` | Run tests with structured results |
|
|
109
114
|
| `kb_batch` | `kb batch` | Parallel operation execution |
|
|
115
|
+
| `kb_audit` | `kb audit` | Unified project audit: runs structure, deps, patterns, health, dead symbols, check, entry points in one call. Returns score, recommendations, and next steps. |
|
|
110
116
|
|
|
111
117
|
### Knowledge Management
|
|
112
118
|
| Tool | CLI | Description |
|
|
@@ -158,14 +164,14 @@ npx @vpxa/kb serve
|
|
|
158
164
|
### System
|
|
159
165
|
| Tool | CLI | Description |
|
|
160
166
|
|------|-----|-------------|
|
|
161
|
-
| `kb_status` | `kb status` | Index statistics |
|
|
167
|
+
| `kb_status` | `kb status` | Index statistics + tree-sitter availability |
|
|
162
168
|
| `kb_reindex` | `kb reindex` | Rebuild index |
|
|
163
|
-
| `kb_health` | `kb health` | Project health checks (package.json, tsconfig, lockfile,
|
|
169
|
+
| `kb_health` | `kb health` | Project health checks (package.json, tsconfig, lockfile, circular deps) |
|
|
170
|
+
| `kb_guide` | `kb guide` | Tool discovery — given a goal, recommends tools and workflow order |
|
|
164
171
|
| `kb_queue` | `kb queue` | Task queue for sequential agent operations |
|
|
165
172
|
| `kb_graph` | `kb graph` | Query and manage the knowledge graph (8 actions: find_nodes, find_edges, neighbors, traverse, stats, add, delete, clear) |
|
|
166
173
|
| `kb_onboard` | `kb onboard` | First-time codebase onboarding — runs all analysis tools in one command, auto-persists results |
|
|
167
|
-
| `
|
|
168
|
-
| `kb_replay_clear` | `kb replay-clear` | Clear the replay audit trail |
|
|
174
|
+
| `kb_replay` | `kb replay` | View or clear the audit trail of tool invocations (action: list/clear) |
|
|
169
175
|
|
|
170
176
|
### TUI Dashboard
|
|
171
177
|
|
|
@@ -211,7 +217,7 @@ kb analyze <type> <path>
|
|
|
211
217
|
kb lookup <path>
|
|
212
218
|
|
|
213
219
|
# Context
|
|
214
|
-
kb compact <query> [--max-chars N]
|
|
220
|
+
kb compact <query> [--path <file>] [--max-chars N]
|
|
215
221
|
kb workset <action> [name] [--files f1,f2]
|
|
216
222
|
kb stash <action> [key] [value]
|
|
217
223
|
kb checkpoint <action> [label]
|
|
@@ -226,7 +232,7 @@ kb transform <expression>
|
|
|
226
232
|
# Execution
|
|
227
233
|
kb eval <code> [--lang js|ts] [--timeout N]
|
|
228
234
|
kb test [files...] [--grep pattern]
|
|
229
|
-
kb check [--skip-types] [--skip-lint]
|
|
235
|
+
kb check [--skip-types] [--skip-lint] [--detail summary|errors|full]
|
|
230
236
|
kb batch
|
|
231
237
|
|
|
232
238
|
# Knowledge
|
|
@@ -261,7 +267,7 @@ kb status
|
|
|
261
267
|
kb reindex [--full]
|
|
262
268
|
kb onboard <path> [--generate] [--out-dir <dir>]
|
|
263
269
|
kb serve [--transport stdio|http] [--port N]
|
|
264
|
-
kb init [--force]
|
|
270
|
+
kb init [--force] [--guide]
|
|
265
271
|
```
|
|
266
272
|
|
|
267
273
|
## Configuration
|
|
@@ -296,7 +302,7 @@ kb init [--force]
|
|
|
296
302
|
│ ├── chunker/ — tree-sitter + regex code chunking
|
|
297
303
|
│ ├── indexer/ — incremental file indexer
|
|
298
304
|
│ ├── analyzers/ — blast-radius, deps, symbols, patterns, diagrams
|
|
299
|
-
│ ├── tools/ —
|
|
305
|
+
│ ├── tools/ — 52 tool modules (64 MCP tools)
|
|
300
306
|
│ ├── server/ — MCP protocol server
|
|
301
307
|
│ └── cli/ — command-line interface
|
|
302
308
|
├── bin/kb.mjs — CLI entry point
|
|
@@ -466,7 +472,9 @@ Dependency results include a **confidence** level per import: `high` (ES static
|
|
|
466
472
|
|-----------|------|----------|-------------|
|
|
467
473
|
| `path` | string | **yes** | Root path |
|
|
468
474
|
|
|
469
|
-
#### `kb_analyze_entry_points` — Find Lambda handlers,
|
|
475
|
+
#### `kb_analyze_entry_points` — Find Lambda handlers, CDK constructs, test suites, package exports
|
|
476
|
+
|
|
477
|
+
Walks monorepo workspace packages (pnpm-workspace.yaml / package.json#workspaces), parses `exports` fields, detects CDK constructs and test suites.
|
|
470
478
|
|
|
471
479
|
| Parameter | Type | Required | Description |
|
|
472
480
|
|-----------|------|----------|-------------|
|
|
@@ -485,12 +493,13 @@ Dependency results include a **confidence** level per import: `high` (ES static
|
|
|
485
493
|
|
|
486
494
|
| Parameter | Type | Required | Default | Description |
|
|
487
495
|
|-----------|------|----------|---------|-------------|
|
|
488
|
-
| `text` | string |
|
|
496
|
+
| `text` | string | no* | — | The text to compress (provide `text` or `path`) |
|
|
497
|
+
| `path` | string | no* | — | File path to read server-side (avoids read_file round-trip) |
|
|
489
498
|
| `query` | string | **yes** | — | Focus query — what are you trying to understand? |
|
|
490
499
|
| `max_chars` | number (100–50000) | no | `3000` | Target output size in characters |
|
|
491
500
|
| `segmentation` | enum | no | `paragraph` | How to split: `paragraph`, `sentence`, `line` |
|
|
492
501
|
|
|
493
|
-
|
|
502
|
+
\* At least one of `text` or `path` must be provided. Using `path` is preferred — it eliminates the `read_file` → `compact` two-call chain and prevents token doubling.
|
|
494
503
|
|
|
495
504
|
#### `kb_workset` — Manage named file sets
|
|
496
505
|
|
|
@@ -641,16 +650,6 @@ Returns a ranked file list with estimated token counts, relevance %, focus line
|
|
|
641
650
|
|
|
642
651
|
Follows imports, call sites, and references to build a relationship graph from a starting symbol or file location.
|
|
643
652
|
|
|
644
|
-
#### `kb_find_examples` — Find real usage examples
|
|
645
|
-
|
|
646
|
-
| Parameter | Type | Required | Default | Description |
|
|
647
|
-
|-----------|------|----------|---------|-------------|
|
|
648
|
-
| `query` | string | **yes** | — | Symbol or pattern to find examples of |
|
|
649
|
-
| `limit` | number (1–20) | no | `5` | Maximum examples to return |
|
|
650
|
-
| `content_type` | string | no | — | Filter by content type |
|
|
651
|
-
|
|
652
|
-
Returns usage examples with file paths and code snippets from the indexed codebase.
|
|
653
|
-
|
|
654
653
|
#### `kb_dead_symbols` — Find unused exported symbols
|
|
655
654
|
|
|
656
655
|
| Parameter | Type | Required | Default | Description |
|
|
@@ -748,6 +747,18 @@ Returns structured pass/fail summary. `isError` set if any tests failed.
|
|
|
748
747
|
|
|
749
748
|
Returns per-operation outcomes (success/failure with results or errors).
|
|
750
749
|
|
|
750
|
+
#### `kb_audit` — Unified project audit
|
|
751
|
+
|
|
752
|
+
Runs multiple analysis checks in a single call and returns a synthesized report with a composite score (0–100), per-check summaries, and prioritized recommendations.
|
|
753
|
+
|
|
754
|
+
| Parameter | Type | Required | Default | Description |
|
|
755
|
+
|-----------|------|----------|---------|-------------|
|
|
756
|
+
| `path` | string | no | `.` | Root path to audit |
|
|
757
|
+
| `checks` | string[] | no | all | Subset of checks: `structure`, `dependencies`, `patterns`, `health`, `dead_symbols`, `check`, `entry_points` |
|
|
758
|
+
| `detail` | enum | no | `summary` | `summary` (markdown overview) or `full` (structured JSON data) |
|
|
759
|
+
|
|
760
|
+
Returns `KBResponse<AuditData>` with `next[]` hints for follow-up actions.
|
|
761
|
+
|
|
751
762
|
### Git & Environment
|
|
752
763
|
|
|
753
764
|
#### `kb_git_context` — Summarize Git repository state
|
|
@@ -931,13 +942,22 @@ Isolated file copies for parallel exploration. Create a lane, make changes, diff
|
|
|
931
942
|
|
|
932
943
|
### System
|
|
933
944
|
|
|
945
|
+
#### `kb_guide` — Tool discovery
|
|
946
|
+
|
|
947
|
+
| Parameter | Type | Required | Default | Description |
|
|
948
|
+
|-----------|------|----------|---------|-------------|
|
|
949
|
+
| `goal` | string | **yes** | — | What you want to accomplish |
|
|
950
|
+
| `max_recommendations` | number | no | 5 | Max tools to recommend (1-10) |
|
|
951
|
+
|
|
952
|
+
Given a goal description, recommends which KB tools to use and in what order. Matches against 10 predefined workflows: onboard, audit, bugfix, implement, refactor, search, context, memory, validate, analyze.
|
|
953
|
+
|
|
934
954
|
#### `kb_health` — Run project health checks
|
|
935
955
|
|
|
936
956
|
| Parameter | Type | Required | Default | Description |
|
|
937
957
|
|-----------|------|----------|---------|-------------|
|
|
938
958
|
| `path` | string | no | cwd | Root directory to check |
|
|
939
959
|
|
|
940
|
-
Verifies package.json, tsconfig, scripts, lockfile, README, LICENSE, .gitignore.
|
|
960
|
+
Verifies package.json, tsconfig, scripts, lockfile, README, LICENSE, .gitignore, circular dependencies.
|
|
941
961
|
|
|
942
962
|
#### `kb_queue` — Manage task queues
|
|
943
963
|
|
|
@@ -952,21 +972,18 @@ Verifies package.json, tsconfig, scripts, lockfile, README, LICENSE, .gitignore.
|
|
|
952
972
|
|
|
953
973
|
Sequential task queues for agent operations.
|
|
954
974
|
|
|
955
|
-
#### `
|
|
975
|
+
#### `kb_replay` — View or clear audit trail
|
|
956
976
|
|
|
957
977
|
| Parameter | Type | Required | Default | Description |
|
|
958
978
|
|-----------|------|----------|---------|-------------|
|
|
959
|
-
| `
|
|
960
|
-
| `
|
|
961
|
-
| `
|
|
962
|
-
| `
|
|
979
|
+
| `action` | enum | no | `list` | `list` to view entries, `clear` to wipe the log |
|
|
980
|
+
| `last` | number | no | 20 | Number of entries to return (list only) |
|
|
981
|
+
| `tool` | string | no | — | Filter by tool name (list only) |
|
|
982
|
+
| `source` | enum | no | — | Filter by source: `mcp` or `cli` (list only) |
|
|
983
|
+
| `since` | string | no | — | ISO timestamp — only show entries after this time (list only) |
|
|
963
984
|
|
|
964
985
|
Shows the audit trail of recent tool invocations. Each entry includes tool name, duration, input/output summaries, and status. Useful for debugging agent behavior.
|
|
965
986
|
|
|
966
|
-
#### `kb_replay_clear` — Clear audit trail
|
|
967
|
-
|
|
968
|
-
No parameters. Clears the entire replay log.
|
|
969
|
-
|
|
970
987
|
---
|
|
971
988
|
|
|
972
989
|
## MCP Resources
|
|
@@ -1138,6 +1155,6 @@ Every tool response includes a `_Next:` suggestion at the bottom. Follow these h
|
|
|
1138
1155
|
- **Workflow Hints**: Every tool response includes `_Next:` suggestions for logical follow-up actions
|
|
1139
1156
|
- **MCP SDK**: `@modelcontextprotocol/sdk` (stdio + StreamableHTTP transports)
|
|
1140
1157
|
- **Runtime**: Node.js ≥ 24, TypeScript, ESM, pnpm workspaces
|
|
1141
|
-
- **Build**:
|
|
1158
|
+
- **Build**: tsdown with integrated dts generation
|
|
1142
1159
|
- **Lint**: Biome
|
|
1143
1160
|
- **Test**: Vitest
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpxa/kb",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"bin/",
|
|
24
24
|
"packages/*/dist/**/*.js",
|
|
25
25
|
"packages/*/dist/**/*.d.ts",
|
|
26
|
+
"scaffold/",
|
|
26
27
|
"skills/",
|
|
27
28
|
"README.md",
|
|
28
29
|
"LICENSE"
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
".": "./packages/core/dist/index.js",
|
|
32
33
|
"./tools": "./packages/tools/dist/index.js",
|
|
33
34
|
"./store": "./packages/store/dist/index.js",
|
|
34
|
-
"./embeddings": "./packages/embeddings/dist/index.js"
|
|
35
|
+
"./embeddings": "./packages/embeddings/dist/index.js",
|
|
36
|
+
"./enterprise-bridge": "./packages/enterprise-bridge/dist/index.js"
|
|
35
37
|
},
|
|
36
38
|
"types": "./packages/core/dist/index.d.ts",
|
|
37
39
|
"bin": {
|
|
@@ -51,11 +53,12 @@
|
|
|
51
53
|
"devDependencies": {
|
|
52
54
|
"@biomejs/biome": "^2.x",
|
|
53
55
|
"@types/node": "^24.x",
|
|
54
|
-
"esbuild": "^0.x",
|
|
55
|
-
"glob": "^13.x",
|
|
56
56
|
"rimraf": "^6.x",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
57
|
+
"tsdown": "^0.x",
|
|
58
|
+
"turbo": "^2.x",
|
|
59
|
+
"typescript": "^6.x",
|
|
60
|
+
"vitest": "^4.x",
|
|
61
|
+
"ws": "^8.20.0"
|
|
59
62
|
},
|
|
60
63
|
"engines": {
|
|
61
64
|
"node": ">=24"
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
"scripts": {
|
|
64
67
|
"build": "node scripts/build.mjs",
|
|
65
68
|
"typecheck": "tsc -b tsconfig.build.json --emitDeclarationOnly",
|
|
66
|
-
"clean": "rimraf --glob packages/*/
|
|
69
|
+
"clean": "turbo run clean && rimraf --glob node_modules \"packages/*/node_modules\"",
|
|
67
70
|
"lint": "biome check .",
|
|
68
71
|
"lint:fix": "biome check --write .",
|
|
69
72
|
"format": "biome format --write .",
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
files: string[];
|
|
12
|
-
/** Maximum depth of transitive dependency traversal (default: 5) */
|
|
13
|
-
maxDepth?: number;
|
|
14
|
-
/** Output format */
|
|
15
|
-
format?: 'json' | 'markdown';
|
|
1
|
+
import { AnalysisResult } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/analyzers/src/blast-radius-analyzer.d.ts
|
|
4
|
+
interface BlastRadiusOptions {
|
|
5
|
+
/** Changed file paths (relative to root) */
|
|
6
|
+
files: string[];
|
|
7
|
+
/** Maximum depth of transitive dependency traversal (default: 5) */
|
|
8
|
+
maxDepth?: number;
|
|
9
|
+
/** Output format */
|
|
10
|
+
format?: 'json' | 'markdown';
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
declare class BlastRadiusAnalyzer {
|
|
13
|
+
readonly name = "blast-radius";
|
|
14
|
+
private depAnalyzer;
|
|
15
|
+
analyze(rootPath: string, options: BlastRadiusOptions): Promise<AnalysisResult>;
|
|
16
|
+
private formatMarkdown;
|
|
22
17
|
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { BlastRadiusAnalyzer, BlastRadiusOptions };
|
|
23
20
|
//# sourceMappingURL=blast-radius-analyzer.d.ts.map
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import{DependencyAnalyzer as
|
|
2
|
-
`),
|
|
3
|
-
`);
|
|
4
|
-
`);for(const e of f)t.push(`- \`${e.path}\``)}const p=n.filter(e=>e.reason==="direct-importer");if(p.length>0){t.push(`
|
|
5
|
-
### Direct Importers (${p.length} files)
|
|
6
|
-
`);for(const e of p)t.push(`- \`${e.path}\``)}const r=n.filter(e=>e.reason==="transitive-importer");if(r.length>0){t.push(`
|
|
7
|
-
### Transitive Importers (${r.length} files)
|
|
8
|
-
`);for(const e of r.slice(0,20))t.push(`- \`${e.path}\` (depth ${e.depth})`);r.length>20&&t.push(`- ... and ${r.length-20} more`)}const o=n.filter(e=>e.reason==="test");if(o.length>0){t.push(`
|
|
9
|
-
### Affected Tests (${o.length} files)
|
|
10
|
-
`);for(const e of o)t.push(`- \`${e.path}\``)}return t.push(`
|
|
1
|
+
import{DependencyAnalyzer as e}from"./dependency-analyzer.js";var t=class{name=`blast-radius`;depAnalyzer=new e;async analyze(e,t){let{files:n,maxDepth:r=5,format:i=`markdown`}=t,a=Date.now(),o=(await this.depAnalyzer.analyze(e,{format:`json`})).data,s=o.reverseGraph??{},c=o.testCoverage??{},l=new Map,u=[];for(let e of n){l.set(e,{path:e,reason:`changed`,depth:0});let t=e.replace(/\.[jt]sx?$/,``);u.push({path:t,depth:0})}for(;u.length>0;){let e=u.shift();if(!e)break;let{path:t,depth:n}=e;if(n>=r)continue;let i=s[t]??[];for(let e of i){if(l.has(e))continue;let t=n===0?`direct-importer`:`transitive-importer`;l.set(e,{path:e,reason:t,depth:n+1});let r=e.replace(/\.[jt]sx?$/,``);u.push({path:r,depth:n+1})}}let d=new Set;for(let[e]of l){let t=c[e.replace(/\.[jt]sx?$/,``)]??[];for(let e of t)l.has(e)||(d.add(e),l.set(e,{path:e,reason:`test`,depth:999}))}let f=[...l.values()].sort((e,t)=>e.depth-t.depth);return{output:i===`json`?JSON.stringify({changedFiles:n,affected:f},null,2):this.formatMarkdown(n,f,s),data:{changedFiles:n,affected:f},meta:{analyzedAt:new Date().toISOString(),scope:e,fileCount:f.length,durationMs:Date.now()-a}}}formatMarkdown(e,t,n){let r=[];r.push(`## Blast Radius Analysis
|
|
2
|
+
`),r.push(`**Changed files:** ${e.length}`),r.push(`**Total affected:** ${t.length}\n`);let i=t.filter(e=>e.reason===`changed`);if(i.length>0){r.push(`### Changed Files
|
|
3
|
+
`);for(let e of i)r.push(`- \`${e.path}\``)}let a=t.filter(e=>e.reason===`direct-importer`);if(a.length>0){r.push(`\n### Direct Importers (${a.length} files)\n`);for(let e of a)r.push(`- \`${e.path}\``)}let o=t.filter(e=>e.reason===`transitive-importer`);if(o.length>0){r.push(`\n### Transitive Importers (${o.length} files)\n`);for(let e of o.slice(0,20))r.push(`- \`${e.path}\` (depth ${e.depth})`);o.length>20&&r.push(`- ... and ${o.length-20} more`)}let s=t.filter(e=>e.reason===`test`);if(s.length>0){r.push(`\n### Affected Tests (${s.length} files)\n`);for(let e of s)r.push(`- \`${e.path}\``)}return r.push(`
|
|
11
4
|
### Review Summary
|
|
12
|
-
`),
|
|
13
|
-
`)}}export{
|
|
5
|
+
`),r.push(`| Category | Count |`),r.push(`|----------|-------|`),r.push(`| Changed | ${i.length} |`),r.push(`| Direct importers | ${a.length} |`),r.push(`| Transitive importers | ${o.length} |`),r.push(`| Affected tests | ${s.length} |`),r.push(`| **Total review scope** | **${t.length}** |`),r.join(`
|
|
6
|
+
`)}};export{t as BlastRadiusAnalyzer};
|
|
7
|
+
//# sourceMappingURL=blast-radius-analyzer.js.map
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { AnalysisResult, DependencyAnalyzerOptions, IAnalyzer, ImportInfo } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/analyzers/src/dependency-analyzer.d.ts
|
|
4
|
+
declare class DependencyAnalyzer implements IAnalyzer<DependencyAnalyzerOptions> {
|
|
5
|
+
readonly name = "dependencies";
|
|
6
|
+
/** Map of workspace package names to their relative entry point paths */
|
|
7
|
+
private workspacePackages;
|
|
8
|
+
analyze(rootPath: string, options?: DependencyAnalyzerOptions): Promise<AnalysisResult>;
|
|
9
|
+
private collectFiles;
|
|
10
|
+
private extractImports;
|
|
11
|
+
private groupExternalDeps;
|
|
12
|
+
private groupInternalDeps;
|
|
13
|
+
/**
|
|
14
|
+
* Build reverse graph: for each source file, who imports it?
|
|
15
|
+
*/
|
|
16
|
+
buildReverseGraph(imports: ImportInfo[], _rootPath: string): Record<string, string[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Build test coverage map: for each source file, which test files exercise it?
|
|
19
|
+
*/
|
|
20
|
+
buildTestCoverage(imports: ImportInfo[], _rootPath: string): Record<string, string[]>;
|
|
21
|
+
/** Resolve a relative import path to a normalized file path (best-effort). */
|
|
22
|
+
private resolveImportPath;
|
|
23
|
+
/**
|
|
24
|
+
* Build a map of workspace package names → relative entry point paths.
|
|
25
|
+
* Scans for package.json files in common workspace dirs.
|
|
26
|
+
*/
|
|
27
|
+
private buildWorkspaceMap;
|
|
28
|
+
private formatMarkdown;
|
|
29
|
+
private formatMermaid;
|
|
28
30
|
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DependencyAnalyzer };
|
|
29
33
|
//# sourceMappingURL=dependency-analyzer.d.ts.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)
|
|
3
|
-
`),g.length>0&&e.push(`**Top dependencies**: ${g.join(", ")}
|
|
4
|
-
`),e.push(`### External Dependencies
|
|
5
|
-
`),e.push("| Package | Imports | Used By |"),e.push("|---------|---------|---------|");for(const[l,p]of r)e.push(`| ${l} | ${p.count} | ${p.usedBy.length} ${p.usedBy.length===1?"file":"files"} |`);if(t&&Object.keys(t).length>0){const l=Object.keys(t).length,p=Object.keys(o).filter(f=>!y(f)&&!t[f.replace(/\\.[jt]sx?$/,"")]);e.push(`
|
|
1
|
+
import{readFile as e,readdir as t}from"node:fs/promises";import{dirname as n,extname as r,join as i,relative as a,resolve as o}from"node:path";const s=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.py`,`.java`,`.go`,`.cs`,`.kt`,`.scala`,`.rb`,`.rs`,`.php`,`.swift`]),c=[{regex:/import\s+(?:(?:type\s+)?(?:(?:\{[^}]*\}|[\w*]+)\s+from\s+)?)['"]([^'"]+)['"]/g,confidence:`high`},{regex:/import\(\s*['"]([^'"]+)['"]\s*\)/g,confidence:`medium`},{regex:/require\(\s*['"]([^'"]+)['"]\s*\)/g,confidence:`medium`},{regex:/^from\s+([\w.]+)\s+import\b/gm,confidence:`high`,lang:`python`},{regex:/^import\s+([\w.]+)\s*$/gm,confidence:`high`,lang:`python`},{regex:/^import\s+(?:static\s+)?([\w.]+(?:\.\*)?)\s*;/gm,confidence:`high`,lang:`java`},{regex:/(?:^import\s+|^\s+)[""]([^""]+)[""]/gm,confidence:`high`,lang:`go`},{regex:/^using\s+(?:static\s+)?([\w.]+)\s*;/gm,confidence:`high`,lang:`csharp`},{regex:/^use\s+([\w:]+(?:::\w+)*)/gm,confidence:`high`,lang:`rust`},{regex:/^use\s+([\w\\]+)\s*;/gm,confidence:`high`,lang:`php`},{regex:/require(?:_relative)?\s+['"]([^'"]+)['"]/g,confidence:`medium`,lang:`ruby`},{regex:/^import\s+(\w+)\s*$/gm,confidence:`high`,lang:`swift`}],l=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`]),u=[/\.(test|spec)\.[jt]sx?$/,/\/__tests__\//,/\/test\//,/\/tests\//],d={".ts":`js`,".tsx":`js`,".js":`js`,".jsx":`js`,".mjs":`js`,".cjs":`js`,".py":`python`,".java":`java`,".kt":`java`,".scala":`java`,".go":`go`,".cs":`csharp`,".rs":`rust`,".php":`php`,".rb":`ruby`,".swift":`swift`};function f(e,t){return!t||t===`js`?!e.startsWith(`.`)&&!e.startsWith(`/`):t===`python`?!e.startsWith(`.`):t===`java`?!e.startsWith(`com.`)||e.startsWith(`com.amazonaws`)||e.startsWith(`com.google`)||e.startsWith(`com.fasterxml`):t===`go`?e.includes(`.`)&&!e.startsWith(`.`):t===`csharp`?e.startsWith(`System`)||e.startsWith(`Microsoft`)||e.startsWith(`Newtonsoft`)||e.startsWith(`Amazon`):t===`rust`?!e.startsWith(`crate::`)&&!e.startsWith(`self::`)&&!e.startsWith(`super::`):!0}function p(e){return u.some(t=>t.test(e))}var m=class{name=`dependencies`;workspacePackages=new Map;async analyze(t,n={}){let{format:r=`markdown`}=n,i=Date.now();this.workspacePackages=await this.buildWorkspaceMap(t);let a=await this.collectFiles(t),o=[];for(let n of a){let r=await e(n,`utf-8`),i=this.extractImports(r,n,t);o.push(...i)}let s=this.groupExternalDeps(o),c=this.groupInternalDeps(o,t),l=this.buildReverseGraph(o,t),u=this.buildTestCoverage(o,t);return{output:r===`json`?JSON.stringify({external:s,internal:c,reverseGraph:l,testCoverage:u},null,2):r===`mermaid`?this.formatMermaid(c):this.formatMarkdown(s,c,t,u),data:{external:s,internal:c,reverseGraph:l,testCoverage:u,totalImports:o.length},meta:{analyzedAt:new Date().toISOString(),scope:t,fileCount:a.length,durationMs:Date.now()-i}}}async collectFiles(e){let n=[],a=async e=>{let o=await t(e,{withFileTypes:!0});for(let t of o){if(l.has(t.name)||t.name.startsWith(`.`))continue;let o=i(e,t.name);t.isDirectory()?await a(o):s.has(r(t.name))&&n.push(o)}};return await a(e),n}extractImports(e,t,n){let i=[],o=d[r(t).toLowerCase()];for(let r of c){if(r.lang&&r.lang!==o||!r.lang&&o&&o!==`js`)continue;let s=new RegExp(r.regex.source,r.regex.flags),c;for(;(c=s.exec(e))!==null;){let e=c[1],s=f(e,o);i.push({source:e,specifiers:[],filePath:a(n,t).replace(/\\/g,`/`),isExternal:s,confidence:r.confidence})}}return i}groupExternalDeps(e){let t={};for(let n of e){if(!n.isExternal)continue;let e=d[r(n.filePath).toLowerCase()],i;if(e===`java`){let e=n.source.split(`.`);for(;e.length>1;){let t=e[e.length-1];if(t===`*`||/^[A-Z]/.test(t))e.pop();else break}i=e.length>=2?e.slice(0,2).join(`.`):e.join(`.`)}else if(e===`python`)i=n.source.split(`.`)[0];else if(e===`go`)i=n.source;else if(e===`csharp`){let e=n.source.split(`.`);i=e.length>=2?e.slice(0,2).join(`.`):n.source}else i=n.source.startsWith(`@`)?n.source.split(`/`).slice(0,2).join(`/`):n.source.split(`/`)[0];t[i]||(t[i]={count:0,confidence:n.confidence,usedBy:new Set}),t[i].count++,t[i].usedBy.add(n.filePath),n.confidence===`high`?t[i].confidence=`high`:n.confidence===`medium`&&t[i].confidence===`low`&&(t[i].confidence=`medium`)}let n={};for(let[e,r]of Object.entries(t))n[e]={count:r.count,confidence:r.confidence,usedBy:[...r.usedBy]};return n}groupInternalDeps(e,t){let n={};for(let t of e)t.isExternal||(n[t.filePath]||(n[t.filePath]=new Set),n[t.filePath].add(t.source));let r={};for(let[e,t]of Object.entries(n))r[e]=[...t];return r}buildReverseGraph(e,t){let r={};for(let t of e){let e=n(t.filePath),i=this.resolveImportPath(t.source,e);i&&(r[i]||(r[i]=new Set),r[i].add(t.filePath))}let i={};for(let[e,t]of Object.entries(r))i[e]=[...t];return i}buildTestCoverage(e,t){let r={};for(let t of e){if(!p(t.filePath))continue;let e=n(t.filePath),i=this.resolveImportPath(t.source,e);!i||p(i)||(r[i]||(r[i]=new Set),r[i].add(t.filePath))}let i={};for(let[e,t]of Object.entries(r))i[e]=[...t];return i}resolveImportPath(e,t){if(e.startsWith(`.`))return i(t,e).replace(/\\/g,`/`).replace(/\.[jt]sx?$/,``);let n=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0],r=this.workspacePackages.get(n);return r?r.replace(/\.[jt]sx?$/,``):null}async buildWorkspaceMap(n){let r=new Map;for(let s of[`packages`,`functions`,`libs`,`apps`,`cdk`]){let c=i(n,s);try{let s=await t(c,{withFileTypes:!0});for(let t of s)if(!(!t.isDirectory()||l.has(t.name)))try{let s=i(c,t.name,`package.json`),l=JSON.parse(await e(s,`utf-8`));if(l.name){let e=l.main??l.exports?.[`.`]??`src/index.ts`,i=a(n,o(c,t.name,e)).replace(/\\/g,`/`);r.set(l.name,i)}}catch{}}catch{}}return r}formatMarkdown(e,t,n,r){let i=[];i.push(`## Dependencies: ${n}\n`);let a=Object.entries(e).sort((e,t)=>t[1].count-e[1].count),o=a.length,s=a.reduce((e,[,t])=>e+t.count,0),c=a.slice(0,5).map(([e])=>e);i.push(`**${o} external packages**, **${s} total imports**, **${Object.keys(t).length} files** with internal imports.\n`),c.length>0&&i.push(`**Top dependencies**: ${c.join(`, `)}\n`),i.push(`### External Dependencies
|
|
2
|
+
`),i.push(`| Package | Imports | Used By |`),i.push(`|---------|---------|---------|`);for(let[e,t]of a)i.push(`| ${e} | ${t.count} | ${t.usedBy.length} ${t.usedBy.length===1?`file`:`files`} |`);if(r&&Object.keys(r).length>0){let e=Object.keys(r).length,n=Object.keys(t).filter(e=>!p(e)&&!r[e.replace(/\\.[jt]sx?$/,``)]);i.push(`
|
|
6
3
|
### Test Coverage Summary
|
|
7
|
-
`),
|
|
4
|
+
`),i.push(`**${e} source modules** with test coverage.`),n.length>0&&i.push(`**${n.length} source files** with no detected test coverage.`);let a=Object.entries(r).sort((e,t)=>t[1].length-e[1].length);i.push(`
|
|
8
5
|
**Most-tested modules:**
|
|
9
|
-
`);for(
|
|
10
|
-
`)}formatMermaid(
|
|
11
|
-
`)}}export{
|
|
6
|
+
`);for(let[e,t]of a.slice(0,10)){let n=e.replace(/\/dist\/[^/]*$/,`/src/index`).replace(/\.mjs$/,`.ts`);i.push(`- ${n} (${t.length} ${t.length===1?`test`:`tests`})`)}}return i.join(`
|
|
7
|
+
`)}formatMermaid(e){let t=[`graph LR`],n=e=>e.replace(/[^a-zA-Z0-9]/g,`_`);for(let[r,i]of Object.entries(e).slice(0,40)){let e=n(r);for(let a of i){let i=n(a);t.push(` ${e}["${r}"] --> ${i}["${a}"]`)}}return t.join(`
|
|
8
|
+
`)}};export{m as DependencyAnalyzer};
|
|
9
|
+
//# sourceMappingURL=dependency-analyzer.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnalysisResult, DiagramOptions, IAnalyzer } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/analyzers/src/diagram-generator.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Generates Mermaid diagrams by combining output from other analyzers.
|
|
4
6
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
declare class DiagramGenerator implements IAnalyzer<DiagramOptions> {
|
|
8
|
+
readonly name = "diagrams";
|
|
9
|
+
private readonly structureAnalyzer;
|
|
10
|
+
private readonly dependencyAnalyzer;
|
|
11
|
+
analyze(rootPath: string, options?: DiagramOptions): Promise<AnalysisResult>;
|
|
12
|
+
private generateArchitectureDiagram;
|
|
13
|
+
private generateDependencyDiagram;
|
|
12
14
|
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DiagramGenerator };
|
|
13
17
|
//# sourceMappingURL=diagram-generator.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import{DependencyAnalyzer as
|
|
2
|
-
`)}async generateDependencyDiagram(
|
|
3
|
-
|
|
4
|
-
\`\`\``}}export{D as DiagramGenerator};
|
|
1
|
+
import{DependencyAnalyzer as e}from"./dependency-analyzer.js";import{StructureAnalyzer as t}from"./structure-analyzer.js";var n=class{name=`diagrams`;structureAnalyzer=new t;dependencyAnalyzer=new e;async analyze(e,t={}){let{diagramType:n=`architecture`}=t,r=Date.now(),i;switch(n){case`dependencies`:i=await this.generateDependencyDiagram(e);break;default:i=await this.generateArchitectureDiagram(e);break}return{output:i,data:{diagramType:n},meta:{analyzedAt:new Date().toISOString(),scope:e,fileCount:0,durationMs:Date.now()-r}}}async generateArchitectureDiagram(e){let t=(await this.structureAnalyzer.analyze(e,{format:`json`,maxDepth:4})).data.tree,n=(await this.dependencyAnalyzer.analyze(e,{format:`json`})).data,r=["```mermaid",`graph TB`],i=(t.children??[]).filter(e=>e.type===`directory`).slice(0,15);for(let e of i){let t=e.name.replace(/[^a-zA-Z0-9]/g,`_`),n=(e.children??[]).filter(e=>e.type===`directory`);if(n.length>0){r.push(` subgraph ${t}["${e.name}/"]`);for(let e of n.slice(0,12)){let n=`${t}_${e.name.replace(/[^a-zA-Z0-9]/g,`_`)}`,i=Array.isArray(e.children)?e.children.length:0;r.push(` ${n}["${e.name}/ (${i})"]`)}r.push(` end`)}else{let n=Array.isArray(e.children)?e.children.length:0;r.push(` ${t}["${e.name}/ (${n} files)"]`)}}let a=new Set;if(n.internal)for(let[e,t]of Object.entries(n.internal)){let n=e.split(`/`)[0]?.replace(/[^a-zA-Z0-9]/g,`_`);for(let e of t){if(e.startsWith(`.`))continue;let t=e.split(`/`)[0]?.replace(/[^a-zA-Z0-9]/g,`_`);if(n&&t&&n!==t){let e=`${n}->${t}`;a.has(e)||(a.add(e),r.push(` ${n} --> ${t}`))}}}return r.push("```"),r.join(`
|
|
2
|
+
`)}async generateDependencyDiagram(e){return`\`\`\`mermaid\n${(await this.dependencyAnalyzer.analyze(e,{format:`mermaid`})).output}\n\`\`\``}};export{n as DiagramGenerator};
|
|
3
|
+
//# sourceMappingURL=diagram-generator.js.map
|
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { AnalysisResult, AnalyzerOptions, IAnalyzer } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/analyzers/src/entry-point-analyzer.d.ts
|
|
4
|
+
declare class EntryPointAnalyzer implements IAnalyzer<AnalyzerOptions> {
|
|
5
|
+
readonly name = "entry-points";
|
|
6
|
+
analyze(rootPath: string, _options?: AnalyzerOptions): Promise<AnalysisResult>;
|
|
7
|
+
private fromPackageJson;
|
|
8
|
+
/** Parse package.json `exports` field into entry points. */
|
|
9
|
+
private parseExportsField;
|
|
10
|
+
/** Resolve export value through condition maps (import > default > first string). */
|
|
11
|
+
private resolveExportValue;
|
|
12
|
+
/**
|
|
13
|
+
* Find all workspace package directories in a monorepo.
|
|
14
|
+
* Supports pnpm-workspace.yaml and package.json#workspaces.
|
|
15
|
+
*/
|
|
16
|
+
private findWorkspacePackages;
|
|
17
|
+
/** Simple YAML parser for pnpm-workspace.yaml — extracts packages list. */
|
|
18
|
+
private parsePnpmWorkspaceYaml;
|
|
19
|
+
/**
|
|
20
|
+
* Expand a workspace glob like "packages/*" into actual directories
|
|
21
|
+
* that contain package.json files.
|
|
22
|
+
*/
|
|
23
|
+
private expandWorkspaceGlob;
|
|
24
|
+
private fromHandlerExports;
|
|
25
|
+
/** Check if a file is a test suite. */
|
|
26
|
+
private isTestFile;
|
|
27
|
+
/** Extract a meaningful name from the file path for non-JS entry points */
|
|
28
|
+
private inferNameFromFile;
|
|
29
|
+
/**
|
|
30
|
+
* Derive a contextual name from the directory path for generic handler/main files.
|
|
31
|
+
* E.g., "services/channels/email/delivery/src/handler.ts" → "email-delivery"
|
|
32
|
+
*/
|
|
33
|
+
private deriveContextualName;
|
|
34
|
+
private inferEntryType;
|
|
35
|
+
private detectTrigger;
|
|
36
|
+
private collectFiles;
|
|
37
|
+
private formatMarkdown;
|
|
18
38
|
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { EntryPointAnalyzer };
|
|
19
41
|
//# sourceMappingURL=entry-point-analyzer.d.ts.map
|