@vpxa/kb 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/package.json +10 -7
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -20
- package/packages/analyzers/dist/blast-radius-analyzer.js +6 -12
- package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -27
- package/packages/analyzers/dist/dependency-analyzer.js +7 -9
- package/packages/analyzers/dist/diagram-generator.d.ts +12 -8
- package/packages/analyzers/dist/diagram-generator.js +3 -4
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -35
- package/packages/analyzers/dist/entry-point-analyzer.js +5 -6
- package/packages/analyzers/dist/index.d.ts +12 -14
- package/packages/analyzers/dist/index.js +1 -1
- package/packages/analyzers/dist/knowledge-producer.d.ts +29 -25
- package/packages/analyzers/dist/knowledge-producer.js +16 -15
- package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -10
- package/packages/analyzers/dist/pattern-analyzer.js +3 -5
- package/packages/analyzers/dist/regex-call-graph.d.ts +6 -12
- package/packages/analyzers/dist/regex-call-graph.js +2 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +13 -9
- package/packages/analyzers/dist/structure-analyzer.js +3 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +12 -8
- package/packages/analyzers/dist/symbol-analyzer.js +8 -13
- package/packages/analyzers/dist/ts-call-graph.d.ts +16 -13
- package/packages/analyzers/dist/ts-call-graph.js +2 -1
- package/packages/analyzers/dist/types.d.ts +82 -79
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +13 -10
- package/packages/chunker/dist/call-graph-extractor.js +2 -1
- package/packages/chunker/dist/chunker-factory.d.ts +6 -2
- package/packages/chunker/dist/chunker-factory.js +2 -1
- package/packages/chunker/dist/chunker.interface.d.ts +8 -4
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +16 -12
- package/packages/chunker/dist/code-chunker.js +12 -14
- package/packages/chunker/dist/generic-chunker.d.ts +14 -10
- package/packages/chunker/dist/generic-chunker.js +6 -5
- package/packages/chunker/dist/index.d.ts +8 -8
- package/packages/chunker/dist/index.js +1 -1
- package/packages/chunker/dist/markdown-chunker.d.ts +16 -12
- package/packages/chunker/dist/markdown-chunker.js +4 -10
- package/packages/chunker/dist/treesitter-chunker.d.ts +28 -31
- package/packages/chunker/dist/treesitter-chunker.js +7 -8
- package/packages/cli/dist/commands/analyze.d.ts +6 -2
- package/packages/cli/dist/commands/analyze.js +3 -3
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -2
- package/packages/cli/dist/commands/context-cmds.js +2 -1
- package/packages/cli/dist/commands/environment.d.ts +6 -2
- package/packages/cli/dist/commands/environment.js +2 -2
- package/packages/cli/dist/commands/execution.d.ts +6 -2
- package/packages/cli/dist/commands/execution.js +2 -1
- package/packages/cli/dist/commands/graph.d.ts +6 -2
- package/packages/cli/dist/commands/graph.js +6 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +27 -0
- package/packages/cli/dist/commands/init/adapters.js +2 -0
- package/packages/cli/dist/commands/init/config.d.ts +11 -0
- package/packages/cli/dist/commands/init/config.js +4 -0
- package/packages/cli/dist/commands/init/curated.d.ts +8 -0
- package/packages/cli/dist/commands/init/curated.js +2 -0
- package/packages/cli/dist/commands/init/index.d.ts +23 -0
- package/packages/cli/dist/commands/init/index.js +3 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +24 -0
- package/packages/cli/dist/commands/init/scaffold.js +2 -0
- package/packages/cli/dist/commands/init/templates.d.ts +10 -0
- package/packages/cli/dist/commands/init/templates.js +302 -0
- package/packages/cli/dist/commands/init.d.ts +8 -3
- package/packages/cli/dist/commands/init.js +120 -123
- package/packages/cli/dist/commands/knowledge.d.ts +6 -2
- package/packages/cli/dist/commands/knowledge.js +2 -1
- package/packages/cli/dist/commands/search.d.ts +6 -2
- package/packages/cli/dist/commands/search.js +2 -8
- package/packages/cli/dist/commands/system.d.ts +6 -2
- package/packages/cli/dist/commands/system.js +5 -7
- package/packages/cli/dist/commands/workspace.d.ts +6 -2
- package/packages/cli/dist/commands/workspace.js +2 -2
- package/packages/cli/dist/context.d.ts +7 -4
- package/packages/cli/dist/context.js +2 -1
- package/packages/cli/dist/helpers.d.ts +51 -47
- package/packages/cli/dist/helpers.js +6 -5
- package/packages/cli/dist/index.d.ts +4 -1
- package/packages/cli/dist/index.js +3 -2
- package/packages/cli/dist/kb-init.d.ts +48 -50
- package/packages/cli/dist/kb-init.js +2 -1
- package/packages/cli/dist/types.d.ts +8 -5
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +36 -33
- package/packages/core/dist/constants.js +2 -1
- package/packages/core/dist/content-detector.d.ts +8 -7
- package/packages/core/dist/content-detector.js +2 -1
- package/packages/core/dist/errors.d.ts +15 -12
- package/packages/core/dist/errors.js +2 -1
- package/packages/core/dist/index.d.ts +6 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/core/dist/logger.d.ts +16 -7
- package/packages/core/dist/logger.js +2 -1
- package/packages/core/dist/types.d.ts +107 -91
- package/packages/core/dist/types.js +2 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +22 -19
- package/packages/embeddings/dist/embedder.interface.js +1 -0
- package/packages/embeddings/dist/index.d.ts +3 -3
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/embeddings/dist/onnx-embedder.d.ts +21 -22
- package/packages/embeddings/dist/onnx-embedder.js +2 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +29 -0
- package/packages/enterprise-bridge/dist/cache.js +2 -0
- package/packages/enterprise-bridge/dist/er-client.d.ts +38 -0
- package/packages/enterprise-bridge/dist/er-client.js +2 -0
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +63 -0
- package/packages/enterprise-bridge/dist/evolution-collector.js +2 -0
- package/packages/enterprise-bridge/dist/index.d.ts +8 -0
- package/packages/enterprise-bridge/dist/index.js +1 -0
- package/packages/enterprise-bridge/dist/policy-store.d.ts +46 -0
- package/packages/enterprise-bridge/dist/policy-store.js +2 -0
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +24 -0
- package/packages/enterprise-bridge/dist/push-adapter.js +2 -0
- package/packages/enterprise-bridge/dist/result-merger.d.ts +15 -0
- package/packages/enterprise-bridge/dist/result-merger.js +2 -0
- package/packages/enterprise-bridge/dist/types.d.ts +82 -0
- package/packages/enterprise-bridge/dist/types.js +2 -0
- package/packages/indexer/dist/file-hasher.d.ts +5 -2
- package/packages/indexer/dist/file-hasher.js +2 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +23 -20
- package/packages/indexer/dist/filesystem-crawler.js +2 -1
- package/packages/indexer/dist/graph-extractor.d.ts +9 -12
- package/packages/indexer/dist/graph-extractor.js +2 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +49 -43
- package/packages/indexer/dist/incremental-indexer.js +2 -1
- package/packages/indexer/dist/index.d.ts +5 -5
- package/packages/indexer/dist/index.js +1 -1
- package/packages/server/dist/api.d.ts +3 -8
- package/packages/server/dist/api.js +1 -1
- package/packages/server/dist/config.d.ts +6 -2
- package/packages/server/dist/config.js +2 -1
- package/packages/server/dist/curated-manager.d.ts +79 -76
- package/packages/server/dist/curated-manager.js +6 -10
- package/packages/server/dist/index.d.ts +1 -2
- package/packages/server/dist/index.js +2 -1
- package/packages/server/dist/replay-interceptor.d.ts +6 -6
- package/packages/server/dist/replay-interceptor.js +2 -1
- package/packages/server/dist/resources/resources.d.ts +7 -3
- package/packages/server/dist/resources/resources.js +3 -2
- package/packages/server/dist/server.d.ts +34 -24
- package/packages/server/dist/server.js +2 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -10
- package/packages/server/dist/tools/analyze.tools.js +2 -3
- package/packages/server/dist/tools/audit.tool.d.ts +8 -4
- package/packages/server/dist/tools/audit.tool.js +2 -4
- package/packages/server/dist/tools/bridge.tools.d.ts +35 -0
- package/packages/server/dist/tools/bridge.tools.js +16 -0
- package/packages/server/dist/tools/evolution.tools.d.ts +8 -0
- package/packages/server/dist/tools/evolution.tools.js +6 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -11
- package/packages/server/dist/tools/forge.tools.js +11 -13
- package/packages/server/dist/tools/forget.tool.d.ts +7 -3
- package/packages/server/dist/tools/forget.tool.js +2 -7
- package/packages/server/dist/tools/graph.tool.d.ts +7 -3
- package/packages/server/dist/tools/graph.tool.js +5 -5
- package/packages/server/dist/tools/list.tool.d.ts +7 -3
- package/packages/server/dist/tools/list.tool.js +3 -8
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -3
- package/packages/server/dist/tools/lookup.tool.js +3 -9
- package/packages/server/dist/tools/onboard.tool.d.ts +8 -4
- package/packages/server/dist/tools/onboard.tool.js +3 -2
- package/packages/server/dist/tools/policy.tools.d.ts +8 -0
- package/packages/server/dist/tools/policy.tools.js +3 -0
- package/packages/server/dist/tools/produce.tool.d.ts +6 -2
- package/packages/server/dist/tools/produce.tool.js +3 -2
- package/packages/server/dist/tools/read.tool.d.ts +7 -3
- package/packages/server/dist/tools/read.tool.js +3 -6
- package/packages/server/dist/tools/reindex.tool.d.ts +10 -6
- package/packages/server/dist/tools/reindex.tool.js +3 -2
- package/packages/server/dist/tools/remember.tool.d.ts +8 -3
- package/packages/server/dist/tools/remember.tool.js +4 -5
- package/packages/server/dist/tools/replay.tool.d.ts +6 -2
- package/packages/server/dist/tools/replay.tool.js +3 -6
- package/packages/server/dist/tools/search.tool.d.ts +10 -4
- package/packages/server/dist/tools/search.tool.js +7 -22
- package/packages/server/dist/tools/status.tool.d.ts +7 -3
- package/packages/server/dist/tools/status.tool.js +3 -3
- package/packages/server/dist/tools/toolkit.tools.d.ts +36 -34
- package/packages/server/dist/tools/toolkit.tools.js +20 -24
- package/packages/server/dist/tools/update.tool.d.ts +7 -3
- package/packages/server/dist/tools/update.tool.js +2 -6
- package/packages/server/dist/tools/utility.tools.d.ts +15 -14
- package/packages/server/dist/tools/utility.tools.js +11 -23
- package/packages/server/dist/version-check.d.ts +5 -1
- package/packages/server/dist/version-check.js +2 -1
- package/packages/store/dist/graph-store.interface.d.ts +89 -86
- package/packages/store/dist/graph-store.interface.js +1 -0
- package/packages/store/dist/index.d.ts +6 -6
- package/packages/store/dist/index.js +1 -1
- package/packages/store/dist/lance-store.d.ts +37 -30
- package/packages/store/dist/lance-store.js +2 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +43 -46
- package/packages/store/dist/sqlite-graph-store.js +14 -13
- package/packages/store/dist/store-factory.d.ts +11 -7
- package/packages/store/dist/store-factory.js +2 -1
- package/packages/store/dist/store.interface.d.ts +47 -46
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +61 -61
- package/packages/tools/dist/audit.js +5 -5
- package/packages/tools/dist/batch.d.ts +20 -17
- package/packages/tools/dist/batch.js +2 -1
- package/packages/tools/dist/changelog.d.ts +29 -26
- package/packages/tools/dist/changelog.js +3 -2
- package/packages/tools/dist/check.d.ts +42 -38
- package/packages/tools/dist/check.js +3 -2
- package/packages/tools/dist/checkpoint.d.ts +17 -14
- package/packages/tools/dist/checkpoint.js +2 -2
- package/packages/tools/dist/codemod.d.ts +35 -32
- package/packages/tools/dist/codemod.js +3 -2
- package/packages/tools/dist/compact.d.ts +34 -37
- package/packages/tools/dist/compact.js +3 -2
- package/packages/tools/dist/data-transform.d.ts +10 -7
- package/packages/tools/dist/data-transform.js +2 -1
- package/packages/tools/dist/dead-symbols.d.ts +29 -25
- package/packages/tools/dist/dead-symbols.js +3 -2
- package/packages/tools/dist/delegate.d.ts +26 -23
- package/packages/tools/dist/delegate.js +2 -5
- package/packages/tools/dist/diff-parse.d.ts +24 -21
- package/packages/tools/dist/diff-parse.js +4 -3
- package/packages/tools/dist/digest.d.ts +43 -45
- package/packages/tools/dist/digest.js +5 -5
- package/packages/tools/dist/encode.d.ts +11 -8
- package/packages/tools/dist/encode.js +2 -1
- package/packages/tools/dist/env-info.d.ts +25 -22
- package/packages/tools/dist/env-info.js +2 -1
- package/packages/tools/dist/eval.d.ts +13 -10
- package/packages/tools/dist/eval.js +3 -3
- package/packages/tools/dist/evidence-map.d.ts +64 -61
- package/packages/tools/dist/evidence-map.js +3 -3
- package/packages/tools/dist/file-cache.d.ts +42 -0
- package/packages/tools/dist/file-cache.js +4 -0
- package/packages/tools/dist/file-summary.d.ts +34 -29
- package/packages/tools/dist/file-summary.js +3 -2
- package/packages/tools/dist/file-walk.d.ts +6 -3
- package/packages/tools/dist/file-walk.js +2 -1
- package/packages/tools/dist/find-examples.d.ts +26 -21
- package/packages/tools/dist/find-examples.js +4 -3
- package/packages/tools/dist/find.d.ts +39 -40
- package/packages/tools/dist/find.js +2 -1
- package/packages/tools/dist/forge-classify.d.ts +35 -38
- package/packages/tools/dist/forge-classify.js +3 -2
- package/packages/tools/dist/forge-ground.d.ts +58 -60
- package/packages/tools/dist/forge-ground.js +2 -1
- package/packages/tools/dist/git-context.d.ts +22 -19
- package/packages/tools/dist/git-context.js +4 -3
- package/packages/tools/dist/graph-query.d.ts +75 -78
- package/packages/tools/dist/graph-query.js +2 -1
- package/packages/tools/dist/guide.d.ts +14 -11
- package/packages/tools/dist/guide.js +2 -1
- package/packages/tools/dist/health.d.ts +13 -10
- package/packages/tools/dist/health.js +3 -2
- package/packages/tools/dist/http-request.d.ts +20 -17
- package/packages/tools/dist/http-request.js +2 -1
- package/packages/tools/dist/index.d.ts +54 -53
- package/packages/tools/dist/index.js +1 -1
- package/packages/tools/dist/lane.d.ts +28 -25
- package/packages/tools/dist/lane.js +7 -7
- package/packages/tools/dist/measure.d.ts +32 -29
- package/packages/tools/dist/measure.js +3 -2
- package/packages/tools/dist/onboard.d.ts +29 -26
- package/packages/tools/dist/onboard.js +18 -41
- package/packages/tools/dist/parse-output.d.ts +48 -45
- package/packages/tools/dist/parse-output.js +3 -2
- package/packages/tools/dist/path-resolver.d.ts +4 -1
- package/packages/tools/dist/path-resolver.js +2 -1
- package/packages/tools/dist/process-manager.d.ts +18 -15
- package/packages/tools/dist/process-manager.js +2 -1
- package/packages/tools/dist/queue.d.ts +28 -25
- package/packages/tools/dist/queue.js +2 -2
- package/packages/tools/dist/regex-test.d.ts +26 -23
- package/packages/tools/dist/regex-test.js +2 -1
- package/packages/tools/dist/rename.d.ts +28 -25
- package/packages/tools/dist/rename.js +3 -2
- package/packages/tools/dist/replay.d.ts +32 -29
- package/packages/tools/dist/replay.js +5 -6
- package/packages/tools/dist/response-envelope.d.ts +32 -29
- package/packages/tools/dist/response-envelope.js +2 -1
- package/packages/tools/dist/schema-validate.d.ts +15 -12
- package/packages/tools/dist/schema-validate.js +2 -1
- package/packages/tools/dist/scope-map.d.ts +45 -47
- package/packages/tools/dist/scope-map.js +2 -1
- package/packages/tools/dist/snippet.d.ts +26 -24
- package/packages/tools/dist/snippet.js +2 -1
- package/packages/tools/dist/stash.d.ts +13 -10
- package/packages/tools/dist/stash.js +2 -2
- package/packages/tools/dist/stratum-card.d.ts +27 -27
- package/packages/tools/dist/stratum-card.js +4 -5
- package/packages/tools/dist/symbol.d.ts +29 -25
- package/packages/tools/dist/symbol.js +4 -3
- package/packages/tools/dist/test-run.d.ts +19 -15
- package/packages/tools/dist/test-run.js +3 -2
- package/packages/tools/dist/text-utils.d.ts +6 -3
- package/packages/tools/dist/text-utils.js +3 -2
- package/packages/tools/dist/time-utils.d.ts +15 -12
- package/packages/tools/dist/time-utils.js +2 -1
- package/packages/tools/dist/trace.d.ts +24 -20
- package/packages/tools/dist/trace.js +3 -2
- package/packages/tools/dist/truncation.d.ts +6 -3
- package/packages/tools/dist/truncation.js +8 -14
- package/packages/tools/dist/watch.d.ts +28 -25
- package/packages/tools/dist/watch.js +2 -1
- package/packages/tools/dist/web-fetch.d.ts +35 -32
- package/packages/tools/dist/web-fetch.js +7 -12
- package/packages/tools/dist/web-search.d.ts +16 -13
- package/packages/tools/dist/web-search.js +2 -1
- package/packages/tools/dist/workset.d.ts +19 -16
- package/packages/tools/dist/workset.js +2 -2
- package/packages/tui/dist/App-BAlmxCCw.js +3 -0
- package/packages/tui/dist/App.d.ts +11 -5
- package/packages/tui/dist/App.js +1 -450
- package/packages/tui/dist/CuratedPanel-sYdZAICX.js +3 -0
- package/packages/tui/dist/LogPanel-DVB8Sv46.js +4 -0
- package/packages/tui/dist/SearchPanel-DREo6zgt.js +3 -0
- package/packages/tui/dist/StatusPanel-2ex8fLOO.js +3 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DUyj952l.js +8 -0
- package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +29 -0
- package/packages/tui/dist/index-B9VpfVPP.d.ts +14 -0
- package/packages/tui/dist/index.d.ts +3 -19
- package/packages/tui/dist/index.js +2 -476
- package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +317 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -5
- package/packages/tui/dist/panels/CuratedPanel.js +1 -371
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -2
- package/packages/tui/dist/panels/LogPanel.js +1 -449
- package/packages/tui/dist/panels/SearchPanel.d.ts +14 -7
- package/packages/tui/dist/panels/SearchPanel.js +1 -372
- package/packages/tui/dist/panels/StatusPanel.d.ts +11 -5
- package/packages/tui/dist/panels/StatusPanel.js +1 -371
- package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +151 -0
- package/scaffold/adapters/claude-code.mjs +20 -0
- package/scaffold/adapters/copilot.mjs +320 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +14 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +14 -0
- package/scaffold/copilot/agents/Code-Reviewer-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Code-Reviewer-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Debugger.agent.md +31 -0
- package/scaffold/copilot/agents/Documenter.agent.md +35 -0
- package/scaffold/copilot/agents/Explorer.agent.md +50 -0
- package/scaffold/copilot/agents/Frontend.agent.md +29 -0
- package/scaffold/copilot/agents/Implementer.agent.md +31 -0
- package/scaffold/copilot/agents/Orchestrator.agent.md +96 -0
- package/scaffold/copilot/agents/Planner.agent.md +45 -0
- package/scaffold/copilot/agents/README.md +57 -0
- package/scaffold/copilot/agents/Refactor.agent.md +30 -0
- package/scaffold/copilot/agents/Researcher-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Delta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Gamma.agent.md +12 -0
- package/scaffold/copilot/agents/Security.agent.md +42 -0
- package/scaffold/copilot/agents/_shared/adr-protocol.md +91 -0
- package/scaffold/copilot/agents/_shared/architect-reviewer-base.md +50 -0
- package/scaffold/copilot/agents/_shared/code-agent-base.md +70 -0
- package/scaffold/copilot/agents/_shared/code-reviewer-base.md +54 -0
- package/scaffold/copilot/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/copilot/agents/_shared/forge-protocol.md +46 -0
- package/scaffold/copilot/agents/_shared/researcher-base.md +61 -0
- package/scaffold/copilot/agents/templates/adr-template.md +27 -0
- package/scaffold/copilot/agents/templates/execution-state.md +25 -0
- package/scaffold/copilot/prompts/ask.prompt.md +20 -0
- package/scaffold/copilot/prompts/debug.prompt.md +25 -0
- package/scaffold/copilot/prompts/design.prompt.md +22 -0
- package/scaffold/copilot/prompts/implement.prompt.md +26 -0
- package/scaffold/copilot/prompts/plan.prompt.md +24 -0
- package/scaffold/copilot/prompts/review.prompt.md +31 -0
- package/scaffold/definitions/agents.mjs +165 -0
- package/scaffold/definitions/bodies.mjs +292 -0
- package/scaffold/definitions/hooks.mjs +43 -0
- package/scaffold/definitions/models.mjs +56 -0
- package/scaffold/definitions/plugins.mjs +24 -0
- package/scaffold/definitions/prompts.mjs +145 -0
- package/scaffold/definitions/protocols.mjs +322 -0
- package/scaffold/definitions/tools.mjs +176 -0
- package/scaffold/generate.mjs +74 -0
- package/skills/brainstorming/SKILL.md +259 -0
- package/skills/brainstorming/scripts/frame-template.html +365 -0
- package/skills/brainstorming/scripts/helper.js +216 -0
- package/skills/brainstorming/scripts/server.cjs +9 -0
- package/skills/brainstorming/scripts/server.src.cjs +249 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +430 -0
- package/skills/knowledge-base/SKILL.md +22 -9
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ParsedError } from "./parse-output.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/tools/src/check.d.ts
|
|
4
|
+
interface CheckOptions {
|
|
5
|
+
/** Specific files to check (if empty, checks all) */
|
|
6
|
+
files?: string[];
|
|
7
|
+
/** Working directory */
|
|
8
|
+
cwd?: string;
|
|
9
|
+
/** Skip typecheck */
|
|
10
|
+
skipTypes?: boolean;
|
|
11
|
+
/** Skip lint */
|
|
12
|
+
skipLint?: boolean;
|
|
13
|
+
/** Detail level: summary (default, minimal), errors (parsed errors), full (includes raw) */
|
|
14
|
+
detail?: 'summary' | 'errors' | 'full';
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
interface CheckSummaryResult {
|
|
17
|
+
passed: boolean;
|
|
18
|
+
tsc: {
|
|
15
19
|
passed: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
topErrors: string[];
|
|
27
|
-
};
|
|
20
|
+
errorCount: number;
|
|
21
|
+
warningCount: number;
|
|
22
|
+
topErrors: string[];
|
|
23
|
+
};
|
|
24
|
+
biome: {
|
|
25
|
+
passed: boolean;
|
|
26
|
+
errorCount: number;
|
|
27
|
+
warningCount: number;
|
|
28
|
+
topErrors: string[];
|
|
29
|
+
};
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
passed: boolean;
|
|
38
|
-
raw?: string;
|
|
39
|
-
};
|
|
31
|
+
interface CheckResult {
|
|
32
|
+
tsc: {
|
|
33
|
+
errors: ParsedError[];
|
|
34
|
+
passed: boolean;
|
|
35
|
+
raw?: string;
|
|
36
|
+
};
|
|
37
|
+
biome: {
|
|
38
|
+
errors: ParsedError[];
|
|
40
39
|
passed: boolean;
|
|
40
|
+
raw?: string;
|
|
41
|
+
};
|
|
42
|
+
passed: boolean;
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
declare function check(options?: CheckOptions): Promise<CheckResult>;
|
|
43
45
|
/** Produce a minimal summary for LLM consumption (~300 tokens) */
|
|
44
|
-
|
|
46
|
+
declare function summarizeCheckResult(result: CheckResult): CheckSummaryResult;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { CheckOptions, CheckResult, CheckSummaryResult, check, summarizeCheckResult };
|
|
45
49
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{execFile as
|
|
2
|
-
`).trim()||
|
|
1
|
+
import{parseBiome as e,parseTsc as t}from"./parse-output.js";import{execFile as n}from"node:child_process";import{readFile as r}from"node:fs/promises";import{join as i}from"node:path";import{promisify as a}from"node:util";const o=a(n);let s=0;function c(e){let t=e;return[t.stdout?.toString()??``,t.stderr?.toString()??``].filter(Boolean).join(`
|
|
2
|
+
`).trim()||t.message||`Command failed`}async function l(e={}){if(s>=2)throw Error(`Too many concurrent check runs (max 2). Try again later.`);s++;try{return await u(e)}finally{s--}}async function u(n){let a=n.cwd??process.cwd(),s={errors:[],passed:!0,raw:``},l={errors:[],passed:!0,raw:``};if(!n.skipTypes)try{let e=i(a,`package.json`),t=!1;try{t=!!JSON.parse(await r(e,`utf-8`)).scripts?.typecheck}catch{}if(t&&!n.files?.length)await o(`npx`,[`turbo`,`run`,`typecheck`],{cwd:a,shell:!0,timeout:12e4});else{let e=[`--noEmit`];n.files?.length&&e.push(...n.files),await o(`npx`,[`tsc`,...e],{cwd:a,shell:!0,timeout:12e4})}}catch(e){s.raw=c(e),s.errors=t(s.raw),s.passed=s.errors.length===0}if(!n.skipLint)try{let e=[`check`];n.files?.length&&e.push(...n.files),await o(`npx`,[`biome`,...e],{cwd:a,shell:!0,timeout:12e4})}catch(t){l.raw=c(t),l.errors=e(l.raw),l.passed=l.errors.length===0}let u=n.detail??`full`,d={tsc:s,biome:l,passed:s.passed&&l.passed};return u===`full`?d:u===`errors`?{tsc:{errors:s.errors,passed:s.passed},biome:{errors:l.errors,passed:l.passed},passed:d.passed}:d}function d(e){let t=e.tsc.errors.filter(e=>e.severity===`error`),n=e.tsc.errors.filter(e=>e.severity===`warning`),r=e.biome.errors.filter(e=>e.severity===`error`),i=e.biome.errors.filter(e=>e.severity===`warning`);return{passed:e.passed,tsc:{passed:e.tsc.passed,errorCount:t.length,warningCount:n.length,topErrors:t.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)},biome:{passed:e.biome.passed,errorCount:r.length,warningCount:i.length,topErrors:r.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)}}}export{l as check,d as summarizeCheckResult};
|
|
3
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region packages/tools/src/checkpoint.d.ts
|
|
2
|
+
interface Checkpoint {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
files?: string[];
|
|
8
|
+
notes?: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare function checkpointSave(label: string, data: Record<string, unknown>, options?: {
|
|
11
|
+
files?: string[];
|
|
12
|
+
notes?: string;
|
|
13
|
+
cwd?: string;
|
|
13
14
|
}): Checkpoint;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
declare function checkpointLoad(id: string, cwd?: string): Checkpoint | undefined;
|
|
16
|
+
declare function checkpointList(cwd?: string): Checkpoint[];
|
|
17
|
+
declare function checkpointLatest(cwd?: string): Checkpoint | undefined;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave };
|
|
17
20
|
//# sourceMappingURL=checkpoint.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
|
|
1
|
+
import{resolve as e}from"node:path";import{existsSync as t,mkdirSync as n,readFileSync as r,readdirSync as i,writeFileSync as a}from"node:fs";function o(r){let i=e(r??process.cwd(),`.kb-state/checkpoints`);return t(i)||n(i,{recursive:!0}),i}function s(t,n,r){let i=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`checkpoint`,s={id:`${Date.now()}-${i}`,label:t,createdAt:new Date().toISOString(),data:n,files:r?.files,notes:r?.notes};return a(e(o(r?.cwd),`${s.id}.json`),`${JSON.stringify(s,null,2)}\n`,`utf-8`),s}function c(n,i){let a=e(o(i),`${n}.json`);if(t(a))try{return JSON.parse(r(a,`utf-8`))}catch{return}}function l(t){let n=o(t);return i(n).filter(e=>e.endsWith(`.json`)).flatMap(t=>{try{return[JSON.parse(r(e(n,t),`utf-8`))]}catch{return[]}}).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function u(e){return l(e)[0]}export{u as checkpointLatest,l as checkpointList,c as checkpointLoad,s as checkpointSave};
|
|
2
|
+
//# sourceMappingURL=checkpoint.js.map
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region packages/tools/src/codemod.d.ts
|
|
2
|
+
interface CodemodRule {
|
|
3
|
+
/** Description of what this rule does */
|
|
4
|
+
description: string;
|
|
5
|
+
/** Regex pattern to match (string form, will be compiled) */
|
|
6
|
+
pattern: string;
|
|
7
|
+
/** Replacement string (supports $1, $2 capture groups) */
|
|
8
|
+
replacement: string;
|
|
9
|
+
/** Optional: only apply to files matching this glob */
|
|
10
|
+
fileFilter?: string;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
interface CodemodOptions {
|
|
13
|
+
/** Root directory to apply codemod in */
|
|
14
|
+
rootPath: string;
|
|
15
|
+
/** Rules to apply */
|
|
16
|
+
rules: CodemodRule[];
|
|
17
|
+
/** File extensions to process */
|
|
18
|
+
extensions?: string[];
|
|
19
|
+
/** Exclude patterns */
|
|
20
|
+
exclude?: string[];
|
|
21
|
+
/** Dry run */
|
|
22
|
+
dryRun?: boolean;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
interface CodemodChange {
|
|
25
|
+
rule: string;
|
|
26
|
+
path: string;
|
|
27
|
+
line: number;
|
|
28
|
+
before: string;
|
|
29
|
+
after: string;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
interface CodemodResult {
|
|
32
|
+
changes: CodemodChange[];
|
|
33
|
+
rulesApplied: number;
|
|
34
|
+
filesModified: number;
|
|
35
|
+
dryRun: boolean;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
declare function codemod(options: CodemodOptions): Promise<CodemodResult>;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { CodemodChange, CodemodOptions, CodemodResult, CodemodRule, codemod };
|
|
37
40
|
//# sourceMappingURL=codemod.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)
|
|
1
|
+
import{DEFAULT_TOOL_EXTENSIONS as e,matchesGlobPattern as t,walkFiles as n}from"./file-walk.js";import{readFile as r,writeFile as i}from"node:fs/promises";import{relative as a}from"node:path";function o(e){return e.replace(/\\/g,`/`)}async function s(s){let{rootPath:c,rules:l,extensions:u=e,exclude:d=[],dryRun:f=!1}=s,p=l.map(e=>({...e,regex:new RegExp(e.pattern,`g`)})),m=await n(c,u,d),h=[],g=new Set,_=0;for(let e of m){let n=o(a(c,e)),s=(await r(e,`utf-8`)).split(/\r?\n/),l=!1;for(let[e,r]of p.entries())if(!(r.fileFilter&&!t(n,r.fileFilter)))for(let t=0;t<s.length;t++){let i=s[t];r.regex.lastIndex=0;let a=i.replace(r.regex,r.replacement);i!==a&&(s[t]=a,l=!0,g.add(e),h.push({rule:r.description,path:n,line:t+1,before:i,after:a}))}l&&(_+=1,f||await i(e,s.join(`
|
|
2
|
+
`),`utf-8`))}return{changes:h,rulesApplied:g.size,filesModified:_,dryRun:f}}export{s as codemod};
|
|
3
|
+
//# sourceMappingURL=codemod.js.map
|
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
maxChars?: number;
|
|
21
|
-
/** Minimum similarity score to include a segment (0-1, default: 0.3) */
|
|
22
|
-
minScore?: number;
|
|
23
|
-
/** Segmentation strategy (default: 'paragraph') */
|
|
24
|
-
segmentation?: 'paragraph' | 'sentence' | 'line';
|
|
1
|
+
import { FileCache } from "./file-cache.js";
|
|
2
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
3
|
+
|
|
4
|
+
//#region packages/tools/src/compact.d.ts
|
|
5
|
+
interface CompactOptions {
|
|
6
|
+
/** The text to compress (at least one of text/path required) */
|
|
7
|
+
text?: string;
|
|
8
|
+
/** File path to read server-side — avoids read_file round-trip (at least one of text/path required) */
|
|
9
|
+
path?: string;
|
|
10
|
+
/** The focus query — what are we trying to understand? */
|
|
11
|
+
query: string;
|
|
12
|
+
/** Target output size in characters (default: 3000) */
|
|
13
|
+
maxChars?: number;
|
|
14
|
+
/** Minimum similarity score to include a segment (0-1, default: 0.3) */
|
|
15
|
+
minScore?: number;
|
|
16
|
+
/** Segmentation strategy (default: 'paragraph') */
|
|
17
|
+
segmentation?: 'paragraph' | 'sentence' | 'line';
|
|
18
|
+
/** Optional file cache — use cached content instead of raw readFile */
|
|
19
|
+
cache?: FileCache;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
interface CompactResult {
|
|
22
|
+
/** The compressed text */
|
|
23
|
+
text: string;
|
|
24
|
+
/** Original size in chars */
|
|
25
|
+
originalChars: number;
|
|
26
|
+
/** Compressed size in chars */
|
|
27
|
+
compressedChars: number;
|
|
28
|
+
/** Compression ratio (0-1, lower = more compressed) */
|
|
29
|
+
ratio: number;
|
|
30
|
+
/** Number of segments kept / total */
|
|
31
|
+
segmentsKept: number;
|
|
32
|
+
segmentsTotal: number;
|
|
38
33
|
}
|
|
39
34
|
/**
|
|
40
35
|
* Compress text by extracting segments most relevant to a query.
|
|
41
36
|
*/
|
|
42
|
-
|
|
37
|
+
declare function compact(embedder: IEmbedder, options: CompactOptions): Promise<CompactResult>;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { CompactOptions, CompactResult, compact };
|
|
43
40
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cosineSimilarity as e,segment as t}from"./text-utils.js";import{readFile as n}from"node:fs/promises";async function r(r,i){let{query:a,maxChars:o=3e3,minScore:s=.3,segmentation:c=`paragraph`}=i,l;if(i.text)l=i.text;else if(i.path)l=i.cache?(await i.cache.get(i.path)).content:await n(i.path,`utf-8`);else throw Error(`Either "text" or "path" must be provided`);if(l.length<=o)return{text:l,originalChars:l.length,compressedChars:l.length,ratio:1,segmentsKept:1,segmentsTotal:1};let u=t(l,c);if(u.length===0)return{text:``,originalChars:l.length,compressedChars:0,ratio:0,segmentsKept:0,segmentsTotal:0};let d=await r.embed(a),f=[];for(let t=0;t<u.length;t++){let n=e(d,await r.embed(u[t]));f.push({text:u[t],score:n,index:t})}let p=f.filter(e=>e.score>=s).sort((e,t)=>t.score-e.score),m=[],h=0;for(let e of p){if(h+e.text.length>o){h===0&&(m.push({...e,text:e.text.slice(0,o)}),h=o);break}m.push(e),h+=e.text.length+2}m.sort((e,t)=>e.index-t.index);let g=m.map(e=>e.text).join(`
|
|
2
2
|
|
|
3
|
-
`);return{text:
|
|
3
|
+
`);return{text:g,originalChars:l.length,compressedChars:g.length,ratio:g.length/l.length,segmentsKept:m.length,segmentsTotal:u.length}}export{r as compact};
|
|
4
|
+
//# sourceMappingURL=compact.js.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region packages/tools/src/data-transform.d.ts
|
|
2
|
+
interface TransformOptions {
|
|
3
|
+
input: unknown;
|
|
4
|
+
expression: string;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
interface TransformResult {
|
|
7
|
+
output: unknown;
|
|
8
|
+
outputString: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
declare function dataTransform(options: TransformOptions): TransformResult;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TransformOptions, TransformResult, dataTransform };
|
|
10
13
|
//# sourceMappingURL=data-transform.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){let{input:o,expression:s}=e,c;if(typeof o==`string`)try{c=JSON.parse(o)}catch{throw Error(`Invalid JSON input`)}else c=o;let l;if(s===`.`)l=c;else if(s===`keys`)l=Object.keys(a(c));else if(s===`values`)l=Object.values(a(c));else if(s===`length`)l=Array.isArray(c)?c.length:Object.keys(a(c)).length;else if(s===`flatten`)l=i(c).flat();else if(s===`unique`)l=[...new Set(i(c))];else if(s===`sort`)l=[...i(c)].sort();else if(s===`reverse`)l=[...i(c)].reverse();else if(s.startsWith(`.`))l=r(c,s.slice(1));else if(s.startsWith(`map(`)&&s.endsWith(`)`)){let e=s.slice(4,-1).trim(),t=e.startsWith(`.`)?e.slice(1):e;l=i(c).map(e=>r(e,t))}else if(s.startsWith(`select(`)&&s.endsWith(`)`))l=t(i(c),s.slice(7,-1).trim());else if(s.startsWith(`group_by(`)&&s.endsWith(`)`)){let e=s.slice(9,-1).trim().replace(/^\./,``),t={};for(let n of i(c)){let i=String(r(n,e)??`null`);t[i]||(t[i]=[]),t[i].push(n)}l=t}else if(s.startsWith(`pick(`)&&s.endsWith(`)`)){let e=s.slice(5,-1).split(`,`).map(e=>e.trim().replace(/^\./,``)).filter(Boolean);l=Array.isArray(c)?i(c).map(t=>n(t,e)):n(c,e)}else throw Error(`Unsupported expression: ${s}. Supported: ., .path.to.field, keys, values, length, flatten, unique, sort, reverse, map(.field), select(.field == | != | > | < | >= | <= "value"), group_by(.field), pick(.a, .b)`);return{output:l,outputString:typeof l==`string`?l:JSON.stringify(l,null,2)??`null`}}function t(e,t){let n=t.match(/^\.?([\w.[\]]+)\s*(==|!=|>=|<=|>|<)\s*"?([^"]*)"?$/);if(!n)throw Error(`Unsupported select expression: ${t}`);let[,i,a,o]=n;return e.filter(e=>{let t=r(e,i),n=String(t);switch(a){case`==`:return n===o;case`!=`:return n!==o;case`>`:case`<`:case`>=`:case`<=`:{let e=Number(t),n=Number(o);return Number.isNaN(e)||Number.isNaN(n)?!1:a===`>`?e>n:a===`<`?e<n:a===`>=`?e>=n:e<=n}default:return!1}})}function n(e,t){let n={};for(let i of t)n[i]=r(e,i);return n}function r(e,t){if(!t)return e;let n=[...t.matchAll(/([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number.parseInt(e[2],10)),r=e;for(let e of n){if(r==null)return;if(typeof e==`number`){if(!Array.isArray(r))return;r=r[e];continue}if(typeof r!=`object`)return;r=r[e]}return r}function i(e){if(!Array.isArray(e))throw Error(`Operation requires an array input.`);return e}function a(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Operation requires an object input.`);return e}export{e as dataTransform};
|
|
2
|
+
//# sourceMappingURL=data-transform.js.map
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { IEmbedder } from "@kb/embeddings";
|
|
2
|
+
import { IKnowledgeStore } from "@kb/store";
|
|
3
|
+
|
|
4
|
+
//#region packages/tools/src/dead-symbols.d.ts
|
|
5
|
+
interface DeadSymbolOptions {
|
|
6
|
+
/** Root path to scope the search */
|
|
7
|
+
rootPath?: string;
|
|
8
|
+
/** Max symbols to scan (default: 100) */
|
|
9
|
+
limit?: number;
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
interface DeadSymbol {
|
|
12
|
+
name: string;
|
|
13
|
+
path: string;
|
|
14
|
+
line: number;
|
|
15
|
+
kind: string;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
interface DeadSymbolResult {
|
|
18
|
+
/** Dead symbols in source files (.ts/.js/.tsx/.jsx) — actionable */
|
|
19
|
+
deadInSource: DeadSymbol[];
|
|
20
|
+
/** Dead symbols in documentation files (.md) — informational */
|
|
21
|
+
deadInDocs: DeadSymbol[];
|
|
22
|
+
totalExports: number;
|
|
23
|
+
totalDeadSource: number;
|
|
24
|
+
totalDeadDocs: number;
|
|
25
|
+
/** @deprecated Use deadInSource instead */
|
|
26
|
+
deadSymbols: DeadSymbol[];
|
|
27
|
+
/** @deprecated Use totalDeadSource + totalDeadDocs instead */
|
|
28
|
+
totalDead: number;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
declare function findDeadSymbols(embedder: IEmbedder, store: IKnowledgeStore, options?: DeadSymbolOptions): Promise<DeadSymbolResult>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DeadSymbol, DeadSymbolOptions, DeadSymbolResult, findDeadSymbols };
|
|
29
33
|
//# sourceMappingURL=dead-symbols.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{extname as
|
|
2
|
-
`).length-1,
|
|
1
|
+
import{extname as e}from"node:path";const t=new Set([`.md`,`.mdx`]);async function n(n,a,o={}){let{rootPath:s,limit:c=100}=o,l=await n.embed(`export function class const type interface enum`),u=await a.search(l,{limit:c*3}),d=/^export\s+(?:async\s+)?(?:function|class|const|let|interface|type|enum)\s+(\w+)/gm,f=[];for(let e of u){if(!i(e.record.sourcePath,s))continue;let t=e.record.content;d.lastIndex=0;for(let n of t.matchAll(d)){let r=n.index??0,i=t.slice(0,r).split(`
|
|
2
|
+
`).length-1,a=t.slice(r).match(/export\s+(?:async\s+)?(\w+)/);f.push({name:n[1],path:e.record.sourcePath,line:e.record.startLine+i,kind:a?.[1]??`unknown`})}}let p=new Map;for(let e of f){let t=`${e.path}:${e.name}`;p.has(t)||p.set(t,e)}let m=[];for(let e of p.values()){let t=r(e.name),n=RegExp(`import\\s+.*\\b${t}\\b.*from`,`m`),i=RegExp(`export\\s+\\{[^}]*\\b${t}\\b`,`m`),o=await a.ftsSearch(`import ${e.name}`,{limit:10}),s=o.some(t=>t.record.sourcePath!==e.path&&n.test(t.record.content)),c=o.some(t=>t.record.sourcePath!==e.path&&i.test(t.record.content));!s&&!c&&m.push(e)}let h=(e,t)=>e.path===t.path?e.line-t.line:e.path.localeCompare(t.path),g=[],_=[];for(let n of m){let r=e(n.path).toLowerCase();t.has(r)?_.push(n):g.push(n)}return g.sort(h),_.sort(h),{deadInSource:g,deadInDocs:_,totalExports:p.size,totalDeadSource:g.length,totalDeadDocs:_.length,deadSymbols:[...g,..._],totalDead:g.length+_.length}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function i(e,t){if(!t)return!0;let n=a(t).replace(/\/+$/,``),r=a(e);return r===n||r.startsWith(`${n}/`)}function a(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``)}export{n as findDeadSymbols};
|
|
3
|
+
//# sourceMappingURL=dead-symbols.js.map
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
//#region packages/tools/src/delegate.d.ts
|
|
2
|
+
interface DelegateOptions {
|
|
3
|
+
/** The prompt / task to send to the local model. */
|
|
4
|
+
prompt: string;
|
|
5
|
+
/** Model to use (default: the first available model). */
|
|
6
|
+
model?: string;
|
|
7
|
+
/** Optional system prompt. */
|
|
8
|
+
system?: string;
|
|
9
|
+
/** Optional context to include before the prompt. */
|
|
10
|
+
context?: string;
|
|
11
|
+
/** Temperature (0-2, default: 0.3 for deterministic-ish output). */
|
|
12
|
+
temperature?: number;
|
|
13
|
+
/** Timeout in milliseconds (default: 120_000). */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
/** Ollama base URL (default: http://localhost:11434). */
|
|
16
|
+
baseUrl?: string;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
interface DelegateResult {
|
|
19
|
+
model: string;
|
|
20
|
+
response: string;
|
|
21
|
+
durationMs: number;
|
|
22
|
+
tokenCount?: number;
|
|
23
|
+
error?: string;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Check if Ollama is running and return available models.
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
declare function delegateListModels(baseUrl?: string): Promise<string[]>;
|
|
28
29
|
/**
|
|
29
30
|
* Delegate a task to a local Ollama model.
|
|
30
31
|
*
|
|
31
32
|
* Fails fast if Ollama is not running or no models are available.
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
+
declare function delegate(options: DelegateOptions): Promise<DelegateResult>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { DelegateOptions, DelegateResult, delegate, delegateListModels };
|
|
34
37
|
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import{request as
|
|
2
|
-
|
|
3
|
-
</context>
|
|
4
|
-
|
|
5
|
-
`),s+=e.prompt;const n=Date.now(),u=JSON.stringify({model:t,prompt:s,system:e.system,stream:!1,options:{temperature:e.temperature??.3}});try{const i=await f(`${o}/api/generate`,u,a),m=JSON.parse(i);return m.error?{model:t,response:"",durationMs:Date.now()-n,error:m.error}:{model:t,response:(m.response??"").trim(),durationMs:Date.now()-n,tokenCount:m.eval_count}}catch(i){return{model:t,response:"",durationMs:Date.now()-n,error:i instanceof Error?i.message:String(i)}}}function g(e){return new Promise((o,a)=>{const r=new URL(e),t=l({hostname:r.hostname,port:r.port,path:r.pathname,method:"GET",timeout:5e3},s=>{const n=[];s.on("data",u=>n.push(u)),s.on("end",()=>o(Buffer.concat(n).toString("utf-8")))});t.on("error",a),t.on("timeout",()=>{t.destroy(),a(new Error("Connection timeout"))}),t.end()})}function f(e,o,a){return new Promise((r,t)=>{const s=new URL(e),n=l({hostname:s.hostname,port:s.port,path:s.pathname,method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(o)},timeout:a},u=>{const i=[];u.on("data",m=>i.push(m)),u.on("end",()=>r(Buffer.concat(i).toString("utf-8")))});n.on("error",t),n.on("timeout",()=>{n.destroy(),t(new Error(`Ollama request timed out after ${a}ms`))}),n.write(o),n.end()})}export{w as delegate,d as delegateListModels};
|
|
1
|
+
import{request as e}from"node:http";const t=`http://localhost:11434`;async function n(e=t){let n=await i(`${e}/api/tags`),r;try{r=JSON.parse(n)}catch{throw Error(`Ollama returned invalid JSON`)}return(r.models??[]).map(e=>e.name)}async function r(e){let r=e.baseUrl??t,i=e.timeout??12e4,o;try{o=await n(r)}catch{return{model:e.model??`unknown`,response:``,durationMs:0,error:`Ollama is not running at ${r}. Start it with: ollama serve`}}if(o.length===0)return{model:`none`,response:``,durationMs:0,error:`No Ollama models available. Pull one with: ollama pull qwen2.5-coder:7b`};let s=e.model??o[0];if(!o.includes(s))return{model:s,response:``,durationMs:0,error:`Model "${s}" not found. Available: ${o.join(`, `)}`};let c=``;e.context&&(c+=`<context>\n${e.context}\n</context>\n\n`),c+=e.prompt;let l=Date.now(),u=JSON.stringify({model:s,prompt:c,system:e.system,stream:!1,options:{temperature:e.temperature??.3}});try{let e=await a(`${r}/api/generate`,u,i),t=JSON.parse(e);return t.error?{model:s,response:``,durationMs:Date.now()-l,error:t.error}:{model:s,response:(t.response??``).trim(),durationMs:Date.now()-l,tokenCount:t.eval_count}}catch(e){return{model:s,response:``,durationMs:Date.now()-l,error:e instanceof Error?e.message:String(e)}}}function i(t){return new Promise((n,r)=>{let i=new URL(t),a=e({hostname:i.hostname,port:i.port,path:i.pathname,method:`GET`,timeout:5e3},e=>{let t=[];e.on(`data`,e=>t.push(e)),e.on(`end`,()=>n(Buffer.concat(t).toString(`utf-8`)))});a.on(`error`,r),a.on(`timeout`,()=>{a.destroy(),r(Error(`Connection timeout`))}),a.end()})}function a(t,n,r){return new Promise((i,a)=>{let o=new URL(t),s=e({hostname:o.hostname,port:o.port,path:o.pathname,method:`POST`,headers:{"Content-Type":`application/json`,"Content-Length":Buffer.byteLength(n)},timeout:r},e=>{let t=[];e.on(`data`,e=>t.push(e)),e.on(`end`,()=>i(Buffer.concat(t).toString(`utf-8`)))});s.on(`error`,a),s.on(`timeout`,()=>{s.destroy(),a(Error(`Ollama request timed out after ${r}ms`))}),s.write(n),s.end()})}export{r as delegate,n as delegateListModels};
|
|
2
|
+
//# sourceMappingURL=delegate.js.map
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region packages/tools/src/diff-parse.d.ts
|
|
2
|
+
interface DiffFile {
|
|
3
|
+
path: string;
|
|
4
|
+
oldPath?: string;
|
|
5
|
+
status: 'added' | 'modified' | 'deleted' | 'renamed';
|
|
6
|
+
hunks: DiffHunk[];
|
|
7
|
+
additions: number;
|
|
8
|
+
deletions: number;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
interface DiffHunk {
|
|
11
|
+
oldStart: number;
|
|
12
|
+
oldLines: number;
|
|
13
|
+
newStart: number;
|
|
14
|
+
newLines: number;
|
|
15
|
+
header: string;
|
|
16
|
+
changes: DiffChange[];
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
interface DiffChange {
|
|
19
|
+
type: 'add' | 'delete' | 'context';
|
|
20
|
+
line: number;
|
|
21
|
+
content: string;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
interface DiffParseOptions {
|
|
24
|
+
diff: string;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
declare function diffParse(options: DiffParseOptions): DiffFile[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DiffChange, DiffFile, DiffHunk, DiffParseOptions, diffParse };
|
|
26
29
|
//# sourceMappingURL=diff-parse.d.ts.map
|