@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
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),
|
|
3
|
-
`).length,
|
|
4
|
-
`).length-1
|
|
5
|
-
`).length,
|
|
6
|
-
`),
|
|
7
|
-
`)
|
|
8
|
-
|
|
9
|
-
`);let u=0;const a=80*1024,d=Object.entries(n).sort((t,l)=>{const p=t[1].filter(m=>m.exported).length;return l[1].filter(m=>m.exported).length-p});for(const[t,l]of d){const p=l.filter(g=>g.exported);if(p.length===0)continue;const f=[`### ${t}
|
|
10
|
-
`];for(const g of p){const x=g.signature?` \u2014 \`${g.signature}\``:"";f.push(`- \u{1F4E4} \`${g.kind}\` **${g.name}** (line ${g.line})${x}`)}const m=l.length-p.length;m>0&&f.push(`- _${m} internal ${m===1?"symbol":"symbols"}_`),f.push("");const w=f.join(`
|
|
11
|
-
`);if(u+=w.length,u>a){e.push(`
|
|
12
|
-
_Output truncated at 80KB. ${Object.keys(n).length-e.filter(g=>g.startsWith("### ")).length} files omitted._`);break}e.push(w)}return e.join(`
|
|
13
|
-
`)}}export{U as SymbolAnalyzer};
|
|
1
|
+
import{readFile as e,readdir as t}from"node:fs/promises";import{extname as n,join as r,relative as i}from"node:path";const a=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.java`,`.py`,`.go`,`.cs`,`.rb`,`.kt`,`.scala`,`.rs`,`.php`,`.swift`]),o=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,`__pycache__`,`.venv`,`target`,`bin`,`obj`,`.gradle`,`venv`,`env`]),s={exported:[{pattern:/^export\s+(?:async\s+)?function\s+(\w+)/gm,kind:`function`},{pattern:/^export\s+(?:default\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^export\s+interface\s+(\w+)/gm,kind:`interface`},{pattern:/^export\s+type\s+(\w+)/gm,kind:`type`},{pattern:/^export\s+(?:const|let)\s+(\w+)/gm,kind:`const`},{pattern:/^export\s+enum\s+(\w+)/gm,kind:`enum`}],local:[{pattern:/^(?:async\s+)?function\s+(\w+)/gm,kind:`function`},{pattern:/^class\s+(\w+)/gm,kind:`class`},{pattern:/^interface\s+(\w+)/gm,kind:`interface`},{pattern:/^type\s+(\w+)/gm,kind:`type`},{pattern:/^(?:const|let)\s+(\w+)\s*=/gm,kind:`const`},{pattern:/^enum\s+(\w+)/gm,kind:`enum`}]},c={exported:[{pattern:/^[ \t]*public\s+(?:static\s+)?(?:abstract\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*public\s+(?:static\s+)?interface\s+(\w+)/gm,kind:`interface`},{pattern:/^[ \t]*public\s+(?:static\s+)?enum\s+(\w+)/gm,kind:`enum`},{pattern:/^[ \t]*public\s+(?:static\s+)?(?:synchronized\s+)?(?:final\s+)?(?:abstract\s+)?(?:\w+(?:<[^>]*>)?(?:\[\])*)\s+(\w+)\s*\(/gm,kind:`function`}],local:[{pattern:/^[ \t]*(?:private|protected)\s+(?:static\s+)?(?:abstract\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*(?:private|protected)\s+(?:static\s+)?(?:synchronized\s+)?(?:final\s+)?(?:\w+(?:<[^>]*>)?(?:\[\])*)\s+(\w+)\s*\(/gm,kind:`function`},{pattern:/^[ \t]*(?:private|protected)\s+(?:static\s+)?(?:final\s+)?(?:\w+(?:<[^>]*>)?)\s+(\w+)\s*[;=]/gm,kind:`variable`}],skipIndentFilter:!0},l={exported:[{pattern:/^def\s+(\w+)\s*\(/gm,kind:`function`},{pattern:/^async\s+def\s+(\w+)\s*\(/gm,kind:`function`},{pattern:/^class\s+(\w+)/gm,kind:`class`}],local:[{pattern:/^[ \t]+def\s+(\w+)\s*\(/gm,kind:`function`},{pattern:/^[ \t]+async\s+def\s+(\w+)\s*\(/gm,kind:`function`}],skipIndentFilter:!0},u={exported:[{pattern:/^func\s+([A-Z]\w*)\s*\(/gm,kind:`function`},{pattern:/^func\s+\([^)]+\)\s+([A-Z]\w*)\s*\(/gm,kind:`function`},{pattern:/^type\s+([A-Z]\w*)\s+struct\b/gm,kind:`class`},{pattern:/^type\s+([A-Z]\w*)\s+interface\b/gm,kind:`interface`},{pattern:/^type\s+([A-Z]\w*)\s+/gm,kind:`type`}],local:[{pattern:/^func\s+([a-z]\w*)\s*\(/gm,kind:`function`},{pattern:/^func\s+\([^)]+\)\s+([a-z]\w*)\s*\(/gm,kind:`function`},{pattern:/^type\s+([a-z]\w*)\s+struct\b/gm,kind:`class`},{pattern:/^type\s+([a-z]\w*)\s+/gm,kind:`type`}],skipIndentFilter:!0},d={exported:[{pattern:/^[ \t]*public\s+(?:static\s+)?(?:partial\s+)?(?:abstract\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*public\s+(?:static\s+)?interface\s+(\w+)/gm,kind:`interface`},{pattern:/^[ \t]*public\s+(?:static\s+)?enum\s+(\w+)/gm,kind:`enum`},{pattern:/^[ \t]*public\s+(?:static\s+)?(?:virtual\s+)?(?:override\s+)?(?:async\s+)?(?:\w+(?:<[^>]*>)?(?:\[\])?)\s+(\w+)\s*\(/gm,kind:`function`}],local:[{pattern:/^[ \t]*(?:private|protected|internal)\s+(?:static\s+)?(?:abstract\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*(?:private|protected|internal)\s+(?:static\s+)?(?:async\s+)?(?:\w+(?:<[^>]*>)?)\s+(\w+)\s*\(/gm,kind:`function`}],skipIndentFilter:!0},f={exported:[{pattern:/^(?:open\s+|data\s+|sealed\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^(?:fun|suspend\s+fun)\s+(\w+)\s*[(<]/gm,kind:`function`},{pattern:/^interface\s+(\w+)/gm,kind:`interface`},{pattern:/^object\s+(\w+)/gm,kind:`class`},{pattern:/^enum\s+class\s+(\w+)/gm,kind:`enum`}],local:[{pattern:/^[ \t]+(?:private|internal)\s+(?:fun|suspend\s+fun)\s+(\w+)/gm,kind:`function`},{pattern:/^[ \t]+(?:private|internal)\s+(?:val|var)\s+(\w+)/gm,kind:`variable`}],skipIndentFilter:!0},p={exported:[{pattern:/^class\s+(\w+)/gm,kind:`class`},{pattern:/^module\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]+def\s+self\.(\w+)/gm,kind:`function`}],local:[{pattern:/^[ \t]+def\s+(\w+)/gm,kind:`function`}],skipIndentFilter:!0},m={exported:[{pattern:/^pub\s+(?:async\s+)?fn\s+(\w+)/gm,kind:`function`},{pattern:/^pub\s+struct\s+(\w+)/gm,kind:`class`},{pattern:/^pub\s+trait\s+(\w+)/gm,kind:`interface`},{pattern:/^pub\s+enum\s+(\w+)/gm,kind:`enum`},{pattern:/^pub\s+type\s+(\w+)/gm,kind:`type`}],local:[{pattern:/^(?:async\s+)?fn\s+(\w+)/gm,kind:`function`},{pattern:/^struct\s+(\w+)/gm,kind:`class`},{pattern:/^trait\s+(\w+)/gm,kind:`interface`},{pattern:/^enum\s+(\w+)/gm,kind:`enum`}],skipIndentFilter:!0},h={exported:[{pattern:/^[ \t]*(?:abstract\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*interface\s+(\w+)/gm,kind:`interface`},{pattern:/^[ \t]*public\s+(?:static\s+)?function\s+(\w+)/gm,kind:`function`},{pattern:/^function\s+(\w+)\s*\(/gm,kind:`function`}],local:[{pattern:/^[ \t]*(?:private|protected)\s+(?:static\s+)?function\s+(\w+)/gm,kind:`function`}],skipIndentFilter:!0},g={exported:[{pattern:/^[ \t]*(?:open|public)\s+class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*(?:open|public)\s+struct\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*(?:open|public)\s+protocol\s+(\w+)/gm,kind:`interface`},{pattern:/^[ \t]*(?:open|public)\s+enum\s+(\w+)/gm,kind:`enum`},{pattern:/^[ \t]*(?:open|public)\s+func\s+(\w+)/gm,kind:`function`}],local:[{pattern:/^[ \t]*(?:private|fileprivate|internal)\s+func\s+(\w+)/gm,kind:`function`},{pattern:/^[ \t]*(?:private|fileprivate|internal)\s+class\s+(\w+)/gm,kind:`class`}],skipIndentFilter:!0},_={exported:[{pattern:/^[ \t]*(?:case\s+)?class\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*object\s+(\w+)/gm,kind:`class`},{pattern:/^[ \t]*trait\s+(\w+)/gm,kind:`interface`},{pattern:/^[ \t]*def\s+(\w+)/gm,kind:`function`}],local:[],skipIndentFilter:!0};function v(e){switch(e){case`.ts`:case`.tsx`:case`.js`:case`.jsx`:return s;case`.java`:return c;case`.py`:return l;case`.go`:return u;case`.cs`:return d;case`.kt`:return f;case`.rb`:return p;case`.rs`:return m;case`.php`:return h;case`.swift`:return g;case`.scala`:return _;default:return s}}function y(e,t){let n=``,r=0,i=!1;for(let a=t;a<Math.min(t+5,e.length);a++){let t=e[a].trim();n+=(n?` `:``)+t;for(let e of t)e===`(`&&(r++,i=!0),e===`)`&&r--;if(i&&r<=0)return n.replace(/\s*\{.*$/,``).replace(/\s*:\s*$/,``).trim()}return n.trim()||void 0}var b=class{name=`symbols`;async analyze(t,n={}){let{format:r=`markdown`,filter:a}=n,o=Date.now(),s=await this.collectFiles(t),c=[];for(let n of s){let r=await e(n,`utf-8`),a=this.extractSymbols(r,i(t,n).replace(/\\/g,`/`));c.push(...a)}if(a){let e=a.toLowerCase();c=c.filter(t=>t.name.toLowerCase().includes(e))}return{output:r===`json`?JSON.stringify(c,null,2):this.formatMarkdown(c,t),data:{symbols:c,byKind:this.groupByKind(c),exportedCount:c.filter(e=>e.exported).length,totalCount:c.length},meta:{analyzedAt:new Date().toISOString(),scope:t,fileCount:s.length,durationMs:Date.now()-o}}}async collectFiles(e){let i=[],s=async e=>{let c=await t(e,{withFileTypes:!0});for(let t of c){if(o.has(t.name)||t.name.startsWith(`.`))continue;let c=r(e,t.name);t.isDirectory()?await s(c):a.has(n(t.name))&&i.push(c)}};return await s(e),i}extractSymbols(e,t){let r=[],i=e.split(`
|
|
2
|
+
`),a=new Set,o=v(n(t));for(let{pattern:n,kind:s}of o.exported){let o=new RegExp(n.source,n.flags),c;for(;(c=o.exec(e))!==null;){let n=c[1];a.add(n);let o=e.slice(0,c.index).split(`
|
|
3
|
+
`).length,l=s===`function`||s===`method`?y(i,o-1):void 0;r.push({name:n,kind:s,exported:!0,filePath:t,line:o,signature:l})}}for(let{pattern:n,kind:s}of o.local){let c=new RegExp(n.source,n.flags),l;for(;(l=c.exec(e))!==null;){let n=l[1];if(a.has(n))continue;if(!o.skipIndentFilter){let t=i[e.slice(0,l.index).split(`
|
|
4
|
+
`).length-1]??``;if(t.startsWith(` `)||t.startsWith(` `))continue}let c=e.slice(0,l.index).split(`
|
|
5
|
+
`).length,u=s===`function`||s===`method`?y(i,c-1):void 0;r.push({name:n,kind:s,exported:!1,filePath:t,line:c,signature:u})}}return r}groupByKind(e){let t={};for(let n of e)t[n.kind]=(t[n.kind]??0)+1;return t}formatMarkdown(e,t){let n=[],r=e.filter(e=>e.exported).length;n.push(`## Symbols: ${t}\n`),n.push(`**${e.length} symbols** (${r} exported)\n`);let i={};for(let t of e)i[t.kind]=(i[t.kind]??0)+1;let a=Object.entries(i).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${t} ${e===`class`?`classes`:`${e}s`}`).join(`, `);n.push(`**Breakdown**: ${a}\n`);let o={};for(let t of e)o[t.filePath]||(o[t.filePath]=[]),o[t.filePath].push(t);n.push(`**${Object.keys(o).length} files** with symbols\n`);let s=0,c=Object.entries(o).sort((e,t)=>{let n=e[1].filter(e=>e.exported).length;return t[1].filter(e=>e.exported).length-n});for(let[e,t]of c){let r=t.filter(e=>e.exported);if(r.length===0)continue;let i=[`### ${e}\n`];for(let e of r){let t=e.signature?` — \`${e.signature}\``:``;i.push(`- 📤 \`${e.kind}\` **${e.name}** (line ${e.line})${t}`)}let a=t.length-r.length;a>0&&i.push(`- _${a} internal ${a===1?`symbol`:`symbols`}_`),i.push(``);let c=i.join(`
|
|
6
|
+
`);if(s+=c.length,s>81920){n.push(`\n_Output truncated at 80KB. ${Object.keys(o).length-n.filter(e=>e.startsWith(`### `)).length} files omitted._`);break}n.push(c)}return n.join(`
|
|
7
|
+
`)}};export{b as SymbolAnalyzer};
|
|
8
|
+
//# sourceMappingURL=symbol-analyzer.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region packages/analyzers/src/ts-call-graph.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* TypeScript Compiler API-based call graph extractor.
|
|
3
4
|
*
|
|
@@ -5,23 +6,25 @@
|
|
|
5
6
|
* the AST to find function call sites and resolve them to their declaration files.
|
|
6
7
|
* Produces module-level call edges: which modules call functions in which other modules.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
interface ModuleCallEdge {
|
|
10
|
+
/** Caller module (relative path) */
|
|
11
|
+
from: string;
|
|
12
|
+
/** Callee module (relative path) */
|
|
13
|
+
to: string;
|
|
14
|
+
/** Function/symbol names called across this edge */
|
|
15
|
+
symbols: string[];
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
interface CallGraphResult {
|
|
18
|
+
edges: ModuleCallEdge[];
|
|
19
|
+
fileCount: number;
|
|
20
|
+
edgeCount: number;
|
|
21
|
+
durationMs: number;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Extract module-level call graph from a TypeScript/JavaScript project.
|
|
24
25
|
* Returns null if TypeScript compiler is unavailable or no TS files found.
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
declare function extractTsCallGraph(rootPath: string): Promise<CallGraphResult | null>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { CallGraphResult, ModuleCallEdge, extractTsCallGraph };
|
|
27
30
|
//# sourceMappingURL=ts-call-graph.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{extname as e,join as t,relative as n}from"node:path";import{existsSync as r,readFileSync as i,readdirSync as a}from"node:fs";const o=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`]);async function s(e){let t=Date.now();if(!c(e))return null;let r;try{r=await import(`typescript`)}catch{return null}let i=u(e);if(i.length===0)return null;let a=i.slice(0,800),o=l(r,e),s=r.createProgram(a,{...o,noEmit:!0,skipLibCheck:!0,allowJs:!0,target:r.ScriptTarget.ESNext,module:r.ModuleKind.ESNext,moduleResolution:r.ModuleResolutionKind.Bundler}),f=s.getTypeChecker(),p=new Map;for(let t of s.getSourceFiles()){let i=t.fileName;if(t.isDeclarationFile||i.includes(`node_modules`))continue;let a=n(e,i).replace(/\\/g,`/`);a.startsWith(`..`)||d(r,t,t,f,e,a,p)}let m=[];for(let[e,t]of p){let[n,r]=e.split(`|`);m.push({from:n,to:r,symbols:[...t].sort().slice(0,10)})}return m.sort((e,t)=>t.symbols.length-e.symbols.length),{edges:m,fileCount:a.length,edgeCount:m.length,durationMs:Date.now()-t}}function c(e){if(r(t(e,`tsconfig.json`))||r(t(e,`tsconfig.build.json`)))return!0;try{for(let n of a(e,{withFileTypes:!0}))if(n.isDirectory()&&!o.has(n.name)&&!n.name.startsWith(`.`)&&r(t(e,n.name,`tsconfig.json`)))return!0}catch{}return!1}function l(e,n){let a=t(n,`tsconfig.json`);if(!r(a))return{};try{let t=e.readConfigFile(a,e=>i(e,`utf-8`));return t.error?{}:e.parseJsonConfigFileContent(t.config,e.sys,n).options}catch{return{}}}function u(r){let i=[],s=new Set([`.ts`,`.tsx`]),c=(l,u)=>{if(!(u>10))try{for(let d of a(l,{withFileTypes:!0})){if(o.has(d.name)||d.name.startsWith(`.`))continue;let a=t(l,d.name);if(d.isDirectory())c(a,u+1);else if(s.has(e(d.name))){if(d.name.endsWith(`.d.ts`)||/\.(test|spec)\.[jt]sx?$/.test(d.name)||n(r,l).replace(/\\/g,`/`).split(`/`).some(e=>e===`test`||e===`tests`||e===`__tests__`||e===`spec`))continue;i.push(a)}}}catch{}};return c(r,0),i}function d(e,t,n,r,i,a,o){if(e.isCallExpression(t)||e.isNewExpression(t)){let n=t.expression;p(e,n,r,i,a,o)}e.forEachChild(t,t=>{d(e,t,n,r,i,a,o)})}function f(e){let t=e.match(/^(.+?)\/dist\/(.+)$/);if(!t)return e;let[,n,r]=t;return`${n}/src/${r.replace(/\.d\.(m?ts|cts)$/,`.ts`)}`}function p(e,t,r,i,a,o){try{let s,c;if(e.isIdentifier(t)?(s=r.getSymbolAtLocation(t),c=t.text):e.isPropertyAccessExpression(t)&&(s=r.getSymbolAtLocation(t.name),c=t.name.text),!s||!c)return;s.flags&e.SymbolFlags.Alias&&(s=r.getAliasedSymbol(s));let l=s.getDeclarations();if(!l||l.length===0)return;let u=l[0].getSourceFile().fileName;if(u.includes(`node_modules`))return;let d=n(i,u).replace(/\\/g,`/`);if(d=f(d),d===a||d.startsWith(`..`))return;let p=`${a}|${d}`,m=o.get(p);m?m.add(c):o.set(p,new Set([c]))}catch{}}export{s as extractTsCallGraph};
|
|
2
|
+
//# sourceMappingURL=ts-call-graph.js.map
|
|
@@ -1,98 +1,101 @@
|
|
|
1
|
+
//#region packages/analyzers/src/types.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Analyzer interfaces and result types.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
interface AnalysisResult {
|
|
6
|
+
/** Formatted output (Markdown, JSON, or Mermaid) */
|
|
7
|
+
output: string;
|
|
8
|
+
/** Structured data for programmatic access */
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
/** Analysis metadata */
|
|
11
|
+
meta: {
|
|
12
|
+
analyzedAt: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
fileCount: number;
|
|
15
|
+
durationMs: number;
|
|
16
|
+
};
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
interface AnalyzerOptions {
|
|
19
|
+
format?: 'json' | 'markdown' | 'mermaid';
|
|
20
|
+
[key: string]: unknown;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
interface IAnalyzer<TOpts extends AnalyzerOptions = AnalyzerOptions> {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
analyze(rootPath: string, options?: TOpts): Promise<AnalysisResult>;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
interface StructureAnalyzerOptions extends AnalyzerOptions {
|
|
27
|
+
format?: 'json' | 'markdown';
|
|
28
|
+
maxDepth?: number;
|
|
29
|
+
/** When true, only include source code and config files (no docs, images, fonts, etc.) */
|
|
30
|
+
sourceOnly?: boolean;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
interface DependencyAnalyzerOptions extends AnalyzerOptions {
|
|
33
|
+
format?: 'json' | 'markdown' | 'mermaid';
|
|
34
|
+
maxNodes?: number;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
interface SymbolAnalyzerOptions extends AnalyzerOptions {
|
|
37
|
+
filter?: string;
|
|
38
|
+
format?: 'json' | 'markdown';
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
interface DiagramOptions extends AnalyzerOptions {
|
|
41
|
+
diagramType?: 'architecture' | 'dependencies';
|
|
42
|
+
scope?: string;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
interface TreeNode {
|
|
45
|
+
name: string;
|
|
46
|
+
type: 'file' | 'directory';
|
|
47
|
+
purpose?: string;
|
|
48
|
+
language?: string;
|
|
49
|
+
size?: number;
|
|
50
|
+
children?: TreeNode[];
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
interface ProjectStats {
|
|
53
|
+
totalFiles: number;
|
|
54
|
+
totalSize: number;
|
|
55
|
+
languages: Record<string, number>;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
interface ImportInfo {
|
|
58
|
+
source: string;
|
|
59
|
+
specifiers: string[];
|
|
60
|
+
filePath: string;
|
|
61
|
+
isExternal: boolean;
|
|
62
|
+
/** Confidence level based on import resolution method */
|
|
63
|
+
confidence: 'high' | 'medium' | 'low';
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
interface SymbolInfo {
|
|
66
|
+
name: string;
|
|
67
|
+
kind: 'function' | 'class' | 'interface' | 'type' | 'const' | 'enum' | 'variable' | 'method';
|
|
68
|
+
exported: boolean;
|
|
69
|
+
filePath: string;
|
|
70
|
+
line: number;
|
|
71
|
+
/** Full signature for functions/methods (parameter list + return type) */
|
|
72
|
+
signature?: string;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
interface PatternMatch {
|
|
75
|
+
pattern: string;
|
|
76
|
+
description: string;
|
|
77
|
+
locations: string[];
|
|
78
|
+
confidence: 'high' | 'medium' | 'low';
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
interface EntryPoint {
|
|
81
|
+
name: string;
|
|
82
|
+
type: 'lambda-handler' | 'main' | 'bin' | 'server' | 'cli' | 'test' | 'cdk-construct';
|
|
83
|
+
filePath: string;
|
|
84
|
+
trigger?: string;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
interface ExtractionBaselines {
|
|
87
|
+
structure?: AnalysisResult;
|
|
88
|
+
dependencies?: AnalysisResult;
|
|
89
|
+
symbols?: AnalysisResult;
|
|
90
|
+
patterns?: AnalysisResult;
|
|
91
|
+
entryPoints?: AnalysisResult;
|
|
92
|
+
diagrams?: AnalysisResult[];
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
interface ExistingKnowledge {
|
|
95
|
+
categories: string[];
|
|
96
|
+
lastProduced: Record<string, string>;
|
|
97
|
+
documentCount: number;
|
|
97
98
|
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { AnalysisResult, AnalyzerOptions, DependencyAnalyzerOptions, DiagramOptions, EntryPoint, ExistingKnowledge, ExtractionBaselines, IAnalyzer, ImportInfo, PatternMatch, ProjectStats, StructureAnalyzerOptions, SymbolAnalyzerOptions, SymbolInfo, TreeNode };
|
|
98
101
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
//#region packages/chunker/src/call-graph-extractor.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Call-graph extractor using tree-sitter AST.
|
|
3
4
|
*
|
|
4
5
|
* Extracts function-level call sites from parsed code, producing
|
|
5
6
|
* caller→callee edges for blast-radius and dependency analysis.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
interface CallEdge {
|
|
9
|
+
/** File containing the call */
|
|
10
|
+
callerFile: string;
|
|
11
|
+
/** Function/method making the call (or '<module>' for top-level) */
|
|
12
|
+
callerName: string;
|
|
13
|
+
/** Name of the function/method being called */
|
|
14
|
+
calleeName: string;
|
|
15
|
+
/** 1-based line number of the call site */
|
|
16
|
+
line: number;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* Extract call edges from a source file using tree-sitter AST.
|
|
19
20
|
* Returns null if tree-sitter is unavailable or doesn't support the language.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
declare function extractCallEdges(content: string, filePath: string): CallEdge[] | null;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CallEdge, extractCallEdges };
|
|
22
25
|
//# sourceMappingURL=call-graph-extractor.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TreeSitterRuntime as e}from"./treesitter-chunker.js";import{extname as t}from"node:path";const n=new Set([`function_declaration`,`method_definition`,`arrow_function`,`function_definition`,`function_declaration`,`method_declaration`,`function_item`,`method_declaration`,`constructor_declaration`]),r=new Set([`call_expression`,`new_expression`,`call`]);function i(n,r){let i=e.get();if(!i)return null;let o=t(r).toLowerCase();if(!i.hasLanguage(o))return null;let s=i.parse(n,o);if(!s)return null;let c=[],l=s.rootNode;return a(l,r,`<module>`,c),c}function a(e,t,i,c){if(!e)return;let l=i;if(n.has(e.type)&&(l=o(e)??i),r.has(e.type)){let n=s(e);n&&c.push({callerFile:t,callerName:l,calleeName:n,line:(e.startPosition?.row??0)+1})}for(let n=0;n<(e.childCount??0);n++){let r=e.child(n);r&&a(r,t,l,c)}}function o(e){for(let t=0;t<(e.childCount??0);t++){let n=e.child(t);if(n&&(n.type===`identifier`||n.type===`property_identifier`||n.type===`name`))return n.text??null}return null}function s(e){let t=e.childForFieldName?.(`function`)??e.child(0);return t?t.type===`identifier`||t.type===`name`?t.text??null:t.type===`member_expression`||t.type===`attribute`?(t.childForFieldName?.(`property`)??t.childForFieldName?.(`attribute`))?.text??null:e.type===`new_expression`?e.child(1)?.text??null:null:null}export{i as extractCallEdges};
|
|
2
|
+
//# sourceMappingURL=call-graph-extractor.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { IChunker } from "./chunker.interface.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/chunker/src/chunker-factory.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Create the appropriate chunker for a file extension.
|
|
4
6
|
* Prefers tree-sitter AST-based chunking when available; falls back to regex-based.
|
|
5
7
|
*/
|
|
6
|
-
|
|
8
|
+
declare function createChunker(fileExtension: string): IChunker;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createChunker };
|
|
7
11
|
//# sourceMappingURL=chunker-factory.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{CodeChunker as
|
|
1
|
+
import{CodeChunker as e}from"./code-chunker.js";import{TreeSitterChunker as t,TreeSitterRuntime as n}from"./treesitter-chunker.js";import{GenericChunker as r}from"./generic-chunker.js";import{MarkdownChunker as i}from"./markdown-chunker.js";function a(a){let o=a.toLowerCase();switch(o){case`.md`:case`.mdx`:return new i;case`.ts`:case`.tsx`:case`.mts`:case`.cts`:case`.js`:case`.jsx`:case`.mjs`:case`.cjs`:case`.py`:case`.go`:case`.rs`:case`.java`:{let r=n.get();return r?.hasLanguage(o)?new t(r):new e}default:return new r}}export{a as createChunker};
|
|
2
|
+
//# sourceMappingURL=chunker-factory.js.map
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChunkMetadata, RawChunk } from "@kb/core";
|
|
2
|
+
|
|
3
|
+
//#region packages/chunker/src/chunker.interface.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Interface for content chunkers.
|
|
4
6
|
* Each chunker splits a specific content type into searchable chunks.
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
interface IChunker {
|
|
9
|
+
/** Split content into chunks */
|
|
10
|
+
chunk(content: string, metadata: ChunkMetadata): RawChunk[];
|
|
9
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { IChunker };
|
|
10
14
|
//# sourceMappingURL=chunker.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { IChunker } from "./chunker.interface.js";
|
|
2
|
+
import { ChunkMetadata, RawChunk } from "@kb/core";
|
|
3
|
+
|
|
4
|
+
//#region packages/chunker/src/code-chunker.d.ts
|
|
5
|
+
declare class CodeChunker implements IChunker {
|
|
6
|
+
private readonly maxChunkSize;
|
|
7
|
+
constructor(options?: {
|
|
8
|
+
maxChunkSize?: number;
|
|
9
|
+
});
|
|
10
|
+
chunk(content: string, metadata: ChunkMetadata): RawChunk[];
|
|
11
|
+
private findDeclarationBoundaries;
|
|
12
|
+
private fallbackChunk;
|
|
13
|
+
private splitByLines;
|
|
14
|
+
private getLineNumber;
|
|
13
15
|
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { CodeChunker };
|
|
14
18
|
//# sourceMappingURL=code-chunker.d.ts.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import{CHUNK_SIZES as
|
|
2
|
-
|
|
3
|
-
`).length;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`)
|
|
8
|
-
`)
|
|
9
|
-
|
|
10
|
-
`)
|
|
11
|
-
`)
|
|
12
|
-
|
|
13
|
-
`)),s}getLineNumber(e,n){return e.slice(0,n).split(`
|
|
14
|
-
`).length}}export{C as CodeChunker};
|
|
1
|
+
import{CHUNK_SIZES as e}from"../../core/dist/index.js";var t=class{maxChunkSize;constructor(t){this.maxChunkSize=t?.maxChunkSize??e.code.max}chunk(e,t){let n=this.findDeclarationBoundaries(e);if(n.length===0)return this.fallbackChunk(e,t);let r=[];for(let i=0;i<n.length;i++){let a=n[i].offset,o=i+1<n.length?n[i+1].offset:e.length,s=e.slice(a,o).trim();if(s=`// File: ${t.sourcePath}\n`+s,s.length>this.maxChunkSize){let n=this.splitByLines(s,this.maxChunkSize),i=this.getLineNumber(e,a);for(let e of n){let n=e.split(`
|
|
2
|
+
`).length;r.push({text:e,sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:r.length,totalChunks:0,startLine:i,endLine:i+n-1}),i+=n}}else{let n=this.getLineNumber(e,a);r.push({text:s,sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:r.length,totalChunks:0,startLine:n,endLine:n+s.split(`
|
|
3
|
+
`).length-1})}}if(n[0].offset>0){let i=e.slice(0,n[0].offset).trim();i.length>0&&r.unshift({text:`// File: ${t.sourcePath}\n${i}`,sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:0,totalChunks:0,startLine:1,endLine:this.getLineNumber(e,n[0].offset)-1})}return r.map((e,t)=>({...e,chunkIndex:t,totalChunks:r.length}))}findDeclarationBoundaries(e){let t=/^(?:export\s+)?(?:default\s+)?(?:async\s+)?(?:function|class|interface|type|const|enum|abstract\s+class)\s+(\w+)/gm,n=[],r;for(;(r=t.exec(e))!==null;){let t=e.lastIndexOf(`
|
|
4
|
+
`,r.index-1)+1,i=t,a=e.slice(0,t).split(`
|
|
5
|
+
`),o=a.length-1;for(;o>=0;){let e=a[o].trim();if(e===``||e.startsWith(`//`)||e.startsWith(`*`)||e.startsWith(`/*`)||e.startsWith(`*/`)||e.startsWith(`@`))o--;else break}o<a.length-1&&(i=a.slice(0,o+1).join(`
|
|
6
|
+
`).length+1),n.push({offset:i,name:r[1]})}return n}fallbackChunk(e,t){return[{text:`// File: ${t.sourcePath}\n`+e,sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:0,totalChunks:1,startLine:1,endLine:e.split(`
|
|
7
|
+
`).length}]}splitByLines(e,t){let n=e.split(`
|
|
8
|
+
`),r=[],i=[],a=0;for(let e of n)a+e.length+1>t&&i.length>0?(r.push(i.join(`
|
|
9
|
+
`)),i=[e],a=e.length):(i.push(e),a+=e.length+1);return i.length>0&&r.push(i.join(`
|
|
10
|
+
`)),r}getLineNumber(e,t){return e.slice(0,t).split(`
|
|
11
|
+
`).length}};export{t as CodeChunker};
|
|
12
|
+
//# sourceMappingURL=code-chunker.js.map
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { IChunker } from "./chunker.interface.js";
|
|
2
|
+
import { ChunkMetadata, RawChunk } from "@kb/core";
|
|
3
|
+
|
|
4
|
+
//#region packages/chunker/src/generic-chunker.d.ts
|
|
5
|
+
declare class GenericChunker implements IChunker {
|
|
6
|
+
private readonly maxChunkSize;
|
|
7
|
+
private readonly overlap;
|
|
8
|
+
constructor(options?: {
|
|
9
|
+
maxChunkSize?: number;
|
|
10
|
+
overlap?: number;
|
|
11
|
+
});
|
|
12
|
+
chunk(content: string, metadata: ChunkMetadata): RawChunk[];
|
|
11
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { GenericChunker };
|
|
12
16
|
//# sourceMappingURL=generic-chunker.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import{CHUNK_SIZES as
|
|
2
|
-
`).length}];
|
|
3
|
-
`),r=[]
|
|
4
|
-
`),sourcePath:
|
|
5
|
-
`),sourcePath:
|
|
1
|
+
import{CHUNK_SIZES as e}from"../../core/dist/index.js";var t=class{maxChunkSize;overlap;constructor(t){this.maxChunkSize=t?.maxChunkSize??e.default.max,this.overlap=t?.overlap??e.default.overlap}chunk(e,t){if(e.length<=this.maxChunkSize)return[{text:e,sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:0,totalChunks:1,startLine:1,endLine:e.split(`
|
|
2
|
+
`).length}];let n=e.split(`
|
|
3
|
+
`),r=[],i=[],a=0,o=1;for(let e=0;e<n.length;e++){let s=n[e];if(a+s.length+1>this.maxChunkSize&&i.length>0){r.push({text:i.join(`
|
|
4
|
+
`),sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:r.length,totalChunks:0,startLine:o,endLine:o+i.length-1});let e=[],n=0;for(let t=i.length-1;t>=0&&!(n+i[t].length+1>this.overlap);t--)e.unshift(i[t]),n+=i[t].length+1;o=o+i.length-e.length,i=[...e,s],a=n+s.length+1}else i.push(s),a+=s.length+1}return i.length>0&&r.push({text:i.join(`
|
|
5
|
+
`),sourcePath:t.sourcePath,contentType:t.contentType,chunkIndex:r.length,totalChunks:0,startLine:o,endLine:o+i.length-1}),r.map((e,t)=>({...e,chunkIndex:t,totalChunks:r.length}))}};export{t as GenericChunker};
|
|
6
|
+
//# sourceMappingURL=generic-chunker.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { CallEdge, extractCallEdges } from "./call-graph-extractor.js";
|
|
2
|
+
import { IChunker } from "./chunker.interface.js";
|
|
3
|
+
import { createChunker } from "./chunker-factory.js";
|
|
4
|
+
import { CodeChunker } from "./code-chunker.js";
|
|
5
|
+
import { GenericChunker } from "./generic-chunker.js";
|
|
6
|
+
import { MarkdownChunker } from "./markdown-chunker.js";
|
|
7
|
+
import { TreeSitterChunker, TreeSitterRuntime, initializeTreeSitter } from "./treesitter-chunker.js";
|
|
8
|
+
export { type CallEdge, CodeChunker, GenericChunker, type IChunker, MarkdownChunker, TreeSitterChunker, TreeSitterRuntime, createChunker, extractCallEdges, initializeTreeSitter };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CodeChunker as e}from"./code-chunker.js";import{TreeSitterChunker as t,TreeSitterRuntime as n,initializeTreeSitter as r}from"./treesitter-chunker.js";import{extractCallEdges as i}from"./call-graph-extractor.js";import{GenericChunker as a}from"./generic-chunker.js";import{MarkdownChunker as o}from"./markdown-chunker.js";import{createChunker as s}from"./chunker-factory.js";export{e as CodeChunker,a as GenericChunker,o as MarkdownChunker,t as TreeSitterChunker,n as TreeSitterRuntime,s as createChunker,i as extractCallEdges,r as initializeTreeSitter};
|