@orion-agents/orion-code 0.1.8 → 0.2.0
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 +495 -0
- package/README.md +142 -314
- package/README.zh-CN.md +117 -559
- package/dist/cli.js +71 -90
- 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 +174 -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 +2 -2
- package/dist/commands/model-command-handlers.d.ts.map +1 -1
- package/dist/commands/model-command-handlers.js +168 -3
- 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.map +1 -1
- package/dist/commands/session-command-handlers.js +35 -119
- 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 +2 -50
- 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 +14 -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 +8 -6
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +14 -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 +71 -26
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +371 -102
- package/dist/framework/query.js.map +1 -1
- package/dist/framework/stop-decision.d.ts +56 -0
- package/dist/framework/stop-decision.d.ts.map +1 -0
- package/dist/framework/stop-decision.js +36 -0
- package/dist/framework/stop-decision.js.map +1 -0
- 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/harness/assembler.d.ts.map +1 -1
- package/dist/harness/assembler.js +77 -19
- package/dist/harness/assembler.js.map +1 -1
- package/dist/harness/capability-profile.d.ts +3 -0
- package/dist/harness/capability-profile.d.ts.map +1 -0
- package/dist/harness/capability-profile.js +44 -0
- package/dist/harness/capability-profile.js.map +1 -0
- package/dist/harness/capsule.d.ts.map +1 -1
- package/dist/harness/capsule.js +22 -3
- package/dist/harness/capsule.js.map +1 -1
- package/dist/harness/compact-benchmark-corpus.d.ts +10 -0
- package/dist/harness/compact-benchmark-corpus.d.ts.map +1 -0
- package/dist/harness/compact-benchmark-corpus.js +56 -0
- package/dist/harness/compact-benchmark-corpus.js.map +1 -0
- package/dist/harness/context-harness.d.ts +23 -3
- package/dist/harness/context-harness.d.ts.map +1 -1
- package/dist/harness/context-harness.js +183 -11
- package/dist/harness/context-harness.js.map +1 -1
- package/dist/harness/contract.d.ts.map +1 -1
- package/dist/harness/contract.js +106 -11
- package/dist/harness/contract.js.map +1 -1
- package/dist/harness/drift-guard.d.ts +2 -1
- package/dist/harness/drift-guard.d.ts.map +1 -1
- package/dist/harness/drift-guard.js +315 -20
- package/dist/harness/drift-guard.js.map +1 -1
- package/dist/harness/evidence.d.ts.map +1 -1
- package/dist/harness/evidence.js +25 -12
- package/dist/harness/evidence.js.map +1 -1
- package/dist/harness/index.d.ts +7 -2
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +19 -1
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/ledger.d.ts.map +1 -1
- package/dist/harness/ledger.js +44 -14
- package/dist/harness/ledger.js.map +1 -1
- package/dist/harness/progress-controller.d.ts +14 -0
- package/dist/harness/progress-controller.d.ts.map +1 -0
- package/dist/harness/progress-controller.js +110 -0
- package/dist/harness/progress-controller.js.map +1 -0
- package/dist/harness/state.d.ts.map +1 -1
- package/dist/harness/state.js +5 -2
- package/dist/harness/state.js.map +1 -1
- package/dist/harness/stop-controller.d.ts +15 -0
- package/dist/harness/stop-controller.d.ts.map +1 -0
- package/dist/harness/stop-controller.js +87 -0
- package/dist/harness/stop-controller.js.map +1 -0
- package/dist/harness/types.d.ts +137 -0
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/verification.d.ts +7 -0
- package/dist/harness/verification.d.ts.map +1 -0
- package/dist/harness/verification.js +122 -0
- package/dist/harness/verification.js.map +1 -0
- package/dist/index.d.ts +70 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -59
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/prompt-context.d.ts +42 -0
- package/dist/memory/prompt-context.d.ts.map +1 -0
- package/dist/memory/prompt-context.js +129 -0
- package/dist/memory/prompt-context.js.map +1 -0
- 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 +78 -0
- package/dist/runtime/agent-loop.d.ts.map +1 -0
- package/dist/runtime/agent-loop.js +418 -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 +265 -1215
- 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 +34 -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 +105 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.js +506 -0
- package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
- package/dist/runtime/goals/types.d.ts +0 -1
- package/dist/runtime/goals/types.d.ts.map +1 -1
- package/dist/runtime/goals/types.js +0 -1
- package/dist/runtime/goals/types.js.map +1 -1
- 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/model-coordinator.d.ts +44 -1
- package/dist/runtime/model-coordinator.d.ts.map +1 -1
- package/dist/runtime/model-coordinator.js +161 -19
- package/dist/runtime/model-coordinator.js.map +1 -1
- package/dist/runtime/orion-runtime-v1.d.ts +321 -0
- package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
- package/dist/runtime/orion-runtime-v1.js +958 -0
- package/dist/runtime/orion-runtime-v1.js.map +1 -0
- package/dist/runtime/orion-session-runner.d.ts +37 -0
- package/dist/runtime/orion-session-runner.d.ts.map +1 -0
- package/dist/runtime/orion-session-runner.js +146 -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 +1019 -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 +109 -0
- package/dist/runtime/release-receipts.d.ts.map +1 -0
- package/dist/runtime/release-receipts.js +304 -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/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 +5 -2
- 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 -42
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +494 -151
- 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/runner.d.ts +12 -1
- package/dist/runtime/subagents/runner.d.ts.map +1 -1
- package/dist/runtime/subagents/runner.js +62 -1
- package/dist/runtime/subagents/runner.js.map +1 -1
- 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 -197
- 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 +88 -39
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +5 -2
- package/dist/runtime/subagents/types.d.ts.map +1 -1
- package/dist/runtime/subagents/types.js +1 -1
- package/dist/runtime/subagents/types.js.map +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-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 +85 -0
- package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
- package/dist/runtime/thread-ui-adapter.js +514 -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 +1 -1
- package/dist/runtime/ui-view-model.d.ts.map +1 -1
- package/dist/runtime/ui-view-model.js +3 -5
- package/dist/runtime/ui-view-model.js.map +1 -1
- package/dist/services/compact/auto-compact.d.ts +82 -2
- package/dist/services/compact/auto-compact.d.ts.map +1 -1
- package/dist/services/compact/auto-compact.js +226 -44
- package/dist/services/compact/auto-compact.js.map +1 -1
- package/dist/services/compact/compact.d.ts +54 -37
- package/dist/services/compact/compact.d.ts.map +1 -1
- package/dist/services/compact/compact.js +512 -127
- package/dist/services/compact/compact.js.map +1 -1
- package/dist/services/compact/coordinator.d.ts +5 -1
- package/dist/services/compact/coordinator.d.ts.map +1 -1
- package/dist/services/compact/coordinator.js +10 -1
- package/dist/services/compact/coordinator.js.map +1 -1
- package/dist/services/compact/fingerprint.d.ts +27 -0
- package/dist/services/compact/fingerprint.d.ts.map +1 -0
- package/dist/services/compact/fingerprint.js +69 -0
- package/dist/services/compact/fingerprint.js.map +1 -0
- package/dist/services/compact/index.d.ts +7 -5
- package/dist/services/compact/index.d.ts.map +1 -1
- package/dist/services/compact/index.js +19 -6
- package/dist/services/compact/index.js.map +1 -1
- package/dist/services/compact/planner.d.ts +41 -0
- package/dist/services/compact/planner.d.ts.map +1 -0
- package/dist/services/compact/planner.js +102 -0
- package/dist/services/compact/planner.js.map +1 -0
- package/dist/services/compact/semantic-summary.d.ts +93 -0
- package/dist/services/compact/semantic-summary.d.ts.map +1 -0
- package/dist/services/compact/semantic-summary.js +158 -0
- package/dist/services/compact/semantic-summary.js.map +1 -0
- package/dist/services/compact/summary-generator.d.ts +23 -0
- package/dist/services/compact/summary-generator.d.ts.map +1 -1
- package/dist/services/compact/summary-generator.js +173 -39
- package/dist/services/compact/summary-generator.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-context.d.ts.map +1 -1
- package/dist/services/file-context.js +29 -33
- package/dist/services/file-context.js.map +1 -1
- package/dist/services/global-config.d.ts +8 -2
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/services/global-config.js +8 -0
- package/dist/services/global-config.js.map +1 -1
- package/dist/services/llm.d.ts +3 -0
- package/dist/services/llm.d.ts.map +1 -1
- package/dist/services/llm.js +7 -0
- package/dist/services/llm.js.map +1 -1
- package/dist/services/project-instructions.d.ts.map +1 -1
- package/dist/services/project-instructions.js +10 -17
- package/dist/services/project-instructions.js.map +1 -1
- package/dist/services/safe-project-reader.d.ts +30 -0
- package/dist/services/safe-project-reader.d.ts.map +1 -0
- package/dist/services/safe-project-reader.js +141 -0
- package/dist/services/safe-project-reader.js.map +1 -0
- package/dist/services/session-storage.d.ts +134 -5
- package/dist/services/session-storage.d.ts.map +1 -1
- package/dist/services/session-storage.js +727 -57
- package/dist/services/session-storage.js.map +1 -1
- package/dist/services/usage-state.d.ts +7 -0
- package/dist/services/usage-state.d.ts.map +1 -1
- package/dist/services/usage-state.js +117 -16
- package/dist/services/usage-state.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 +19 -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/tui-ui/chrome-view-model.js +1 -1
- package/dist/tui-ui/chrome-view-model.js.map +1 -1
- package/dist/tui-ui/layout.js +1 -1
- package/dist/tui-ui/layout.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 +27 -0
- package/npm-shrinkwrap.json +9 -438
- package/package.json +19 -11
- 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 -251
- package/dist/agents/coordinator.js.map +0 -1
- package/dist/agents/fork.d.ts +0 -69
- package/dist/agents/fork.d.ts.map +0 -1
- package/dist/agents/fork.js +0 -164
- 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 -224
- 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 -186
- package/dist/framework/tool-scheduler.d.ts.map +0 -1
- package/dist/framework/tool-scheduler.js +0 -558
- 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 -24
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.js +0 -756
- 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-controller.d.ts +0 -62
- package/dist/runtime/chat-controller.d.ts.map +0 -1
- package/dist/runtime/chat-controller.js +0 -1630
- 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 -89
- package/dist/runtime/goals/coordinator.d.ts.map +0 -1
- package/dist/runtime/goals/coordinator.js +0 -1481
- 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/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/compact/micro-compact.d.ts +0 -21
- package/dist/services/compact/micro-compact.d.ts.map +0 -1
- package/dist/services/compact/micro-compact.js +0 -99
- package/dist/services/compact/micro-compact.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 -364
- 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
|
@@ -1,28 +1,297 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Modern production composition for isolated subagent Threads.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* shared across concurrent children. All children still flow through the shared
|
|
9
|
-
* {@link SubagentProviderGate} for concurrency bounding and cooldown.
|
|
10
|
-
*
|
|
11
|
-
* `createLlm` and `runQuery` are injectable so the binding is unit-testable
|
|
12
|
-
* without a live provider; production wires them to `new LLMService(...)` and
|
|
13
|
-
* `query()`.
|
|
5
|
+
* This module deliberately does not import framework/query or the process-wide
|
|
6
|
+
* tool catalog. Every child receives an explicit model factory and immutable
|
|
7
|
+
* tool catalog, then runs through AgentLoopV1 -> ToolGateway -> ExecutionService.
|
|
14
8
|
*/
|
|
15
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ProductionSubagentRuntimeV1 = exports.ProductionSubagentRuntimeError = void 0;
|
|
16
11
|
exports.createChildLlmConfig = createChildLlmConfig;
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
19
|
-
const
|
|
12
|
+
exports.createProductionSubagentRuntimeV1 = createProductionSubagentRuntimeV1;
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
const stop_decision_1 = require("../../framework/stop-decision");
|
|
15
|
+
const agent_loop_1 = require("../agent-loop");
|
|
16
|
+
const capability_receipt_journal_1 = require("../capability-receipt-journal");
|
|
17
|
+
const capability_step_factory_1 = require("../capability-step-factory");
|
|
18
|
+
const first_party_tool_services_1 = require("../first-party-tool-services");
|
|
19
|
+
const canonical_1 = require("../protocol/canonical");
|
|
20
|
+
const step_snapshot_1 = require("../step-snapshot");
|
|
21
|
+
const subagent_thread_runtime_1 = require("../subagent-thread-runtime");
|
|
22
|
+
const task_context_service_1 = require("../task-context-service");
|
|
23
|
+
const thread_tool_journal_1 = require("../thread-tool-journal");
|
|
24
|
+
const tool_gateway_1 = require("../tool-gateway");
|
|
25
|
+
const turn_commit_1 = require("../turn-commit");
|
|
26
|
+
const context_builder_1 = require("./context-builder");
|
|
27
|
+
const child_executor_guard_1 = require("./child-executor-guard");
|
|
28
|
+
const result_parser_1 = require("./result-parser");
|
|
29
|
+
const receipt_journal_1 = require("./receipt-journal");
|
|
20
30
|
const types_1 = require("./types");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
class ProductionSubagentRuntimeError extends Error {
|
|
32
|
+
constructor(code, message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.name = 'ProductionSubagentRuntimeError';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.ProductionSubagentRuntimeError = ProductionSubagentRuntimeError;
|
|
39
|
+
/** One root-turn-owned production service; child runtime instances are request scoped. */
|
|
40
|
+
class ProductionSubagentRuntimeV1 {
|
|
41
|
+
constructor(options) {
|
|
42
|
+
this.serviceId = 'production-subagent-runtime-v1';
|
|
43
|
+
this.issuedModelExecutors = new WeakSet();
|
|
44
|
+
this.closed = false;
|
|
45
|
+
validateOptions(options);
|
|
46
|
+
this.options = Object.freeze({ ...options });
|
|
47
|
+
this.tree = new subagent_thread_runtime_1.SubagentThreadTreeScopeV1(options.treeLimits, options.parentAbortSignal);
|
|
48
|
+
this.receipts = new receipt_journal_1.SubagentReceiptJournalV1(options.receiptRootDir ?? (0, path_1.join)(options.childStoreRootDir, 'receipts'));
|
|
49
|
+
this.runtimeServicesDigest =
|
|
50
|
+
options.runtimeServicesDigest ??
|
|
51
|
+
(0, canonical_1.digestRuntimeValue)({
|
|
52
|
+
version: 1,
|
|
53
|
+
owner: this.serviceId,
|
|
54
|
+
loop: 'agent-loop-v1',
|
|
55
|
+
gateway: 'tool-gateway-v1',
|
|
56
|
+
taskContext: 'task-context-v1',
|
|
57
|
+
toolCatalog: options.toolCatalog.digest,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async execute(request) {
|
|
61
|
+
if (this.closed) {
|
|
62
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_CLOSED', 'Production subagent runtime is closed.');
|
|
63
|
+
}
|
|
64
|
+
validateRequest(request);
|
|
65
|
+
this.bindParentTurn(request);
|
|
66
|
+
const deadline = createDeadline(request.abortSignal, request.timeoutMs);
|
|
67
|
+
const startedAt = Date.now();
|
|
68
|
+
const usage = createUsageAccumulator();
|
|
69
|
+
let persistedReceipt;
|
|
70
|
+
try {
|
|
71
|
+
const runtime = new subagent_thread_runtime_1.SubagentThreadRuntimeV1({
|
|
72
|
+
childStoreRootDir: this.options.childStoreRootDir,
|
|
73
|
+
tree: this.tree,
|
|
74
|
+
rolePolicies: this.options.rolePolicies,
|
|
75
|
+
defaultBudget: request.budget,
|
|
76
|
+
maxSummaryBytes: this.options.maxSummaryBytes ?? 64 * 1024,
|
|
77
|
+
createAgentLoop: input => this.createChildLoop(input, request, usage),
|
|
78
|
+
onReceipt: async (receipt) => {
|
|
79
|
+
persistedReceipt = this.receipts.commit(receipt);
|
|
80
|
+
await this.options.onReceipt?.(persistedReceipt);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
const child = await runtime.run({
|
|
84
|
+
parent: request.parent,
|
|
85
|
+
parentAuthority: request.parentAuthority,
|
|
86
|
+
role: request.packet.role,
|
|
87
|
+
objective: request.packet.objective,
|
|
88
|
+
budget: request.budget,
|
|
89
|
+
abortSignal: deadline.signal,
|
|
90
|
+
});
|
|
91
|
+
if (!persistedReceipt || persistedReceipt.digest !== child.receipt.digest) {
|
|
92
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', 'Child completed without a matching durable parent-facing receipt.');
|
|
93
|
+
}
|
|
94
|
+
const status = deadline.timedOut
|
|
95
|
+
? 'timed_out'
|
|
96
|
+
: child.turnTerminal === 'interrupted' || child.status === 'cancelled'
|
|
97
|
+
? 'cancelled'
|
|
98
|
+
: child.turnTerminal === 'failed' || child.status !== 'completed'
|
|
99
|
+
? 'failed'
|
|
100
|
+
: 'completed';
|
|
101
|
+
const subtaskUsage = finalizeUsage(usage, child.usage, startedAt, true);
|
|
102
|
+
const result = (0, result_parser_1.parseSubtaskResult)({
|
|
103
|
+
id: request.taskId,
|
|
104
|
+
role: request.packet.role,
|
|
105
|
+
content: child.summary,
|
|
106
|
+
status,
|
|
107
|
+
usage: subtaskUsage,
|
|
108
|
+
});
|
|
109
|
+
result.stopDecision = child.stopDecision;
|
|
110
|
+
return Object.freeze({
|
|
111
|
+
result,
|
|
112
|
+
parentCancelled: status === 'cancelled' && Boolean(request.abortSignal?.aborted),
|
|
113
|
+
receipt: child.receipt,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
const status = deadline.timedOut
|
|
118
|
+
? 'timed_out'
|
|
119
|
+
: request.abortSignal?.aborted || this.tree.signal.aborted
|
|
120
|
+
? 'cancelled'
|
|
121
|
+
: 'failed';
|
|
122
|
+
const result = (0, result_parser_1.parseSubtaskResult)({
|
|
123
|
+
id: request.taskId,
|
|
124
|
+
role: request.packet.role,
|
|
125
|
+
content: errorMessage(error),
|
|
126
|
+
status,
|
|
127
|
+
usage: finalizeUsage(usage, undefined, startedAt, false),
|
|
128
|
+
});
|
|
129
|
+
result.stopDecision = (0, stop_decision_1.createStopDecision)({
|
|
130
|
+
scope: 'subagent',
|
|
131
|
+
status: status === 'cancelled' ? 'cancelled' : status === 'timed_out' ? 'stopped' : 'failed',
|
|
132
|
+
disposition: 'resume_allowed',
|
|
133
|
+
reason: { code: `subagent_${status}`, message: result.summary },
|
|
134
|
+
evidence: [],
|
|
135
|
+
nextActions: [
|
|
136
|
+
{ kind: 'retry', label: 'Inspect the child receipt boundary before retrying.' },
|
|
137
|
+
],
|
|
138
|
+
resources: {
|
|
139
|
+
llmRequests: {
|
|
140
|
+
used: usage.providerAttempts,
|
|
141
|
+
limit: request.budget.maxModelRequests,
|
|
142
|
+
},
|
|
143
|
+
toolCalls: { used: usage.toolCalls, limit: request.budget.maxToolCalls },
|
|
144
|
+
elapsedMs: { used: Math.max(0, Date.now() - startedAt), limit: request.timeoutMs },
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
return Object.freeze({
|
|
148
|
+
result,
|
|
149
|
+
parentCancelled: status === 'cancelled' && Boolean(request.abortSignal?.aborted),
|
|
150
|
+
...(persistedReceipt ? { receipt: persistedReceipt } : {}),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
deadline.dispose();
|
|
155
|
+
usage.unsubscribe?.();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
close(reason = 'production_subagent_runtime_closed') {
|
|
159
|
+
if (this.closed)
|
|
160
|
+
return;
|
|
161
|
+
this.closed = true;
|
|
162
|
+
this.tree.close(reason);
|
|
163
|
+
}
|
|
164
|
+
bindParentTurn(request) {
|
|
165
|
+
const key = `${request.parent.threadId}:${request.parent.turnId}`;
|
|
166
|
+
if (!this.parentTurnKey) {
|
|
167
|
+
this.parentTurnKey = key;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (this.parentTurnKey !== key) {
|
|
171
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', 'A production subagent runtime and its tree limits belong to exactly one parent turn.');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
createChildLoop(input, request, usage) {
|
|
175
|
+
const llm = this.options.createModelExecutor({
|
|
176
|
+
role: input.role,
|
|
177
|
+
objective: input.objective,
|
|
178
|
+
abortSignal: input.abortSignal,
|
|
179
|
+
});
|
|
180
|
+
if (!llm ||
|
|
181
|
+
typeof llm.chatStream !== 'function' ||
|
|
182
|
+
typeof llm.setProviderRequestPreflight !== 'function') {
|
|
183
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_MODEL_PORT', 'Child model factory must return an isolated LLMService with provider preflight support.');
|
|
184
|
+
}
|
|
185
|
+
if (this.issuedModelExecutors.has(llm)) {
|
|
186
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_MODEL_PORT', 'Child model factory reused mutable LLM state across child requests.');
|
|
187
|
+
}
|
|
188
|
+
this.issuedModelExecutors.add(llm);
|
|
189
|
+
const sharedPreflight = this.options.beforeProviderRequest;
|
|
190
|
+
llm.setProviderRequestPreflight(async (context) => {
|
|
191
|
+
const shared = sharedPreflight ? await sharedPreflight(context) : { available: true };
|
|
192
|
+
if (!shared.available)
|
|
193
|
+
return shared;
|
|
194
|
+
try {
|
|
195
|
+
input.budget.consumeModelRequests();
|
|
196
|
+
usage.providerAttempts += 1;
|
|
197
|
+
return shared;
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
return { available: false, reason: errorMessage(error) };
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
if (typeof llm.subscribeUsage === 'function') {
|
|
204
|
+
usage.hasUsageObserver = true;
|
|
205
|
+
usage.unsubscribe = llm.subscribeUsage(event => observeUsage(usage, event));
|
|
206
|
+
}
|
|
207
|
+
const taskContext = (0, task_context_service_1.createTaskContextService)({
|
|
208
|
+
cwd: input.authority.projectRoot,
|
|
209
|
+
modelId: llm.getModel(),
|
|
210
|
+
config: { completionGate: 'off' },
|
|
211
|
+
});
|
|
212
|
+
const context = this.options.toolContext(request, input.authority);
|
|
213
|
+
if ((0, path_1.resolve)(context.cwd) !== (0, path_1.resolve)(input.authority.projectRoot)) {
|
|
214
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', 'Child ToolContext cwd must match the narrowed authority root.');
|
|
215
|
+
}
|
|
216
|
+
const firstPartyPolicy = new first_party_tool_services_1.FirstPartyToolPolicyServiceV1(this.options.toolCatalog, context);
|
|
217
|
+
const policy = {
|
|
218
|
+
decide: (policyInput) => {
|
|
219
|
+
input.budget.consumeToolCalls();
|
|
220
|
+
usage.toolCalls += 1;
|
|
221
|
+
return firstPartyPolicy.decide(policyInput);
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
const gateway = new tool_gateway_1.ToolGateway({
|
|
225
|
+
policy,
|
|
226
|
+
approval: new first_party_tool_services_1.FirstPartyToolApprovalServiceV1(this.options.approvalHandler),
|
|
227
|
+
sandbox: new first_party_tool_services_1.FirstPartySandboxServiceV1(),
|
|
228
|
+
execution: new step_snapshot_1.ExecutionService(),
|
|
229
|
+
journal: new thread_tool_journal_1.ThreadToolInvocationJournalV1(input.childStore),
|
|
230
|
+
});
|
|
231
|
+
const capabilityJournal = new capability_receipt_journal_1.CapabilityReceiptJournalV1(input.childStore);
|
|
232
|
+
const registries = new Map();
|
|
233
|
+
const preparationKey = (step) => `${step.turnId}:${step.requestIndex}`;
|
|
234
|
+
const stepFactory = new capability_step_factory_1.CapabilityAgentLoopStepFactoryV1({
|
|
235
|
+
resolveConfiguration: async (step) => {
|
|
236
|
+
const configured = await this.options.resolveCapabilityConfiguration(step, {
|
|
237
|
+
role: input.role,
|
|
238
|
+
objective: input.objective,
|
|
239
|
+
modelId: llm.getModel(),
|
|
240
|
+
authority: input.authority,
|
|
241
|
+
taskContext,
|
|
242
|
+
toolCatalog: this.options.toolCatalog,
|
|
243
|
+
});
|
|
244
|
+
assertCapabilityConfiguration(configured, llm, input.authority);
|
|
245
|
+
const bindings = budgetedBindings(this.options.toolCatalog, input, request);
|
|
246
|
+
registries.set(preparationKey(step), bindings);
|
|
247
|
+
return {
|
|
248
|
+
...configured,
|
|
249
|
+
compiler: {
|
|
250
|
+
...configured.compiler,
|
|
251
|
+
task: {
|
|
252
|
+
...configured.compiler.task,
|
|
253
|
+
objective: input.objective,
|
|
254
|
+
activeInstruction: request.packet.expectedOutput,
|
|
255
|
+
},
|
|
256
|
+
authority: input.authority,
|
|
257
|
+
tools: this.options.toolCatalog.candidates,
|
|
258
|
+
runtimeServicesDigest: this.runtimeServicesDigest,
|
|
259
|
+
executionPolicyDigest: configured.executionPolicy.digest,
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
},
|
|
263
|
+
resolveToolRegistry: step => {
|
|
264
|
+
const key = preparationKey(step);
|
|
265
|
+
const registry = registries.get(key);
|
|
266
|
+
registries.delete(key);
|
|
267
|
+
if (!registry)
|
|
268
|
+
throw new Error(`No frozen child tool registry exists for ${key}.`);
|
|
269
|
+
return registry;
|
|
270
|
+
},
|
|
271
|
+
onCaptured: bundle => {
|
|
272
|
+
capabilityJournal.commit(bundle);
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
const baseMessages = childBaseMessages(request, input.authority.projectRoot);
|
|
276
|
+
const turnCommits = new turn_commit_1.ThreadTurnCommitJournalV1(input.childStore);
|
|
277
|
+
const agentLoop = new agent_loop_1.AgentLoopV1({
|
|
278
|
+
llm,
|
|
279
|
+
taskContext,
|
|
280
|
+
steps: stepFactory,
|
|
281
|
+
gateway,
|
|
282
|
+
loadBaseMessages: () => baseMessages.map(message => ({ ...message })),
|
|
283
|
+
toolContext: () => context,
|
|
284
|
+
loopBudget: {
|
|
285
|
+
maxLlmRequestsPerUserTurn: input.budget.limits.maxModelRequests,
|
|
286
|
+
maxToolCallsPerUserTurn: input.budget.limits.maxToolCalls,
|
|
287
|
+
},
|
|
288
|
+
commitTurn: commit => commitAgentLoopTurn(turnCommits, commit),
|
|
289
|
+
});
|
|
290
|
+
return new CommitCompletingChildRunnerV1(agentLoop, input, taskContext, turnCommits, baseMessages);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
exports.ProductionSubagentRuntimeV1 = ProductionSubagentRuntimeV1;
|
|
294
|
+
/** Backward-compatible config derivation only; it does not construct a child loop. */
|
|
26
295
|
function createChildLlmConfig(rootConfig) {
|
|
27
296
|
return {
|
|
28
297
|
apiKey: rootConfig.apiKey,
|
|
@@ -32,147 +301,221 @@ function createChildLlmConfig(rootConfig) {
|
|
|
32
301
|
timeout: 60000,
|
|
33
302
|
};
|
|
34
303
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// v0.2.26: inject the shared resilience coordinator so child requests
|
|
49
|
-
// also go through the retry/circuit-breaker/stream-recovery layer.
|
|
50
|
-
if (deps.resilience) {
|
|
51
|
-
llm.resilience = deps.resilience;
|
|
52
|
-
}
|
|
53
|
-
let providerAttempts = 0;
|
|
54
|
-
const providerPreflight = async (context) => {
|
|
55
|
-
providerAttempts += 1;
|
|
56
|
-
return deps.beforeProviderRequest ? deps.beforeProviderRequest(context) : { available: true };
|
|
57
|
-
};
|
|
58
|
-
const restoreProviderPreflight = typeof llm.setProviderRequestPreflight === 'function'
|
|
59
|
-
? llm.setProviderRequestPreflight(providerPreflight)
|
|
60
|
-
: undefined;
|
|
61
|
-
let finalContent = '';
|
|
62
|
-
const usage = { ...types_1.EMPTY_SUBTASK_USAGE };
|
|
63
|
-
const startedAt = Date.now();
|
|
64
|
-
let modelRequests = 0;
|
|
65
|
-
let observedModelRequests = 0;
|
|
66
|
-
let providerCostComplete = true;
|
|
67
|
-
let providerCostUsd = 0;
|
|
68
|
-
let completionUsageComplete = false;
|
|
69
|
-
const unsubscribeUsage = typeof llm.subscribeUsage === 'function'
|
|
70
|
-
? llm.subscribeUsage(event => {
|
|
71
|
-
observedModelRequests++;
|
|
72
|
-
usage.promptTokens += event.usage.promptTokens;
|
|
73
|
-
usage.completionTokens += event.usage.completionTokens;
|
|
74
|
-
if (event.usage.costUsd === undefined)
|
|
75
|
-
providerCostComplete = false;
|
|
76
|
-
else
|
|
77
|
-
providerCostUsd += event.usage.costUsd;
|
|
78
|
-
})
|
|
79
|
-
: undefined;
|
|
80
|
-
const finalizeUsage = (usageComplete) => {
|
|
81
|
-
usage.modelRequests = Math.max(usage.modelRequests, modelRequests, observedModelRequests);
|
|
82
|
-
usage.durationMs = Math.max(0, Date.now() - startedAt);
|
|
83
|
-
usage.usageComplete = usageComplete;
|
|
84
|
-
if (observedModelRequests > 0 && providerCostComplete)
|
|
85
|
-
usage.costUsd = providerCostUsd;
|
|
86
|
-
};
|
|
304
|
+
function createProductionSubagentRuntimeV1(options) {
|
|
305
|
+
return new ProductionSubagentRuntimeV1(options);
|
|
306
|
+
}
|
|
307
|
+
class CommitCompletingChildRunnerV1 {
|
|
308
|
+
constructor(agentLoop, input, taskContext, commits, baseMessages) {
|
|
309
|
+
this.agentLoop = agentLoop;
|
|
310
|
+
this.input = input;
|
|
311
|
+
this.taskContext = taskContext;
|
|
312
|
+
this.commits = commits;
|
|
313
|
+
this.baseMessages = baseMessages;
|
|
314
|
+
}
|
|
315
|
+
async run(context) {
|
|
316
|
+
let outcome;
|
|
87
317
|
try {
|
|
88
|
-
|
|
89
|
-
messages: messages,
|
|
90
|
-
tools: toolSet.tools,
|
|
91
|
-
toolExecutor: toolSet.toolExecutor,
|
|
92
|
-
llm,
|
|
93
|
-
maxTurns: deps.maxTurnsPerTask,
|
|
94
|
-
abortSignal,
|
|
95
|
-
// Children stream nothing to stdout; the root only sees the structured result.
|
|
96
|
-
streamCallbacks: { onChunk: () => undefined },
|
|
97
|
-
};
|
|
98
|
-
for await (const event of runQuery(params)) {
|
|
99
|
-
if (event.type === 'message' && event.role === 'assistant') {
|
|
100
|
-
finalContent = event.content;
|
|
101
|
-
}
|
|
102
|
-
else if (event.type === 'complete') {
|
|
103
|
-
finalContent = event.content;
|
|
104
|
-
const loopUsage = loopStatsToUsage(event.stats, modelRequests, event.usage?.promptTokens, event.usage?.completionTokens);
|
|
105
|
-
usage.modelRequests = loopUsage.modelRequests;
|
|
106
|
-
usage.toolCalls = loopUsage.toolCalls;
|
|
107
|
-
if (observedModelRequests === 0) {
|
|
108
|
-
usage.promptTokens = loopUsage.promptTokens;
|
|
109
|
-
usage.completionTokens = loopUsage.completionTokens;
|
|
110
|
-
}
|
|
111
|
-
const expectedSuccessfulRequests = Math.max(event.stats?.llmRequests ?? 0, loopUsage.modelRequests);
|
|
112
|
-
const hasAggregateUsage = Boolean(event.usage &&
|
|
113
|
-
Number.isFinite(event.usage.promptTokens) &&
|
|
114
|
-
Number.isFinite(event.usage.completionTokens));
|
|
115
|
-
const successfulUsageCovered = observedModelRequests >= expectedSuccessfulRequests || hasAggregateUsage;
|
|
116
|
-
const unknownFailedAttempts = (event.stats?.providerRetryCount ?? 0) > 0 ||
|
|
117
|
-
(event.stats?.providerFallbackCount ?? 0) > 0 ||
|
|
118
|
-
(Boolean(unsubscribeUsage) && providerAttempts > observedModelRequests);
|
|
119
|
-
completionUsageComplete = successfulUsageCovered && !unknownFailedAttempts;
|
|
120
|
-
}
|
|
121
|
-
else if (event.type === 'assistant_tool_calls') {
|
|
122
|
-
modelRequests += 1;
|
|
123
|
-
finalContent = event.content;
|
|
124
|
-
}
|
|
125
|
-
else if (event.type === 'tool_result') {
|
|
126
|
-
usage.toolCalls += 1;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
318
|
+
outcome = await this.agentLoop.run(context);
|
|
129
319
|
}
|
|
130
|
-
catch (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
deps.providerGate.enterCooldown(retryAfter);
|
|
135
|
-
}
|
|
136
|
-
// Preserve already-observed usage as a lower bound. The runner
|
|
137
|
-
// normalizes this into failed/cancelled without losing provider cost.
|
|
138
|
-
finalizeUsage(false);
|
|
139
|
-
throw new types_1.SubtaskExecutionError(err instanceof Error ? err.message : String(err), usage);
|
|
320
|
+
catch (error) {
|
|
321
|
+
outcome = context.abortSignal.aborted
|
|
322
|
+
? { status: 'interrupted', reason: errorMessage(error) }
|
|
323
|
+
: { status: 'failed', error: errorMessage(error) };
|
|
140
324
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
325
|
+
if (!this.input.childStore.loadProjection().turns[context.turnId]?.commit) {
|
|
326
|
+
const terminal = outcome.status === 'completed'
|
|
327
|
+
? { status: 'completed', outcome: outcome.outcome }
|
|
328
|
+
: outcome.status === 'interrupted'
|
|
329
|
+
? { status: 'interrupted', reason: outcome.reason }
|
|
330
|
+
: { status: 'failed', error: outcome.error };
|
|
331
|
+
const stopDecision = (0, stop_decision_1.createStopDecision)({
|
|
332
|
+
scope: 'subagent',
|
|
333
|
+
status: outcome.status === 'completed'
|
|
334
|
+
? 'completed'
|
|
335
|
+
: outcome.status === 'interrupted'
|
|
336
|
+
? 'cancelled'
|
|
337
|
+
: 'failed',
|
|
338
|
+
disposition: outcome.status === 'completed' ? 'finish_scope' : 'resume_allowed',
|
|
339
|
+
reason: {
|
|
340
|
+
code: `child_${outcome.status}`,
|
|
341
|
+
message: outcome.status === 'failed'
|
|
342
|
+
? outcome.error
|
|
343
|
+
: outcome.status === 'interrupted'
|
|
344
|
+
? (outcome.reason ?? 'Child interrupted.')
|
|
345
|
+
: (outcome.outcome ?? 'Child completed.'),
|
|
346
|
+
},
|
|
347
|
+
evidence: [],
|
|
348
|
+
nextActions: outcome.status === 'completed'
|
|
349
|
+
? [{ kind: 'inspect', label: 'Inspect child evidence.' }]
|
|
350
|
+
: [{ kind: 'retry', label: 'Retry from the durable child boundary.' }],
|
|
351
|
+
resources: {},
|
|
352
|
+
});
|
|
353
|
+
this.commits.commit({
|
|
354
|
+
turnId: context.turnId,
|
|
355
|
+
history: [...this.baseMessages, { role: 'user', content: context.input }],
|
|
356
|
+
taskContextState: this.taskContext.exportState(),
|
|
357
|
+
taskContextRevision: this.taskContext.revision,
|
|
358
|
+
terminal,
|
|
359
|
+
stopDecision,
|
|
360
|
+
});
|
|
144
361
|
}
|
|
145
|
-
|
|
146
|
-
|
|
362
|
+
return outcome;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function commitAgentLoopTurn(commits, commit) {
|
|
366
|
+
commits.commit({
|
|
367
|
+
turnId: commit.turnId,
|
|
368
|
+
history: commit.history,
|
|
369
|
+
taskContextState: commit.taskContextState,
|
|
370
|
+
taskContextRevision: commit.taskContextRevision,
|
|
371
|
+
terminal: terminalFromAgentCommit(commit),
|
|
372
|
+
stopDecision: commit.queryComplete.stats?.stopDecision,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function terminalFromAgentCommit(commit) {
|
|
376
|
+
const finishReason = commit.queryComplete.stats?.finishReason;
|
|
377
|
+
if (finishReason === 'failed') {
|
|
378
|
+
return { status: 'failed', error: commit.queryComplete.content || 'Child AgentLoop failed.' };
|
|
379
|
+
}
|
|
380
|
+
if (finishReason === 'cancelled') {
|
|
381
|
+
return { status: 'interrupted', reason: 'Child AgentLoop cancelled.' };
|
|
382
|
+
}
|
|
383
|
+
return { status: 'completed', outcome: finishReason ?? 'completed' };
|
|
384
|
+
}
|
|
385
|
+
function budgetedBindings(catalog, input, request) {
|
|
386
|
+
return new Map([...catalog.bindings].map(([bindingId, binding]) => [
|
|
387
|
+
bindingId,
|
|
388
|
+
Object.freeze({
|
|
389
|
+
descriptor: binding.descriptor,
|
|
390
|
+
execute: async (args, context) => {
|
|
391
|
+
const containment = (0, child_executor_guard_1.evaluateToolCall)(binding.descriptor.name, args, {
|
|
392
|
+
rootCwd: input.authority.projectRoot,
|
|
393
|
+
scopePaths: request.canonicalScopePaths,
|
|
394
|
+
});
|
|
395
|
+
if (!containment.ok) {
|
|
396
|
+
return {
|
|
397
|
+
success: false,
|
|
398
|
+
output: '',
|
|
399
|
+
error: `Subagent scope denied ${binding.descriptor.name}: ${containment.reason}`,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
return binding.execute(args, context);
|
|
403
|
+
},
|
|
404
|
+
}),
|
|
405
|
+
]));
|
|
406
|
+
}
|
|
407
|
+
function childBaseMessages(request, cwd) {
|
|
408
|
+
const framed = (0, context_builder_1.buildChildMessages)({
|
|
409
|
+
cwd,
|
|
410
|
+
packet: request.packet,
|
|
411
|
+
canonicalScopePaths: request.canonicalScopePaths ? [...request.canonicalScopePaths] : undefined,
|
|
412
|
+
rootObjectiveSummary: request.rootObjectiveSummary,
|
|
413
|
+
modelLabel: request.modelLabel,
|
|
414
|
+
});
|
|
415
|
+
return Object.freeze([
|
|
416
|
+
{
|
|
417
|
+
role: 'system',
|
|
418
|
+
content: `${framed[0].content}\n\n# Delegation packet\n${framed[1].content}`,
|
|
419
|
+
},
|
|
420
|
+
]);
|
|
421
|
+
}
|
|
422
|
+
function createUsageAccumulator() {
|
|
423
|
+
return {
|
|
424
|
+
providerAttempts: 0,
|
|
425
|
+
toolCalls: 0,
|
|
426
|
+
promptTokens: 0,
|
|
427
|
+
completionTokens: 0,
|
|
428
|
+
costUsd: 0,
|
|
429
|
+
costComplete: true,
|
|
430
|
+
hasUsageObserver: false,
|
|
431
|
+
successfulUsageEvents: 0,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function observeUsage(usage, event) {
|
|
435
|
+
usage.successfulUsageEvents += 1;
|
|
436
|
+
usage.promptTokens += event.usage.promptTokens;
|
|
437
|
+
usage.completionTokens += event.usage.completionTokens;
|
|
438
|
+
if (event.usage.costUsd === undefined)
|
|
439
|
+
usage.costComplete = false;
|
|
440
|
+
else
|
|
441
|
+
usage.costUsd += event.usage.costUsd;
|
|
442
|
+
}
|
|
443
|
+
function finalizeUsage(observed, charged, startedAt, completed) {
|
|
444
|
+
const usage = {
|
|
445
|
+
...types_1.EMPTY_SUBTASK_USAGE,
|
|
446
|
+
modelRequests: Math.max(observed.providerAttempts, charged?.modelRequests ?? 0),
|
|
447
|
+
toolCalls: Math.max(observed.toolCalls, charged?.toolCalls ?? 0),
|
|
448
|
+
promptTokens: observed.promptTokens,
|
|
449
|
+
completionTokens: observed.completionTokens,
|
|
450
|
+
durationMs: Math.max(0, Date.now() - startedAt),
|
|
451
|
+
usageComplete: completed &&
|
|
452
|
+
observed.hasUsageObserver &&
|
|
453
|
+
observed.successfulUsageEvents >= observed.providerAttempts,
|
|
147
454
|
};
|
|
455
|
+
if (observed.hasUsageObserver && observed.costComplete)
|
|
456
|
+
usage.costUsd = observed.costUsd;
|
|
457
|
+
return usage;
|
|
458
|
+
}
|
|
459
|
+
function assertCapabilityConfiguration(configured, llm, authority) {
|
|
460
|
+
if (!configured || configured.model.modelId !== llm.getModel()) {
|
|
461
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', 'Capability model snapshot must match the isolated child model.');
|
|
462
|
+
}
|
|
463
|
+
if (configured.environment.cwd !== authority.projectRoot) {
|
|
464
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', 'Child capability environment must use the narrowed authority root.');
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function validateOptions(options) {
|
|
468
|
+
if (!options.childStoreRootDir?.trim())
|
|
469
|
+
invalid('childStoreRootDir is required.');
|
|
470
|
+
if (!options.toolCatalog)
|
|
471
|
+
invalid('An explicit child tool catalog is required.');
|
|
472
|
+
if (options.toolCatalog.candidates.some(candidate => !candidate.descriptor.risk.readOnly)) {
|
|
473
|
+
invalid('Production investigation subagents accept only read-only tool bindings.');
|
|
474
|
+
}
|
|
475
|
+
if (typeof options.createModelExecutor !== 'function')
|
|
476
|
+
invalid('createModelExecutor is required.');
|
|
477
|
+
if (typeof options.resolveCapabilityConfiguration !== 'function') {
|
|
478
|
+
invalid('resolveCapabilityConfiguration is required.');
|
|
479
|
+
}
|
|
480
|
+
if (typeof options.toolContext !== 'function')
|
|
481
|
+
invalid('toolContext is required.');
|
|
482
|
+
}
|
|
483
|
+
function validateRequest(request) {
|
|
484
|
+
if (!request.taskId.trim() || !request.packet.objective.trim()) {
|
|
485
|
+
invalid('Subagent taskId and objective are required.');
|
|
486
|
+
}
|
|
487
|
+
if (!Number.isSafeInteger(request.timeoutMs) || request.timeoutMs <= 0) {
|
|
488
|
+
invalid('Subagent timeoutMs must be a positive safe integer.');
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function invalid(message) {
|
|
492
|
+
throw new ProductionSubagentRuntimeError('ORION_SUBAGENT_PRODUCTION_INVALID', message);
|
|
148
493
|
}
|
|
149
|
-
function
|
|
494
|
+
function createDeadline(parent, timeoutMs) {
|
|
495
|
+
const controller = new AbortController();
|
|
496
|
+
let timedOut = false;
|
|
497
|
+
const onAbort = () => controller.abort(parent?.reason);
|
|
498
|
+
if (parent?.aborted)
|
|
499
|
+
onAbort();
|
|
500
|
+
else
|
|
501
|
+
parent?.addEventListener('abort', onAbort, { once: true });
|
|
502
|
+
const timer = setTimeout(() => {
|
|
503
|
+
timedOut = true;
|
|
504
|
+
controller.abort(new Error(`Subagent timed out after ${timeoutMs}ms.`));
|
|
505
|
+
}, timeoutMs);
|
|
506
|
+
timer.unref?.();
|
|
150
507
|
return {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
508
|
+
signal: controller.signal,
|
|
509
|
+
get timedOut() {
|
|
510
|
+
return timedOut;
|
|
511
|
+
},
|
|
512
|
+
dispose: () => {
|
|
513
|
+
clearTimeout(timer);
|
|
514
|
+
parent?.removeEventListener('abort', onAbort);
|
|
515
|
+
},
|
|
156
516
|
};
|
|
157
517
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
return false;
|
|
161
|
-
const e = err;
|
|
162
|
-
const status = e.status ?? e.statusCode;
|
|
163
|
-
return status === 429 || /rate.?limit|429|too many requests/i.test(String(e.message ?? ''));
|
|
164
|
-
}
|
|
165
|
-
function extractRetryAfterMs(err) {
|
|
166
|
-
if (!err || typeof err !== 'object')
|
|
167
|
-
return 5000;
|
|
168
|
-
const e = err;
|
|
169
|
-
const headers = e.headers;
|
|
170
|
-
const retryAfter = headers?.['retry-after'];
|
|
171
|
-
if (retryAfter) {
|
|
172
|
-
const seconds = Number.parseFloat(retryAfter);
|
|
173
|
-
if (Number.isFinite(seconds))
|
|
174
|
-
return seconds * 1000;
|
|
175
|
-
}
|
|
176
|
-
return 5000; // conservative default cooldown
|
|
518
|
+
function errorMessage(error) {
|
|
519
|
+
return error instanceof Error ? error.message : String(error);
|
|
177
520
|
}
|
|
178
521
|
//# sourceMappingURL=production.js.map
|