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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This handler routes incoming RPC calls to the WotannRuntime methods.
|
|
9
9
|
*/
|
|
10
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, chmodSync, realpathSync, } from "node:fs";
|
|
10
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, chmodSync, realpathSync, unlinkSync, } from "node:fs";
|
|
11
11
|
import { join, dirname, resolve as resolvePath } from "node:path";
|
|
12
12
|
import { parse as yamlParse, stringify as yamlStringify } from "yaml";
|
|
13
13
|
import { resolveWotannHome, resolveWotannHomeSubdir } from "../utils/wotann-home.js";
|
|
@@ -24,7 +24,17 @@ import { AuditTrail } from "../telemetry/audit-trail.js";
|
|
|
24
24
|
// the route-table-driven `executeDesktopAction(action)` from
|
|
25
25
|
// platform-bindings. Wiring this unblocks the entire F-series RPC
|
|
26
26
|
// surface (iOS → daemon → action → UI feedback).
|
|
27
|
-
import { executeDesktopAction, } from "../computer-use/platform-bindings.js";
|
|
27
|
+
import { executeDesktopAction, takeScreenshot, } from "../computer-use/platform-bindings.js";
|
|
28
|
+
import { buildObservationFrame, executeComputerAction, normalizeComputerAction, } from "../computer-use/driver-contract.js";
|
|
29
|
+
// V9 T1.x — `computer.session.safeStep` routes the same step payload as
|
|
30
|
+
// `computer.session.step` through the safe-execute composer, layering
|
|
31
|
+
// validateAction → confidence-gate → coordinate-scaling → action-replay
|
|
32
|
+
// on top of the existing platform-bindings dispatch. The four sibling
|
|
33
|
+
// modules already exist; this wire turns kairos-rpc.ts from "step → drive
|
|
34
|
+
// the machine + dispatch" into the runtime caller of the safe-execute
|
|
35
|
+
// pipeline so guardrails apply at the daemon RPC boundary.
|
|
36
|
+
import { safeExecute } from "../computer-use/safe-execute.js";
|
|
37
|
+
import { startRecording, } from "../computer-use/action-replay.js";
|
|
28
38
|
import { createECDH, hkdfSync, randomUUID } from "node:crypto";
|
|
29
39
|
import { sanitizeCommand } from "../security/command-sanitizer.js";
|
|
30
40
|
import { VoicePipeline } from "../voice/voice-pipeline.js";
|
|
@@ -49,6 +59,9 @@ import { streamMethodForChunkType } from "../desktop/companion-server.js";
|
|
|
49
59
|
import { registerSandboxHandlers } from "./rpc-handlers/sandbox-rpc.js";
|
|
50
60
|
import { registerOrchestrationHandlers } from "./rpc-handlers/orchestration-rpc.js";
|
|
51
61
|
import { registerIntelligenceHandlers } from "./rpc-handlers/intelligence-rpc.js";
|
|
62
|
+
import { probeMcpServers } from "../mcp/health-probe.js";
|
|
63
|
+
import { parsePromptCorpusText } from "../snippets/prompt-corpus.js";
|
|
64
|
+
import { getMarkitdownCapabilities } from "../tools/markitdown-bridge.js";
|
|
52
65
|
// ── Voice pipeline singleton + streaming bookkeeping ──────
|
|
53
66
|
//
|
|
54
67
|
// Session-5 wiring for `voice.transcribe` and `voice.stream.{start,poll,
|
|
@@ -181,6 +194,127 @@ function serializeEvent(e) {
|
|
|
181
194
|
payload: e.payload,
|
|
182
195
|
};
|
|
183
196
|
}
|
|
197
|
+
// ── safe-execute → desktop translation ────────────────────────
|
|
198
|
+
//
|
|
199
|
+
// `computer.session.safeStep` accepts the AtomicAction shape from
|
|
200
|
+
// action-repertoire (model-friendly: {type:"click", at:{x,y}}). The
|
|
201
|
+
// existing dispatch surface (executeComputerAction → executeDesktopAction)
|
|
202
|
+
// expects the {action:"click", params:{x:"…",y:"…"}} envelope used by the
|
|
203
|
+
// legacy `computer.session.step` handler. This helper bridges the two
|
|
204
|
+
// shapes WITHOUT duplicating the dispatch table — translation is a flat
|
|
205
|
+
// switch and every variant maps onto a normalizeComputerAction-known
|
|
206
|
+
// action name. Returns null when the atomic action has no desktop
|
|
207
|
+
// counterpart (e.g. `zoom` is a perception-side concern, not a dispatch).
|
|
208
|
+
function atomicToDesktopShape(atomic) {
|
|
209
|
+
const type = atomic["type"];
|
|
210
|
+
if (typeof type !== "string")
|
|
211
|
+
return null;
|
|
212
|
+
const stringify = (params) => {
|
|
213
|
+
const out = {};
|
|
214
|
+
for (const [k, v] of Object.entries(params)) {
|
|
215
|
+
if (v === undefined || v === null)
|
|
216
|
+
continue;
|
|
217
|
+
out[k] = String(v);
|
|
218
|
+
}
|
|
219
|
+
return out;
|
|
220
|
+
};
|
|
221
|
+
switch (type) {
|
|
222
|
+
case "click":
|
|
223
|
+
case "double_click":
|
|
224
|
+
case "right_click": {
|
|
225
|
+
const at = atomic["at"];
|
|
226
|
+
const button = type === "right_click" ? "right" : (atomic["button"] ?? "left");
|
|
227
|
+
const clicks = type === "double_click" ? 2 : 1;
|
|
228
|
+
return {
|
|
229
|
+
action: "click",
|
|
230
|
+
params: stringify({ x: at?.x, y: at?.y, button, clicks }),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
case "type": {
|
|
234
|
+
return { action: "type", params: stringify({ text: atomic["text"] }) };
|
|
235
|
+
}
|
|
236
|
+
case "key": {
|
|
237
|
+
const keys = atomic["keys"];
|
|
238
|
+
if (!Array.isArray(keys) || keys.length === 0)
|
|
239
|
+
return null;
|
|
240
|
+
return { action: "key", params: { key: keys.join("+") } };
|
|
241
|
+
}
|
|
242
|
+
case "scroll": {
|
|
243
|
+
const at = atomic["at"];
|
|
244
|
+
return {
|
|
245
|
+
action: "scroll",
|
|
246
|
+
params: stringify({
|
|
247
|
+
x: at?.x,
|
|
248
|
+
y: at?.y,
|
|
249
|
+
direction: atomic["direction"],
|
|
250
|
+
amount: atomic["amount"],
|
|
251
|
+
}),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
case "drag": {
|
|
255
|
+
const path = atomic["path"];
|
|
256
|
+
if (!Array.isArray(path) || path.length < 2)
|
|
257
|
+
return null;
|
|
258
|
+
const start = path[0];
|
|
259
|
+
const end = path[path.length - 1];
|
|
260
|
+
return {
|
|
261
|
+
action: "drag",
|
|
262
|
+
params: stringify({ x: start.x, y: start.y, endX: end.x, endY: end.y }),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
case "mouse_move": {
|
|
266
|
+
const to = atomic["to"];
|
|
267
|
+
return { action: "move", params: stringify({ x: to?.x, y: to?.y }) };
|
|
268
|
+
}
|
|
269
|
+
case "screenshot":
|
|
270
|
+
case "take_screenshot": {
|
|
271
|
+
return { action: "screenshot", params: {} };
|
|
272
|
+
}
|
|
273
|
+
case "wait": {
|
|
274
|
+
return { action: "wait", params: stringify({ ms: atomic["ms"] }) };
|
|
275
|
+
}
|
|
276
|
+
case "cursor_position":
|
|
277
|
+
return { action: "get-active-window", params: {} };
|
|
278
|
+
case "screen_size":
|
|
279
|
+
return { action: "screen-size", params: {} };
|
|
280
|
+
case "zoom":
|
|
281
|
+
// perception-side action — no desktop dispatch counterpart
|
|
282
|
+
return null;
|
|
283
|
+
default:
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const SECRET_ARG_NAME_PATTERN = /(?:token|secret|password|passwd|api[-_]?key|access[-_]?key|private[-_]?key|credential|auth|bearer)/i;
|
|
288
|
+
const SECRET_VALUE_PATTERN = /\b(?:Bearer\s+)[^\s]+|\b(?:sk-[A-Za-z0-9_-]{8,}|gh[pousr]_[A-Za-z0-9_]{8,})\b|(?:api[-_]?key|token|secret|password|passwd|credential|auth)\s*[=:]\s*[^\s,;]+/gi;
|
|
289
|
+
function redactSecretText(value) {
|
|
290
|
+
return value.replace(SECRET_VALUE_PATTERN, (match) => {
|
|
291
|
+
if (/^Bearer\s+/i.test(match))
|
|
292
|
+
return "Bearer [redacted]";
|
|
293
|
+
const separator = match.includes("=") ? "=" : match.includes(":") ? ":" : "";
|
|
294
|
+
if (!separator)
|
|
295
|
+
return "[redacted]";
|
|
296
|
+
const [key] = match.split(separator, 1);
|
|
297
|
+
return `${key}${separator}[redacted]`;
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
function redactMcpArgs(args) {
|
|
301
|
+
let redactNext = false;
|
|
302
|
+
return args.map((arg) => {
|
|
303
|
+
if (redactNext) {
|
|
304
|
+
redactNext = false;
|
|
305
|
+
return "[redacted]";
|
|
306
|
+
}
|
|
307
|
+
if (!SECRET_ARG_NAME_PATTERN.test(arg)) {
|
|
308
|
+
return redactSecretText(arg);
|
|
309
|
+
}
|
|
310
|
+
if (arg.includes("=")) {
|
|
311
|
+
const [key] = arg.split("=", 1);
|
|
312
|
+
return `${key}=[redacted]`;
|
|
313
|
+
}
|
|
314
|
+
redactNext = true;
|
|
315
|
+
return arg;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
184
318
|
function serializeApprovalRecord(r) {
|
|
185
319
|
// The typed payload is serialised as-is — JSON-RPC consumers rely on
|
|
186
320
|
// `payload.kind` to discriminate (shell-exec/file-write/destructive/custom)
|
|
@@ -738,10 +872,72 @@ export function extractImageCandidatesFromParams(params) {
|
|
|
738
872
|
}
|
|
739
873
|
return candidates;
|
|
740
874
|
}
|
|
875
|
+
function normalizeP256PublicKey(publicKey) {
|
|
876
|
+
if (publicKey.length === 65 && publicKey[0] === 0x04)
|
|
877
|
+
return publicKey;
|
|
878
|
+
if (publicKey.length === 64)
|
|
879
|
+
return Buffer.concat([Buffer.from([0x04]), publicKey]);
|
|
880
|
+
throw new Error(`Invalid P-256 public key: expected 64-byte raw X/Y or 65-byte X9.63, got ${publicKey.length} bytes`);
|
|
881
|
+
}
|
|
741
882
|
const MAX_FRAME_BUFFER = 30;
|
|
883
|
+
const MCP_SERVER_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$/;
|
|
884
|
+
const BLOCKED_MCP_COMMANDS = new Set([
|
|
885
|
+
"bash",
|
|
886
|
+
"sh",
|
|
887
|
+
"zsh",
|
|
888
|
+
"fish",
|
|
889
|
+
"curl",
|
|
890
|
+
"wget",
|
|
891
|
+
"nc",
|
|
892
|
+
"netcat",
|
|
893
|
+
"osascript",
|
|
894
|
+
"powershell",
|
|
895
|
+
"pwsh",
|
|
896
|
+
]);
|
|
897
|
+
const TRUSTED_MCP_COMMANDS = new Set([
|
|
898
|
+
"node",
|
|
899
|
+
"npm",
|
|
900
|
+
"npx",
|
|
901
|
+
"pnpm",
|
|
902
|
+
"yarn",
|
|
903
|
+
"bun",
|
|
904
|
+
"python",
|
|
905
|
+
"python3",
|
|
906
|
+
"uv",
|
|
907
|
+
"uvx",
|
|
908
|
+
"docker",
|
|
909
|
+
"deno",
|
|
910
|
+
]);
|
|
911
|
+
function validateMcpAddRequest(input) {
|
|
912
|
+
if (!MCP_SERVER_NAME_PATTERN.test(input.name)) {
|
|
913
|
+
return "MCP server name must be 1-80 chars and contain only letters, numbers, dot, underscore, or dash";
|
|
914
|
+
}
|
|
915
|
+
if (input.transport !== "stdio" && input.transport !== "http") {
|
|
916
|
+
return "MCP server transport must be stdio or http";
|
|
917
|
+
}
|
|
918
|
+
if (!Array.isArray(input.args) || input.args.some((arg) => typeof arg !== "string")) {
|
|
919
|
+
return "MCP server args must be strings";
|
|
920
|
+
}
|
|
921
|
+
const command = input.command.trim();
|
|
922
|
+
if (command.length === 0)
|
|
923
|
+
return "MCP server command required";
|
|
924
|
+
if (/[;&|`$<>]/.test(command)) {
|
|
925
|
+
return "MCP server command must be an executable name or path, not a shell expression";
|
|
926
|
+
}
|
|
927
|
+
const executable = command.split(/[\\/]/).pop()?.toLowerCase() ?? command.toLowerCase();
|
|
928
|
+
if (BLOCKED_MCP_COMMANDS.has(executable)) {
|
|
929
|
+
return `MCP server command '${executable}' is blocked; register a concrete MCP executable instead`;
|
|
930
|
+
}
|
|
931
|
+
const pathLike = command.includes("/") || command.includes("\\") || command.startsWith(".");
|
|
932
|
+
if ((pathLike || !TRUSTED_MCP_COMMANDS.has(executable)) && !input.trusted) {
|
|
933
|
+
return "untrusted MCP command requires trusted:true after explicit user confirmation";
|
|
934
|
+
}
|
|
935
|
+
return null;
|
|
936
|
+
}
|
|
742
937
|
export class KairosRPCHandler {
|
|
743
938
|
handlers = new Map();
|
|
744
939
|
runtime = null;
|
|
940
|
+
runtimeReady = null;
|
|
745
941
|
daemon = null;
|
|
746
942
|
// State for iOS surface handlers (node registry, ECDH keys, frame buffer).
|
|
747
943
|
nodeRegistry = new Map();
|
|
@@ -879,6 +1075,16 @@ export class KairosRPCHandler {
|
|
|
879
1075
|
sweepTimer = null;
|
|
880
1076
|
constructor() {
|
|
881
1077
|
this.registerBuiltinMethods();
|
|
1078
|
+
// iOS/TUI surface methods are part of the base daemon contract. Register
|
|
1079
|
+
// them explicitly here so they are available even if future builtin blocks
|
|
1080
|
+
// are reorganized before the legacy end-of-method registration site.
|
|
1081
|
+
this.registerIOSSurfaceHandlers();
|
|
1082
|
+
// registerSurfaceHandlers() also runs from setRuntime() — re-running here
|
|
1083
|
+
// is idempotent (handlers Map.set is replace-on-collision) and lets the
|
|
1084
|
+
// runtime-independent handlers (ingest.capabilities, hooks.list with null
|
|
1085
|
+
// guards, etc.) answer pre-setRuntime calls. Runtime-dependent handlers
|
|
1086
|
+
// close over `this.runtime` and pick up the value at invocation time.
|
|
1087
|
+
this.registerSurfaceHandlers();
|
|
882
1088
|
this.startSubscriptionSweep();
|
|
883
1089
|
}
|
|
884
1090
|
/**
|
|
@@ -1097,8 +1303,9 @@ export class KairosRPCHandler {
|
|
|
1097
1303
|
/**
|
|
1098
1304
|
* Attach a WotannRuntime instance to route RPC calls to.
|
|
1099
1305
|
*/
|
|
1100
|
-
setRuntime(runtime) {
|
|
1306
|
+
setRuntime(runtime, ready) {
|
|
1101
1307
|
this.runtime = runtime;
|
|
1308
|
+
this.runtimeReady = ready ?? null;
|
|
1102
1309
|
// Register self-improvement handlers now that runtime and daemon are available
|
|
1103
1310
|
this.registerSelfImprovementHandlers();
|
|
1104
1311
|
this.registerSurfaceHandlers();
|
|
@@ -1278,6 +1485,23 @@ export class KairosRPCHandler {
|
|
|
1278
1485
|
};
|
|
1279
1486
|
return;
|
|
1280
1487
|
}
|
|
1488
|
+
if (this.runtimeReady) {
|
|
1489
|
+
try {
|
|
1490
|
+
await this.runtimeReady;
|
|
1491
|
+
}
|
|
1492
|
+
catch (err) {
|
|
1493
|
+
yield {
|
|
1494
|
+
jsonrpc: "2.0",
|
|
1495
|
+
method: "stream.error",
|
|
1496
|
+
params: {
|
|
1497
|
+
type: "error",
|
|
1498
|
+
content: `Runtime initialization failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
1499
|
+
sessionId: "",
|
|
1500
|
+
},
|
|
1501
|
+
};
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1281
1505
|
const prompt = request.params?.prompt ?? "";
|
|
1282
1506
|
const sessionId = request.params?.sessionId ?? "default";
|
|
1283
1507
|
const requestedModel = request.params?.model ?? "";
|
|
@@ -1382,6 +1606,9 @@ export class KairosRPCHandler {
|
|
|
1382
1606
|
sessionId,
|
|
1383
1607
|
provider: chunk.provider,
|
|
1384
1608
|
model: chunk.model,
|
|
1609
|
+
...(chunk.toolName ? { toolName: chunk.toolName } : {}),
|
|
1610
|
+
...(chunk.toolInput ? { toolInput: chunk.toolInput } : {}),
|
|
1611
|
+
...(chunk.toolCallId ? { toolCallId: chunk.toolCallId } : {}),
|
|
1385
1612
|
},
|
|
1386
1613
|
};
|
|
1387
1614
|
}
|
|
@@ -1626,8 +1853,13 @@ export class KairosRPCHandler {
|
|
|
1626
1853
|
try {
|
|
1627
1854
|
const { execFile } = await import("node:child_process");
|
|
1628
1855
|
const { promisify } = await import("node:util");
|
|
1856
|
+
const { tmpdir } = await import("node:os");
|
|
1857
|
+
const { join } = await import("node:path");
|
|
1629
1858
|
const execFileAsync = promisify(execFile);
|
|
1630
|
-
|
|
1859
|
+
// Use os.tmpdir() so this works on Windows (TEMP/TMP) — literal
|
|
1860
|
+
// /tmp returned ENOENT on Windows because the directory doesn't
|
|
1861
|
+
// exist.
|
|
1862
|
+
const tmpFile = join(tmpdir(), `wotann-codex-${Date.now()}.txt`);
|
|
1631
1863
|
const codexModel = targetModel || getProviderDefaults("codex").defaultModel;
|
|
1632
1864
|
await execFileAsync("codex", ["exec", "-c", `model="${codexModel}"`, "-o", tmpFile, prompt], {
|
|
1633
1865
|
timeout: 60000,
|
|
@@ -1716,6 +1948,23 @@ export class KairosRPCHandler {
|
|
|
1716
1948
|
};
|
|
1717
1949
|
return;
|
|
1718
1950
|
}
|
|
1951
|
+
if (this.runtimeReady) {
|
|
1952
|
+
try {
|
|
1953
|
+
await this.runtimeReady;
|
|
1954
|
+
}
|
|
1955
|
+
catch (err) {
|
|
1956
|
+
yield {
|
|
1957
|
+
jsonrpc: "2.0",
|
|
1958
|
+
method: "stream.error",
|
|
1959
|
+
params: {
|
|
1960
|
+
type: "error",
|
|
1961
|
+
content: `Runtime initialization failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
1962
|
+
sessionId,
|
|
1963
|
+
},
|
|
1964
|
+
};
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1719
1968
|
const requestedModel = params["model"] ?? "";
|
|
1720
1969
|
const requestedProvider = params["provider"] ?? "";
|
|
1721
1970
|
// Round 63 turn-24: convert iOS-supplied images (base64) to VisionInput[]
|
|
@@ -1792,6 +2041,9 @@ export class KairosRPCHandler {
|
|
|
1792
2041
|
sessionId,
|
|
1793
2042
|
provider: chunk.provider,
|
|
1794
2043
|
model: chunk.model,
|
|
2044
|
+
...(chunk.toolName ? { toolName: chunk.toolName } : {}),
|
|
2045
|
+
...(chunk.toolInput ? { toolInput: chunk.toolInput } : {}),
|
|
2046
|
+
...(chunk.toolCallId ? { toolCallId: chunk.toolCallId } : {}),
|
|
1795
2047
|
},
|
|
1796
2048
|
};
|
|
1797
2049
|
}
|
|
@@ -2018,6 +2270,35 @@ export class KairosRPCHandler {
|
|
|
2018
2270
|
connected: activeDeviceIds.has(device.id),
|
|
2019
2271
|
}));
|
|
2020
2272
|
});
|
|
2273
|
+
const getCompanionServerForRemoteAccess = () => {
|
|
2274
|
+
const companionServer = this.daemon?.getCompanionServer();
|
|
2275
|
+
if (!companionServer || !companionServer.isRunning()) {
|
|
2276
|
+
throw new Error("Companion server not running");
|
|
2277
|
+
}
|
|
2278
|
+
return companionServer;
|
|
2279
|
+
};
|
|
2280
|
+
const getRemoteAccessSnapshot = async () => {
|
|
2281
|
+
const companionServer = getCompanionServerForRemoteAccess();
|
|
2282
|
+
return companionServer.getRemoteAccessSnapshot();
|
|
2283
|
+
};
|
|
2284
|
+
const configureRemoteAccess = async (params) => {
|
|
2285
|
+
const companionServer = getCompanionServerForRemoteAccess();
|
|
2286
|
+
const url = typeof params.url === "string" ? params.url.trim() : "";
|
|
2287
|
+
if (!url) {
|
|
2288
|
+
throw new Error("url required");
|
|
2289
|
+
}
|
|
2290
|
+
return companionServer.configureRemoteAccessUrl(url);
|
|
2291
|
+
};
|
|
2292
|
+
const clearRemoteAccess = async () => {
|
|
2293
|
+
const companionServer = getCompanionServerForRemoteAccess();
|
|
2294
|
+
return companionServer.clearConfiguredRemoteAccessUrl();
|
|
2295
|
+
};
|
|
2296
|
+
this.handlers.set("companion.remote.status", getRemoteAccessSnapshot);
|
|
2297
|
+
this.handlers.set("companion.remote.configure", configureRemoteAccess);
|
|
2298
|
+
this.handlers.set("companion.remote.clear", clearRemoteAccess);
|
|
2299
|
+
this.handlers.set("remote.access.status", getRemoteAccessSnapshot);
|
|
2300
|
+
this.handlers.set("remote.access.configure", configureRemoteAccess);
|
|
2301
|
+
this.handlers.set("remote.access.clear", clearRemoteAccess);
|
|
2021
2302
|
this.handlers.set("companion.sessions", async () => {
|
|
2022
2303
|
const companionServer = this.daemon?.getCompanionServer();
|
|
2023
2304
|
if (!companionServer || !companionServer.isRunning()) {
|
|
@@ -2106,6 +2387,13 @@ export class KairosRPCHandler {
|
|
|
2106
2387
|
const service = getProviderService();
|
|
2107
2388
|
const force = params["force"] === true;
|
|
2108
2389
|
const snapshot = await service.getSnapshot({ force });
|
|
2390
|
+
if (this.runtimeReady) {
|
|
2391
|
+
await this.runtimeReady;
|
|
2392
|
+
}
|
|
2393
|
+
const runtimeStatus = this.runtime?.getStatus();
|
|
2394
|
+
const active = runtimeStatus
|
|
2395
|
+
? { provider: runtimeStatus.activeProvider, model: runtimeStatus.activeModel }
|
|
2396
|
+
: snapshot.active;
|
|
2109
2397
|
return {
|
|
2110
2398
|
providers: snapshot.providers.map((p) => ({
|
|
2111
2399
|
id: p.id,
|
|
@@ -2123,7 +2411,7 @@ export class KairosRPCHandler {
|
|
|
2123
2411
|
envKeys: service.getSpec(p.id)?.envKeys ?? [],
|
|
2124
2412
|
docsUrl: service.getSpec(p.id)?.docsUrl ?? null,
|
|
2125
2413
|
})),
|
|
2126
|
-
active
|
|
2414
|
+
active,
|
|
2127
2415
|
lastRefreshedAt: snapshot.lastRefreshedAt,
|
|
2128
2416
|
};
|
|
2129
2417
|
});
|
|
@@ -2555,7 +2843,11 @@ export class KairosRPCHandler {
|
|
|
2555
2843
|
// a descriptive error if the provider is unconfigured or the model is
|
|
2556
2844
|
// not available so the UI surfaces a clear message.
|
|
2557
2845
|
const { getProviderService } = await import("../providers/provider-service.js");
|
|
2846
|
+
if (this.runtimeReady) {
|
|
2847
|
+
await this.runtimeReady;
|
|
2848
|
+
}
|
|
2558
2849
|
getProviderService().setActive(provider, model);
|
|
2850
|
+
this.runtime?.setActiveProvider(provider, model);
|
|
2559
2851
|
return { success: true, provider, model };
|
|
2560
2852
|
});
|
|
2561
2853
|
// Cost — returns real cost data from the runtime session and status
|
|
@@ -3208,44 +3500,6 @@ export class KairosRPCHandler {
|
|
|
3208
3500
|
}
|
|
3209
3501
|
return { workspaces };
|
|
3210
3502
|
});
|
|
3211
|
-
// Plugins list
|
|
3212
|
-
this.handlers.set("plugins.list", async () => {
|
|
3213
|
-
if (!this.runtime)
|
|
3214
|
-
return { plugins: [] };
|
|
3215
|
-
try {
|
|
3216
|
-
const lifecycle = this.runtime.getPluginLifecycle();
|
|
3217
|
-
const stats = lifecycle.getStats();
|
|
3218
|
-
// Build a plugin list from the lifecycle hook registrations.
|
|
3219
|
-
// Each unique pluginName across all events represents a registered plugin.
|
|
3220
|
-
const pluginSet = new Map();
|
|
3221
|
-
for (const event of Object.keys(stats)) {
|
|
3222
|
-
const hooks = lifecycle.getHooks(event);
|
|
3223
|
-
for (const hook of hooks) {
|
|
3224
|
-
const existing = pluginSet.get(hook.pluginName);
|
|
3225
|
-
if (existing) {
|
|
3226
|
-
if (!existing.events.includes(event)) {
|
|
3227
|
-
existing.events.push(event);
|
|
3228
|
-
}
|
|
3229
|
-
existing.hookCount++;
|
|
3230
|
-
}
|
|
3231
|
-
else {
|
|
3232
|
-
pluginSet.set(hook.pluginName, { events: [event], hookCount: 1 });
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
}
|
|
3236
|
-
const plugins = [...pluginSet.entries()].map(([name, info]) => ({
|
|
3237
|
-
name,
|
|
3238
|
-
events: info.events,
|
|
3239
|
-
hookCount: info.hookCount,
|
|
3240
|
-
enabled: true,
|
|
3241
|
-
}));
|
|
3242
|
-
return { plugins };
|
|
3243
|
-
}
|
|
3244
|
-
catch {
|
|
3245
|
-
// Best-effort path — caller gets a safe fallback, no user-facing error.
|
|
3246
|
-
return { plugins: [] };
|
|
3247
|
-
}
|
|
3248
|
-
});
|
|
3249
3503
|
// Connectors list
|
|
3250
3504
|
this.handlers.set("connectors.list", async () => {
|
|
3251
3505
|
if (!this.runtime)
|
|
@@ -3973,6 +4227,315 @@ export class KairosRPCHandler {
|
|
|
3973
4227
|
return { success: false, reason: "Failed to read sessions" };
|
|
3974
4228
|
}
|
|
3975
4229
|
});
|
|
4230
|
+
// session.rewind — drop the last N turns or messages from a session.
|
|
4231
|
+
// mode:"steps" (default) rewinds whole user→assistant→tool turns;
|
|
4232
|
+
// mode:"messages" trims raw messages. Returns the new snapshot plus
|
|
4233
|
+
// the count + payload of the removed events for caller-side undo UX.
|
|
4234
|
+
this.handlers.set("session.rewind", async (params) => {
|
|
4235
|
+
const sessionId = params["sessionId"];
|
|
4236
|
+
const n = Number(params["n"] ?? 1);
|
|
4237
|
+
const mode = (params["mode"] ?? "steps");
|
|
4238
|
+
if (!sessionId)
|
|
4239
|
+
return { success: false, reason: "sessionId required" };
|
|
4240
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
4241
|
+
return { success: false, reason: "n must be a positive integer" };
|
|
4242
|
+
}
|
|
4243
|
+
if (mode !== "steps" && mode !== "messages") {
|
|
4244
|
+
return { success: false, reason: "mode must be 'steps' or 'messages'" };
|
|
4245
|
+
}
|
|
4246
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(sessionId)) {
|
|
4247
|
+
return { success: false, reason: "Invalid sessionId format" };
|
|
4248
|
+
}
|
|
4249
|
+
const sessionsDir = resolveWotannHomeSubdir("sessions");
|
|
4250
|
+
const filePath = join(sessionsDir, `${sessionId}.json`);
|
|
4251
|
+
const resolved = resolvePath(filePath);
|
|
4252
|
+
const safeRoot = resolvePath(sessionsDir) + "/";
|
|
4253
|
+
if (!resolved.startsWith(safeRoot)) {
|
|
4254
|
+
return { success: false, reason: "Invalid sessionId path" };
|
|
4255
|
+
}
|
|
4256
|
+
if (!existsSync(resolved)) {
|
|
4257
|
+
return { success: false, reason: `Session ${sessionId} not found` };
|
|
4258
|
+
}
|
|
4259
|
+
try {
|
|
4260
|
+
const raw = readFileSync(resolved, "utf-8");
|
|
4261
|
+
const snapshot = JSON.parse(raw);
|
|
4262
|
+
const messages = Array.isArray(snapshot["messages"])
|
|
4263
|
+
? snapshot["messages"]
|
|
4264
|
+
: [];
|
|
4265
|
+
// Reconstruct the minimal SessionState shape rewind expects.
|
|
4266
|
+
const session = {
|
|
4267
|
+
id: sessionId,
|
|
4268
|
+
startedAt: new Date(),
|
|
4269
|
+
provider: snapshot["provider"] ?? "anthropic",
|
|
4270
|
+
model: snapshot["model"] ?? "",
|
|
4271
|
+
totalTokens: Number(snapshot["totalTokens"] ?? 0),
|
|
4272
|
+
totalCost: Number(snapshot["totalCost"] ?? 0),
|
|
4273
|
+
toolCalls: Number(snapshot["toolCalls"] ?? 0),
|
|
4274
|
+
messages: messages,
|
|
4275
|
+
incognito: Boolean(snapshot["incognito"] ?? false),
|
|
4276
|
+
...(typeof snapshot["title"] === "string" ? { title: snapshot["title"] } : {}),
|
|
4277
|
+
};
|
|
4278
|
+
const { rewindBySteps, rewindByMessages } = await import("../core/session-rewind.js");
|
|
4279
|
+
const result = mode === "steps" ? rewindBySteps(session, n) : rewindByMessages(session, n);
|
|
4280
|
+
if (!result.changed) {
|
|
4281
|
+
return { success: true, changed: false, removed: 0 };
|
|
4282
|
+
}
|
|
4283
|
+
const updated = {
|
|
4284
|
+
...snapshot,
|
|
4285
|
+
messages: result.session.messages,
|
|
4286
|
+
totalTokens: result.session.totalTokens,
|
|
4287
|
+
totalCost: result.session.totalCost,
|
|
4288
|
+
toolCalls: result.session.toolCalls,
|
|
4289
|
+
};
|
|
4290
|
+
writeFileAtomic(resolved, JSON.stringify(updated, null, 2), {
|
|
4291
|
+
encoding: "utf-8",
|
|
4292
|
+
});
|
|
4293
|
+
return {
|
|
4294
|
+
success: true,
|
|
4295
|
+
changed: true,
|
|
4296
|
+
mode,
|
|
4297
|
+
removed: result.removed.length,
|
|
4298
|
+
removedMessages: result.removed,
|
|
4299
|
+
};
|
|
4300
|
+
}
|
|
4301
|
+
catch (err) {
|
|
4302
|
+
return {
|
|
4303
|
+
success: false,
|
|
4304
|
+
reason: `rewind failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
4305
|
+
};
|
|
4306
|
+
}
|
|
4307
|
+
});
|
|
4308
|
+
// research.run — surface dual-confidence + iterdrag strategies for
|
|
4309
|
+
// GUI/iOS callers. Mode "dual-confidence" is cheap (2 search calls);
|
|
4310
|
+
// "iterdrag" walks a depth-bounded decomposition tree. Search is
|
|
4311
|
+
// honest-stub by default so the call always returns a structured
|
|
4312
|
+
// payload even without a backend wired.
|
|
4313
|
+
this.handlers.set("research.run", async (params) => {
|
|
4314
|
+
const query = params["query"] ?? "";
|
|
4315
|
+
if (!query)
|
|
4316
|
+
return { ok: false, error: "query required" };
|
|
4317
|
+
const strategy = (params["strategy"] ?? "dual-confidence").toLowerCase();
|
|
4318
|
+
const maxDepth = Number(params["maxDepth"] ?? 2);
|
|
4319
|
+
const hitsPerCall = Number(params["hitsPerCall"] ?? 10);
|
|
4320
|
+
const strategies = await import("../intelligence/research-strategies.js");
|
|
4321
|
+
const search = (async (q) => [
|
|
4322
|
+
{ url: `wotann://stub/${encodeURIComponent(q)}`, title: q },
|
|
4323
|
+
]);
|
|
4324
|
+
try {
|
|
4325
|
+
if (strategy === "iterdrag") {
|
|
4326
|
+
const decompose = async (q) => {
|
|
4327
|
+
const parts = q
|
|
4328
|
+
.split(/\s+(?:and|or)\s+|;\s*/i)
|
|
4329
|
+
.filter((p) => p.trim().length > 0);
|
|
4330
|
+
return parts.length > 1 ? parts : [];
|
|
4331
|
+
};
|
|
4332
|
+
const root = await strategies.iterDrag(query, search, decompose, {
|
|
4333
|
+
maxDepth,
|
|
4334
|
+
hitsPerNode: hitsPerCall,
|
|
4335
|
+
});
|
|
4336
|
+
return { ok: true, strategy: "iterdrag", root };
|
|
4337
|
+
}
|
|
4338
|
+
const result = await strategies.dualConfidenceSearch(query, search, {
|
|
4339
|
+
hitsPerCall,
|
|
4340
|
+
});
|
|
4341
|
+
return { ok: true, strategy: "dual-confidence", result };
|
|
4342
|
+
}
|
|
4343
|
+
catch (err) {
|
|
4344
|
+
return {
|
|
4345
|
+
ok: false,
|
|
4346
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4347
|
+
};
|
|
4348
|
+
}
|
|
4349
|
+
});
|
|
4350
|
+
// skill.optimize_description — surface the description-optimizer.
|
|
4351
|
+
// Caller passes the current description + labeled corpus
|
|
4352
|
+
// (positives/negatives). Returns the best variant + its eval.
|
|
4353
|
+
this.handlers.set("skill.optimize_description", async (params) => {
|
|
4354
|
+
const current = params["current"];
|
|
4355
|
+
const positives = params["positives"] ?? [];
|
|
4356
|
+
const negatives = params["negatives"] ?? [];
|
|
4357
|
+
const threshold = Number(params["threshold"] ?? 0.5);
|
|
4358
|
+
if (!current)
|
|
4359
|
+
return { ok: false, error: "current required" };
|
|
4360
|
+
try {
|
|
4361
|
+
const { optimizeDescription } = await import("../skills/description-optimizer.js");
|
|
4362
|
+
const result = await optimizeDescription({
|
|
4363
|
+
current,
|
|
4364
|
+
positives,
|
|
4365
|
+
negatives,
|
|
4366
|
+
threshold,
|
|
4367
|
+
});
|
|
4368
|
+
return { ok: true, ...result };
|
|
4369
|
+
}
|
|
4370
|
+
catch (err) {
|
|
4371
|
+
return {
|
|
4372
|
+
ok: false,
|
|
4373
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4374
|
+
};
|
|
4375
|
+
}
|
|
4376
|
+
});
|
|
4377
|
+
// manifest.render — surface run-manifest. Caller passes a path to
|
|
4378
|
+
// a saved trajectory JSON; we render Markdown + JSON forms so
|
|
4379
|
+
// desktop/iOS can show whichever fits their UI.
|
|
4380
|
+
this.handlers.set("manifest.render", async (params) => {
|
|
4381
|
+
const trajectoryPath = params["trajectoryPath"];
|
|
4382
|
+
if (!trajectoryPath)
|
|
4383
|
+
return { ok: false, error: "trajectoryPath required" };
|
|
4384
|
+
try {
|
|
4385
|
+
// Reuse the existing path-traversal guard pattern from session.resume.
|
|
4386
|
+
const safeRoot = resolvePath(resolveWotannHomeSubdir("trajectories")) + "/";
|
|
4387
|
+
const resolved = resolvePath(trajectoryPath);
|
|
4388
|
+
const homeRoot = resolvePath(resolveWotannHomeSubdir("")) + "/";
|
|
4389
|
+
if (!resolved.startsWith(safeRoot) && !resolved.startsWith(homeRoot)) {
|
|
4390
|
+
return { ok: false, error: "trajectoryPath must be inside ~/.wotann" };
|
|
4391
|
+
}
|
|
4392
|
+
if (!existsSync(resolved)) {
|
|
4393
|
+
return { ok: false, error: `trajectory not found: ${resolved}` };
|
|
4394
|
+
}
|
|
4395
|
+
const { loadTrajectory } = await import("../autopilot/trajectory-recorder.js");
|
|
4396
|
+
const { buildManifest, renderManifestMarkdown, renderManifestJson } = await import("../autopilot/run-manifest.js");
|
|
4397
|
+
const trajectory = await loadTrajectory(resolved);
|
|
4398
|
+
const buildOpts = {};
|
|
4399
|
+
if (typeof params["taskTitle"] === "string") {
|
|
4400
|
+
buildOpts.taskTitle = params["taskTitle"];
|
|
4401
|
+
}
|
|
4402
|
+
if (typeof params["costUsd"] === "number") {
|
|
4403
|
+
buildOpts.costUsd = params["costUsd"];
|
|
4404
|
+
}
|
|
4405
|
+
const manifest = buildManifest(trajectory, buildOpts);
|
|
4406
|
+
return {
|
|
4407
|
+
ok: true,
|
|
4408
|
+
manifest,
|
|
4409
|
+
markdown: renderManifestMarkdown(manifest),
|
|
4410
|
+
json: renderManifestJson(manifest),
|
|
4411
|
+
};
|
|
4412
|
+
}
|
|
4413
|
+
catch (err) {
|
|
4414
|
+
return {
|
|
4415
|
+
ok: false,
|
|
4416
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4417
|
+
};
|
|
4418
|
+
}
|
|
4419
|
+
});
|
|
4420
|
+
// skill.telemetry_record — append a skill-activation event to the
|
|
4421
|
+
// shared telemetry log. Cross-surface (CLI/desktop/iOS) callers all
|
|
4422
|
+
// hit the same path so the corpus mined for the description-optimizer
|
|
4423
|
+
// is consistent regardless of which surface the user prefers.
|
|
4424
|
+
this.handlers.set("skill.telemetry_record", async (params) => {
|
|
4425
|
+
try {
|
|
4426
|
+
const { SkillActivationTelemetry } = await import("../skills/activation-telemetry.js");
|
|
4427
|
+
const sessionId = params["sessionId"];
|
|
4428
|
+
const prompt = params["prompt"];
|
|
4429
|
+
if (!sessionId || typeof prompt !== "string") {
|
|
4430
|
+
return { ok: false, error: "sessionId + prompt required" };
|
|
4431
|
+
}
|
|
4432
|
+
const telemetryPath = resolveWotannHomeSubdir("skill-telemetry.jsonl");
|
|
4433
|
+
const t = new SkillActivationTelemetry({ path: telemetryPath });
|
|
4434
|
+
const triggered = (params["triggered"] ?? null);
|
|
4435
|
+
const candidatesRaw = params["candidates"] ?? [];
|
|
4436
|
+
const candidates = candidatesRaw
|
|
4437
|
+
.filter((c) => !!c &&
|
|
4438
|
+
typeof c === "object" &&
|
|
4439
|
+
typeof c.skill === "string" &&
|
|
4440
|
+
typeof c.score === "number")
|
|
4441
|
+
.map((c) => ({ skill: c.skill, score: c.score }));
|
|
4442
|
+
const event = await t.record({
|
|
4443
|
+
sessionId,
|
|
4444
|
+
prompt,
|
|
4445
|
+
triggered,
|
|
4446
|
+
candidates,
|
|
4447
|
+
...(typeof params["outcome"] === "string"
|
|
4448
|
+
? { outcome: params["outcome"] }
|
|
4449
|
+
: {}),
|
|
4450
|
+
});
|
|
4451
|
+
return { ok: true, event };
|
|
4452
|
+
}
|
|
4453
|
+
catch (err) {
|
|
4454
|
+
return {
|
|
4455
|
+
ok: false,
|
|
4456
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4457
|
+
};
|
|
4458
|
+
}
|
|
4459
|
+
});
|
|
4460
|
+
// skill.telemetry_mark_outcome — flag the last activation for a
|
|
4461
|
+
// session as ok | regret | unknown. The patch is appended to the
|
|
4462
|
+
// shared telemetry JSONL so a reload sees the corrected outcome.
|
|
4463
|
+
this.handlers.set("skill.telemetry_mark_outcome", async (params) => {
|
|
4464
|
+
try {
|
|
4465
|
+
const sessionId = params["sessionId"];
|
|
4466
|
+
const outcome = params["outcome"];
|
|
4467
|
+
if (!sessionId)
|
|
4468
|
+
return { ok: false, error: "sessionId required" };
|
|
4469
|
+
if (outcome !== "ok" && outcome !== "regret" && outcome !== "unknown") {
|
|
4470
|
+
return {
|
|
4471
|
+
ok: false,
|
|
4472
|
+
error: 'outcome must be "ok" | "regret" | "unknown"',
|
|
4473
|
+
};
|
|
4474
|
+
}
|
|
4475
|
+
const { SkillActivationTelemetry } = await import("../skills/activation-telemetry.js");
|
|
4476
|
+
const t = new SkillActivationTelemetry({
|
|
4477
|
+
path: resolveWotannHomeSubdir("skill-telemetry.jsonl"),
|
|
4478
|
+
});
|
|
4479
|
+
const patched = await t.markOutcome(sessionId, outcome);
|
|
4480
|
+
return { ok: true, patched };
|
|
4481
|
+
}
|
|
4482
|
+
catch (err) {
|
|
4483
|
+
return {
|
|
4484
|
+
ok: false,
|
|
4485
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4486
|
+
};
|
|
4487
|
+
}
|
|
4488
|
+
});
|
|
4489
|
+
// skill.telemetry_corpus — mine a positive/negative corpus for the
|
|
4490
|
+
// named skill from the telemetry log. Surfaces extractCorpusForSkill
|
|
4491
|
+
// so GUIs can preview what the optimizer will see before running it.
|
|
4492
|
+
this.handlers.set("skill.telemetry_corpus", async (params) => {
|
|
4493
|
+
try {
|
|
4494
|
+
const { loadTelemetryLog, extractCorpusForSkill } = await import("../skills/activation-telemetry.js");
|
|
4495
|
+
const skill = params["skill"];
|
|
4496
|
+
if (!skill)
|
|
4497
|
+
return { ok: false, error: "skill required" };
|
|
4498
|
+
const telemetryPath = resolveWotannHomeSubdir("skill-telemetry.jsonl");
|
|
4499
|
+
const result = loadTelemetryLog(telemetryPath);
|
|
4500
|
+
const maxEach = Number(params["maxEach"] ?? 200);
|
|
4501
|
+
const corpus = extractCorpusForSkill(result.events, skill, {
|
|
4502
|
+
maxEach: Number.isFinite(maxEach) && maxEach > 0 ? maxEach : 200,
|
|
4503
|
+
});
|
|
4504
|
+
return {
|
|
4505
|
+
ok: true,
|
|
4506
|
+
path: telemetryPath,
|
|
4507
|
+
skipped: result.skipped,
|
|
4508
|
+
...corpus,
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4511
|
+
catch (err) {
|
|
4512
|
+
return {
|
|
4513
|
+
ok: false,
|
|
4514
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4515
|
+
};
|
|
4516
|
+
}
|
|
4517
|
+
});
|
|
4518
|
+
// effort.classify — surface the effort-cascade tier classifier so
|
|
4519
|
+
// GUI/iOS can preview the routing decision before execution.
|
|
4520
|
+
// Distinct from the existing `route.classify` handler (which delegates
|
|
4521
|
+
// to runtime.classifyAndRoute and returns an error envelope when the
|
|
4522
|
+
// runtime is uninitialised); this one is pure heuristics.
|
|
4523
|
+
this.handlers.set("effort.classify", async (params) => {
|
|
4524
|
+
const prompt = params["prompt"];
|
|
4525
|
+
if (typeof prompt !== "string")
|
|
4526
|
+
return { ok: false, error: "prompt required" };
|
|
4527
|
+
const { classifyEffort, EFFORT_ORDER } = await import("../providers/effort-cascade.js");
|
|
4528
|
+
const isTier = (t) => typeof t === "string" && EFFORT_ORDER.includes(t);
|
|
4529
|
+
const hints = {};
|
|
4530
|
+
if (isTier(params["minTier"]))
|
|
4531
|
+
hints.minTier = params["minTier"];
|
|
4532
|
+
if (isTier(params["maxTier"]))
|
|
4533
|
+
hints.maxTier = params["maxTier"];
|
|
4534
|
+
if (params["bump"] === true)
|
|
4535
|
+
hints.bump = true;
|
|
4536
|
+
const tier = classifyEffort(prompt, hints);
|
|
4537
|
+
return { ok: true, tier, ladder: EFFORT_ORDER };
|
|
4538
|
+
});
|
|
3976
4539
|
// architect — route through runtime query with architect system prompt
|
|
3977
4540
|
this.handlers.set("architect", async (params) => {
|
|
3978
4541
|
const prompt = params.prompt ?? params.question;
|
|
@@ -4302,25 +4865,113 @@ export class KairosRPCHandler {
|
|
|
4302
4865
|
};
|
|
4303
4866
|
}
|
|
4304
4867
|
});
|
|
4305
|
-
// mcp.list — list MCP servers
|
|
4306
|
-
this.handlers.set("mcp.list", async () => {
|
|
4307
|
-
// MCP servers are config-based; read from wotann.yaml
|
|
4868
|
+
// mcp.list — list MCP servers with live health/tool counts.
|
|
4869
|
+
this.handlers.set("mcp.list", async (params) => {
|
|
4308
4870
|
const configPath = resolveWotannHomeSubdir("wotann.yaml");
|
|
4309
4871
|
if (!existsSync(configPath))
|
|
4310
|
-
return { servers: [], count: 0 };
|
|
4872
|
+
return { servers: [], count: 0, healthyCount: 0, unhealthyCount: 0 };
|
|
4311
4873
|
try {
|
|
4874
|
+
const probe = params["probe"] !== false;
|
|
4875
|
+
const timeoutMs = Math.max(200, Math.min(10_000, Number(params["timeoutMs"]) || 1_500));
|
|
4312
4876
|
const raw = readFileSync(configPath, "utf-8");
|
|
4313
4877
|
const config = (yamlParse(raw) ?? {});
|
|
4314
4878
|
const mcpServers = config["mcpServers"] ?? config["mcp_servers"] ?? {};
|
|
4315
|
-
const servers = Object.entries(mcpServers).map(([name, entry]) =>
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4879
|
+
const servers = Object.entries(mcpServers).map(([name, entry]) => {
|
|
4880
|
+
const record = typeof entry === "object" && entry !== null ? entry : {};
|
|
4881
|
+
const rawArgs = Array.isArray(record["args"])
|
|
4882
|
+
? record["args"].filter((arg) => typeof arg === "string")
|
|
4883
|
+
: [];
|
|
4884
|
+
const command = typeof record["command"] === "string" ? record["command"] : "";
|
|
4885
|
+
const enabled = record["enabled"] !== false;
|
|
4886
|
+
return {
|
|
4887
|
+
name,
|
|
4888
|
+
enabled,
|
|
4889
|
+
command: command.length > 0 ? command : null,
|
|
4890
|
+
args: redactMcpArgs(rawArgs),
|
|
4891
|
+
rawArgs,
|
|
4892
|
+
transport: typeof record["transport"] === "string" ? record["transport"] : "stdio",
|
|
4893
|
+
status: enabled
|
|
4894
|
+
? command.length > 0
|
|
4895
|
+
? "configured"
|
|
4896
|
+
: "missing_command"
|
|
4897
|
+
: "disabled",
|
|
4898
|
+
};
|
|
4899
|
+
});
|
|
4900
|
+
const targets = servers
|
|
4901
|
+
.filter((server) => probe && server.enabled && typeof server.command === "string")
|
|
4902
|
+
.map((server) => {
|
|
4903
|
+
const entry = mcpServers[server.name];
|
|
4904
|
+
const envSource = typeof entry === "object" && entry !== null
|
|
4905
|
+
? entry["env"]
|
|
4906
|
+
: undefined;
|
|
4907
|
+
const env = typeof envSource === "object" && envSource !== null
|
|
4908
|
+
? Object.fromEntries(Object.entries(envSource).filter((entry) => typeof entry[1] === "string"))
|
|
4909
|
+
: undefined;
|
|
4910
|
+
return {
|
|
4911
|
+
name: server.name,
|
|
4912
|
+
command: server.command,
|
|
4913
|
+
args: server.rawArgs,
|
|
4914
|
+
...(env ? { env } : {}),
|
|
4915
|
+
};
|
|
4916
|
+
});
|
|
4917
|
+
const healthByName = probe ? await probeMcpServers(targets, { timeoutMs }) : {};
|
|
4918
|
+
const enriched = servers.map((server) => {
|
|
4919
|
+
const publicServer = {
|
|
4920
|
+
name: server.name,
|
|
4921
|
+
enabled: server.enabled,
|
|
4922
|
+
command: server.command,
|
|
4923
|
+
args: server.args,
|
|
4924
|
+
transport: server.transport,
|
|
4925
|
+
status: server.status,
|
|
4926
|
+
};
|
|
4927
|
+
const health = healthByName[server.name];
|
|
4928
|
+
if (!server.enabled) {
|
|
4929
|
+
return { ...publicServer, status: "disabled", ok: false, toolCount: null, error: null };
|
|
4930
|
+
}
|
|
4931
|
+
if (server.command === null) {
|
|
4932
|
+
return {
|
|
4933
|
+
...publicServer,
|
|
4934
|
+
status: "missing_command",
|
|
4935
|
+
ok: false,
|
|
4936
|
+
toolCount: null,
|
|
4937
|
+
error: "command required",
|
|
4938
|
+
};
|
|
4939
|
+
}
|
|
4940
|
+
if (!probe || !health) {
|
|
4941
|
+
return {
|
|
4942
|
+
...publicServer,
|
|
4943
|
+
status: "not_probed",
|
|
4944
|
+
ok: null,
|
|
4945
|
+
toolCount: null,
|
|
4946
|
+
error: null,
|
|
4947
|
+
};
|
|
4948
|
+
}
|
|
4949
|
+
return {
|
|
4950
|
+
...publicServer,
|
|
4951
|
+
status: health.ok ? "healthy" : "unhealthy",
|
|
4952
|
+
ok: health.ok,
|
|
4953
|
+
latencyMs: health.latencyMs,
|
|
4954
|
+
toolCount: health.toolCount,
|
|
4955
|
+
serverInfo: health.serverInfo,
|
|
4956
|
+
error: health.error ? redactSecretText(health.error) : null,
|
|
4957
|
+
};
|
|
4958
|
+
});
|
|
4959
|
+
return {
|
|
4960
|
+
servers: enriched,
|
|
4961
|
+
count: enriched.length,
|
|
4962
|
+
healthyCount: enriched.filter((s) => s.status === "healthy").length,
|
|
4963
|
+
unhealthyCount: enriched.filter((s) => s.status === "unhealthy").length,
|
|
4964
|
+
probed: probe,
|
|
4965
|
+
};
|
|
4320
4966
|
}
|
|
4321
|
-
catch {
|
|
4322
|
-
|
|
4323
|
-
|
|
4967
|
+
catch (err) {
|
|
4968
|
+
return {
|
|
4969
|
+
servers: [],
|
|
4970
|
+
count: 0,
|
|
4971
|
+
healthyCount: 0,
|
|
4972
|
+
unhealthyCount: 0,
|
|
4973
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4974
|
+
};
|
|
4324
4975
|
}
|
|
4325
4976
|
});
|
|
4326
4977
|
// composer.apply — apply a batch of multi-file edits.
|
|
@@ -4445,8 +5096,44 @@ export class KairosRPCHandler {
|
|
|
4445
5096
|
const command = p["command"];
|
|
4446
5097
|
const args = p["args"] ?? [];
|
|
4447
5098
|
const transport = (p["transport"] ?? "stdio");
|
|
5099
|
+
const trusted = p["trusted"] === true || p["confirmUnsafe"] === true;
|
|
5100
|
+
const skipMalwareCheck = p["skipMalwareCheck"] === true;
|
|
5101
|
+
const strictMalwareCheck = p["strictMalwareCheck"] === true;
|
|
4448
5102
|
if (!name || !command)
|
|
4449
5103
|
return { ok: false, error: "name and command required" };
|
|
5104
|
+
const validationError = validateMcpAddRequest({ name, command, args, transport, trusted });
|
|
5105
|
+
if (validationError)
|
|
5106
|
+
return { ok: false, error: validationError };
|
|
5107
|
+
// OSV.dev malware/CVE pre-flight — gated before write so a typosquat
|
|
5108
|
+
// or compromised package never reaches user config. Unlike the CLI
|
|
5109
|
+
// path which prints + exits, the RPC returns a structured error so
|
|
5110
|
+
// the GUI/iOS surface can render a confirmation dialog.
|
|
5111
|
+
if (!skipMalwareCheck) {
|
|
5112
|
+
const { preflight: osvPreflight } = await import("../security/osv-check.js");
|
|
5113
|
+
const silentLogger = {
|
|
5114
|
+
info: (_m) => { },
|
|
5115
|
+
warn: (_m) => { },
|
|
5116
|
+
error: (_m) => { },
|
|
5117
|
+
};
|
|
5118
|
+
const verdict = await osvPreflight([{ name, command, args }], {
|
|
5119
|
+
strict: strictMalwareCheck,
|
|
5120
|
+
logger: silentLogger,
|
|
5121
|
+
});
|
|
5122
|
+
if (!verdict.proceed) {
|
|
5123
|
+
const blockedResult = verdict.results[name];
|
|
5124
|
+
return {
|
|
5125
|
+
ok: false,
|
|
5126
|
+
error: "blocked by OSV malware/CVE pre-flight",
|
|
5127
|
+
blocked: true,
|
|
5128
|
+
packageRef: blockedResult?.packageRef ?? null,
|
|
5129
|
+
advisories: blockedResult?.vulnerabilities.map((v) => ({
|
|
5130
|
+
id: v.id,
|
|
5131
|
+
summary: v.summary ?? null,
|
|
5132
|
+
severity: blockedResult.highestSeverity,
|
|
5133
|
+
})) ?? [],
|
|
5134
|
+
};
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
4450
5137
|
const configPath = resolveWotannHomeSubdir("wotann.yaml");
|
|
4451
5138
|
try {
|
|
4452
5139
|
if (!existsSync(dirname(configPath)))
|
|
@@ -5640,6 +6327,7 @@ export class KairosRPCHandler {
|
|
|
5640
6327
|
const rawAction = stepObj["action"];
|
|
5641
6328
|
const rawParams = stepObj["params"];
|
|
5642
6329
|
let execution = null;
|
|
6330
|
+
let computerResult = null;
|
|
5643
6331
|
let actionError = null;
|
|
5644
6332
|
if (typeof rawAction === "string" && session.status === "running") {
|
|
5645
6333
|
const params = {};
|
|
@@ -5651,9 +6339,27 @@ export class KairosRPCHandler {
|
|
|
5651
6339
|
params[k] = String(v);
|
|
5652
6340
|
}
|
|
5653
6341
|
}
|
|
5654
|
-
const
|
|
6342
|
+
const normalized = normalizeComputerAction({ action: rawAction, params });
|
|
5655
6343
|
try {
|
|
5656
|
-
|
|
6344
|
+
if (normalized.ok) {
|
|
6345
|
+
computerResult = await executeComputerAction({
|
|
6346
|
+
action: normalized.action,
|
|
6347
|
+
executeDesktopAction,
|
|
6348
|
+
});
|
|
6349
|
+
execution =
|
|
6350
|
+
computerResult.error === "desktop route returned no result"
|
|
6351
|
+
? null
|
|
6352
|
+
: {
|
|
6353
|
+
success: computerResult.ok,
|
|
6354
|
+
output: computerResult.output ?? computerResult.error ?? "",
|
|
6355
|
+
};
|
|
6356
|
+
}
|
|
6357
|
+
else {
|
|
6358
|
+
const action = { action: rawAction, params };
|
|
6359
|
+
execution = executeDesktopAction(action);
|
|
6360
|
+
if (!execution)
|
|
6361
|
+
actionError = normalized.error;
|
|
6362
|
+
}
|
|
5657
6363
|
}
|
|
5658
6364
|
catch (execErr) {
|
|
5659
6365
|
actionError = execErr instanceof Error ? execErr.message : "executeDesktopAction threw";
|
|
@@ -5724,6 +6430,7 @@ export class KairosRPCHandler {
|
|
|
5724
6430
|
return {
|
|
5725
6431
|
...serializeSession(session),
|
|
5726
6432
|
execution: execution ?? null,
|
|
6433
|
+
...(computerResult ? { computerResult } : {}),
|
|
5727
6434
|
...(actionError ? { actionError } : {}),
|
|
5728
6435
|
};
|
|
5729
6436
|
}
|
|
@@ -5731,6 +6438,215 @@ export class KairosRPCHandler {
|
|
|
5731
6438
|
throw toRpcError(err);
|
|
5732
6439
|
}
|
|
5733
6440
|
});
|
|
6441
|
+
// computer.session.safeStep — guardrailed sibling of computer.session.step.
|
|
6442
|
+
//
|
|
6443
|
+
// Same state-machine advance as `step`, but the action is routed through
|
|
6444
|
+
// the safe-execute composer so it is:
|
|
6445
|
+
// 1. Validated against the AtomicAction schema (validateAction)
|
|
6446
|
+
// 2. Tagged with a sensitivity (caller override > inferSensitivity)
|
|
6447
|
+
// 3. Gated on confidence (gateAction → execute / ask-user / abort)
|
|
6448
|
+
// 4. Coordinate-remapped from view-space → screen-space when a
|
|
6449
|
+
// ScaleContext is supplied (so model-emitted clicks land at the
|
|
6450
|
+
// correct OS pixel even on retina / downscaled displays)
|
|
6451
|
+
// 5. Dispatched to executeComputerAction → executeDesktopAction
|
|
6452
|
+
// (the same Layer-4 surface the legacy `step` handler uses)
|
|
6453
|
+
// 6. Recorded into the caller-threaded ReplaySession so step history
|
|
6454
|
+
// survives the RPC boundary and can be returned for replay UI
|
|
6455
|
+
//
|
|
6456
|
+
// The legacy `computer.session.step` handler is intentionally untouched
|
|
6457
|
+
// — callers that need raw dispatch keep it; new callers (computer-agent
|
|
6458
|
+
// step loop, iOS guarded-step UI) opt into safe-execute via this RPC.
|
|
6459
|
+
this.handlers.set("computer.session.safeStep", async (params) => {
|
|
6460
|
+
const sessionId = params["sessionId"];
|
|
6461
|
+
const deviceId = params["deviceId"];
|
|
6462
|
+
const action = params["action"];
|
|
6463
|
+
const confidence = params["confidence"];
|
|
6464
|
+
if (typeof sessionId !== "string")
|
|
6465
|
+
throw new Error("sessionId required");
|
|
6466
|
+
if (typeof deviceId !== "string")
|
|
6467
|
+
throw new Error("deviceId required");
|
|
6468
|
+
if (!action || typeof action !== "object") {
|
|
6469
|
+
throw new Error("action (object) required");
|
|
6470
|
+
}
|
|
6471
|
+
if (typeof confidence !== "number" || !Number.isFinite(confidence)) {
|
|
6472
|
+
throw new Error("confidence (finite number 0..1) required");
|
|
6473
|
+
}
|
|
6474
|
+
// Optional sensitivity override — when omitted, safe-execute infers
|
|
6475
|
+
// it from the action.type via inferSensitivity().
|
|
6476
|
+
const rawSensitivity = params["sensitivity"];
|
|
6477
|
+
let sensitivityOverride;
|
|
6478
|
+
if (rawSensitivity !== undefined) {
|
|
6479
|
+
if (rawSensitivity !== "read-only" &&
|
|
6480
|
+
rawSensitivity !== "navigation" &&
|
|
6481
|
+
rawSensitivity !== "input" &&
|
|
6482
|
+
rawSensitivity !== "destructive") {
|
|
6483
|
+
throw new Error("sensitivity must be one of: read-only|navigation|input|destructive");
|
|
6484
|
+
}
|
|
6485
|
+
sensitivityOverride = rawSensitivity;
|
|
6486
|
+
}
|
|
6487
|
+
// Optional ScaleContext — when provided, all coordinate fields on the
|
|
6488
|
+
// action are remapped from view-space → screen-space before dispatch.
|
|
6489
|
+
const rawScale = params["scale"];
|
|
6490
|
+
let scaleContext;
|
|
6491
|
+
if (rawScale !== undefined) {
|
|
6492
|
+
if (!rawScale || typeof rawScale !== "object") {
|
|
6493
|
+
throw new Error("scale must be an object");
|
|
6494
|
+
}
|
|
6495
|
+
const s = rawScale;
|
|
6496
|
+
const sw = s["screenWidth"];
|
|
6497
|
+
const sh = s["screenHeight"];
|
|
6498
|
+
const vw = s["viewWidth"];
|
|
6499
|
+
const vh = s["viewHeight"];
|
|
6500
|
+
if (typeof sw !== "number" ||
|
|
6501
|
+
typeof sh !== "number" ||
|
|
6502
|
+
typeof vw !== "number" ||
|
|
6503
|
+
typeof vh !== "number") {
|
|
6504
|
+
throw new Error("scale requires numeric screenWidth, screenHeight, viewWidth, viewHeight");
|
|
6505
|
+
}
|
|
6506
|
+
scaleContext = {
|
|
6507
|
+
screenWidth: sw,
|
|
6508
|
+
screenHeight: sh,
|
|
6509
|
+
viewWidth: vw,
|
|
6510
|
+
viewHeight: vh,
|
|
6511
|
+
};
|
|
6512
|
+
}
|
|
6513
|
+
// Optional caller-threaded ReplaySession — when omitted, a fresh one
|
|
6514
|
+
// is started using the sessionId so each RPC call still produces a
|
|
6515
|
+
// recorded step. Threading lets agents accumulate steps across calls.
|
|
6516
|
+
const rawSession = params["session"];
|
|
6517
|
+
let replaySession;
|
|
6518
|
+
if (rawSession === undefined) {
|
|
6519
|
+
replaySession = startRecording(sessionId);
|
|
6520
|
+
}
|
|
6521
|
+
else {
|
|
6522
|
+
if (!rawSession || typeof rawSession !== "object") {
|
|
6523
|
+
throw new Error("session must be an object");
|
|
6524
|
+
}
|
|
6525
|
+
const rs = rawSession;
|
|
6526
|
+
const rsId = rs["id"];
|
|
6527
|
+
const rsStartedAt = rs["startedAt"];
|
|
6528
|
+
const rsSteps = rs["steps"];
|
|
6529
|
+
if (typeof rsId !== "string" ||
|
|
6530
|
+
typeof rsStartedAt !== "number" ||
|
|
6531
|
+
!Array.isArray(rsSteps)) {
|
|
6532
|
+
throw new Error("session requires {id: string, startedAt: number, steps: array}");
|
|
6533
|
+
}
|
|
6534
|
+
// Honest stub: we accept the caller's session shape but freeze it
|
|
6535
|
+
// before threading so the immutability contract holds.
|
|
6536
|
+
replaySession = Object.freeze({
|
|
6537
|
+
id: rsId,
|
|
6538
|
+
startedAt: rsStartedAt,
|
|
6539
|
+
steps: Object.freeze(rsSteps.slice()),
|
|
6540
|
+
});
|
|
6541
|
+
}
|
|
6542
|
+
try {
|
|
6543
|
+
// Layer 1: advance the session state machine — same as `step`.
|
|
6544
|
+
// We feed the entire safeStep payload into the store so the audit
|
|
6545
|
+
// trail records BOTH the action and its confidence/sensitivity for
|
|
6546
|
+
// post-hoc analysis (this is why guardrailed steps exist).
|
|
6547
|
+
const session = this.computerSessionStore.step({
|
|
6548
|
+
sessionId,
|
|
6549
|
+
deviceId,
|
|
6550
|
+
step: {
|
|
6551
|
+
action,
|
|
6552
|
+
confidence,
|
|
6553
|
+
...(sensitivityOverride ? { sensitivity: sensitivityOverride } : {}),
|
|
6554
|
+
},
|
|
6555
|
+
});
|
|
6556
|
+
// Build the executor by wrapping executeComputerAction so that
|
|
6557
|
+
// safe-execute can dispatch through the same Layer-4 surface as the
|
|
6558
|
+
// legacy `step` handler. The atomic-action shape from
|
|
6559
|
+
// action-repertoire is converted on-the-fly into the
|
|
6560
|
+
// ComputerAction shape that executeComputerAction consumes.
|
|
6561
|
+
const executor = {
|
|
6562
|
+
async execute(atomic) {
|
|
6563
|
+
// Translate AtomicAction → {action: string, params} envelope so
|
|
6564
|
+
// normalizeComputerAction can produce the ComputerAction shape
|
|
6565
|
+
// the dispatch table expects. We mirror the same translation
|
|
6566
|
+
// surface as the legacy `step` handler so route-table behavior
|
|
6567
|
+
// is identical between guarded and raw paths.
|
|
6568
|
+
const translated = atomicToDesktopShape(atomic);
|
|
6569
|
+
if (!translated) {
|
|
6570
|
+
return {
|
|
6571
|
+
outcome: "",
|
|
6572
|
+
error: `unsupported atomic action: ${atomic.type}`,
|
|
6573
|
+
};
|
|
6574
|
+
}
|
|
6575
|
+
const normalized = normalizeComputerAction({
|
|
6576
|
+
action: translated.action,
|
|
6577
|
+
params: translated.params,
|
|
6578
|
+
});
|
|
6579
|
+
if (!normalized.ok) {
|
|
6580
|
+
return { outcome: "", error: normalized.error };
|
|
6581
|
+
}
|
|
6582
|
+
try {
|
|
6583
|
+
const result = await executeComputerAction({
|
|
6584
|
+
action: normalized.action,
|
|
6585
|
+
executeDesktopAction,
|
|
6586
|
+
});
|
|
6587
|
+
if (!result.ok) {
|
|
6588
|
+
return {
|
|
6589
|
+
outcome: result.output ?? "",
|
|
6590
|
+
error: result.error ?? "executor reported failure",
|
|
6591
|
+
};
|
|
6592
|
+
}
|
|
6593
|
+
return { outcome: result.output ?? "ok" };
|
|
6594
|
+
}
|
|
6595
|
+
catch (err) {
|
|
6596
|
+
return {
|
|
6597
|
+
outcome: "",
|
|
6598
|
+
error: err instanceof Error ? err.message : String(err),
|
|
6599
|
+
};
|
|
6600
|
+
}
|
|
6601
|
+
},
|
|
6602
|
+
};
|
|
6603
|
+
const safeReq = {
|
|
6604
|
+
action,
|
|
6605
|
+
confidence,
|
|
6606
|
+
...(sensitivityOverride ? { sensitivity: sensitivityOverride } : {}),
|
|
6607
|
+
...(scaleContext ? { scale: scaleContext } : {}),
|
|
6608
|
+
session: replaySession,
|
|
6609
|
+
executor,
|
|
6610
|
+
};
|
|
6611
|
+
const outcome = await safeExecute(safeReq);
|
|
6612
|
+
// Build a return envelope that mirrors safe-execute's tagged union
|
|
6613
|
+
// so callers can switch on `status` without re-deriving types.
|
|
6614
|
+
// `replaySession` is included on every branch (rejected returns
|
|
6615
|
+
// the unmodified session; executed/skipped return the appended one).
|
|
6616
|
+
if (outcome.status === "executed") {
|
|
6617
|
+
return {
|
|
6618
|
+
...serializeSession(session),
|
|
6619
|
+
status: outcome.status,
|
|
6620
|
+
action: outcome.action,
|
|
6621
|
+
outcome: outcome.outcome,
|
|
6622
|
+
decision: outcome.decision,
|
|
6623
|
+
replaySession: outcome.session,
|
|
6624
|
+
};
|
|
6625
|
+
}
|
|
6626
|
+
if (outcome.status === "skipped") {
|
|
6627
|
+
return {
|
|
6628
|
+
...serializeSession(session),
|
|
6629
|
+
status: outcome.status,
|
|
6630
|
+
action: outcome.action,
|
|
6631
|
+
outcome: outcome.reason,
|
|
6632
|
+
decision: outcome.decision,
|
|
6633
|
+
replaySession: outcome.session,
|
|
6634
|
+
};
|
|
6635
|
+
}
|
|
6636
|
+
// rejected — no action narrowed, no decision was made.
|
|
6637
|
+
return {
|
|
6638
|
+
...serializeSession(session),
|
|
6639
|
+
status: outcome.status,
|
|
6640
|
+
action: null,
|
|
6641
|
+
outcome: outcome.reason,
|
|
6642
|
+
decision: null,
|
|
6643
|
+
replaySession: outcome.session,
|
|
6644
|
+
};
|
|
6645
|
+
}
|
|
6646
|
+
catch (err) {
|
|
6647
|
+
throw toRpcError(err);
|
|
6648
|
+
}
|
|
6649
|
+
});
|
|
5734
6650
|
this.handlers.set("computer.session.requestApproval", async (params) => {
|
|
5735
6651
|
const sessionId = params["sessionId"];
|
|
5736
6652
|
const deviceId = params["deviceId"];
|
|
@@ -7583,10 +8499,16 @@ export class KairosRPCHandler {
|
|
|
7583
8499
|
if (typeof params["category"] === "string") {
|
|
7584
8500
|
filter.category = params["category"];
|
|
7585
8501
|
}
|
|
8502
|
+
if (typeof params["tag"] === "string")
|
|
8503
|
+
filter.tag = params["tag"];
|
|
8504
|
+
if (typeof params["source"] === "string")
|
|
8505
|
+
filter.source = params["source"];
|
|
7586
8506
|
if (params["favOnly"] === true)
|
|
7587
8507
|
filter.favOnly = true;
|
|
7588
8508
|
if (typeof params["query"] === "string")
|
|
7589
8509
|
filter.query = params["query"];
|
|
8510
|
+
if (typeof params["limit"] === "number")
|
|
8511
|
+
filter.limit = params["limit"];
|
|
7590
8512
|
const snippets = store.list(filter);
|
|
7591
8513
|
return { snippets, count: snippets.length };
|
|
7592
8514
|
}
|
|
@@ -7618,6 +8540,16 @@ export class KairosRPCHandler {
|
|
|
7618
8540
|
const upsertInput = { title, body, category, tags, isFavorite };
|
|
7619
8541
|
if (id !== undefined)
|
|
7620
8542
|
upsertInput.id = id;
|
|
8543
|
+
if (typeof params["source"] === "string")
|
|
8544
|
+
upsertInput.source = params["source"];
|
|
8545
|
+
if (typeof params["externalId"] === "string") {
|
|
8546
|
+
upsertInput.externalId = params["externalId"];
|
|
8547
|
+
}
|
|
8548
|
+
if (typeof params["sourceUrl"] === "string") {
|
|
8549
|
+
upsertInput.sourceUrl = params["sourceUrl"];
|
|
8550
|
+
}
|
|
8551
|
+
if (typeof params["version"] === "string")
|
|
8552
|
+
upsertInput.version = params["version"];
|
|
7621
8553
|
const snippet = store.upsert(upsertInput);
|
|
7622
8554
|
return { ok: true, snippet };
|
|
7623
8555
|
}
|
|
@@ -7676,6 +8608,58 @@ export class KairosRPCHandler {
|
|
|
7676
8608
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
7677
8609
|
}
|
|
7678
8610
|
});
|
|
8611
|
+
this.handlers.set("snippet.import", async (params) => {
|
|
8612
|
+
if (!this.runtime)
|
|
8613
|
+
return { error: "Runtime not initialized" };
|
|
8614
|
+
const store = this.runtime.getSnippetStore();
|
|
8615
|
+
if (!store)
|
|
8616
|
+
return { error: "SnippetStore not available" };
|
|
8617
|
+
try {
|
|
8618
|
+
const tags = Array.isArray(params["tags"])
|
|
8619
|
+
? params["tags"].filter((tag) => typeof tag === "string")
|
|
8620
|
+
: [];
|
|
8621
|
+
const options = {
|
|
8622
|
+
...(typeof params["source"] === "string" ? { source: params["source"] } : {}),
|
|
8623
|
+
...(typeof params["version"] === "string"
|
|
8624
|
+
? { version: params["version"] }
|
|
8625
|
+
: {}),
|
|
8626
|
+
...(typeof params["sourceUrl"] === "string"
|
|
8627
|
+
? { sourceUrl: params["sourceUrl"] }
|
|
8628
|
+
: {}),
|
|
8629
|
+
...(typeof params["category"] === "string"
|
|
8630
|
+
? { category: params["category"] }
|
|
8631
|
+
: {}),
|
|
8632
|
+
...(tags.length > 0 ? { tags } : {}),
|
|
8633
|
+
};
|
|
8634
|
+
if (typeof params["text"] === "string") {
|
|
8635
|
+
const corpus = parsePromptCorpusText(params["text"], options);
|
|
8636
|
+
const result = store.importCorpus(corpus);
|
|
8637
|
+
return { ok: true, ...result, count: result.snippets.length };
|
|
8638
|
+
}
|
|
8639
|
+
if (Array.isArray(params["snippets"])) {
|
|
8640
|
+
const source = typeof params["source"] === "string" && params["source"].trim().length > 0
|
|
8641
|
+
? params["source"]
|
|
8642
|
+
: "manual-import";
|
|
8643
|
+
const corpus = {
|
|
8644
|
+
source,
|
|
8645
|
+
snippets: params["snippets"].filter((item) => typeof item === "object" &&
|
|
8646
|
+
item !== null &&
|
|
8647
|
+
typeof item["title"] === "string" &&
|
|
8648
|
+
typeof item["body"] === "string"),
|
|
8649
|
+
...(options.version ? { version: options.version } : {}),
|
|
8650
|
+
...(options.sourceUrl ? { sourceUrl: options.sourceUrl } : {}),
|
|
8651
|
+
...(options.category ? { category: options.category } : {}),
|
|
8652
|
+
...(options.tags ? { tags: options.tags } : {}),
|
|
8653
|
+
};
|
|
8654
|
+
const result = store.importCorpus(corpus);
|
|
8655
|
+
return { ok: true, ...result, count: result.snippets.length };
|
|
8656
|
+
}
|
|
8657
|
+
return { error: "text or snippets required" };
|
|
8658
|
+
}
|
|
8659
|
+
catch (err) {
|
|
8660
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
8661
|
+
}
|
|
8662
|
+
});
|
|
7679
8663
|
this.handlers.set("snippet.get", async (params) => {
|
|
7680
8664
|
if (!this.runtime)
|
|
7681
8665
|
return { error: "Runtime not initialized" };
|
|
@@ -7708,6 +8692,25 @@ export class KairosRPCHandler {
|
|
|
7708
8692
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
7709
8693
|
}
|
|
7710
8694
|
});
|
|
8695
|
+
this.handlers.set("ingest.capabilities", async () => {
|
|
8696
|
+
try {
|
|
8697
|
+
const markitdown = await getMarkitdownCapabilities();
|
|
8698
|
+
return {
|
|
8699
|
+
ok: true,
|
|
8700
|
+
markitdown,
|
|
8701
|
+
modalities: {
|
|
8702
|
+
documents: ["pdf", "docx", "xlsx", "pptx", "text"],
|
|
8703
|
+
images: ["ocr"],
|
|
8704
|
+
audio: ["transcription"],
|
|
8705
|
+
notes: ["markdown", "text", "org", "frontmatter", "wikilinks"],
|
|
8706
|
+
},
|
|
8707
|
+
notes: "This report is runtime-probed: unavailable entries are honest capability gaps, not hidden stubs.",
|
|
8708
|
+
};
|
|
8709
|
+
}
|
|
8710
|
+
catch (err) {
|
|
8711
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
8712
|
+
}
|
|
8713
|
+
});
|
|
7711
8714
|
// 23. Hooks Inventory — list registered hooks. Audit found the
|
|
7712
8715
|
// daemon registered zero `hooks.*` methods despite shipping 21
|
|
7713
8716
|
// hook events + 23 BUILT_IN guards (per CLAUDE.md). UIs had no
|
|
@@ -7968,65 +8971,172 @@ export class KairosRPCHandler {
|
|
|
7968
8971
|
}
|
|
7969
8972
|
});
|
|
7970
8973
|
// ── Screen control (3 methods) ─────────────────────────────
|
|
8974
|
+
this.handlers.set("screen.stream", async () => {
|
|
8975
|
+
try {
|
|
8976
|
+
const testCapture = takeScreenshot();
|
|
8977
|
+
if (!testCapture) {
|
|
8978
|
+
return {
|
|
8979
|
+
streamId: `stream-${Date.now()}`,
|
|
8980
|
+
status: "unavailable",
|
|
8981
|
+
format: "mjpeg",
|
|
8982
|
+
reason: "Screen recording permission required",
|
|
8983
|
+
};
|
|
8984
|
+
}
|
|
8985
|
+
try {
|
|
8986
|
+
unlinkSync(testCapture.path);
|
|
8987
|
+
}
|
|
8988
|
+
catch {
|
|
8989
|
+
/* best-effort cleanup */
|
|
8990
|
+
}
|
|
8991
|
+
return {
|
|
8992
|
+
streamId: `stream-${Date.now()}`,
|
|
8993
|
+
status: "active",
|
|
8994
|
+
format: "mjpeg",
|
|
8995
|
+
captureAvailable: true,
|
|
8996
|
+
};
|
|
8997
|
+
}
|
|
8998
|
+
catch (err) {
|
|
8999
|
+
return {
|
|
9000
|
+
streamId: `stream-${Date.now()}`,
|
|
9001
|
+
status: "unavailable",
|
|
9002
|
+
format: "mjpeg",
|
|
9003
|
+
reason: err instanceof Error ? err.message : String(err),
|
|
9004
|
+
};
|
|
9005
|
+
}
|
|
9006
|
+
});
|
|
7971
9007
|
this.handlers.set("screen.capture", async () => {
|
|
7972
|
-
const bindings = ext()?.getComputerBindings?.();
|
|
7973
|
-
if (!bindings)
|
|
7974
|
-
return { error: "Computer bindings not available" };
|
|
7975
9008
|
try {
|
|
7976
|
-
const img =
|
|
9009
|
+
const img = takeScreenshot();
|
|
9010
|
+
if (!img)
|
|
9011
|
+
return { error: "Screen recording permission required" };
|
|
9012
|
+
const image = readFileSync(img.path).toString("base64");
|
|
9013
|
+
const observation = buildObservationFrame({
|
|
9014
|
+
screenshot: img,
|
|
9015
|
+
image,
|
|
9016
|
+
environment: process.platform === "darwin"
|
|
9017
|
+
? "macos"
|
|
9018
|
+
: process.platform === "linux"
|
|
9019
|
+
? "linux"
|
|
9020
|
+
: "unknown",
|
|
9021
|
+
});
|
|
9022
|
+
try {
|
|
9023
|
+
unlinkSync(img.path);
|
|
9024
|
+
}
|
|
9025
|
+
catch {
|
|
9026
|
+
/* best-effort cleanup */
|
|
9027
|
+
}
|
|
7977
9028
|
return {
|
|
7978
|
-
image
|
|
9029
|
+
image,
|
|
7979
9030
|
width: img.width,
|
|
7980
9031
|
height: img.height,
|
|
7981
9032
|
format: img.format ?? "png",
|
|
7982
|
-
timestamp:
|
|
9033
|
+
timestamp: observation.timestamp,
|
|
9034
|
+
observation,
|
|
7983
9035
|
};
|
|
7984
9036
|
}
|
|
7985
9037
|
catch (err) {
|
|
7986
9038
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
7987
9039
|
}
|
|
7988
9040
|
});
|
|
9041
|
+
this.handlers.set("computer.driver.observe", async () => {
|
|
9042
|
+
try {
|
|
9043
|
+
const img = takeScreenshot();
|
|
9044
|
+
if (!img)
|
|
9045
|
+
return { error: "Screen recording permission required" };
|
|
9046
|
+
const image = readFileSync(img.path).toString("base64");
|
|
9047
|
+
const observation = buildObservationFrame({
|
|
9048
|
+
screenshot: img,
|
|
9049
|
+
image,
|
|
9050
|
+
environment: process.platform === "darwin"
|
|
9051
|
+
? "macos"
|
|
9052
|
+
: process.platform === "linux"
|
|
9053
|
+
? "linux"
|
|
9054
|
+
: process.platform === "win32"
|
|
9055
|
+
? "windows"
|
|
9056
|
+
: "unknown",
|
|
9057
|
+
});
|
|
9058
|
+
try {
|
|
9059
|
+
unlinkSync(img.path);
|
|
9060
|
+
}
|
|
9061
|
+
catch {
|
|
9062
|
+
/* best-effort cleanup */
|
|
9063
|
+
}
|
|
9064
|
+
return observation;
|
|
9065
|
+
}
|
|
9066
|
+
catch (err) {
|
|
9067
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
9068
|
+
}
|
|
9069
|
+
});
|
|
9070
|
+
this.handlers.set("computer.driver.execute", async (params) => {
|
|
9071
|
+
const normalized = normalizeComputerAction({
|
|
9072
|
+
action: params["action"],
|
|
9073
|
+
params: params["params"],
|
|
9074
|
+
});
|
|
9075
|
+
if (!normalized.ok)
|
|
9076
|
+
return { success: false, error: normalized.error };
|
|
9077
|
+
const result = await executeComputerAction({
|
|
9078
|
+
action: normalized.action,
|
|
9079
|
+
executeDesktopAction,
|
|
9080
|
+
});
|
|
9081
|
+
return {
|
|
9082
|
+
success: result.ok,
|
|
9083
|
+
...result,
|
|
9084
|
+
};
|
|
9085
|
+
});
|
|
7989
9086
|
this.handlers.set("screen.input", async (params) => {
|
|
7990
|
-
const
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
const
|
|
9087
|
+
const raw = params;
|
|
9088
|
+
const kind = String(raw["action"] ?? raw["kind"] ?? "").toLowerCase();
|
|
9089
|
+
const routeParams = {};
|
|
9090
|
+
for (const key of ["x", "y", "endX", "endY", "direction", "amount", "button", "clicks"]) {
|
|
9091
|
+
const value = raw[key];
|
|
9092
|
+
if (value !== undefined)
|
|
9093
|
+
routeParams[key] = String(value);
|
|
9094
|
+
}
|
|
7994
9095
|
try {
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
9096
|
+
let action = kind;
|
|
9097
|
+
if (kind === "doubleclick") {
|
|
9098
|
+
action = "click";
|
|
9099
|
+
routeParams["clicks"] = "2";
|
|
7999
9100
|
}
|
|
8000
|
-
if (kind === "
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
return { ok: true };
|
|
8004
|
-
}
|
|
8005
|
-
if (kind === "scroll") {
|
|
8006
|
-
const { dx, dy } = params;
|
|
8007
|
-
await bindings.scroll(dx ?? 0, dy ?? 0);
|
|
8008
|
-
return { ok: true };
|
|
9101
|
+
else if (kind === "rightclick") {
|
|
9102
|
+
action = "click";
|
|
9103
|
+
routeParams["button"] = "right";
|
|
8009
9104
|
}
|
|
8010
|
-
|
|
9105
|
+
const result = executeDesktopAction({ action, params: routeParams });
|
|
9106
|
+
if (!result)
|
|
9107
|
+
return { success: false, error: `unknown kind: ${kind}` };
|
|
9108
|
+
return result.success
|
|
9109
|
+
? { success: true, ok: true, output: result.output }
|
|
9110
|
+
: { success: false, error: result.output };
|
|
8011
9111
|
}
|
|
8012
9112
|
catch (err) {
|
|
8013
|
-
return { error: err instanceof Error ? err.message : String(err) };
|
|
9113
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
8014
9114
|
}
|
|
8015
9115
|
});
|
|
8016
9116
|
this.handlers.set("screen.keyboard", async (params) => {
|
|
8017
|
-
const
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
9117
|
+
const raw = params;
|
|
9118
|
+
try {
|
|
9119
|
+
const text = typeof raw.text === "string" ? raw.text : "";
|
|
9120
|
+
if (text.length > 0) {
|
|
9121
|
+
const result = executeDesktopAction({ action: "type", params: { text } });
|
|
9122
|
+
return result?.success
|
|
9123
|
+
? { success: true, ok: true, output: result.output }
|
|
9124
|
+
: { success: false, error: result?.output ?? "Typing failed" };
|
|
9125
|
+
}
|
|
9126
|
+
const combo = typeof raw.key === "string"
|
|
9127
|
+
? raw.key
|
|
9128
|
+
: typeof raw.combo === "string"
|
|
9129
|
+
? raw.combo
|
|
9130
|
+
: Array.isArray(raw.keys)
|
|
9131
|
+
? raw.keys.filter((key) => typeof key === "string").join("+")
|
|
9132
|
+
: "";
|
|
9133
|
+
const result = executeDesktopAction({ action: "key", params: { key: combo } });
|
|
9134
|
+
return result?.success
|
|
9135
|
+
? { success: true, ok: true, output: result.output }
|
|
9136
|
+
: { success: false, error: result?.output ?? "Key press failed" };
|
|
8027
9137
|
}
|
|
8028
9138
|
catch (err) {
|
|
8029
|
-
return { error: err instanceof Error ? err.message : String(err) };
|
|
9139
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
8030
9140
|
}
|
|
8031
9141
|
});
|
|
8032
9142
|
// ── Morning briefing ───────────────────────────────────────
|
|
@@ -8042,19 +9152,9 @@ export class KairosRPCHandler {
|
|
|
8042
9152
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
8043
9153
|
}
|
|
8044
9154
|
}
|
|
8045
|
-
// Fallback: assemble from available subsystems
|
|
8046
|
-
const costTracker = this.runtime.getCostTracker();
|
|
8047
|
-
const sessions = ext()?.getSessionManager?.()?.listRecent?.(5) ?? [];
|
|
8048
9155
|
return {
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
today: costTracker.getTodayCost(),
|
|
8052
|
-
weekly: costTracker.getWeeklyCost(),
|
|
8053
|
-
},
|
|
8054
|
-
recentSessions: sessions,
|
|
8055
|
-
weather: null,
|
|
8056
|
-
calendar: [],
|
|
8057
|
-
tasks: [],
|
|
9156
|
+
available: false,
|
|
9157
|
+
error: "Daily briefing is not connected to real overnight activity yet.",
|
|
8058
9158
|
};
|
|
8059
9159
|
});
|
|
8060
9160
|
// ── Meet summarize ─────────────────────────────────────────
|
|
@@ -8151,8 +9251,9 @@ export class KairosRPCHandler {
|
|
|
8151
9251
|
try {
|
|
8152
9252
|
// iOS sends its public key as base64 of the raw SEC 1 uncompressed
|
|
8153
9253
|
// representation (65 bytes with 0x04 prefix). Buffer.from handles
|
|
8154
|
-
//
|
|
8155
|
-
|
|
9254
|
+
// CryptoKit may send raw X/Y bytes; Node ECDH expects X9.63 with
|
|
9255
|
+
// the 0x04 prefix.
|
|
9256
|
+
const clientPubRaw = normalizeP256PublicKey(Buffer.from(publicKey, "base64"));
|
|
8156
9257
|
const ecdh = createECDH("prime256v1");
|
|
8157
9258
|
ecdh.generateKeys();
|
|
8158
9259
|
const serverPubRaw = ecdh.getPublicKey(); // 65-byte uncompressed SEC 1
|
|
@@ -8169,6 +9270,7 @@ export class KairosRPCHandler {
|
|
|
8169
9270
|
this.ecdhSessions.delete(k);
|
|
8170
9271
|
}
|
|
8171
9272
|
return {
|
|
9273
|
+
publicKey: serverPubRaw.toString("base64"),
|
|
8172
9274
|
serverPublicKey: serverPubRaw.toString("base64"),
|
|
8173
9275
|
sessionId: sid,
|
|
8174
9276
|
keyFingerprint: derivedKey.subarray(0, 8).toString("hex"),
|
|
@@ -8747,7 +9849,8 @@ export class KairosRPCHandler {
|
|
|
8747
9849
|
return { ok: true, empty: true, message: "no WOTANN home — nothing to export" };
|
|
8748
9850
|
}
|
|
8749
9851
|
const ts = new Date().toISOString().replace(/[:.]/g, "-");
|
|
8750
|
-
const
|
|
9852
|
+
const { tmpdir } = await import("node:os");
|
|
9853
|
+
const outDir = tmpdir();
|
|
8751
9854
|
const path = await import("node:path");
|
|
8752
9855
|
const outPath = path.join(outDir, `wotann-export-${ts}.tar.gz`);
|
|
8753
9856
|
const { execFileNoThrow } = await import("../utils/execFileNoThrow.js");
|
|
@@ -8862,22 +9965,62 @@ export class KairosRPCHandler {
|
|
|
8862
9965
|
// Surfaces the local plugin directory's `plugin.json` manifests so the
|
|
8863
9966
|
// marketplace UI can list installed plugins and what they expose.
|
|
8864
9967
|
this.handlers.set("plugins.list", async (params) => {
|
|
9968
|
+
let runtimePlugins = [];
|
|
8865
9969
|
try {
|
|
8866
9970
|
const { loadPlugins } = await import("../marketplace/plugin-loader.js");
|
|
8867
9971
|
const { resolveWotannHome } = await import("../utils/wotann-home.js");
|
|
9972
|
+
runtimePlugins = (() => {
|
|
9973
|
+
if (!this.runtime)
|
|
9974
|
+
return [];
|
|
9975
|
+
try {
|
|
9976
|
+
const lifecycle = this.runtime.getPluginLifecycle();
|
|
9977
|
+
const stats = lifecycle.getStats();
|
|
9978
|
+
const pluginSet = new Map();
|
|
9979
|
+
for (const event of Object.keys(stats)) {
|
|
9980
|
+
const hooks = lifecycle.getHooks(event);
|
|
9981
|
+
for (const hook of hooks) {
|
|
9982
|
+
const existing = pluginSet.get(hook.pluginName);
|
|
9983
|
+
if (existing) {
|
|
9984
|
+
if (!existing.events.includes(event))
|
|
9985
|
+
existing.events.push(event);
|
|
9986
|
+
existing.hookCount++;
|
|
9987
|
+
}
|
|
9988
|
+
else {
|
|
9989
|
+
pluginSet.set(hook.pluginName, { events: [event], hookCount: 1 });
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
}
|
|
9993
|
+
return [...pluginSet.entries()].map(([name, info]) => ({
|
|
9994
|
+
name,
|
|
9995
|
+
events: info.events,
|
|
9996
|
+
hookCount: info.hookCount,
|
|
9997
|
+
enabled: true,
|
|
9998
|
+
}));
|
|
9999
|
+
}
|
|
10000
|
+
catch {
|
|
10001
|
+
return [];
|
|
10002
|
+
}
|
|
10003
|
+
})();
|
|
8868
10004
|
const root = params.pluginsRoot ?? `${resolveWotannHome()}/plugins`;
|
|
8869
10005
|
const result = loadPlugins({ pluginsRoot: root });
|
|
8870
10006
|
if (result.ok) {
|
|
8871
10007
|
return {
|
|
8872
10008
|
ok: true,
|
|
8873
10009
|
plugins: result.plugins,
|
|
10010
|
+
runtimePlugins,
|
|
8874
10011
|
skipped: result.skipped,
|
|
8875
10012
|
};
|
|
8876
10013
|
}
|
|
8877
|
-
return { ok: false, error: result.error };
|
|
10014
|
+
return { ok: false, error: result.error, runtimePlugins };
|
|
8878
10015
|
}
|
|
8879
10016
|
catch (err) {
|
|
8880
|
-
return {
|
|
10017
|
+
return {
|
|
10018
|
+
ok: false,
|
|
10019
|
+
error: err instanceof Error ? err.message : String(err),
|
|
10020
|
+
plugins: [],
|
|
10021
|
+
runtimePlugins,
|
|
10022
|
+
skipped: [],
|
|
10023
|
+
};
|
|
8881
10024
|
}
|
|
8882
10025
|
});
|
|
8883
10026
|
// ── Connector webhook server (resurrected). Lifecycle is opt-in via
|
|
@@ -9703,11 +10846,16 @@ export class KairosRPCHandler {
|
|
|
9703
10846
|
if (this.cloudOffloadRegistry)
|
|
9704
10847
|
return this.cloudOffloadRegistry;
|
|
9705
10848
|
const { createCloudOffloadRegistry } = await import("../providers/cloud-offload/adapter.js");
|
|
10849
|
+
const { loadCloudOffloadAdaptersFromFile } = await import("../providers/cloud-offload/config-loader.js");
|
|
9706
10850
|
this.cloudOffloadRegistry = createCloudOffloadRegistry();
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
10851
|
+
const configPath = join(resolveWotannHome(), "cloud-offload.yaml");
|
|
10852
|
+
const loaded = loadCloudOffloadAdaptersFromFile({ filePath: configPath, env: process.env });
|
|
10853
|
+
for (const adapter of loaded.adapters) {
|
|
10854
|
+
this.cloudOffloadRegistry.register(adapter);
|
|
10855
|
+
}
|
|
10856
|
+
for (const warning of loaded.warnings) {
|
|
10857
|
+
console.warn(`[kairos-rpc] ${warning}`);
|
|
10858
|
+
}
|
|
9711
10859
|
return this.cloudOffloadRegistry;
|
|
9712
10860
|
}
|
|
9713
10861
|
/**
|