@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,47 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
contentType?: string;
|
|
20
|
-
/** Working directory for glob resolution (default: cwd) */
|
|
21
|
-
cwd?: string;
|
|
1
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
2
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
3
|
+
import { ContentType } from "@kb/core";
|
|
4
|
+
|
|
5
|
+
//#region packages/tools/src/find.d.ts
|
|
6
|
+
interface FindOptions {
|
|
7
|
+
/** Semantic search query (optional) */
|
|
8
|
+
query?: string;
|
|
9
|
+
/** File glob pattern (optional) */
|
|
10
|
+
glob?: string;
|
|
11
|
+
/** Keyword/regex pattern for text search (optional) */
|
|
12
|
+
pattern?: string;
|
|
13
|
+
/** Max results per strategy (default: 10) */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Filter by content type */
|
|
16
|
+
contentType?: ContentType;
|
|
17
|
+
/** Working directory for glob resolution (default: cwd) */
|
|
18
|
+
cwd?: string;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
interface FindResult {
|
|
21
|
+
/** File path (relative to cwd) */
|
|
22
|
+
path: string;
|
|
23
|
+
/** How this result was found */
|
|
24
|
+
source: 'vector' | 'keyword' | 'glob' | 'pattern';
|
|
25
|
+
/** Relevance score (0-1 for vector/keyword, 1 for glob/pattern matches) */
|
|
26
|
+
score: number;
|
|
27
|
+
/** Line range if from KB search */
|
|
28
|
+
lineRange?: {
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
};
|
|
32
|
+
/** Content preview */
|
|
33
|
+
preview?: string;
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
interface FindResults {
|
|
36
|
+
results: FindResult[];
|
|
37
|
+
strategies: string[];
|
|
38
|
+
totalFound: number;
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
41
|
* Run federated search across multiple strategies.
|
|
45
42
|
*/
|
|
46
|
-
|
|
43
|
+
declare function find(embedder: IEmbedder, store: IKnowledgeStore, options: FindOptions): Promise<FindResults>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { FindOptions, FindResult, FindResults, find };
|
|
47
46
|
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function e(e,t,n){let{query:r,glob:i,pattern:a,limit:o=10,contentType:s,cwd:c=process.cwd()}=n,l=[],u=[],d=new Set;if(r){l.push(`vector`);let n=await e.embed(r),i={limit:o,contentType:s},a=await t.search(n,i);for(let e of a){let t=`${e.record.sourcePath}:${e.record.startLine}`;d.has(t)||(d.add(t),u.push({path:e.record.sourcePath,source:`vector`,score:e.score,lineRange:{start:e.record.startLine,end:e.record.endLine},preview:e.record.content.slice(0,200)}))}}if(r){l.push(`keyword`);try{let e=await t.ftsSearch(r,{limit:o,contentType:s});for(let t of e){let e=`${t.record.sourcePath}:${t.record.startLine}`;d.has(e)||(d.add(e),u.push({path:t.record.sourcePath,source:`keyword`,score:t.score,lineRange:{start:t.record.startLine,end:t.record.endLine},preview:t.record.content.slice(0,200)}))}}catch{}}if(i){l.push(`glob`);try{let{globSync:e}=await import(`node:fs`),t=e(i,{cwd:c,withFileTypes:!1}),n=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,`.kb-state`,`.kb-data`]),r=t.filter(e=>!e.replace(/\\/g,`/`).split(`/`).some(e=>n.has(e)));for(let e of r.slice(0,o)){let t=`glob:${e}`;d.has(t)||(d.add(t),u.push({path:e,source:`glob`,score:1}))}}catch{}}if(a){l.push(`pattern`);try{let e=new RegExp(a,`i`),n=await t.ftsSearch(a,{limit:o*2,contentType:s});for(let t of n)if(e.test(t.record.content)){let e=`${t.record.sourcePath}:${t.record.startLine}`;d.has(e)||(d.add(e),u.push({path:t.record.sourcePath,source:`pattern`,score:t.score,lineRange:{start:t.record.startLine,end:t.record.endLine},preview:t.record.content.slice(0,200)}))}}catch{}}return u.sort((e,t)=>t.score-e.score),{results:u.slice(0,o),strategies:l,totalFound:u.length}}export{e as find};
|
|
2
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
files: string[];
|
|
12
|
-
/** Task description for keyword detection */
|
|
13
|
-
task: string;
|
|
14
|
-
/** Root path for package boundary detection */
|
|
15
|
-
rootPath: string;
|
|
1
|
+
import { ForgeTier } from "./evidence-map.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/forge-classify.d.ts
|
|
4
|
+
interface ForgeClassifyOptions {
|
|
5
|
+
/** Files being modified (absolute or relative paths) */
|
|
6
|
+
files: string[];
|
|
7
|
+
/** Task description for keyword detection */
|
|
8
|
+
task: string;
|
|
9
|
+
/** Root path for package boundary detection */
|
|
10
|
+
rootPath: string;
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
interface ClassifyTrigger {
|
|
13
|
+
rule: string;
|
|
14
|
+
detail: string;
|
|
15
|
+
source: 'blast_radius' | 'cross_package' | 'schema_contract' | 'security_auth' | 'task_hint' | 'default';
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
interface TypedUnknownSeed {
|
|
18
|
+
description: string;
|
|
19
|
+
type: 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
|
|
20
|
+
suggestedTool: string;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
interface ForgeClassifyCeremony {
|
|
23
|
+
ground: string;
|
|
24
|
+
build: string;
|
|
25
|
+
break: string;
|
|
26
|
+
evidenceMap: string;
|
|
27
|
+
gate: string;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
interface ForgeClassifyResult {
|
|
30
|
+
tier: ForgeTier;
|
|
31
|
+
triggers: ClassifyTrigger[];
|
|
32
|
+
packagesCrossed: string[];
|
|
33
|
+
hasSchemaChange: boolean;
|
|
34
|
+
hasSecurityPath: boolean;
|
|
35
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
36
|
+
ceremony: ForgeClassifyCeremony;
|
|
42
37
|
}
|
|
43
|
-
|
|
38
|
+
declare function forgeClassify(options: ForgeClassifyOptions): Promise<ForgeClassifyResult>;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ClassifyTrigger, ForgeClassifyCeremony, ForgeClassifyOptions, ForgeClassifyResult, TypedUnknownSeed, forgeClassify };
|
|
44
41
|
//# sourceMappingURL=forge-classify.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}catch{return
|
|
1
|
+
import{fileSummary as e}from"./file-summary.js";import{dirname as t,extname as n,relative as r,resolve as i}from"node:path";import{existsSync as a,readFileSync as o,readdirSync as s,statSync as c}from"node:fs";const l=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mts`,`.cts`,`.mjs`,`.cjs`]),u=new Set([`.git`,`.kb-data`,`.kb-state`,`.turbo`,`.yarn`,`build`,`coverage`,`dist`,`node_modules`]),d=/auth|token|permission|acl|encrypt|secret|credential|jwt|oauth|password/i,f=/\b(hash|sign|verify|bcrypt|jwt|decrypt|secret|password)\b/i,p=/auth|security|permission|encrypt|secret|credential/i,m=/types\.ts$|schema\.ts$|contract\.ts$|\.proto$|openapi|swagger|\.graphql$/i,h=/(?:^|\/)(events|contracts|shared)(?:\/|$)/i,g=/export\s+interface\b|export\s+type\b|export\s+const\s+\w*Schema\w*\s*=\s*z\./i,_=/schema|contract|migration|breaking.change|api.change/i,v=/migration|data.?model|multi.?service|breaking|backward.?compat/i,y={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function b(e){let t=i(e.rootPath),n=e.task.trim(),r=e.files.map(e=>i(t,e)),a=[],o=!1,s=!1;for(let e of r){let r=S(e,t),i=w(e);(d.test(r)||f.test(i)||p.test(n))&&(o=!0),(m.test(r)||h.test(r)||_.test(n)||g.test(i)||await T(e))&&(s=!0)}o&&x(a,{rule:`security-path`,detail:`Security/auth path, task, or content matched security heuristics`,source:`security_auth`}),s&&x(a,{rule:`schema-contract`,detail:`Schema or contract path, task, or export shape matched contract heuristics`,source:`schema_contract`});let c=E(r,t);c.affectedFiles>5&&x(a,{rule:`blast-radius-importers`,detail:`${c.affectedFiles} affected files via direct import scanning`,source:`blast_radius`});let l=[...new Set(r.map(e=>j(e,t)).filter(e=>!!e))].sort();l.length>=2&&x(a,{rule:`cross-package-boundary`,detail:`Files span ${l.length} packages: ${l.join(`, `)}`,source:`cross_package`}),v.test(n)&&x(a,{rule:`task-hint-critical`,detail:`Task description matched migration or compatibility criticality hints`,source:`task_hint`});let u=a.length>0?`critical`:r.length===1?`floor`:`standard`;return{tier:u,triggers:a,packagesCrossed:l,hasSchemaChange:s,hasSecurityPath:o,typedUnknownSeeds:A(a),ceremony:y[u]}}function x(e,t){e.some(e=>e.rule===t.rule&&e.source===t.source)||e.push(t)}function S(e,t){let n=i(t,e),a=r(t,n);return(a&&!a.startsWith(`..`)?a:n).replace(/\\/g,`/`)}function C(e){if(!a(e))return!1;try{return c(e).size<=1e5}catch{return!1}}function w(e){if(!C(e))return``;try{return o(e,`utf-8`).split(/\r?\n/).slice(0,200).join(`
|
|
2
|
+
`)}catch{return``}}async function T(t){if(!C(t))return!1;try{let n=await e({path:t}),r=new Set(n.exports);return n.interfaces.some(e=>r.has(e.name))||n.types.some(e=>r.has(e.name))}catch{return!1}}function E(e,t){let n=new Set(e.filter(e=>a(e)));if(n.size===0)return{affectedFiles:e.length,importers:[]};let i=new Set;for(let e of D(t)){if(n.has(e)||!C(e))continue;let t=w(e);t&&O(t).some(t=>k(t,e,n))&&i.add(e)}return{affectedFiles:e.length+i.size,importers:[...i].map(e=>r(t,e).replace(/\\/g,`/`))}}function D(e){let t=[];function r(e){let a=[];try{a=s(e)}catch{return}for(let o of a){if(u.has(o))continue;let a=i(e,o),s;try{s=c(a)}catch{continue}if(s.isDirectory()){r(a);continue}l.has(n(o).toLowerCase())&&t.push(a)}}return r(e),t}function O(e){let t=new Set;for(let n of e.matchAll(/(?:from\s+['"]([^'"]+)['"]|import\s+['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\))/g)){let e=n[1]??n[2]??n[3];e&&t.add(e)}return[...t]}function k(e,n,r){if(!e.startsWith(`.`))return!1;let a=i(t(n),e);return[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.jsx`,`${a}.mts`,`${a}.cts`,`${a}.mjs`,`${a}.cjs`,i(a,`index.ts`),i(a,`index.tsx`),i(a,`index.js`),i(a,`index.jsx`)].some(e=>r.has(e))}function A(e){return e.map(e=>{switch(e.source){case`security_auth`:return{description:`Verify auth and security assumptions before yielding`,type:`contract`,suggestedTool:`kb_search`};case`schema_contract`:return{description:`Confirm schema and contract compatibility`,type:`contract`,suggestedTool:`kb_schema_validate`};case`blast_radius`:return{description:`Inspect affected importers before delivery`,type:`impact`,suggestedTool:`kb_blast_radius`};case`cross_package`:return{description:`Assess downstream package impact across boundaries`,type:`impact`,suggestedTool:`kb_blast_radius`};case`task_hint`:return{description:`Check established conventions for migrations or compatibility work`,type:`convention`,suggestedTool:`kb_find`};default:return{description:`No explicit unknown routing required`,type:`freshness`,suggestedTool:`kb_lookup`}}})}function j(e,n){let s=t(i(n,e)),c=i(n);for(;s.length>=c.length;){let e=i(s,`package.json`);if(a(e))try{return JSON.parse(o(e,`utf-8`)).name??r(c,s).replace(/\\/g,`/`)}catch{return r(c,s).replace(/\\/g,`/`)}let n=t(s);if(n===s)break;s=n}}export{b as forgeClassify};
|
|
3
|
+
//# sourceMappingURL=forge-classify.js.map
|
|
@@ -1,64 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/** Force a specific tier (skip auto-classify) */
|
|
22
|
-
forceTier?: ForgeTier;
|
|
23
|
-
/** Task ID for evidence map creation (default: auto-generated from task) */
|
|
24
|
-
taskId?: string;
|
|
1
|
+
import { ForgeTier } from "./evidence-map.js";
|
|
2
|
+
import { ClassifyTrigger, TypedUnknownSeed } from "./forge-classify.js";
|
|
3
|
+
import { ScopeMapResult } from "./scope-map.js";
|
|
4
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
5
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
6
|
+
|
|
7
|
+
//#region packages/tools/src/forge-ground.d.ts
|
|
8
|
+
interface ForgeGroundOptions {
|
|
9
|
+
/** Task description */
|
|
10
|
+
task: string;
|
|
11
|
+
/** Target files being modified (absolute paths) */
|
|
12
|
+
files: string[];
|
|
13
|
+
/** Root path of the codebase */
|
|
14
|
+
rootPath: string;
|
|
15
|
+
/** Max constraint entries to load (default: 3) */
|
|
16
|
+
maxConstraints?: number;
|
|
17
|
+
/** Force a specific tier (skip auto-classify) */
|
|
18
|
+
forceTier?: ForgeTier;
|
|
19
|
+
/** Task ID for evidence map creation (default: auto-generated from task) */
|
|
20
|
+
taskId?: string;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
interface ConstraintRef {
|
|
23
|
+
source: string;
|
|
24
|
+
snippet: string;
|
|
25
|
+
relevance: number;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
27
|
+
interface ForgeGroundResult {
|
|
28
|
+
/** Computed or forced tier */
|
|
29
|
+
tier: ForgeTier;
|
|
30
|
+
/** Classification triggers (empty if tier was forced) */
|
|
31
|
+
classifyTriggers: ClassifyTrigger[];
|
|
32
|
+
/** Scope map (relevant files with focus ranges) — null for Floor tier */
|
|
33
|
+
scopeMap: ScopeMapResult | null;
|
|
34
|
+
/** Typed Unknown Queue seeds */
|
|
35
|
+
typedUnknownSeeds: TypedUnknownSeed[];
|
|
36
|
+
/** Constraint seed — relevant KB entries from decisions/patterns */
|
|
37
|
+
constraints: ConstraintRef[];
|
|
38
|
+
/** File summaries for target files */
|
|
39
|
+
fileSummaries: Array<{
|
|
40
|
+
path: string;
|
|
41
|
+
exports: string[];
|
|
42
|
+
functions: string[];
|
|
43
|
+
lines: number;
|
|
44
|
+
error?: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Evidence map task ID (created if Standard or Critical) */
|
|
47
|
+
evidenceMapTaskId: string | null;
|
|
48
|
+
/** Total estimated tokens for this Ground output */
|
|
49
|
+
estimatedTokens: number;
|
|
50
|
+
/** Ceremony recommendations for this tier */
|
|
51
|
+
ceremony: {
|
|
52
|
+
ground: string;
|
|
53
|
+
build: string;
|
|
54
|
+
break: string;
|
|
55
|
+
evidenceMap: string;
|
|
56
|
+
gate: string;
|
|
57
|
+
};
|
|
62
58
|
}
|
|
63
|
-
|
|
59
|
+
declare function forgeGround(embedder: IEmbedder, store: IKnowledgeStore, options: ForgeGroundOptions): Promise<ForgeGroundResult>;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ConstraintRef, ForgeGroundOptions, ForgeGroundResult, forgeGround };
|
|
64
62
|
//# sourceMappingURL=forge-ground.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{estimateTokens as e}from"./text-utils.js";import{evidenceMap as t}from"./evidence-map.js";import{fileSummary as n}from"./file-summary.js";import{forgeClassify as r}from"./forge-classify.js";import{scopeMap as i}from"./scope-map.js";const a={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function o(e,t,n){let r=n.maxConstraints??3,i=await s(n),a=await u(n.files);if(i.tier===`floor`)return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:null,typedUnknownSeeds:i.typedUnknownSeeds,constraints:[],fileSummaries:a,evidenceMapTaskId:null,ceremony:i.ceremony});let[o,d,p]=await Promise.all([c(e,t,n.task,i.tier),l(e,t,n.task,r),f(n.rootPath,n.taskId??v(n.task),i.tier)]);return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:o,typedUnknownSeeds:i.typedUnknownSeeds,constraints:d,fileSummaries:a,evidenceMapTaskId:p,ceremony:i.ceremony})}async function s(e){if(e.forceTier)return{tier:e.forceTier,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(e.forceTier)};try{let t=await r({files:e.files,task:e.task,rootPath:e.rootPath});return{tier:t.tier,classifyTriggers:t.triggers,typedUnknownSeeds:t.typedUnknownSeeds,ceremony:t.ceremony}}catch{return{tier:`standard`,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(`standard`)}}}async function c(e,t,n,r){try{return await i(e,t,{task:n,maxFiles:r===`critical`?20:10})}catch{return null}}async function l(e,t,n,r){try{let i=`decision pattern convention ${n}`,a=typeof e.embedQuery==`function`?await e.embedQuery(i):await e.embed(i);return(await t.search(a,{limit:r,origin:`curated`})).slice(0,r).map(e=>p(e))}catch{return[]}}async function u(e){return Promise.all(e.map(async e=>d(e)))}async function d(e){try{return h(await n({path:e}))}catch(t){return{path:e,exports:[],functions:[],lines:0,error:t instanceof Error?t.message:`Unable to summarize file`}}}async function f(e,n,r){try{return t({action:`create`,taskId:n,tier:r},e),n}catch{return null}}function p(e){return{source:e.record.sourcePath,snippet:m(e.record.content),relevance:e.score}}function m(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=200?t:`${t.slice(0,197).trimEnd()}...`}function h(e){return{path:e.path,exports:e.exports,functions:e.functions.map(e=>e.name),lines:e.lines}}function g(e){return{...a[e]}}function _(t){return{...t,estimatedTokens:e(JSON.stringify(t))}}function v(e){let t=e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(Boolean).slice(0,5).join(`-`),n=Date.now().toString(36);return`${t||`task`}-${n}`}export{o as forgeGround};
|
|
2
|
+
//# sourceMappingURL=forge-ground.js.map
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region packages/tools/src/git-context.d.ts
|
|
2
|
+
interface GitContextOptions {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
commitCount?: number;
|
|
5
|
+
includeDiff?: boolean;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
interface GitContextResult {
|
|
8
|
+
branch: string;
|
|
9
|
+
status: {
|
|
10
|
+
staged: string[];
|
|
11
|
+
modified: string[];
|
|
12
|
+
untracked: string[];
|
|
13
|
+
};
|
|
14
|
+
recentCommits: Array<{
|
|
15
|
+
hash: string;
|
|
16
|
+
message: string;
|
|
17
|
+
author: string;
|
|
18
|
+
date: string;
|
|
19
|
+
}>;
|
|
20
|
+
diff?: string;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
declare function gitContext(options?: GitContextOptions): Promise<GitContextResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { GitContextOptions, GitContextResult, gitContext };
|
|
22
25
|
//# sourceMappingURL=git-context.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import{execFile as
|
|
2
|
-
`).filter(Boolean)){
|
|
3
|
-
`).filter(Boolean).map(
|
|
1
|
+
import{execFile as e}from"node:child_process";import{promisify as t}from"node:util";const n=t(e);async function r(e,t){try{let{stdout:r}=await n(`git`,e,{cwd:t,timeout:15e3});return r.toString().trim()}catch{return``}}async function i(e={}){let t=e.cwd??process.cwd(),n=e.commitCount??5,[i,a,o,s]=await Promise.all([r([`rev-parse`,`--abbrev-ref`,`HEAD`],t),r([`status`,`--porcelain`],t),r([`log`,`--max-count=${n}`,`--format=%h|%s|%an|%ai`],t),e.includeDiff?r([`diff`,`--stat`,`--no-color`],t):Promise.resolve(``)]),c=[],l=[],u=[];for(let e of a.split(`
|
|
2
|
+
`).filter(Boolean)){let t=e[0],n=e[1],r=e.slice(3).trim();t!==` `&&t!==`?`&&c.push(r),(n===`M`||n===`D`)&&l.push(r),t===`?`&&u.push(r)}let d=o.split(`
|
|
3
|
+
`).filter(Boolean).map(e=>{let[t,n,r,i]=e.split(`|`);return{hash:t,message:n,author:r,date:i}});return{branch:i||`unknown`,status:{staged:c,modified:l,untracked:u},recentCommits:d,diff:s||void 0}}export{i as gitContext};
|
|
4
|
+
//# sourceMappingURL=git-context.js.map
|
|
@@ -1,89 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { GraphEdge, GraphNode, GraphStats, GraphTraversalResult, IGraphStore } from "@kb/store";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/graph-query.d.ts
|
|
4
|
+
interface GraphQueryOptions {
|
|
5
|
+
/** Action: query nodes, traverse from a node, get stats, or add data */
|
|
6
|
+
action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'add' | 'delete' | 'clear';
|
|
7
|
+
/** Node type filter (for find_nodes) */
|
|
8
|
+
nodeType?: string;
|
|
9
|
+
/** Name pattern (LIKE %pattern%) for find_nodes */
|
|
10
|
+
namePattern?: string;
|
|
11
|
+
/** Source path filter */
|
|
12
|
+
sourcePath?: string;
|
|
13
|
+
/** Node ID for neighbors/traverse/delete */
|
|
14
|
+
nodeId?: string;
|
|
15
|
+
/** Edge type filter */
|
|
16
|
+
edgeType?: string;
|
|
17
|
+
/** From node ID (for find_edges) */
|
|
18
|
+
fromId?: string;
|
|
19
|
+
/** To node ID (for find_edges) */
|
|
20
|
+
toId?: string;
|
|
21
|
+
/** Traversal direction */
|
|
22
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
23
|
+
/** Max traversal depth (default: 2) */
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
/** Max results (default: 50) */
|
|
26
|
+
limit?: number;
|
|
27
|
+
/** Nodes to add (for action=add) */
|
|
28
|
+
nodes?: Array<{
|
|
29
|
+
id?: string;
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
properties?: Record<string, unknown>;
|
|
33
|
+
sourceRecordId?: string;
|
|
17
34
|
sourcePath?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** Max traversal depth (default: 2) */
|
|
29
|
-
maxDepth?: number;
|
|
30
|
-
/** Max results (default: 50) */
|
|
31
|
-
limit?: number;
|
|
32
|
-
/** Nodes to add (for action=add) */
|
|
33
|
-
nodes?: Array<{
|
|
34
|
-
id?: string;
|
|
35
|
-
type: string;
|
|
36
|
-
name: string;
|
|
37
|
-
properties?: Record<string, unknown>;
|
|
38
|
-
sourceRecordId?: string;
|
|
39
|
-
sourcePath?: string;
|
|
40
|
-
}>;
|
|
41
|
-
/** Edges to add (for action=add) */
|
|
42
|
-
edges?: Array<{
|
|
43
|
-
id?: string;
|
|
44
|
-
fromId: string;
|
|
45
|
-
toId: string;
|
|
46
|
-
type: string;
|
|
47
|
-
weight?: number;
|
|
48
|
-
properties?: Record<string, unknown>;
|
|
49
|
-
}>;
|
|
35
|
+
}>;
|
|
36
|
+
/** Edges to add (for action=add) */
|
|
37
|
+
edges?: Array<{
|
|
38
|
+
id?: string;
|
|
39
|
+
fromId: string;
|
|
40
|
+
toId: string;
|
|
41
|
+
type: string;
|
|
42
|
+
weight?: number;
|
|
43
|
+
properties?: Record<string, unknown>;
|
|
44
|
+
}>;
|
|
50
45
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
interface GraphQueryResult {
|
|
47
|
+
action: string;
|
|
48
|
+
nodes?: GraphNode[];
|
|
49
|
+
edges?: GraphEdge[];
|
|
50
|
+
stats?: GraphStats;
|
|
51
|
+
nodesAdded?: number;
|
|
52
|
+
edgesAdded?: number;
|
|
53
|
+
deleted?: number;
|
|
54
|
+
summary: string;
|
|
60
55
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
|
|
57
|
+
interface GraphAugmentOptions {
|
|
58
|
+
/** Max graph hops from each vector hit (default: 1) */
|
|
59
|
+
hops?: number;
|
|
60
|
+
/** Edge type filter for graph expansion */
|
|
61
|
+
edgeType?: string;
|
|
62
|
+
/** Max graph nodes per vector hit (default: 5) */
|
|
63
|
+
maxPerHit?: number;
|
|
69
64
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
interface GraphAugmentedResult {
|
|
66
|
+
/** Original search result record ID */
|
|
67
|
+
recordId: string;
|
|
68
|
+
/** Original similarity score */
|
|
69
|
+
score: number;
|
|
70
|
+
/** Source path of the matched record */
|
|
71
|
+
sourcePath: string;
|
|
72
|
+
/** Graph nodes connected to this record (via sourceRecordId) */
|
|
73
|
+
graphContext: GraphTraversalResult;
|
|
79
74
|
}
|
|
80
75
|
/**
|
|
81
76
|
* Augment vector search results with graph context.
|
|
82
77
|
* For each search hit, finds linked graph nodes and traverses their connections.
|
|
83
78
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
|
|
80
|
+
recordId: string;
|
|
81
|
+
score: number;
|
|
82
|
+
sourcePath: string;
|
|
88
83
|
}>, options?: GraphAugmentOptions): Promise<GraphAugmentedResult[]>;
|
|
84
|
+
//#endregion
|
|
85
|
+
export { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery };
|
|
89
86
|
//# sourceMappingURL=graph-query.d.ts.map
|