@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
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
# Visual Companion Guide
|
|
2
|
+
|
|
3
|
+
Browser-based visual brainstorming companion for showing mockups, diagrams, and options.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
The browser is a **general-purpose visual canvas** — use it for any content that benefits from visual presentation: diagrams, mockups, explanations, comparisons, and interactive selections.
|
|
8
|
+
|
|
9
|
+
### Server Lifecycle
|
|
10
|
+
|
|
11
|
+
| What | How | Format |
|
|
12
|
+
|------|-----|--------|
|
|
13
|
+
| Start server | Set `BRAINSTORM_DIR`, run `node scripts/server.cjs` in background | Reads URL from `$BRAINSTORM_DIR/.server-info` |
|
|
14
|
+
| Push a screen | Write an `.html` file to `$BRAINSTORM_DIR/` | Content fragment — no `<html>` or `<head>` needed |
|
|
15
|
+
| Read user picks | Read `$BRAINSTORM_DIR/.events` (JSON lines) | `{"type":"click","choice":"A","text":"...","selected":true}` |
|
|
16
|
+
| Read all state | Read `$BRAINSTORM_DIR/.session-state.json` | `{"currentScreen":"file.html","selections":{...}}` |
|
|
17
|
+
| Show waiting screen | Push HTML with centered `.subtitle` text | Clears stale content when returning to terminal |
|
|
18
|
+
| End session | Kill the node process or let 30-min idle timeout | Files persist in `.brainstorm/` |
|
|
19
|
+
|
|
20
|
+
### Content Types You Can Show
|
|
21
|
+
|
|
22
|
+
| What | How | Example Use |
|
|
23
|
+
|------|-----|-------------|
|
|
24
|
+
| **Explanatory content** | `<h2>`, `<p>`, `.section`, `.subtitle` | Describe an architecture, explain a concept |
|
|
25
|
+
| **Diagrams** | ASCII art in `<pre>`, SVG, or HTML boxes with arrows | Data flow, state machines, system topology |
|
|
26
|
+
| **Mockups / wireframes** | `.mockup` + `.mockup-header` + `.mockup-body` | UI layouts, component structure, page wireframes |
|
|
27
|
+
| **Side-by-side comparison** | `.split` (2-column grid) | Compare before/after, two layout options |
|
|
28
|
+
| **Pros / cons** | `.pros-cons` > `.pros` + `.cons` | Evaluate a trade-off visually |
|
|
29
|
+
| **Wireframe elements** | `.mock-nav`, `.mock-sidebar`, `.mock-content`, `.mock-button`, `.mock-input`, `.placeholder` | Build interactive-looking wireframes |
|
|
30
|
+
| **Single-select options** | `.options` > `.option` (`.letter` + `.content`) | Pick one from A/B/C |
|
|
31
|
+
| **Multi-select options** | `.options[data-multiselect]` > `.option` | Toggle multiple choices |
|
|
32
|
+
| **Visual cards** | `.cards` > `.card` (`.card-image` + `.card-body`) | Compare visual designs side-by-side |
|
|
33
|
+
| **Any HTML** | Standard HTML + inline styles | Anything the above classes don't cover |
|
|
34
|
+
|
|
35
|
+
### Diagram Rule
|
|
36
|
+
|
|
37
|
+
> **Never use ASCII box-drawing characters** (`┌ ─ ┐ │ └ ┘ ├ ┤ ┬ ┴ ┼`) for diagrams. LLMs cannot reliably count characters to align box edges. Use one of these instead:
|
|
38
|
+
|
|
39
|
+
| Diagram type | Approach | Why |
|
|
40
|
+
|-------------|----------|-----|
|
|
41
|
+
| Boxes and arrows | **HTML/CSS `<div>` with borders** | Browser handles alignment — always pixel-perfect |
|
|
42
|
+
| Simple linear flow | **ASCII arrows only** (`──▶`, `▼`, `│`) | No boxes to misalign. LLMs handle this fine |
|
|
43
|
+
|
|
44
|
+
### Minimal Templates
|
|
45
|
+
|
|
46
|
+
**Diagram with HTML boxes (recommended):**
|
|
47
|
+
```html
|
|
48
|
+
<h2>How Data Flows</h2>
|
|
49
|
+
<p class="subtitle">Request lifecycle through the system</p>
|
|
50
|
+
<div class="mockup">
|
|
51
|
+
<div class="mockup-header">Architecture</div>
|
|
52
|
+
<div class="mockup-body">
|
|
53
|
+
<div style="display:flex;flex-direction:column;align-items:center;gap:12px">
|
|
54
|
+
<div style="display:flex;align-items:center;gap:0">
|
|
55
|
+
<div style="border:2px solid var(--accent);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>Client</b></div>
|
|
56
|
+
<span style="color:var(--accent);padding:0 6px">──▶</span>
|
|
57
|
+
<div style="border:2px solid var(--accent);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>API Gateway</b></div>
|
|
58
|
+
<span style="color:var(--accent);padding:0 6px">──▶</span>
|
|
59
|
+
<div style="border:2px solid var(--accent);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>Auth Service</b></div>
|
|
60
|
+
</div>
|
|
61
|
+
<div style="color:var(--accent)">▼</div>
|
|
62
|
+
<div style="display:flex;align-items:center;gap:0">
|
|
63
|
+
<div style="border:2px solid var(--accent);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>Router</b></div>
|
|
64
|
+
<span style="color:var(--accent);padding:0 6px">──▶</span>
|
|
65
|
+
<div style="border:2px solid var(--accent);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>Worker Queue</b></div>
|
|
66
|
+
</div>
|
|
67
|
+
<div style="color:var(--accent)">▼</div>
|
|
68
|
+
<div style="border:2px solid var(--success);border-radius:6px;padding:8px 16px;text-align:center;min-width:110px"><b>Database</b></div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Diagram with simple ASCII arrows (also safe):**
|
|
75
|
+
```html
|
|
76
|
+
<div class="mockup">
|
|
77
|
+
<div class="mockup-header">Architecture</div>
|
|
78
|
+
<div class="mockup-body">
|
|
79
|
+
<pre style="color:var(--accent);font-size:14px;line-height:2">
|
|
80
|
+
Client ──▶ API Gateway ──▶ Auth Service
|
|
81
|
+
│ │
|
|
82
|
+
▼ ▼
|
|
83
|
+
Router ──────▶ Worker Queue
|
|
84
|
+
│
|
|
85
|
+
▼
|
|
86
|
+
Database</pre>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Side-by-side comparison:**
|
|
92
|
+
```html
|
|
93
|
+
<h2>Before vs After</h2>
|
|
94
|
+
<div class="split">
|
|
95
|
+
<div class="mockup">
|
|
96
|
+
<div class="mockup-header">Current</div>
|
|
97
|
+
<div class="mockup-body"><!-- current layout --></div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="mockup">
|
|
100
|
+
<div class="mockup-header">Proposed</div>
|
|
101
|
+
<div class="mockup-body"><!-- proposed layout --></div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Single-select:**
|
|
107
|
+
```html
|
|
108
|
+
<h2>Pick one</h2>
|
|
109
|
+
<div class="options">
|
|
110
|
+
<div class="option"><div class="letter">A</div><div class="content"><h3>First</h3><p>Description</p></div></div>
|
|
111
|
+
<div class="option"><div class="letter">B</div><div class="content"><h3>Second</h3><p>Description</p></div></div>
|
|
112
|
+
</div>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Multi-select:**
|
|
116
|
+
```html
|
|
117
|
+
<h2>Pick any that apply</h2>
|
|
118
|
+
<div class="options" data-multiselect>
|
|
119
|
+
<div class="option"><div class="letter">A</div><div class="content"><h3>First</h3><p>Description</p></div></div>
|
|
120
|
+
<div class="option"><div class="letter">B</div><div class="content"><h3>Second</h3><p>Description</p></div></div>
|
|
121
|
+
</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## When to Use
|
|
125
|
+
|
|
126
|
+
Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
|
|
127
|
+
|
|
128
|
+
**Use the browser** when the content itself is visual:
|
|
129
|
+
|
|
130
|
+
- **UI mockups** — wireframes, layouts, navigation structures, component designs
|
|
131
|
+
- **Architecture diagrams** — system components, data flow, relationship maps
|
|
132
|
+
- **Side-by-side visual comparisons** — comparing two layouts, two color schemes, two design directions
|
|
133
|
+
- **Design polish** — when the question is about look and feel, spacing, visual hierarchy
|
|
134
|
+
- **Spatial relationships** — state machines, flowcharts, entity relationships rendered as diagrams
|
|
135
|
+
|
|
136
|
+
**Use the terminal** when the content is text or tabular:
|
|
137
|
+
|
|
138
|
+
- **Requirements and scope questions** — "what does X mean?", "which features are in scope?"
|
|
139
|
+
- **Conceptual A/B/C choices** — picking between approaches described in words
|
|
140
|
+
- **Tradeoff lists** — pros/cons, comparison tables
|
|
141
|
+
- **Technical decisions** — API design, data modeling, architectural approach selection
|
|
142
|
+
- **Clarifying questions** — anything where the answer is words, not a visual preference
|
|
143
|
+
|
|
144
|
+
A question *about* a UI topic is not automatically a visual question. "What kind of wizard do you want?" is conceptual — use the terminal. "Which of these wizard layouts feels right?" is visual — use the browser.
|
|
145
|
+
|
|
146
|
+
## How It Works
|
|
147
|
+
|
|
148
|
+
The server watches a directory for HTML files and serves the newest one to the browser. You write HTML content — explanations, diagrams, mockups, comparisons, interactive selections, or any visual — and the user sees it in their browser. When the page includes clickable options, selections are recorded to a `.events` file that you read on your next turn.
|
|
149
|
+
|
|
150
|
+
**Content fragments vs full documents:** If your HTML file starts with `<!DOCTYPE` or `<html`, the server serves it as-is (just injects the helper script). Otherwise, the server automatically wraps your content in the frame template — adding the header, CSS theme, selection indicator, and all interactive infrastructure. **Write content fragments by default.** Only write full documents when you need complete control over the page.
|
|
151
|
+
|
|
152
|
+
## Starting a Session
|
|
153
|
+
|
|
154
|
+
The server is a Node.js script (`scripts/server.cjs`) configured via environment variables. Create a session directory, set env vars, and launch with `node` directly — no shell wrapper needed.
|
|
155
|
+
|
|
156
|
+
**Environment variables:**
|
|
157
|
+
|
|
158
|
+
| Variable | Required | Default | Description |
|
|
159
|
+
|----------|----------|---------|-------------|
|
|
160
|
+
| `BRAINSTORM_DIR` | Yes | `/tmp/brainstorm` | Session directory for HTML files and events |
|
|
161
|
+
| `BRAINSTORM_HOST` | No | `127.0.0.1` | Bind host |
|
|
162
|
+
| `BRAINSTORM_URL_HOST` | No | `localhost` | Hostname shown in returned URL |
|
|
163
|
+
| `BRAINSTORM_PORT` | No | Random high port | Port to listen on |
|
|
164
|
+
|
|
165
|
+
**Steps:**
|
|
166
|
+
|
|
167
|
+
1. Create session directory: `<project>/.brainstorm/<session-id>/`
|
|
168
|
+
2. Set `BRAINSTORM_DIR` to that path
|
|
169
|
+
3. Run `node scripts/server.cjs` as a background process
|
|
170
|
+
4. Read `$BRAINSTORM_DIR/.server-info` to get the URL and port
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
# Returns in .server-info:
|
|
174
|
+
{"type":"server-started","port":52341,"url":"http://localhost:52341",
|
|
175
|
+
"screen_dir":"/path/to/project/.brainstorm/12345-1706000000"}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Save `screen_dir` from the response. The server auto-opens the browser on start. If the user can't see the page, remind them of the URL from `.server-info`. Use `--no-auto-open` to disable.
|
|
179
|
+
|
|
180
|
+
**Finding connection info:** The server writes its startup JSON to `$SCREEN_DIR/.server-info`. Read that file to get the URL and port. When using a project directory, check `<project>/.brainstorm/` for the session directory.
|
|
181
|
+
|
|
182
|
+
**Note:** Use a project-relative session directory so mockups persist in `.brainstorm/` and survive server restarts. Without it, files go to `/tmp` and get cleaned up. Remind the user to add `.brainstorm/` to `.gitignore` if it's not already there.
|
|
183
|
+
|
|
184
|
+
**Platform notes:**
|
|
185
|
+
|
|
186
|
+
- **All platforms:** Launch `node scripts/server.cjs` as a background process. On Windows (PowerShell), set env vars with `$env:BRAINSTORM_DIR = "..."` before running. On macOS/Linux, use `BRAINSTORM_DIR=... node scripts/server.cjs &`.
|
|
187
|
+
- **Codex / remote environments:** If background processes are reaped, use the tool's background execution mechanism (e.g., `isBackground: true`).
|
|
188
|
+
- **Remote/containerized setups:** Set `BRAINSTORM_HOST=0.0.0.0` and `BRAINSTORM_URL_HOST=localhost` to bind non-loopback.
|
|
189
|
+
|
|
190
|
+
The server auto-exits after 30 minutes of inactivity.
|
|
191
|
+
|
|
192
|
+
## The Loop
|
|
193
|
+
|
|
194
|
+
1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
|
|
195
|
+
- Before each write, check that `$SCREEN_DIR/.server-info` exists. If it doesn't (or `.server-stopped` exists), the server has shut down — restart it with `node scripts/server.cjs` before continuing. The server auto-exits after 30 minutes of inactivity.
|
|
196
|
+
- Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
|
|
197
|
+
- **Never reuse filenames** — each screen gets a fresh file
|
|
198
|
+
- Use Write tool — **never use cat/heredoc** (dumps noise into terminal)
|
|
199
|
+
- Server automatically serves the newest file
|
|
200
|
+
|
|
201
|
+
2. **Tell user what to expect and end your turn:**
|
|
202
|
+
- The browser auto-opens on server start. If the user closed it, remind them of the URL from `.server-info`
|
|
203
|
+
- Give a brief text summary of what's on screen (e.g., "Showing 3 layout options for the homepage")
|
|
204
|
+
- Ask them to respond in the terminal: "Take a look and let me know what you think. Click to select an option if you'd like."
|
|
205
|
+
|
|
206
|
+
3. **On your next turn** — after the user responds in the terminal:
|
|
207
|
+
- Read `$SCREEN_DIR/.events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
|
|
208
|
+
- Merge with the user's terminal text to get the full picture
|
|
209
|
+
- The terminal message is the primary feedback; `.events` provides structured interaction data
|
|
210
|
+
|
|
211
|
+
4. **Iterate or advance** — if feedback changes current screen, write a new file (e.g., `layout-v2.html`). Only move to the next question when the current step is validated.
|
|
212
|
+
|
|
213
|
+
5. **Unload when returning to terminal** — when the next step doesn't need the browser (e.g., a clarifying question, a tradeoff discussion), push a waiting screen to clear the stale content:
|
|
214
|
+
|
|
215
|
+
```html
|
|
216
|
+
<!-- filename: waiting.html (or waiting-2.html, etc.) -->
|
|
217
|
+
<div style="display:flex;align-items:center;justify-content:center;min-height:60vh">
|
|
218
|
+
<p class="subtitle">Continuing in terminal...</p>
|
|
219
|
+
</div>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
This prevents the user from staring at a resolved choice while the conversation has moved on. When the next visual question comes up, push a new content file as usual.
|
|
223
|
+
|
|
224
|
+
6. Repeat until done.
|
|
225
|
+
|
|
226
|
+
## Writing Content Fragments
|
|
227
|
+
|
|
228
|
+
Write just the content that goes inside the page. The server wraps it in the frame template automatically (header, theme CSS, selection indicator, and all interactive infrastructure).
|
|
229
|
+
|
|
230
|
+
**Minimal example:**
|
|
231
|
+
|
|
232
|
+
```html
|
|
233
|
+
<h2>Which layout works better?</h2>
|
|
234
|
+
<p class="subtitle">Consider readability and visual hierarchy</p>
|
|
235
|
+
|
|
236
|
+
<div class="options">
|
|
237
|
+
<div class="option" data-choice="a" onclick="toggleSelect(this)">
|
|
238
|
+
<div class="letter">A</div>
|
|
239
|
+
<div class="content">
|
|
240
|
+
<h3>Single Column</h3>
|
|
241
|
+
<p>Clean, focused reading experience</p>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="option" data-choice="b" onclick="toggleSelect(this)">
|
|
245
|
+
<div class="letter">B</div>
|
|
246
|
+
<div class="content">
|
|
247
|
+
<h3>Two Column</h3>
|
|
248
|
+
<p>Sidebar navigation with main content</p>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
That's it. No `<html>`, no CSS, no `<script>` tags needed. The server provides all of that.
|
|
255
|
+
|
|
256
|
+
## CSS Classes Available
|
|
257
|
+
|
|
258
|
+
The frame template provides these CSS classes for your content:
|
|
259
|
+
|
|
260
|
+
### Options (A/B/C choices)
|
|
261
|
+
|
|
262
|
+
```html
|
|
263
|
+
<div class="options">
|
|
264
|
+
<div class="option" data-choice="a" onclick="toggleSelect(this)">
|
|
265
|
+
<div class="letter">A</div>
|
|
266
|
+
<div class="content">
|
|
267
|
+
<h3>Title</h3>
|
|
268
|
+
<p>Description</p>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Multi-select:** Add `data-multiselect` to the container to let users select multiple options. Each click toggles the item. The indicator bar shows the count.
|
|
275
|
+
|
|
276
|
+
```html
|
|
277
|
+
<div class="options" data-multiselect>
|
|
278
|
+
<!-- same option markup — users can select/deselect multiple -->
|
|
279
|
+
</div>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Cards (visual designs)
|
|
283
|
+
|
|
284
|
+
```html
|
|
285
|
+
<div class="cards">
|
|
286
|
+
<div class="card" data-choice="design1" onclick="toggleSelect(this)">
|
|
287
|
+
<div class="card-image"><!-- mockup content --></div>
|
|
288
|
+
<div class="card-body">
|
|
289
|
+
<h3>Name</h3>
|
|
290
|
+
<p>Description</p>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Mockup container
|
|
297
|
+
|
|
298
|
+
```html
|
|
299
|
+
<div class="mockup">
|
|
300
|
+
<div class="mockup-header">Preview: Dashboard Layout</div>
|
|
301
|
+
<div class="mockup-body"><!-- your mockup HTML --></div>
|
|
302
|
+
</div>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Split view (side-by-side)
|
|
306
|
+
|
|
307
|
+
```html
|
|
308
|
+
<div class="split">
|
|
309
|
+
<div class="mockup"><!-- left --></div>
|
|
310
|
+
<div class="mockup"><!-- right --></div>
|
|
311
|
+
</div>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Pros/Cons
|
|
315
|
+
|
|
316
|
+
```html
|
|
317
|
+
<div class="pros-cons">
|
|
318
|
+
<div class="pros"><h4>Pros</h4><ul><li>Benefit</li></ul></div>
|
|
319
|
+
<div class="cons"><h4>Cons</h4><ul><li>Drawback</li></ul></div>
|
|
320
|
+
</div>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Mock elements (wireframe building blocks)
|
|
324
|
+
|
|
325
|
+
```html
|
|
326
|
+
<div class="mock-nav">Logo | Home | About | Contact</div>
|
|
327
|
+
<div style="display: flex;">
|
|
328
|
+
<div class="mock-sidebar">Navigation</div>
|
|
329
|
+
<div class="mock-content">Main content area</div>
|
|
330
|
+
</div>
|
|
331
|
+
<button class="mock-button">Action Button</button>
|
|
332
|
+
<input class="mock-input" placeholder="Input field">
|
|
333
|
+
<div class="placeholder">Placeholder area</div>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Typography and sections
|
|
337
|
+
|
|
338
|
+
- `h2` — page title
|
|
339
|
+
- `h3` — section heading
|
|
340
|
+
- `.subtitle` — secondary text below title
|
|
341
|
+
- `.section` — content block with bottom margin
|
|
342
|
+
- `.label` — small uppercase label text
|
|
343
|
+
|
|
344
|
+
## Browser Events Format
|
|
345
|
+
|
|
346
|
+
When the user clicks options in the browser, their interactions are recorded to `$SCREEN_DIR/.events` (one JSON object per line). The file is cleared automatically when you push a new screen.
|
|
347
|
+
|
|
348
|
+
```jsonl
|
|
349
|
+
{"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
|
|
350
|
+
{"type":"click","choice":"c","text":"Option C - Complex Grid","timestamp":1706000108}
|
|
351
|
+
{"type":"click","choice":"b","text":"Option B - Hybrid","timestamp":1706000115}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
The full event stream shows the user's exploration path — they may click multiple options before settling. The last `choice` event is typically the final selection, but the pattern of clicks can reveal hesitation or preferences worth asking about.
|
|
355
|
+
|
|
356
|
+
If `.events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
|
|
357
|
+
|
|
358
|
+
## WebSocket Transport
|
|
359
|
+
|
|
360
|
+
The server supports WebSocket connections on the same port as HTTP. The browser client connects via WebSocket for instant updates:
|
|
361
|
+
|
|
362
|
+
- **New file detected** — server broadcasts `{"type":"new-file","name":"..."}` — page reloads instantly
|
|
363
|
+
- **User clicks option** — POST to `/events` as before, server also broadcasts via WebSocket
|
|
364
|
+
|
|
365
|
+
If the WebSocket connection fails (older browser, network issue), the client automatically falls back to polling every 1.5s, preserving backward compatibility.
|
|
366
|
+
|
|
367
|
+
## Session State
|
|
368
|
+
|
|
369
|
+
Selections persist across page reloads in `.session-state.json` (in the session directory):
|
|
370
|
+
|
|
371
|
+
- All screens the user has seen
|
|
372
|
+
- All current selections per screen (deselected items are removed)
|
|
373
|
+
- Current screen name and last update timestamp
|
|
374
|
+
|
|
375
|
+
On page load, the client fetches `GET /state` and restores prior selections. The agent can also read `.session-state.json` for a cumulative view of user choices across the session.
|
|
376
|
+
|
|
377
|
+
## Design Tips
|
|
378
|
+
|
|
379
|
+
- **Scale fidelity to the question** — wireframes for layout, polish for polish questions
|
|
380
|
+
- **Explain the question on each page** — "Which layout feels more professional?" not just "Pick one"
|
|
381
|
+
- **Iterate before advancing** — if feedback changes current screen, write a new version
|
|
382
|
+
- **2-4 options max** per screen
|
|
383
|
+
- **Use real content when it matters** — for a photography portfolio, use actual images (Unsplash). Placeholder content obscures design issues.
|
|
384
|
+
- **Keep mockups simple** — focus on layout and structure, not pixel-perfect design
|
|
385
|
+
|
|
386
|
+
## File Naming
|
|
387
|
+
|
|
388
|
+
- Use semantic names: `platform.html`, `visual-style.html`, `layout.html`
|
|
389
|
+
- Never reuse filenames — each screen must be a new file
|
|
390
|
+
- For iterations: append version suffix like `layout-v2.html`, `layout-v3.html`
|
|
391
|
+
- Server serves newest file by modification time
|
|
392
|
+
|
|
393
|
+
## Cleaning Up
|
|
394
|
+
|
|
395
|
+
Kill the Node.js server process (or let the 30-minute idle timeout handle it). Mockup files persist in `.brainstorm/` for later reference. Only `/tmp` sessions get deleted on cleanup.
|
|
396
|
+
|
|
397
|
+
## Reference
|
|
398
|
+
|
|
399
|
+
- Server (bundled, self-contained): `scripts/server.cjs` — run this, no `npm install` needed
|
|
400
|
+
- Server source (dev): `scripts/server.src.cjs` — requires `pnpm install` at project root
|
|
401
|
+
- Frame template (CSS reference): `scripts/frame-template.html`
|
|
402
|
+
- Helper script (client-side): `scripts/helper.js`
|
|
403
|
+
|
|
404
|
+
## Future: Blocking Tool Call Pattern (Design Note)
|
|
405
|
+
|
|
406
|
+
> **Status:** Design note only — not implemented. Captured for future reference.
|
|
407
|
+
|
|
408
|
+
### Concept
|
|
409
|
+
|
|
410
|
+
Instead of the current async loop (write file → user interacts → agent reads on next turn), a blocking MCP tool could unify the interaction into a single agent turn:
|
|
411
|
+
|
|
412
|
+
1. Agent calls `await_user_selection({ screen: "platform.html", timeout: 120000 })`
|
|
413
|
+
2. Tool starts WebSocket server, writes HTML, opens browser
|
|
414
|
+
3. Tool **blocks** (does not return to the LLM)
|
|
415
|
+
4. User makes selections in browser → WebSocket resolves
|
|
416
|
+
5. Tool returns `{ selections: [...] }` to the LLM
|
|
417
|
+
6. Agent continues in the **same turn** with the user's choices
|
|
418
|
+
|
|
419
|
+
### Benefits
|
|
420
|
+
|
|
421
|
+
- No turn boundary between showing options and receiving feedback
|
|
422
|
+
- Agent can chain multiple visual questions in one turn
|
|
423
|
+
- Closer to a "native" interactive experience
|
|
424
|
+
|
|
425
|
+
### Constraints
|
|
426
|
+
|
|
427
|
+
- Requires MCP tool to support long-running blocking calls
|
|
428
|
+
- Timeout handling is critical (user may never interact)
|
|
429
|
+
- VS Code Copilot Chat may have turn-level timeouts that conflict
|
|
430
|
+
- Must still fall back gracefully if browser doesn't connect
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vpxa/kb — Knowledge Base Toolkit
|
|
2
2
|
|
|
3
|
-
Local-first AI developer toolkit — 64 MCP tools for
|
|
3
|
+
Local-first AI developer toolkit — 64 MCP tools for search, analysis, context compression, FORGE quality gates, knowledge management, code manipulation, execution, web access, and developer utilities.
|
|
4
4
|
|
|
5
5
|
## When to Use
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ Local-first AI developer toolkit — 64 MCP tools for knowledge management, code
|
|
|
25
25
|
core → store → embeddings → chunker → indexer → analyzers → tools → server → cli → tui
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
- **MCP server**:
|
|
28
|
+
- **MCP server**: 64 tools + 2 resources (via `@modelcontextprotocol/sdk`)
|
|
29
29
|
- **CLI**: 45 commands (thin dispatcher + 10 command groups)
|
|
30
30
|
- **Search**: Hybrid vector + keyword + RRF fusion
|
|
31
31
|
- **Embeddings**: ONNX local (mxbai-embed-large-v1, 1024 dimensions)
|
|
@@ -54,9 +54,9 @@ remember (capture insights)
|
|
|
54
54
|
remember({ title: "Session checkpoint: <topic>", content: "<what was done, decisions made, next steps>", category: "conventions" })
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
## Tool Catalog (
|
|
57
|
+
## Tool Catalog (64 tools)
|
|
58
58
|
|
|
59
|
-
### Search & Discovery (
|
|
59
|
+
### Search & Discovery (8)
|
|
60
60
|
| Tool | CLI | Purpose |
|
|
61
61
|
|------|-----|---------|
|
|
62
62
|
| `search` | `kb search` | Hybrid/semantic/keyword search with `search_mode` param |
|
|
@@ -98,7 +98,7 @@ remember({ title: "Session checkpoint: <topic>", content: "<what was done, decis
|
|
|
98
98
|
|
|
99
99
|
### Execution & Validation (5)
|
|
100
100
|
| Tool | CLI | Purpose |
|
|
101
|
-
|
|
101
|
+
|------|-----|---------|
|
|
102
102
|
| `eval` | `kb eval` | Sandboxed JavaScript/TypeScript execution |
|
|
103
103
|
| `check` | `kb check` | Incremental typecheck + lint. `detail` param: summary (default, ~300 tokens), errors, full |
|
|
104
104
|
| `test_run` | `kb test` | Run tests with structured pass/fail results |
|
|
@@ -149,13 +149,24 @@ Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/de
|
|
|
149
149
|
| `env` | — | System and runtime environment info (sensitive values redacted) |
|
|
150
150
|
| `time` | — | Date parsing, timezone conversion, duration math |
|
|
151
151
|
|
|
152
|
-
###
|
|
152
|
+
### FORGE Quality Gates (5)
|
|
153
153
|
| Tool | CLI | Purpose |
|
|
154
|
-
|
|
154
|
+
|------|-----|---------|
|
|
155
|
+
| `forge_ground` | — | Full Ground phase: classify tier, scope map, unknowns, constraints |
|
|
156
|
+
| `forge_classify` | — | Quick tier classification (Floor/Standard/Critical) |
|
|
157
|
+
| `evidence_map` | — | CRUD + Gate evaluation for verified/assumed/unknown claims |
|
|
158
|
+
| `stratum_card` | — | Generate T1/T2 compressed context cards from files (10-100x token reduction) |
|
|
159
|
+
| `digest` | — | Compress N text sources into token-budgeted summary |
|
|
160
|
+
|
|
161
|
+
### System (8)
|
|
162
|
+
| Tool | CLI | Purpose |
|
|
163
|
+
|------|-----|---------|
|
|
155
164
|
| `status` | `kb status` | Index statistics |
|
|
156
165
|
| `reindex` | `kb reindex` | Rebuild index |
|
|
157
166
|
| `health` | `kb health` | Project health checks (package.json, tsconfig, lockfile, circular deps) |
|
|
158
167
|
| `guide` | `kb guide` | Tool discovery — given a goal, recommends tools and workflow order |
|
|
168
|
+
| `onboard` | `kb onboard` | Full codebase onboarding in one call (structure + deps + patterns + knowledge) |
|
|
169
|
+
| `graph` | `kb graph` | Query the auto-populated knowledge graph (modules, symbols, imports) |
|
|
159
170
|
| `queue` | `kb queue` | Task queue for sequential agent operations (create/push/next/done/fail) |
|
|
160
171
|
| `replay` | `kb replay` | View or clear the audit trail of tool invocations (action: list/clear) |
|
|
161
172
|
|
|
@@ -221,8 +232,10 @@ git_context({ diff: true })
|
|
|
221
232
|
## CLI Quick Reference
|
|
222
233
|
|
|
223
234
|
```bash
|
|
224
|
-
kb init
|
|
225
|
-
kb
|
|
235
|
+
kb init # Scaffold KB in current directory
|
|
236
|
+
kb init --force # Overwrite all scaffold/skill files
|
|
237
|
+
kb init --guide # JSON report of stale files for LLM-driven updates
|
|
238
|
+
kb serve # Start MCP server (stdio or HTTP)
|
|
226
239
|
kb search <q> # Hybrid search
|
|
227
240
|
kb find <q> # Federated search
|
|
228
241
|
kb symbol <name> # Resolve symbol
|