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,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* results-log — Append-only TSV log for autoresearch loop results.
|
|
3
|
+
*
|
|
4
|
+
* Port of the `results.tsv` pattern from karpathy/autoresearch. Each
|
|
5
|
+
* line is one experimental run's outcome. The format is intentionally
|
|
6
|
+
* simple — six tab-separated columns, no header line that changes,
|
|
7
|
+
* grep-friendly, append-only — so the loop can write fast and humans
|
|
8
|
+
* can sed/awk it without parsing.
|
|
9
|
+
*
|
|
10
|
+
* Why TSV (not JSONL):
|
|
11
|
+
* - karpathy's pattern: human-readable in `cat`, sortable by column
|
|
12
|
+
* in `sort -k2 -n`, diffable in plain `diff`.
|
|
13
|
+
* - JSON parsers can break on a malformed line; TSV with a single
|
|
14
|
+
* column count is robustly recoverable.
|
|
15
|
+
* - The simplicity-criterion gate (kept|discarded) reads as a single
|
|
16
|
+
* column, so `awk -F'\t' '$5=="kept"'` is the report query.
|
|
17
|
+
*
|
|
18
|
+
* Why append-only:
|
|
19
|
+
* - History is the artifact. Rewrites lose the "what we tried but
|
|
20
|
+
* discarded" record that's the whole point of autopilot loops.
|
|
21
|
+
* - Concurrent writers can append without coordinating; readers tail.
|
|
22
|
+
*
|
|
23
|
+
* Quality bars:
|
|
24
|
+
* - QB#1 immutable: ResultRow is readonly; serializer never mutates
|
|
25
|
+
* - QB#3 honest: parse returns ok:false for malformed lines instead
|
|
26
|
+
* of throwing or silently dropping data
|
|
27
|
+
* - QB#7 stateless: no module-level state; file path passed by caller
|
|
28
|
+
* - QB#11 sibling-site: this is the runtime caller for the
|
|
29
|
+
* "simplicity criterion" gate that budgeted-research.ts already
|
|
30
|
+
* references in its docstring (per the comp-research audit)
|
|
31
|
+
*/
|
|
32
|
+
import { promises as fs } from "node:fs";
|
|
33
|
+
import { dirname } from "node:path";
|
|
34
|
+
// ── Encoding ─────────────────────────────────────────────────────────
|
|
35
|
+
const COLUMN_COUNT = 6;
|
|
36
|
+
const COLUMN_DELIMITER = "\t";
|
|
37
|
+
const ROW_DELIMITER = "\n";
|
|
38
|
+
/**
|
|
39
|
+
* Sanitize a string field — strips tab + newline (the delimiters) so a
|
|
40
|
+
* malicious description can't break the column count.
|
|
41
|
+
*/
|
|
42
|
+
function sanitize(s) {
|
|
43
|
+
return s.replace(/[\t\r\n]/g, " ").trim();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Serialize a single row to a TSV line (no trailing newline; caller
|
|
47
|
+
* decides how to join). Pure: never throws on valid input.
|
|
48
|
+
*/
|
|
49
|
+
export function serializeRow(row) {
|
|
50
|
+
const cols = [
|
|
51
|
+
sanitize(row.timestamp),
|
|
52
|
+
sanitize(row.runId),
|
|
53
|
+
sanitize(row.objective),
|
|
54
|
+
Number.isFinite(row.metric) ? row.metric.toString() : "NaN",
|
|
55
|
+
row.status,
|
|
56
|
+
sanitize(row.description),
|
|
57
|
+
];
|
|
58
|
+
return cols.join(COLUMN_DELIMITER);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse a TSV line back into a row. Returns ok:false on malformed input
|
|
62
|
+
* — never throws so a single bad line can't crash a tail-reader.
|
|
63
|
+
*/
|
|
64
|
+
export function parseRow(line) {
|
|
65
|
+
if (line.length === 0 || line.startsWith("#")) {
|
|
66
|
+
return { ok: false, error: "empty or comment line" };
|
|
67
|
+
}
|
|
68
|
+
const cols = line.split(COLUMN_DELIMITER);
|
|
69
|
+
if (cols.length !== COLUMN_COUNT) {
|
|
70
|
+
return { ok: false, error: `expected ${COLUMN_COUNT} columns, got ${cols.length}` };
|
|
71
|
+
}
|
|
72
|
+
const [timestamp, runId, objective, metricStr, statusStr, description] = cols;
|
|
73
|
+
const metric = Number.parseFloat(metricStr);
|
|
74
|
+
if (!Number.isFinite(metric)) {
|
|
75
|
+
return { ok: false, error: `metric "${metricStr}" is not a finite number` };
|
|
76
|
+
}
|
|
77
|
+
if (!isStatus(statusStr)) {
|
|
78
|
+
return { ok: false, error: `status "${statusStr}" is not a known ResultStatus` };
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
ok: true,
|
|
82
|
+
row: Object.freeze({
|
|
83
|
+
timestamp,
|
|
84
|
+
runId,
|
|
85
|
+
objective,
|
|
86
|
+
metric,
|
|
87
|
+
status: statusStr,
|
|
88
|
+
description,
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function isStatus(s) {
|
|
93
|
+
return s === "kept" || s === "discarded" || s === "crashed" || s === "skipped";
|
|
94
|
+
}
|
|
95
|
+
// ── File-level operations (caller-controlled side effects) ───────────
|
|
96
|
+
/**
|
|
97
|
+
* Append one row to the log file. Creates the parent dir if missing.
|
|
98
|
+
* Uses an O_APPEND-style write so concurrent appenders do not interleave
|
|
99
|
+
* partial lines (Node's `appendFile` translates to O_APPEND on POSIX).
|
|
100
|
+
*/
|
|
101
|
+
export async function appendRow(filePath, row) {
|
|
102
|
+
await fs.mkdir(dirname(filePath), { recursive: true });
|
|
103
|
+
const line = serializeRow(row) + ROW_DELIMITER;
|
|
104
|
+
await fs.appendFile(filePath, line, { encoding: "utf8" });
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Read all parseable rows from a log file. Malformed lines are
|
|
108
|
+
* skipped and reported in `errors`. Caller decides whether to surface
|
|
109
|
+
* the errors or treat the log as a best-effort source.
|
|
110
|
+
*/
|
|
111
|
+
export async function readRows(filePath) {
|
|
112
|
+
let raw;
|
|
113
|
+
try {
|
|
114
|
+
raw = await fs.readFile(filePath, "utf8");
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
if (err.code === "ENOENT") {
|
|
118
|
+
return { rows: [], errors: [] };
|
|
119
|
+
}
|
|
120
|
+
throw err;
|
|
121
|
+
}
|
|
122
|
+
const rows = [];
|
|
123
|
+
const errors = [];
|
|
124
|
+
const lines = raw.split(ROW_DELIMITER);
|
|
125
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
126
|
+
const line = lines[i];
|
|
127
|
+
if (line === undefined || line === "")
|
|
128
|
+
continue;
|
|
129
|
+
const r = parseRow(line);
|
|
130
|
+
if (r.ok && r.row) {
|
|
131
|
+
rows.push(r.row);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
errors.push(`line ${i + 1}: ${r.error ?? "unknown"}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
rows: Object.freeze(rows),
|
|
139
|
+
errors: Object.freeze(errors),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// ── Simplicity-criterion gate ────────────────────────────────────────
|
|
143
|
+
/**
|
|
144
|
+
* Karpathy's gate: when two runs achieve the same metric, prefer the
|
|
145
|
+
* SIMPLER one (lower description length, or earlier timestamp as
|
|
146
|
+
* tiebreaker). Returns the row that should be kept; the other should
|
|
147
|
+
* be marked `status: "discarded"`.
|
|
148
|
+
*
|
|
149
|
+
* Pure: takes two rows and returns the keeper.
|
|
150
|
+
*/
|
|
151
|
+
export function applySimplicityCriterion(a, b) {
|
|
152
|
+
if (a.metric !== b.metric) {
|
|
153
|
+
// Higher metric wins (assume "more is better"). Callers wanting
|
|
154
|
+
// "less is better" should negate the metric upstream.
|
|
155
|
+
return a.metric > b.metric ? a : b;
|
|
156
|
+
}
|
|
157
|
+
if (a.description.length !== b.description.length) {
|
|
158
|
+
return a.description.length < b.description.length ? a : b;
|
|
159
|
+
}
|
|
160
|
+
// Tiebreak: earlier wins.
|
|
161
|
+
return a.timestamp <= b.timestamp ? a : b;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Apply the simplicity criterion across a full results set, returning
|
|
165
|
+
* one keeper per `objective`. Useful for compacting a long log into a
|
|
166
|
+
* "best run per goal" summary.
|
|
167
|
+
*/
|
|
168
|
+
export function bestRunPerObjective(rows) {
|
|
169
|
+
const byObjective = new Map();
|
|
170
|
+
for (const row of rows) {
|
|
171
|
+
if (row.status === "crashed" || row.status === "skipped")
|
|
172
|
+
continue;
|
|
173
|
+
const incumbent = byObjective.get(row.objective);
|
|
174
|
+
byObjective.set(row.objective, incumbent ? applySimplicityCriterion(incumbent, row) : row);
|
|
175
|
+
}
|
|
176
|
+
return Object.freeze([...byObjective.values()]);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=results-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results-log.js","sourceRoot":"","sources":["../../../src/intelligence/research-loops/results-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,wEAAwE;AAExE,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;GAGG;AACH,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAc;IACzC,MAAM,IAAI,GAAG;QACX,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC;QACvB,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;QACnB,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC;QACvB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK;QAC3D,GAAG,CAAC,MAAM;QACV,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;KAC1B,CAAC;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACrC,CAAC;AAED;;;GA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I,GAAG,EAAqB,CAAC;IACjD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;YAAE,SAAS;QACnE,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjD,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,wBAAwB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAyB,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base research strategy contract — ported from
|
|
3
|
+
* LearningCircuit/local-deep-research `advanced_search_system/strategies/base_strategy.py`.
|
|
4
|
+
*
|
|
5
|
+
* Defines the common interface that every strategy in this directory
|
|
6
|
+
* implements. Strategies are constructed with an INJECTABLE search
|
|
7
|
+
* provider so the test harness can prove the contract with a stub
|
|
8
|
+
* (QB #2 honest stubs / QB #11 sibling-site composition).
|
|
9
|
+
*
|
|
10
|
+
* Source: github.com/LearningCircuit/local-deep-research
|
|
11
|
+
* Strategies ported in this batch:
|
|
12
|
+
* - langgraph-agent parallel subagents + shared collector
|
|
13
|
+
* - dual-confidence high/medium/rejected pools
|
|
14
|
+
* - recursive-decomposition hierarchical subtask fan-out
|
|
15
|
+
* - parallel-constrained parallel branches under a shared budget
|
|
16
|
+
*
|
|
17
|
+
* Quality bars:
|
|
18
|
+
* QB #1 immutable — every result is Object.freeze'd
|
|
19
|
+
* QB #2 injectable provider — strategies don't bake a backend
|
|
20
|
+
* QB #6 honest stubs — missing provider yields stop="no-provider"
|
|
21
|
+
* QB #7 per-call state — no module globals
|
|
22
|
+
* QB #14 verification — covered in tests/.../strategies/*.test.ts
|
|
23
|
+
* QB #19 no zombie instances — every strategy is exercised in tests
|
|
24
|
+
*
|
|
25
|
+
* The 50-iteration GraphRecursionError cap from LDR's langgraph_agent is
|
|
26
|
+
* shared as MAX_TOOL_CALLS_PER_RUN here so no strategy ships a runaway
|
|
27
|
+
* loop. Subclasses MAY lower it but MUST NOT raise it without an audit.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Hard ceiling on tool calls / search invocations per strategy run.
|
|
31
|
+
* Mirrors LDR's `DEFAULT_MAX_ITERATIONS = 50` from langgraph_agent_strategy.py.
|
|
32
|
+
* Strategies that loop MUST honor this — even if their per-step caller
|
|
33
|
+
* asks for more, the runner clamps to this value.
|
|
34
|
+
*/
|
|
35
|
+
export declare const MAX_TOOL_CALLS_PER_RUN = 50;
|
|
36
|
+
/** Hard ceiling on recursion depth — protects recursive-decomposition. */
|
|
37
|
+
export declare const MAX_RECURSION_DEPTH = 5;
|
|
38
|
+
/** Hard ceiling on fan-out width for parallel/decomposition strategies. */
|
|
39
|
+
export declare const MAX_SUBTOPICS = 8;
|
|
40
|
+
/** Maximum number of subagents we'll launch concurrently. */
|
|
41
|
+
export declare const MAX_SUBAGENT_WORKERS = 4;
|
|
42
|
+
/** One search hit returned by the injected provider. */
|
|
43
|
+
export interface SearchHit {
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly url: string;
|
|
46
|
+
readonly snippet: string;
|
|
47
|
+
/** Optional engine identifier for citation grouping. */
|
|
48
|
+
readonly sourceEngine?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Injected search backend. Returns an arbitrary number of hits for a
|
|
52
|
+
* single query. Tests inject a stub; production wires DuckDuckGo /
|
|
53
|
+
* SearXNG / DeepResearch via deep-research.ts.
|
|
54
|
+
*
|
|
55
|
+
* Why a callback (not a class)? Strategies should compose with any
|
|
56
|
+
* backend the host wires, including in-memory stubs. The contract is
|
|
57
|
+
* the smallest thing it can be.
|
|
58
|
+
*/
|
|
59
|
+
export type SearchProvider = (query: string) => Promise<readonly SearchHit[]>;
|
|
60
|
+
/** Confidence bucket — used by dual-confidence + others. */
|
|
61
|
+
export type ConfidenceLevel = "high" | "medium" | "rejected";
|
|
62
|
+
/** One citation backed by a numbered index. Indices come from the collector. */
|
|
63
|
+
export interface ResearchCitation {
|
|
64
|
+
readonly index: number;
|
|
65
|
+
readonly hit: SearchHit;
|
|
66
|
+
/** Confidence label for dual-confidence; "high" by default. */
|
|
67
|
+
readonly confidence: ConfidenceLevel;
|
|
68
|
+
}
|
|
69
|
+
/** One unit of synthesized output from a strategy. */
|
|
70
|
+
export interface ResearchFinding {
|
|
71
|
+
readonly question: string;
|
|
72
|
+
readonly content: string;
|
|
73
|
+
readonly citations: readonly ResearchCitation[];
|
|
74
|
+
/** For decomposition strategies — depth at which this finding was produced. */
|
|
75
|
+
readonly depth?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface ResearchContext {
|
|
78
|
+
readonly provider: SearchProvider;
|
|
79
|
+
/** Wall-clock now-ms; injectable for deterministic tests. */
|
|
80
|
+
readonly now?: () => number;
|
|
81
|
+
/** Optional strategy-specific overrides (max iters, depth, etc.). */
|
|
82
|
+
readonly overrides?: Readonly<Record<string, number>>;
|
|
83
|
+
}
|
|
84
|
+
export type StrategyStopReason = "completed" | "max-tool-calls" | "max-depth" | "no-provider" | "provider-error" | "no-results";
|
|
85
|
+
export interface ResearchResult {
|
|
86
|
+
readonly strategy: string;
|
|
87
|
+
readonly query: string;
|
|
88
|
+
readonly findings: readonly ResearchFinding[];
|
|
89
|
+
readonly toolCalls: number;
|
|
90
|
+
readonly stopReason: StrategyStopReason;
|
|
91
|
+
readonly ok: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Every strategy implements `run(query, context)`. The runner is a
|
|
95
|
+
* plain async function, not a class, so it composes naturally with
|
|
96
|
+
* the existing helpers in `research-loops/` (budgeted-research, etc.).
|
|
97
|
+
*
|
|
98
|
+
* Implementations MUST:
|
|
99
|
+
* 1. Honor MAX_TOOL_CALLS_PER_RUN (or a lower per-strategy cap).
|
|
100
|
+
* 2. Return findings even when the cap fires (never empty hands).
|
|
101
|
+
* 3. Return `ok=false` + a meaningful stopReason on real failure.
|
|
102
|
+
* 4. Set `strategy` to a stable, kebab-case identifier.
|
|
103
|
+
*/
|
|
104
|
+
export interface BaseResearchStrategy {
|
|
105
|
+
readonly name: string;
|
|
106
|
+
run(query: string, context: ResearchContext): Promise<ResearchResult>;
|
|
107
|
+
}
|
|
108
|
+
export declare function requireProvider(context: ResearchContext, strategy: string): ResearchResult | null;
|
|
109
|
+
export declare function clampMax(value: number | undefined, cap: number, fallback: number): number;
|
|
110
|
+
export declare function emptyResult(strategy: string, query: string, reason: StrategyStopReason): ResearchResult;
|
|
111
|
+
//# sourceMappingURL=base-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-strategy.d.ts","sourceRoot":"","sources":["../../../../src/intelligence/research-loops/strategies/base-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,2EAA2E;AAC3E,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GA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B,CAAC;IACxC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;CACtB;AAID;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACvE;AAID,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAYjG;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzF;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,kBAAkB,GACzB,cAAc,CAShB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base research strategy contract — ported from
|
|
3
|
+
* LearningCircuit/local-deep-research `advanced_search_system/strategies/base_strategy.py`.
|
|
4
|
+
*
|
|
5
|
+
* Defines the common interface that every strategy in this directory
|
|
6
|
+
* implements. Strategies are constructed with an INJECTABLE search
|
|
7
|
+
* provider so the test harness can prove the contract with a stub
|
|
8
|
+
* (QB #2 honest stubs / QB #11 sibling-site composition).
|
|
9
|
+
*
|
|
10
|
+
* Source: github.com/LearningCircuit/local-deep-research
|
|
11
|
+
* Strategies ported in this batch:
|
|
12
|
+
* - langgraph-agent parallel subagents + shared collector
|
|
13
|
+
* - dual-confidence high/medium/rejected pools
|
|
14
|
+
* - recursive-decomposition hierarchical subtask fan-out
|
|
15
|
+
* - parallel-constrained parallel branches under a shared budget
|
|
16
|
+
*
|
|
17
|
+
* Quality bars:
|
|
18
|
+
* QB #1 immutable — every result is Object.freeze'd
|
|
19
|
+
* QB #2 injectable provider — strategies don't bake a backend
|
|
20
|
+
* QB #6 honest stubs — missing provider yields stop="no-provider"
|
|
21
|
+
* QB #7 per-call state — no module globals
|
|
22
|
+
* QB #14 verification — covered in tests/.../strategies/*.test.ts
|
|
23
|
+
* QB #19 no zombie instances — every strategy is exercised in tests
|
|
24
|
+
*
|
|
25
|
+
* The 50-iteration GraphRecursionError cap from LDR's langgraph_agent is
|
|
26
|
+
* shared as MAX_TOOL_CALLS_PER_RUN here so no strategy ships a runaway
|
|
27
|
+
* loop. Subclasses MAY lower it but MUST NOT raise it without an audit.
|
|
28
|
+
*/
|
|
29
|
+
// ── Shared constants ─────────────────────────────────────────────────
|
|
30
|
+
/**
|
|
31
|
+
* Hard ceiling on tool calls / search invocations per strategy run.
|
|
32
|
+
* Mirrors LDR's `DEFAULT_MAX_ITERATIONS = 50` from langgraph_agent_strategy.py.
|
|
33
|
+
* Strategies that loop MUST honor this — even if their per-step caller
|
|
34
|
+
* asks for more, the runner clamps to this value.
|
|
35
|
+
*/
|
|
36
|
+
export const MAX_TOOL_CALLS_PER_RUN = 50;
|
|
37
|
+
/** Hard ceiling on recursion depth — protects recursive-decomposition. */
|
|
38
|
+
export const MAX_RECURSION_DEPTH = 5;
|
|
39
|
+
/** Hard ceiling on fan-out width for parallel/decomposition strategies. */
|
|
40
|
+
export const MAX_SUBTOPICS = 8;
|
|
41
|
+
/** Maximum number of subagents we'll launch concurrently. */
|
|
42
|
+
export const MAX_SUBAGENT_WORKERS = 4;
|
|
43
|
+
// ── Shared validation helpers ───────────────────────────────────────
|
|
44
|
+
export function requireProvider(context, strategy) {
|
|
45
|
+
if (typeof context.provider !== "function") {
|
|
46
|
+
return Object.freeze({
|
|
47
|
+
strategy,
|
|
48
|
+
query: "",
|
|
49
|
+
findings: Object.freeze([]),
|
|
50
|
+
toolCalls: 0,
|
|
51
|
+
stopReason: "no-provider",
|
|
52
|
+
ok: false,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
export function clampMax(value, cap, fallback) {
|
|
58
|
+
if (value === undefined || !Number.isFinite(value) || value <= 0)
|
|
59
|
+
return Math.min(fallback, cap);
|
|
60
|
+
return Math.min(Math.floor(value), cap);
|
|
61
|
+
}
|
|
62
|
+
export function emptyResult(strategy, query, reason) {
|
|
63
|
+
return Object.freeze({
|
|
64
|
+
strategy,
|
|
65
|
+
query,
|
|
66
|
+
findings: Object.freeze([]),
|
|
67
|
+
toolCalls: 0,
|
|
68
|
+
stopReason: reason,
|
|
69
|
+
ok: false,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=base-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-strategy.js","sourceRoot":"","sources":["../../../../src/intelligence/research-loops/strategies/base-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,wEAAwE;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AA2FtC,uEAAuE;AAEvE,MAAM,UAAU,eAAe,CAAC,OAAwB,EAAE,QAAgB;IACxE,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,QAAQ;YACR,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAoB,EAAE,CAAC;YAC9C,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,aAAsB;YAClC,EAAE,EAAE,KAAK;SACV,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAyB,EAAE,GAAW,EAAE,QAAgB;IAC/E,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjG,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,KAAa,EACb,MAA0B;IAE1B,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ;QACR,KAAK;QACL,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAoB,EAAE,CAAC;QAC9C,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,MAAM;QAClB,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dual-Confidence with Rejection strategy — ported from LDR
|
|
3
|
+
* `advanced_search_system/strategies/dual_confidence_with_rejection.py`
|
|
4
|
+
* (and its parent `dual_confidence_strategy.py`).
|
|
5
|
+
*
|
|
6
|
+
* For each search hit, the strategy scores POSITIVE evidence (does the
|
|
7
|
+
* hit support the query?) and NEGATIVE evidence (does it actively
|
|
8
|
+
* contradict the query?). Hits are bucketed into three pools:
|
|
9
|
+
* - high pos ≥ HIGH_POSITIVE and neg ≤ MAX_NEGATIVE_FOR_HIGH
|
|
10
|
+
* - medium pos ≥ MEDIUM_POSITIVE and neg ≤ MAX_NEGATIVE_FOR_MEDIUM
|
|
11
|
+
* - rejected anything else (logged but excluded from final answer)
|
|
12
|
+
*
|
|
13
|
+
* The "with rejection" variant adds an EARLY-REJECTION shortcut: if a
|
|
14
|
+
* hit's average negative > REJECTION_NEGATIVE_THRESHOLD, it's dropped
|
|
15
|
+
* before scoring positive evidence (LDR's `_evaluate_candidate_immediately`
|
|
16
|
+
* logic). This saves provider tokens.
|
|
17
|
+
*
|
|
18
|
+
* The confidence scorer is INJECTABLE — tests provide deterministic
|
|
19
|
+
* scores; production wires an LLM-backed judge. A missing scorer
|
|
20
|
+
* yields a single fixture finding with stop="no-provider" semantics.
|
|
21
|
+
*
|
|
22
|
+
* Source: github.com/LearningCircuit/local-deep-research
|
|
23
|
+
*
|
|
24
|
+
* Quality bars: QB#1, QB#2, QB#6, QB#7, QB#14.
|
|
25
|
+
*/
|
|
26
|
+
import { type BaseResearchStrategy, type ResearchContext, type ResearchCitation, type ResearchResult, type SearchHit } from "./base-strategy.js";
|
|
27
|
+
/** Per-hit score returned by the injectable judge. */
|
|
28
|
+
export interface DualConfidenceScore {
|
|
29
|
+
/** Confidence that the hit SUPPORTS the query. In [0,1]. */
|
|
30
|
+
readonly positive: number;
|
|
31
|
+
/** Confidence that the hit CONTRADICTS the query. In [0,1]. */
|
|
32
|
+
readonly negative: number;
|
|
33
|
+
}
|
|
34
|
+
export type ConfidenceScorer = (query: string, hit: SearchHit) => Promise<DualConfidenceScore>;
|
|
35
|
+
export interface DualConfidenceOptions {
|
|
36
|
+
readonly scorer?: ConfidenceScorer;
|
|
37
|
+
readonly maxToolCalls?: number;
|
|
38
|
+
/** Min positive evidence to bucket as "high". Default 0.7. */
|
|
39
|
+
readonly highPositive?: number;
|
|
40
|
+
/** Max negative evidence allowed in the "high" bucket. Default 0.1. */
|
|
41
|
+
readonly maxNegativeForHigh?: number;
|
|
42
|
+
/** Min positive evidence to bucket as "medium". Default 0.4. */
|
|
43
|
+
readonly mediumPositive?: number;
|
|
44
|
+
/** Max negative evidence allowed in the "medium" bucket. Default 0.3. */
|
|
45
|
+
readonly maxNegativeForMedium?: number;
|
|
46
|
+
/** Negative threshold for early rejection (skips positive scoring). Default 0.25. */
|
|
47
|
+
readonly rejectionNegativeThreshold?: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class DualConfidenceStrategy implements BaseResearchStrategy {
|
|
50
|
+
readonly name = "dual-confidence";
|
|
51
|
+
private readonly opts;
|
|
52
|
+
constructor(options?: DualConfidenceOptions);
|
|
53
|
+
run(query: string, context: ResearchContext): Promise<ResearchResult>;
|
|
54
|
+
/** Bucket a dual-confidence score. Public for testability. */
|
|
55
|
+
bucket(score: DualConfidenceScore): ResearchCitation["confidence"];
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=dual-confidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dual-confidence.d.ts","sourceRoot":"","sources":["../../../../src/intelligence/research-loops/strategies/dual-confidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,oBAAoB,CAAC;AAI5B,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE/F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,yEAAyE;IACzE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,qFAAqF;IACrF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CAC9C;AAYD,qBAAa,sBAAuB,YAAW,oBAAoB;IACjE,QAAQ,CAAC,IAAI,qBAAiB;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;gBAE3B,OAAO,GAAE,qBAA0B;IAYzC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAsG3E,8DAA8D;IAC9D,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,gBAAgB,CAAC,YAAY,CAAC;CAiBnE"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dual-Confidence with Rejection strategy — ported from LDR
|
|
3
|
+
* `advanced_search_system/strategies/dual_confidence_with_rejection.py`
|
|
4
|
+
* (and its parent `dual_confidence_strategy.py`).
|
|
5
|
+
*
|
|
6
|
+
* For each search hit, the strategy scores POSITIVE evidence (does the
|
|
7
|
+
* hit support the query?) and NEGATIVE evidence (does it actively
|
|
8
|
+
* contradict the query?). Hits are bucketed into three pools:
|
|
9
|
+
* - high pos ≥ HIGH_POSITIVE and neg ≤ MAX_NEGATIVE_FOR_HIGH
|
|
10
|
+
* - medium pos ≥ MEDIUM_POSITIVE and neg ≤ MAX_NEGATIVE_FOR_MEDIUM
|
|
11
|
+
* - rejected anything else (logged but excluded from final answer)
|
|
12
|
+
*
|
|
13
|
+
* The "with rejection" variant adds an EARLY-REJECTION shortcut: if a
|
|
14
|
+
* hit's average negative > REJECTION_NEGATIVE_THRESHOLD, it's dropped
|
|
15
|
+
* before scoring positive evidence (LDR's `_evaluate_candidate_immediately`
|
|
16
|
+
* logic). This saves provider tokens.
|
|
17
|
+
*
|
|
18
|
+
* The confidence scorer is INJECTABLE — tests provide deterministic
|
|
19
|
+
* scores; production wires an LLM-backed judge. A missing scorer
|
|
20
|
+
* yields a single fixture finding with stop="no-provider" semantics.
|
|
21
|
+
*
|
|
22
|
+
* Source: github.com/LearningCircuit/local-deep-research
|
|
23
|
+
*
|
|
24
|
+
* Quality bars: QB#1, QB#2, QB#6, QB#7, QB#14.
|
|
25
|
+
*/
|
|
26
|
+
import { ResearchResultsCollector } from "../results-collector.js";
|
|
27
|
+
import { MAX_TOOL_CALLS_PER_RUN, clampMax, requireProvider, } from "./base-strategy.js";
|
|
28
|
+
const STRATEGY_NAME = "dual-confidence";
|
|
29
|
+
export class DualConfidenceStrategy {
|
|
30
|
+
name = STRATEGY_NAME;
|
|
31
|
+
opts;
|
|
32
|
+
constructor(options = {}) {
|
|
33
|
+
this.opts = Object.freeze({
|
|
34
|
+
maxToolCalls: clampMax(options.maxToolCalls, MAX_TOOL_CALLS_PER_RUN, MAX_TOOL_CALLS_PER_RUN),
|
|
35
|
+
highPositive: options.highPositive ?? 0.7,
|
|
36
|
+
maxNegativeForHigh: options.maxNegativeForHigh ?? 0.1,
|
|
37
|
+
mediumPositive: options.mediumPositive ?? 0.4,
|
|
38
|
+
maxNegativeForMedium: options.maxNegativeForMedium ?? 0.3,
|
|
39
|
+
rejectionNegativeThreshold: options.rejectionNegativeThreshold ?? 0.25,
|
|
40
|
+
scorer: options.scorer,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async run(query, context) {
|
|
44
|
+
if (typeof query !== "string" || query.length === 0) {
|
|
45
|
+
throw new Error("dual-confidence: query must be non-empty string");
|
|
46
|
+
}
|
|
47
|
+
const noProvider = requireProvider(context, STRATEGY_NAME);
|
|
48
|
+
if (noProvider)
|
|
49
|
+
return Object.freeze({ ...noProvider, query });
|
|
50
|
+
const collector = new ResearchResultsCollector();
|
|
51
|
+
let toolCalls = 0;
|
|
52
|
+
let stopReason = "completed";
|
|
53
|
+
let hits;
|
|
54
|
+
try {
|
|
55
|
+
const out = await context.provider(query);
|
|
56
|
+
hits = Array.isArray(out) ? out : [];
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
strategy: STRATEGY_NAME,
|
|
61
|
+
query,
|
|
62
|
+
findings: Object.freeze([]),
|
|
63
|
+
toolCalls: 0,
|
|
64
|
+
stopReason: "provider-error",
|
|
65
|
+
ok: false,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
toolCalls += 1;
|
|
69
|
+
if (hits.length === 0) {
|
|
70
|
+
return Object.freeze({
|
|
71
|
+
strategy: STRATEGY_NAME,
|
|
72
|
+
query,
|
|
73
|
+
findings: Object.freeze([]),
|
|
74
|
+
toolCalls,
|
|
75
|
+
stopReason: "no-results",
|
|
76
|
+
ok: false,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const assignedIndices = collector.addResults(hits, "dual-confidence");
|
|
80
|
+
// If no scorer is wired, return an honest fixture finding so misuse
|
|
81
|
+
// is obvious. This mirrors the budgeted-research "no-runner" pattern.
|
|
82
|
+
if (!this.opts.scorer) {
|
|
83
|
+
const finding = Object.freeze({
|
|
84
|
+
question: query,
|
|
85
|
+
content: "[fixture-scorer] dual-confidence has no scorer wired; returning unscored hits",
|
|
86
|
+
citations: collector.citations(),
|
|
87
|
+
});
|
|
88
|
+
return Object.freeze({
|
|
89
|
+
strategy: STRATEGY_NAME,
|
|
90
|
+
query,
|
|
91
|
+
findings: Object.freeze([finding]),
|
|
92
|
+
toolCalls,
|
|
93
|
+
stopReason: "completed",
|
|
94
|
+
ok: false,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Score each hit. Early rejection skips positive scoring when
|
|
98
|
+
// negative evidence is already conclusive (LDR `_evaluate_candidate_immediately`).
|
|
99
|
+
for (let i = 0; i < hits.length; i++) {
|
|
100
|
+
if (toolCalls >= this.opts.maxToolCalls) {
|
|
101
|
+
stopReason = "max-tool-calls";
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
const hit = hits[i];
|
|
105
|
+
const idx = assignedIndices[i];
|
|
106
|
+
if (!hit || idx === undefined || idx === 0)
|
|
107
|
+
continue;
|
|
108
|
+
let score;
|
|
109
|
+
try {
|
|
110
|
+
score = await this.opts.scorer(query, hit);
|
|
111
|
+
toolCalls += 1;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
collector.setConfidence(idx, "rejected");
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const bucket = this.bucket(score);
|
|
118
|
+
collector.setConfidence(idx, bucket);
|
|
119
|
+
}
|
|
120
|
+
const high = collector.citationsAtConfidence("high");
|
|
121
|
+
const medium = collector.citationsAtConfidence("medium");
|
|
122
|
+
const rejected = collector.citationsAtConfidence("rejected");
|
|
123
|
+
const keep = Object.freeze([...high, ...medium]);
|
|
124
|
+
const content = summarize(query, high, medium, rejected);
|
|
125
|
+
const finding = Object.freeze({
|
|
126
|
+
question: query,
|
|
127
|
+
content,
|
|
128
|
+
citations: keep,
|
|
129
|
+
});
|
|
130
|
+
return Object.freeze({
|
|
131
|
+
strategy: STRATEGY_NAME,
|
|
132
|
+
query,
|
|
133
|
+
findings: Object.freeze([finding]),
|
|
134
|
+
toolCalls,
|
|
135
|
+
stopReason,
|
|
136
|
+
ok: true,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** Bucket a dual-confidence score. Public for testability. */
|
|
140
|
+
bucket(score) {
|
|
141
|
+
if (!Number.isFinite(score.positive) || !Number.isFinite(score.negative))
|
|
142
|
+
return "rejected";
|
|
143
|
+
if (score.negative > this.opts.rejectionNegativeThreshold)
|
|
144
|
+
return "rejected";
|
|
145
|
+
if (score.positive >= this.opts.highPositive &&
|
|
146
|
+
score.negative <= this.opts.maxNegativeForHigh) {
|
|
147
|
+
return "high";
|
|
148
|
+
}
|
|
149
|
+
if (score.positive >= this.opts.mediumPositive &&
|
|
150
|
+
score.negative <= this.opts.maxNegativeForMedium) {
|
|
151
|
+
return "medium";
|
|
152
|
+
}
|
|
153
|
+
return "rejected";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function summarize(query, high, medium, rejected) {
|
|
157
|
+
const lines = [];
|
|
158
|
+
lines.push(`# Dual-confidence answer for: ${query}`);
|
|
159
|
+
lines.push(`High-confidence: ${high.length}, Medium-confidence: ${medium.length}, Rejected: ${rejected.length}`);
|
|
160
|
+
if (high.length > 0) {
|
|
161
|
+
lines.push("\n## High-confidence sources");
|
|
162
|
+
for (const c of high)
|
|
163
|
+
lines.push(`- [${c.index}] ${c.hit.title}`);
|
|
164
|
+
}
|
|
165
|
+
if (medium.length > 0) {
|
|
166
|
+
lines.push("\n## Medium-confidence sources");
|
|
167
|
+
for (const c of medium)
|
|
168
|
+
lines.push(`- [${c.index}] ${c.hit.title}`);
|
|
169
|
+
}
|
|
170
|
+
return lines.join("\n");
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=dual-confidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dual-confidence.js","sourceRoot":"","sources":["../../../../src/intelligence/research-loops/strategies/dual-confidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAQL,sBAAsB,EACtB,QAAQ,EACR,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAqCxC,MAAM,OAAO,sBAAsB;IACxB,IAAI,GAAG,aAAa,CAAC;IACb,IAAI,CAAkB;IAEvC,YAAY,UAAiC,EAAE;QAC7C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;YACxB,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;YAC5F,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,GAAG;YACzC,kBAAkB,EAAE,OAAO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