wotann 0.5.0 → 0.5.39
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/dist/agents/background-agent.d.ts.map +1 -1
- package/dist/agents/background-agent.js +2 -1
- package/dist/agents/background-agent.js.map +1 -1
- package/dist/agents/file-scope-policy.d.ts +116 -0
- package/dist/agents/file-scope-policy.d.ts.map +1 -0
- package/dist/agents/file-scope-policy.js +190 -0
- package/dist/agents/file-scope-policy.js.map +1 -0
- package/dist/agents/yaml-manifest.d.ts +125 -0
- package/dist/agents/yaml-manifest.d.ts.map +1 -0
- package/dist/agents/yaml-manifest.js +901 -0
- package/dist/agents/yaml-manifest.js.map +1 -0
- package/dist/auth/login.d.ts +3 -3
- package/dist/auth/login.d.ts.map +1 -1
- package/dist/auth/login.js +80 -23
- package/dist/auth/login.js.map +1 -1
- package/dist/autopilot/completion-oracle.d.ts.map +1 -1
- package/dist/autopilot/completion-oracle.js +3 -1
- package/dist/autopilot/completion-oracle.js.map +1 -1
- package/dist/autopilot/run-manifest.d.ts +90 -0
- package/dist/autopilot/run-manifest.d.ts.map +1 -0
- package/dist/autopilot/run-manifest.js +261 -0
- package/dist/autopilot/run-manifest.js.map +1 -0
- package/dist/browser/adaptive-selectors.d.ts +170 -0
- package/dist/browser/adaptive-selectors.d.ts.map +1 -0
- package/dist/browser/adaptive-selectors.js +317 -0
- package/dist/browser/adaptive-selectors.js.map +1 -0
- package/dist/browser/humanize-input.d.ts +76 -0
- package/dist/browser/humanize-input.d.ts.map +1 -0
- package/dist/browser/humanize-input.js +386 -0
- package/dist/browser/humanize-input.js.map +1 -0
- package/dist/channels/teams.d.ts +41 -19
- package/dist/channels/teams.d.ts.map +1 -1
- package/dist/channels/teams.js +121 -24
- package/dist/channels/teams.js.map +1 -1
- package/dist/channels/terminal-mention.d.ts.map +1 -1
- package/dist/channels/terminal-mention.js +4 -1
- package/dist/channels/terminal-mention.js.map +1 -1
- package/dist/cli/commands/blast-radius.d.ts +47 -0
- package/dist/cli/commands/blast-radius.d.ts.map +1 -0
- package/dist/cli/commands/blast-radius.js +123 -0
- package/dist/cli/commands/blast-radius.js.map +1 -0
- package/dist/cli/commands/evolve.d.ts +92 -0
- package/dist/cli/commands/evolve.d.ts.map +1 -0
- package/dist/cli/commands/evolve.js +336 -0
- package/dist/cli/commands/evolve.js.map +1 -0
- package/dist/cli/commands/learning.d.ts +54 -0
- package/dist/cli/commands/learning.d.ts.map +1 -0
- package/dist/cli/commands/learning.js +380 -0
- package/dist/cli/commands/learning.js.map +1 -0
- package/dist/cli/commands/persona.d.ts +42 -0
- package/dist/cli/commands/persona.d.ts.map +1 -0
- package/dist/cli/commands/persona.js +198 -0
- package/dist/cli/commands/persona.js.map +1 -0
- package/dist/cli/commands/stuck.d.ts.map +1 -1
- package/dist/cli/commands/stuck.js +5 -2
- package/dist/cli/commands/stuck.js.map +1 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +5 -2
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/orphan-wires/agent-manifest-cmd.d.ts +17 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.js +99 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/arena-cmd.d.ts +26 -0
- package/dist/cli/orphan-wires/arena-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/arena-cmd.js +167 -0
- package/dist/cli/orphan-wires/arena-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/artifact-cmd.d.ts +17 -0
- package/dist/cli/orphan-wires/artifact-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/artifact-cmd.js +175 -0
- package/dist/cli/orphan-wires/artifact-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/demo-cmd.d.ts +25 -0
- package/dist/cli/orphan-wires/demo-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/demo-cmd.js +164 -0
- package/dist/cli/orphan-wires/demo-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/extras-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/extras-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/extras-cmd.js +289 -0
- package/dist/cli/orphan-wires/extras-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.d.ts +15 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.js +36 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/index.d.ts.map +1 -1
- package/dist/cli/orphan-wires/index.js +30 -0
- package/dist/cli/orphan-wires/index.js.map +1 -1
- package/dist/cli/orphan-wires/integrations-cmd.d.ts +38 -0
- package/dist/cli/orphan-wires/integrations-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/integrations-cmd.js +345 -0
- package/dist/cli/orphan-wires/integrations-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.d.ts +18 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.js +127 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.d.ts +21 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.js +86 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/patch-cmd.d.ts +29 -0
- package/dist/cli/orphan-wires/patch-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/patch-cmd.js +150 -0
- package/dist/cli/orphan-wires/patch-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.d.ts +28 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.js +169 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.d.ts +21 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.js +70 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.js +74 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.d.ts +18 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.js +87 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.js +115 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.js.map +1 -0
- package/dist/cli/thin-client.d.ts +17 -10
- package/dist/cli/thin-client.d.ts.map +1 -1
- package/dist/cli/thin-client.js +108 -26
- package/dist/cli/thin-client.js.map +1 -1
- package/dist/computer-use/action-history-compactor.d.ts +92 -0
- package/dist/computer-use/action-history-compactor.d.ts.map +1 -0
- package/dist/computer-use/action-history-compactor.js +204 -0
- package/dist/computer-use/action-history-compactor.js.map +1 -0
- package/dist/computer-use/action-repertoire.d.ts +8 -0
- package/dist/computer-use/action-repertoire.d.ts.map +1 -1
- package/dist/computer-use/action-repertoire.js +19 -0
- package/dist/computer-use/action-repertoire.js.map +1 -1
- package/dist/computer-use/computer-agent.d.ts +232 -2
- package/dist/computer-use/computer-agent.d.ts.map +1 -1
- package/dist/computer-use/computer-agent.js +558 -19
- package/dist/computer-use/computer-agent.js.map +1 -1
- package/dist/computer-use/coordinate-scaling.d.ts +104 -0
- package/dist/computer-use/coordinate-scaling.d.ts.map +1 -0
- package/dist/computer-use/coordinate-scaling.js +175 -0
- package/dist/computer-use/coordinate-scaling.js.map +1 -0
- package/dist/computer-use/driver-contract.d.ts +158 -0
- package/dist/computer-use/driver-contract.d.ts.map +1 -0
- package/dist/computer-use/driver-contract.js +471 -0
- package/dist/computer-use/driver-contract.js.map +1 -0
- package/dist/computer-use/perception-engine.d.ts +39 -0
- package/dist/computer-use/perception-engine.d.ts.map +1 -1
- package/dist/computer-use/perception-engine.js +27 -27
- package/dist/computer-use/perception-engine.js.map +1 -1
- package/dist/computer-use/platform-bindings.d.ts.map +1 -1
- package/dist/computer-use/platform-bindings.js +216 -2
- package/dist/computer-use/platform-bindings.js.map +1 -1
- package/dist/computer-use/safe-execute.d.ts +86 -0
- package/dist/computer-use/safe-execute.d.ts.map +1 -0
- package/dist/computer-use/safe-execute.js +152 -0
- package/dist/computer-use/safe-execute.js.map +1 -0
- package/dist/context/branch-summarization.d.ts +97 -0
- package/dist/context/branch-summarization.d.ts.map +1 -0
- package/dist/context/branch-summarization.js +170 -0
- package/dist/context/branch-summarization.js.map +1 -0
- package/dist/context/compaction.d.ts +16 -1
- package/dist/context/compaction.d.ts.map +1 -1
- package/dist/context/compaction.js +50 -2
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/inspector.d.ts +2 -2
- package/dist/context/inspector.d.ts.map +1 -1
- package/dist/context/inspector.js +4 -3
- package/dist/context/inspector.js.map +1 -1
- package/dist/core/agent-bridge.d.ts.map +1 -1
- package/dist/core/agent-bridge.js +200 -69
- package/dist/core/agent-bridge.js.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +7 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/mode-model-preference.d.ts +95 -0
- package/dist/core/mode-model-preference.d.ts.map +1 -0
- package/dist/core/mode-model-preference.js +170 -0
- package/dist/core/mode-model-preference.js.map +1 -0
- package/dist/core/prompt-override.d.ts.map +1 -1
- package/dist/core/prompt-override.js +1 -0
- package/dist/core/prompt-override.js.map +1 -1
- package/dist/core/runtime-intelligence.d.ts +11 -0
- package/dist/core/runtime-intelligence.d.ts.map +1 -1
- package/dist/core/runtime-intelligence.js +18 -3
- package/dist/core/runtime-intelligence.js.map +1 -1
- package/dist/core/runtime-tool-dispatch.js +1 -1
- package/dist/core/runtime-tool-dispatch.js.map +1 -1
- package/dist/core/runtime.d.ts +186 -13
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +717 -228
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/session-rewind.d.ts +67 -0
- package/dist/core/session-rewind.d.ts.map +1 -0
- package/dist/core/session-rewind.js +120 -0
- package/dist/core/session-rewind.js.map +1 -0
- package/dist/core/types.d.ts +19 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/daemon/file-watcher.d.ts +84 -0
- package/dist/daemon/file-watcher.d.ts.map +1 -0
- package/dist/daemon/file-watcher.js +193 -0
- package/dist/daemon/file-watcher.js.map +1 -0
- package/dist/daemon/jsonl-mode.d.ts +11 -0
- package/dist/daemon/jsonl-mode.d.ts.map +1 -0
- package/dist/daemon/jsonl-mode.js +77 -0
- package/dist/daemon/jsonl-mode.js.map +1 -0
- package/dist/daemon/kairos-ipc.d.ts +4 -1
- package/dist/daemon/kairos-ipc.d.ts.map +1 -1
- package/dist/daemon/kairos-ipc.js +38 -22
- package/dist/daemon/kairos-ipc.js.map +1 -1
- package/dist/daemon/kairos-rpc.d.ts +5 -1
- package/dist/daemon/kairos-rpc.d.ts.map +1 -1
- package/dist/daemon/kairos-rpc.js +1262 -114
- package/dist/daemon/kairos-rpc.js.map +1 -1
- package/dist/daemon/kairos.d.ts +35 -4
- package/dist/daemon/kairos.d.ts.map +1 -1
- package/dist/daemon/kairos.js +204 -24
- package/dist/daemon/kairos.js.map +1 -1
- package/dist/daemon/rpc-handlers/intelligence-rpc.d.ts.map +1 -1
- package/dist/daemon/rpc-handlers/intelligence-rpc.js +15 -3
- package/dist/daemon/rpc-handlers/intelligence-rpc.js.map +1 -1
- package/dist/daemon/transport/jsonl.d.ts +7 -0
- package/dist/daemon/transport/jsonl.d.ts.map +1 -0
- package/dist/daemon/transport/jsonl.js +38 -0
- package/dist/daemon/transport/jsonl.js.map +1 -0
- package/dist/daemon/transport/socket-path.d.ts +28 -0
- package/dist/daemon/transport/socket-path.d.ts.map +1 -0
- package/dist/daemon/transport/socket-path.js +36 -0
- package/dist/daemon/transport/socket-path.js.map +1 -0
- package/dist/design/theme-presets.d.ts +77 -0
- package/dist/design/theme-presets.d.ts.map +1 -0
- package/dist/design/theme-presets.js +274 -0
- package/dist/design/theme-presets.js.map +1 -0
- package/dist/desktop/companion-server.d.ts +67 -4
- package/dist/desktop/companion-server.d.ts.map +1 -1
- package/dist/desktop/companion-server.js +617 -70
- package/dist/desktop/companion-server.js.map +1 -1
- package/dist/desktop/web-artifacts-builder.d.ts +108 -0
- package/dist/desktop/web-artifacts-builder.d.ts.map +1 -0
- package/dist/desktop/web-artifacts-builder.js +184 -0
- package/dist/desktop/web-artifacts-builder.js.map +1 -0
- package/dist/hooks/built-in.d.ts.map +1 -1
- package/dist/hooks/built-in.js +15 -10
- package/dist/hooks/built-in.js.map +1 -1
- package/dist/index.js +1301 -167
- package/dist/index.js.map +1 -1
- package/dist/integrations/integration-manifest.d.ts +140 -0
- package/dist/integrations/integration-manifest.d.ts.map +1 -0
- package/dist/integrations/integration-manifest.js +268 -0
- package/dist/integrations/integration-manifest.js.map +1 -0
- package/dist/intelligence/apply-patch-dsl.d.ts +112 -0
- package/dist/intelligence/apply-patch-dsl.d.ts.map +1 -0
- package/dist/intelligence/apply-patch-dsl.js +264 -0
- package/dist/intelligence/apply-patch-dsl.js.map +1 -0
- package/dist/intelligence/apply-patch-executor.d.ts +147 -0
- package/dist/intelligence/apply-patch-executor.d.ts.map +1 -0
- package/dist/intelligence/apply-patch-executor.js +418 -0
- package/dist/intelligence/apply-patch-executor.js.map +1 -0
- package/dist/intelligence/blast-radius.d.ts +67 -0
- package/dist/intelligence/blast-radius.d.ts.map +1 -0
- package/dist/intelligence/blast-radius.js +536 -0
- package/dist/intelligence/blast-radius.js.map +1 -0
- package/dist/intelligence/code-graph.d.ts +58 -7
- package/dist/intelligence/code-graph.d.ts.map +1 -1
- package/dist/intelligence/code-graph.js +347 -16
- package/dist/intelligence/code-graph.js.map +1 -1
- package/dist/intelligence/codebase-health.d.ts.map +1 -1
- package/dist/intelligence/codebase-health.js +4 -3
- package/dist/intelligence/codebase-health.js.map +1 -1
- package/dist/intelligence/codemaps.d.ts +30 -1
- package/dist/intelligence/codemaps.d.ts.map +1 -1
- package/dist/intelligence/codemaps.js +99 -16
- package/dist/intelligence/codemaps.js.map +1 -1
- package/dist/intelligence/consecutive-error-counter.d.ts +89 -0
- package/dist/intelligence/consecutive-error-counter.d.ts.map +1 -0
- package/dist/intelligence/consecutive-error-counter.js +151 -0
- package/dist/intelligence/consecutive-error-counter.js.map +1 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.d.ts +87 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.d.ts.map +1 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.js +882 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.js.map +1 -0
- package/dist/intelligence/extractors/mineru.d.ts +108 -0
- package/dist/intelligence/extractors/mineru.d.ts.map +1 -0
- package/dist/intelligence/extractors/mineru.js +352 -0
- package/dist/intelligence/extractors/mineru.js.map +1 -0
- package/dist/intelligence/harness-introspect.d.ts +124 -0
- package/dist/intelligence/harness-introspect.d.ts.map +1 -0
- package/dist/intelligence/harness-introspect.js +349 -0
- package/dist/intelligence/harness-introspect.js.map +1 -0
- package/dist/intelligence/multi-patch-voter.d.ts +59 -1
- package/dist/intelligence/multi-patch-voter.d.ts.map +1 -1
- package/dist/intelligence/multi-patch-voter.js +191 -27
- package/dist/intelligence/multi-patch-voter.js.map +1 -1
- package/dist/intelligence/multimodal-extract.d.ts +44 -0
- package/dist/intelligence/multimodal-extract.d.ts.map +1 -1
- package/dist/intelligence/multimodal-extract.js +40 -1
- package/dist/intelligence/multimodal-extract.js.map +1 -1
- package/dist/intelligence/research-loops/budgeted-research.d.ts +7 -0
- package/dist/intelligence/research-loops/budgeted-research.d.ts.map +1 -1
- package/dist/intelligence/research-loops/budgeted-research.js +18 -0
- package/dist/intelligence/research-loops/budgeted-research.js.map +1 -1
- package/dist/intelligence/research-loops/constraint-guided-explorer.d.ts +124 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.d.ts.map +1 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.js +177 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.js.map +1 -0
- package/dist/intelligence/research-loops/results-collector.d.ts +62 -0
- package/dist/intelligence/research-loops/results-collector.d.ts.map +1 -0
- package/dist/intelligence/research-loops/results-collector.js +128 -0
- package/dist/intelligence/research-loops/results-collector.js.map +1 -0
- package/dist/intelligence/research-loops/results-log.d.ts +94 -0
- package/dist/intelligence/research-loops/results-log.d.ts.map +1 -0
- package/dist/intelligence/research-loops/results-log.js +178 -0
- package/dist/intelligence/research-loops/results-log.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.d.ts +111 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.js +72 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.d.ts +57 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.js +172 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.d.ts +68 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.js +221 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.d.ts +42 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.js +132 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.d.ts +55 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.js +187 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.js.map +1 -0
- package/dist/intelligence/research-loops/strategy-registry.d.ts +43 -0
- package/dist/intelligence/research-loops/strategy-registry.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategy-registry.js +62 -0
- package/dist/intelligence/research-loops/strategy-registry.js.map +1 -0
- package/dist/intelligence/research-strategies.d.ts +133 -0
- package/dist/intelligence/research-strategies.d.ts.map +1 -0
- package/dist/intelligence/research-strategies.js +204 -0
- package/dist/intelligence/research-strategies.js.map +1 -0
- package/dist/lib.d.ts +49 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +133 -0
- package/dist/lib.js.map +1 -1
- package/dist/loop/tool-description-reset.d.ts +113 -0
- package/dist/loop/tool-description-reset.d.ts.map +1 -0
- package/dist/loop/tool-description-reset.js +136 -0
- package/dist/loop/tool-description-reset.js.map +1 -0
- package/dist/lsp/server-registry.d.ts.map +1 -1
- package/dist/lsp/server-registry.js +2 -1
- package/dist/lsp/server-registry.js.map +1 -1
- package/dist/lsp/symbol-operations.d.ts.map +1 -1
- package/dist/lsp/symbol-operations.js +2 -1
- package/dist/lsp/symbol-operations.js.map +1 -1
- package/dist/marketplace/acp-agent-registry.d.ts.map +1 -1
- package/dist/marketplace/acp-agent-registry.js +2 -1
- package/dist/marketplace/acp-agent-registry.js.map +1 -1
- package/dist/marketplace/marketplace-source-git.d.ts +135 -0
- package/dist/marketplace/marketplace-source-git.d.ts.map +1 -0
- package/dist/marketplace/marketplace-source-git.js +211 -0
- package/dist/marketplace/marketplace-source-git.js.map +1 -0
- package/dist/marketplace/registry.d.ts +87 -0
- package/dist/marketplace/registry.d.ts.map +1 -1
- package/dist/marketplace/registry.js +113 -2
- package/dist/marketplace/registry.js.map +1 -1
- package/dist/mcp/chrome-devtools.d.ts +62 -2
- package/dist/mcp/chrome-devtools.d.ts.map +1 -1
- package/dist/mcp/chrome-devtools.js +183 -1
- package/dist/mcp/chrome-devtools.js.map +1 -1
- package/dist/mcp/health-probe.d.ts +1 -0
- package/dist/mcp/health-probe.d.ts.map +1 -1
- package/dist/mcp/health-probe.js +32 -1
- package/dist/mcp/health-probe.js.map +1 -1
- package/dist/mcp/mcp-scaffolder.d.ts +166 -0
- package/dist/mcp/mcp-scaffolder.d.ts.map +1 -0
- package/dist/mcp/mcp-scaffolder.js +526 -0
- package/dist/mcp/mcp-scaffolder.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -1
- package/dist/mcp/mcp-server.js +55 -0
- package/dist/mcp/mcp-server.js.map +1 -1
- package/dist/mcp/memory-mcp.d.ts +163 -0
- package/dist/mcp/memory-mcp.d.ts.map +1 -0
- package/dist/mcp/memory-mcp.js +368 -0
- package/dist/mcp/memory-mcp.js.map +1 -0
- package/dist/mcp/tool-loader.d.ts.map +1 -1
- package/dist/mcp/tool-loader.js +13 -0
- package/dist/mcp/tool-loader.js.map +1 -1
- package/dist/meet/meeting-runtime.d.ts.map +1 -1
- package/dist/meet/meeting-runtime.js +3 -1
- package/dist/meet/meeting-runtime.js.map +1 -1
- package/dist/memory/incremental-indexer.d.ts.map +1 -1
- package/dist/memory/incremental-indexer.js +5 -1
- package/dist/memory/incremental-indexer.js.map +1 -1
- package/dist/memory/qmd-integration.d.ts.map +1 -1
- package/dist/memory/qmd-integration.js +47 -15
- package/dist/memory/qmd-integration.js.map +1 -1
- package/dist/memory/two-phase-consolidator.d.ts +118 -0
- package/dist/memory/two-phase-consolidator.d.ts.map +1 -0
- package/dist/memory/two-phase-consolidator.js +265 -0
- package/dist/memory/two-phase-consolidator.js.map +1 -0
- package/dist/middleware/doom-loop.d.ts +21 -0
- package/dist/middleware/doom-loop.d.ts.map +1 -1
- package/dist/middleware/doom-loop.js +49 -6
- package/dist/middleware/doom-loop.js.map +1 -1
- package/dist/middleware/loop-detection.d.ts +176 -6
- package/dist/middleware/loop-detection.d.ts.map +1 -1
- package/dist/middleware/loop-detection.js +341 -6
- package/dist/middleware/loop-detection.js.map +1 -1
- package/dist/middleware/pipeline.d.ts +9 -1
- package/dist/middleware/pipeline.d.ts.map +1 -1
- package/dist/middleware/pipeline.js +116 -1
- package/dist/middleware/pipeline.js.map +1 -1
- package/dist/middleware/tool-flow-gate.d.ts +20 -0
- package/dist/middleware/tool-flow-gate.d.ts.map +1 -1
- package/dist/middleware/tool-flow-gate.js +93 -0
- package/dist/middleware/tool-flow-gate.js.map +1 -1
- package/dist/mobile/ios-app.d.ts +18 -1
- package/dist/mobile/ios-app.d.ts.map +1 -1
- package/dist/mobile/ios-app.js +108 -8
- package/dist/mobile/ios-app.js.map +1 -1
- package/dist/orchestration/adversarial-cut.d.ts +85 -0
- package/dist/orchestration/adversarial-cut.d.ts.map +1 -0
- package/dist/orchestration/adversarial-cut.js +222 -0
- package/dist/orchestration/adversarial-cut.js.map +1 -0
- package/dist/orchestration/agent-kanban.d.ts +147 -0
- package/dist/orchestration/agent-kanban.d.ts.map +1 -0
- package/dist/orchestration/agent-kanban.js +414 -0
- package/dist/orchestration/agent-kanban.js.map +1 -0
- package/dist/orchestration/autonomous.d.ts +111 -0
- package/dist/orchestration/autonomous.d.ts.map +1 -1
- package/dist/orchestration/autonomous.js +183 -6
- package/dist/orchestration/autonomous.js.map +1 -1
- package/dist/orchestration/elo-tournament.d.ts +90 -0
- package/dist/orchestration/elo-tournament.d.ts.map +1 -0
- package/dist/orchestration/elo-tournament.js +203 -0
- package/dist/orchestration/elo-tournament.js.map +1 -0
- package/dist/orchestration/multi-model-arena.d.ts +138 -0
- package/dist/orchestration/multi-model-arena.d.ts.map +1 -0
- package/dist/orchestration/multi-model-arena.js +298 -0
- package/dist/orchestration/multi-model-arena.js.map +1 -0
- package/dist/orchestration/review-pipeline.d.ts +78 -0
- package/dist/orchestration/review-pipeline.d.ts.map +1 -0
- package/dist/orchestration/review-pipeline.js +202 -0
- package/dist/orchestration/review-pipeline.js.map +1 -0
- package/dist/orchestration/unified-state-thread.d.ts +186 -0
- package/dist/orchestration/unified-state-thread.d.ts.map +1 -0
- package/dist/orchestration/unified-state-thread.js +327 -0
- package/dist/orchestration/unified-state-thread.js.map +1 -0
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +2 -1
- package/dist/plugins/manager.js.map +1 -1
- package/dist/prompt/engine.d.ts +7 -0
- package/dist/prompt/engine.d.ts.map +1 -1
- package/dist/prompt/engine.js.map +1 -1
- package/dist/prompt/modules/caveman.d.ts +51 -0
- package/dist/prompt/modules/caveman.d.ts.map +1 -0
- package/dist/prompt/modules/caveman.js +97 -0
- package/dist/prompt/modules/caveman.js.map +1 -0
- package/dist/prompt/modules/index.d.ts +1 -0
- package/dist/prompt/modules/index.d.ts.map +1 -1
- package/dist/prompt/modules/index.js +3 -0
- package/dist/prompt/modules/index.js.map +1 -1
- package/dist/providers/account-pool.d.ts.map +1 -1
- package/dist/providers/account-pool.js +1 -0
- package/dist/providers/account-pool.js.map +1 -1
- package/dist/providers/anthropic-adapter.d.ts.map +1 -1
- package/dist/providers/anthropic-adapter.js +33 -0
- package/dist/providers/anthropic-adapter.js.map +1 -1
- package/dist/providers/cloud-offload/config-loader.d.ts +20 -0
- package/dist/providers/cloud-offload/config-loader.d.ts.map +1 -0
- package/dist/providers/cloud-offload/config-loader.js +148 -0
- package/dist/providers/cloud-offload/config-loader.js.map +1 -0
- package/dist/providers/codex-adapter.d.ts.map +1 -1
- package/dist/providers/codex-adapter.js +136 -4
- package/dist/providers/codex-adapter.js.map +1 -1
- package/dist/providers/discovery.d.ts.map +1 -1
- package/dist/providers/discovery.js +20 -0
- package/dist/providers/discovery.js.map +1 -1
- package/dist/providers/effort-cascade.d.ts +113 -0
- package/dist/providers/effort-cascade.d.ts.map +1 -0
- package/dist/providers/effort-cascade.js +215 -0
- package/dist/providers/effort-cascade.js.map +1 -0
- package/dist/providers/fallback-chain.d.ts.map +1 -1
- package/dist/providers/fallback-chain.js +1 -0
- package/dist/providers/fallback-chain.js.map +1 -1
- package/dist/providers/health-check.d.ts.map +1 -1
- package/dist/providers/health-check.js +8 -0
- package/dist/providers/health-check.js.map +1 -1
- package/dist/providers/model-defaults.d.ts +1 -1
- package/dist/providers/model-defaults.d.ts.map +1 -1
- package/dist/providers/model-defaults.js +13 -1
- package/dist/providers/model-defaults.js.map +1 -1
- package/dist/providers/model-discovery.d.ts.map +1 -1
- package/dist/providers/model-discovery.js +1 -0
- package/dist/providers/model-discovery.js.map +1 -1
- package/dist/providers/ollama-adapter.d.ts.map +1 -1
- package/dist/providers/ollama-adapter.js +21 -1
- package/dist/providers/ollama-adapter.js.map +1 -1
- package/dist/providers/openai-compat-adapter.d.ts.map +1 -1
- package/dist/providers/openai-compat-adapter.js +25 -0
- package/dist/providers/openai-compat-adapter.js.map +1 -1
- package/dist/providers/preset-library.d.ts.map +1 -1
- package/dist/providers/preset-library.js +9 -0
- package/dist/providers/preset-library.js.map +1 -1
- package/dist/providers/provider-service.d.ts.map +1 -1
- package/dist/providers/provider-service.js +40 -1
- package/dist/providers/provider-service.js.map +1 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +7 -0
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/sticky-rotation.d.ts +100 -0
- package/dist/providers/sticky-rotation.d.ts.map +1 -0
- package/dist/providers/sticky-rotation.js +134 -0
- package/dist/providers/sticky-rotation.js.map +1 -0
- package/dist/providers/tool-parsers/parsers.d.ts.map +1 -1
- package/dist/providers/tool-parsers/parsers.js +17 -4
- package/dist/providers/tool-parsers/parsers.js.map +1 -1
- package/dist/providers/types.d.ts +25 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/recipes/final-output.d.ts +74 -0
- package/dist/recipes/final-output.d.ts.map +1 -0
- package/dist/recipes/final-output.js +232 -0
- package/dist/recipes/final-output.js.map +1 -0
- package/dist/recipes/recipe-loader.d.ts.map +1 -1
- package/dist/recipes/recipe-loader.js +29 -0
- package/dist/recipes/recipe-loader.js.map +1 -1
- package/dist/recipes/recipe-runtime.d.ts.map +1 -1
- package/dist/recipes/recipe-runtime.js +31 -0
- package/dist/recipes/recipe-runtime.js.map +1 -1
- package/dist/recipes/recipe-types.d.ts +28 -0
- package/dist/recipes/recipe-types.d.ts.map +1 -1
- package/dist/recipes/sop-crystallizer.d.ts +90 -0
- package/dist/recipes/sop-crystallizer.d.ts.map +1 -0
- package/dist/recipes/sop-crystallizer.js +238 -0
- package/dist/recipes/sop-crystallizer.js.map +1 -0
- package/dist/recipes/sub-recipe-orchestrator.d.ts +126 -0
- package/dist/recipes/sub-recipe-orchestrator.d.ts.map +1 -0
- package/dist/recipes/sub-recipe-orchestrator.js +225 -0
- package/dist/recipes/sub-recipe-orchestrator.js.map +1 -0
- package/dist/sandbox/extended-backends.d.ts.map +1 -1
- package/dist/sandbox/extended-backends.js +7 -2
- package/dist/sandbox/extended-backends.js.map +1 -1
- package/dist/sandbox/seatbelt-policy.d.ts +132 -0
- package/dist/sandbox/seatbelt-policy.d.ts.map +1 -0
- package/dist/sandbox/seatbelt-policy.js +562 -0
- package/dist/sandbox/seatbelt-policy.js.map +1 -0
- package/dist/sandbox/terminal-backends.d.ts.map +1 -1
- package/dist/sandbox/terminal-backends.js +3 -1
- package/dist/sandbox/terminal-backends.js.map +1 -1
- package/dist/security/auto-mode-ruleset.d.ts +142 -0
- package/dist/security/auto-mode-ruleset.d.ts.map +1 -0
- package/dist/security/auto-mode-ruleset.js +264 -0
- package/dist/security/auto-mode-ruleset.js.map +1 -0
- package/dist/security/bash-arity-policy.d.ts +70 -0
- package/dist/security/bash-arity-policy.d.ts.map +1 -0
- package/dist/security/bash-arity-policy.js +189 -0
- package/dist/security/bash-arity-policy.js.map +1 -0
- package/dist/security/command-sanitizer.d.ts.map +1 -1
- package/dist/security/command-sanitizer.js +24 -0
- package/dist/security/command-sanitizer.js.map +1 -1
- package/dist/security/credential-broker.d.ts +136 -0
- package/dist/security/credential-broker.d.ts.map +1 -0
- package/dist/security/credential-broker.js +284 -0
- package/dist/security/credential-broker.js.map +1 -0
- package/dist/security/invisible-text-sanitizer.d.ts +114 -0
- package/dist/security/invisible-text-sanitizer.d.ts.map +1 -0
- package/dist/security/invisible-text-sanitizer.js +221 -0
- package/dist/security/invisible-text-sanitizer.js.map +1 -0
- package/dist/security/osv-check.d.ts +174 -0
- package/dist/security/osv-check.d.ts.map +1 -0
- package/dist/security/osv-check.js +409 -0
- package/dist/security/osv-check.js.map +1 -0
- package/dist/security/process-hardening.d.ts +114 -0
- package/dist/security/process-hardening.d.ts.map +1 -0
- package/dist/security/process-hardening.js +132 -0
- package/dist/security/process-hardening.js.map +1 -0
- package/dist/security/shell-escalation-tiers.d.ts +73 -0
- package/dist/security/shell-escalation-tiers.d.ts.map +1 -0
- package/dist/security/shell-escalation-tiers.js +439 -0
- package/dist/security/shell-escalation-tiers.js.map +1 -0
- package/dist/session/fork.d.ts +100 -0
- package/dist/session/fork.d.ts.map +1 -0
- package/dist/session/fork.js +223 -0
- package/dist/session/fork.js.map +1 -0
- package/dist/skills/activation-telemetry.d.ts +154 -0
- package/dist/skills/activation-telemetry.d.ts.map +1 -0
- package/dist/skills/activation-telemetry.js +274 -0
- package/dist/skills/activation-telemetry.js.map +1 -0
- package/dist/skills/agentskills-registry.d.ts +12 -1
- package/dist/skills/agentskills-registry.d.ts.map +1 -1
- package/dist/skills/agentskills-registry.js +11 -0
- package/dist/skills/agentskills-registry.js.map +1 -1
- package/dist/skills/description-optimizer.d.ts +101 -0
- package/dist/skills/description-optimizer.d.ts.map +1 -0
- package/dist/skills/description-optimizer.js +304 -0
- package/dist/skills/description-optimizer.js.map +1 -0
- package/dist/skills/history-deduper.d.ts +109 -0
- package/dist/skills/history-deduper.d.ts.map +1 -0
- package/dist/skills/history-deduper.js +222 -0
- package/dist/skills/history-deduper.js.map +1 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +2 -1
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/skill-source-adapter.d.ts +16 -0
- package/dist/skills/skill-source-adapter.d.ts.map +1 -1
- package/dist/skills/skill-source-adapter.js +0 -0
- package/dist/skills/skill-source-adapter.js.map +1 -1
- package/dist/skills/skill-standard.d.ts +29 -4
- package/dist/skills/skill-standard.d.ts.map +1 -1
- package/dist/skills/skill-standard.js +139 -66
- package/dist/skills/skill-standard.js.map +1 -1
- package/dist/skills/sop-completion-gate.d.ts +137 -0
- package/dist/skills/sop-completion-gate.d.ts.map +1 -0
- package/dist/skills/sop-completion-gate.js +159 -0
- package/dist/skills/sop-completion-gate.js.map +1 -0
- package/dist/skills/sop-template.d.ts +85 -0
- package/dist/skills/sop-template.d.ts.map +1 -0
- package/dist/skills/sop-template.js +106 -0
- package/dist/skills/sop-template.js.map +1 -0
- package/dist/skills/wotann-skills-registry.d.ts +1 -1
- package/dist/skills/wotann-skills-registry.d.ts.map +1 -1
- package/dist/skills/wotann-skills-registry.js +503 -0
- package/dist/skills/wotann-skills-registry.js.map +1 -1
- package/dist/snippets/prompt-corpus.d.ts +10 -0
- package/dist/snippets/prompt-corpus.d.ts.map +1 -0
- package/dist/snippets/prompt-corpus.js +158 -0
- package/dist/snippets/prompt-corpus.js.map +1 -0
- package/dist/snippets/snippet-store.d.ts +27 -0
- package/dist/snippets/snippet-store.d.ts.map +1 -1
- package/dist/snippets/snippet-store.js +109 -6
- package/dist/snippets/snippet-store.js.map +1 -1
- package/dist/storage/sqlite-node-backend.d.ts +47 -36
- package/dist/storage/sqlite-node-backend.d.ts.map +1 -1
- package/dist/storage/sqlite-node-backend.js +250 -94
- package/dist/storage/sqlite-node-backend.js.map +1 -1
- package/dist/testing/webapp-server-lifecycle.d.ts +74 -0
- package/dist/testing/webapp-server-lifecycle.d.ts.map +1 -0
- package/dist/testing/webapp-server-lifecycle.js +272 -0
- package/dist/testing/webapp-server-lifecycle.js.map +1 -0
- package/dist/tools/markitdown-bridge.d.ts +19 -0
- package/dist/tools/markitdown-bridge.d.ts.map +1 -1
- package/dist/tools/markitdown-bridge.js +167 -2
- package/dist/tools/markitdown-bridge.js.map +1 -1
- package/dist/tools/pdf-processor.d.ts.map +1 -1
- package/dist/tools/pdf-processor.js +7 -3
- package/dist/tools/pdf-processor.js.map +1 -1
- package/dist/tools/pptx-processor.d.ts +51 -0
- package/dist/tools/pptx-processor.d.ts.map +1 -0
- package/dist/tools/pptx-processor.js +334 -0
- package/dist/tools/pptx-processor.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +1661 -149
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/agent-tools.d.ts +60 -0
- package/dist/ui/agent-tools.d.ts.map +1 -0
- package/dist/ui/agent-tools.js +468 -0
- package/dist/ui/agent-tools.js.map +1 -0
- package/dist/ui/alt-buffer-mode.d.ts +68 -0
- package/dist/ui/alt-buffer-mode.d.ts.map +1 -0
- package/dist/ui/alt-buffer-mode.js +114 -0
- package/dist/ui/alt-buffer-mode.js.map +1 -0
- package/dist/ui/alt-buffer.d.ts +57 -10
- package/dist/ui/alt-buffer.d.ts.map +1 -1
- package/dist/ui/alt-buffer.js +54 -12
- package/dist/ui/alt-buffer.js.map +1 -1
- package/dist/ui/components/AgentStatusPanel.d.ts.map +1 -1
- package/dist/ui/components/AgentStatusPanel.js +14 -6
- package/dist/ui/components/AgentStatusPanel.js.map +1 -1
- package/dist/ui/components/AuditLogPanel.js +3 -3
- package/dist/ui/components/AuditLogPanel.js.map +1 -1
- package/dist/ui/components/AutomationsPanel.js +3 -3
- package/dist/ui/components/AutomationsPanel.js.map +1 -1
- package/dist/ui/components/ChatView.d.ts +9 -1
- package/dist/ui/components/ChatView.d.ts.map +1 -1
- package/dist/ui/components/ChatView.js +503 -14
- package/dist/ui/components/ChatView.js.map +1 -1
- package/dist/ui/components/CommandPaletteCommands.d.ts +2 -0
- package/dist/ui/components/CommandPaletteCommands.d.ts.map +1 -1
- package/dist/ui/components/CommandPaletteCommands.js +18 -2
- package/dist/ui/components/CommandPaletteCommands.js.map +1 -1
- package/dist/ui/components/ContextHUD.d.ts.map +1 -1
- package/dist/ui/components/ContextHUD.js +3 -3
- package/dist/ui/components/ContextHUD.js.map +1 -1
- package/dist/ui/components/DispatchInbox.js +3 -3
- package/dist/ui/components/DispatchInbox.js.map +1 -1
- package/dist/ui/components/GdprPanel.d.ts.map +1 -1
- package/dist/ui/components/GdprPanel.js +2 -3
- package/dist/ui/components/GdprPanel.js.map +1 -1
- package/dist/ui/components/HistoryPicker.js +3 -3
- package/dist/ui/components/HistoryPicker.js.map +1 -1
- package/dist/ui/components/ModelPicker.d.ts +9 -6
- package/dist/ui/components/ModelPicker.d.ts.map +1 -1
- package/dist/ui/components/ModelPicker.js +12 -9
- package/dist/ui/components/ModelPicker.js.map +1 -1
- package/dist/ui/components/OptionPicker.js +3 -3
- package/dist/ui/components/OptionPicker.js.map +1 -1
- package/dist/ui/components/PermissionPrompt.js +3 -3
- package/dist/ui/components/PermissionPrompt.js.map +1 -1
- package/dist/ui/components/PromptInput.d.ts.map +1 -1
- package/dist/ui/components/PromptInput.js +65 -10
- package/dist/ui/components/PromptInput.js.map +1 -1
- package/dist/ui/components/ProviderSetupOverlay.d.ts +19 -0
- package/dist/ui/components/ProviderSetupOverlay.d.ts.map +1 -0
- package/dist/ui/components/ProviderSetupOverlay.js +124 -0
- package/dist/ui/components/ProviderSetupOverlay.js.map +1 -0
- package/dist/ui/components/StartupScreen.d.ts.map +1 -1
- package/dist/ui/components/StartupScreen.js +10 -1
- package/dist/ui/components/StartupScreen.js.map +1 -1
- package/dist/ui/components/StatusBar.d.ts.map +1 -1
- package/dist/ui/components/StatusBar.js +3 -3
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/TrustPanel.js +3 -3
- package/dist/ui/components/TrustPanel.js.map +1 -1
- package/dist/ui/components/UnifiedStatusBar.d.ts.map +1 -1
- package/dist/ui/components/UnifiedStatusBar.js +76 -5
- package/dist/ui/components/UnifiedStatusBar.js.map +1 -1
- package/dist/ui/computer-action-parser.d.ts +6 -0
- package/dist/ui/computer-action-parser.d.ts.map +1 -0
- package/dist/ui/computer-action-parser.js +119 -0
- package/dist/ui/computer-action-parser.js.map +1 -0
- package/dist/ui/helpers.d.ts +1 -1
- package/dist/ui/helpers.d.ts.map +1 -1
- package/dist/ui/helpers.js +1 -1
- package/dist/ui/helpers.js.map +1 -1
- package/dist/ui/keybindings.d.ts +12 -2
- package/dist/ui/keybindings.d.ts.map +1 -1
- package/dist/ui/keybindings.js +36 -4
- package/dist/ui/keybindings.js.map +1 -1
- package/dist/ui/markdown-stream.d.ts +99 -0
- package/dist/ui/markdown-stream.d.ts.map +1 -0
- package/dist/ui/markdown-stream.js +314 -0
- package/dist/ui/markdown-stream.js.map +1 -0
- package/dist/ui/terminal-keyboard-protocol.d.ts +23 -0
- package/dist/ui/terminal-keyboard-protocol.d.ts.map +1 -0
- package/dist/ui/terminal-keyboard-protocol.js +72 -0
- package/dist/ui/terminal-keyboard-protocol.js.map +1 -0
- package/dist/ui/theme/context.d.ts +39 -0
- package/dist/ui/theme/context.d.ts.map +1 -0
- package/dist/ui/theme/context.js +42 -0
- package/dist/ui/theme/context.js.map +1 -0
- package/dist/utils/platform.d.ts +115 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +146 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/verification/auto-verify-policy.d.ts +107 -0
- package/dist/verification/auto-verify-policy.d.ts.map +1 -0
- package/dist/verification/auto-verify-policy.js +309 -0
- package/dist/verification/auto-verify-policy.js.map +1 -0
- package/package.json +4 -1
- package/skills/anthropic-finance/audit-spreadsheet.md +165 -0
- package/skills/anthropic-finance/clean-data-xls.md +59 -0
- package/skills/anthropic-finance/competitive-analysis.md +288 -0
- package/skills/anthropic-finance/compliance-rules-engine.md +56 -0
- package/skills/anthropic-finance/dd-checklist.md +126 -0
- package/skills/anthropic-finance/independent-recompute.md +47 -0
- package/skills/anthropic-finance/reconcile-root-cause.md +48 -0
- package/skills/anthropic-finance/roll-forward.md +42 -0
- package/skills/anthropic-finance/untrusted-doc-parse.md +57 -0
- package/skills/anthropic-finance/variance-commentary.md +43 -0
- package/skills/doubt-driven-development.md +95 -0
- package/skills/mattpocock/diagnose.md +126 -0
- package/skills/mattpocock/grill-with-docs.md +97 -0
- package/skills/mattpocock/improve-codebase-architecture.md +80 -0
- package/skills/mattpocock/prototype.md +39 -0
- package/skills/mattpocock/review.md +87 -0
- package/skills/mattpocock/tdd.md +118 -0
- package/skills/mattpocock/zoom-out.md +17 -0
- package/skills/scientific/citation-management/SKILL.md +1113 -0
- package/skills/scientific/citation-management/assets/bibtex_template.bib +264 -0
- package/skills/scientific/citation-management/assets/citation_checklist.md +386 -0
- package/skills/scientific/citation-management/references/bibtex_formatting.md +908 -0
- package/skills/scientific/citation-management/references/citation_validation.md +794 -0
- package/skills/scientific/citation-management/references/google_scholar_search.md +725 -0
- package/skills/scientific/citation-management/references/metadata_extraction.md +870 -0
- package/skills/scientific/citation-management/references/pubmed_search.md +839 -0
- package/skills/scientific/citation-management/scripts/doi_to_bibtex.py +204 -0
- package/skills/scientific/citation-management/scripts/extract_metadata.py +569 -0
- package/skills/scientific/citation-management/scripts/format_bibtex.py +349 -0
- package/skills/scientific/citation-management/scripts/generate_schematic.py +139 -0
- package/skills/scientific/citation-management/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/citation-management/scripts/search_google_scholar.py +282 -0
- package/skills/scientific/citation-management/scripts/search_pubmed.py +398 -0
- package/skills/scientific/citation-management/scripts/validate_citations.py +497 -0
- package/skills/scientific/database-lookup/SKILL.md +480 -0
- package/skills/scientific/database-lookup/references/addgene.md +38 -0
- package/skills/scientific/database-lookup/references/alphafold.md +40 -0
- package/skills/scientific/database-lookup/references/alphavantage.md +261 -0
- package/skills/scientific/database-lookup/references/bea.md +409 -0
- package/skills/scientific/database-lookup/references/bindingdb.md +85 -0
- package/skills/scientific/database-lookup/references/biogrid.md +110 -0
- package/skills/scientific/database-lookup/references/bls.md +235 -0
- package/skills/scientific/database-lookup/references/brenda.md +71 -0
- package/skills/scientific/database-lookup/references/cbioportal.md +206 -0
- package/skills/scientific/database-lookup/references/census.md +251 -0
- package/skills/scientific/database-lookup/references/chebi.md +103 -0
- package/skills/scientific/database-lookup/references/chembl.md +80 -0
- package/skills/scientific/database-lookup/references/clinicaltrials.md +77 -0
- package/skills/scientific/database-lookup/references/clinpgx.md +64 -0
- package/skills/scientific/database-lookup/references/clinvar.md +91 -0
- package/skills/scientific/database-lookup/references/cod.md +121 -0
- package/skills/scientific/database-lookup/references/cosmic.md +59 -0
- package/skills/scientific/database-lookup/references/dailymed.md +65 -0
- package/skills/scientific/database-lookup/references/datacommons.md +237 -0
- package/skills/scientific/database-lookup/references/dbsnp.md +143 -0
- package/skills/scientific/database-lookup/references/disgenet.md +52 -0
- package/skills/scientific/database-lookup/references/drugbank.md +54 -0
- package/skills/scientific/database-lookup/references/ecb.md +191 -0
- package/skills/scientific/database-lookup/references/emdb.md +37 -0
- package/skills/scientific/database-lookup/references/ena.md +372 -0
- package/skills/scientific/database-lookup/references/encode.md +47 -0
- package/skills/scientific/database-lookup/references/ensembl.md +539 -0
- package/skills/scientific/database-lookup/references/epa.md +232 -0
- package/skills/scientific/database-lookup/references/eurostat.md +237 -0
- package/skills/scientific/database-lookup/references/fda.md +64 -0
- package/skills/scientific/database-lookup/references/federal-reserve.md +216 -0
- package/skills/scientific/database-lookup/references/fred.md +297 -0
- package/skills/scientific/database-lookup/references/gene-ontology.md +147 -0
- package/skills/scientific/database-lookup/references/geo.md +130 -0
- package/skills/scientific/database-lookup/references/gnomad.md +93 -0
- package/skills/scientific/database-lookup/references/gtex.md +136 -0
- package/skills/scientific/database-lookup/references/gwas-catalog.md +46 -0
- package/skills/scientific/database-lookup/references/hca.md +35 -0
- package/skills/scientific/database-lookup/references/hpo.md +48 -0
- package/skills/scientific/database-lookup/references/human-protein-atlas.md +57 -0
- package/skills/scientific/database-lookup/references/interpro.md +120 -0
- package/skills/scientific/database-lookup/references/jaspar.md +50 -0
- package/skills/scientific/database-lookup/references/kegg.md +78 -0
- package/skills/scientific/database-lookup/references/lincs-l1000.md +68 -0
- package/skills/scientific/database-lookup/references/materials-project.md +123 -0
- package/skills/scientific/database-lookup/references/metabolomics-workbench.md +98 -0
- package/skills/scientific/database-lookup/references/monarch.md +46 -0
- package/skills/scientific/database-lookup/references/mousemine.md +40 -0
- package/skills/scientific/database-lookup/references/nasa-exoplanet-archive.md +112 -0
- package/skills/scientific/database-lookup/references/nasa.md +121 -0
- package/skills/scientific/database-lookup/references/ncbi-gene.md +64 -0
- package/skills/scientific/database-lookup/references/ncbi-protein.md +104 -0
- package/skills/scientific/database-lookup/references/ncbi-taxonomy.md +121 -0
- package/skills/scientific/database-lookup/references/nist.md +105 -0
- package/skills/scientific/database-lookup/references/noaa.md +199 -0
- package/skills/scientific/database-lookup/references/omim.md +114 -0
- package/skills/scientific/database-lookup/references/opentargets.md +459 -0
- package/skills/scientific/database-lookup/references/openweathermap.md +255 -0
- package/skills/scientific/database-lookup/references/pdb.md +121 -0
- package/skills/scientific/database-lookup/references/pride.md +74 -0
- package/skills/scientific/database-lookup/references/pubchem.md +145 -0
- package/skills/scientific/database-lookup/references/quickgo.md +45 -0
- package/skills/scientific/database-lookup/references/reactome.md +140 -0
- package/skills/scientific/database-lookup/references/rummageo.md +32 -0
- package/skills/scientific/database-lookup/references/sdss.md +130 -0
- package/skills/scientific/database-lookup/references/sec-edgar.md +315 -0
- package/skills/scientific/database-lookup/references/simbad.md +131 -0
- package/skills/scientific/database-lookup/references/sra.md +149 -0
- package/skills/scientific/database-lookup/references/string.md +283 -0
- package/skills/scientific/database-lookup/references/tcga-gdc.md +58 -0
- package/skills/scientific/database-lookup/references/treasury.md +215 -0
- package/skills/scientific/database-lookup/references/ucsc-genome.md +135 -0
- package/skills/scientific/database-lookup/references/uniprot.md +283 -0
- package/skills/scientific/database-lookup/references/usgs.md +260 -0
- package/skills/scientific/database-lookup/references/uspto.md +130 -0
- package/skills/scientific/database-lookup/references/who.md +283 -0
- package/skills/scientific/database-lookup/references/worldbank.md +239 -0
- package/skills/scientific/database-lookup/references/zinc.md +202 -0
- package/skills/scientific/hypothesis-generation/SKILL.md +297 -0
- package/skills/scientific/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/skills/scientific/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/skills/scientific/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/skills/scientific/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/skills/scientific/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/skills/scientific/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/skills/scientific/hypothesis-generation/scripts/generate_schematic.py +139 -0
- package/skills/scientific/hypothesis-generation/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/literature-review/SKILL.md +699 -0
- package/skills/scientific/literature-review/assets/review_template.md +412 -0
- package/skills/scientific/literature-review/references/citation_styles.md +166 -0
- package/skills/scientific/literature-review/references/database_strategies.md +455 -0
- package/skills/scientific/literature-review/scripts/generate_pdf.py +176 -0
- package/skills/scientific/literature-review/scripts/generate_schematic.py +139 -0
- package/skills/scientific/literature-review/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/literature-review/scripts/search_databases.py +303 -0
- package/skills/scientific/literature-review/scripts/verify_citations.py +222 -0
- package/skills/scientific/markdown-mermaid-writing/SKILL.md +327 -0
- package/skills/scientific/markdown-mermaid-writing/assets/examples/example-research-report.md +221 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/architecture.md +108 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/block.md +177 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/c4.md +136 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/class.md +246 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/complex_examples.md +384 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/er.md +222 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/flowchart.md +177 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/gantt.md +138 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/git_graph.md +74 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/kanban.md +107 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/mindmap.md +74 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/packet.md +55 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/pie.md +52 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/quadrant.md +66 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/radar.md +59 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/requirement.md +88 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/sankey.md +71 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/sequence.md +174 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/state.md +150 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/timeline.md +96 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/treemap.md +66 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/user_journey.md +108 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/xy_chart.md +53 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/zenuml.md +71 -0
- package/skills/scientific/markdown-mermaid-writing/references/markdown_style_guide.md +733 -0
- package/skills/scientific/markdown-mermaid-writing/references/mermaid_style_guide.md +458 -0
- package/skills/scientific/markdown-mermaid-writing/templates/decision_record.md +211 -0
- package/skills/scientific/markdown-mermaid-writing/templates/how_to_guide.md +275 -0
- package/skills/scientific/markdown-mermaid-writing/templates/issue.md +303 -0
- package/skills/scientific/markdown-mermaid-writing/templates/kanban.md +223 -0
- package/skills/scientific/markdown-mermaid-writing/templates/presentation.md +312 -0
- package/skills/scientific/markdown-mermaid-writing/templates/project_documentation.md +412 -0
- package/skills/scientific/markdown-mermaid-writing/templates/pull_request.md +319 -0
- package/skills/scientific/markdown-mermaid-writing/templates/research_paper.md +304 -0
- package/skills/scientific/markdown-mermaid-writing/templates/status_report.md +185 -0
- package/skills/scientific/paper-lookup/SKILL.md +193 -0
- package/skills/scientific/paper-lookup/references/arxiv.md +161 -0
- package/skills/scientific/paper-lookup/references/biorxiv.md +118 -0
- package/skills/scientific/paper-lookup/references/core.md +150 -0
- package/skills/scientific/paper-lookup/references/crossref.md +181 -0
- package/skills/scientific/paper-lookup/references/medrxiv.md +104 -0
- package/skills/scientific/paper-lookup/references/openalex.md +174 -0
- package/skills/scientific/paper-lookup/references/pmc.md +152 -0
- package/skills/scientific/paper-lookup/references/pubmed.md +124 -0
- package/skills/scientific/paper-lookup/references/semantic-scholar.md +203 -0
- package/skills/scientific/paper-lookup/references/unpaywall.md +127 -0
- package/skills/scientific/peer-review/SKILL.md +569 -0
- package/skills/scientific/peer-review/references/common_issues.md +552 -0
- package/skills/scientific/peer-review/references/reporting_standards.md +290 -0
- package/skills/scientific/peer-review/scripts/generate_schematic.py +139 -0
- package/skills/scientific/peer-review/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/scholar-evaluation/SKILL.md +298 -0
- package/skills/scientific/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/skills/scientific/scholar-evaluation/scripts/calculate_scores.py +378 -0
- package/skills/scientific/scholar-evaluation/scripts/generate_schematic.py +139 -0
- package/skills/scientific/scholar-evaluation/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/scientific-brainstorming/SKILL.md +189 -0
- package/skills/scientific/scientific-brainstorming/references/brainstorming_methods.md +326 -0
- package/skills/scientific/scientific-critical-thinking/SKILL.md +570 -0
- package/skills/scientific/scientific-critical-thinking/references/common_biases.md +364 -0
- package/skills/scientific/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/skills/scientific/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/skills/scientific/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/skills/scientific/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/skills/scientific/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/skills/scientific/scientific-critical-thinking/scripts/generate_schematic.py +139 -0
- package/skills/scientific/scientific-critical-thinking/scripts/generate_schematic_ai.py +817 -0
- package/skills/wotann-imports/incremental-implementation.md +241 -0
- package/skills/wotann-imports/security-threat-model.md +81 -0
- package/skills/wotann-imports/triage.md +103 -0
- package/dist/build/deploy-targets/coolify.d.ts +0 -148
- package/dist/build/deploy-targets/coolify.d.ts.map +0 -1
- package/dist/build/deploy-targets/coolify.js +0 -339
- package/dist/build/deploy-targets/coolify.js.map +0 -1
- package/dist/build/deploy-targets/dokploy.d.ts +0 -139
- package/dist/build/deploy-targets/dokploy.d.ts.map +0 -1
- package/dist/build/deploy-targets/dokploy.js +0 -339
- package/dist/build/deploy-targets/dokploy.js.map +0 -1
- package/dist/claude/hardening/error-handler.d.ts +0 -52
- package/dist/claude/hardening/error-handler.d.ts.map +0 -1
- package/dist/claude/hardening/error-handler.js +0 -158
- package/dist/claude/hardening/error-handler.js.map +0 -1
- package/dist/cli/onboarding.d.ts +0 -34
- package/dist/cli/onboarding.d.ts.map +0 -1
- package/dist/cli/onboarding.js +0 -150
- package/dist/cli/onboarding.js.map +0 -1
- package/dist/core/agent-profiles.d.ts +0 -65
- package/dist/core/agent-profiles.d.ts.map +0 -1
- package/dist/core/agent-profiles.js +0 -137
- package/dist/core/agent-profiles.js.map +0 -1
- package/dist/desktop/supabase-relay.d.ts +0 -86
- package/dist/desktop/supabase-relay.d.ts.map +0 -1
- package/dist/desktop/supabase-relay.js +0 -335
- package/dist/desktop/supabase-relay.js.map +0 -1
- package/dist/intelligence/kg-builder.d.ts +0 -181
- package/dist/intelligence/kg-builder.d.ts.map +0 -1
- package/dist/intelligence/kg-builder.js +0 -807
- package/dist/intelligence/kg-builder.js.map +0 -1
- package/dist/orchestration/jean-orchestrator.d.ts +0 -79
- package/dist/orchestration/jean-orchestrator.d.ts.map +0 -1
- package/dist/orchestration/jean-orchestrator.js +0 -253
- package/dist/orchestration/jean-orchestrator.js.map +0 -1
- package/dist/orchestration/jean-registries/command-registry.d.ts +0 -85
- package/dist/orchestration/jean-registries/command-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/command-registry.js +0 -120
- package/dist/orchestration/jean-registries/command-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/event-registry.d.ts +0 -80
- package/dist/orchestration/jean-registries/event-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/event-registry.js +0 -147
- package/dist/orchestration/jean-registries/event-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/process-registry.d.ts +0 -71
- package/dist/orchestration/jean-registries/process-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/process-registry.js +0 -104
- package/dist/orchestration/jean-registries/process-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/result-registry.d.ts +0 -71
- package/dist/orchestration/jean-registries/result-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/result-registry.js +0 -97
- package/dist/orchestration/jean-registries/result-registry.js.map +0 -1
- package/dist/providers/bedrock-signer.d.ts +0 -23
- package/dist/providers/bedrock-signer.d.ts.map +0 -1
- package/dist/providers/bedrock-signer.js +0 -439
- package/dist/providers/bedrock-signer.js.map +0 -1
- package/dist/providers/harness-profiles.d.ts +0 -70
- package/dist/providers/harness-profiles.d.ts.map +0 -1
- package/dist/providers/harness-profiles.js +0 -210
- package/dist/providers/harness-profiles.js.map +0 -1
- package/dist/providers/vertex-oauth.d.ts +0 -21
- package/dist/providers/vertex-oauth.d.ts.map +0 -1
- package/dist/providers/vertex-oauth.js +0 -393
- package/dist/providers/vertex-oauth.js.map +0 -1
- package/dist/sandbox/backends/cloud-auth.d.ts +0 -50
- package/dist/sandbox/backends/cloud-auth.d.ts.map +0 -1
- package/dist/sandbox/backends/cloud-auth.js +0 -93
- package/dist/sandbox/backends/cloud-auth.js.map +0 -1
- package/dist/security/anti-distillation.d.ts +0 -46
- package/dist/security/anti-distillation.d.ts.map +0 -1
- package/dist/security/anti-distillation.js +0 -358
- package/dist/security/anti-distillation.js.map +0 -1
- package/dist/security/multi-encoding-decoder.d.ts +0 -47
- package/dist/security/multi-encoding-decoder.d.ts.map +0 -1
- package/dist/security/multi-encoding-decoder.js +0 -336
- package/dist/security/multi-encoding-decoder.js.map +0 -1
- package/dist/ui/accessibility.d.ts +0 -157
- package/dist/ui/accessibility.d.ts.map +0 -1
- package/dist/ui/accessibility.js +0 -232
- package/dist/ui/accessibility.js.map +0 -1
- package/dist/ui/animations.d.ts +0 -102
- package/dist/ui/animations.d.ts.map +0 -1
- package/dist/ui/animations.js +0 -277
- package/dist/ui/animations.js.map +0 -1
- package/dist/ui/components/Sparkline.d.ts +0 -81
- package/dist/ui/components/Sparkline.d.ts.map +0 -1
- package/dist/ui/components/Sparkline.js +0 -102
- package/dist/ui/components/Sparkline.js.map +0 -1
- package/dist/ui/input/mouse.d.ts +0 -139
- package/dist/ui/input/mouse.d.ts.map +0 -1
- package/dist/ui/input/mouse.js +0 -239
- package/dist/ui/input/mouse.js.map +0 -1
- package/dist/ui/sound.d.ts +0 -85
- package/dist/ui/sound.d.ts.map +0 -1
- package/dist/ui/sound.js +0 -126
- package/dist/ui/sound.js.map +0 -1
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mcp-scaffolder.ts — Cline-style "add-a-tool" self-extending MCP server
|
|
3
|
+
* scaffolder.
|
|
4
|
+
*
|
|
5
|
+
* Pattern (https://cline.bot/blog): given a high-level tool description
|
|
6
|
+
* (server name, transport, list of tools with input schemas + handler
|
|
7
|
+
* stubs), produce a complete, runnable MCP server scaffold the user can
|
|
8
|
+
* drop into their workspace and `npm install && npm run build && npm
|
|
9
|
+
* start` against.
|
|
10
|
+
*
|
|
11
|
+
* The module is split into three pure surfaces:
|
|
12
|
+
*
|
|
13
|
+
* 1. `validateScaffoldRequest(req)` — totals up every structural error
|
|
14
|
+
* (bad name, empty tools, duplicate tool names, bad transport,
|
|
15
|
+
* missing http port, bad param specs) and returns a tagged result.
|
|
16
|
+
* Never throws.
|
|
17
|
+
*
|
|
18
|
+
* 2. `scaffoldMcpServer(req)` — pure file-array generator. Validates
|
|
19
|
+
* first; if invalid, returns `{ ok:false, errors }`. If valid,
|
|
20
|
+
* returns a frozen array of frozen `ScaffoldFiles` (path + content)
|
|
21
|
+
* covering server.ts, package.json, tsconfig.json, README.md, and a
|
|
22
|
+
* vitest smoke test.
|
|
23
|
+
*
|
|
24
|
+
* 3. `writeScaffold(result, rootDir, fs?)` — writes the file array to
|
|
25
|
+
* disk via an injectable `ScaffoldFs` shim. Defaults to
|
|
26
|
+
* `node:fs/promises`. Tests use `createInMemoryScaffoldFs()` to
|
|
27
|
+
* avoid touching the real filesystem.
|
|
28
|
+
*
|
|
29
|
+
* Quality bars enforced:
|
|
30
|
+
* - QB#1 (immutable): every input/output type uses `readonly`; the
|
|
31
|
+
* returned `files` array and each `ScaffoldFiles` object are
|
|
32
|
+
* `Object.freeze`d. No in-place mutation across the boundary.
|
|
33
|
+
* - QB#3 (honest): every public function returns a tagged
|
|
34
|
+
* `{ ok:true, ... } | { ok:false, errors|error }` union; nothing
|
|
35
|
+
* throws across the public boundary. Disk write failures are
|
|
36
|
+
* reported, not propagated.
|
|
37
|
+
* - QB#7 (stateless): the module holds no global state. The fs shim
|
|
38
|
+
* is threaded per call, mirroring `memory-mcp.ts`.
|
|
39
|
+
* - QB#11 (sibling-site): re-uses the `MCP_PROTOCOL_VERSION` constant
|
|
40
|
+
* advertised by `mcp-server.ts` and the `@modelcontextprotocol/sdk`
|
|
41
|
+
* peer dep already in the workspace, so generated servers default
|
|
42
|
+
* to the same protocol version WOTANN itself speaks.
|
|
43
|
+
* - QB#19 (zombie-free): every public export is exercised by at least
|
|
44
|
+
* one test in `tests/mcp/mcp-scaffolder.test.ts`.
|
|
45
|
+
*/
|
|
46
|
+
import { MCP_PROTOCOL_VERSION } from "./mcp-server.js";
|
|
47
|
+
// ── Constants ─────────────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Server-name regex. Matches npm package convention — lowercase letters,
|
|
50
|
+
* digits, hyphens — but excludes scoped names because the scaffolded
|
|
51
|
+
* package.json doesn't claim a scope. Length capped at 64 to avoid
|
|
52
|
+
* filesystem-path edge cases on Windows long-path setups.
|
|
53
|
+
*/
|
|
54
|
+
const SERVER_NAME_RE = /^[a-z][a-z0-9-]{0,63}$/;
|
|
55
|
+
/**
|
|
56
|
+
* Tool-name regex. MCP tool names should be safe to embed in JSON,
|
|
57
|
+
* shell, and TypeScript source — restricting to identifier-ish chars
|
|
58
|
+
* keeps the generated `case "tool_name":` switch trivially valid.
|
|
59
|
+
*/
|
|
60
|
+
const TOOL_NAME_RE = /^[a-zA-Z_][a-zA-Z0-9_-]{0,63}$/;
|
|
61
|
+
/**
|
|
62
|
+
* Pinned dep versions for the generated package.json. Matched to the
|
|
63
|
+
* same SDK + tooling versions WOTANN itself uses so user-generated
|
|
64
|
+
* servers don't drift away from the host's MCP protocol version
|
|
65
|
+
* (QB#11). Bumping these here propagates to every newly-generated
|
|
66
|
+
* scaffold without requiring callers to specify versions.
|
|
67
|
+
*/
|
|
68
|
+
const SCAFFOLD_DEPS = Object.freeze({
|
|
69
|
+
sdk: "^1.0.4",
|
|
70
|
+
typescript: "^5.6.0",
|
|
71
|
+
vitest: "^2.1.0",
|
|
72
|
+
tsx: "^4.19.0",
|
|
73
|
+
nodeTypes: "^20.0.0",
|
|
74
|
+
});
|
|
75
|
+
// ── Validation ────────────────────────────────────────────────────────────
|
|
76
|
+
/**
|
|
77
|
+
* Pure validator. Collects every error (does not short-circuit on the
|
|
78
|
+
* first failure) so callers can surface them all in one round. QB#3:
|
|
79
|
+
* never throws; always returns a tagged result.
|
|
80
|
+
*/
|
|
81
|
+
export function validateScaffoldRequest(req) {
|
|
82
|
+
const errors = [];
|
|
83
|
+
// Server name
|
|
84
|
+
if (typeof req.name !== "string" || !SERVER_NAME_RE.test(req.name)) {
|
|
85
|
+
errors.push(`name must match ${SERVER_NAME_RE.toString()} (lowercase, hyphenated, starts with a letter)`);
|
|
86
|
+
}
|
|
87
|
+
// Description
|
|
88
|
+
if (typeof req.description !== "string" || req.description.trim() === "") {
|
|
89
|
+
errors.push("description must be a non-empty string");
|
|
90
|
+
}
|
|
91
|
+
// Transport
|
|
92
|
+
if (req.transport !== "stdio" && req.transport !== "http") {
|
|
93
|
+
errors.push(`transport must be "stdio" or "http", got ${JSON.stringify(req.transport)}`);
|
|
94
|
+
}
|
|
95
|
+
if (req.transport === "http") {
|
|
96
|
+
if (typeof req.httpPort !== "number" ||
|
|
97
|
+
!Number.isInteger(req.httpPort) ||
|
|
98
|
+
req.httpPort < 1 ||
|
|
99
|
+
req.httpPort > 65535) {
|
|
100
|
+
errors.push('httpPort must be an integer between 1 and 65535 when transport is "http"');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Tools
|
|
104
|
+
if (!Array.isArray(req.tools) || req.tools.length === 0) {
|
|
105
|
+
errors.push("tools must be a non-empty array");
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const seenNames = new Set();
|
|
109
|
+
req.tools.forEach((tool, idx) => {
|
|
110
|
+
const tag = `tools[${idx}]`;
|
|
111
|
+
if (!tool || typeof tool !== "object") {
|
|
112
|
+
errors.push(`${tag} must be an object`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (typeof tool.name !== "string" || !TOOL_NAME_RE.test(tool.name)) {
|
|
116
|
+
errors.push(`${tag}.name must match ${TOOL_NAME_RE.toString()} (identifier-like, max 64 chars)`);
|
|
117
|
+
}
|
|
118
|
+
else if (seenNames.has(tool.name)) {
|
|
119
|
+
errors.push(`${tag}.name "${tool.name}" duplicates an earlier tool`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
seenNames.add(tool.name);
|
|
123
|
+
}
|
|
124
|
+
if (typeof tool.description !== "string" || tool.description.trim() === "") {
|
|
125
|
+
errors.push(`${tag}.description must be a non-empty string`);
|
|
126
|
+
}
|
|
127
|
+
if (typeof tool.handlerStub !== "string" || tool.handlerStub.trim() === "") {
|
|
128
|
+
errors.push(`${tag}.handlerStub must be a non-empty string`);
|
|
129
|
+
}
|
|
130
|
+
if (!tool.inputSchema || typeof tool.inputSchema !== "object") {
|
|
131
|
+
errors.push(`${tag}.inputSchema must be an object`);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const entries = Object.entries(tool.inputSchema);
|
|
135
|
+
for (const [paramName, raw] of entries) {
|
|
136
|
+
const ptag = `${tag}.inputSchema["${paramName}"]`;
|
|
137
|
+
if (!raw || typeof raw !== "object") {
|
|
138
|
+
errors.push(`${ptag} must be an object`);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const spec = raw;
|
|
142
|
+
const validTypes = ["string", "number", "boolean", "array", "object"];
|
|
143
|
+
if (typeof spec.type !== "string" || !validTypes.includes(spec.type)) {
|
|
144
|
+
errors.push(`${ptag}.type must be one of ${validTypes.join("|")}, got ${JSON.stringify(spec.type)}`);
|
|
145
|
+
}
|
|
146
|
+
if (typeof spec.required !== "boolean") {
|
|
147
|
+
errors.push(`${ptag}.required must be a boolean`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return errors.length === 0
|
|
154
|
+
? Object.freeze({ ok: true })
|
|
155
|
+
: Object.freeze({ ok: false, errors: Object.freeze(errors.slice()) });
|
|
156
|
+
}
|
|
157
|
+
// ── Scaffolding (pure) ────────────────────────────────────────────────────
|
|
158
|
+
/**
|
|
159
|
+
* Top-level scaffold entry. Validates first; if the request is bad,
|
|
160
|
+
* returns a tagged failure (QB#3). On success returns a frozen array
|
|
161
|
+
* of frozen file objects (QB#1).
|
|
162
|
+
*/
|
|
163
|
+
export function scaffoldMcpServer(req) {
|
|
164
|
+
const v = validateScaffoldRequest(req);
|
|
165
|
+
if (!v.ok) {
|
|
166
|
+
return Object.freeze({ ok: false, errors: v.errors });
|
|
167
|
+
}
|
|
168
|
+
const files = [
|
|
169
|
+
file("src/server.ts", renderServerTs(req)),
|
|
170
|
+
file("package.json", renderPackageJson(req)),
|
|
171
|
+
file("tsconfig.json", renderTsconfigJson()),
|
|
172
|
+
file("README.md", renderReadme(req)),
|
|
173
|
+
file("test/server.test.ts", renderSmokeTest(req)),
|
|
174
|
+
];
|
|
175
|
+
return Object.freeze({
|
|
176
|
+
ok: true,
|
|
177
|
+
files: Object.freeze(files.slice()),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/** Tiny helper — frozen `ScaffoldFiles` constructor. */
|
|
181
|
+
function file(path, content) {
|
|
182
|
+
return Object.freeze({ path, content });
|
|
183
|
+
}
|
|
184
|
+
// ── Renderers ─────────────────────────────────────────────────────────────
|
|
185
|
+
/**
|
|
186
|
+
* Convert a `ToolDef.inputSchema` (our typed map) to a JSON-Schema
|
|
187
|
+
* `properties` object plus a `required` array. Returns the literal
|
|
188
|
+
* source string we paste into the tool registration block — keeping
|
|
189
|
+
* this as a string (rather than a JS literal) lets the generated file
|
|
190
|
+
* stay readable instead of being one giant object expression.
|
|
191
|
+
*/
|
|
192
|
+
function renderInputSchema(schema) {
|
|
193
|
+
const properties = {};
|
|
194
|
+
const required = [];
|
|
195
|
+
for (const [name, spec] of Object.entries(schema)) {
|
|
196
|
+
const prop = { type: spec.type };
|
|
197
|
+
if (spec.description)
|
|
198
|
+
prop.description = spec.description;
|
|
199
|
+
properties[name] = prop;
|
|
200
|
+
if (spec.required)
|
|
201
|
+
required.push(name);
|
|
202
|
+
}
|
|
203
|
+
const out = { type: "object", properties, ...(required.length > 0 ? { required } : {}) };
|
|
204
|
+
return JSON.stringify(out, null, 2);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Generate the main `src/server.ts` file. Branches on transport:
|
|
208
|
+
* stdio uses `StdioServerTransport`, http uses
|
|
209
|
+
* `StreamableHTTPServerTransport`. Both register every tool with the
|
|
210
|
+
* pasted `handlerStub` as the body.
|
|
211
|
+
*/
|
|
212
|
+
function renderServerTs(req) {
|
|
213
|
+
const isHttp = req.transport === "http";
|
|
214
|
+
const port = req.httpPort ?? 3000;
|
|
215
|
+
const toolsBlock = req.tools
|
|
216
|
+
.map((tool) => {
|
|
217
|
+
const schemaSrc = indent(renderInputSchema(tool.inputSchema), " ");
|
|
218
|
+
const stub = indent(tool.handlerStub.trim(), " ");
|
|
219
|
+
return ` server.registerTool(
|
|
220
|
+
${JSON.stringify(tool.name)},
|
|
221
|
+
{
|
|
222
|
+
description: ${JSON.stringify(tool.description)},
|
|
223
|
+
inputSchema: ${schemaSrc},
|
|
224
|
+
},
|
|
225
|
+
async (args) => {
|
|
226
|
+
${stub}
|
|
227
|
+
},
|
|
228
|
+
);`;
|
|
229
|
+
})
|
|
230
|
+
.join("\n\n");
|
|
231
|
+
const transportImport = isHttp
|
|
232
|
+
? 'import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";\nimport { createServer } from "node:http";'
|
|
233
|
+
: 'import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";';
|
|
234
|
+
const transportWire = isHttp
|
|
235
|
+
? ` const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
|
|
236
|
+
await server.connect(transport);
|
|
237
|
+
const httpServer = createServer((req, res) => {
|
|
238
|
+
transport.handleRequest(req, res).catch((err) => {
|
|
239
|
+
res.statusCode = 500;
|
|
240
|
+
res.end(String(err));
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
httpServer.listen(${port}, () => {
|
|
244
|
+
// eslint-disable-next-line no-console
|
|
245
|
+
console.error(${JSON.stringify(`${req.name} listening on http://localhost:${port}`)});
|
|
246
|
+
});`
|
|
247
|
+
: ` const transport = new StdioServerTransport();
|
|
248
|
+
await server.connect(transport);
|
|
249
|
+
// eslint-disable-next-line no-console
|
|
250
|
+
console.error(${JSON.stringify(`${req.name} ready on stdio`)});`;
|
|
251
|
+
return `/**
|
|
252
|
+
* ${req.name} — ${req.description}
|
|
253
|
+
*
|
|
254
|
+
* Generated by WOTANN's mcp-scaffolder. Edit the handler bodies to
|
|
255
|
+
* implement each tool, then \`npm install && npm run build && npm start\`.
|
|
256
|
+
*
|
|
257
|
+
* MCP protocol version: ${MCP_PROTOCOL_VERSION}
|
|
258
|
+
*/
|
|
259
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
260
|
+
${transportImport}
|
|
261
|
+
|
|
262
|
+
export async function main(): Promise<void> {
|
|
263
|
+
const server = new McpServer({
|
|
264
|
+
name: ${JSON.stringify(req.name)},
|
|
265
|
+
version: "0.1.0",
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
${toolsBlock}
|
|
269
|
+
|
|
270
|
+
${transportWire}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
main().catch((err) => {
|
|
274
|
+
// eslint-disable-next-line no-console
|
|
275
|
+
console.error(err);
|
|
276
|
+
process.exit(1);
|
|
277
|
+
});
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Render `package.json`. The dep set is tracked in `SCAFFOLD_DEPS`;
|
|
282
|
+
* scripts target the standard tsx/tsc/vitest trio so the scaffold
|
|
283
|
+
* matches the host project's tooling (QB#11).
|
|
284
|
+
*/
|
|
285
|
+
function renderPackageJson(req) {
|
|
286
|
+
const pkg = {
|
|
287
|
+
name: req.name,
|
|
288
|
+
version: "0.1.0",
|
|
289
|
+
description: req.description,
|
|
290
|
+
type: "module",
|
|
291
|
+
main: "dist/server.js",
|
|
292
|
+
bin: { [req.name]: "dist/server.js" },
|
|
293
|
+
scripts: {
|
|
294
|
+
build: "tsc",
|
|
295
|
+
start: "node dist/server.js",
|
|
296
|
+
dev: "tsx src/server.ts",
|
|
297
|
+
test: "vitest run",
|
|
298
|
+
typecheck: "tsc --noEmit",
|
|
299
|
+
},
|
|
300
|
+
dependencies: {
|
|
301
|
+
"@modelcontextprotocol/sdk": SCAFFOLD_DEPS.sdk,
|
|
302
|
+
},
|
|
303
|
+
devDependencies: {
|
|
304
|
+
"@types/node": SCAFFOLD_DEPS.nodeTypes,
|
|
305
|
+
tsx: SCAFFOLD_DEPS.tsx,
|
|
306
|
+
typescript: SCAFFOLD_DEPS.typescript,
|
|
307
|
+
vitest: SCAFFOLD_DEPS.vitest,
|
|
308
|
+
},
|
|
309
|
+
engines: { node: ">=20" },
|
|
310
|
+
};
|
|
311
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Pinned tsconfig matching the host project's settings as closely as
|
|
315
|
+
* possible — strict mode, ES2022 target, Node16 module resolution,
|
|
316
|
+
* declaration files emitted. Keeps generated servers consistent with
|
|
317
|
+
* the rest of the WOTANN ecosystem.
|
|
318
|
+
*/
|
|
319
|
+
function renderTsconfigJson() {
|
|
320
|
+
const cfg = {
|
|
321
|
+
compilerOptions: {
|
|
322
|
+
target: "ES2022",
|
|
323
|
+
module: "Node16",
|
|
324
|
+
moduleResolution: "Node16",
|
|
325
|
+
lib: ["ES2022"],
|
|
326
|
+
outDir: "dist",
|
|
327
|
+
rootDir: "src",
|
|
328
|
+
strict: true,
|
|
329
|
+
noUncheckedIndexedAccess: true,
|
|
330
|
+
esModuleInterop: true,
|
|
331
|
+
skipLibCheck: true,
|
|
332
|
+
forceConsistentCasingInFileNames: true,
|
|
333
|
+
resolveJsonModule: true,
|
|
334
|
+
declaration: true,
|
|
335
|
+
sourceMap: true,
|
|
336
|
+
types: ["node"],
|
|
337
|
+
},
|
|
338
|
+
include: ["src/**/*"],
|
|
339
|
+
exclude: ["node_modules", "dist", "test"],
|
|
340
|
+
};
|
|
341
|
+
return JSON.stringify(cfg, null, 2) + "\n";
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Render the README. Lists every generated tool plus a copy-paste
|
|
345
|
+
* install/run snippet matching the transport.
|
|
346
|
+
*/
|
|
347
|
+
function renderReadme(req) {
|
|
348
|
+
const toolList = req.tools
|
|
349
|
+
.map((tool) => {
|
|
350
|
+
const params = Object.entries(tool.inputSchema)
|
|
351
|
+
.map(([name, spec]) => ` - \`${name}\` (${spec.type}${spec.required ? ", required" : ""})${spec.description ? ` — ${spec.description}` : ""}`)
|
|
352
|
+
.join("\n");
|
|
353
|
+
return `### \`${tool.name}\`\n\n${tool.description}\n\n**Parameters:**\n${params || " (none)"}\n`;
|
|
354
|
+
})
|
|
355
|
+
.join("\n");
|
|
356
|
+
const runSection = req.transport === "http"
|
|
357
|
+
? `Runs as an HTTP MCP server on port \`${req.httpPort ?? 3000}\`. Point your MCP client at \`http://localhost:${req.httpPort ?? 3000}\`.`
|
|
358
|
+
: "Runs as a stdio MCP server. Configure your MCP client to launch `npm start` and pipe stdio.";
|
|
359
|
+
return `# ${req.name}
|
|
360
|
+
|
|
361
|
+
${req.description}
|
|
362
|
+
|
|
363
|
+
> Generated by WOTANN's mcp-scaffolder. Edit the handler bodies in
|
|
364
|
+
> \`src/server.ts\` to wire each tool to its real implementation, then
|
|
365
|
+
> rebuild.
|
|
366
|
+
|
|
367
|
+
## Install
|
|
368
|
+
|
|
369
|
+
\`\`\`bash
|
|
370
|
+
npm install
|
|
371
|
+
npm run build
|
|
372
|
+
npm start
|
|
373
|
+
\`\`\`
|
|
374
|
+
|
|
375
|
+
## Run
|
|
376
|
+
|
|
377
|
+
${runSection}
|
|
378
|
+
|
|
379
|
+
## Iterate
|
|
380
|
+
|
|
381
|
+
1. Open \`src/server.ts\` and replace each \`TODO\` handler body with
|
|
382
|
+
real logic.
|
|
383
|
+
2. Run \`npm test\` to keep the smoke test green as you go.
|
|
384
|
+
3. Run \`npm run typecheck\` before committing.
|
|
385
|
+
|
|
386
|
+
## Tools
|
|
387
|
+
|
|
388
|
+
${toolList}
|
|
389
|
+
|
|
390
|
+
## Protocol
|
|
391
|
+
|
|
392
|
+
MCP protocol version \`${MCP_PROTOCOL_VERSION}\` via \`@modelcontextprotocol/sdk\`.
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Render a minimal vitest smoke test. The test imports `main()` and
|
|
397
|
+
* asserts the module loads without throwing — enough to catch syntax
|
|
398
|
+
* errors and missing imports introduced when the user fills in handler
|
|
399
|
+
* bodies. Real per-tool tests are the user's job.
|
|
400
|
+
*/
|
|
401
|
+
function renderSmokeTest(req) {
|
|
402
|
+
const toolNames = req.tools.map((t) => JSON.stringify(t.name)).join(", ");
|
|
403
|
+
return `import { describe, expect, it } from "vitest";
|
|
404
|
+
|
|
405
|
+
describe("${req.name} smoke", () => {
|
|
406
|
+
it("module loads", async () => {
|
|
407
|
+
// Imports the server module; throws if syntax is broken or a dep
|
|
408
|
+
// is missing. We do NOT call main() because that would try to
|
|
409
|
+
// attach to stdio/http for real.
|
|
410
|
+
const mod = await import("../src/server.ts");
|
|
411
|
+
expect(typeof mod.main).toBe("function");
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
it("declares the expected tools", () => {
|
|
415
|
+
const declared = [${toolNames}];
|
|
416
|
+
expect(declared.length).toBe(${req.tools.length});
|
|
417
|
+
for (const name of declared) {
|
|
418
|
+
expect(typeof name).toBe("string");
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
`;
|
|
423
|
+
}
|
|
424
|
+
/** Indent every line of `body` by `prefix`. Used to nest schema + stub. */
|
|
425
|
+
function indent(body, prefix) {
|
|
426
|
+
return body
|
|
427
|
+
.split("\n")
|
|
428
|
+
.map((line) => (line.length === 0 ? line : prefix + line))
|
|
429
|
+
.join("\n");
|
|
430
|
+
}
|
|
431
|
+
// ── Filesystem ────────────────────────────────────────────────────────────
|
|
432
|
+
/**
|
|
433
|
+
* Build an in-memory `ScaffoldFs` shim. Tests use this; production
|
|
434
|
+
* callers use `createNodeScaffoldFs()` (real disk).
|
|
435
|
+
*/
|
|
436
|
+
export function createInMemoryScaffoldFs() {
|
|
437
|
+
const files = new Map();
|
|
438
|
+
const shim = {
|
|
439
|
+
files,
|
|
440
|
+
async writeFile(path, content) {
|
|
441
|
+
files.set(path, content);
|
|
442
|
+
},
|
|
443
|
+
async mkdirRecursive(_path) {
|
|
444
|
+
// No-op: the map has no notion of directories.
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
return Object.freeze(shim);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Build a `ScaffoldFs` backed by `node:fs/promises`. Lazy-imported so
|
|
451
|
+
* the in-memory shim path doesn't pull `node:fs` into pure tests.
|
|
452
|
+
*/
|
|
453
|
+
export async function createNodeScaffoldFs() {
|
|
454
|
+
const fsp = await import("node:fs/promises");
|
|
455
|
+
const shim = {
|
|
456
|
+
async writeFile(path, content) {
|
|
457
|
+
await fsp.writeFile(path, content, "utf8");
|
|
458
|
+
},
|
|
459
|
+
async mkdirRecursive(path) {
|
|
460
|
+
await fsp.mkdir(path, { recursive: true });
|
|
461
|
+
},
|
|
462
|
+
};
|
|
463
|
+
return Object.freeze(shim);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Write a `ScaffoldResult` to disk under `rootDir`. Each file's
|
|
467
|
+
* directory is created via `mkdirRecursive` before its `writeFile`
|
|
468
|
+
* call. Returns the list of paths actually written, or a tagged error
|
|
469
|
+
* (QB#3). If the input result is a failure, that failure is forwarded
|
|
470
|
+
* verbatim so callers can chain `scaffoldMcpServer(...) -> writeScaffold`.
|
|
471
|
+
*/
|
|
472
|
+
export async function writeScaffold(result, rootDir, fs) {
|
|
473
|
+
if (!result.ok) {
|
|
474
|
+
return Object.freeze({
|
|
475
|
+
ok: false,
|
|
476
|
+
error: `cannot write: scaffold failed validation (${result.errors.join("; ")})`,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
if (typeof rootDir !== "string" || rootDir.trim() === "") {
|
|
480
|
+
return Object.freeze({ ok: false, error: "rootDir must be a non-empty string" });
|
|
481
|
+
}
|
|
482
|
+
const realFs = fs ?? (await createNodeScaffoldFs());
|
|
483
|
+
const written = [];
|
|
484
|
+
try {
|
|
485
|
+
for (const f of result.files) {
|
|
486
|
+
const fullPath = joinPath(rootDir, f.path);
|
|
487
|
+
const dir = dirname(fullPath);
|
|
488
|
+
await realFs.mkdirRecursive(dir);
|
|
489
|
+
await realFs.writeFile(fullPath, f.content);
|
|
490
|
+
written.push(fullPath);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
catch (err) {
|
|
494
|
+
return Object.freeze({
|
|
495
|
+
ok: false,
|
|
496
|
+
error: `write failed after ${written.length}/${result.files.length} file(s): ${stringifyError(err)}`,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
return Object.freeze({ ok: true, paths: Object.freeze(written.slice()) });
|
|
500
|
+
}
|
|
501
|
+
// ── Tiny path helpers ─────────────────────────────────────────────────────
|
|
502
|
+
// Local re-implementations so the module stays node-independent until
|
|
503
|
+
// `writeScaffold` actually needs the disk. Mirrors what `node:path` does
|
|
504
|
+
// for forward-slash POSIX joins, which is all we ever generate.
|
|
505
|
+
function joinPath(root, rel) {
|
|
506
|
+
const r = root.endsWith("/") ? root.slice(0, -1) : root;
|
|
507
|
+
const child = rel.startsWith("/") ? rel.slice(1) : rel;
|
|
508
|
+
return `${r}/${child}`;
|
|
509
|
+
}
|
|
510
|
+
function dirname(path) {
|
|
511
|
+
const idx = path.lastIndexOf("/");
|
|
512
|
+
if (idx <= 0)
|
|
513
|
+
return path === "/" ? "/" : ".";
|
|
514
|
+
return path.slice(0, idx);
|
|
515
|
+
}
|
|
516
|
+
function stringifyError(err) {
|
|
517
|
+
if (err instanceof Error)
|
|
518
|
+
return err.message;
|
|
519
|
+
try {
|
|
520
|
+
return JSON.stringify(err);
|
|
521
|
+
}
|
|
522
|
+
catch {
|
|
523
|
+
return String(err);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
//# sourceMappingURL=mcp-scaffolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-scaffolder.js","sourceRoot":"","sources":["../../src/mcp/mcp-scaffolder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAyFvD,6EAA6E;AAE7E;;;;;GAKG;AACH,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,QAAQ;IACb,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,SAAS;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,6EAA6E;AAE7E;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAwB;IAC9D,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,cAAc;IACd,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,C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OAAO,CAEtB;CACF;AAID;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChG;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,eAAe,CAyBlF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAKjF"}
|
package/dist/mcp/mcp-server.js
CHANGED
|
@@ -385,6 +385,13 @@ export class WotannMcpServer {
|
|
|
385
385
|
this.log("mcp_tool hook error", err);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
const tool = this.adapter.listTools().find((candidate) => candidate.name === p.name);
|
|
389
|
+
if (tool) {
|
|
390
|
+
const schemaError = validateToolArguments(tool, p.arguments ?? {});
|
|
391
|
+
if (schemaError) {
|
|
392
|
+
throw new JsonRpcError(RPC_INVALID_PARAMS, `tools/call: ${schemaError}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
388
395
|
const result = await this.adapter.callTool(p.name, p.arguments ?? {});
|
|
389
396
|
return result;
|
|
390
397
|
}
|
|
@@ -540,4 +547,52 @@ export function makeTextResult(text, isError) {
|
|
|
540
547
|
...(isError !== undefined ? { isError } : {}),
|
|
541
548
|
};
|
|
542
549
|
}
|
|
550
|
+
function validateToolArguments(tool, args) {
|
|
551
|
+
const schema = tool.inputSchema;
|
|
552
|
+
if (schema.type !== "object") {
|
|
553
|
+
return `tool "${tool.name}" declares unsupported input schema type "${schema.type}"`;
|
|
554
|
+
}
|
|
555
|
+
for (const required of schema.required ?? []) {
|
|
556
|
+
if (!(required in args)) {
|
|
557
|
+
return `missing required argument "${required}" for tool "${tool.name}"`;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (schema.additionalProperties === false) {
|
|
561
|
+
const allowed = new Set(Object.keys(schema.properties));
|
|
562
|
+
const extra = Object.keys(args).find((key) => !allowed.has(key));
|
|
563
|
+
if (extra) {
|
|
564
|
+
return `unexpected argument "${extra}" for tool "${tool.name}"`;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
for (const [key, value] of Object.entries(args)) {
|
|
568
|
+
const property = schema.properties[key];
|
|
569
|
+
if (!property?.type)
|
|
570
|
+
continue;
|
|
571
|
+
const acceptedTypes = Array.isArray(property.type) ? property.type : [property.type];
|
|
572
|
+
if (!acceptedTypes.some((type) => matchesJsonSchemaType(value, type))) {
|
|
573
|
+
return `argument "${key}" for tool "${tool.name}" must be ${acceptedTypes.join(" or ")}`;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return null;
|
|
577
|
+
}
|
|
578
|
+
function matchesJsonSchemaType(value, type) {
|
|
579
|
+
switch (type) {
|
|
580
|
+
case "string":
|
|
581
|
+
return typeof value === "string";
|
|
582
|
+
case "number":
|
|
583
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
584
|
+
case "integer":
|
|
585
|
+
return typeof value === "number" && Number.isInteger(value);
|
|
586
|
+
case "boolean":
|
|
587
|
+
return typeof value === "boolean";
|
|
588
|
+
case "object":
|
|
589
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
590
|
+
case "array":
|
|
591
|
+
return Array.isArray(value);
|
|
592
|
+
case "null":
|
|
593
|
+
return value === null;
|
|
594
|
+
default:
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
543
598
|
//# sourceMappingURL=mcp-server.js.map
|