@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,80 +1,83 @@
|
|
|
1
|
+
//#region packages/tools/src/parse-output.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* kb_parse_output — Structured parsers for common build tool output.
|
|
3
4
|
*
|
|
4
5
|
* Converts noisy text output from tsc, vitest, biome, and git status
|
|
5
6
|
* into structured JSON that LLM agents can act on directly.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
interface ParsedError {
|
|
9
|
+
file: string;
|
|
10
|
+
line?: number;
|
|
11
|
+
column?: number;
|
|
12
|
+
severity: 'error' | 'warning' | 'info';
|
|
13
|
+
code?: string;
|
|
14
|
+
message: string;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
interface ParsedTestResult {
|
|
17
|
+
name: string;
|
|
18
|
+
file?: string;
|
|
19
|
+
status: 'pass' | 'fail' | 'skip';
|
|
20
|
+
duration?: number;
|
|
21
|
+
error?: string;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
interface ParsedTestSummary {
|
|
24
|
+
tests: ParsedTestResult[];
|
|
25
|
+
passed: number;
|
|
26
|
+
failed: number;
|
|
27
|
+
skipped: number;
|
|
28
|
+
duration?: number;
|
|
29
|
+
suites?: number;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
interface ParsedGitStatus {
|
|
32
|
+
staged: Array<{
|
|
33
|
+
status: string;
|
|
34
|
+
file: string;
|
|
35
|
+
}>;
|
|
36
|
+
unstaged: Array<{
|
|
37
|
+
status: string;
|
|
38
|
+
file: string;
|
|
39
|
+
}>;
|
|
40
|
+
untracked: string[];
|
|
41
|
+
branch?: string;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
type ParsedOutput = {
|
|
44
|
+
tool: 'tsc';
|
|
45
|
+
errors: ParsedError[];
|
|
45
46
|
} | {
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
tool: 'vitest';
|
|
48
|
+
summary: ParsedTestSummary;
|
|
48
49
|
} | {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
tool: 'biome';
|
|
51
|
+
errors: ParsedError[];
|
|
51
52
|
} | {
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
tool: 'git-status';
|
|
54
|
+
status: ParsedGitStatus;
|
|
54
55
|
};
|
|
55
56
|
/**
|
|
56
57
|
* Parse `tsc` output into structured errors.
|
|
57
58
|
*
|
|
58
59
|
* Example line: `src/foo.ts(10,5): error TS2339: Property 'x' does not exist`
|
|
59
60
|
*/
|
|
60
|
-
|
|
61
|
+
declare function parseTsc(output: string): ParsedError[];
|
|
61
62
|
/**
|
|
62
63
|
* Parse vitest run output into structured test results.
|
|
63
64
|
*/
|
|
64
|
-
|
|
65
|
+
declare function parseVitest(output: string): ParsedTestSummary;
|
|
65
66
|
/**
|
|
66
67
|
* Parse biome check/lint output into structured errors.
|
|
67
68
|
*
|
|
68
69
|
* Example: `src/foo.ts:10:5 lint/suspicious/noDoubleEquals ━━━`
|
|
69
70
|
* ` × Use === instead of ==`
|
|
70
71
|
*/
|
|
71
|
-
|
|
72
|
+
declare function parseBiome(output: string): ParsedError[];
|
|
72
73
|
/**
|
|
73
74
|
* Parse `git status --porcelain=v1 -b` output into structured status.
|
|
74
75
|
*/
|
|
75
|
-
|
|
76
|
+
declare function parseGitStatus(output: string): ParsedGitStatus;
|
|
76
77
|
/**
|
|
77
78
|
* Auto-detect the tool from output content and parse accordingly.
|
|
78
79
|
*/
|
|
79
|
-
|
|
80
|
+
declare function parseOutput(output: string, tool?: string): ParsedOutput;
|
|
81
|
+
//#endregion
|
|
82
|
+
export { ParsedError, ParsedGitStatus, ParsedOutput, ParsedTestResult, ParsedTestSummary, parseBiome, parseGitStatus, parseOutput, parseTsc, parseVitest };
|
|
80
83
|
//# sourceMappingURL=parse-output.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
function
|
|
2
|
-
`)){if(!
|
|
1
|
+
function e(e){let t=[];for(let n of e.matchAll(/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+(TS\d+):\s+(.+)$/gm))t.push({file:n[1],line:Number.parseInt(n[2],10),column:Number.parseInt(n[3],10),severity:n[4],code:n[5],message:n[6]});if(t.length===0)for(let n of e.matchAll(/^(.+?):(\d+):(\d+)\s+-\s+(error|warning)\s+(TS\d+):\s+(.+)$/gm))t.push({file:n[1],line:Number.parseInt(n[2],10),column:Number.parseInt(n[3],10),severity:n[4],code:n[5],message:n[6]});return t}function t(e){let t=[];for(let n of e.matchAll(/^\s*([✓✕×-])\s+(.+?)(?:\s+(\d+)ms)?$/gm)){let e=n[1],r=e===`✓`?`pass`:e===`-`?`skip`:`fail`;t.push({name:n[2].trim(),status:r,duration:n[3]?Number.parseInt(n[3],10):void 0})}for(let n of e.matchAll(/^\s*([✓✕×])\s+(\S+\.test\.\w+)\s+\((\d+)\s+tests?\)\s*(\d+ms)?$/gm)){let e=n[1]===`✓`?`pass`:`fail`;t.push({name:n[2],file:n[2],status:e,duration:n[4]?Number.parseInt(n[4],10):void 0})}let n=/Tests\s+(?:(\d+)\s+passed)?(?:\s*\|\s*)?(?:(\d+)\s+failed)?(?:\s*\|\s*)?(?:(\d+)\s+skipped)?\s*\((\d+)\)/.exec(e),r=n?Number.parseInt(n[1]??`0`,10):t.filter(e=>e.status===`pass`).length,i=n?Number.parseInt(n[2]??`0`,10):t.filter(e=>e.status===`fail`).length,a=n?Number.parseInt(n[3]??`0`,10):t.filter(e=>e.status===`skip`).length,o=/Duration\s+(\d+(?:\.\d+)?)(?:ms|s)/.exec(e),s=o?o[0].includes(`s`)&&!o[0].includes(`ms`)?Number.parseFloat(o[1])*1e3:Number.parseFloat(o[1]):void 0,c=/Test Files\s+(\d+)\s+passed/.exec(e);return{tests:t,passed:r,failed:i,skipped:a,duration:s,suites:c?Number.parseInt(c[1],10):void 0}}function n(e){let t=[];for(let n of e.matchAll(/^(.+?):(\d+):(\d+)\s+([\w/]+)\s+━+$/gm)){let r=n[1],i=Number.parseInt(n[2],10),a=Number.parseInt(n[3],10),o=n[4],s=e.slice((n.index??0)+n[0].length,(n.index??0)+n[0].length+500),c=/^\s*[×!i]\s+(.+)$/m.exec(s),l=c?c[1].trim():o,u=o.includes(`lint`)?`warning`:`error`;t.push({file:r,line:i,column:a,severity:u,code:o,message:l})}return t}function r(e){let t=[],n=[],r=[],a;for(let o of e.split(`
|
|
2
|
+
`)){if(!o)continue;if(o.startsWith(`## `)){a=o.slice(3).split(`...`)[0];continue}let e=o[0],s=o[1],c=o.slice(3).trim();e===`?`&&s===`?`?r.push(c):(e!==` `&&e!==`?`&&t.push({status:i(e),file:c}),s!==` `&&s!==`?`&&n.push({status:i(s),file:c}))}return{staged:t,unstaged:n,untracked:r,branch:a}}function i(e){return{M:`modified`,A:`added`,D:`deleted`,R:`renamed`,C:`copied`,U:`unmerged`}[e]??e}function a(i,a){let s=a??o(i);switch(s){case`tsc`:return{tool:`tsc`,errors:e(i)};case`vitest`:return{tool:`vitest`,summary:t(i)};case`biome`:return{tool:`biome`,errors:n(i)};case`git-status`:return{tool:`git-status`,status:r(i)};default:throw Error(`Unknown tool: ${s}. Supported: tsc, vitest, biome, git-status`)}}function o(e){return e.includes(`error TS`)||/\(\d+,\d+\):\s+error/.test(e)?`tsc`:e.includes(`vitest`)||e.includes(`Test Files`)||e.includes(`✓`)?`vitest`:e.includes(`biome`)||/\w+\/\w+\s+━+/.test(e)?`biome`:/^##\s/.test(e)||/^[MADRCU?! ]{2}\s/.test(e)?`git-status`:`unknown`}export{n as parseBiome,r as parseGitStatus,a as parseOutput,e as parseTsc,t as parseVitest};
|
|
3
|
+
//# sourceMappingURL=parse-output.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region packages/tools/src/path-resolver.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Shared path resolver for MCP tools (E-014).
|
|
3
4
|
* Provides consistent path resolution across all tools.
|
|
@@ -8,5 +9,7 @@
|
|
|
8
9
|
* - Relative paths are resolved against the server's cwd
|
|
9
10
|
* - '.' and empty/undefined default to cwd
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
declare function resolvePath(input?: string): string;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { resolvePath };
|
|
12
15
|
//# sourceMappingURL=path-resolver.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{isAbsolute as e,resolve as
|
|
1
|
+
import{isAbsolute as e,resolve as t}from"node:path";function n(n){return!n||n===`.`?process.cwd():e(n)?n:t(process.cwd(),n)}export{n as resolvePath};
|
|
2
|
+
//# sourceMappingURL=path-resolver.js.map
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region packages/tools/src/process-manager.d.ts
|
|
2
|
+
interface ManagedProcess {
|
|
3
|
+
id: string;
|
|
4
|
+
command: string;
|
|
5
|
+
args: string[];
|
|
6
|
+
pid?: number;
|
|
7
|
+
status: 'running' | 'stopped' | 'error';
|
|
8
|
+
startedAt: string;
|
|
9
|
+
exitCode?: number;
|
|
10
|
+
logs: string[];
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
declare function processStart(id: string, command: string, args?: string[], options?: {
|
|
13
|
+
cwd?: string;
|
|
13
14
|
}): ManagedProcess;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
declare function processStop(id: string): ManagedProcess | undefined;
|
|
16
|
+
declare function processStatus(id: string): ManagedProcess | undefined;
|
|
17
|
+
declare function processList(): ManagedProcess[];
|
|
18
|
+
declare function processLogs(id: string, tail?: number): string[];
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ManagedProcess, processList, processLogs, processStart, processStatus, processStop };
|
|
18
21
|
//# sourceMappingURL=process-manager.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{spawn as
|
|
1
|
+
import{spawn as e}from"node:child_process";const t=new Map;function n(n,r,i=[],a){if(t.has(n))throw Error(`Process "${n}" is already running. Stop it first.`);if(t.size>=20)throw Error(`Too many managed processes (max 20). Stop some first.`);let o=/[;|&`$(){}[\]!<>\\]/,s=[r,...i].join(` `);if(o.test(s))throw Error(`Command contains disallowed shell metacharacters`);let c=e(r,i,{cwd:a?.cwd??process.cwd(),shell:!0,stdio:[`ignore`,`pipe`,`pipe`]}),l={id:n,command:r,args:i,pid:c.pid??void 0,status:`running`,startedAt:new Date().toISOString(),logs:[]},u=e=>{let t=e.toString().split(/\r?\n/).filter(Boolean);l.logs.push(...t),l.logs.length>200&&(l.logs=l.logs.slice(-200))};return c.stdout?.on(`data`,u),c.stderr?.on(`data`,u),c.on(`exit`,e=>{l.status=e===0?`stopped`:`error`,l.exitCode=e??void 0,setTimeout(()=>t.delete(n),3e4)}),c.on(`error`,e=>{l.status=`error`,l.logs.push(`[error] ${e.message}`)}),t.set(n,{proc:c,info:l}),l}function r(e){let n=t.get(e);if(!n)return;n.proc.kill(`SIGTERM`);let r=setTimeout(()=>{try{n.proc.kill(`SIGKILL`)}catch{}},5e3);return n.proc.once(`exit`,()=>clearTimeout(r)),n.info.status=`stopped`,t.delete(e),n.info}function i(e){return t.get(e)?.info}function a(){return[...t.values()].map(e=>e.info)}function o(e,n){let r=t.get(e);return r?n?r.info.logs.slice(-n):r.info.logs:[]}export{a as processList,o as processLogs,n as processStart,i as processStatus,r as processStop};
|
|
2
|
+
//# sourceMappingURL=process-manager.js.map
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
//#region packages/tools/src/queue.d.ts
|
|
2
|
+
interface QueueItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
status: 'pending' | 'in-progress' | 'done' | 'failed';
|
|
6
|
+
data?: unknown;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
error?: string;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
interface QueueState {
|
|
12
|
+
name: string;
|
|
13
|
+
items: QueueItem[];
|
|
13
14
|
}
|
|
14
15
|
/** Create a new named queue. */
|
|
15
|
-
|
|
16
|
+
declare function queueCreate(name: string, cwd?: string): QueueState;
|
|
16
17
|
/** Push an item onto a queue. Creates the queue if it doesn't exist. */
|
|
17
|
-
|
|
18
|
+
declare function queuePush(name: string, title: string, data?: unknown, cwd?: string): QueueItem;
|
|
18
19
|
/** Take the next pending item from a queue and mark it in-progress. */
|
|
19
|
-
|
|
20
|
+
declare function queueNext(name: string, cwd?: string): QueueItem | null;
|
|
20
21
|
/** Mark a queue item as done. */
|
|
21
|
-
|
|
22
|
+
declare function queueDone(name: string, id: string, cwd?: string): QueueItem;
|
|
22
23
|
/** Mark a queue item as failed with an error message. */
|
|
23
|
-
|
|
24
|
+
declare function queueFail(name: string, id: string, error: string, cwd?: string): QueueItem;
|
|
24
25
|
/** Get the current state of a queue. */
|
|
25
|
-
|
|
26
|
+
declare function queueGet(name: string, cwd?: string): QueueState | null;
|
|
26
27
|
/** List all queues with their item counts. */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
declare function queueList(cwd?: string): Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
pending: number;
|
|
31
|
+
done: number;
|
|
32
|
+
failed: number;
|
|
33
|
+
total: number;
|
|
33
34
|
}>;
|
|
34
35
|
/** Clear completed items from a queue. */
|
|
35
|
-
|
|
36
|
+
declare function queueClear(name: string, cwd?: string): number;
|
|
36
37
|
/** Delete a queue entirely. */
|
|
37
|
-
|
|
38
|
+
declare function queueDelete(name: string, cwd?: string): boolean;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { QueueItem, QueueState, queueClear, queueCreate, queueDelete, queueDone, queueFail, queueGet, queueList, queueNext, queuePush };
|
|
38
41
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
|
|
1
|
+
import{dirname as e,resolve as t}from"node:path";import{existsSync as n,mkdirSync as r,readFileSync as i,writeFileSync as a}from"node:fs";function o(e){return t(e??process.cwd(),`.kb-state`,`queue.json`)}function s(e){let t=o(e);if(!n(t))return{};try{return JSON.parse(i(t,`utf-8`))}catch{return{}}}function c(t,i){let s=o(i),c=e(s);n(c)||r(c,{recursive:!0}),a(s,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function l(){return`q_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`}function u(e,t){let n=s(t);if(n[e])throw Error(`Queue "${e}" already exists`);let r={name:e,items:[]};return n[e]=r,c(n,t),r}function d(e,t,n,r){let i=s(r);i[e]||(i[e]={name:e,items:[]});let a=new Date().toISOString(),o={id:l(),title:t,status:`pending`,data:n,createdAt:a,updatedAt:a};return i[e].items.push(o),c(i,r),o}function f(e,t){let n=s(t),r=n[e];if(!r)throw Error(`Queue "${e}" does not exist`);let i=r.items.find(e=>e.status===`pending`);return i?(i.status=`in-progress`,i.updatedAt=new Date().toISOString(),c(n,t),i):null}function p(e,t,n){let r=s(n),i=r[e];if(!i)throw Error(`Queue "${e}" does not exist`);let a=i.items.find(e=>e.id===t);if(!a)throw Error(`Item "${t}" not found in queue "${e}"`);return a.status=`done`,a.updatedAt=new Date().toISOString(),c(r,n),a}function m(e,t,n,r){let i=s(r),a=i[e];if(!a)throw Error(`Queue "${e}" does not exist`);let o=a.items.find(e=>e.id===t);if(!o)throw Error(`Item "${t}" not found in queue "${e}"`);return o.status=`failed`,o.error=n,o.updatedAt=new Date().toISOString(),c(i,r),o}function h(e,t){return s(t)[e]??null}function g(e){let t=s(e);return Object.values(t).map(e=>({name:e.name,pending:e.items.filter(e=>e.status===`pending`).length,done:e.items.filter(e=>e.status===`done`).length,failed:e.items.filter(e=>e.status===`failed`).length,total:e.items.length}))}function _(e,t){let n=s(t),r=n[e];if(!r)throw Error(`Queue "${e}" does not exist`);let i=r.items.length;r.items=r.items.filter(e=>e.status===`pending`||e.status===`in-progress`);let a=i-r.items.length;return c(n,t),a}function v(e,t){let n=s(t);return n[e]?(delete n[e],c(n,t),!0):!1}export{_ as queueClear,u as queueCreate,v as queueDelete,p as queueDone,m as queueFail,h as queueGet,g as queueList,f as queueNext,d as queuePush};
|
|
2
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
+
//#region packages/tools/src/regex-test.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* kb_regex_test — Test regex patterns against sample strings.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
interface RegexTestOptions {
|
|
6
|
+
pattern: string;
|
|
7
|
+
flags?: string;
|
|
8
|
+
testStrings: string[];
|
|
9
|
+
mode?: 'match' | 'replace' | 'split';
|
|
10
|
+
replacement?: string;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
interface RegexMatchInfo {
|
|
13
|
+
full: string;
|
|
14
|
+
groups: (string | undefined)[];
|
|
15
|
+
index: number;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
interface RegexTestStringResult {
|
|
18
|
+
input: string;
|
|
19
|
+
matched: boolean;
|
|
20
|
+
matches?: RegexMatchInfo[];
|
|
21
|
+
replaced?: string;
|
|
22
|
+
split?: string[];
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
interface RegexTestResult {
|
|
25
|
+
pattern: string;
|
|
26
|
+
flags: string;
|
|
27
|
+
results: RegexTestStringResult[];
|
|
28
|
+
valid: boolean;
|
|
29
|
+
error?: string;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
declare function regexTest(options: RegexTestOptions): RegexTestResult;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { RegexMatchInfo, RegexTestOptions, RegexTestResult, RegexTestStringResult, regexTest };
|
|
31
34
|
//# sourceMappingURL=regex-test.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){let{pattern:t,flags:n=``,testStrings:r,mode:i=`match`,replacement:a=``}=e;try{let e=new RegExp(t,n);return{pattern:t,flags:n,results:r.map(r=>{let o=e.test(r);switch(i){case`match`:{let e=n.includes(`g`)?n:`${n}g`;return{input:r,matched:o,matches:[...r.matchAll(new RegExp(t,e))].map(e=>({full:e[0],groups:[...e.slice(1)],index:e.index??0}))}}case`replace`:return{input:r,matched:o,replaced:r.replace(new RegExp(t,n),a)};default:return{input:r,matched:o,split:r.split(new RegExp(t,n))}}}),valid:!0}}catch(e){return{pattern:t,flags:n,results:[],valid:!1,error:e.message}}}export{e as regexTest};
|
|
2
|
+
//# sourceMappingURL=regex-test.js.map
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
//#region packages/tools/src/rename.d.ts
|
|
2
|
+
interface RenameOptions {
|
|
3
|
+
/** Symbol to rename */
|
|
4
|
+
oldName: string;
|
|
5
|
+
/** New symbol name */
|
|
6
|
+
newName: string;
|
|
7
|
+
/** Root directory to search in */
|
|
8
|
+
rootPath: string;
|
|
9
|
+
/** File extensions to process (default: .ts, .tsx, .js, .jsx) */
|
|
10
|
+
extensions?: string[];
|
|
11
|
+
/** Glob patterns to exclude */
|
|
12
|
+
exclude?: string[];
|
|
13
|
+
/** Dry run — don't write changes */
|
|
14
|
+
dryRun?: boolean;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
interface RenameChange {
|
|
17
|
+
path: string;
|
|
18
|
+
line: number;
|
|
19
|
+
before: string;
|
|
20
|
+
after: string;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
interface RenameResult {
|
|
23
|
+
oldName: string;
|
|
24
|
+
newName: string;
|
|
25
|
+
changes: RenameChange[];
|
|
26
|
+
filesModified: number;
|
|
27
|
+
dryRun: boolean;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
declare function rename(options: RenameOptions): Promise<RenameResult>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { RenameChange, RenameOptions, RenameResult, rename };
|
|
29
32
|
//# sourceMappingURL=rename.d.ts.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)
|
|
1
|
+
import{DEFAULT_TOOL_EXTENSIONS as e,walkFiles as t}from"./file-walk.js";import{readFile as n,writeFile as r}from"node:fs/promises";import{relative as i}from"node:path";function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){return e.replace(/\\/g,`/`)}function s(e){return RegExp(`(^|[^A-Za-z0-9_$])(${a(e)})(?=[^A-Za-z0-9_$]|$)`,`g`)}async function c(a){let{oldName:c,newName:l,rootPath:u,extensions:d=e,exclude:f=[],dryRun:p=!1}=a;if(!c.trim())throw Error(`oldName must not be empty`);let m=s(c),h=await t(u,d,f),g=[],_=0;for(let e of h){let t=(await n(e,`utf-8`)).split(/\r?\n/),a=!1;for(let n=0;n<t.length;n++){let r=t[n];m.lastIndex=0;let s=r.replace(m,(e,t)=>(a=!0,`${t}${l}`));r!==s&&(t[n]=s,g.push({path:o(i(u,e)),line:n+1,before:r,after:s}))}a&&(_+=1,p||await r(e,t.join(`
|
|
2
|
+
`),`utf-8`))}return{oldName:c,newName:l,changes:g,filesModified:_,dryRun:p}}export{c as rename};
|
|
3
|
+
//# sourceMappingURL=rename.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region packages/tools/src/replay.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Replay — append-only audit trail of tool/CLI invocations.
|
|
3
4
|
*
|
|
@@ -5,52 +6,54 @@
|
|
|
5
6
|
* to `.kb-state/replay.jsonl`. Used by `kb replay` CLI, `kb_replay` MCP tool,
|
|
6
7
|
* and the TUI log panel.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
interface ReplayEntry {
|
|
10
|
+
/** ISO timestamp */
|
|
11
|
+
ts: string;
|
|
12
|
+
/** Source: 'mcp' | 'cli' */
|
|
13
|
+
source: 'mcp' | 'cli';
|
|
14
|
+
/** Tool or command name */
|
|
15
|
+
tool: string;
|
|
16
|
+
/** Redacted input summary (first 200 chars of JSON) */
|
|
17
|
+
input: string;
|
|
18
|
+
/** Duration in milliseconds */
|
|
19
|
+
durationMs: number;
|
|
20
|
+
/** Result status */
|
|
21
|
+
status: 'ok' | 'error';
|
|
22
|
+
/** Short result summary (first 200 chars) */
|
|
23
|
+
output: string;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
interface ReplayOptions {
|
|
26
|
+
/** Max entries to return (default: 20) */
|
|
27
|
+
last?: number;
|
|
28
|
+
/** Filter by tool name */
|
|
29
|
+
tool?: string;
|
|
30
|
+
/** Filter by source */
|
|
31
|
+
source?: 'mcp' | 'cli';
|
|
32
|
+
/** Filter entries after this ISO timestamp */
|
|
33
|
+
since?: string;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Append a replay entry to the audit log.
|
|
36
37
|
* Creates the `.kb-state/` directory if it doesn't exist.
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
declare function replayAppend(entry: ReplayEntry): void;
|
|
39
40
|
/**
|
|
40
41
|
* Read replay entries with optional filters.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
declare function replayList(opts?: ReplayOptions): ReplayEntry[];
|
|
43
44
|
/**
|
|
44
45
|
* Trim the replay log to MAX_ENTRIES, keeping the most recent.
|
|
45
46
|
*/
|
|
46
|
-
|
|
47
|
+
declare function replayTrim(): number;
|
|
47
48
|
/**
|
|
48
49
|
* Clear the entire replay log.
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
declare function replayClear(): void;
|
|
51
52
|
/**
|
|
52
53
|
* Helper: create a replay entry from a tool invocation.
|
|
53
54
|
* Use as a wrapper around tool execution.
|
|
54
55
|
*/
|
|
55
|
-
|
|
56
|
+
declare function replayCapture(source: 'mcp' | 'cli', tool: string, input: unknown, fn: () => Promise<unknown>): Promise<unknown>;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { ReplayEntry, ReplayOptions, replayAppend, replayCapture, replayClear, replayList, replayTrim };
|
|
56
59
|
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
`).filter(Boolean);
|
|
4
|
-
`)
|
|
5
|
-
|
|
6
|
-
`,"utf-8"),s}function O(){const t=c();try{l(t,"","utf-8")}catch{}}function N(t,r,n,s){const e=Date.now();return s().then(i=>(y({ts:new Date().toISOString(),source:t,tool:r,input:typeof n=="string"?n:JSON.stringify(n),durationMs:Date.now()-e,status:"ok",output:typeof i=="string"?i:JSON.stringify(i??"")}),i)).catch(i=>{throw y({ts:new Date().toISOString(),source:t,tool:r,input:typeof n=="string"?n:JSON.stringify(n),durationMs:Date.now()-e,status:"error",output:i instanceof Error?i.message:String(i)}),i})}export{y as replayAppend,N as replayCapture,O as replayClear,E as replayList,k as replayTrim};
|
|
1
|
+
import{dirname as e,resolve as t}from"node:path";import{appendFileSync as n,mkdirSync as r,readFileSync as i,writeFileSync as a}from"node:fs";const o=5e3;let s=0;function c(){return t(process.cwd(),`.kb-state`,`replay.jsonl`)}function l(e,t){return e.length<=t?e:`${e.slice(0,t-1)}…`}function u(t){let i=c();r(e(i),{recursive:!0});let a={...t,input:l(t.input,200),output:l(t.output,200)};if(n(i,`${JSON.stringify(a)}\n`,`utf-8`),s++,s>=100){s=0;try{f()}catch{}}}function d(e={}){let t=c(),n;try{n=i(t,`utf-8`)}catch{return[]}let r=n.trim().split(`
|
|
2
|
+
`).filter(Boolean),a=[];for(let e of r)try{a.push(JSON.parse(e))}catch{}if(e.tool&&(a=a.filter(t=>t.tool===e.tool)),e.source&&(a=a.filter(t=>t.source===e.source)),e.since){let t=e.since;a=a.filter(e=>e.ts>=t)}let o=e.last??20;return a.slice(-o)}function f(){let e=c(),t;try{t=i(e,`utf-8`)}catch{return 0}let n=t.trim().split(`
|
|
3
|
+
`).filter(Boolean);if(n.length<=o)return 0;let r=n.length-o;return a(e,`${n.slice(-o).join(`
|
|
4
|
+
`)}\n`,`utf-8`),r}function p(){let e=c();try{a(e,``,`utf-8`)}catch{}}function m(e,t,n,r){let i=Date.now();return r().then(r=>(u({ts:new Date().toISOString(),source:e,tool:t,input:typeof n==`string`?n:JSON.stringify(n),durationMs:Date.now()-i,status:`ok`,output:typeof r==`string`?r:JSON.stringify(r??``)}),r)).catch(r=>{throw u({ts:new Date().toISOString(),source:e,tool:t,input:typeof n==`string`?n:JSON.stringify(n),durationMs:Date.now()-i,status:`error`,output:r instanceof Error?r.message:String(r)}),r})}export{u as replayAppend,m as replayCapture,p as replayClear,d as replayList,f as replayTrim};
|
|
5
|
+
//# sourceMappingURL=replay.js.map
|