@vpxa/kb 0.1.13 → 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 +8 -2
- 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 -35
- package/packages/analyzers/dist/entry-point-analyzer.js +5 -6
- 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 +8 -3
- package/packages/cli/dist/commands/init.js +120 -123
- 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 -7
- 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 -5
- 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 +8 -7
- 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 +107 -91
- 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 -3
- package/packages/server/dist/tools/audit.tool.d.ts +8 -4
- package/packages/server/dist/tools/audit.tool.js +2 -4
- 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 -22
- 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 -24
- 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 -46
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +61 -61
- package/packages/tools/dist/audit.js +5 -5
- 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 +42 -38
- 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 -37
- 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 -25
- 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 +14 -11
- package/packages/tools/dist/guide.js +2 -1
- package/packages/tools/dist/health.d.ts +13 -10
- package/packages/tools/dist/health.js +3 -2
- 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 -53
- 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 +4 -1
- package/packages/tools/dist/path-resolver.js +2 -1
- 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 +32 -29
- package/packages/tools/dist/replay.js +5 -6
- package/packages/tools/dist/response-envelope.d.ts +32 -29
- package/packages/tools/dist/response-envelope.js +2 -1
- 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 -47
- 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 +6 -3
- 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 +22 -9
package/README.md
CHANGED
|
@@ -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
|
|
|
@@ -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
|
|
@@ -1149,6 +1155,6 @@ Every tool response includes a `_Next:` suggestion at the bottom. Follow these h
|
|
|
1149
1155
|
- **Workflow Hints**: Every tool response includes `_Next:` suggestions for logical follow-up actions
|
|
1150
1156
|
- **MCP SDK**: `@modelcontextprotocol/sdk` (stdio + StreamableHTTP transports)
|
|
1151
1157
|
- **Runtime**: Node.js ≥ 24, TypeScript, ESM, pnpm workspaces
|
|
1152
|
-
- **Build**:
|
|
1158
|
+
- **Build**: tsdown with integrated dts generation
|
|
1153
1159
|
- **Lint**: Biome
|
|
1154
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,37 +1,41 @@
|
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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;
|
|
36
38
|
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { EntryPointAnalyzer };
|
|
37
41
|
//# sourceMappingURL=entry-point-analyzer.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import{access as
|
|
2
|
-
`)){
|
|
3
|
-
`),
|
|
4
|
-
`)
|
|
5
|
-
|
|
6
|
-
`)}}export{$ as EntryPointAnalyzer};
|
|
1
|
+
import{access as e,readFile as t,readdir as n}from"node:fs/promises";import{extname as r,join as i,relative as a,resolve as o}from"node:path";const s=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,`__pycache__`,`.venv`,`target`,`bin`,`obj`,`.gradle`,`venv`,`env`]),c=new Set([`test`,`tests`,`__tests__`,`spec`,`specs`,`test-utils`]),l=[/export\s+const\s+(handler|main)\s*(?::[^=]*)?\s*=/,/export\s+(?:async\s+)?function\s+(handler|main)\s*\(/,/export\s+const\s+(\w+Handler)\s*(?::[^=]*)?\s*=/,/export\s+default\s+app/,/^app\s*=\s*(?:Flask|FastAPI)\s*\(/m,/^urlpatterns\s*=\s*\[/m,/^if\s+__name__\s*==\s*['"]__main__['"]:/m,/public\s+static\s+void\s+main\s*\(\s*String/,/@SpringBootApplication/,/^func\s+main\s*\(\s*\)/m],u=/export\s+(?:default\s+)?class\s+(\w+)\s+extends\s+(?:Construct|Stack|NestedStack|Stage)/,d=[/from\s+['"]vitest['"]/,/from\s+['"]jest['"]/,/from\s+['"]mocha['"]/,/import\s+.*['"]@jest\/globals['"]/,/require\s*\(\s*['"](?:vitest|jest|mocha)['"]\s*\)/],f=[{regex:/SqsEventSource|SQSEvent|sqs/i,trigger:`SQS`},{regex:/SnsEventSource|SNSEvent|sns/i,trigger:`SNS`},{regex:/ApiGateway|APIGatewayEvent|httpApi|restApi/i,trigger:`API Gateway`},{regex:/ScheduleExpression|EventBridgeRule|schedule/i,trigger:`EventBridge Schedule`},{regex:/S3EventSource|S3Event|s3/i,trigger:`S3`},{regex:/DynamoEventSource|DynamoDBStream/i,trigger:`DynamoDB Stream`},{regex:/@RequestMapping|@GetMapping|@PostMapping/i,trigger:`HTTP Endpoint`},{regex:/http\.ListenAndServe|gin\.Default|echo\.New/i,trigger:`HTTP Server`},{regex:/app\.route\(|@app\.get|@app\.post|@router\./i,trigger:`HTTP Route`}];var p=class{name=`entry-points`;async analyze(e,t={}){let n=Date.now(),r=[],i=await this.findWorkspacePackages(e);if(i.length>0)for(let t of i){let n=await this.fromPackageJson(t,e);r.push(...n)}else{let t=await this.fromPackageJson(e,e);r.push(...t)}let a=await this.fromHandlerExports(e);return r.push(...a),{output:this.formatMarkdown(r,e),data:{entryPoints:r,total:r.length},meta:{analyzedAt:new Date().toISOString(),scope:e,fileCount:r.length,durationMs:Date.now()-n}}}async fromPackageJson(n,r){let o=[],s=a(r,n).replace(/\\/g,`/`)||`.`;try{let r=i(n,`package.json`);await e(r);let a=JSON.parse(await t(r,`utf-8`)),c=s===`.`?``:`${s}/`;if(a.main&&o.push({name:a.name?`${a.name}:main`:`main`,type:`main`,filePath:`${c}${a.main}`}),a.bin){let e=typeof a.bin==`string`?{[a.name??`cli`]:a.bin}:a.bin;for(let[t,n]of Object.entries(e))o.push({name:t,type:`cli`,filePath:`${c}${n}`})}if(a.exports){let e=this.parseExportsField(a.exports,a.name??s,c);o.push(...e)}a.scripts?.start&&o.push({name:a.name?`${a.name}:start`:`start`,type:`server`,filePath:a.scripts.start,trigger:`npm start`})}catch{}return o}parseExportsField(e,t,n){let r=[];if(typeof e==`string`)return r.push({name:t,type:`main`,filePath:`${n}${e}`}),r;if(typeof e!=`object`||!e)return r;for(let[i,a]of Object.entries(e)){if(!i.startsWith(`.`))continue;let e=i===`.`?t:`${t}/${i.slice(2)}`,o=this.resolveExportValue(a);o&&r.push({name:e,type:`main`,filePath:`${n}${o}`})}return r}resolveExportValue(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return;let t=e;for(let e of[`import`,`default`,`require`])if(typeof t[e]==`string`)return t[e];for(let e of Object.values(t))if(typeof e==`string`)return e}async findWorkspacePackages(n){let r=[];try{let a=i(n,`pnpm-workspace.yaml`);await e(a);let o=await t(a,`utf-8`),s=this.parsePnpmWorkspaceYaml(o);for(let e of s){let t=await this.expandWorkspaceGlob(n,e);r.push(...t)}if(r.length>0)return r}catch{}try{let e=i(n,`package.json`),a=JSON.parse(await t(e,`utf-8`)),o=Array.isArray(a.workspaces)?a.workspaces:a.workspaces?.packages??[];for(let e of o){let t=await this.expandWorkspaceGlob(n,e);r.push(...t)}}catch{}return r}parsePnpmWorkspaceYaml(e){let t=[],n=!1;for(let r of e.split(`
|
|
2
|
+
`)){let e=r.trim();if(e===`packages:`){n=!0;continue}if(n){if(e.startsWith(`- `))t.push(e.slice(2).replace(/^['"]|['"]$/g,``));else if(e&&!e.startsWith(`#`))break}}return t}async expandWorkspaceGlob(t,r){let a=[],c=r.indexOf(`*`);if(c===-1){let n=o(t,r);try{await e(i(n,`package.json`)),a.push(n)}catch{}return a}let l=o(t,r.slice(0,c));try{let t=await n(l,{withFileTypes:!0});for(let n of t){if(!n.isDirectory()||s.has(n.name))continue;let t=i(l,n.name);try{await e(i(t,`package.json`)),a.push(t)}catch{}}}catch{}return a}async fromHandlerExports(e){let n=[],r=await this.collectFiles(e);for(let i of r)try{let r=await t(i,`utf-8`),o=a(e,i).replace(/\\/g,`/`);if(!o.split(`/`).some(e=>c.has(e))){let e=!1;for(let t of l){let i=r.match(t);if(i){let t=i[1]??this.inferNameFromFile(o);(t===`handler`||t===`main`)&&(t=this.deriveContextualName(o)??t);let a=/@SpringBootApplication/.test(r)?`HTTP Server`:this.detectTrigger(r);n.push({name:t,type:this.inferEntryType(i[1]??t,o),filePath:o,trigger:a}),e=!0;break}}if(!e){let e=r.match(u);e&&n.push({name:e[1],type:`cdk-construct`,filePath:o,trigger:`CDK Construct`})}}this.isTestFile(o,r)&&n.push({name:this.inferNameFromFile(o),type:`test`,filePath:o,trigger:`Test Suite`})}catch{}return n}isTestFile(e,t){return/\.(test|spec)\.[jt]sx?$/.test(e)?d.some(e=>e.test(t)):!1}inferNameFromFile(e){return(e.split(/[/\\]/).pop()??`default`).replace(/\.\w+$/,``)}deriveContextualName(e){let t=e.split(`/`).filter(e=>e!==`src`&&e!==`lib`);if(t.pop(),t.length===0)return;let n=t.filter(e=>![`services`,`functions`,`lambdas`,`handlers`,`packages`,`apps`].includes(e));if(n.length===0)return;let r=n.slice(-2);return r.length===2&&r[1].startsWith(r[0])?r[1]:r.join(`-`)}inferEntryType(e,t){return e===`handler`||e===`main`||t.includes(`handler`)||/functions[/]/.test(t)||e.endsWith(`Handler`)?`lambda-handler`:(t.endsWith(`.py`)||t.endsWith(`.go`)||t.endsWith(`.java`),`main`)}detectTrigger(e){for(let t of f)if(t.regex.test(e))return t.trigger}async collectFiles(e){let t=[],a=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.java`,`.py`,`.go`,`.cs`,`.kt`,`.rb`,`.rs`,`.php`,`.swift`]),o=async(e,c)=>{if(c>10)return;let l=await n(e,{withFileTypes:!0});for(let n of l){if(s.has(n.name)||n.name.startsWith(`.`))continue;let l=i(e,n.name);n.isDirectory()?await o(l,c+1):a.has(r(n.name))&&t.push(l)}};return await o(e,0),t}formatMarkdown(e,t){let n=[];if(n.push(`## Entry Points: ${t}\n`),n.push(`**${e.length} entry ${e.length===1?`point`:`points`}** found\n`),e.length===0)return n.push(`No entry points detected.`),n.join(`
|
|
3
|
+
`);let r=new Map;for(let t of e){let e=r.get(t.type)??[];e.push(t),r.set(t.type,e)}let i=[`lambda-handler`,`main`,`server`,`cli`,`bin`,`cdk-construct`,`test`],a=[...r.entries()].sort((e,t)=>i.indexOf(e[0])-i.indexOf(t[0]));n.push(`| Name | Type | File | Trigger |`),n.push(`|------|------|------|---------|`);for(let[,e]of a)for(let t of e)n.push(`| ${t.name} | ${t.type} | ${t.filePath} | ${t.trigger??`—`} |`);return n.join(`
|
|
4
|
+
`)}};export{p as EntryPointAnalyzer};
|
|
5
|
+
//# sourceMappingURL=entry-point-analyzer.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { extractTsCallGraph }
|
|
13
|
-
export type { AnalysisResult, AnalyzerOptions, DependencyAnalyzerOptions, DiagramOptions, EntryPoint, ExistingKnowledge, ExtractionBaselines, IAnalyzer, ImportInfo, PatternMatch, ProjectStats, StructureAnalyzerOptions, SymbolAnalyzerOptions, SymbolInfo, TreeNode, } from './types.js';
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { AnalysisResult, AnalyzerOptions, DependencyAnalyzerOptions, DiagramOptions, EntryPoint, ExistingKnowledge, ExtractionBaselines, IAnalyzer, ImportInfo, PatternMatch, ProjectStats, StructureAnalyzerOptions, SymbolAnalyzerOptions, SymbolInfo, TreeNode } from "./types.js";
|
|
2
|
+
import { BlastRadiusAnalyzer, BlastRadiusOptions } from "./blast-radius-analyzer.js";
|
|
3
|
+
import { DependencyAnalyzer } from "./dependency-analyzer.js";
|
|
4
|
+
import { DiagramGenerator } from "./diagram-generator.js";
|
|
5
|
+
import { EntryPointAnalyzer } from "./entry-point-analyzer.js";
|
|
6
|
+
import { PatternAnalyzer } from "./pattern-analyzer.js";
|
|
7
|
+
import { StructureAnalyzer } from "./structure-analyzer.js";
|
|
8
|
+
import { SymbolAnalyzer } from "./symbol-analyzer.js";
|
|
9
|
+
import { Analyzers, KnowledgeProducer } from "./knowledge-producer.js";
|
|
10
|
+
import { extractTsCallGraph } from "./ts-call-graph.js";
|
|
11
|
+
import { extractRegexCallGraph } from "./regex-call-graph.js";
|
|
12
|
+
export { type AnalysisResult, type AnalyzerOptions, type Analyzers, BlastRadiusAnalyzer, type BlastRadiusOptions, DependencyAnalyzer, type DependencyAnalyzerOptions, DiagramGenerator, type DiagramOptions, type EntryPoint, EntryPointAnalyzer, type ExistingKnowledge, type ExtractionBaselines, type IAnalyzer, type ImportInfo, KnowledgeProducer, PatternAnalyzer, type PatternMatch, type ProjectStats, StructureAnalyzer, type StructureAnalyzerOptions, SymbolAnalyzer, type SymbolAnalyzerOptions, type SymbolInfo, type TreeNode, extractRegexCallGraph, extractTsCallGraph };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BlastRadiusAnalyzer as t}from"./blast-radius-analyzer.js";import{
|
|
1
|
+
import{DependencyAnalyzer as e}from"./dependency-analyzer.js";import{BlastRadiusAnalyzer as t}from"./blast-radius-analyzer.js";import{StructureAnalyzer as n}from"./structure-analyzer.js";import{DiagramGenerator as r}from"./diagram-generator.js";import{EntryPointAnalyzer as i}from"./entry-point-analyzer.js";import{KnowledgeProducer as a}from"./knowledge-producer.js";import{PatternAnalyzer as o}from"./pattern-analyzer.js";import{extractRegexCallGraph as s}from"./regex-call-graph.js";import{SymbolAnalyzer as c}from"./symbol-analyzer.js";import{extractTsCallGraph as l}from"./ts-call-graph.js";export{t as BlastRadiusAnalyzer,e as DependencyAnalyzer,r as DiagramGenerator,i as EntryPointAnalyzer,a as KnowledgeProducer,o as PatternAnalyzer,n as StructureAnalyzer,c as SymbolAnalyzer,s as extractRegexCallGraph,l as extractTsCallGraph};
|