@orion-agents/orion-code 0.1.9 → 0.2.2
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/CHANGELOG.md +85 -0
- package/README.md +142 -323
- package/README.zh-CN.md +118 -578
- package/dist/cli.js +65 -84
- package/dist/cli.js.map +1 -1
- package/dist/commands/context-commands.d.ts.map +1 -1
- package/dist/commands/context-commands.js +14 -7
- package/dist/commands/context-commands.js.map +1 -1
- package/dist/commands/context-tool-command-handlers.d.ts +4 -5
- package/dist/commands/context-tool-command-handlers.d.ts.map +1 -1
- package/dist/commands/context-tool-command-handlers.js +132 -208
- package/dist/commands/context-tool-command-handlers.js.map +1 -1
- package/dist/commands/core-command-handlers.d.ts +3 -6
- package/dist/commands/core-command-handlers.d.ts.map +1 -1
- package/dist/commands/core-command-handlers.js +66 -664
- package/dist/commands/core-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-command-handlers.d.ts +1 -2
- package/dist/commands/diagnostic-command-handlers.d.ts.map +1 -1
- package/dist/commands/diagnostic-command-handlers.js +3 -17
- package/dist/commands/diagnostic-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-commands.d.ts.map +1 -1
- package/dist/commands/diagnostic-commands.js +0 -45
- package/dist/commands/diagnostic-commands.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -7
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/model-command-handlers.d.ts +1 -1
- package/dist/commands/model-command-handlers.js +2 -2
- package/dist/commands/model-command-handlers.js.map +1 -1
- package/dist/commands/model-commands.d.ts.map +1 -1
- package/dist/commands/model-commands.js +0 -11
- package/dist/commands/model-commands.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +1 -139
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/session-command-handlers.d.ts +1 -1
- package/dist/commands/session-command-handlers.d.ts.map +1 -1
- package/dist/commands/session-command-handlers.js +52 -214
- package/dist/commands/session-command-handlers.js.map +1 -1
- package/dist/commands/session-commands.d.ts.map +1 -1
- package/dist/commands/session-commands.js +0 -48
- package/dist/commands/session-commands.js.map +1 -1
- package/dist/commands/target-command.d.ts +9 -15
- package/dist/commands/target-command.d.ts.map +1 -1
- package/dist/commands/target-command.js +16 -130
- package/dist/commands/target-command.js.map +1 -1
- package/dist/commands/tool-commands.d.ts.map +1 -1
- package/dist/commands/tool-commands.js +0 -10
- package/dist/commands/tool-commands.js.map +1 -1
- package/dist/commands/types.d.ts +10 -14
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/commands/workflow-command-handlers.d.ts.map +1 -1
- package/dist/commands/workflow-command-handlers.js +1 -3
- package/dist/commands/workflow-command-handlers.js.map +1 -1
- package/dist/commands/workflow-commands.d.ts.map +1 -1
- package/dist/commands/workflow-commands.js +2 -24
- package/dist/commands/workflow-commands.js.map +1 -1
- package/dist/framework/agent-mode.d.ts +2 -3
- package/dist/framework/agent-mode.d.ts.map +1 -1
- package/dist/framework/agent-mode.js +8 -31
- package/dist/framework/agent-mode.js.map +1 -1
- package/dist/framework/index.d.ts +3 -3
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +6 -9
- package/dist/framework/index.js.map +1 -1
- package/dist/framework/loop-budget-contract.d.ts +20 -0
- package/dist/framework/loop-budget-contract.d.ts.map +1 -0
- package/dist/framework/loop-budget-contract.js +13 -0
- package/dist/framework/loop-budget-contract.js.map +1 -0
- package/dist/framework/prompt.d.ts.map +1 -1
- package/dist/framework/prompt.js +5 -4
- package/dist/framework/prompt.js.map +1 -1
- package/dist/framework/query.d.ts +45 -22
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +64 -52
- package/dist/framework/query.js.map +1 -1
- package/dist/framework/store.d.ts +4 -2
- package/dist/framework/store.d.ts.map +1 -1
- package/dist/framework/store.js +1 -0
- package/dist/framework/store.js.map +1 -1
- package/dist/framework/tool-call-orchestrator.d.ts +80 -0
- package/dist/framework/tool-call-orchestrator.d.ts.map +1 -0
- package/dist/framework/tool-call-orchestrator.js +192 -0
- package/dist/framework/tool-call-orchestrator.js.map +1 -0
- package/dist/framework/tool-state.d.ts +12 -11
- package/dist/framework/tool-state.d.ts.map +1 -1
- package/dist/framework/tool-state.js +36 -28
- package/dist/framework/tool-state.js.map +1 -1
- package/dist/framework/tool.d.ts +0 -9
- package/dist/framework/tool.d.ts.map +1 -1
- package/dist/framework/tool.js.map +1 -1
- package/dist/index.d.ts +70 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -65
- package/dist/index.js.map +1 -1
- package/dist/print-ui/launch.d.ts.map +1 -1
- package/dist/print-ui/launch.js +9 -2
- package/dist/print-ui/launch.js.map +1 -1
- package/dist/product/paths.d.ts +7 -0
- package/dist/product/paths.d.ts.map +1 -1
- package/dist/product/paths.js +19 -0
- package/dist/product/paths.js.map +1 -1
- package/dist/runtime/agent-loop.d.ts +80 -0
- package/dist/runtime/agent-loop.d.ts.map +1 -0
- package/dist/runtime/agent-loop.js +419 -0
- package/dist/runtime/agent-loop.js.map +1 -0
- package/dist/runtime/agent-runtime-controller.d.ts +10 -57
- package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-controller.js +270 -1216
- package/dist/runtime/agent-runtime-controller.js.map +1 -1
- package/dist/runtime/agent-runtime-protocol.d.ts +4 -5
- package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-protocol.js.map +1 -1
- package/dist/runtime/agent-runtime-runner.d.ts +36 -0
- package/dist/runtime/agent-runtime-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runtime-runner.js +3 -0
- package/dist/runtime/agent-runtime-runner.js.map +1 -0
- package/dist/runtime/batch-read-service.d.ts +29 -0
- package/dist/runtime/batch-read-service.d.ts.map +1 -0
- package/dist/runtime/batch-read-service.js +212 -0
- package/dist/runtime/batch-read-service.js.map +1 -0
- package/dist/runtime/builtin-tool-provider.d.ts +30 -0
- package/dist/runtime/builtin-tool-provider.d.ts.map +1 -0
- package/dist/runtime/builtin-tool-provider.js +233 -0
- package/dist/runtime/builtin-tool-provider.js.map +1 -0
- package/dist/runtime/capabilities/compiler.d.ts +11 -0
- package/dist/runtime/capabilities/compiler.d.ts.map +1 -0
- package/dist/runtime/capabilities/compiler.js +719 -0
- package/dist/runtime/capabilities/compiler.js.map +1 -0
- package/dist/runtime/capabilities/index.d.ts +3 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +9 -0
- package/dist/runtime/capabilities/index.js.map +1 -0
- package/dist/runtime/capabilities/types.d.ts +175 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +3 -0
- package/dist/runtime/capabilities/types.js.map +1 -0
- package/dist/runtime/capability-receipt-journal.d.ts +29 -0
- package/dist/runtime/capability-receipt-journal.d.ts.map +1 -0
- package/dist/runtime/capability-receipt-journal.js +264 -0
- package/dist/runtime/capability-receipt-journal.js.map +1 -0
- package/dist/runtime/capability-step-factory.d.ts +73 -0
- package/dist/runtime/capability-step-factory.d.ts.map +1 -0
- package/dist/runtime/capability-step-factory.js +302 -0
- package/dist/runtime/capability-step-factory.js.map +1 -0
- package/dist/runtime/compact-transaction.d.ts +225 -0
- package/dist/runtime/compact-transaction.d.ts.map +1 -0
- package/dist/runtime/compact-transaction.js +622 -0
- package/dist/runtime/compact-transaction.js.map +1 -0
- package/dist/runtime/composer/buffer.d.ts +3 -4
- package/dist/runtime/composer/buffer.d.ts.map +1 -1
- package/dist/runtime/composer/buffer.js +3 -4
- package/dist/runtime/composer/buffer.js.map +1 -1
- package/dist/runtime/composer/grapheme.d.ts +2 -4
- package/dist/runtime/composer/grapheme.d.ts.map +1 -1
- package/dist/runtime/composer/grapheme.js +2 -4
- package/dist/runtime/composer/grapheme.js.map +1 -1
- package/dist/runtime/composer/layout.d.ts +1 -3
- package/dist/runtime/composer/layout.d.ts.map +1 -1
- package/dist/runtime/composer/layout.js +1 -3
- package/dist/runtime/composer/layout.js.map +1 -1
- package/dist/runtime/core-tools/descriptors.d.ts +17 -0
- package/dist/runtime/core-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/core-tools/descriptors.js +185 -0
- package/dist/runtime/core-tools/descriptors.js.map +1 -0
- package/dist/runtime/first-party-core-provider.d.ts +55 -0
- package/dist/runtime/first-party-core-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-core-provider.js +197 -0
- package/dist/runtime/first-party-core-provider.js.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts +57 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.js +238 -0
- package/dist/runtime/first-party-long-tail-provider.js.map +1 -0
- package/dist/runtime/first-party-tool-services.d.ts +43 -0
- package/dist/runtime/first-party-tool-services.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-services.js +200 -0
- package/dist/runtime/first-party-tool-services.js.map +1 -0
- package/dist/runtime/first-party-tool-universe.d.ts +14 -0
- package/dist/runtime/first-party-tool-universe.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-universe.js +20 -0
- package/dist/runtime/first-party-tool-universe.js.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts +63 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.js +253 -0
- package/dist/runtime/goal-lifecycle-v2.js.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts +111 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.js +511 -0
- package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
- package/dist/runtime/harness-confluence.d.ts +165 -0
- package/dist/runtime/harness-confluence.d.ts.map +1 -0
- package/dist/runtime/harness-confluence.js +807 -0
- package/dist/runtime/harness-confluence.js.map +1 -0
- package/dist/runtime/harness-eval.d.ts +96 -0
- package/dist/runtime/harness-eval.d.ts.map +1 -0
- package/dist/runtime/harness-eval.js +181 -0
- package/dist/runtime/harness-eval.js.map +1 -0
- package/dist/runtime/harness-metrics.d.ts +202 -0
- package/dist/runtime/harness-metrics.d.ts.map +1 -0
- package/dist/runtime/harness-metrics.js +415 -0
- package/dist/runtime/harness-metrics.js.map +1 -0
- package/dist/runtime/legacy-session-importer.d.ts +99 -0
- package/dist/runtime/legacy-session-importer.d.ts.map +1 -0
- package/dist/runtime/legacy-session-importer.js +455 -0
- package/dist/runtime/legacy-session-importer.js.map +1 -0
- package/dist/runtime/legacy-thread-materializer.d.ts +72 -0
- package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -0
- package/dist/runtime/legacy-thread-materializer.js +553 -0
- package/dist/runtime/legacy-thread-materializer.js.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts +23 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.js +423 -0
- package/dist/runtime/long-tail-tools/descriptors.js.map +1 -0
- package/dist/runtime/loop-budget.d.ts +1 -1
- package/dist/runtime/loop-budget.d.ts.map +1 -1
- package/dist/runtime/loop-budget.js +2 -2
- package/dist/runtime/loop-budget.js.map +1 -1
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +75 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js +484 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts +13 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.js +139 -0
- package/dist/runtime/mcp/first-party-mcp-config.js.map +1 -0
- package/dist/runtime/mcp/index.d.ts +5 -0
- package/dist/runtime/mcp/index.d.ts.map +1 -0
- package/dist/{skills → runtime/mcp}/index.js +3 -9
- package/dist/runtime/mcp/index.js.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts +95 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js +854 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js.map +1 -0
- package/dist/runtime/mcp/types.d.ts +128 -0
- package/dist/runtime/mcp/types.d.ts.map +1 -0
- package/dist/runtime/mcp/types.js +5 -0
- package/dist/runtime/mcp/types.js.map +1 -0
- package/dist/runtime/orion-runtime-v1.d.ts +322 -0
- package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
- package/dist/runtime/orion-runtime-v1.js +959 -0
- package/dist/runtime/orion-runtime-v1.js.map +1 -0
- package/dist/runtime/orion-session-runner.d.ts +38 -0
- package/dist/runtime/orion-session-runner.d.ts.map +1 -0
- package/dist/runtime/orion-session-runner.js +168 -0
- package/dist/runtime/orion-session-runner.js.map +1 -0
- package/dist/runtime/product-orion-runtime.d.ts +35 -0
- package/dist/runtime/product-orion-runtime.d.ts.map +1 -0
- package/dist/runtime/product-orion-runtime.js +1047 -0
- package/dist/runtime/product-orion-runtime.js.map +1 -0
- package/dist/runtime/prompts/index.d.ts +3 -0
- package/dist/runtime/prompts/index.d.ts.map +1 -0
- package/dist/{ink-ui/types.js → runtime/prompts/index.js} +3 -2
- package/dist/runtime/prompts/index.js.map +1 -0
- package/dist/runtime/prompts/prompt-registry.d.ts +22 -0
- package/dist/runtime/prompts/prompt-registry.d.ts.map +1 -0
- package/dist/runtime/prompts/prompt-registry.js +356 -0
- package/dist/runtime/prompts/prompt-registry.js.map +1 -0
- package/dist/runtime/prompts/types.d.ts +111 -0
- package/dist/runtime/prompts/types.d.ts.map +1 -0
- package/dist/runtime/prompts/types.js +5 -0
- package/dist/runtime/prompts/types.js.map +1 -0
- package/dist/runtime/protocol/canonical.d.ts +3 -0
- package/dist/runtime/protocol/canonical.d.ts.map +1 -0
- package/dist/runtime/protocol/canonical.js +21 -0
- package/dist/runtime/protocol/canonical.js.map +1 -0
- package/dist/runtime/protocol/index.d.ts +4 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +16 -0
- package/dist/runtime/protocol/index.js.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts +671 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js +557 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -0
- package/dist/runtime/release-receipts.d.ts +110 -0
- package/dist/runtime/release-receipts.d.ts.map +1 -0
- package/dist/runtime/release-receipts.js +305 -0
- package/dist/runtime/release-receipts.js.map +1 -0
- package/dist/runtime/resource-scope.d.ts +123 -0
- package/dist/runtime/resource-scope.d.ts.map +1 -0
- package/dist/runtime/resource-scope.js +363 -0
- package/dist/runtime/resource-scope.js.map +1 -0
- package/dist/runtime/runtime-event-buffer.d.ts +78 -0
- package/dist/runtime/runtime-event-buffer.d.ts.map +1 -0
- package/dist/runtime/runtime-event-buffer.js +237 -0
- package/dist/runtime/runtime-event-buffer.js.map +1 -0
- package/dist/runtime/runtime-services.d.ts +87 -0
- package/dist/runtime/runtime-services.d.ts.map +1 -0
- package/dist/runtime/runtime-services.js +180 -0
- package/dist/runtime/runtime-services.js.map +1 -0
- package/dist/runtime/session-history-recovery.d.ts +19 -0
- package/dist/runtime/session-history-recovery.d.ts.map +1 -0
- package/dist/runtime/session-history-recovery.js +45 -0
- package/dist/runtime/session-history-recovery.js.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts +34 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.js +100 -0
- package/dist/runtime/skills/bounded-lru-cache.js.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts +96 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.js +829 -0
- package/dist/runtime/skills/filesystem-skill-provider.js.map +1 -0
- package/dist/runtime/skills/index.d.ts +5 -0
- package/dist/runtime/skills/index.d.ts.map +1 -0
- package/dist/{ink-ui/controllers/chat-controller.js → runtime/skills/index.js} +5 -2
- package/dist/runtime/skills/index.js.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts +77 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.js +673 -0
- package/dist/runtime/skills/lazy-skill-runtime.js.map +1 -0
- package/dist/runtime/skills/types.d.ts +137 -0
- package/dist/runtime/skills/types.d.ts.map +1 -0
- package/dist/runtime/skills/types.js +13 -0
- package/dist/runtime/skills/types.js.map +1 -0
- package/dist/runtime/step-snapshot.d.ts +183 -0
- package/dist/runtime/step-snapshot.d.ts.map +1 -0
- package/dist/runtime/step-snapshot.js +286 -0
- package/dist/runtime/step-snapshot.js.map +1 -0
- package/dist/runtime/subagent-thread-runtime.d.ts +239 -0
- package/dist/runtime/subagent-thread-runtime.d.ts.map +1 -0
- package/dist/runtime/subagent-thread-runtime.js +876 -0
- package/dist/runtime/subagent-thread-runtime.js.map +1 -0
- package/dist/runtime/subagents/index.d.ts +4 -1
- package/dist/runtime/subagents/index.d.ts.map +1 -1
- package/dist/runtime/subagents/index.js +10 -2
- package/dist/runtime/subagents/index.js.map +1 -1
- package/dist/runtime/subagents/parent-step-fork.d.ts +36 -0
- package/dist/runtime/subagents/parent-step-fork.d.ts.map +1 -0
- package/dist/runtime/subagents/parent-step-fork.js +83 -0
- package/dist/runtime/subagents/parent-step-fork.js.map +1 -0
- package/dist/runtime/subagents/production.d.ts +65 -46
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +494 -170
- package/dist/runtime/subagents/production.js.map +1 -1
- package/dist/runtime/subagents/receipt-journal.d.ts +20 -0
- package/dist/runtime/subagents/receipt-journal.d.ts.map +1 -0
- package/dist/runtime/subagents/receipt-journal.js +74 -0
- package/dist/runtime/subagents/receipt-journal.js.map +1 -0
- package/dist/runtime/subagents/runtime-contract.d.ts +29 -0
- package/dist/runtime/subagents/runtime-contract.d.ts.map +1 -0
- package/dist/runtime/subagents/runtime-contract.js +3 -0
- package/dist/runtime/subagents/runtime-contract.js.map +1 -0
- package/dist/runtime/subagents/runtime-integration.d.ts +41 -56
- package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
- package/dist/runtime/subagents/runtime-integration.js +34 -198
- package/dist/runtime/subagents/runtime-integration.js.map +1 -1
- package/dist/runtime/subagents/supervisor.d.ts +19 -7
- package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
- package/dist/runtime/subagents/supervisor.js +83 -40
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +1 -1
- package/dist/runtime/subagents/types.js +1 -1
- package/dist/runtime/task-context-service.d.ts +91 -0
- package/dist/runtime/task-context-service.d.ts.map +1 -0
- package/dist/runtime/task-context-service.js +122 -0
- package/dist/runtime/task-context-service.js.map +1 -0
- package/dist/runtime/thread-admission.d.ts +130 -0
- package/dist/runtime/thread-admission.d.ts.map +1 -0
- package/dist/runtime/thread-admission.js +276 -0
- package/dist/runtime/thread-admission.js.map +1 -0
- package/dist/runtime/thread-compact-persistence.d.ts +50 -0
- package/dist/runtime/thread-compact-persistence.d.ts.map +1 -0
- package/dist/runtime/thread-compact-persistence.js +176 -0
- package/dist/runtime/thread-compact-persistence.js.map +1 -0
- package/dist/runtime/thread-event-store.d.ts +98 -0
- package/dist/runtime/thread-event-store.d.ts.map +1 -0
- package/dist/runtime/thread-event-store.js +737 -0
- package/dist/runtime/thread-event-store.js.map +1 -0
- package/dist/runtime/thread-projection.d.ts +91 -0
- package/dist/runtime/thread-projection.d.ts.map +1 -0
- package/dist/runtime/thread-projection.js +407 -0
- package/dist/runtime/thread-projection.js.map +1 -0
- package/dist/runtime/thread-runtime.d.ts +165 -0
- package/dist/runtime/thread-runtime.d.ts.map +1 -0
- package/dist/runtime/thread-runtime.js +704 -0
- package/dist/runtime/thread-runtime.js.map +1 -0
- package/dist/runtime/thread-session-view.d.ts +45 -0
- package/dist/runtime/thread-session-view.d.ts.map +1 -0
- package/dist/runtime/thread-session-view.js +264 -0
- package/dist/runtime/thread-session-view.js.map +1 -0
- package/dist/runtime/thread-tool-journal.d.ts +11 -0
- package/dist/runtime/thread-tool-journal.d.ts.map +1 -0
- package/dist/runtime/thread-tool-journal.js +131 -0
- package/dist/runtime/thread-tool-journal.js.map +1 -0
- package/dist/runtime/thread-ui-adapter.d.ts +87 -0
- package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
- package/dist/runtime/thread-ui-adapter.js +580 -0
- package/dist/runtime/thread-ui-adapter.js.map +1 -0
- package/dist/runtime/tool-gateway.d.ts +159 -0
- package/dist/runtime/tool-gateway.d.ts.map +1 -0
- package/dist/runtime/tool-gateway.js +311 -0
- package/dist/runtime/tool-gateway.js.map +1 -0
- package/dist/runtime/turn-commit.d.ts +103 -0
- package/dist/runtime/turn-commit.d.ts.map +1 -0
- package/dist/runtime/turn-commit.js +321 -0
- package/dist/runtime/turn-commit.js.map +1 -0
- package/dist/runtime/ui-events.d.ts +15 -5
- package/dist/runtime/ui-events.d.ts.map +1 -1
- package/dist/runtime/ui-events.js +0 -1
- package/dist/runtime/ui-events.js.map +1 -1
- package/dist/runtime/ui-view-model.d.ts +2 -1
- package/dist/runtime/ui-view-model.d.ts.map +1 -1
- package/dist/runtime/ui-view-model.js +6 -5
- package/dist/runtime/ui-view-model.js.map +1 -1
- package/dist/services/config-dir.d.ts +1 -1
- package/dist/services/config-dir.d.ts.map +1 -1
- package/dist/services/config-dir.js +2 -1
- package/dist/services/config-dir.js.map +1 -1
- package/dist/services/config.d.ts +2 -16
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +2 -29
- package/dist/services/config.js.map +1 -1
- package/dist/services/doctor.d.ts +0 -2
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +39 -64
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/file-lock.d.ts.map +1 -1
- package/dist/services/file-lock.js +42 -17
- package/dist/services/file-lock.js.map +1 -1
- package/dist/services/global-config.d.ts +2 -2
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/services/session-storage.d.ts +8 -0
- package/dist/services/session-storage.d.ts.map +1 -1
- package/dist/services/session-storage.js +76 -12
- package/dist/services/session-storage.js.map +1 -1
- package/dist/skills/builtin/code-review/SKILL.md +51 -0
- package/dist/skills/builtin/security-check/SKILL.md +54 -0
- package/dist/skills/builtin/test-gen/SKILL.md +49 -0
- package/dist/terminal-ui/launch.d.ts +3 -1
- package/dist/terminal-ui/launch.d.ts.map +1 -1
- package/dist/terminal-ui/launch.js +21 -3
- package/dist/terminal-ui/launch.js.map +1 -1
- package/dist/tools/core/common.d.ts +34 -0
- package/dist/tools/core/common.d.ts.map +1 -0
- package/dist/tools/core/common.js +164 -0
- package/dist/tools/core/common.js.map +1 -0
- package/dist/tools/core/edit-file.d.ts +10 -0
- package/dist/tools/core/edit-file.d.ts.map +1 -0
- package/dist/tools/core/edit-file.js +301 -0
- package/dist/tools/core/edit-file.js.map +1 -0
- package/dist/tools/core/exec-command.d.ts +2 -0
- package/dist/tools/core/exec-command.d.ts.map +1 -0
- package/dist/tools/core/exec-command.js +347 -0
- package/dist/tools/core/exec-command.js.map +1 -0
- package/dist/tools/core/glob.d.ts +2 -0
- package/dist/tools/core/glob.d.ts.map +1 -0
- package/dist/tools/core/glob.js +133 -0
- package/dist/tools/core/glob.js.map +1 -0
- package/dist/tools/core/grep.d.ts +12 -0
- package/dist/tools/core/grep.d.ts.map +1 -0
- package/dist/tools/core/grep.js +223 -0
- package/dist/tools/core/grep.js.map +1 -0
- package/dist/tools/core/index.d.ts +15 -0
- package/dist/tools/core/index.d.ts.map +1 -0
- package/dist/tools/core/index.js +31 -0
- package/dist/tools/core/index.js.map +1 -0
- package/dist/tools/core/list-files.d.ts +2 -0
- package/dist/tools/core/list-files.d.ts.map +1 -0
- package/dist/tools/core/list-files.js +87 -0
- package/dist/tools/core/list-files.js.map +1 -0
- package/dist/tools/core/read-file.d.ts +2 -0
- package/dist/tools/core/read-file.d.ts.map +1 -0
- package/dist/tools/core/read-file.js +129 -0
- package/dist/tools/core/read-file.js.map +1 -0
- package/dist/tools/core/write-file.d.ts +2 -0
- package/dist/tools/core/write-file.d.ts.map +1 -0
- package/dist/tools/core/write-file.js +65 -0
- package/dist/tools/core/write-file.js.map +1 -0
- package/dist/tools/todo.d.ts +3 -4
- package/dist/tools/todo.d.ts.map +1 -1
- package/dist/tools/todo.js +80 -79
- package/dist/tools/todo.js.map +1 -1
- package/dist/tools/web.js +1 -1
- package/dist/tools/web.js.map +1 -1
- package/dist/tui-ui/chrome-view-model.d.ts.map +1 -1
- package/dist/tui-ui/chrome-view-model.js +22 -8
- package/dist/tui-ui/chrome-view-model.js.map +1 -1
- package/dist/tui-ui/launch.d.ts.map +1 -1
- package/dist/tui-ui/launch.js +13 -0
- package/dist/tui-ui/launch.js.map +1 -1
- package/dist/tui-ui/layout.js +1 -1
- package/dist/tui-ui/layout.js.map +1 -1
- package/dist/tui-ui/state.d.ts.map +1 -1
- package/dist/tui-ui/state.js +2 -0
- package/dist/tui-ui/state.js.map +1 -1
- package/docs/migration/v0.1.9-to-v0.2.0.md +98 -0
- package/docs/orion.example.json +79 -0
- package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +1234 -0
- package/docs/plan/v0.2.0-release-checklist.md +91 -0
- package/docs/readme.md +8 -8
- package/npm-shrinkwrap.json +45 -450
- package/package.json +17 -13
- package/dist/agents/coder.d.ts +0 -12
- package/dist/agents/coder.d.ts.map +0 -1
- package/dist/agents/coder.js +0 -48
- package/dist/agents/coder.js.map +0 -1
- package/dist/agents/coordinator.d.ts +0 -86
- package/dist/agents/coordinator.d.ts.map +0 -1
- package/dist/agents/coordinator.js +0 -291
- package/dist/agents/coordinator.js.map +0 -1
- package/dist/agents/fork.d.ts +0 -73
- package/dist/agents/fork.d.ts.map +0 -1
- package/dist/agents/fork.js +0 -163
- package/dist/agents/fork.js.map +0 -1
- package/dist/agents/leader.d.ts +0 -12
- package/dist/agents/leader.d.ts.map +0 -1
- package/dist/agents/leader.js +0 -49
- package/dist/agents/leader.js.map +0 -1
- package/dist/agents/router.d.ts +0 -59
- package/dist/agents/router.d.ts.map +0 -1
- package/dist/agents/router.js +0 -193
- package/dist/agents/router.js.map +0 -1
- package/dist/agents/worker-pool.d.ts +0 -72
- package/dist/agents/worker-pool.d.ts.map +0 -1
- package/dist/agents/worker-pool.js +0 -229
- package/dist/agents/worker-pool.js.map +0 -1
- package/dist/commands/legacy-commands.d.ts +0 -4
- package/dist/commands/legacy-commands.d.ts.map +0 -1
- package/dist/commands/legacy-commands.js +0 -44
- package/dist/commands/legacy-commands.js.map +0 -1
- package/dist/core/agent.d.ts +0 -84
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -58
- package/dist/core/agent.js.map +0 -1
- package/dist/core/brain.d.ts +0 -50
- package/dist/core/brain.d.ts.map +0 -1
- package/dist/core/brain.js +0 -95
- package/dist/core/brain.js.map +0 -1
- package/dist/framework/tool-scheduler.d.ts +0 -191
- package/dist/framework/tool-scheduler.d.ts.map +0 -1
- package/dist/framework/tool-scheduler.js +0 -573
- package/dist/framework/tool-scheduler.js.map +0 -1
- package/dist/harness/harness.d.ts +0 -58
- package/dist/harness/harness.d.ts.map +0 -1
- package/dist/harness/harness.js +0 -195
- package/dist/harness/harness.js.map +0 -1
- package/dist/harness/safety.d.ts +0 -101
- package/dist/harness/safety.d.ts.map +0 -1
- package/dist/harness/safety.js +0 -322
- package/dist/harness/safety.js.map +0 -1
- package/dist/init.d.ts +0 -108
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -393
- package/dist/init.js.map +0 -1
- package/dist/ink-ui/App.d.ts +0 -9
- package/dist/ink-ui/App.d.ts.map +0 -1
- package/dist/ink-ui/App.js +0 -12
- package/dist/ink-ui/App.js.map +0 -1
- package/dist/ink-ui/components/Markdown.d.ts +0 -10
- package/dist/ink-ui/components/Markdown.d.ts.map +0 -1
- package/dist/ink-ui/components/Markdown.js +0 -210
- package/dist/ink-ui/components/Markdown.js.map +0 -1
- package/dist/ink-ui/components/NativeCursor.d.ts +0 -12
- package/dist/ink-ui/components/NativeCursor.d.ts.map +0 -1
- package/dist/ink-ui/components/NativeCursor.js +0 -35
- package/dist/ink-ui/components/NativeCursor.js.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.d.ts +0 -8
- package/dist/ink-ui/components/PixelHorseBanner.d.ts.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.js +0 -97
- package/dist/ink-ui/components/PixelHorseBanner.js.map +0 -1
- package/dist/ink-ui/components/PromptInput.d.ts +0 -13
- package/dist/ink-ui/components/PromptInput.d.ts.map +0 -1
- package/dist/ink-ui/components/PromptInput.js +0 -30
- package/dist/ink-ui/components/PromptInput.js.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts +0 -13
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.js +0 -53
- package/dist/ink-ui/components/RunningHorseIndicator.js.map +0 -1
- package/dist/ink-ui/components/SelectList.d.ts +0 -16
- package/dist/ink-ui/components/SelectList.d.ts.map +0 -1
- package/dist/ink-ui/components/SelectList.js +0 -60
- package/dist/ink-ui/components/SelectList.js.map +0 -1
- package/dist/ink-ui/components/StatusLine.d.ts +0 -11
- package/dist/ink-ui/components/StatusLine.d.ts.map +0 -1
- package/dist/ink-ui/components/StatusLine.js +0 -70
- package/dist/ink-ui/components/StatusLine.js.map +0 -1
- package/dist/ink-ui/components/ToolActivity.d.ts +0 -19
- package/dist/ink-ui/components/ToolActivity.d.ts.map +0 -1
- package/dist/ink-ui/components/ToolActivity.js +0 -134
- package/dist/ink-ui/components/ToolActivity.js.map +0 -1
- package/dist/ink-ui/components/Transcript.d.ts +0 -14
- package/dist/ink-ui/components/Transcript.d.ts.map +0 -1
- package/dist/ink-ui/components/Transcript.js +0 -66
- package/dist/ink-ui/components/Transcript.js.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.d.ts +0 -2
- package/dist/ink-ui/controllers/chat-controller.d.ts.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.js.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts +0 -6
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.js +0 -27
- package/dist/ink-ui/hooks/use-raw-input-bridge.js.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.d.ts +0 -7
- package/dist/ink-ui/hooks/use-terminal-size.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.js +0 -34
- package/dist/ink-ui/hooks/use-terminal-size.js.map +0 -1
- package/dist/ink-ui/launch.d.ts +0 -9
- package/dist/ink-ui/launch.d.ts.map +0 -1
- package/dist/ink-ui/launch.js +0 -101
- package/dist/ink-ui/launch.js.map +0 -1
- package/dist/ink-ui/runtime/grapheme.d.ts +0 -10
- package/dist/ink-ui/runtime/grapheme.d.ts.map +0 -1
- package/dist/ink-ui/runtime/grapheme.js +0 -17
- package/dist/ink-ui/runtime/grapheme.js.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.d.ts +0 -10
- package/dist/ink-ui/runtime/input-buffer.d.ts.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.js +0 -18
- package/dist/ink-ui/runtime/input-buffer.js.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.d.ts +0 -13
- package/dist/ink-ui/runtime/layout-budget.d.ts.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.js +0 -25
- package/dist/ink-ui/runtime/layout-budget.js.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.d.ts +0 -62
- package/dist/ink-ui/runtime/native-cursor.d.ts.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.js +0 -398
- package/dist/ink-ui/runtime/native-cursor.js.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.d.ts +0 -10
- package/dist/ink-ui/runtime/prompt-layout.d.ts.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.js +0 -21
- package/dist/ink-ui/runtime/prompt-layout.js.map +0 -1
- package/dist/ink-ui/runtime/raw-input.d.ts +0 -4
- package/dist/ink-ui/runtime/raw-input.d.ts.map +0 -1
- package/dist/ink-ui/runtime/raw-input.js +0 -15
- package/dist/ink-ui/runtime/raw-input.js.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.d.ts +0 -37
- package/dist/ink-ui/runtime/transcript-state.d.ts.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.js +0 -91
- package/dist/ink-ui/runtime/transcript-state.js.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.d.ts +0 -27
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.js +0 -781
- package/dist/ink-ui/screens/ReplScreen.js.map +0 -1
- package/dist/ink-ui/types.d.ts +0 -2
- package/dist/ink-ui/types.d.ts.map +0 -1
- package/dist/ink-ui/types.js.map +0 -1
- package/dist/runtime/chat-checkpoint.d.ts +0 -17
- package/dist/runtime/chat-checkpoint.d.ts.map +0 -1
- package/dist/runtime/chat-checkpoint.js +0 -105
- package/dist/runtime/chat-checkpoint.js.map +0 -1
- package/dist/runtime/chat-command-scope.d.ts +0 -5
- package/dist/runtime/chat-command-scope.d.ts.map +0 -1
- package/dist/runtime/chat-command-scope.js +0 -22
- package/dist/runtime/chat-command-scope.js.map +0 -1
- package/dist/runtime/chat-compact.d.ts +0 -26
- package/dist/runtime/chat-compact.d.ts.map +0 -1
- package/dist/runtime/chat-compact.js +0 -132
- package/dist/runtime/chat-compact.js.map +0 -1
- package/dist/runtime/chat-controller.d.ts +0 -62
- package/dist/runtime/chat-controller.d.ts.map +0 -1
- package/dist/runtime/chat-controller.js +0 -1620
- package/dist/runtime/chat-controller.js.map +0 -1
- package/dist/runtime/chat-effort.d.ts +0 -5
- package/dist/runtime/chat-effort.d.ts.map +0 -1
- package/dist/runtime/chat-effort.js +0 -47
- package/dist/runtime/chat-effort.js.map +0 -1
- package/dist/runtime/chat-presentation.d.ts +0 -63
- package/dist/runtime/chat-presentation.d.ts.map +0 -1
- package/dist/runtime/chat-presentation.js +0 -561
- package/dist/runtime/chat-presentation.js.map +0 -1
- package/dist/runtime/chat-trace.d.ts +0 -52
- package/dist/runtime/chat-trace.d.ts.map +0 -1
- package/dist/runtime/chat-trace.js +0 -234
- package/dist/runtime/chat-trace.js.map +0 -1
- package/dist/runtime/chat-workspace.d.ts +0 -22
- package/dist/runtime/chat-workspace.d.ts.map +0 -1
- package/dist/runtime/chat-workspace.js +0 -154
- package/dist/runtime/chat-workspace.js.map +0 -1
- package/dist/runtime/goals/accounting.d.ts +0 -45
- package/dist/runtime/goals/accounting.d.ts.map +0 -1
- package/dist/runtime/goals/accounting.js +0 -114
- package/dist/runtime/goals/accounting.js.map +0 -1
- package/dist/runtime/goals/coordinator.d.ts +0 -92
- package/dist/runtime/goals/coordinator.d.ts.map +0 -1
- package/dist/runtime/goals/coordinator.js +0 -1471
- package/dist/runtime/goals/coordinator.js.map +0 -1
- package/dist/runtime/goals/lifecycle.d.ts +0 -13
- package/dist/runtime/goals/lifecycle.d.ts.map +0 -1
- package/dist/runtime/goals/lifecycle.js +0 -46
- package/dist/runtime/goals/lifecycle.js.map +0 -1
- package/dist/runtime/goals/prompt.d.ts +0 -16
- package/dist/runtime/goals/prompt.d.ts.map +0 -1
- package/dist/runtime/goals/prompt.js +0 -88
- package/dist/runtime/goals/prompt.js.map +0 -1
- package/dist/runtime/goals/stop-policy.d.ts +0 -9
- package/dist/runtime/goals/stop-policy.d.ts.map +0 -1
- package/dist/runtime/goals/stop-policy.js +0 -83
- package/dist/runtime/goals/stop-policy.js.map +0 -1
- package/dist/runtime/goals/tools.d.ts +0 -61
- package/dist/runtime/goals/tools.d.ts.map +0 -1
- package/dist/runtime/goals/tools.js +0 -568
- package/dist/runtime/goals/tools.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -10
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js +0 -23
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/init.d.ts +0 -24
- package/dist/sdk/init.d.ts.map +0 -1
- package/dist/sdk/init.js +0 -48
- package/dist/sdk/init.js.map +0 -1
- package/dist/sdk/query.d.ts +0 -19
- package/dist/sdk/query.d.ts.map +0 -1
- package/dist/sdk/query.js +0 -42
- package/dist/sdk/query.js.map +0 -1
- package/dist/sdk/sessions.d.ts +0 -19
- package/dist/sdk/sessions.d.ts.map +0 -1
- package/dist/sdk/sessions.js +0 -57
- package/dist/sdk/sessions.js.map +0 -1
- package/dist/sdk/types.d.ts +0 -47
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/types.js +0 -8
- package/dist/sdk/types.js.map +0 -1
- package/dist/services/agent-runner.d.ts +0 -71
- package/dist/services/agent-runner.d.ts.map +0 -1
- package/dist/services/agent-runner.js +0 -185
- package/dist/services/agent-runner.js.map +0 -1
- package/dist/services/task-manager.d.ts +0 -161
- package/dist/services/task-manager.d.ts.map +0 -1
- package/dist/services/task-manager.js +0 -315
- package/dist/services/task-manager.js.map +0 -1
- package/dist/skills/discovery.d.ts +0 -22
- package/dist/skills/discovery.d.ts.map +0 -1
- package/dist/skills/discovery.js +0 -75
- package/dist/skills/discovery.js.map +0 -1
- package/dist/skills/index.d.ts +0 -11
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/loader.d.ts +0 -53
- package/dist/skills/loader.d.ts.map +0 -1
- package/dist/skills/loader.js +0 -421
- package/dist/skills/loader.js.map +0 -1
- package/dist/skills/registry.d.ts +0 -41
- package/dist/skills/registry.d.ts.map +0 -1
- package/dist/skills/registry.js +0 -157
- package/dist/skills/registry.js.map +0 -1
- package/dist/skills/runtime.d.ts +0 -46
- package/dist/skills/runtime.d.ts.map +0 -1
- package/dist/skills/runtime.js +0 -363
- package/dist/skills/runtime.js.map +0 -1
- package/dist/skills/types.d.ts +0 -112
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -24
- package/dist/skills/types.js.map +0 -1
- package/dist/tools/index.d.ts +0 -52
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -2268
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/mcp.d.ts +0 -99
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mcp.js +0 -695
- package/dist/tools/mcp.js.map +0 -1
- package/dist/tools/plan.d.ts +0 -17
- package/dist/tools/plan.d.ts.map +0 -1
- package/dist/tools/plan.js +0 -84
- package/dist/tools/plan.js.map +0 -1
- package/docs/migration/v0.1.8-to-v0.1.9.md +0 -60
- package/docs/plan/v0.1.9-release-checklist.md +0 -64
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Turn-level
|
|
3
|
+
* Turn-level bridge for the modern subagent runtime.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the
|
|
8
|
-
*
|
|
9
|
-
* turn's tool list. Returns null when subagents are off or the LLM is absent,
|
|
10
|
-
* so the root loop is unchanged.
|
|
5
|
+
* The bridge is intentionally dependency-injected. If the product composition
|
|
6
|
+
* root has not supplied a durable parent fork anchor and production child
|
|
7
|
+
* runtime, the capability is unavailable instead of falling back to query()
|
|
8
|
+
* or a process-global tool catalog.
|
|
11
9
|
*/
|
|
12
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
11
|
exports.runSubtaskBatch = void 0;
|
|
@@ -16,171 +14,23 @@ exports.createSubagentToolForTurn = createSubagentToolForTurn;
|
|
|
16
14
|
exports.deriveRootLlmConfig = deriveRootLlmConfig;
|
|
17
15
|
const budget_1 = require("./budget");
|
|
18
16
|
const provider_gate_1 = require("./provider-gate");
|
|
19
|
-
const production_1 = require("./production");
|
|
20
17
|
const supervisor_1 = require("./supervisor");
|
|
21
18
|
Object.defineProperty(exports, "runSubtaskBatch", { enumerable: true, get: function () { return supervisor_1.runSubtaskBatch; } });
|
|
22
19
|
const tool_1 = require("./tool");
|
|
23
|
-
const presets_1 = require("./presets");
|
|
24
|
-
const child_executor_guard_1 = require("./child-executor-guard");
|
|
25
|
-
const web_research_adapter_1 = require("./web-research-adapter");
|
|
26
20
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* subagents barrel → runtime-integration → tools/index → web → config → subagents/types
|
|
31
|
-
* When `tools/index` loads before `web.ts` finishes, `WEB_TOOLS` is still
|
|
32
|
-
* `undefined` and `...WEB_TOOLS` throws "not iterable". Deferring the import
|
|
33
|
-
* to call-time breaks the cycle because by then all modules have initialized.
|
|
34
|
-
*/
|
|
35
|
-
function lazyRuntimeTools() {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
37
|
-
const tools = require('../../tools');
|
|
38
|
-
return { executeTool: tools.executeTool, getRuntimeTools: tools.getRuntimeTools };
|
|
39
|
-
}
|
|
40
|
-
function parseSearchOutput(output, query, provider, limit) {
|
|
41
|
-
const results = [];
|
|
42
|
-
const seen = new Set();
|
|
43
|
-
const markdownLink = /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)(?:\s*-\s*([^\n]+))?/giu;
|
|
44
|
-
for (const match of output.matchAll(markdownLink)) {
|
|
45
|
-
const url = match[2];
|
|
46
|
-
if (seen.has(url))
|
|
47
|
-
continue;
|
|
48
|
-
seen.add(url);
|
|
49
|
-
results.push({
|
|
50
|
-
query,
|
|
51
|
-
provider,
|
|
52
|
-
title: match[1].trim() || url,
|
|
53
|
-
url,
|
|
54
|
-
...(match[3]?.trim() ? { snippet: match[3].trim() } : {}),
|
|
55
|
-
status: 'ok',
|
|
56
|
-
});
|
|
57
|
-
if (results.length >= limit)
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return results;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Adapt only the first-class WebSearch/WebFetch tools. They remain outside the
|
|
64
|
-
* child allowlist; this root-owned dependency is reached only after the
|
|
65
|
-
* scheduler approves an external `subtask` request.
|
|
66
|
-
*/
|
|
67
|
-
function createDedicatedWebResearchDeps(runtimeTools, cwd) {
|
|
68
|
-
const searchTool = runtimeTools.find(tool => tool.name === 'web_search');
|
|
69
|
-
const fetchTool = runtimeTools.find(tool => tool.name === 'web_fetch');
|
|
70
|
-
if (!searchTool || !fetchTool)
|
|
71
|
-
return undefined;
|
|
72
|
-
const context = (signal) => ({
|
|
73
|
-
cwd,
|
|
74
|
-
config: { name: 'orion-code-research', mode: 'root-approved-web-research' },
|
|
75
|
-
abortSignal: signal,
|
|
76
|
-
});
|
|
77
|
-
return {
|
|
78
|
-
search: async (query, limit, signal) => {
|
|
79
|
-
if (signal?.aborted)
|
|
80
|
-
throw new Error('web search cancelled by parent');
|
|
81
|
-
const result = await searchTool.execute({ query, limit }, context(signal));
|
|
82
|
-
if (!result.success)
|
|
83
|
-
throw new Error(result.error || 'web search failed');
|
|
84
|
-
const provider = typeof result.metadata?.provider === 'string'
|
|
85
|
-
? result.metadata.provider
|
|
86
|
-
: typeof result.metadata?.source === 'string'
|
|
87
|
-
? result.metadata.source
|
|
88
|
-
: 'web_search';
|
|
89
|
-
return parseSearchOutput(result.output, query, provider, limit);
|
|
90
|
-
},
|
|
91
|
-
fetch: async (url, prompt, signal) => {
|
|
92
|
-
if (signal?.aborted) {
|
|
93
|
-
return {
|
|
94
|
-
url,
|
|
95
|
-
status: 'error',
|
|
96
|
-
failureReason: 'web fetch cancelled by parent or deadline',
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const result = await fetchTool.execute({ url, prompt: prompt ?? 'extract relevant facts and citations' }, context(signal));
|
|
100
|
-
if (!result.success) {
|
|
101
|
-
const failureReason = result.error || 'web fetch failed';
|
|
102
|
-
return {
|
|
103
|
-
url,
|
|
104
|
-
status: /security|blocked|ssrf|internal network/iu.test(failureReason)
|
|
105
|
-
? 'blocked'
|
|
106
|
-
: 'error',
|
|
107
|
-
failureReason,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
const finalUrlMatch = result.output.match(/\n\nFinal URL \(after redirects\):\s*(\S+)\s*$/u);
|
|
111
|
-
const content = finalUrlMatch
|
|
112
|
-
? result.output.slice(0, finalUrlMatch.index).trimEnd()
|
|
113
|
-
: result.output;
|
|
114
|
-
return {
|
|
115
|
-
url,
|
|
116
|
-
status: 'ok',
|
|
117
|
-
content,
|
|
118
|
-
...(finalUrlMatch ? { finalUrl: finalUrlMatch[1] } : {}),
|
|
119
|
-
bytes: Buffer.byteLength(content, 'utf8'),
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Build the `subtask` tool for a root turn, or null if disabled.
|
|
126
|
-
*
|
|
127
|
-
* Returns a bundle: the tool to merge into the root turn's tool list, plus an
|
|
128
|
-
* accessor for the aggregate child usage so the root loop can fold child cost
|
|
129
|
-
* into its loop stats and `/cost`. The bundle is null when subagents are off.
|
|
21
|
+
* Build the root `subtask` tool. Missing modern dependencies are a deliberate
|
|
22
|
+
* fail-closed result while the product composition root migrates its parent
|
|
23
|
+
* fork anchor.
|
|
130
24
|
*/
|
|
131
25
|
function createSubagentBundleForTurn(inputs) {
|
|
132
|
-
const { config, cwd,
|
|
133
|
-
if (config.mode === 'off')
|
|
26
|
+
const { config, cwd, abortSignal, onSubtaskEvent } = inputs;
|
|
27
|
+
if (config.mode === 'off' || !inputs.rootLlmConfig.apiKey)
|
|
134
28
|
return null;
|
|
135
|
-
if (!
|
|
29
|
+
if (!inputs.productionRuntime ||
|
|
30
|
+
(!inputs.parentFork && !inputs.parentForkSource) ||
|
|
31
|
+
!inputs.parentAuthority) {
|
|
136
32
|
return null;
|
|
137
|
-
|
|
138
|
-
// filter once for 'research'. Assert no forbidden tool slips in as a
|
|
139
|
-
// defense-in-depth check (the allowlist already excludes them, but this
|
|
140
|
-
// catches future regressions).
|
|
141
|
-
const { executeTool, getRuntimeTools } = lazyRuntimeTools();
|
|
142
|
-
const runtimeTools = getRuntimeTools();
|
|
143
|
-
const availableNames = runtimeTools.map(t => t.name);
|
|
144
|
-
const allowedNames = new Set((0, presets_1.filterToolsForRole)(availableNames, 'research', runtimeTools));
|
|
145
|
-
const childTools = runtimeTools.filter(t => allowedNames.has(t.name));
|
|
146
|
-
(0, presets_1.assertNoForbiddenTools)(childTools.map(t => t.name));
|
|
147
|
-
// Defense-in-depth: map tool name -> definition so the executor can re-verify
|
|
148
|
-
// isReadOnly() on every call. A tool that is not read-only must never execute
|
|
149
|
-
// in a child context, regardless of what the allowlist says at construction.
|
|
150
|
-
const childToolByName = new Map();
|
|
151
|
-
for (const t of childTools)
|
|
152
|
-
childToolByName.set(t.name, t);
|
|
153
|
-
// R3: the async-context scope holder lets the supervisor bind each child to
|
|
154
|
-
// its packet scope, so parallel children cannot overwrite one another while
|
|
155
|
-
// sharing the same guarded executor.
|
|
156
|
-
const scopeHolder = new child_executor_guard_1.ScopeHolder();
|
|
157
|
-
const unguardedExecutor = async (name, args, signal) => {
|
|
158
|
-
if (!allowedNames.has(name)) {
|
|
159
|
-
return JSON.stringify({
|
|
160
|
-
success: false,
|
|
161
|
-
error: `Tool ${name} is not available to subagents.`,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
// Re-verify read-only at execution time: catches tools whose isReadOnly()
|
|
165
|
-
// returns false (mutating MCP actions, future regressions).
|
|
166
|
-
const tool = childToolByName.get(name);
|
|
167
|
-
if (!tool || tool.isReadOnly?.(args) !== true) {
|
|
168
|
-
return JSON.stringify({
|
|
169
|
-
success: false,
|
|
170
|
-
error: `Tool ${name} is not read-only and cannot run in a subagent.`,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
const toolContext = {
|
|
174
|
-
cwd,
|
|
175
|
-
config: { name: 'orion-code-subagent', mode: 'subagent' },
|
|
176
|
-
abortSignal: signal,
|
|
177
|
-
};
|
|
178
|
-
return executeTool(name, args, signal, toolContext);
|
|
179
|
-
};
|
|
180
|
-
const childToolExecutor = (0, child_executor_guard_1.createChildToolExecutorGuard)(unguardedExecutor, {
|
|
181
|
-
rootCwd: cwd,
|
|
182
|
-
scopeHolder,
|
|
183
|
-
});
|
|
33
|
+
}
|
|
184
34
|
const providerGate = new provider_gate_1.SubagentProviderGate({
|
|
185
35
|
maxConcurrent: config.maxParallel,
|
|
186
36
|
sharedGate: inputs.sharedGate,
|
|
@@ -191,25 +41,17 @@ function createSubagentBundleForTurn(inputs) {
|
|
|
191
41
|
maxToolCallsPerTask: config.maxToolCallsPerTask,
|
|
192
42
|
timeoutMs: config.timeoutMs,
|
|
193
43
|
}));
|
|
194
|
-
// R6: turn-level task counter persists across `subtask` calls so multiple
|
|
195
|
-
// calls in one root turn cannot exceed `maxTasksPerTurn`.
|
|
196
44
|
const turnTaskState = new budget_1.TurnTaskState();
|
|
197
|
-
|
|
198
|
-
rootConfig: rootLlmConfig,
|
|
199
|
-
providerGate,
|
|
200
|
-
maxModelRequestsPerTask: config.maxModelRequestsPerTask,
|
|
201
|
-
maxToolCallsPerTask: config.maxToolCallsPerTask,
|
|
202
|
-
resilience: inputs.resilience,
|
|
203
|
-
beforeProviderRequest: inputs.beforeProviderRequest,
|
|
204
|
-
});
|
|
45
|
+
let closed = false;
|
|
205
46
|
const supervisorDeps = {
|
|
206
47
|
config,
|
|
207
48
|
cwd,
|
|
208
49
|
budget,
|
|
209
50
|
providerGate,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
51
|
+
executeChild: inputs.productionRuntime,
|
|
52
|
+
parentFork: inputs.parentFork,
|
|
53
|
+
parentForkSource: inputs.parentForkSource,
|
|
54
|
+
parentAuthority: inputs.parentAuthority,
|
|
213
55
|
turnTaskState,
|
|
214
56
|
hasPendingPermission: inputs.hasPendingPermission,
|
|
215
57
|
onChildUsage: inputs.onChildUsage,
|
|
@@ -218,32 +60,29 @@ function createSubagentBundleForTurn(inputs) {
|
|
|
218
60
|
modelLabel: inputs.modelLabel,
|
|
219
61
|
onEvent: onSubtaskEvent,
|
|
220
62
|
onSubtaskResult: inputs.onSubtaskResult,
|
|
221
|
-
runWebResearch:
|
|
222
|
-
const deps = inputs.webResearchDeps ?? createDedicatedWebResearchDeps(runtimeTools, cwd);
|
|
223
|
-
return deps
|
|
224
|
-
? (request, parentSignal) => (0, web_research_adapter_1.runWebResearch)(request, deps, parentSignal)
|
|
225
|
-
: undefined;
|
|
226
|
-
})(),
|
|
63
|
+
runWebResearch: inputs.runWebResearch,
|
|
227
64
|
};
|
|
228
|
-
const tool = (0, tool_1.createSubtaskTool)(supervisorDeps);
|
|
229
65
|
return {
|
|
230
|
-
tool,
|
|
231
|
-
/** Read-only accessor for the reconciled aggregate child usage this turn. */
|
|
66
|
+
tool: (0, tool_1.createSubtaskTool)(supervisorDeps),
|
|
232
67
|
getAggregateUsage: () => budget.aggregateUsage(),
|
|
233
|
-
/** Number of subtasks that ran (reconciled) this turn. */
|
|
234
68
|
getSubtaskCount: () => budget.reconciledTaskCount(),
|
|
69
|
+
close: async (reason) => {
|
|
70
|
+
if (closed)
|
|
71
|
+
return;
|
|
72
|
+
closed = true;
|
|
73
|
+
try {
|
|
74
|
+
await inputs.productionRuntime.close(reason ?? 'parent_turn_settled');
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
inputs.parentForkSource?.close(reason ?? 'parent_turn_settled');
|
|
78
|
+
}
|
|
79
|
+
},
|
|
235
80
|
};
|
|
236
81
|
}
|
|
237
|
-
/**
|
|
238
|
-
* Backwards-compatible wrapper returning only the tool. Prefer
|
|
239
|
-
* {@link createSubagentBundleForTurn} when the root loop needs to fold child
|
|
240
|
-
* usage into its stats.
|
|
241
|
-
*/
|
|
242
82
|
function createSubagentToolForTurn(inputs) {
|
|
243
|
-
|
|
244
|
-
return bundle ? bundle.tool : null;
|
|
83
|
+
return createSubagentBundleForTurn(inputs)?.tool ?? null;
|
|
245
84
|
}
|
|
246
|
-
/** Derive the root LLM config slice from the runtime config. */
|
|
85
|
+
/** Derive the root LLM config slice from the legacy runtime config. */
|
|
247
86
|
function deriveRootLlmConfig(config) {
|
|
248
87
|
const registry = config.modelRegistry;
|
|
249
88
|
const profile = registry?.defaultProfile;
|
|
@@ -256,9 +95,6 @@ function deriveRootLlmConfig(config) {
|
|
|
256
95
|
apiKey,
|
|
257
96
|
baseUrl: provider.baseUrl,
|
|
258
97
|
model: profile.model,
|
|
259
|
-
// LLMConfig has one base URL/key. A cross-provider fallback would send
|
|
260
|
-
// the fallback model to the default provider, so fail closed until child
|
|
261
|
-
// fallback becomes provider-aware.
|
|
262
98
|
fallbackModel: registry?.fallbackProfile?.provider === profile.provider
|
|
263
99
|
? registry.fallbackProfile.model
|
|
264
100
|
: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-integration.js","sourceRoot":"","sources":["../../../src/runtime/subagents/runtime-integration.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"runtime-integration.js","sourceRoot":"","sources":["../../../src/runtime/subagents/runtime-integration.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA6EH,kEA0DC;AAED,8DAEC;AAGD,kDA0BC;AA9JD,qCAAuF;AAEvF,mDAAuD;AAEvD,6CAA4E;AA4JnE,gGA5JA,4BAAe,OA4JA;AA3JxB,iCAA2C;AAyD3C;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,MAA0B;IACpE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAC5D,IAAI,MAAM,CAAC,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AC,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpB,OAAO;YACL,MAAM;YACN,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,aAAa,EACX,QAAQ,EAAE,eAAe,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ;gBACtD,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK;gBAChC,CAAC,CAAC,SAAS;SAChB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,UAAU;QAC1B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,MAAM,CAAC,aAAa;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -8,12 +8,16 @@
|
|
|
8
8
|
* The supervisor does NOT own LLM state, tool execution, permission policy or
|
|
9
9
|
* transcript storage. It composes the policy gate, the budget ledger, the
|
|
10
10
|
* provider gate and the runner, and emits renderer-independent lifecycle
|
|
11
|
-
* events that the root loop forwards to terminal/
|
|
11
|
+
* events that the root loop forwards to terminal/TUI.
|
|
12
12
|
*/
|
|
13
13
|
import { SubagentBudgetLedger, TurnTaskState } from './budget';
|
|
14
14
|
import { type PolicyRejectReason } from './policy';
|
|
15
15
|
import { SubagentProviderGate } from './provider-gate';
|
|
16
16
|
import { type ExecuteChildQuery, type ChildToolSet } from './runner';
|
|
17
|
+
import type { AuthoritySnapshotV1 } from '../step-snapshot';
|
|
18
|
+
import type { ParentThreadForkRequestV1 } from '../subagent-thread-runtime';
|
|
19
|
+
import type { ProductionSubagentExecutionPortV1 } from './runtime-contract';
|
|
20
|
+
import type { ParentThreadStepForkSourcePortV1 } from './parent-step-fork';
|
|
17
21
|
import type { ScopeHolder } from './child-executor-guard';
|
|
18
22
|
import type { ResearchRequest } from './research-types';
|
|
19
23
|
import type { WebResearchResult } from './web-research-adapter';
|
|
@@ -23,10 +27,18 @@ export interface SubagentSupervisorDeps {
|
|
|
23
27
|
cwd: string;
|
|
24
28
|
budget: SubagentBudgetLedger;
|
|
25
29
|
providerGate: SubagentProviderGate;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
+
/** Modern production boundary. Child execution owns Thread/Loop/Gateway. */
|
|
31
|
+
executeChild?: ProductionSubagentExecutionPortV1;
|
|
32
|
+
/** Durable parent fork anchor required by the modern production boundary. */
|
|
33
|
+
parentFork?: ParentThreadForkRequestV1;
|
|
34
|
+
/** Resolves the current active step only when a subtask batch actually executes. */
|
|
35
|
+
parentForkSource?: ParentThreadStepForkSourcePortV1;
|
|
36
|
+
/** Root authority that the child role policy may only narrow. */
|
|
37
|
+
parentAuthority?: AuthoritySnapshotV1;
|
|
38
|
+
/** @deprecated Test-only legacy runner seam; production must inject executeChild. */
|
|
39
|
+
executeQuery?: ExecuteChildQuery;
|
|
40
|
+
/** @deprecated Test-only legacy runner seam; production must inject executeChild. */
|
|
41
|
+
toolSet?: ChildToolSet;
|
|
30
42
|
/**
|
|
31
43
|
* R3: async-context scope holder. The supervisor binds each child run to
|
|
32
44
|
* its packet's canonical scope so parallel children cannot overwrite or
|
|
@@ -80,7 +92,7 @@ export interface RunBatchOutcome {
|
|
|
80
92
|
result: SubtaskBatchResult;
|
|
81
93
|
/** Whether policy rejected the entire batch before any child ran. */
|
|
82
94
|
rejected: boolean;
|
|
83
|
-
rejectReason?: PolicyRejectReason;
|
|
95
|
+
rejectReason?: PolicyRejectReason | 'production_runtime_unavailable';
|
|
84
96
|
}
|
|
85
97
|
/**
|
|
86
98
|
* Run a batch of subtasks. Returns a {@link SubtaskBatchResult} whose results
|
|
@@ -89,5 +101,5 @@ export interface RunBatchOutcome {
|
|
|
89
101
|
* Never throws: policy rejection, child failures, timeouts and cancels are
|
|
90
102
|
* all normalized into result entries.
|
|
91
103
|
*/
|
|
92
|
-
export declare function runSubtaskBatch(request: SubtaskRequest,
|
|
104
|
+
export declare function runSubtaskBatch(request: SubtaskRequest, inputDeps: SubagentSupervisorDeps): Promise<RunBatchOutcome>;
|
|
93
105
|
//# sourceMappingURL=supervisor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/runtime/subagents/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAEvB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;IAC7B,YAAY,EAAE,oBAAoB,CAAC;IACnC,
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/runtime/subagents/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MA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own LLM state, tool execution, permission policy or
|
|
10
10
|
* transcript storage. It composes the policy gate, the budget ledger, the
|
|
11
11
|
* provider gate and the runner, and emits renderer-independent lifecycle
|
|
12
|
-
* events that the root loop forwards to terminal/
|
|
12
|
+
* events that the root loop forwards to terminal/TUI.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.runSubtaskBatch = runSubtaskBatch;
|
|
@@ -34,7 +34,32 @@ function nextTaskId() {
|
|
|
34
34
|
* Never throws: policy rejection, child failures, timeouts and cancels are
|
|
35
35
|
* all normalized into result entries.
|
|
36
36
|
*/
|
|
37
|
-
async function runSubtaskBatch(request,
|
|
37
|
+
async function runSubtaskBatch(request, inputDeps) {
|
|
38
|
+
let resolvedParentFork = inputDeps.parentFork;
|
|
39
|
+
try {
|
|
40
|
+
resolvedParentFork ?? (resolvedParentFork = inputDeps.parentForkSource?.current());
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
resolvedParentFork = undefined;
|
|
44
|
+
}
|
|
45
|
+
const deps = resolvedParentFork
|
|
46
|
+
? { ...inputDeps, parentFork: resolvedParentFork }
|
|
47
|
+
: inputDeps;
|
|
48
|
+
const modernReady = Boolean(deps.executeChild && deps.parentFork && deps.parentAuthority);
|
|
49
|
+
const legacyReady = Boolean(deps.executeQuery && deps.toolSet);
|
|
50
|
+
if ((deps.executeChild && !modernReady) || (!modernReady && !legacyReady)) {
|
|
51
|
+
const batchId = nextBatchId();
|
|
52
|
+
const results = request.tasks.map(packet => {
|
|
53
|
+
const result = buildRejectedResult(packet, 'production_runtime_unavailable');
|
|
54
|
+
finalizeTask(deps, batchId, result.id, packet, result);
|
|
55
|
+
return result;
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
result: { batchId, results, aggregateUsage: (0, types_1.sumSubtaskUsage)([]) },
|
|
59
|
+
rejected: true,
|
|
60
|
+
rejectReason: 'production_runtime_unavailable',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
38
63
|
// Validate the authoritative ResearchRequest before policy/budget/provider
|
|
39
64
|
// work. An external request without the dedicated root capability must fail
|
|
40
65
|
// closed instead of silently degrading to local-only research.
|
|
@@ -131,23 +156,26 @@ async function runSubtaskBatch(request, deps) {
|
|
|
131
156
|
objective: tasks[i].objective,
|
|
132
157
|
});
|
|
133
158
|
}
|
|
134
|
-
const runnerDeps = (i) =>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
159
|
+
const runnerDeps = (i) => deps.executeQuery && deps.toolSet
|
|
160
|
+
? {
|
|
161
|
+
cwd: deps.cwd,
|
|
162
|
+
canonicalScopePaths: verdict.canonicalScope.get(i),
|
|
163
|
+
toolSet: deps.toolSet,
|
|
164
|
+
executeQuery: deps.executeQuery,
|
|
165
|
+
executionBudget: executionBudgets[i],
|
|
166
|
+
timeoutMs: deps.config.timeoutMs,
|
|
167
|
+
parentAbortSignal: deps.parentAbortSignal,
|
|
168
|
+
rootObjectiveSummary: deps.rootObjectiveSummary,
|
|
169
|
+
modelLabel: deps.modelLabel,
|
|
170
|
+
}
|
|
171
|
+
: undefined;
|
|
145
172
|
let outcomes;
|
|
173
|
+
const canonicalScopes = (i) => verdict.canonicalScope.get(i);
|
|
146
174
|
if (request.execution === 'parallel') {
|
|
147
|
-
outcomes = await runParallel(tasks, taskIds, batchId, deps, runnerDeps);
|
|
175
|
+
outcomes = await runParallel(tasks, taskIds, batchId, deps, runnerDeps, canonicalScopes, executionBudgets);
|
|
148
176
|
}
|
|
149
177
|
else {
|
|
150
|
-
outcomes = await runSerial(tasks, taskIds, batchId, deps, runnerDeps);
|
|
178
|
+
outcomes = await runSerial(tasks, taskIds, batchId, deps, runnerDeps, canonicalScopes, executionBudgets);
|
|
151
179
|
}
|
|
152
180
|
// Reconcile budget for each task with its real usage.
|
|
153
181
|
for (const outcome of outcomes) {
|
|
@@ -160,12 +188,12 @@ async function runSubtaskBatch(request, deps) {
|
|
|
160
188
|
rejected: false,
|
|
161
189
|
};
|
|
162
190
|
}
|
|
163
|
-
async function runParallel(tasks, taskIds, batchId, deps, runnerDeps) {
|
|
191
|
+
async function runParallel(tasks, taskIds, batchId, deps, runnerDeps, canonicalScopes, executionBudgets) {
|
|
164
192
|
// Launch each child; the provider gate bounds actual concurrency. Collect
|
|
165
193
|
// by index so the final order matches the request order.
|
|
166
194
|
// allSettled guarantees every task is accounted for even if a future
|
|
167
195
|
// refactor breaks the "runOne never throws" contract.
|
|
168
|
-
const slots = tasks.map((task, i) => runOne(task, taskIds[i], batchId, i, deps, runnerDeps(i)));
|
|
196
|
+
const slots = tasks.map((task, i) => runOne(task, taskIds[i], batchId, i, deps, runnerDeps(i), canonicalScopes(i), executionBudgets[i]));
|
|
169
197
|
const settled = await Promise.allSettled(slots);
|
|
170
198
|
return settled.map((s, i) => {
|
|
171
199
|
if (s.status === 'fulfilled')
|
|
@@ -195,7 +223,7 @@ async function runParallel(tasks, taskIds, batchId, deps, runnerDeps) {
|
|
|
195
223
|
return { result, parentCancelled: false };
|
|
196
224
|
});
|
|
197
225
|
}
|
|
198
|
-
async function runSerial(tasks, taskIds, batchId, deps, runnerDeps) {
|
|
226
|
+
async function runSerial(tasks, taskIds, batchId, deps, runnerDeps, canonicalScopes, executionBudgets) {
|
|
199
227
|
const outcomes = [];
|
|
200
228
|
for (let i = 0; i < tasks.length; i++) {
|
|
201
229
|
if (deps.parentAbortSignal?.aborted) {
|
|
@@ -212,25 +240,24 @@ async function runSerial(tasks, taskIds, batchId, deps, runnerDeps) {
|
|
|
212
240
|
}
|
|
213
241
|
break;
|
|
214
242
|
}
|
|
215
|
-
const outcome = await runOne(tasks[i], taskIds[i], batchId, i, deps, runnerDeps(i));
|
|
243
|
+
const outcome = await runOne(tasks[i], taskIds[i], batchId, i, deps, runnerDeps(i), canonicalScopes(i), executionBudgets[i]);
|
|
216
244
|
outcomes.push(outcome);
|
|
217
245
|
}
|
|
218
246
|
return outcomes;
|
|
219
247
|
}
|
|
220
|
-
async function runOne(task, taskId, batchId, _index, deps, runnerDeps) {
|
|
248
|
+
async function runOne(task, taskId, batchId, _index, deps, runnerDeps, canonicalScopePaths, executionBudget) {
|
|
221
249
|
// R4: pass the parent abort signal so a queued waiter is removed and
|
|
222
250
|
// rejected when the user hits Ctrl+C, instead of hanging until a slot
|
|
223
251
|
// frees. A rejected acquire yields a cancelled result, not a hung batch.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return { result: cancelled, parentCancelled: true };
|
|
252
|
+
if (!deps.executeChild) {
|
|
253
|
+
try {
|
|
254
|
+
await deps.providerGate.acquire(deps.parentAbortSignal);
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
const cancelled = cancelledResult(taskId, task);
|
|
258
|
+
finalizeTask(deps, batchId, taskId, task, cancelled);
|
|
259
|
+
return { result: cancelled, parentCancelled: true };
|
|
260
|
+
}
|
|
234
261
|
}
|
|
235
262
|
try {
|
|
236
263
|
const execute = async () => {
|
|
@@ -239,7 +266,23 @@ async function runOne(task, taskId, batchId, _index, deps, runnerDeps) {
|
|
|
239
266
|
const webPromise = request && (request.mode === 'web' || request.mode === 'mixed')
|
|
240
267
|
? deps.runWebResearch(request, deps.parentAbortSignal)
|
|
241
268
|
: undefined;
|
|
242
|
-
const outcome =
|
|
269
|
+
const outcome = deps.executeChild
|
|
270
|
+
? await deps.executeChild.execute({
|
|
271
|
+
taskId,
|
|
272
|
+
packet: task,
|
|
273
|
+
canonicalScopePaths,
|
|
274
|
+
parent: deps.parentFork,
|
|
275
|
+
parentAuthority: deps.parentAuthority,
|
|
276
|
+
budget: {
|
|
277
|
+
maxModelRequests: executionBudget.maxModelRequests,
|
|
278
|
+
maxToolCalls: executionBudget.maxToolCalls,
|
|
279
|
+
},
|
|
280
|
+
timeoutMs: deps.config.timeoutMs,
|
|
281
|
+
abortSignal: deps.parentAbortSignal,
|
|
282
|
+
rootObjectiveSummary: deps.rootObjectiveSummary,
|
|
283
|
+
modelLabel: deps.modelLabel,
|
|
284
|
+
})
|
|
285
|
+
: await (0, runner_1.runSubtask)(task, requiredLegacyRunnerDeps(runnerDeps), taskId);
|
|
243
286
|
let web;
|
|
244
287
|
if (webPromise) {
|
|
245
288
|
try {
|
|
@@ -249,24 +292,24 @@ async function runOne(task, taskId, batchId, _index, deps, runnerDeps) {
|
|
|
249
292
|
web = failedWebResearchResult(error, Boolean(deps.parentAbortSignal?.aborted));
|
|
250
293
|
}
|
|
251
294
|
}
|
|
252
|
-
// R7: single finalize path - terminal event + result callback + usage
|
|
253
|
-
// callback all happen here, exactly once, with errors isolated so a
|
|
254
|
-
// throwing sink cannot reject the batch or corrupt sibling aggregation.
|
|
255
295
|
finalizeTask(deps, batchId, taskId, task, outcome.result, request ? { request, ...(web ? { web } : {}) } : undefined);
|
|
256
296
|
return outcome;
|
|
257
297
|
};
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
// run finishes, so no child can clear a sibling or root boundary.
|
|
261
|
-
if (deps.scopeHolder) {
|
|
262
|
-
return await deps.scopeHolder.runWithScope(runnerDeps.canonicalScopePaths ?? [], execute);
|
|
298
|
+
if (!deps.executeChild && deps.scopeHolder) {
|
|
299
|
+
return await deps.scopeHolder.runWithScope(canonicalScopePaths ?? [], execute);
|
|
263
300
|
}
|
|
264
301
|
return await execute();
|
|
265
302
|
}
|
|
266
303
|
finally {
|
|
267
|
-
deps.
|
|
304
|
+
if (!deps.executeChild)
|
|
305
|
+
deps.providerGate.release();
|
|
268
306
|
}
|
|
269
307
|
}
|
|
308
|
+
function requiredLegacyRunnerDeps(deps) {
|
|
309
|
+
if (!deps)
|
|
310
|
+
throw new Error('Legacy child runner dependencies are unavailable.');
|
|
311
|
+
return deps;
|
|
312
|
+
}
|
|
270
313
|
/**
|
|
271
314
|
* R7: finalize exactly once per task. Emits the terminal lifecycle event,
|
|
272
315
|
* persists the result (artifact), and reports observed usage to the root
|