wotann 0.5.0 → 0.5.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/background-agent.d.ts.map +1 -1
- package/dist/agents/background-agent.js +2 -1
- package/dist/agents/background-agent.js.map +1 -1
- package/dist/agents/file-scope-policy.d.ts +116 -0
- package/dist/agents/file-scope-policy.d.ts.map +1 -0
- package/dist/agents/file-scope-policy.js +190 -0
- package/dist/agents/file-scope-policy.js.map +1 -0
- package/dist/agents/yaml-manifest.d.ts +125 -0
- package/dist/agents/yaml-manifest.d.ts.map +1 -0
- package/dist/agents/yaml-manifest.js +901 -0
- package/dist/agents/yaml-manifest.js.map +1 -0
- package/dist/auth/login.d.ts +3 -3
- package/dist/auth/login.d.ts.map +1 -1
- package/dist/auth/login.js +80 -23
- package/dist/auth/login.js.map +1 -1
- package/dist/autopilot/completion-oracle.d.ts.map +1 -1
- package/dist/autopilot/completion-oracle.js +3 -1
- package/dist/autopilot/completion-oracle.js.map +1 -1
- package/dist/autopilot/run-manifest.d.ts +90 -0
- package/dist/autopilot/run-manifest.d.ts.map +1 -0
- package/dist/autopilot/run-manifest.js +261 -0
- package/dist/autopilot/run-manifest.js.map +1 -0
- package/dist/browser/adaptive-selectors.d.ts +170 -0
- package/dist/browser/adaptive-selectors.d.ts.map +1 -0
- package/dist/browser/adaptive-selectors.js +317 -0
- package/dist/browser/adaptive-selectors.js.map +1 -0
- package/dist/browser/humanize-input.d.ts +76 -0
- package/dist/browser/humanize-input.d.ts.map +1 -0
- package/dist/browser/humanize-input.js +386 -0
- package/dist/browser/humanize-input.js.map +1 -0
- package/dist/channels/teams.d.ts +41 -19
- package/dist/channels/teams.d.ts.map +1 -1
- package/dist/channels/teams.js +121 -24
- package/dist/channels/teams.js.map +1 -1
- package/dist/channels/terminal-mention.d.ts.map +1 -1
- package/dist/channels/terminal-mention.js +4 -1
- package/dist/channels/terminal-mention.js.map +1 -1
- package/dist/cli/commands/blast-radius.d.ts +47 -0
- package/dist/cli/commands/blast-radius.d.ts.map +1 -0
- package/dist/cli/commands/blast-radius.js +123 -0
- package/dist/cli/commands/blast-radius.js.map +1 -0
- package/dist/cli/commands/evolve.d.ts +92 -0
- package/dist/cli/commands/evolve.d.ts.map +1 -0
- package/dist/cli/commands/evolve.js +336 -0
- package/dist/cli/commands/evolve.js.map +1 -0
- package/dist/cli/commands/learning.d.ts +54 -0
- package/dist/cli/commands/learning.d.ts.map +1 -0
- package/dist/cli/commands/learning.js +380 -0
- package/dist/cli/commands/learning.js.map +1 -0
- package/dist/cli/commands/persona.d.ts +42 -0
- package/dist/cli/commands/persona.d.ts.map +1 -0
- package/dist/cli/commands/persona.js +198 -0
- package/dist/cli/commands/persona.js.map +1 -0
- package/dist/cli/commands/stuck.d.ts.map +1 -1
- package/dist/cli/commands/stuck.js +5 -2
- package/dist/cli/commands/stuck.js.map +1 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +5 -2
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/orphan-wires/agent-manifest-cmd.d.ts +17 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.js +99 -0
- package/dist/cli/orphan-wires/agent-manifest-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/arena-cmd.d.ts +26 -0
- package/dist/cli/orphan-wires/arena-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/arena-cmd.js +167 -0
- package/dist/cli/orphan-wires/arena-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/artifact-cmd.d.ts +17 -0
- package/dist/cli/orphan-wires/artifact-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/artifact-cmd.js +175 -0
- package/dist/cli/orphan-wires/artifact-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/demo-cmd.d.ts +25 -0
- package/dist/cli/orphan-wires/demo-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/demo-cmd.js +164 -0
- package/dist/cli/orphan-wires/demo-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/extras-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/extras-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/extras-cmd.js +289 -0
- package/dist/cli/orphan-wires/extras-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.d.ts +15 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.js +36 -0
- package/dist/cli/orphan-wires/harness-introspect-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/index.d.ts.map +1 -1
- package/dist/cli/orphan-wires/index.js +30 -0
- package/dist/cli/orphan-wires/index.js.map +1 -1
- package/dist/cli/orphan-wires/integrations-cmd.d.ts +38 -0
- package/dist/cli/orphan-wires/integrations-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/integrations-cmd.js +345 -0
- package/dist/cli/orphan-wires/integrations-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.d.ts +18 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.js +127 -0
- package/dist/cli/orphan-wires/mcp-scaffold-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.d.ts +21 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.js +86 -0
- package/dist/cli/orphan-wires/memory-consolidate-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/patch-cmd.d.ts +29 -0
- package/dist/cli/orphan-wires/patch-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/patch-cmd.js +150 -0
- package/dist/cli/orphan-wires/patch-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.d.ts +28 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.js +169 -0
- package/dist/cli/orphan-wires/redteam-scan-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.d.ts +21 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.js +70 -0
- package/dist/cli/orphan-wires/scrape-adapt-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.js +74 -0
- package/dist/cli/orphan-wires/shell-tier-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.d.ts +18 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.js +87 -0
- package/dist/cli/orphan-wires/sub-recipes-cmd.js.map +1 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.d.ts +20 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.d.ts.map +1 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.js +115 -0
- package/dist/cli/orphan-wires/webapp-test-cmd.js.map +1 -0
- package/dist/cli/thin-client.d.ts +17 -10
- package/dist/cli/thin-client.d.ts.map +1 -1
- package/dist/cli/thin-client.js +108 -26
- package/dist/cli/thin-client.js.map +1 -1
- package/dist/computer-use/action-history-compactor.d.ts +92 -0
- package/dist/computer-use/action-history-compactor.d.ts.map +1 -0
- package/dist/computer-use/action-history-compactor.js +204 -0
- package/dist/computer-use/action-history-compactor.js.map +1 -0
- package/dist/computer-use/action-repertoire.d.ts +8 -0
- package/dist/computer-use/action-repertoire.d.ts.map +1 -1
- package/dist/computer-use/action-repertoire.js +19 -0
- package/dist/computer-use/action-repertoire.js.map +1 -1
- package/dist/computer-use/computer-agent.d.ts +232 -2
- package/dist/computer-use/computer-agent.d.ts.map +1 -1
- package/dist/computer-use/computer-agent.js +558 -19
- package/dist/computer-use/computer-agent.js.map +1 -1
- package/dist/computer-use/coordinate-scaling.d.ts +104 -0
- package/dist/computer-use/coordinate-scaling.d.ts.map +1 -0
- package/dist/computer-use/coordinate-scaling.js +175 -0
- package/dist/computer-use/coordinate-scaling.js.map +1 -0
- package/dist/computer-use/driver-contract.d.ts +158 -0
- package/dist/computer-use/driver-contract.d.ts.map +1 -0
- package/dist/computer-use/driver-contract.js +471 -0
- package/dist/computer-use/driver-contract.js.map +1 -0
- package/dist/computer-use/perception-engine.d.ts +39 -0
- package/dist/computer-use/perception-engine.d.ts.map +1 -1
- package/dist/computer-use/perception-engine.js +27 -27
- package/dist/computer-use/perception-engine.js.map +1 -1
- package/dist/computer-use/platform-bindings.d.ts.map +1 -1
- package/dist/computer-use/platform-bindings.js +216 -2
- package/dist/computer-use/platform-bindings.js.map +1 -1
- package/dist/computer-use/safe-execute.d.ts +86 -0
- package/dist/computer-use/safe-execute.d.ts.map +1 -0
- package/dist/computer-use/safe-execute.js +152 -0
- package/dist/computer-use/safe-execute.js.map +1 -0
- package/dist/context/branch-summarization.d.ts +97 -0
- package/dist/context/branch-summarization.d.ts.map +1 -0
- package/dist/context/branch-summarization.js +170 -0
- package/dist/context/branch-summarization.js.map +1 -0
- package/dist/context/compaction.d.ts +16 -1
- package/dist/context/compaction.d.ts.map +1 -1
- package/dist/context/compaction.js +50 -2
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/inspector.d.ts +2 -2
- package/dist/context/inspector.d.ts.map +1 -1
- package/dist/context/inspector.js +4 -3
- package/dist/context/inspector.js.map +1 -1
- package/dist/core/agent-bridge.d.ts.map +1 -1
- package/dist/core/agent-bridge.js +200 -69
- package/dist/core/agent-bridge.js.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +7 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/mode-model-preference.d.ts +95 -0
- package/dist/core/mode-model-preference.d.ts.map +1 -0
- package/dist/core/mode-model-preference.js +170 -0
- package/dist/core/mode-model-preference.js.map +1 -0
- package/dist/core/prompt-override.d.ts.map +1 -1
- package/dist/core/prompt-override.js +1 -0
- package/dist/core/prompt-override.js.map +1 -1
- package/dist/core/runtime-intelligence.d.ts +11 -0
- package/dist/core/runtime-intelligence.d.ts.map +1 -1
- package/dist/core/runtime-intelligence.js +18 -3
- package/dist/core/runtime-intelligence.js.map +1 -1
- package/dist/core/runtime-tool-dispatch.js +1 -1
- package/dist/core/runtime-tool-dispatch.js.map +1 -1
- package/dist/core/runtime.d.ts +186 -13
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +717 -228
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/session-rewind.d.ts +67 -0
- package/dist/core/session-rewind.d.ts.map +1 -0
- package/dist/core/session-rewind.js +120 -0
- package/dist/core/session-rewind.js.map +1 -0
- package/dist/core/types.d.ts +19 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/daemon/file-watcher.d.ts +84 -0
- package/dist/daemon/file-watcher.d.ts.map +1 -0
- package/dist/daemon/file-watcher.js +193 -0
- package/dist/daemon/file-watcher.js.map +1 -0
- package/dist/daemon/jsonl-mode.d.ts +11 -0
- package/dist/daemon/jsonl-mode.d.ts.map +1 -0
- package/dist/daemon/jsonl-mode.js +77 -0
- package/dist/daemon/jsonl-mode.js.map +1 -0
- package/dist/daemon/kairos-ipc.d.ts +4 -1
- package/dist/daemon/kairos-ipc.d.ts.map +1 -1
- package/dist/daemon/kairos-ipc.js +38 -22
- package/dist/daemon/kairos-ipc.js.map +1 -1
- package/dist/daemon/kairos-rpc.d.ts +5 -1
- package/dist/daemon/kairos-rpc.d.ts.map +1 -1
- package/dist/daemon/kairos-rpc.js +1262 -114
- package/dist/daemon/kairos-rpc.js.map +1 -1
- package/dist/daemon/kairos.d.ts +35 -4
- package/dist/daemon/kairos.d.ts.map +1 -1
- package/dist/daemon/kairos.js +204 -24
- package/dist/daemon/kairos.js.map +1 -1
- package/dist/daemon/rpc-handlers/intelligence-rpc.d.ts.map +1 -1
- package/dist/daemon/rpc-handlers/intelligence-rpc.js +15 -3
- package/dist/daemon/rpc-handlers/intelligence-rpc.js.map +1 -1
- package/dist/daemon/transport/jsonl.d.ts +7 -0
- package/dist/daemon/transport/jsonl.d.ts.map +1 -0
- package/dist/daemon/transport/jsonl.js +38 -0
- package/dist/daemon/transport/jsonl.js.map +1 -0
- package/dist/daemon/transport/socket-path.d.ts +28 -0
- package/dist/daemon/transport/socket-path.d.ts.map +1 -0
- package/dist/daemon/transport/socket-path.js +36 -0
- package/dist/daemon/transport/socket-path.js.map +1 -0
- package/dist/design/theme-presets.d.ts +77 -0
- package/dist/design/theme-presets.d.ts.map +1 -0
- package/dist/design/theme-presets.js +274 -0
- package/dist/design/theme-presets.js.map +1 -0
- package/dist/desktop/companion-server.d.ts +67 -4
- package/dist/desktop/companion-server.d.ts.map +1 -1
- package/dist/desktop/companion-server.js +617 -70
- package/dist/desktop/companion-server.js.map +1 -1
- package/dist/desktop/web-artifacts-builder.d.ts +108 -0
- package/dist/desktop/web-artifacts-builder.d.ts.map +1 -0
- package/dist/desktop/web-artifacts-builder.js +184 -0
- package/dist/desktop/web-artifacts-builder.js.map +1 -0
- package/dist/hooks/built-in.d.ts.map +1 -1
- package/dist/hooks/built-in.js +15 -10
- package/dist/hooks/built-in.js.map +1 -1
- package/dist/index.js +1301 -167
- package/dist/index.js.map +1 -1
- package/dist/integrations/integration-manifest.d.ts +140 -0
- package/dist/integrations/integration-manifest.d.ts.map +1 -0
- package/dist/integrations/integration-manifest.js +268 -0
- package/dist/integrations/integration-manifest.js.map +1 -0
- package/dist/intelligence/apply-patch-dsl.d.ts +112 -0
- package/dist/intelligence/apply-patch-dsl.d.ts.map +1 -0
- package/dist/intelligence/apply-patch-dsl.js +264 -0
- package/dist/intelligence/apply-patch-dsl.js.map +1 -0
- package/dist/intelligence/apply-patch-executor.d.ts +147 -0
- package/dist/intelligence/apply-patch-executor.d.ts.map +1 -0
- package/dist/intelligence/apply-patch-executor.js +418 -0
- package/dist/intelligence/apply-patch-executor.js.map +1 -0
- package/dist/intelligence/blast-radius.d.ts +67 -0
- package/dist/intelligence/blast-radius.d.ts.map +1 -0
- package/dist/intelligence/blast-radius.js +536 -0
- package/dist/intelligence/blast-radius.js.map +1 -0
- package/dist/intelligence/code-graph.d.ts +58 -7
- package/dist/intelligence/code-graph.d.ts.map +1 -1
- package/dist/intelligence/code-graph.js +347 -16
- package/dist/intelligence/code-graph.js.map +1 -1
- package/dist/intelligence/codebase-health.d.ts.map +1 -1
- package/dist/intelligence/codebase-health.js +4 -3
- package/dist/intelligence/codebase-health.js.map +1 -1
- package/dist/intelligence/codemaps.d.ts +30 -1
- package/dist/intelligence/codemaps.d.ts.map +1 -1
- package/dist/intelligence/codemaps.js +99 -16
- package/dist/intelligence/codemaps.js.map +1 -1
- package/dist/intelligence/consecutive-error-counter.d.ts +89 -0
- package/dist/intelligence/consecutive-error-counter.d.ts.map +1 -0
- package/dist/intelligence/consecutive-error-counter.js +151 -0
- package/dist/intelligence/consecutive-error-counter.js.map +1 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.d.ts +87 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.d.ts.map +1 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.js +882 -0
- package/dist/intelligence/eval-frameworks/redteam-plugin-catalog.js.map +1 -0
- package/dist/intelligence/extractors/mineru.d.ts +108 -0
- package/dist/intelligence/extractors/mineru.d.ts.map +1 -0
- package/dist/intelligence/extractors/mineru.js +352 -0
- package/dist/intelligence/extractors/mineru.js.map +1 -0
- package/dist/intelligence/harness-introspect.d.ts +124 -0
- package/dist/intelligence/harness-introspect.d.ts.map +1 -0
- package/dist/intelligence/harness-introspect.js +349 -0
- package/dist/intelligence/harness-introspect.js.map +1 -0
- package/dist/intelligence/multi-patch-voter.d.ts +59 -1
- package/dist/intelligence/multi-patch-voter.d.ts.map +1 -1
- package/dist/intelligence/multi-patch-voter.js +191 -27
- package/dist/intelligence/multi-patch-voter.js.map +1 -1
- package/dist/intelligence/multimodal-extract.d.ts +44 -0
- package/dist/intelligence/multimodal-extract.d.ts.map +1 -1
- package/dist/intelligence/multimodal-extract.js +40 -1
- package/dist/intelligence/multimodal-extract.js.map +1 -1
- package/dist/intelligence/research-loops/budgeted-research.d.ts +7 -0
- package/dist/intelligence/research-loops/budgeted-research.d.ts.map +1 -1
- package/dist/intelligence/research-loops/budgeted-research.js +18 -0
- package/dist/intelligence/research-loops/budgeted-research.js.map +1 -1
- package/dist/intelligence/research-loops/constraint-guided-explorer.d.ts +124 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.d.ts.map +1 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.js +177 -0
- package/dist/intelligence/research-loops/constraint-guided-explorer.js.map +1 -0
- package/dist/intelligence/research-loops/results-collector.d.ts +62 -0
- package/dist/intelligence/research-loops/results-collector.d.ts.map +1 -0
- package/dist/intelligence/research-loops/results-collector.js +128 -0
- package/dist/intelligence/research-loops/results-collector.js.map +1 -0
- package/dist/intelligence/research-loops/results-log.d.ts +94 -0
- package/dist/intelligence/research-loops/results-log.d.ts.map +1 -0
- package/dist/intelligence/research-loops/results-log.js +178 -0
- package/dist/intelligence/research-loops/results-log.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.d.ts +111 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.js +72 -0
- package/dist/intelligence/research-loops/strategies/base-strategy.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.d.ts +57 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.js +172 -0
- package/dist/intelligence/research-loops/strategies/dual-confidence.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.d.ts +68 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.js +221 -0
- package/dist/intelligence/research-loops/strategies/langgraph-agent.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.d.ts +42 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.js +132 -0
- package/dist/intelligence/research-loops/strategies/parallel-constrained.js.map +1 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.d.ts +55 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.js +187 -0
- package/dist/intelligence/research-loops/strategies/recursive-decomposition.js.map +1 -0
- package/dist/intelligence/research-loops/strategy-registry.d.ts +43 -0
- package/dist/intelligence/research-loops/strategy-registry.d.ts.map +1 -0
- package/dist/intelligence/research-loops/strategy-registry.js +62 -0
- package/dist/intelligence/research-loops/strategy-registry.js.map +1 -0
- package/dist/intelligence/research-strategies.d.ts +133 -0
- package/dist/intelligence/research-strategies.d.ts.map +1 -0
- package/dist/intelligence/research-strategies.js +204 -0
- package/dist/intelligence/research-strategies.js.map +1 -0
- package/dist/lib.d.ts +49 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +133 -0
- package/dist/lib.js.map +1 -1
- package/dist/loop/tool-description-reset.d.ts +113 -0
- package/dist/loop/tool-description-reset.d.ts.map +1 -0
- package/dist/loop/tool-description-reset.js +136 -0
- package/dist/loop/tool-description-reset.js.map +1 -0
- package/dist/lsp/server-registry.d.ts.map +1 -1
- package/dist/lsp/server-registry.js +2 -1
- package/dist/lsp/server-registry.js.map +1 -1
- package/dist/lsp/symbol-operations.d.ts.map +1 -1
- package/dist/lsp/symbol-operations.js +2 -1
- package/dist/lsp/symbol-operations.js.map +1 -1
- package/dist/marketplace/acp-agent-registry.d.ts.map +1 -1
- package/dist/marketplace/acp-agent-registry.js +2 -1
- package/dist/marketplace/acp-agent-registry.js.map +1 -1
- package/dist/marketplace/marketplace-source-git.d.ts +135 -0
- package/dist/marketplace/marketplace-source-git.d.ts.map +1 -0
- package/dist/marketplace/marketplace-source-git.js +211 -0
- package/dist/marketplace/marketplace-source-git.js.map +1 -0
- package/dist/marketplace/registry.d.ts +87 -0
- package/dist/marketplace/registry.d.ts.map +1 -1
- package/dist/marketplace/registry.js +113 -2
- package/dist/marketplace/registry.js.map +1 -1
- package/dist/mcp/chrome-devtools.d.ts +62 -2
- package/dist/mcp/chrome-devtools.d.ts.map +1 -1
- package/dist/mcp/chrome-devtools.js +183 -1
- package/dist/mcp/chrome-devtools.js.map +1 -1
- package/dist/mcp/health-probe.d.ts +1 -0
- package/dist/mcp/health-probe.d.ts.map +1 -1
- package/dist/mcp/health-probe.js +32 -1
- package/dist/mcp/health-probe.js.map +1 -1
- package/dist/mcp/mcp-scaffolder.d.ts +166 -0
- package/dist/mcp/mcp-scaffolder.d.ts.map +1 -0
- package/dist/mcp/mcp-scaffolder.js +526 -0
- package/dist/mcp/mcp-scaffolder.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -1
- package/dist/mcp/mcp-server.js +55 -0
- package/dist/mcp/mcp-server.js.map +1 -1
- package/dist/mcp/memory-mcp.d.ts +163 -0
- package/dist/mcp/memory-mcp.d.ts.map +1 -0
- package/dist/mcp/memory-mcp.js +368 -0
- package/dist/mcp/memory-mcp.js.map +1 -0
- package/dist/mcp/tool-loader.d.ts.map +1 -1
- package/dist/mcp/tool-loader.js +13 -0
- package/dist/mcp/tool-loader.js.map +1 -1
- package/dist/meet/meeting-runtime.d.ts.map +1 -1
- package/dist/meet/meeting-runtime.js +3 -1
- package/dist/meet/meeting-runtime.js.map +1 -1
- package/dist/memory/incremental-indexer.d.ts.map +1 -1
- package/dist/memory/incremental-indexer.js +5 -1
- package/dist/memory/incremental-indexer.js.map +1 -1
- package/dist/memory/qmd-integration.d.ts.map +1 -1
- package/dist/memory/qmd-integration.js +47 -15
- package/dist/memory/qmd-integration.js.map +1 -1
- package/dist/memory/two-phase-consolidator.d.ts +118 -0
- package/dist/memory/two-phase-consolidator.d.ts.map +1 -0
- package/dist/memory/two-phase-consolidator.js +265 -0
- package/dist/memory/two-phase-consolidator.js.map +1 -0
- package/dist/middleware/doom-loop.d.ts +21 -0
- package/dist/middleware/doom-loop.d.ts.map +1 -1
- package/dist/middleware/doom-loop.js +49 -6
- package/dist/middleware/doom-loop.js.map +1 -1
- package/dist/middleware/loop-detection.d.ts +176 -6
- package/dist/middleware/loop-detection.d.ts.map +1 -1
- package/dist/middleware/loop-detection.js +341 -6
- package/dist/middleware/loop-detection.js.map +1 -1
- package/dist/middleware/pipeline.d.ts +9 -1
- package/dist/middleware/pipeline.d.ts.map +1 -1
- package/dist/middleware/pipeline.js +116 -1
- package/dist/middleware/pipeline.js.map +1 -1
- package/dist/middleware/tool-flow-gate.d.ts +20 -0
- package/dist/middleware/tool-flow-gate.d.ts.map +1 -1
- package/dist/middleware/tool-flow-gate.js +93 -0
- package/dist/middleware/tool-flow-gate.js.map +1 -1
- package/dist/mobile/ios-app.d.ts +18 -1
- package/dist/mobile/ios-app.d.ts.map +1 -1
- package/dist/mobile/ios-app.js +108 -8
- package/dist/mobile/ios-app.js.map +1 -1
- package/dist/orchestration/adversarial-cut.d.ts +85 -0
- package/dist/orchestration/adversarial-cut.d.ts.map +1 -0
- package/dist/orchestration/adversarial-cut.js +222 -0
- package/dist/orchestration/adversarial-cut.js.map +1 -0
- package/dist/orchestration/agent-kanban.d.ts +147 -0
- package/dist/orchestration/agent-kanban.d.ts.map +1 -0
- package/dist/orchestration/agent-kanban.js +414 -0
- package/dist/orchestration/agent-kanban.js.map +1 -0
- package/dist/orchestration/autonomous.d.ts +111 -0
- package/dist/orchestration/autonomous.d.ts.map +1 -1
- package/dist/orchestration/autonomous.js +183 -6
- package/dist/orchestration/autonomous.js.map +1 -1
- package/dist/orchestration/elo-tournament.d.ts +90 -0
- package/dist/orchestration/elo-tournament.d.ts.map +1 -0
- package/dist/orchestration/elo-tournament.js +203 -0
- package/dist/orchestration/elo-tournament.js.map +1 -0
- package/dist/orchestration/multi-model-arena.d.ts +138 -0
- package/dist/orchestration/multi-model-arena.d.ts.map +1 -0
- package/dist/orchestration/multi-model-arena.js +298 -0
- package/dist/orchestration/multi-model-arena.js.map +1 -0
- package/dist/orchestration/review-pipeline.d.ts +78 -0
- package/dist/orchestration/review-pipeline.d.ts.map +1 -0
- package/dist/orchestration/review-pipeline.js +202 -0
- package/dist/orchestration/review-pipeline.js.map +1 -0
- package/dist/orchestration/unified-state-thread.d.ts +186 -0
- package/dist/orchestration/unified-state-thread.d.ts.map +1 -0
- package/dist/orchestration/unified-state-thread.js +327 -0
- package/dist/orchestration/unified-state-thread.js.map +1 -0
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +2 -1
- package/dist/plugins/manager.js.map +1 -1
- package/dist/prompt/engine.d.ts +7 -0
- package/dist/prompt/engine.d.ts.map +1 -1
- package/dist/prompt/engine.js.map +1 -1
- package/dist/prompt/modules/caveman.d.ts +51 -0
- package/dist/prompt/modules/caveman.d.ts.map +1 -0
- package/dist/prompt/modules/caveman.js +97 -0
- package/dist/prompt/modules/caveman.js.map +1 -0
- package/dist/prompt/modules/index.d.ts +1 -0
- package/dist/prompt/modules/index.d.ts.map +1 -1
- package/dist/prompt/modules/index.js +3 -0
- package/dist/prompt/modules/index.js.map +1 -1
- package/dist/providers/account-pool.d.ts.map +1 -1
- package/dist/providers/account-pool.js +1 -0
- package/dist/providers/account-pool.js.map +1 -1
- package/dist/providers/anthropic-adapter.d.ts.map +1 -1
- package/dist/providers/anthropic-adapter.js +33 -0
- package/dist/providers/anthropic-adapter.js.map +1 -1
- package/dist/providers/cloud-offload/config-loader.d.ts +20 -0
- package/dist/providers/cloud-offload/config-loader.d.ts.map +1 -0
- package/dist/providers/cloud-offload/config-loader.js +148 -0
- package/dist/providers/cloud-offload/config-loader.js.map +1 -0
- package/dist/providers/codex-adapter.d.ts.map +1 -1
- package/dist/providers/codex-adapter.js +136 -4
- package/dist/providers/codex-adapter.js.map +1 -1
- package/dist/providers/discovery.d.ts.map +1 -1
- package/dist/providers/discovery.js +20 -0
- package/dist/providers/discovery.js.map +1 -1
- package/dist/providers/effort-cascade.d.ts +113 -0
- package/dist/providers/effort-cascade.d.ts.map +1 -0
- package/dist/providers/effort-cascade.js +215 -0
- package/dist/providers/effort-cascade.js.map +1 -0
- package/dist/providers/fallback-chain.d.ts.map +1 -1
- package/dist/providers/fallback-chain.js +1 -0
- package/dist/providers/fallback-chain.js.map +1 -1
- package/dist/providers/health-check.d.ts.map +1 -1
- package/dist/providers/health-check.js +8 -0
- package/dist/providers/health-check.js.map +1 -1
- package/dist/providers/model-defaults.d.ts +1 -1
- package/dist/providers/model-defaults.d.ts.map +1 -1
- package/dist/providers/model-defaults.js +13 -1
- package/dist/providers/model-defaults.js.map +1 -1
- package/dist/providers/model-discovery.d.ts.map +1 -1
- package/dist/providers/model-discovery.js +1 -0
- package/dist/providers/model-discovery.js.map +1 -1
- package/dist/providers/ollama-adapter.d.ts.map +1 -1
- package/dist/providers/ollama-adapter.js +21 -1
- package/dist/providers/ollama-adapter.js.map +1 -1
- package/dist/providers/openai-compat-adapter.d.ts.map +1 -1
- package/dist/providers/openai-compat-adapter.js +25 -0
- package/dist/providers/openai-compat-adapter.js.map +1 -1
- package/dist/providers/preset-library.d.ts.map +1 -1
- package/dist/providers/preset-library.js +9 -0
- package/dist/providers/preset-library.js.map +1 -1
- package/dist/providers/provider-service.d.ts.map +1 -1
- package/dist/providers/provider-service.js +40 -1
- package/dist/providers/provider-service.js.map +1 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +7 -0
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/sticky-rotation.d.ts +100 -0
- package/dist/providers/sticky-rotation.d.ts.map +1 -0
- package/dist/providers/sticky-rotation.js +134 -0
- package/dist/providers/sticky-rotation.js.map +1 -0
- package/dist/providers/tool-parsers/parsers.d.ts.map +1 -1
- package/dist/providers/tool-parsers/parsers.js +17 -4
- package/dist/providers/tool-parsers/parsers.js.map +1 -1
- package/dist/providers/types.d.ts +25 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/recipes/final-output.d.ts +74 -0
- package/dist/recipes/final-output.d.ts.map +1 -0
- package/dist/recipes/final-output.js +232 -0
- package/dist/recipes/final-output.js.map +1 -0
- package/dist/recipes/recipe-loader.d.ts.map +1 -1
- package/dist/recipes/recipe-loader.js +29 -0
- package/dist/recipes/recipe-loader.js.map +1 -1
- package/dist/recipes/recipe-runtime.d.ts.map +1 -1
- package/dist/recipes/recipe-runtime.js +31 -0
- package/dist/recipes/recipe-runtime.js.map +1 -1
- package/dist/recipes/recipe-types.d.ts +28 -0
- package/dist/recipes/recipe-types.d.ts.map +1 -1
- package/dist/recipes/sop-crystallizer.d.ts +90 -0
- package/dist/recipes/sop-crystallizer.d.ts.map +1 -0
- package/dist/recipes/sop-crystallizer.js +238 -0
- package/dist/recipes/sop-crystallizer.js.map +1 -0
- package/dist/recipes/sub-recipe-orchestrator.d.ts +126 -0
- package/dist/recipes/sub-recipe-orchestrator.d.ts.map +1 -0
- package/dist/recipes/sub-recipe-orchestrator.js +225 -0
- package/dist/recipes/sub-recipe-orchestrator.js.map +1 -0
- package/dist/sandbox/extended-backends.d.ts.map +1 -1
- package/dist/sandbox/extended-backends.js +7 -2
- package/dist/sandbox/extended-backends.js.map +1 -1
- package/dist/sandbox/seatbelt-policy.d.ts +132 -0
- package/dist/sandbox/seatbelt-policy.d.ts.map +1 -0
- package/dist/sandbox/seatbelt-policy.js +562 -0
- package/dist/sandbox/seatbelt-policy.js.map +1 -0
- package/dist/sandbox/terminal-backends.d.ts.map +1 -1
- package/dist/sandbox/terminal-backends.js +3 -1
- package/dist/sandbox/terminal-backends.js.map +1 -1
- package/dist/security/auto-mode-ruleset.d.ts +142 -0
- package/dist/security/auto-mode-ruleset.d.ts.map +1 -0
- package/dist/security/auto-mode-ruleset.js +264 -0
- package/dist/security/auto-mode-ruleset.js.map +1 -0
- package/dist/security/bash-arity-policy.d.ts +70 -0
- package/dist/security/bash-arity-policy.d.ts.map +1 -0
- package/dist/security/bash-arity-policy.js +189 -0
- package/dist/security/bash-arity-policy.js.map +1 -0
- package/dist/security/command-sanitizer.d.ts.map +1 -1
- package/dist/security/command-sanitizer.js +24 -0
- package/dist/security/command-sanitizer.js.map +1 -1
- package/dist/security/credential-broker.d.ts +136 -0
- package/dist/security/credential-broker.d.ts.map +1 -0
- package/dist/security/credential-broker.js +284 -0
- package/dist/security/credential-broker.js.map +1 -0
- package/dist/security/invisible-text-sanitizer.d.ts +114 -0
- package/dist/security/invisible-text-sanitizer.d.ts.map +1 -0
- package/dist/security/invisible-text-sanitizer.js +221 -0
- package/dist/security/invisible-text-sanitizer.js.map +1 -0
- package/dist/security/osv-check.d.ts +174 -0
- package/dist/security/osv-check.d.ts.map +1 -0
- package/dist/security/osv-check.js +409 -0
- package/dist/security/osv-check.js.map +1 -0
- package/dist/security/process-hardening.d.ts +114 -0
- package/dist/security/process-hardening.d.ts.map +1 -0
- package/dist/security/process-hardening.js +132 -0
- package/dist/security/process-hardening.js.map +1 -0
- package/dist/security/shell-escalation-tiers.d.ts +73 -0
- package/dist/security/shell-escalation-tiers.d.ts.map +1 -0
- package/dist/security/shell-escalation-tiers.js +439 -0
- package/dist/security/shell-escalation-tiers.js.map +1 -0
- package/dist/session/fork.d.ts +100 -0
- package/dist/session/fork.d.ts.map +1 -0
- package/dist/session/fork.js +223 -0
- package/dist/session/fork.js.map +1 -0
- package/dist/skills/activation-telemetry.d.ts +154 -0
- package/dist/skills/activation-telemetry.d.ts.map +1 -0
- package/dist/skills/activation-telemetry.js +274 -0
- package/dist/skills/activation-telemetry.js.map +1 -0
- package/dist/skills/agentskills-registry.d.ts +12 -1
- package/dist/skills/agentskills-registry.d.ts.map +1 -1
- package/dist/skills/agentskills-registry.js +11 -0
- package/dist/skills/agentskills-registry.js.map +1 -1
- package/dist/skills/description-optimizer.d.ts +101 -0
- package/dist/skills/description-optimizer.d.ts.map +1 -0
- package/dist/skills/description-optimizer.js +304 -0
- package/dist/skills/description-optimizer.js.map +1 -0
- package/dist/skills/history-deduper.d.ts +109 -0
- package/dist/skills/history-deduper.d.ts.map +1 -0
- package/dist/skills/history-deduper.js +222 -0
- package/dist/skills/history-deduper.js.map +1 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +2 -1
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/skill-source-adapter.d.ts +16 -0
- package/dist/skills/skill-source-adapter.d.ts.map +1 -1
- package/dist/skills/skill-source-adapter.js +0 -0
- package/dist/skills/skill-source-adapter.js.map +1 -1
- package/dist/skills/skill-standard.d.ts +29 -4
- package/dist/skills/skill-standard.d.ts.map +1 -1
- package/dist/skills/skill-standard.js +139 -66
- package/dist/skills/skill-standard.js.map +1 -1
- package/dist/skills/sop-completion-gate.d.ts +137 -0
- package/dist/skills/sop-completion-gate.d.ts.map +1 -0
- package/dist/skills/sop-completion-gate.js +159 -0
- package/dist/skills/sop-completion-gate.js.map +1 -0
- package/dist/skills/sop-template.d.ts +85 -0
- package/dist/skills/sop-template.d.ts.map +1 -0
- package/dist/skills/sop-template.js +106 -0
- package/dist/skills/sop-template.js.map +1 -0
- package/dist/skills/wotann-skills-registry.d.ts +1 -1
- package/dist/skills/wotann-skills-registry.d.ts.map +1 -1
- package/dist/skills/wotann-skills-registry.js +503 -0
- package/dist/skills/wotann-skills-registry.js.map +1 -1
- package/dist/snippets/prompt-corpus.d.ts +10 -0
- package/dist/snippets/prompt-corpus.d.ts.map +1 -0
- package/dist/snippets/prompt-corpus.js +158 -0
- package/dist/snippets/prompt-corpus.js.map +1 -0
- package/dist/snippets/snippet-store.d.ts +27 -0
- package/dist/snippets/snippet-store.d.ts.map +1 -1
- package/dist/snippets/snippet-store.js +109 -6
- package/dist/snippets/snippet-store.js.map +1 -1
- package/dist/storage/sqlite-node-backend.d.ts +47 -36
- package/dist/storage/sqlite-node-backend.d.ts.map +1 -1
- package/dist/storage/sqlite-node-backend.js +250 -94
- package/dist/storage/sqlite-node-backend.js.map +1 -1
- package/dist/testing/webapp-server-lifecycle.d.ts +74 -0
- package/dist/testing/webapp-server-lifecycle.d.ts.map +1 -0
- package/dist/testing/webapp-server-lifecycle.js +272 -0
- package/dist/testing/webapp-server-lifecycle.js.map +1 -0
- package/dist/tools/markitdown-bridge.d.ts +19 -0
- package/dist/tools/markitdown-bridge.d.ts.map +1 -1
- package/dist/tools/markitdown-bridge.js +167 -2
- package/dist/tools/markitdown-bridge.js.map +1 -1
- package/dist/tools/pdf-processor.d.ts.map +1 -1
- package/dist/tools/pdf-processor.js +7 -3
- package/dist/tools/pdf-processor.js.map +1 -1
- package/dist/tools/pptx-processor.d.ts +51 -0
- package/dist/tools/pptx-processor.d.ts.map +1 -0
- package/dist/tools/pptx-processor.js +334 -0
- package/dist/tools/pptx-processor.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +1661 -149
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/agent-tools.d.ts +60 -0
- package/dist/ui/agent-tools.d.ts.map +1 -0
- package/dist/ui/agent-tools.js +468 -0
- package/dist/ui/agent-tools.js.map +1 -0
- package/dist/ui/alt-buffer-mode.d.ts +68 -0
- package/dist/ui/alt-buffer-mode.d.ts.map +1 -0
- package/dist/ui/alt-buffer-mode.js +114 -0
- package/dist/ui/alt-buffer-mode.js.map +1 -0
- package/dist/ui/alt-buffer.d.ts +57 -10
- package/dist/ui/alt-buffer.d.ts.map +1 -1
- package/dist/ui/alt-buffer.js +54 -12
- package/dist/ui/alt-buffer.js.map +1 -1
- package/dist/ui/components/AgentStatusPanel.d.ts.map +1 -1
- package/dist/ui/components/AgentStatusPanel.js +14 -6
- package/dist/ui/components/AgentStatusPanel.js.map +1 -1
- package/dist/ui/components/AuditLogPanel.js +3 -3
- package/dist/ui/components/AuditLogPanel.js.map +1 -1
- package/dist/ui/components/AutomationsPanel.js +3 -3
- package/dist/ui/components/AutomationsPanel.js.map +1 -1
- package/dist/ui/components/ChatView.d.ts +9 -1
- package/dist/ui/components/ChatView.d.ts.map +1 -1
- package/dist/ui/components/ChatView.js +503 -14
- package/dist/ui/components/ChatView.js.map +1 -1
- package/dist/ui/components/CommandPaletteCommands.d.ts +2 -0
- package/dist/ui/components/CommandPaletteCommands.d.ts.map +1 -1
- package/dist/ui/components/CommandPaletteCommands.js +18 -2
- package/dist/ui/components/CommandPaletteCommands.js.map +1 -1
- package/dist/ui/components/ContextHUD.d.ts.map +1 -1
- package/dist/ui/components/ContextHUD.js +3 -3
- package/dist/ui/components/ContextHUD.js.map +1 -1
- package/dist/ui/components/DispatchInbox.js +3 -3
- package/dist/ui/components/DispatchInbox.js.map +1 -1
- package/dist/ui/components/GdprPanel.d.ts.map +1 -1
- package/dist/ui/components/GdprPanel.js +2 -3
- package/dist/ui/components/GdprPanel.js.map +1 -1
- package/dist/ui/components/HistoryPicker.js +3 -3
- package/dist/ui/components/HistoryPicker.js.map +1 -1
- package/dist/ui/components/ModelPicker.d.ts +9 -6
- package/dist/ui/components/ModelPicker.d.ts.map +1 -1
- package/dist/ui/components/ModelPicker.js +12 -9
- package/dist/ui/components/ModelPicker.js.map +1 -1
- package/dist/ui/components/OptionPicker.js +3 -3
- package/dist/ui/components/OptionPicker.js.map +1 -1
- package/dist/ui/components/PermissionPrompt.js +3 -3
- package/dist/ui/components/PermissionPrompt.js.map +1 -1
- package/dist/ui/components/PromptInput.d.ts.map +1 -1
- package/dist/ui/components/PromptInput.js +65 -10
- package/dist/ui/components/PromptInput.js.map +1 -1
- package/dist/ui/components/ProviderSetupOverlay.d.ts +19 -0
- package/dist/ui/components/ProviderSetupOverlay.d.ts.map +1 -0
- package/dist/ui/components/ProviderSetupOverlay.js +124 -0
- package/dist/ui/components/ProviderSetupOverlay.js.map +1 -0
- package/dist/ui/components/StartupScreen.d.ts.map +1 -1
- package/dist/ui/components/StartupScreen.js +10 -1
- package/dist/ui/components/StartupScreen.js.map +1 -1
- package/dist/ui/components/StatusBar.d.ts.map +1 -1
- package/dist/ui/components/StatusBar.js +3 -3
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/TrustPanel.js +3 -3
- package/dist/ui/components/TrustPanel.js.map +1 -1
- package/dist/ui/components/UnifiedStatusBar.d.ts.map +1 -1
- package/dist/ui/components/UnifiedStatusBar.js +76 -5
- package/dist/ui/components/UnifiedStatusBar.js.map +1 -1
- package/dist/ui/computer-action-parser.d.ts +6 -0
- package/dist/ui/computer-action-parser.d.ts.map +1 -0
- package/dist/ui/computer-action-parser.js +119 -0
- package/dist/ui/computer-action-parser.js.map +1 -0
- package/dist/ui/helpers.d.ts +1 -1
- package/dist/ui/helpers.d.ts.map +1 -1
- package/dist/ui/helpers.js +1 -1
- package/dist/ui/helpers.js.map +1 -1
- package/dist/ui/keybindings.d.ts +12 -2
- package/dist/ui/keybindings.d.ts.map +1 -1
- package/dist/ui/keybindings.js +36 -4
- package/dist/ui/keybindings.js.map +1 -1
- package/dist/ui/markdown-stream.d.ts +99 -0
- package/dist/ui/markdown-stream.d.ts.map +1 -0
- package/dist/ui/markdown-stream.js +314 -0
- package/dist/ui/markdown-stream.js.map +1 -0
- package/dist/ui/terminal-keyboard-protocol.d.ts +23 -0
- package/dist/ui/terminal-keyboard-protocol.d.ts.map +1 -0
- package/dist/ui/terminal-keyboard-protocol.js +72 -0
- package/dist/ui/terminal-keyboard-protocol.js.map +1 -0
- package/dist/ui/theme/context.d.ts +39 -0
- package/dist/ui/theme/context.d.ts.map +1 -0
- package/dist/ui/theme/context.js +42 -0
- package/dist/ui/theme/context.js.map +1 -0
- package/dist/utils/platform.d.ts +115 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +146 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/verification/auto-verify-policy.d.ts +107 -0
- package/dist/verification/auto-verify-policy.d.ts.map +1 -0
- package/dist/verification/auto-verify-policy.js +309 -0
- package/dist/verification/auto-verify-policy.js.map +1 -0
- package/package.json +4 -1
- package/skills/anthropic-finance/audit-spreadsheet.md +165 -0
- package/skills/anthropic-finance/clean-data-xls.md +59 -0
- package/skills/anthropic-finance/competitive-analysis.md +288 -0
- package/skills/anthropic-finance/compliance-rules-engine.md +56 -0
- package/skills/anthropic-finance/dd-checklist.md +126 -0
- package/skills/anthropic-finance/independent-recompute.md +47 -0
- package/skills/anthropic-finance/reconcile-root-cause.md +48 -0
- package/skills/anthropic-finance/roll-forward.md +42 -0
- package/skills/anthropic-finance/untrusted-doc-parse.md +57 -0
- package/skills/anthropic-finance/variance-commentary.md +43 -0
- package/skills/doubt-driven-development.md +95 -0
- package/skills/mattpocock/diagnose.md +126 -0
- package/skills/mattpocock/grill-with-docs.md +97 -0
- package/skills/mattpocock/improve-codebase-architecture.md +80 -0
- package/skills/mattpocock/prototype.md +39 -0
- package/skills/mattpocock/review.md +87 -0
- package/skills/mattpocock/tdd.md +118 -0
- package/skills/mattpocock/zoom-out.md +17 -0
- package/skills/scientific/citation-management/SKILL.md +1113 -0
- package/skills/scientific/citation-management/assets/bibtex_template.bib +264 -0
- package/skills/scientific/citation-management/assets/citation_checklist.md +386 -0
- package/skills/scientific/citation-management/references/bibtex_formatting.md +908 -0
- package/skills/scientific/citation-management/references/citation_validation.md +794 -0
- package/skills/scientific/citation-management/references/google_scholar_search.md +725 -0
- package/skills/scientific/citation-management/references/metadata_extraction.md +870 -0
- package/skills/scientific/citation-management/references/pubmed_search.md +839 -0
- package/skills/scientific/citation-management/scripts/doi_to_bibtex.py +204 -0
- package/skills/scientific/citation-management/scripts/extract_metadata.py +569 -0
- package/skills/scientific/citation-management/scripts/format_bibtex.py +349 -0
- package/skills/scientific/citation-management/scripts/generate_schematic.py +139 -0
- package/skills/scientific/citation-management/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/citation-management/scripts/search_google_scholar.py +282 -0
- package/skills/scientific/citation-management/scripts/search_pubmed.py +398 -0
- package/skills/scientific/citation-management/scripts/validate_citations.py +497 -0
- package/skills/scientific/database-lookup/SKILL.md +480 -0
- package/skills/scientific/database-lookup/references/addgene.md +38 -0
- package/skills/scientific/database-lookup/references/alphafold.md +40 -0
- package/skills/scientific/database-lookup/references/alphavantage.md +261 -0
- package/skills/scientific/database-lookup/references/bea.md +409 -0
- package/skills/scientific/database-lookup/references/bindingdb.md +85 -0
- package/skills/scientific/database-lookup/references/biogrid.md +110 -0
- package/skills/scientific/database-lookup/references/bls.md +235 -0
- package/skills/scientific/database-lookup/references/brenda.md +71 -0
- package/skills/scientific/database-lookup/references/cbioportal.md +206 -0
- package/skills/scientific/database-lookup/references/census.md +251 -0
- package/skills/scientific/database-lookup/references/chebi.md +103 -0
- package/skills/scientific/database-lookup/references/chembl.md +80 -0
- package/skills/scientific/database-lookup/references/clinicaltrials.md +77 -0
- package/skills/scientific/database-lookup/references/clinpgx.md +64 -0
- package/skills/scientific/database-lookup/references/clinvar.md +91 -0
- package/skills/scientific/database-lookup/references/cod.md +121 -0
- package/skills/scientific/database-lookup/references/cosmic.md +59 -0
- package/skills/scientific/database-lookup/references/dailymed.md +65 -0
- package/skills/scientific/database-lookup/references/datacommons.md +237 -0
- package/skills/scientific/database-lookup/references/dbsnp.md +143 -0
- package/skills/scientific/database-lookup/references/disgenet.md +52 -0
- package/skills/scientific/database-lookup/references/drugbank.md +54 -0
- package/skills/scientific/database-lookup/references/ecb.md +191 -0
- package/skills/scientific/database-lookup/references/emdb.md +37 -0
- package/skills/scientific/database-lookup/references/ena.md +372 -0
- package/skills/scientific/database-lookup/references/encode.md +47 -0
- package/skills/scientific/database-lookup/references/ensembl.md +539 -0
- package/skills/scientific/database-lookup/references/epa.md +232 -0
- package/skills/scientific/database-lookup/references/eurostat.md +237 -0
- package/skills/scientific/database-lookup/references/fda.md +64 -0
- package/skills/scientific/database-lookup/references/federal-reserve.md +216 -0
- package/skills/scientific/database-lookup/references/fred.md +297 -0
- package/skills/scientific/database-lookup/references/gene-ontology.md +147 -0
- package/skills/scientific/database-lookup/references/geo.md +130 -0
- package/skills/scientific/database-lookup/references/gnomad.md +93 -0
- package/skills/scientific/database-lookup/references/gtex.md +136 -0
- package/skills/scientific/database-lookup/references/gwas-catalog.md +46 -0
- package/skills/scientific/database-lookup/references/hca.md +35 -0
- package/skills/scientific/database-lookup/references/hpo.md +48 -0
- package/skills/scientific/database-lookup/references/human-protein-atlas.md +57 -0
- package/skills/scientific/database-lookup/references/interpro.md +120 -0
- package/skills/scientific/database-lookup/references/jaspar.md +50 -0
- package/skills/scientific/database-lookup/references/kegg.md +78 -0
- package/skills/scientific/database-lookup/references/lincs-l1000.md +68 -0
- package/skills/scientific/database-lookup/references/materials-project.md +123 -0
- package/skills/scientific/database-lookup/references/metabolomics-workbench.md +98 -0
- package/skills/scientific/database-lookup/references/monarch.md +46 -0
- package/skills/scientific/database-lookup/references/mousemine.md +40 -0
- package/skills/scientific/database-lookup/references/nasa-exoplanet-archive.md +112 -0
- package/skills/scientific/database-lookup/references/nasa.md +121 -0
- package/skills/scientific/database-lookup/references/ncbi-gene.md +64 -0
- package/skills/scientific/database-lookup/references/ncbi-protein.md +104 -0
- package/skills/scientific/database-lookup/references/ncbi-taxonomy.md +121 -0
- package/skills/scientific/database-lookup/references/nist.md +105 -0
- package/skills/scientific/database-lookup/references/noaa.md +199 -0
- package/skills/scientific/database-lookup/references/omim.md +114 -0
- package/skills/scientific/database-lookup/references/opentargets.md +459 -0
- package/skills/scientific/database-lookup/references/openweathermap.md +255 -0
- package/skills/scientific/database-lookup/references/pdb.md +121 -0
- package/skills/scientific/database-lookup/references/pride.md +74 -0
- package/skills/scientific/database-lookup/references/pubchem.md +145 -0
- package/skills/scientific/database-lookup/references/quickgo.md +45 -0
- package/skills/scientific/database-lookup/references/reactome.md +140 -0
- package/skills/scientific/database-lookup/references/rummageo.md +32 -0
- package/skills/scientific/database-lookup/references/sdss.md +130 -0
- package/skills/scientific/database-lookup/references/sec-edgar.md +315 -0
- package/skills/scientific/database-lookup/references/simbad.md +131 -0
- package/skills/scientific/database-lookup/references/sra.md +149 -0
- package/skills/scientific/database-lookup/references/string.md +283 -0
- package/skills/scientific/database-lookup/references/tcga-gdc.md +58 -0
- package/skills/scientific/database-lookup/references/treasury.md +215 -0
- package/skills/scientific/database-lookup/references/ucsc-genome.md +135 -0
- package/skills/scientific/database-lookup/references/uniprot.md +283 -0
- package/skills/scientific/database-lookup/references/usgs.md +260 -0
- package/skills/scientific/database-lookup/references/uspto.md +130 -0
- package/skills/scientific/database-lookup/references/who.md +283 -0
- package/skills/scientific/database-lookup/references/worldbank.md +239 -0
- package/skills/scientific/database-lookup/references/zinc.md +202 -0
- package/skills/scientific/hypothesis-generation/SKILL.md +297 -0
- package/skills/scientific/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/skills/scientific/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/skills/scientific/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/skills/scientific/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/skills/scientific/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/skills/scientific/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/skills/scientific/hypothesis-generation/scripts/generate_schematic.py +139 -0
- package/skills/scientific/hypothesis-generation/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/literature-review/SKILL.md +699 -0
- package/skills/scientific/literature-review/assets/review_template.md +412 -0
- package/skills/scientific/literature-review/references/citation_styles.md +166 -0
- package/skills/scientific/literature-review/references/database_strategies.md +455 -0
- package/skills/scientific/literature-review/scripts/generate_pdf.py +176 -0
- package/skills/scientific/literature-review/scripts/generate_schematic.py +139 -0
- package/skills/scientific/literature-review/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/literature-review/scripts/search_databases.py +303 -0
- package/skills/scientific/literature-review/scripts/verify_citations.py +222 -0
- package/skills/scientific/markdown-mermaid-writing/SKILL.md +327 -0
- package/skills/scientific/markdown-mermaid-writing/assets/examples/example-research-report.md +221 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/architecture.md +108 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/block.md +177 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/c4.md +136 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/class.md +246 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/complex_examples.md +384 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/er.md +222 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/flowchart.md +177 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/gantt.md +138 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/git_graph.md +74 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/kanban.md +107 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/mindmap.md +74 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/packet.md +55 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/pie.md +52 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/quadrant.md +66 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/radar.md +59 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/requirement.md +88 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/sankey.md +71 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/sequence.md +174 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/state.md +150 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/timeline.md +96 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/treemap.md +66 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/user_journey.md +108 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/xy_chart.md +53 -0
- package/skills/scientific/markdown-mermaid-writing/references/diagrams/zenuml.md +71 -0
- package/skills/scientific/markdown-mermaid-writing/references/markdown_style_guide.md +733 -0
- package/skills/scientific/markdown-mermaid-writing/references/mermaid_style_guide.md +458 -0
- package/skills/scientific/markdown-mermaid-writing/templates/decision_record.md +211 -0
- package/skills/scientific/markdown-mermaid-writing/templates/how_to_guide.md +275 -0
- package/skills/scientific/markdown-mermaid-writing/templates/issue.md +303 -0
- package/skills/scientific/markdown-mermaid-writing/templates/kanban.md +223 -0
- package/skills/scientific/markdown-mermaid-writing/templates/presentation.md +312 -0
- package/skills/scientific/markdown-mermaid-writing/templates/project_documentation.md +412 -0
- package/skills/scientific/markdown-mermaid-writing/templates/pull_request.md +319 -0
- package/skills/scientific/markdown-mermaid-writing/templates/research_paper.md +304 -0
- package/skills/scientific/markdown-mermaid-writing/templates/status_report.md +185 -0
- package/skills/scientific/paper-lookup/SKILL.md +193 -0
- package/skills/scientific/paper-lookup/references/arxiv.md +161 -0
- package/skills/scientific/paper-lookup/references/biorxiv.md +118 -0
- package/skills/scientific/paper-lookup/references/core.md +150 -0
- package/skills/scientific/paper-lookup/references/crossref.md +181 -0
- package/skills/scientific/paper-lookup/references/medrxiv.md +104 -0
- package/skills/scientific/paper-lookup/references/openalex.md +174 -0
- package/skills/scientific/paper-lookup/references/pmc.md +152 -0
- package/skills/scientific/paper-lookup/references/pubmed.md +124 -0
- package/skills/scientific/paper-lookup/references/semantic-scholar.md +203 -0
- package/skills/scientific/paper-lookup/references/unpaywall.md +127 -0
- package/skills/scientific/peer-review/SKILL.md +569 -0
- package/skills/scientific/peer-review/references/common_issues.md +552 -0
- package/skills/scientific/peer-review/references/reporting_standards.md +290 -0
- package/skills/scientific/peer-review/scripts/generate_schematic.py +139 -0
- package/skills/scientific/peer-review/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/scholar-evaluation/SKILL.md +298 -0
- package/skills/scientific/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/skills/scientific/scholar-evaluation/scripts/calculate_scores.py +378 -0
- package/skills/scientific/scholar-evaluation/scripts/generate_schematic.py +139 -0
- package/skills/scientific/scholar-evaluation/scripts/generate_schematic_ai.py +817 -0
- package/skills/scientific/scientific-brainstorming/SKILL.md +189 -0
- package/skills/scientific/scientific-brainstorming/references/brainstorming_methods.md +326 -0
- package/skills/scientific/scientific-critical-thinking/SKILL.md +570 -0
- package/skills/scientific/scientific-critical-thinking/references/common_biases.md +364 -0
- package/skills/scientific/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/skills/scientific/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/skills/scientific/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/skills/scientific/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/skills/scientific/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/skills/scientific/scientific-critical-thinking/scripts/generate_schematic.py +139 -0
- package/skills/scientific/scientific-critical-thinking/scripts/generate_schematic_ai.py +817 -0
- package/skills/wotann-imports/incremental-implementation.md +241 -0
- package/skills/wotann-imports/security-threat-model.md +81 -0
- package/skills/wotann-imports/triage.md +103 -0
- package/dist/build/deploy-targets/coolify.d.ts +0 -148
- package/dist/build/deploy-targets/coolify.d.ts.map +0 -1
- package/dist/build/deploy-targets/coolify.js +0 -339
- package/dist/build/deploy-targets/coolify.js.map +0 -1
- package/dist/build/deploy-targets/dokploy.d.ts +0 -139
- package/dist/build/deploy-targets/dokploy.d.ts.map +0 -1
- package/dist/build/deploy-targets/dokploy.js +0 -339
- package/dist/build/deploy-targets/dokploy.js.map +0 -1
- package/dist/claude/hardening/error-handler.d.ts +0 -52
- package/dist/claude/hardening/error-handler.d.ts.map +0 -1
- package/dist/claude/hardening/error-handler.js +0 -158
- package/dist/claude/hardening/error-handler.js.map +0 -1
- package/dist/cli/onboarding.d.ts +0 -34
- package/dist/cli/onboarding.d.ts.map +0 -1
- package/dist/cli/onboarding.js +0 -150
- package/dist/cli/onboarding.js.map +0 -1
- package/dist/core/agent-profiles.d.ts +0 -65
- package/dist/core/agent-profiles.d.ts.map +0 -1
- package/dist/core/agent-profiles.js +0 -137
- package/dist/core/agent-profiles.js.map +0 -1
- package/dist/desktop/supabase-relay.d.ts +0 -86
- package/dist/desktop/supabase-relay.d.ts.map +0 -1
- package/dist/desktop/supabase-relay.js +0 -335
- package/dist/desktop/supabase-relay.js.map +0 -1
- package/dist/intelligence/kg-builder.d.ts +0 -181
- package/dist/intelligence/kg-builder.d.ts.map +0 -1
- package/dist/intelligence/kg-builder.js +0 -807
- package/dist/intelligence/kg-builder.js.map +0 -1
- package/dist/orchestration/jean-orchestrator.d.ts +0 -79
- package/dist/orchestration/jean-orchestrator.d.ts.map +0 -1
- package/dist/orchestration/jean-orchestrator.js +0 -253
- package/dist/orchestration/jean-orchestrator.js.map +0 -1
- package/dist/orchestration/jean-registries/command-registry.d.ts +0 -85
- package/dist/orchestration/jean-registries/command-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/command-registry.js +0 -120
- package/dist/orchestration/jean-registries/command-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/event-registry.d.ts +0 -80
- package/dist/orchestration/jean-registries/event-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/event-registry.js +0 -147
- package/dist/orchestration/jean-registries/event-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/process-registry.d.ts +0 -71
- package/dist/orchestration/jean-registries/process-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/process-registry.js +0 -104
- package/dist/orchestration/jean-registries/process-registry.js.map +0 -1
- package/dist/orchestration/jean-registries/result-registry.d.ts +0 -71
- package/dist/orchestration/jean-registries/result-registry.d.ts.map +0 -1
- package/dist/orchestration/jean-registries/result-registry.js +0 -97
- package/dist/orchestration/jean-registries/result-registry.js.map +0 -1
- package/dist/providers/bedrock-signer.d.ts +0 -23
- package/dist/providers/bedrock-signer.d.ts.map +0 -1
- package/dist/providers/bedrock-signer.js +0 -439
- package/dist/providers/bedrock-signer.js.map +0 -1
- package/dist/providers/harness-profiles.d.ts +0 -70
- package/dist/providers/harness-profiles.d.ts.map +0 -1
- package/dist/providers/harness-profiles.js +0 -210
- package/dist/providers/harness-profiles.js.map +0 -1
- package/dist/providers/vertex-oauth.d.ts +0 -21
- package/dist/providers/vertex-oauth.d.ts.map +0 -1
- package/dist/providers/vertex-oauth.js +0 -393
- package/dist/providers/vertex-oauth.js.map +0 -1
- package/dist/sandbox/backends/cloud-auth.d.ts +0 -50
- package/dist/sandbox/backends/cloud-auth.d.ts.map +0 -1
- package/dist/sandbox/backends/cloud-auth.js +0 -93
- package/dist/sandbox/backends/cloud-auth.js.map +0 -1
- package/dist/security/anti-distillation.d.ts +0 -46
- package/dist/security/anti-distillation.d.ts.map +0 -1
- package/dist/security/anti-distillation.js +0 -358
- package/dist/security/anti-distillation.js.map +0 -1
- package/dist/security/multi-encoding-decoder.d.ts +0 -47
- package/dist/security/multi-encoding-decoder.d.ts.map +0 -1
- package/dist/security/multi-encoding-decoder.js +0 -336
- package/dist/security/multi-encoding-decoder.js.map +0 -1
- package/dist/ui/accessibility.d.ts +0 -157
- package/dist/ui/accessibility.d.ts.map +0 -1
- package/dist/ui/accessibility.js +0 -232
- package/dist/ui/accessibility.js.map +0 -1
- package/dist/ui/animations.d.ts +0 -102
- package/dist/ui/animations.d.ts.map +0 -1
- package/dist/ui/animations.js +0 -277
- package/dist/ui/animations.js.map +0 -1
- package/dist/ui/components/Sparkline.d.ts +0 -81
- package/dist/ui/components/Sparkline.d.ts.map +0 -1
- package/dist/ui/components/Sparkline.js +0 -102
- package/dist/ui/components/Sparkline.js.map +0 -1
- package/dist/ui/input/mouse.d.ts +0 -139
- package/dist/ui/input/mouse.d.ts.map +0 -1
- package/dist/ui/input/mouse.js +0 -239
- package/dist/ui/input/mouse.js.map +0 -1
- package/dist/ui/sound.d.ts +0 -85
- package/dist/ui/sound.d.ts.map +0 -1
- package/dist/ui/sound.js +0 -126
- package/dist/ui/sound.js.map +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursive Decomposition strategy — ported from LDR
|
|
3
|
+
* `advanced_search_system/strategies/recursive_decomposition_strategy.py`.
|
|
4
|
+
*
|
|
5
|
+
* The lead agent decides for the input query: "DECOMPOSE" or
|
|
6
|
+
* "SEARCH_DIRECTLY". On DECOMPOSE, it produces 2–MAX_SUBTOPICS subtasks
|
|
7
|
+
* and recursively analyzes each at depth+1. On SEARCH_DIRECTLY (or
|
|
8
|
+
* when MAX_RECURSION_DEPTH is reached), the strategy calls the
|
|
9
|
+
* injected search provider once and synthesizes a leaf finding.
|
|
10
|
+
*
|
|
11
|
+
* Final synthesis aggregates per-subtask findings into a single root
|
|
12
|
+
* finding while preserving the per-subtask citations on the deeper
|
|
13
|
+
* findings.
|
|
14
|
+
*
|
|
15
|
+
* The decomposer is INJECTABLE — tests use a deterministic stub.
|
|
16
|
+
* Production wires an LLM-backed planner. Recursion is bounded by
|
|
17
|
+
* MAX_RECURSION_DEPTH AND a global tool-call cap (MAX_TOOL_CALLS_PER_RUN)
|
|
18
|
+
* so even a pathological decomposer cannot run away.
|
|
19
|
+
*
|
|
20
|
+
* Source: github.com/LearningCircuit/local-deep-research
|
|
21
|
+
*
|
|
22
|
+
* Quality bars: QB#1, QB#2, QB#6, QB#7, QB#14.
|
|
23
|
+
*/
|
|
24
|
+
import { ResearchResultsCollector } from "../results-collector.js";
|
|
25
|
+
import { MAX_RECURSION_DEPTH, MAX_SUBTOPICS, MAX_TOOL_CALLS_PER_RUN, clampMax, requireProvider, } from "./base-strategy.js";
|
|
26
|
+
const STRATEGY_NAME = "recursive-decomposition";
|
|
27
|
+
export class RecursiveDecompositionStrategy {
|
|
28
|
+
name = STRATEGY_NAME;
|
|
29
|
+
opts;
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this.opts = Object.freeze({
|
|
32
|
+
maxToolCalls: clampMax(options.maxToolCalls, MAX_TOOL_CALLS_PER_RUN, MAX_TOOL_CALLS_PER_RUN),
|
|
33
|
+
maxDepth: clampMax(options.maxDepth, MAX_RECURSION_DEPTH, MAX_RECURSION_DEPTH),
|
|
34
|
+
maxSubtopics: clampMax(options.maxSubtopics, MAX_SUBTOPICS, MAX_SUBTOPICS),
|
|
35
|
+
decomposer: options.decomposer,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async run(query, context) {
|
|
39
|
+
if (typeof query !== "string" || query.length === 0) {
|
|
40
|
+
throw new Error("recursive-decomposition: query must be non-empty string");
|
|
41
|
+
}
|
|
42
|
+
const noProvider = requireProvider(context, STRATEGY_NAME);
|
|
43
|
+
if (noProvider)
|
|
44
|
+
return Object.freeze({ ...noProvider, query });
|
|
45
|
+
const state = {
|
|
46
|
+
toolCalls: 0,
|
|
47
|
+
stopReason: "completed",
|
|
48
|
+
collector: new ResearchResultsCollector(),
|
|
49
|
+
};
|
|
50
|
+
const rootFinding = await this.analyze(query, 0, context, state);
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
strategy: STRATEGY_NAME,
|
|
53
|
+
query,
|
|
54
|
+
findings: Object.freeze([rootFinding]),
|
|
55
|
+
toolCalls: state.toolCalls,
|
|
56
|
+
stopReason: state.stopReason,
|
|
57
|
+
ok: state.stopReason !== "provider-error",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Analyze a (sub)query at a given depth. Returns a single finding
|
|
62
|
+
* for this node — for decomposed nodes, the finding's content is
|
|
63
|
+
* the LLM-aggregated synthesis of child findings.
|
|
64
|
+
*/
|
|
65
|
+
async analyze(query, depth, context, state) {
|
|
66
|
+
// Depth cap → direct search.
|
|
67
|
+
if (depth >= this.opts.maxDepth) {
|
|
68
|
+
if (state.stopReason === "completed")
|
|
69
|
+
state.stopReason = "max-depth";
|
|
70
|
+
return this.directSearch(query, depth, context, state);
|
|
71
|
+
}
|
|
72
|
+
if (state.toolCalls >= this.opts.maxToolCalls) {
|
|
73
|
+
state.stopReason = "max-tool-calls";
|
|
74
|
+
return Object.freeze({
|
|
75
|
+
question: query,
|
|
76
|
+
content: `[cap reached at depth ${depth}] ${query}`,
|
|
77
|
+
citations: Object.freeze([]),
|
|
78
|
+
depth,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
// Decompose? Without a decomposer we fall straight through to search.
|
|
82
|
+
let decision = {
|
|
83
|
+
shouldDecompose: false,
|
|
84
|
+
subtasks: [],
|
|
85
|
+
reasoning: "no decomposer",
|
|
86
|
+
};
|
|
87
|
+
if (this.opts.decomposer) {
|
|
88
|
+
try {
|
|
89
|
+
decision = await this.opts.decomposer(query, depth);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
decision = { shouldDecompose: false, subtasks: [], reasoning: "decomposer-error" };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (!decision.shouldDecompose || decision.subtasks.length === 0) {
|
|
96
|
+
return this.directSearch(query, depth, context, state);
|
|
97
|
+
}
|
|
98
|
+
const subtasks = decision.subtasks.slice(0, this.opts.maxSubtopics);
|
|
99
|
+
const subFindings = [];
|
|
100
|
+
for (const sub of subtasks) {
|
|
101
|
+
if (state.toolCalls >= this.opts.maxToolCalls) {
|
|
102
|
+
state.stopReason = "max-tool-calls";
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
const child = await this.analyze(sub, depth + 1, context, state);
|
|
106
|
+
subFindings.push(child);
|
|
107
|
+
}
|
|
108
|
+
const aggregatedContent = aggregate(query, decision, subFindings, depth);
|
|
109
|
+
const allCitations = subFindings.flatMap((f) => [...f.citations]);
|
|
110
|
+
return Object.freeze({
|
|
111
|
+
question: query,
|
|
112
|
+
content: aggregatedContent,
|
|
113
|
+
citations: Object.freeze(dedupeCitations(allCitations)),
|
|
114
|
+
depth,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async directSearch(query, depth, context, state) {
|
|
118
|
+
if (state.toolCalls >= this.opts.maxToolCalls) {
|
|
119
|
+
state.stopReason = "max-tool-calls";
|
|
120
|
+
return Object.freeze({
|
|
121
|
+
question: query,
|
|
122
|
+
content: `[cap reached at depth ${depth}] ${query}`,
|
|
123
|
+
citations: Object.freeze([]),
|
|
124
|
+
depth,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
let hits;
|
|
128
|
+
try {
|
|
129
|
+
const out = await context.provider(query);
|
|
130
|
+
hits = Array.isArray(out) ? out : [];
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
state.stopReason = "provider-error";
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
question: query,
|
|
136
|
+
content: `[provider-error] ${query}`,
|
|
137
|
+
citations: Object.freeze([]),
|
|
138
|
+
depth,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
state.toolCalls += 1;
|
|
142
|
+
const startSize = state.collector.size();
|
|
143
|
+
state.collector.addResults(hits, `depth-${depth}`);
|
|
144
|
+
const newCitations = state.collector.citations().slice(startSize);
|
|
145
|
+
const summary = summarizeHits(query, hits);
|
|
146
|
+
return Object.freeze({
|
|
147
|
+
question: query,
|
|
148
|
+
content: summary,
|
|
149
|
+
citations: Object.freeze(newCitations),
|
|
150
|
+
depth,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// ── Helpers ─────────────────────────────────────────────────────────
|
|
155
|
+
function aggregate(query, decision, subFindings, depth) {
|
|
156
|
+
const lines = [];
|
|
157
|
+
lines.push(`# ${query} (depth ${depth})`);
|
|
158
|
+
lines.push(`Decomposed into ${subFindings.length} subtask(s): ${decision.reasoning}`);
|
|
159
|
+
for (let i = 0; i < subFindings.length; i++) {
|
|
160
|
+
const sf = subFindings[i];
|
|
161
|
+
if (!sf)
|
|
162
|
+
continue;
|
|
163
|
+
lines.push(`\n## Subtask ${i + 1}: ${sf.question}`);
|
|
164
|
+
lines.push(sf.content);
|
|
165
|
+
}
|
|
166
|
+
return lines.join("\n");
|
|
167
|
+
}
|
|
168
|
+
function summarizeHits(query, hits) {
|
|
169
|
+
if (hits.length === 0)
|
|
170
|
+
return `No results for: ${query}`;
|
|
171
|
+
const lines = [`### ${query}`];
|
|
172
|
+
for (const h of hits.slice(0, 8))
|
|
173
|
+
lines.push(`- ${h.title}: ${h.snippet}`);
|
|
174
|
+
return lines.join("\n");
|
|
175
|
+
}
|
|
176
|
+
function dedupeCitations(cits) {
|
|
177
|
+
const seen = new Set();
|
|
178
|
+
const out = [];
|
|
179
|
+
for (const c of cits) {
|
|
180
|
+
if (seen.has(c.index))
|
|
181
|
+
continue;
|
|
182
|
+
seen.add(c.index);
|
|
183
|
+
out.push(c);
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=recursive-decomposition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recursive-decomposition.js","sourceRoot":"","sources":["../../../../src/intelligence/research-loops/strategies/recursive-decomposition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAOL,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAAG,yBAAyB,CAAC;AAmChD,MAAM,OAAO,8BAA8B;IAChC,IAAI,GAAG,aAAa,CAAC;IACb,IAAI,CAAkB;IAEvC,YAAY,UAAyC,EAAE;QACrD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;YACxB,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;YAC5F,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;YAC9E,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,aAA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CAAC,CAAC;QAClB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy registry — names → strategy constructors.
|
|
3
|
+
*
|
|
4
|
+
* The registry exposes:
|
|
5
|
+
* - RESEARCH_STRATEGIES: a frozen map of name → factory
|
|
6
|
+
* - getStrategy(name): returns a fresh instance or null
|
|
7
|
+
*
|
|
8
|
+
* Strategies are constructed lazily so each call gets a fresh
|
|
9
|
+
* collector / counter (QB #7 per-call state — never share instances
|
|
10
|
+
* across runs).
|
|
11
|
+
*
|
|
12
|
+
* Wire-in to the existing /research skill is INTENTIONALLY out of
|
|
13
|
+
* scope for this commit; see the follow-up PR.
|
|
14
|
+
*
|
|
15
|
+
* Quality bars: QB#1 frozen registry, QB#7 fresh instance per call,
|
|
16
|
+
* QB#14 verified in strategy-registry.test.ts.
|
|
17
|
+
*/
|
|
18
|
+
import type { BaseResearchStrategy } from "./strategies/base-strategy.js";
|
|
19
|
+
/** Factory keyed by strategy name. */
|
|
20
|
+
export type StrategyFactory = () => BaseResearchStrategy;
|
|
21
|
+
export declare const STRATEGY_NAMES: readonly ["langgraph-agent", "dual-confidence", "recursive-decomposition", "parallel-constrained"];
|
|
22
|
+
export type StrategyName = (typeof STRATEGY_NAMES)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Frozen registry: name → factory. Each factory returns a fresh
|
|
25
|
+
* strategy instance so callers cannot accidentally share state
|
|
26
|
+
* across runs.
|
|
27
|
+
*
|
|
28
|
+
* `parallel-constrained` requires a `slots` config — the default
|
|
29
|
+
* factory builds it with a single slot equal to the query at run
|
|
30
|
+
* time; callers who want richer constraint coverage should construct
|
|
31
|
+
* `ParallelConstrainedStrategy` directly.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RESEARCH_STRATEGIES: Readonly<Record<StrategyName, StrategyFactory>>;
|
|
34
|
+
/**
|
|
35
|
+
* Return a fresh instance of the named strategy, or null if unknown.
|
|
36
|
+
* Never throws on unknown names — caller decides whether to surface
|
|
37
|
+
* the miss.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getStrategy(name: string): BaseResearchStrategy | null;
|
|
40
|
+
export declare function isKnownStrategy(name: string): name is StrategyName;
|
|
41
|
+
/** List all available strategy names. Frozen at module load. */
|
|
42
|
+
export declare function listStrategies(): readonly StrategyName[];
|
|
43
|
+
//# sourceMappingURL=strategy-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy-registry.d.ts","sourceRoot":"","sources":["../../../src/intelligence/research-loops/strategy-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAM1E,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,cAAc,oGAKhB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,CAK9E,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAIrE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,YAAY,CAElE;AAED,gEAAgE;AAChE,wBAAgB,cAAc,IAAI,SAAS,YAAY,EAAE,CAExD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy registry — names → strategy constructors.
|
|
3
|
+
*
|
|
4
|
+
* The registry exposes:
|
|
5
|
+
* - RESEARCH_STRATEGIES: a frozen map of name → factory
|
|
6
|
+
* - getStrategy(name): returns a fresh instance or null
|
|
7
|
+
*
|
|
8
|
+
* Strategies are constructed lazily so each call gets a fresh
|
|
9
|
+
* collector / counter (QB #7 per-call state — never share instances
|
|
10
|
+
* across runs).
|
|
11
|
+
*
|
|
12
|
+
* Wire-in to the existing /research skill is INTENTIONALLY out of
|
|
13
|
+
* scope for this commit; see the follow-up PR.
|
|
14
|
+
*
|
|
15
|
+
* Quality bars: QB#1 frozen registry, QB#7 fresh instance per call,
|
|
16
|
+
* QB#14 verified in strategy-registry.test.ts.
|
|
17
|
+
*/
|
|
18
|
+
import { LangGraphAgentStrategy } from "./strategies/langgraph-agent.js";
|
|
19
|
+
import { DualConfidenceStrategy } from "./strategies/dual-confidence.js";
|
|
20
|
+
import { RecursiveDecompositionStrategy } from "./strategies/recursive-decomposition.js";
|
|
21
|
+
import { ParallelConstrainedStrategy } from "./strategies/parallel-constrained.js";
|
|
22
|
+
export const STRATEGY_NAMES = Object.freeze([
|
|
23
|
+
"langgraph-agent",
|
|
24
|
+
"dual-confidence",
|
|
25
|
+
"recursive-decomposition",
|
|
26
|
+
"parallel-constrained",
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Frozen registry: name → factory. Each factory returns a fresh
|
|
30
|
+
* strategy instance so callers cannot accidentally share state
|
|
31
|
+
* across runs.
|
|
32
|
+
*
|
|
33
|
+
* `parallel-constrained` requires a `slots` config — the default
|
|
34
|
+
* factory builds it with a single slot equal to the query at run
|
|
35
|
+
* time; callers who want richer constraint coverage should construct
|
|
36
|
+
* `ParallelConstrainedStrategy` directly.
|
|
37
|
+
*/
|
|
38
|
+
export const RESEARCH_STRATEGIES = Object.freeze({
|
|
39
|
+
"langgraph-agent": () => new LangGraphAgentStrategy(),
|
|
40
|
+
"dual-confidence": () => new DualConfidenceStrategy(),
|
|
41
|
+
"recursive-decomposition": () => new RecursiveDecompositionStrategy(),
|
|
42
|
+
"parallel-constrained": () => new ParallelConstrainedStrategy({ slots: [{ query: "default" }] }),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Return a fresh instance of the named strategy, or null if unknown.
|
|
46
|
+
* Never throws on unknown names — caller decides whether to surface
|
|
47
|
+
* the miss.
|
|
48
|
+
*/
|
|
49
|
+
export function getStrategy(name) {
|
|
50
|
+
if (!isKnownStrategy(name))
|
|
51
|
+
return null;
|
|
52
|
+
const factory = RESEARCH_STRATEGIES[name];
|
|
53
|
+
return factory();
|
|
54
|
+
}
|
|
55
|
+
export function isKnownStrategy(name) {
|
|
56
|
+
return STRATEGY_NAMES.includes(name);
|
|
57
|
+
}
|
|
58
|
+
/** List all available strategy names. Frozen at module load. */
|
|
59
|
+
export function listStrategies() {
|
|
60
|
+
return STRATEGY_NAMES;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=strategy-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy-registry.js","sourceRoot":"","sources":["../../../src/intelligence/research-loops/strategy-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAKnF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,iBAAiB;IACjB,iBAAiB;IACjB,yBAAyB;IACzB,sBAAsB;CACd,CAAC,CAAC;AAIZ;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAoD,MAAM,CAAC,MAAM,CAAC;IAChG,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,sBAAsB,EAAE;IACrD,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,sBAAsB,EAAE;IACrD,yBAAyB,EAAE,GAAG,EAAE,CAAC,IAAI,8BAA8B,EAAE;IACrE,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAI,2BAA2B,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;CACjG,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAQ,cAAoC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Research strategies — dual-confidence, recursive-decomposition,
|
|
3
|
+
* iterDRAG. Ports the three patterns documented in
|
|
4
|
+
* LearningCircuit/local-deep-research.
|
|
5
|
+
*
|
|
6
|
+
* The strategies are wrappers around a caller-supplied `search` callback:
|
|
7
|
+
*
|
|
8
|
+
* - dualConfidenceSearch(q) — runs search twice with
|
|
9
|
+
* a rephrased twin query, returns confidence ∈ [0,1] from source
|
|
10
|
+
* overlap. Cheap (2 calls) + meaningful divergence signal.
|
|
11
|
+
*
|
|
12
|
+
* - recursivelyDecompose(q, decompose) — recursively breaks a
|
|
13
|
+
* question into atoms when the heuristic detects compound shape
|
|
14
|
+
* ("and"/"or", semicolons, multi-clause). Each level uses the
|
|
15
|
+
* caller-supplied `decompose` callback; the function itself only
|
|
16
|
+
* decides *whether* to recurse.
|
|
17
|
+
*
|
|
18
|
+
* - iterDrag(root, …) — Iterative
|
|
19
|
+
* Decompose-Retrieve-Aggregate-Generate. Walks a question tree
|
|
20
|
+
* to bounded depth, gathering hits at each node and aggregating
|
|
21
|
+
* bottom-up. Designed for multi-hop questions.
|
|
22
|
+
*
|
|
23
|
+
* QUALITY BARS
|
|
24
|
+
* - QB#1 No vendor bias — search/decompose/synthesize are callbacks.
|
|
25
|
+
* - QB#3 Honest stub — every error path returns a structured error;
|
|
26
|
+
* never fakes evidence.
|
|
27
|
+
* - QB#7 Per-call state — every strategy allocates fresh state.
|
|
28
|
+
*/
|
|
29
|
+
export interface Hit {
|
|
30
|
+
readonly url: string;
|
|
31
|
+
readonly title?: string;
|
|
32
|
+
readonly snippet?: string;
|
|
33
|
+
}
|
|
34
|
+
export type SearchFn = (query: string) => Promise<readonly Hit[]>;
|
|
35
|
+
export interface DualConfidenceOptions {
|
|
36
|
+
/** Optional twin query supplier. Defaults to {@link rephraseQuery}. */
|
|
37
|
+
readonly rephrase?: (query: string) => string;
|
|
38
|
+
/** Cap the number of hits per search before computing overlap. */
|
|
39
|
+
readonly hitsPerCall?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface DualConfidenceResult {
|
|
42
|
+
/** Hits unique to the primary query. */
|
|
43
|
+
readonly primaryHits: readonly Hit[];
|
|
44
|
+
/** Hits unique to the rephrased twin query. */
|
|
45
|
+
readonly twinHits: readonly Hit[];
|
|
46
|
+
/** Hits that appeared in both passes (high signal). */
|
|
47
|
+
readonly overlap: readonly Hit[];
|
|
48
|
+
/** Jaccard overlap of URL sets, ∈ [0,1]. */
|
|
49
|
+
readonly confidence: number;
|
|
50
|
+
/** True when overlap is below the divergence threshold (0.3). */
|
|
51
|
+
readonly diverged: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Dual-confidence search. Runs the user's search callback twice — once
|
|
55
|
+
* with the original query, once with a rephrased twin — and reports
|
|
56
|
+
* how much the two result sets agree. High overlap → strong signal.
|
|
57
|
+
* Low overlap → caller should treat the answer as low-confidence and
|
|
58
|
+
* gather more evidence before synthesis.
|
|
59
|
+
*/
|
|
60
|
+
export declare function dualConfidenceSearch(query: string, search: SearchFn, opts?: DualConfidenceOptions): Promise<DualConfidenceResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Default rephraser. Three deterministic transforms applied in order:
|
|
63
|
+
* 1. If the query is a direct question ("How do X?"), reword as a
|
|
64
|
+
* noun phrase ("definition of X", "best practices for X").
|
|
65
|
+
* 2. Strip filler ("how can I", "tell me about", "I want to know").
|
|
66
|
+
* 3. Append the query's main keyword to the front for emphasis.
|
|
67
|
+
*
|
|
68
|
+
* No LLM call — keeps dual-confidence cheap.
|
|
69
|
+
*/
|
|
70
|
+
export declare function rephraseQuery(query: string): string;
|
|
71
|
+
export interface DecomposedQuestion {
|
|
72
|
+
readonly text: string;
|
|
73
|
+
readonly depth: number;
|
|
74
|
+
readonly children: readonly DecomposedQuestion[];
|
|
75
|
+
}
|
|
76
|
+
export interface DecomposeOptions {
|
|
77
|
+
/** Max recursion depth. Default 3. */
|
|
78
|
+
readonly maxDepth?: number;
|
|
79
|
+
/** Override the heuristic that decides if a question is compound. */
|
|
80
|
+
readonly isCompound?: (q: string) => boolean;
|
|
81
|
+
}
|
|
82
|
+
export type DecomposeFn = (question: string) => Promise<readonly string[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Recursively decompose a question into atoms. The provided
|
|
85
|
+
* `decompose` callback is asked to break the input into immediate
|
|
86
|
+
* sub-questions; we then call it again on each sub-question that
|
|
87
|
+
* still looks compound.
|
|
88
|
+
*
|
|
89
|
+
* Stops when:
|
|
90
|
+
* - the heuristic flags the question as atomic, OR
|
|
91
|
+
* - depth ≥ maxDepth, OR
|
|
92
|
+
* - decompose() returns ≤ 1 child (no progress).
|
|
93
|
+
*/
|
|
94
|
+
export declare function recursivelyDecompose(question: string, decompose: DecomposeFn, opts?: DecomposeOptions): Promise<DecomposedQuestion>;
|
|
95
|
+
/**
|
|
96
|
+
* Cheap compound-shape heuristic. A question is "compound" when it:
|
|
97
|
+
* - contains a connective (" and ", " or ", semicolon, "; "), OR
|
|
98
|
+
* - has multiple distinct interrogatives ("what … and how …"), OR
|
|
99
|
+
* - is long enough (≥ 25 words) to likely span multiple ideas.
|
|
100
|
+
*/
|
|
101
|
+
export declare function defaultCompoundCheck(question: string): boolean;
|
|
102
|
+
export interface IterDragNode {
|
|
103
|
+
readonly question: string;
|
|
104
|
+
readonly depth: number;
|
|
105
|
+
readonly hits: readonly Hit[];
|
|
106
|
+
readonly children: readonly IterDragNode[];
|
|
107
|
+
/** Aggregated answer at this node, populated bottom-up. */
|
|
108
|
+
readonly aggregated: string;
|
|
109
|
+
}
|
|
110
|
+
export interface IterDragOptions {
|
|
111
|
+
readonly maxDepth?: number;
|
|
112
|
+
/** Hits per node to retain after dedup. Default 5. */
|
|
113
|
+
readonly hitsPerNode?: number;
|
|
114
|
+
/** Optional aggregator for combining child answers + hits into a node answer. */
|
|
115
|
+
readonly aggregate?: (question: string, hits: readonly Hit[], childAnswers: readonly string[]) => string | Promise<string>;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Iterative Decompose-Retrieve-Aggregate-Generate. Depth-bounded tree
|
|
119
|
+
* walk: at each node, call `search` for evidence, recurse via
|
|
120
|
+
* `decompose` while the question is compound and we have budget, then
|
|
121
|
+
* roll up answers bottom-up using `aggregate`.
|
|
122
|
+
*
|
|
123
|
+
* The default aggregator is a concatenation of child answers + the
|
|
124
|
+
* current node's hit titles — sufficient to drive a final synthesize()
|
|
125
|
+
* call without the strategy module hard-coding LLM behaviour.
|
|
126
|
+
*/
|
|
127
|
+
export declare function iterDrag(rootQuestion: string, search: SearchFn, decompose: DecomposeFn, opts?: IterDragOptions): Promise<IterDragNode>;
|
|
128
|
+
/**
|
|
129
|
+
* Walk an IterDragNode tree and yield every node depth-first. Useful
|
|
130
|
+
* for callers that want to render the tree or extract evidence flatly.
|
|
131
|
+
*/
|
|
132
|
+
export declare function iterDragNodes(root: IterDragNode): Generator<IterDragNode, void, undefined>;
|
|
133
|
+
//# sourceMappingURL=research-strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research-strategies.d.ts","sourceRoot":"","sources":["../../src/intelligence/research-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;AAIlE,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,EAAE,CAAC;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,EAAE,CAAC;IAClC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,EAAE,CAAC;IACjC,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAID;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,QAAQ,EAChB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CA8B/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,M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B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,GAAG,EAAE,EACpB,YAAY,EAAE,SAAS,MAAM,EAAE,KAC5B,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,WAAW,EACtB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,YAAY,CAAC,CAKvB;AAiED;;;GAGG;AACH,wBAAiB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,CAG3F"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Research strategies — dual-confidence, recursive-decomposition,
|
|
3
|
+
* iterDRAG. Ports the three patterns documented in
|
|
4
|
+
* LearningCircuit/local-deep-research.
|
|
5
|
+
*
|
|
6
|
+
* The strategies are wrappers around a caller-supplied `search` callback:
|
|
7
|
+
*
|
|
8
|
+
* - dualConfidenceSearch(q) — runs search twice with
|
|
9
|
+
* a rephrased twin query, returns confidence ∈ [0,1] from source
|
|
10
|
+
* overlap. Cheap (2 calls) + meaningful divergence signal.
|
|
11
|
+
*
|
|
12
|
+
* - recursivelyDecompose(q, decompose) — recursively breaks a
|
|
13
|
+
* question into atoms when the heuristic detects compound shape
|
|
14
|
+
* ("and"/"or", semicolons, multi-clause). Each level uses the
|
|
15
|
+
* caller-supplied `decompose` callback; the function itself only
|
|
16
|
+
* decides *whether* to recurse.
|
|
17
|
+
*
|
|
18
|
+
* - iterDrag(root, …) — Iterative
|
|
19
|
+
* Decompose-Retrieve-Aggregate-Generate. Walks a question tree
|
|
20
|
+
* to bounded depth, gathering hits at each node and aggregating
|
|
21
|
+
* bottom-up. Designed for multi-hop questions.
|
|
22
|
+
*
|
|
23
|
+
* QUALITY BARS
|
|
24
|
+
* - QB#1 No vendor bias — search/decompose/synthesize are callbacks.
|
|
25
|
+
* - QB#3 Honest stub — every error path returns a structured error;
|
|
26
|
+
* never fakes evidence.
|
|
27
|
+
* - QB#7 Per-call state — every strategy allocates fresh state.
|
|
28
|
+
*/
|
|
29
|
+
const DIVERGENCE_THRESHOLD = 0.3;
|
|
30
|
+
/**
|
|
31
|
+
* Dual-confidence search. Runs the user's search callback twice — once
|
|
32
|
+
* with the original query, once with a rephrased twin — and reports
|
|
33
|
+
* how much the two result sets agree. High overlap → strong signal.
|
|
34
|
+
* Low overlap → caller should treat the answer as low-confidence and
|
|
35
|
+
* gather more evidence before synthesis.
|
|
36
|
+
*/
|
|
37
|
+
export async function dualConfidenceSearch(query, search, opts = {}) {
|
|
38
|
+
const cap = typeof opts.hitsPerCall === "number" ? opts.hitsPerCall : Infinity;
|
|
39
|
+
const rephrase = opts.rephrase ?? rephraseQuery;
|
|
40
|
+
const twinQuery = rephrase(query);
|
|
41
|
+
const [primaryHits, twinHits] = await Promise.all([
|
|
42
|
+
search(query).then((h) => h.slice(0, cap)),
|
|
43
|
+
search(twinQuery).then((h) => h.slice(0, cap)),
|
|
44
|
+
]);
|
|
45
|
+
const primaryUrls = new Set(primaryHits.map((h) => h.url));
|
|
46
|
+
const twinUrls = new Set(twinHits.map((h) => h.url));
|
|
47
|
+
const overlap = [];
|
|
48
|
+
for (const h of primaryHits) {
|
|
49
|
+
if (twinUrls.has(h.url))
|
|
50
|
+
overlap.push(h);
|
|
51
|
+
}
|
|
52
|
+
const onlyPrimary = primaryHits.filter((h) => !twinUrls.has(h.url));
|
|
53
|
+
const onlyTwin = twinHits.filter((h) => !primaryUrls.has(h.url));
|
|
54
|
+
const unionSize = primaryUrls.size + twinUrls.size - overlap.length;
|
|
55
|
+
const confidence = unionSize === 0 ? 0 : overlap.length / unionSize;
|
|
56
|
+
return {
|
|
57
|
+
primaryHits: Object.freeze(onlyPrimary),
|
|
58
|
+
twinHits: Object.freeze(onlyTwin),
|
|
59
|
+
overlap: Object.freeze(overlap),
|
|
60
|
+
confidence,
|
|
61
|
+
diverged: confidence < DIVERGENCE_THRESHOLD,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default rephraser. Three deterministic transforms applied in order:
|
|
66
|
+
* 1. If the query is a direct question ("How do X?"), reword as a
|
|
67
|
+
* noun phrase ("definition of X", "best practices for X").
|
|
68
|
+
* 2. Strip filler ("how can I", "tell me about", "I want to know").
|
|
69
|
+
* 3. Append the query's main keyword to the front for emphasis.
|
|
70
|
+
*
|
|
71
|
+
* No LLM call — keeps dual-confidence cheap.
|
|
72
|
+
*/
|
|
73
|
+
export function rephraseQuery(query) {
|
|
74
|
+
let q = query.trim();
|
|
75
|
+
const lower = q.toLowerCase();
|
|
76
|
+
if (lower.startsWith("how do ") || lower.startsWith("how to ")) {
|
|
77
|
+
q = q.replace(/^[Hh]ow\s+(do|to)\s+/, "best practices for ");
|
|
78
|
+
}
|
|
79
|
+
else if (lower.startsWith("what is ") || lower.startsWith("what are ")) {
|
|
80
|
+
q = q.replace(/^[Ww]hat\s+(is|are)\s+/, "definition of ");
|
|
81
|
+
}
|
|
82
|
+
else if (lower.startsWith("why ")) {
|
|
83
|
+
q = q.replace(/^[Ww]hy\s+/, "reasons ");
|
|
84
|
+
}
|
|
85
|
+
q = q.replace(/^(how can i|tell me about|i want to know|please tell me)\s+/i, "");
|
|
86
|
+
return q.trim();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Recursively decompose a question into atoms. The provided
|
|
90
|
+
* `decompose` callback is asked to break the input into immediate
|
|
91
|
+
* sub-questions; we then call it again on each sub-question that
|
|
92
|
+
* still looks compound.
|
|
93
|
+
*
|
|
94
|
+
* Stops when:
|
|
95
|
+
* - the heuristic flags the question as atomic, OR
|
|
96
|
+
* - depth ≥ maxDepth, OR
|
|
97
|
+
* - decompose() returns ≤ 1 child (no progress).
|
|
98
|
+
*/
|
|
99
|
+
export async function recursivelyDecompose(question, decompose, opts = {}) {
|
|
100
|
+
const maxDepth = opts.maxDepth ?? 3;
|
|
101
|
+
const isCompound = opts.isCompound ?? defaultCompoundCheck;
|
|
102
|
+
return await walk(question, 0, decompose, maxDepth, isCompound);
|
|
103
|
+
}
|
|
104
|
+
async function walk(text, depth, decompose, maxDepth, isCompound) {
|
|
105
|
+
if (depth >= maxDepth || !isCompound(text)) {
|
|
106
|
+
return { text, depth, children: Object.freeze([]) };
|
|
107
|
+
}
|
|
108
|
+
const children = await decompose(text);
|
|
109
|
+
if (children.length <= 1) {
|
|
110
|
+
return { text, depth, children: Object.freeze([]) };
|
|
111
|
+
}
|
|
112
|
+
const recursed = await Promise.all(children.map((c) => walk(c, depth + 1, decompose, maxDepth, isCompound)));
|
|
113
|
+
return { text, depth, children: Object.freeze(recursed) };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Cheap compound-shape heuristic. A question is "compound" when it:
|
|
117
|
+
* - contains a connective (" and ", " or ", semicolon, "; "), OR
|
|
118
|
+
* - has multiple distinct interrogatives ("what … and how …"), OR
|
|
119
|
+
* - is long enough (≥ 25 words) to likely span multiple ideas.
|
|
120
|
+
*/
|
|
121
|
+
export function defaultCompoundCheck(question) {
|
|
122
|
+
const text = question.trim();
|
|
123
|
+
if (text.length === 0)
|
|
124
|
+
return false;
|
|
125
|
+
const lower = text.toLowerCase();
|
|
126
|
+
if (/\band\b|\bor\b|;|\bvs\.?\b|, /.test(lower))
|
|
127
|
+
return true;
|
|
128
|
+
const interrogatives = (lower.match(/\b(how|why|what|when|where|who|which)\b/g) ?? []).length;
|
|
129
|
+
if (interrogatives >= 2)
|
|
130
|
+
return true;
|
|
131
|
+
const wordCount = text.split(/\s+/).filter(Boolean).length;
|
|
132
|
+
return wordCount >= 25;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Iterative Decompose-Retrieve-Aggregate-Generate. Depth-bounded tree
|
|
136
|
+
* walk: at each node, call `search` for evidence, recurse via
|
|
137
|
+
* `decompose` while the question is compound and we have budget, then
|
|
138
|
+
* roll up answers bottom-up using `aggregate`.
|
|
139
|
+
*
|
|
140
|
+
* The default aggregator is a concatenation of child answers + the
|
|
141
|
+
* current node's hit titles — sufficient to drive a final synthesize()
|
|
142
|
+
* call without the strategy module hard-coding LLM behaviour.
|
|
143
|
+
*/
|
|
144
|
+
export async function iterDrag(rootQuestion, search, decompose, opts = {}) {
|
|
145
|
+
const maxDepth = opts.maxDepth ?? 2;
|
|
146
|
+
const hitsPerNode = opts.hitsPerNode ?? 5;
|
|
147
|
+
const aggregate = opts.aggregate ?? defaultAggregator;
|
|
148
|
+
return await iterDragWalk(rootQuestion, 0, maxDepth, hitsPerNode, search, decompose, aggregate);
|
|
149
|
+
}
|
|
150
|
+
async function iterDragWalk(question, depth, maxDepth, hitsPerNode, search, decompose, aggregate) {
|
|
151
|
+
const allHits = await search(question);
|
|
152
|
+
const dedup = dedupeHitsByUrl(allHits).slice(0, hitsPerNode);
|
|
153
|
+
let children = [];
|
|
154
|
+
if (depth < maxDepth && defaultCompoundCheck(question)) {
|
|
155
|
+
const subQuestions = await decompose(question);
|
|
156
|
+
if (subQuestions.length > 1) {
|
|
157
|
+
children = await Promise.all(subQuestions.map((sq) => iterDragWalk(sq, depth + 1, maxDepth, hitsPerNode, search, decompose, aggregate)));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const childAnswers = children.map((c) => c.aggregated).filter((a) => a.length > 0);
|
|
161
|
+
const aggregated = await Promise.resolve(aggregate(question, dedup, childAnswers));
|
|
162
|
+
return {
|
|
163
|
+
question,
|
|
164
|
+
depth,
|
|
165
|
+
hits: Object.freeze(dedup),
|
|
166
|
+
children: Object.freeze(children),
|
|
167
|
+
aggregated,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function defaultAggregator(question, hits, childAnswers) {
|
|
171
|
+
const lines = [`Q: ${question}`];
|
|
172
|
+
if (childAnswers.length > 0) {
|
|
173
|
+
lines.push("Sub-answers:");
|
|
174
|
+
for (const a of childAnswers)
|
|
175
|
+
lines.push(` - ${a.replace(/\n/g, " ").slice(0, 200)}`);
|
|
176
|
+
}
|
|
177
|
+
if (hits.length > 0) {
|
|
178
|
+
lines.push("Evidence:");
|
|
179
|
+
for (const h of hits)
|
|
180
|
+
lines.push(` - ${h.title ?? h.url} (${h.url})`);
|
|
181
|
+
}
|
|
182
|
+
return lines.join("\n");
|
|
183
|
+
}
|
|
184
|
+
function dedupeHitsByUrl(hits) {
|
|
185
|
+
const seen = new Set();
|
|
186
|
+
const out = [];
|
|
187
|
+
for (const h of hits) {
|
|
188
|
+
if (!h.url || seen.has(h.url))
|
|
189
|
+
continue;
|
|
190
|
+
seen.add(h.url);
|
|
191
|
+
out.push(h);
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Walk an IterDragNode tree and yield every node depth-first. Useful
|
|
197
|
+
* for callers that want to render the tree or extract evidence flatly.
|
|
198
|
+
*/
|
|
199
|
+
export function* iterDragNodes(root) {
|
|
200
|
+
yield root;
|
|
201
|
+
for (const c of root.children)
|
|
202
|
+
yield* iterDragNodes(c);
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=research-strategies.js.map
|