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
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* LoopDetector — Crush loop_detection.go port.
|
|
2
|
+
* LoopDetector — Crush loop_detection.go port + deer-flow multiset upgrade.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* ── Layer 1 (existing, unchanged): LoopDetector ──────────────────
|
|
5
|
+
* Per-session sliding-window hash repetition. Catches "same tool +
|
|
6
|
+
* same args" repeated ≥ threshold times. Wired at order 24.5.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* ── Layer 2 (new, additive): MultisetLoopDetector ───────────────
|
|
9
|
+
* Three orthogonal axes from
|
|
10
|
+
* research/deer-flow/.../loop_detection_middleware.py
|
|
11
|
+
*
|
|
12
|
+
* 1. **Multiset hash** — sort canonical (name, key) signatures of the
|
|
13
|
+
* last N calls and hash. ABC and BCA hash identically. Catches
|
|
14
|
+
* agents that reorder the same wasteful calls.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Per-tool frequency cap** — independent of args. WARN @ 30,
|
|
17
|
+
* HARD-STOP @ 50. Catches `read_file × 80` on 80 different paths,
|
|
18
|
+
* which the multiset hash would miss because each path hashes
|
|
19
|
+
* distinctly.
|
|
20
|
+
*
|
|
21
|
+
* 3. **read_file line-range bucketing** — start/end lines collapsed
|
|
22
|
+
* to 200-line buckets so re-reading lines 1-50, 1-60, 1-80 of the
|
|
23
|
+
* same file collapses into one signature (false-positive killer).
|
|
24
|
+
* write_file / str_replace stay content-sensitive: full args
|
|
25
|
+
* hashed (false-negative killer).
|
|
26
|
+
*
|
|
27
|
+
* LRU thread table: bounded at 100 entries by default. Oldest by
|
|
28
|
+
* last-access timestamp evicted on overflow (Quality Bar #7 keeps
|
|
29
|
+
* sessions isolated; LRU keeps memory bounded under many concurrent
|
|
30
|
+
* sessions).
|
|
10
31
|
*
|
|
11
32
|
* DESIGN NOTES:
|
|
12
33
|
* - Per-session state: `Map<sessionId, RecentCallWindow>` (Quality Bar #7).
|
|
@@ -22,6 +43,10 @@
|
|
|
22
43
|
* Crush reference: charmbracelet/crush `internal/llm/agent/loop_detection.go`
|
|
23
44
|
* (not cloned locally — pattern described in
|
|
24
45
|
* docs/internal/RESEARCH_TERMINALBENCH_HARNESSES_DEEP.md §P1-B6).
|
|
46
|
+
*
|
|
47
|
+
* deer-flow reference (multiset upgrade):
|
|
48
|
+
* research/deer-flow/backend/packages/harness/deerflow/agents/middlewares/
|
|
49
|
+
* loop_detection_middleware.py
|
|
25
50
|
*/
|
|
26
51
|
import { createHash } from "node:crypto";
|
|
27
52
|
export const DEFAULT_LOOP_CONFIG = {
|
|
@@ -165,4 +190,314 @@ export function createLoopDetectionMiddleware(instance) {
|
|
|
165
190
|
},
|
|
166
191
|
};
|
|
167
192
|
}
|
|
193
|
+
// ─────────────────────────────────────────────────────────────────
|
|
194
|
+
// ── Multiset Upgrade (deer-flow pattern) ─────────────────────────
|
|
195
|
+
// ─────────────────────────────────────────────────────────────────
|
|
196
|
+
/**
|
|
197
|
+
* Default constants for the multiset detector. Ported verbatim from
|
|
198
|
+
* deer-flow's `loop_detection_middleware.py` so behavior matches the
|
|
199
|
+
* bytedance variant on TerminalBench.
|
|
200
|
+
*/
|
|
201
|
+
export const DEFAULT_MULTISET_WINDOW = 10;
|
|
202
|
+
export const DEFAULT_FREQ_WARN_AT = 30;
|
|
203
|
+
export const DEFAULT_FREQ_HARD_STOP_AT = 50;
|
|
204
|
+
export const DEFAULT_MAX_TRACKED_THREADS = 100;
|
|
205
|
+
export const DEFAULT_READ_FILE_BUCKET_SIZE = 200;
|
|
206
|
+
const DEFAULT_HASH_REPEAT_WARN = 3;
|
|
207
|
+
const DEFAULT_HASH_REPEAT_HARD_STOP = 5;
|
|
208
|
+
/**
|
|
209
|
+
* Coerce a value to a positive integer ≥ 1. Used to defensively
|
|
210
|
+
* normalize `start_line` / `end_line` which providers sometimes
|
|
211
|
+
* serialize as strings, floats, or null.
|
|
212
|
+
*/
|
|
213
|
+
function coerceLine(value, fallback) {
|
|
214
|
+
if (value === null || value === undefined)
|
|
215
|
+
return fallback;
|
|
216
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
217
|
+
if (!Number.isFinite(n))
|
|
218
|
+
return fallback;
|
|
219
|
+
const truncated = Math.trunc(n);
|
|
220
|
+
return truncated >= 1 ? truncated : 1;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Bucket `read_file` args so re-reads of overlapping line ranges of
|
|
224
|
+
* the same file collapse to one signature.
|
|
225
|
+
*
|
|
226
|
+
* Behavior matches deer-flow's `_stable_tool_key` for `read_file`:
|
|
227
|
+
* - Default bucket size: 200 lines.
|
|
228
|
+
* - `start_line` defaults to 1 if absent/invalid.
|
|
229
|
+
* - `end_line` defaults to `start_line` if absent/invalid.
|
|
230
|
+
* - Bucket index = `Math.floor((line - 1) / bucketSize)`.
|
|
231
|
+
* - Output: `"{path}:{startBucket}-{endBucket}"`.
|
|
232
|
+
*
|
|
233
|
+
* Examples (bucket size 200):
|
|
234
|
+
* - lines 1-50 → `"/x:0-0"`
|
|
235
|
+
* - lines 1-60 → `"/x:0-0"` (same bucket — collapses)
|
|
236
|
+
* - lines 1-80 → `"/x:0-0"` (same bucket — collapses)
|
|
237
|
+
* - lines 250-300 → `"/x:1-1"` (different bucket — distinct)
|
|
238
|
+
*/
|
|
239
|
+
export function bucketReadFileArgs(args, bucketSize = DEFAULT_READ_FILE_BUCKET_SIZE) {
|
|
240
|
+
const path = typeof args.path === "string" ? args.path : "";
|
|
241
|
+
const rawStart = coerceLine(args.start_line, 1);
|
|
242
|
+
const rawEnd = coerceLine(args.end_line, rawStart);
|
|
243
|
+
// Normalize so end >= start (deer-flow uses `sorted((start, end))`).
|
|
244
|
+
const startLine = Math.min(rawStart, rawEnd);
|
|
245
|
+
const endLine = Math.max(rawStart, rawEnd);
|
|
246
|
+
const bucketStart = Math.floor((Math.max(startLine, 1) - 1) / bucketSize);
|
|
247
|
+
const bucketEnd = Math.floor((Math.max(endLine, 1) - 1) / bucketSize);
|
|
248
|
+
return `${path}:${bucketStart}-${bucketEnd}`;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Derive a stable per-call key. Mirrors deer-flow's `_stable_tool_key`:
|
|
252
|
+
* - `read_file` → bucketed line range (false-positive killer).
|
|
253
|
+
* - `write_file` / `str_replace` → full canonical args hash
|
|
254
|
+
* (content-sensitive; false-negative killer).
|
|
255
|
+
* - everything else → JSON of salient fields (`path`, `url`, `query`,
|
|
256
|
+
* `command`, `pattern`, `glob`, `cmd`), falling back to full args.
|
|
257
|
+
*/
|
|
258
|
+
function stableToolKey(name, rawArgs, bucketSize) {
|
|
259
|
+
const args = rawArgs !== null && typeof rawArgs === "object" && !Array.isArray(rawArgs)
|
|
260
|
+
? rawArgs
|
|
261
|
+
: {};
|
|
262
|
+
if (name === "read_file") {
|
|
263
|
+
return bucketReadFileArgs(args, bucketSize);
|
|
264
|
+
}
|
|
265
|
+
if (name === "write_file" || name === "str_replace") {
|
|
266
|
+
// Full canonical hash — distinct payloads stay distinct.
|
|
267
|
+
return JSON.stringify(canonicalize(args));
|
|
268
|
+
}
|
|
269
|
+
const salient = ["path", "url", "query", "command", "pattern", "glob", "cmd"];
|
|
270
|
+
const stable = {};
|
|
271
|
+
for (const field of salient) {
|
|
272
|
+
const v = args[field];
|
|
273
|
+
if (v !== undefined && v !== null)
|
|
274
|
+
stable[field] = v;
|
|
275
|
+
}
|
|
276
|
+
if (Object.keys(stable).length > 0) {
|
|
277
|
+
return JSON.stringify(canonicalize(stable));
|
|
278
|
+
}
|
|
279
|
+
return JSON.stringify(canonicalize(args));
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Hash a multiset of tool calls. Sorts the canonical `(name, key)`
|
|
283
|
+
* signatures so ABC and BCA hash identically.
|
|
284
|
+
*/
|
|
285
|
+
function hashMultiset(calls) {
|
|
286
|
+
const normalized = calls
|
|
287
|
+
.map((c) => `${c.name}:${c.key}`)
|
|
288
|
+
.slice()
|
|
289
|
+
.sort();
|
|
290
|
+
return createHash("md5").update(JSON.stringify(normalized)).digest("hex").slice(0, 12);
|
|
291
|
+
}
|
|
292
|
+
function makeFreshThread() {
|
|
293
|
+
return {
|
|
294
|
+
window: [],
|
|
295
|
+
toolFreq: new Map(),
|
|
296
|
+
warnedHashes: new Set(),
|
|
297
|
+
warnedTools: new Set(),
|
|
298
|
+
lastAccess: 0, // set on insert
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* MultisetLoopDetector — order-independent + per-tool frequency +
|
|
303
|
+
* read_file bucketing + bounded LRU thread table.
|
|
304
|
+
*
|
|
305
|
+
* Usage:
|
|
306
|
+
* const det = new MultisetLoopDetector();
|
|
307
|
+
* const r = det.observe({ name: "read_file", args: { path: "/x", start_line: 1, end_line: 50 } });
|
|
308
|
+
* if (r.status === "hard-stop") forceFinalAnswer();
|
|
309
|
+
* else if (r.status === "warn") injectNudge(r.reason!);
|
|
310
|
+
*
|
|
311
|
+
* Each session is keyed by `sessionId` passed to `observe`. The third
|
|
312
|
+
* argument is optional — when omitted, `"default"` is used (matches
|
|
313
|
+
* deer-flow's `_get_thread_id` fallback).
|
|
314
|
+
*/
|
|
315
|
+
export class MultisetLoopDetector {
|
|
316
|
+
windowSize;
|
|
317
|
+
warnAt;
|
|
318
|
+
hardStopAt;
|
|
319
|
+
hashRepeatWarnAt;
|
|
320
|
+
hashRepeatHardStopAt;
|
|
321
|
+
maxTrackedThreads;
|
|
322
|
+
readFileBucketSize;
|
|
323
|
+
/**
|
|
324
|
+
* Per-session state. JS `Map` preserves insertion order, but we use
|
|
325
|
+
* an explicit `lastAccess` counter so LRU eviction is correct under
|
|
326
|
+
* any access pattern (touch on read AND write).
|
|
327
|
+
*/
|
|
328
|
+
threads = new Map();
|
|
329
|
+
/** Monotonic counter for `lastAccess` timestamps. */
|
|
330
|
+
accessCounter = 0;
|
|
331
|
+
constructor(options = {}) {
|
|
332
|
+
this.windowSize = options.window ?? DEFAULT_MULTISET_WINDOW;
|
|
333
|
+
this.warnAt = options.warnAt ?? DEFAULT_FREQ_WARN_AT;
|
|
334
|
+
this.hardStopAt = options.hardStopAt ?? DEFAULT_FREQ_HARD_STOP_AT;
|
|
335
|
+
this.hashRepeatWarnAt = options.hashRepeatWarnAt ?? DEFAULT_HASH_REPEAT_WARN;
|
|
336
|
+
this.hashRepeatHardStopAt = options.hashRepeatHardStopAt ?? DEFAULT_HASH_REPEAT_HARD_STOP;
|
|
337
|
+
this.maxTrackedThreads = options.maxTrackedThreads ?? DEFAULT_MAX_TRACKED_THREADS;
|
|
338
|
+
this.readFileBucketSize = options.readFileBucketSize ?? DEFAULT_READ_FILE_BUCKET_SIZE;
|
|
339
|
+
if (this.windowSize < 1) {
|
|
340
|
+
throw new Error("MultisetLoopDetector: window must be >= 1");
|
|
341
|
+
}
|
|
342
|
+
if (this.hardStopAt < this.warnAt) {
|
|
343
|
+
throw new Error("MultisetLoopDetector: hardStopAt must be >= warnAt");
|
|
344
|
+
}
|
|
345
|
+
if (this.hashRepeatHardStopAt < this.hashRepeatWarnAt) {
|
|
346
|
+
throw new Error("MultisetLoopDetector: hashRepeatHardStopAt must be >= hashRepeatWarnAt");
|
|
347
|
+
}
|
|
348
|
+
if (this.maxTrackedThreads < 1) {
|
|
349
|
+
throw new Error("MultisetLoopDetector: maxTrackedThreads must be >= 1");
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Touch (or create) the thread record. Bumps `lastAccess`. Evicts
|
|
354
|
+
* the LRU thread if the table would exceed `maxTrackedThreads` on
|
|
355
|
+
* insert.
|
|
356
|
+
*/
|
|
357
|
+
touchThread(sessionId) {
|
|
358
|
+
const existing = this.threads.get(sessionId);
|
|
359
|
+
if (existing) {
|
|
360
|
+
existing.lastAccess = ++this.accessCounter;
|
|
361
|
+
return existing;
|
|
362
|
+
}
|
|
363
|
+
// Insert. Evict LRU first if at-or-over the cap so a fresh insert
|
|
364
|
+
// never blows past `maxTrackedThreads`.
|
|
365
|
+
if (this.threads.size >= this.maxTrackedThreads) {
|
|
366
|
+
this.evictOldest();
|
|
367
|
+
}
|
|
368
|
+
const fresh = makeFreshThread();
|
|
369
|
+
fresh.lastAccess = ++this.accessCounter;
|
|
370
|
+
this.threads.set(sessionId, fresh);
|
|
371
|
+
return fresh;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Evict the thread with the oldest `lastAccess`. Called from
|
|
375
|
+
* {@link touchThread} on overflow. O(N) — N is bounded by
|
|
376
|
+
* `maxTrackedThreads` (100 by default), so this stays cheap.
|
|
377
|
+
*/
|
|
378
|
+
evictOldest() {
|
|
379
|
+
let oldestKey = null;
|
|
380
|
+
let oldestTs = Number.POSITIVE_INFINITY;
|
|
381
|
+
for (const [k, v] of this.threads) {
|
|
382
|
+
if (v.lastAccess < oldestTs) {
|
|
383
|
+
oldestTs = v.lastAccess;
|
|
384
|
+
oldestKey = k;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (oldestKey !== null) {
|
|
388
|
+
this.threads.delete(oldestKey);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Observe a tool call for a session. Updates the multiset window
|
|
393
|
+
* and per-tool frequency, and returns the current status:
|
|
394
|
+
*
|
|
395
|
+
* - `"ok"` — under all thresholds.
|
|
396
|
+
* - `"warn"` — either the multiset hash has been seen
|
|
397
|
+
* `hashRepeatWarnAt` times inside the window, OR the per-tool
|
|
398
|
+
* frequency has crossed `warnAt`. Each unique hash / tool emits
|
|
399
|
+
* `"warn"` exactly once per session (avoids spamming).
|
|
400
|
+
* - `"hard-stop"` — multiset hash hit `hashRepeatHardStopAt` or
|
|
401
|
+
* per-tool frequency hit `hardStopAt`. Caller should force a
|
|
402
|
+
* final answer.
|
|
403
|
+
*
|
|
404
|
+
* Hash precedence: hash-based hard-stop > frequency hard-stop >
|
|
405
|
+
* hash-based warn > frequency warn > ok.
|
|
406
|
+
*/
|
|
407
|
+
observe(call, sessionId = "default") {
|
|
408
|
+
const name = call.name;
|
|
409
|
+
const key = stableToolKey(name, call.args, this.readFileBucketSize);
|
|
410
|
+
const thread = this.touchThread(sessionId);
|
|
411
|
+
// Append + slide window.
|
|
412
|
+
thread.window.push({ name, key });
|
|
413
|
+
if (thread.window.length > this.windowSize) {
|
|
414
|
+
thread.window.splice(0, thread.window.length - this.windowSize);
|
|
415
|
+
}
|
|
416
|
+
// Current window's multiset hash (after appending).
|
|
417
|
+
const hash = hashMultiset(thread.window);
|
|
418
|
+
// Count occurrences of the *current* hash by re-hashing each
|
|
419
|
+
// length-1-or-more suffix? No — deer-flow tracks the hash history,
|
|
420
|
+
// not the multiset window. We mirror the same shape: count how
|
|
421
|
+
// many times this exact hash has appeared in a separate history
|
|
422
|
+
// log. Since this hash is derived from the current window, we
|
|
423
|
+
// store hashes in a parallel array.
|
|
424
|
+
//
|
|
425
|
+
// To stay memory-light we keep the count inside `toolFreq` under
|
|
426
|
+
// a reserved synthetic key `__hash:<hash>` for hash-occurrence
|
|
427
|
+
// counting. This is a per-session counter that increments every
|
|
428
|
+
// call where the window hash matches.
|
|
429
|
+
const hashKey = `__hash:${hash}`;
|
|
430
|
+
const hashCount = (thread.toolFreq.get(hashKey) ?? 0) + 1;
|
|
431
|
+
thread.toolFreq.set(hashKey, hashCount);
|
|
432
|
+
// Per-tool frequency (independent of args).
|
|
433
|
+
const toolCount = (thread.toolFreq.get(name) ?? 0) + 1;
|
|
434
|
+
thread.toolFreq.set(name, toolCount);
|
|
435
|
+
// ── Layer A: multiset hash thresholds (highest precedence) ──
|
|
436
|
+
if (hashCount >= this.hashRepeatHardStopAt) {
|
|
437
|
+
return {
|
|
438
|
+
hash,
|
|
439
|
+
status: "hard-stop",
|
|
440
|
+
reason: `multiset hash ${hash} repeated ${hashCount}× (≥${this.hashRepeatHardStopAt}) inside window`,
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
// ── Layer B: per-tool frequency hard-stop ─────────────────
|
|
444
|
+
if (toolCount >= this.hardStopAt) {
|
|
445
|
+
return {
|
|
446
|
+
hash,
|
|
447
|
+
status: "hard-stop",
|
|
448
|
+
reason: `tool '${name}' called ${toolCount}× (≥${this.hardStopAt})`,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
// ── Layer C: multiset hash warn (once per hash) ───────────
|
|
452
|
+
if (hashCount >= this.hashRepeatWarnAt) {
|
|
453
|
+
if (!thread.warnedHashes.has(hash)) {
|
|
454
|
+
thread.warnedHashes.add(hash);
|
|
455
|
+
return {
|
|
456
|
+
hash,
|
|
457
|
+
status: "warn",
|
|
458
|
+
reason: `multiset hash ${hash} repeated ${hashCount}× (≥${this.hashRepeatWarnAt}) inside window`,
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
// Already warned for this hash; fall through to layer D so a
|
|
462
|
+
// pending frequency warn can still surface.
|
|
463
|
+
}
|
|
464
|
+
// ── Layer D: per-tool frequency warn (once per tool) ──────
|
|
465
|
+
if (toolCount >= this.warnAt) {
|
|
466
|
+
if (!thread.warnedTools.has(name)) {
|
|
467
|
+
thread.warnedTools.add(name);
|
|
468
|
+
return {
|
|
469
|
+
hash,
|
|
470
|
+
status: "warn",
|
|
471
|
+
reason: `tool '${name}' called ${toolCount}× (≥${this.warnAt})`,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return { hash, status: "ok" };
|
|
476
|
+
}
|
|
477
|
+
/** Clear state for one session. */
|
|
478
|
+
reset(sessionId) {
|
|
479
|
+
this.threads.delete(sessionId);
|
|
480
|
+
}
|
|
481
|
+
/** Clear state for ALL sessions. */
|
|
482
|
+
resetAll() {
|
|
483
|
+
this.threads.clear();
|
|
484
|
+
this.accessCounter = 0;
|
|
485
|
+
}
|
|
486
|
+
/** Number of currently-tracked sessions. Bounded by `maxTrackedThreads`. */
|
|
487
|
+
size() {
|
|
488
|
+
return this.threads.size;
|
|
489
|
+
}
|
|
490
|
+
/** Current per-tool count for diagnostics/tests. */
|
|
491
|
+
getToolCount(sessionId, toolName) {
|
|
492
|
+
return this.threads.get(sessionId)?.toolFreq.get(toolName) ?? 0;
|
|
493
|
+
}
|
|
494
|
+
/** Current window length for diagnostics/tests. */
|
|
495
|
+
getWindowLength(sessionId) {
|
|
496
|
+
return this.threads.get(sessionId)?.window.length ?? 0;
|
|
497
|
+
}
|
|
498
|
+
/** Whether a session is currently tracked (used by LRU tests). */
|
|
499
|
+
hasSession(sessionId) {
|
|
500
|
+
return this.threads.has(sessionId);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
168
503
|
//# sourceMappingURL=loop-detection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-detection.js","sourceRoot":"","sources":["../../src/middleware/loop-detection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAkBzC,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,CAAC;CACb,CAAC;AAWF,iEAAiE;AAEjE;;;;GAIG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC;SAC7D,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,CAAC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ddleware } from "./verification-enforcement.js
|
|
|
16
16
|
import { AutoInstallMiddleware } from "./auto-install.js";
|
|
17
17
|
import { StaleDetectionMiddleware } from "./stale-detection.js";
|
|
18
18
|
import { DoomLoopMiddleware } from "./doom-loop.js";
|
|
19
|
-
import { LoopDetector } from "./loop-detection.js";
|
|
19
|
+
import { LoopDetector, MultisetLoopDetector } from "./loop-detection.js";
|
|
20
20
|
import { SkillRulesProvider } from "../orchestration/skill-rules-provider.js";
|
|
21
21
|
import { OutputTruncationMiddleware } from "./output-truncation.js";
|
|
22
22
|
import { ToolPairValidatorMiddleware } from "./tool-pair-validator.js";
|
|
@@ -67,6 +67,7 @@ export declare function createPipelineWithInstances(checklist: PreCompletionChec
|
|
|
67
67
|
readonly staleDetection: StaleDetectionMiddleware;
|
|
68
68
|
readonly doomLoop: DoomLoopMiddleware;
|
|
69
69
|
readonly loopDetector: LoopDetector;
|
|
70
|
+
readonly multisetLoopDetector: MultisetLoopDetector;
|
|
70
71
|
readonly outputTruncation: OutputTruncationMiddleware;
|
|
71
72
|
readonly toolPairValidator: ToolPairValidatorMiddleware;
|
|
72
73
|
readonly guardrailProvider: GuardrailProviderMiddleware;
|
|
@@ -113,6 +114,13 @@ export declare function getDefaultDoomLoop(): DoomLoopMiddleware;
|
|
|
113
114
|
* Get the default shared LoopDetector instance (Crush port, per-session).
|
|
114
115
|
*/
|
|
115
116
|
export declare function getDefaultLoopDetector(): LoopDetector;
|
|
117
|
+
/**
|
|
118
|
+
* Get the default shared MultisetLoopDetector instance (deer-flow port —
|
|
119
|
+
* order-independent multiset + per-tool frequency cap + read_file
|
|
120
|
+
* bucketing). Wired at pipeline order 24.55, immediately after the legacy
|
|
121
|
+
* LoopDetector at 24.5. Audit finding #4 — zombie module resurrection.
|
|
122
|
+
*/
|
|
123
|
+
export declare function getDefaultMultisetLoopDetector(): MultisetLoopDetector;
|
|
116
124
|
/**
|
|
117
125
|
* Get the default shared OutputTruncationMiddleware instance.
|
|
118
126
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/middleware/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkB7E,OAAO,EACL,gCAAgC,EAEjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAkC,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uBAAuB,CAAC;AACnG,OAAO,EACL,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAA+B,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAkC,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAA4B,MAAM,gBAAgB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/middleware/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkB7E,OAAO,EACL,gCAAgC,EAEjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAkC,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uBAAuB,CAAC;AACnG,OAAO,EACL,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAA+B,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAkC,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,k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B,IAAI,qBAAqB,CAE7D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,wBAAwB,CAEnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CAEvD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,IAAI,oBAAoB,CAErE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,0BAA0B,CAEvE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,2BAA2B,CAEzE;AAID,4EAA4E;AAC5E,wBAAgB,2BAA2B,IAAI,2BAA2B,CAEzE;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,IAAI,0BAA0B,CAEvE;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,IAAI,0BAA0B,CAEvE;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,IAAI,sBAAsB,CAE/D;AAED,gEAAgE;AAChE,wBAAgB,eAAe,IAAI,eAAe,CAEjD;AAED,6EAA6E;AAC7E,wBAAgB,4BAA4B,IAAI,4BAA4B,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,kBAAkB,CAEjE"}
|
|
@@ -17,7 +17,7 @@ import { VerificationEnforcementMiddleware, createVerificationEnforcementMiddlew
|
|
|
17
17
|
import { AutoInstallMiddleware, createAutoInstallMiddleware } from "./auto-install.js";
|
|
18
18
|
import { StaleDetectionMiddleware, createStaleDetectionMiddleware } from "./stale-detection.js";
|
|
19
19
|
import { DoomLoopMiddleware, createDoomLoopMiddleware } from "./doom-loop.js";
|
|
20
|
-
import { LoopDetector, createLoopDetectionMiddleware } from "./loop-detection.js";
|
|
20
|
+
import { LoopDetector, MultisetLoopDetector, createLoopDetectionMiddleware, } from "./loop-detection.js";
|
|
21
21
|
import { createToolFlowGateMiddleware } from "./tool-flow-gate.js";
|
|
22
22
|
import { SkillRulesProvider } from "../orchestration/skill-rules-provider.js";
|
|
23
23
|
import { OutputTruncationMiddleware, createOutputTruncationMiddleware, } from "./output-truncation.js";
|
|
@@ -46,6 +46,16 @@ const defaultAutoInstallInstance = new AutoInstallMiddleware();
|
|
|
46
46
|
const defaultStaleDetectionInstance = new StaleDetectionMiddleware();
|
|
47
47
|
const defaultDoomLoopInstance = new DoomLoopMiddleware();
|
|
48
48
|
const defaultLoopDetectorInstance = new LoopDetector();
|
|
49
|
+
// Audit finding #4 wire — MultisetLoopDetector chains AFTER the legacy
|
|
50
|
+
// LoopDetector to catch loop classes the legacy hash-window misses:
|
|
51
|
+
// 1. Order-independent multiset (catches ABC / BCA reordering)
|
|
52
|
+
// 2. Per-tool frequency cap (catches `read_file × 50` on distinct paths)
|
|
53
|
+
// 3. read_file line-range bucketing (catches re-reads of overlapping ranges)
|
|
54
|
+
// Defaults match deer-flow (window=10, warn@30, hard-stop@50, hashRepeatWarn@3,
|
|
55
|
+
// hashRepeatHardStop@5). The legacy detector keeps its existing nudge
|
|
56
|
+
// untouched; multiset appends a SEPARATE nudge ONLY on warn / hard-stop so
|
|
57
|
+
// backward-compatible consumers that grep for the legacy message still match.
|
|
58
|
+
const defaultMultisetLoopDetectorInstance = new MultisetLoopDetector();
|
|
49
59
|
const defaultOutputTruncationInstance = new OutputTruncationMiddleware();
|
|
50
60
|
const defaultToolPairValidatorInstance = new ToolPairValidatorMiddleware();
|
|
51
61
|
// Lane 2 deer-flow ports (6 new middleware — closes Lane 2 parity gap).
|
|
@@ -122,6 +132,98 @@ const defaultTrifectaContextProvider = (ctx) => {
|
|
|
122
132
|
};
|
|
123
133
|
};
|
|
124
134
|
const defaultDenyApprovalHandler = async () => "deny";
|
|
135
|
+
// ── Multiset Loop Detection Adapter ──────────────────────────
|
|
136
|
+
//
|
|
137
|
+
// Audit finding #4 — zombie module wire. MultisetLoopDetector ports
|
|
138
|
+
// deer-flow's three-axis detector and lives at src/middleware/loop-detection.ts
|
|
139
|
+
// alongside the legacy LoopDetector. Until this adapter, it had ZERO
|
|
140
|
+
// production callers.
|
|
141
|
+
//
|
|
142
|
+
// Decision: AUGMENT (chain), not REPLACE.
|
|
143
|
+
// - The legacy LoopDetector ("LoopDetection" layer at order 24.5) keeps
|
|
144
|
+
// its existing surface untouched (backward-compatibility for anything
|
|
145
|
+
// watching for its specific nudge text).
|
|
146
|
+
// - This adapter wires the multiset detector immediately AFTER at order
|
|
147
|
+
// 24.55. It fires ONLY when status is "warn" or "hard-stop", appending
|
|
148
|
+
// a distinct, clearly-labeled nudge to `result.followUp`.
|
|
149
|
+
// - APIs differ ({record + buildNudge} vs {observe}). The adapter
|
|
150
|
+
// translates the AgentResult into a `ToolCall` shape, calls observe,
|
|
151
|
+
// and converts non-"ok" statuses into a system_reminder block.
|
|
152
|
+
//
|
|
153
|
+
// Conservatism (per task constraint — DO NOT make the pipeline more
|
|
154
|
+
// aggressive about looping):
|
|
155
|
+
// - Multiset defaults (warn@30, hard-stop@50, hashRepeatWarn@3,
|
|
156
|
+
// hashRepeatHardStop@5) come straight from deer-flow's published
|
|
157
|
+
// thresholds — a generous bar that catches genuine loops, not
|
|
158
|
+
// short-term repeats the legacy detector already handles.
|
|
159
|
+
// - Status "ok" → adapter is a no-op (returns result unchanged).
|
|
160
|
+
// - Status "warn" / "hard-stop" → APPEND to existing followUp (preserving
|
|
161
|
+
// any prior legacy or DoomLoop message), never replace.
|
|
162
|
+
// - Per-hash and per-tool warns fire AT MOST ONCE per session (the
|
|
163
|
+
// detector itself tracks `warnedHashes` / `warnedTools` to silence
|
|
164
|
+
// spam).
|
|
165
|
+
function buildMultisetArgs(result) {
|
|
166
|
+
// Mirror the shape used by the legacy adapter so the args surface is
|
|
167
|
+
// consistent across both detectors. AgentResult is a coarse view —
|
|
168
|
+
// pendingToolInput is not yet threaded through, so we use what's
|
|
169
|
+
// available without inventing fields.
|
|
170
|
+
const args = {};
|
|
171
|
+
if (result.filePath)
|
|
172
|
+
args["path"] = result.filePath;
|
|
173
|
+
if (result.content)
|
|
174
|
+
args["content"] = result.content.slice(0, 500);
|
|
175
|
+
return args;
|
|
176
|
+
}
|
|
177
|
+
function buildMultisetNudge(observe, toolName) {
|
|
178
|
+
if (observe.status === "ok")
|
|
179
|
+
return null;
|
|
180
|
+
const severity = observe.status === "hard-stop" ? "STOP" : "warning";
|
|
181
|
+
return [
|
|
182
|
+
"<system_reminder>",
|
|
183
|
+
`Loop detector (multiset) raised a ${severity}: ${observe.reason ?? "repetition threshold crossed"}.`,
|
|
184
|
+
`Tool: ${toolName}. The current trajectory is not making progress —`,
|
|
185
|
+
"step back, reconsider, and try a fundamentally different strategy.",
|
|
186
|
+
"</system_reminder>",
|
|
187
|
+
].join("\n");
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Wire a {@link MultisetLoopDetector} into the middleware pipeline. Sits
|
|
191
|
+
* at order 24.55 — immediately after the legacy LoopDetection (24.5) so
|
|
192
|
+
* its append-only nudge concatenates onto any legacy / DoomLoop message
|
|
193
|
+
* rather than replacing it.
|
|
194
|
+
*
|
|
195
|
+
* The adapter is intentionally side-effect-only: it mutates nothing on
|
|
196
|
+
* `result` other than `followUp` (and only on detection). For "ok"
|
|
197
|
+
* outcomes — by far the common case — it returns the input result
|
|
198
|
+
* unchanged.
|
|
199
|
+
*
|
|
200
|
+
* Local to pipeline.ts (constraint: DO NOT modify loop-detection.ts).
|
|
201
|
+
*/
|
|
202
|
+
function createMultisetLoopDetectionMiddleware(instance) {
|
|
203
|
+
return {
|
|
204
|
+
name: "MultisetLoopDetection",
|
|
205
|
+
order: 24.55,
|
|
206
|
+
after(ctx, result) {
|
|
207
|
+
if (!result.toolName)
|
|
208
|
+
return result;
|
|
209
|
+
const call = {
|
|
210
|
+
name: result.toolName,
|
|
211
|
+
args: buildMultisetArgs(result),
|
|
212
|
+
};
|
|
213
|
+
const observe = instance.observe(call, ctx.sessionId);
|
|
214
|
+
const nudge = buildMultisetNudge(observe, result.toolName);
|
|
215
|
+
if (!nudge)
|
|
216
|
+
return result;
|
|
217
|
+
// APPEND, never replace — preserves legacy LoopDetection / DoomLoop
|
|
218
|
+
// follow-ups (backward-compatibility for any consumer watching for
|
|
219
|
+
// those specific texts).
|
|
220
|
+
return {
|
|
221
|
+
...result,
|
|
222
|
+
followUp: result.followUp ? `${result.followUp}\n\n${nudge}` : nudge,
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}
|
|
125
227
|
// ── Pipeline Definition (31 layers in order, 6 Lane 2 additions) ─
|
|
126
228
|
const PIPELINE = [
|
|
127
229
|
createToolPairValidatorMiddleware(defaultToolPairValidatorInstance), // 0. Tool use/result pair validation
|
|
@@ -164,6 +266,7 @@ const PIPELINE = [
|
|
|
164
266
|
createStaleDetectionMiddleware(defaultStaleDetectionInstance), // 23. Stale-read detection
|
|
165
267
|
createDoomLoopMiddleware(defaultDoomLoopInstance), // 24. Doom loop detection
|
|
166
268
|
createLoopDetectionMiddleware(defaultLoopDetectorInstance), // 24.5. Loop detection (Crush port, per-session)
|
|
269
|
+
createMultisetLoopDetectionMiddleware(defaultMultisetLoopDetectorInstance), // 24.55. Loop detection (deer-flow multiset port — augments 24.5, append-only nudge)
|
|
167
270
|
// Round 29 + Wave A3.2 — tool-flow-gate wired to a real
|
|
168
271
|
// SkillRulesProvider. Until callers register rules per-session
|
|
169
272
|
// via `addRulesFromSkill`, the provider returns [] for every
|
|
@@ -251,6 +354,7 @@ export function createPipelineWithInstances(checklist, notificationTracker) {
|
|
|
251
354
|
const staleDetection = new StaleDetectionMiddleware();
|
|
252
355
|
const doomLoop = new DoomLoopMiddleware();
|
|
253
356
|
const loopDetector = new LoopDetector();
|
|
357
|
+
const multisetLoopDetector = new MultisetLoopDetector();
|
|
254
358
|
const outputTruncation = new OutputTruncationMiddleware();
|
|
255
359
|
const toolPairValidator = new ToolPairValidatorMiddleware();
|
|
256
360
|
const guardrailProvider = new GuardrailProviderMiddleware(new AllowlistProvider({}));
|
|
@@ -297,6 +401,7 @@ export function createPipelineWithInstances(checklist, notificationTracker) {
|
|
|
297
401
|
createStaleDetectionMiddleware(staleDetection),
|
|
298
402
|
createDoomLoopMiddleware(doomLoop),
|
|
299
403
|
createLoopDetectionMiddleware(loopDetector),
|
|
404
|
+
createMultisetLoopDetectionMiddleware(multisetLoopDetector),
|
|
300
405
|
createToolFlowGateMiddleware({
|
|
301
406
|
rulesProvider: skillRulesProvider.asProvider(),
|
|
302
407
|
}),
|
|
@@ -313,6 +418,7 @@ export function createPipelineWithInstances(checklist, notificationTracker) {
|
|
|
313
418
|
staleDetection,
|
|
314
419
|
doomLoop,
|
|
315
420
|
loopDetector,
|
|
421
|
+
multisetLoopDetector,
|
|
316
422
|
outputTruncation,
|
|
317
423
|
toolPairValidator,
|
|
318
424
|
guardrailProvider,
|
|
@@ -378,6 +484,15 @@ export function getDefaultDoomLoop() {
|
|
|
378
484
|
export function getDefaultLoopDetector() {
|
|
379
485
|
return defaultLoopDetectorInstance;
|
|
380
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Get the default shared MultisetLoopDetector instance (deer-flow port —
|
|
489
|
+
* order-independent multiset + per-tool frequency cap + read_file
|
|
490
|
+
* bucketing). Wired at pipeline order 24.55, immediately after the legacy
|
|
491
|
+
* LoopDetector at 24.5. Audit finding #4 — zombie module resurrection.
|
|
492
|
+
*/
|
|
493
|
+
export function getDefaultMultisetLoopDetector() {
|
|
494
|
+
return defaultMultisetLoopDetectorInstance;
|
|
495
|
+
}
|
|
381
496
|
/**
|
|
382
497
|
* Get the default shared OutputTruncationMiddleware instance.
|
|
383
498
|
*/
|