@bastani/atomic 0.9.21-alpha.1 → 0.9.21
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 +56 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +22 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +292 -60
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +23 -0
- package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
- package/dist/builtin/workflows/builtin/{chunk-cw86srkf.js → chunk-632fxeb8.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-w18kbz63.js → chunk-94f8zfz1.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-kspvwc24.js → chunk-9cm2ckq2.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-jaj27rqc.js → chunk-a1ar035d.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-wh19f5ee.js → chunk-d3xhj946.js} +5 -4
- package/dist/builtin/workflows/builtin/{chunk-crw7q5g1.js → chunk-gyjck9z8.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-maqv731g.js → chunk-hj8mh07f.js} +10 -6
- package/dist/builtin/workflows/builtin/{chunk-0nrgfbag.js → chunk-kb7s3gx2.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-73c5tayt.js → chunk-kgn5wz1c.js} +19 -1
- package/dist/builtin/workflows/builtin/{chunk-2hak3b7g.js → chunk-nkj4qhj6.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-bzdvx2xr.js → chunk-r97ndfvt.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-vkmpdat4.js → chunk-wf876n16.js} +1 -1
- package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
- package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
- package/dist/builtin/workflows/builtin/goal.js +4 -4
- package/dist/builtin/workflows/builtin/index.js +12 -12
- package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
- package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +4 -4
- package/dist/builtin/workflows/builtin/steering-context.js +1 -1
- package/dist/builtin/workflows/builtin/tournament.js +3 -3
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +40 -11
- package/dist/builtin/workflows/src/index.js +9 -3
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -1
- package/dist/cli/auth-command.js +5 -0
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/credential-print.js +2 -0
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/experimental/command.js +5 -2
- package/dist/cli/experimental/command.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +4 -4
- package/dist/config.js +4 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +9 -4
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -4
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +4 -4
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +38 -15
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +14 -9
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +4 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +140 -95
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage-backends.js +2 -3
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/auth-storage.js +4 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtin-resource-loader.js +9 -0
- package/dist/core/builtin-resource-loader.js.map +1 -1
- package/dist/core/cache-warmer.js +8 -1
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/range-planner.js +6 -0
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/execution-model-router.d.ts +13 -3
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +227 -131
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/export-html/template-js/entries-navigation.js +16 -6
- package/dist/core/export-html/template-js/initialization.js +34 -11
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +50 -17
- package/dist/core/extensions/context-types.d.ts +2 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/host-input.js +8 -4
- package/dist/core/extensions/host-input.js.map +1 -1
- package/dist/core/extensions/reactive-widget.js +1 -0
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +4 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +48 -30
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.js +9 -7
- package/dist/core/extensions/workflow-activity-hub.js.map +1 -1
- package/dist/core/footer-data-provider.js +24 -23
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.js +1 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mandatory-resource-loader.js +4 -1
- package/dist/core/mandatory-resource-loader.js.map +1 -1
- package/dist/core/model-config.js +2 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.js +1 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/{model-routing-task.d.ts → model-routing-bytes.d.ts} +1 -4
- package/dist/core/model-routing-bytes.d.ts.map +1 -0
- package/dist/core/model-routing-bytes.js +33 -0
- package/dist/core/model-routing-bytes.js.map +1 -0
- package/dist/core/model-routing-candidates.d.ts +42 -0
- package/dist/core/model-routing-candidates.d.ts.map +1 -0
- package/dist/core/model-routing-candidates.js +309 -0
- package/dist/core/model-routing-candidates.js.map +1 -0
- package/dist/core/model-routing-constraints.d.ts +4 -0
- package/dist/core/model-routing-constraints.d.ts.map +1 -1
- package/dist/core/model-routing-constraints.js +13 -1
- package/dist/core/model-routing-constraints.js.map +1 -1
- package/dist/core/model-routing-debug.d.ts +9 -0
- package/dist/core/model-routing-debug.d.ts.map +1 -0
- package/dist/core/model-routing-debug.js +14 -0
- package/dist/core/model-routing-debug.js.map +1 -0
- package/dist/core/model-routing-evals.d.ts +50 -0
- package/dist/core/model-routing-evals.d.ts.map +1 -0
- package/dist/core/model-routing-evals.js +190 -0
- package/dist/core/model-routing-evals.js.map +1 -0
- package/dist/core/model-routing-needs.d.ts +75 -0
- package/dist/core/model-routing-needs.d.ts.map +1 -0
- package/dist/core/model-routing-needs.js +176 -0
- package/dist/core/model-routing-needs.js.map +1 -0
- package/dist/core/model-runtime-streaming.js +3 -0
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.js +26 -14
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.js +2 -3
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/output-guard.js +1 -0
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager-paths.d.ts +2 -1
- package/dist/core/package-manager-paths.d.ts.map +1 -1
- package/dist/core/package-manager-paths.js +4 -3
- package/dist/core/package-manager-paths.js.map +1 -1
- package/dist/core/package-manager.js +1 -0
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +9 -7
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-core.js +49 -0
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/runtime-credentials.js +2 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/session-cwd.js +1 -0
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-archive.js +4 -2
- package/dist/core/session-manager-archive.js.map +1 -1
- package/dist/core/session-manager-core.js +11 -7
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +10 -4
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +12 -6
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +2 -1
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +21 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.js +13 -7
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-storage.js +6 -0
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/settings-types.d.ts +8 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/structured-output/index.d.ts.map +1 -1
- package/dist/core/structured-output/index.js +4 -1
- package/dist/core/structured-output/index.js.map +1 -1
- package/dist/core/structured-output/invalid-output.js +1 -0
- package/dist/core/structured-output/invalid-output.js.map +1 -1
- package/dist/core/tasks/agent-adapter.js +5 -3
- package/dist/core/tasks/agent-adapter.js.map +1 -1
- package/dist/core/tasks/child-command-owner.js +3 -7
- package/dist/core/tasks/child-command-owner.js.map +1 -1
- package/dist/core/tasks/completion.js +5 -1
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tasks/owner-store.js +12 -8
- package/dist/core/tasks/owner-store.js.map +1 -1
- package/dist/core/tasks/supervisor.js +14 -35
- package/dist/core/tasks/supervisor.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js +13 -4
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js +11 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.js +1 -0
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js +1 -0
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/option-list-view.js +1 -0
- package/dist/core/tools/ask-user-question/view/components/option-list-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js +5 -0
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js +2 -0
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.js +13 -8
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js +1 -0
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.js +1 -0
- package/dist/core/tools/ask-user-question/view/components/tab-bar.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js +30 -24
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js +5 -0
- package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.js +8 -0
- package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js +4 -4
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
- package/dist/core/tools/bash.js +5 -8
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-batch.js +4 -0
- package/dist/core/tools/edit-batch.js.map +1 -1
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-coordinator.js +9 -0
- package/dist/core/tools/file-mutation-coordinator.js.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/hashline-engine/fs.js +1 -1
- package/dist/core/tools/hashline-engine/fs.js.map +1 -1
- package/dist/core/tools/hashline-engine/input.js +4 -0
- package/dist/core/tools/hashline-engine/input.js.map +1 -1
- package/dist/core/tools/hashline-engine/mismatch.js +6 -0
- package/dist/core/tools/hashline-engine/mismatch.js.map +1 -1
- package/dist/core/tools/hashline-engine/patcher.js +13 -0
- package/dist/core/tools/hashline-engine/patcher.js.map +1 -1
- package/dist/core/tools/hashline-engine/recovery.js +1 -0
- package/dist/core/tools/hashline-engine/recovery.js.map +1 -1
- package/dist/core/tools/output-accumulator.js +20 -13
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/persisted-output-file.js +9 -3
- package/dist/core/tools/persisted-output-file.js.map +1 -1
- package/dist/core/tools/resource-selectors.js +1 -0
- package/dist/core/tools/resource-selectors.js.map +1 -1
- package/dist/core/tools/write.js +1 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.js +1 -0
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/workflow-stage-admission.js +17 -10
- package/dist/core/workflow-stage-admission.js.map +1 -1
- package/dist/extensions/llama/client.js +2 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/huggingface-ui.js +17 -9
- package/dist/extensions/llama/huggingface-ui.js.map +1 -1
- package/dist/extensions/llama/huggingface.js +2 -0
- package/dist/extensions/llama/huggingface.js.map +1 -1
- package/dist/extensions/llama/ui.js +11 -3
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/armin.js +10 -6
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +10 -2
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.js +10 -2
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +9 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +3 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +4 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +2 -1
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +63 -31
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +8 -1
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.js +24 -14
- package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +2 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.js +15 -6
- package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +7 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +2 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +21 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +4 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js +8 -6
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +1 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +7 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +8 -2
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +9 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +4 -2
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +5 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.js +13 -2
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +9 -3
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +24 -12
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +12 -3
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.js +11 -2
- package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +13 -8
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/scroll-widget.js +4 -0
- package/dist/modes/interactive/components/scroll-widget.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-header.js +11 -7
- package/dist/modes/interactive/components/session-selector-header.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js +25 -12
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +23 -15
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +19 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +4 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/startup-identity.js +8 -3
- package/dist/modes/interactive/components/startup-identity.js.map +1 -1
- package/dist/modes/interactive/components/task-completion-message.js +2 -0
- package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
- package/dist/modes/interactive/components/task-detail.js +2 -0
- package/dist/modes/interactive/components/task-detail.js.map +1 -1
- package/dist/modes/interactive/components/task-inspector.js +22 -12
- package/dist/modes/interactive/components/task-inspector.js.map +1 -1
- package/dist/modes/interactive/components/task-list.js +2 -0
- package/dist/modes/interactive/components/task-list.js.map +1 -1
- package/dist/modes/interactive/components/task-live-transcript.js +8 -3
- package/dist/modes/interactive/components/task-live-transcript.js.map +1 -1
- package/dist/modes/interactive/components/task-navigation.js +5 -2
- package/dist/modes/interactive/components/task-navigation.js.map +1 -1
- package/dist/modes/interactive/components/task-row.js +2 -0
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +2 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +7 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +25 -10
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/transcript-follow-indicator.js +1 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-component.js +7 -3
- package/dist/modes/interactive/components/tree-selector-component.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-help.js +1 -0
- package/dist/modes/interactive/components/tree-selector-help.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-label-input.js +6 -2
- package/dist/modes/interactive/components/tree-selector-label-input.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-list.js +4 -0
- package/dist/modes/interactive/components/tree-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +6 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +6 -3
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.js +5 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/working-status.js +1 -0
- package/dist/modes/interactive/components/working-status.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +2 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +1 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +162 -120
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +3 -0
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +0 -6
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js +0 -4
- package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +0 -12
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-startup-chat-container.js +1 -4
- package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js +1 -3
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/theme/color-utils.d.ts +5 -0
- package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
- package/dist/modes/interactive/theme/color-utils.js +11 -0
- package/dist/modes/interactive/theme/color-utils.js.map +1 -1
- package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/global-theme.js +4 -3
- package/dist/modes/interactive/theme/global-theme.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +7 -0
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +9 -2
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.js +8 -3
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +12 -8
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-dialog-host.js +7 -3
- package/dist/modes/interactive-engine/engine-dialog-host.js.map +1 -1
- package/dist/modes/interactive-engine/engine-health.js +23 -13
- package/dist/modes/interactive-engine/engine-health.js.map +1 -1
- package/dist/modes/interactive-engine/engine-input-form.js +3 -2
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.js +13 -1
- package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
- package/dist/modes/interactive-engine/engine-project-trust.js +2 -1
- package/dist/modes/interactive-engine/engine-project-trust.js.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.js +7 -4
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.js +3 -2
- package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.js +5 -1
- package/dist/modes/interactive-engine/input-form-host.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +37 -23
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/remote-command-catalog.js +4 -3
- package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +24 -12
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/interactive-engine/remote-frame-clamp.js +3 -3
- package/dist/modes/interactive-engine/remote-frame-clamp.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +5 -4
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/interactive-engine/remote-queue-pause.js +3 -1
- package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +24 -13
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/interactive-engine/resource-readiness-error.js +1 -0
- package/dist/modes/interactive-engine/resource-readiness-error.js.map +1 -1
- package/dist/modes/interactive-engine/session-picker-host.js +5 -1
- package/dist/modes/interactive-engine/session-picker-host.js.map +1 -1
- package/dist/modes/interactive-engine/terminal-mode-controller.js +2 -1
- package/dist/modes/interactive-engine/terminal-mode-controller.js.map +1 -1
- package/dist/modes/rpc/queued-writer.js +13 -4
- package/dist/modes/rpc/queued-writer.js.map +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js +2 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +8 -4
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +10 -3
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +35 -22
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +6 -6
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.js +3 -1
- package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-generation-buffer.js +1 -3
- package/dist/modes/rpc/rpc-generation-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.js +4 -1
- package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -1
- package/dist/modes/rpc/rpc-output-buffer.js +3 -4
- package/dist/modes/rpc/rpc-output-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-pending-requests.js +1 -3
- package/dist/modes/rpc/rpc-pending-requests.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +3 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-resource-readiness.js +4 -5
- package/dist/modes/rpc/rpc-resource-readiness.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +15 -0
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.js +3 -0
- package/dist/modes/rpc/rpc-terminal-drain.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/models/evals.md +883 -39
- package/docs/models/model-selection.md +7 -8
- package/docs/rpc/examples.md +1 -1
- package/docs/rpc/protocol.md +9 -3
- package/docs/sdk/structured-decisions.md +1 -1
- package/docs/sdk.md +3 -3
- package/docs/settings.md +24 -3
- package/docs/subagents/reference.md +22 -4
- package/docs/subagents.md +2 -0
- package/docs/usage.md +3 -3
- package/docs/workflows/api-reference.md +1 -1
- package/docs/workflows/authoring.md +1 -7
- package/docs/workflows/builtins.md +1 -1
- package/docs/workflows/reliable-design.md +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/rpc-client.ts +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/npm-shrinkwrap.json +70 -33
- package/package.json +6 -7
- package/dist/core/model-routing-task.d.ts.map +0 -1
- package/dist/core/model-routing-task.js +0 -120
- package/dist/core/model-routing-task.js.map +0 -1
|
@@ -6944,7 +6944,7 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
6944
6944
|
});
|
|
6945
6945
|
|
|
6946
6946
|
// dist/builtin/subagents/src/extension/index.ts
|
|
6947
|
-
import * as
|
|
6947
|
+
import * as fs22 from "node:fs";
|
|
6948
6948
|
import * as os8 from "node:os";
|
|
6949
6949
|
import * as path23 from "node:path";
|
|
6950
6950
|
import {
|
|
@@ -6978,7 +6978,9 @@ import * as fs2 from "node:fs";
|
|
|
6978
6978
|
import {
|
|
6979
6979
|
eligiblePair,
|
|
6980
6980
|
ModelConstraintsSchema,
|
|
6981
|
-
parseModelConstraints
|
|
6981
|
+
parseModelConstraints,
|
|
6982
|
+
parseTaskNeeds,
|
|
6983
|
+
TaskNeedsSchema
|
|
6982
6984
|
} from "@bastani/atomic";
|
|
6983
6985
|
|
|
6984
6986
|
// dist/builtin/subagents/src/agents/agent-paths.ts
|
|
@@ -11794,6 +11796,7 @@ function topLevelSingleTask(item) {
|
|
|
11794
11796
|
...item.params.progress !== undefined ? { progress: item.params.progress } : {},
|
|
11795
11797
|
...item.params.model !== undefined ? { model: item.params.model } : {},
|
|
11796
11798
|
...item.params.modelConstraints !== undefined ? { modelConstraints: item.params.modelConstraints } : {},
|
|
11799
|
+
...item.params.taskNeeds !== undefined ? { taskNeeds: item.params.taskNeeds } : {},
|
|
11797
11800
|
...item.params.skill !== undefined ? { skill: item.params.skill } : {},
|
|
11798
11801
|
...item.params.group !== undefined ? { group: item.params.group } : {}
|
|
11799
11802
|
};
|
|
@@ -12577,11 +12580,14 @@ function currentModelFullId(model) {
|
|
|
12577
12580
|
import {
|
|
12578
12581
|
AutoRoutingInferenceError,
|
|
12579
12582
|
parseModelConstraints as parseModelConstraints2,
|
|
12580
|
-
|
|
12583
|
+
reportModelRoutingDebug,
|
|
12584
|
+
routeExecutionModel,
|
|
12585
|
+
setsProviders
|
|
12581
12586
|
} from "@bastani/atomic";
|
|
12582
12587
|
async function routeSubagentModel(input) {
|
|
12583
12588
|
const { ctx, agent } = input;
|
|
12584
12589
|
const constraints = structuredClone([parseModelConstraints2(agent.modelConstraints), parseModelConstraints2(input.modelConstraints)].filter((c) => c !== undefined));
|
|
12590
|
+
const taskNeeds = parseTaskNeeds(input.taskNeeds);
|
|
12585
12591
|
const effortOverride = agent.source === "builtin" && agent.thinking !== "" ? agent.thinking : undefined;
|
|
12586
12592
|
let route;
|
|
12587
12593
|
try {
|
|
@@ -12590,14 +12596,16 @@ async function routeSubagentModel(input) {
|
|
|
12590
12596
|
task: input.task?.trim() ? input.task : agent.systemPrompt,
|
|
12591
12597
|
agent: { name: agent.name, description: agent.description },
|
|
12592
12598
|
constraints: effortOverride === undefined ? constraints : [...constraints, { allowedEfforts: [effortOverride] }],
|
|
12593
|
-
signal: input.signal
|
|
12599
|
+
signal: input.signal,
|
|
12600
|
+
...taskNeeds ? { taskNeeds } : {},
|
|
12601
|
+
...setsProviders(parseModelConstraints2(input.modelConstraints)) ? { overrideProviderSettings: true } : {}
|
|
12594
12602
|
});
|
|
12595
12603
|
} catch (error) {
|
|
12596
12604
|
input.signal?.throwIfAborted();
|
|
12597
12605
|
if (!(error instanceof AutoRoutingInferenceError) || error.currentModelRoute === undefined)
|
|
12598
12606
|
throw error;
|
|
12599
12607
|
route = error.currentModelRoute;
|
|
12600
|
-
|
|
12608
|
+
reportModelRoutingDebug(`Subagent auto routing failed; running "${agent.name}" on the current chat model ${route.modelOverride}.`);
|
|
12601
12609
|
}
|
|
12602
12610
|
const fallbackRoute = effortOverride === undefined ? route : await routeExecutionModel({
|
|
12603
12611
|
ctx,
|
|
@@ -12642,6 +12650,7 @@ function recordRun(agent, task, status, durationMs) {
|
|
|
12642
12650
|
}
|
|
12643
12651
|
|
|
12644
12652
|
// dist/builtin/subagents/src/runs/shared/single-output.ts
|
|
12653
|
+
import * as fs15 from "node:fs";
|
|
12645
12654
|
import * as path15 from "node:path";
|
|
12646
12655
|
function normalizeSingleOutputOverride(output, defaultOutput) {
|
|
12647
12656
|
if (output === false || output === "false")
|
|
@@ -12703,6 +12712,58 @@ function validateFileOnlyOutputMode(outputMode, outputPath, context) {
|
|
|
12703
12712
|
}
|
|
12704
12713
|
return;
|
|
12705
12714
|
}
|
|
12715
|
+
function captureSingleOutputSnapshot(outputPath) {
|
|
12716
|
+
if (!outputPath)
|
|
12717
|
+
return;
|
|
12718
|
+
try {
|
|
12719
|
+
const stat = fs15.statSync(outputPath);
|
|
12720
|
+
return { exists: true, mtimeMs: stat.mtimeMs, size: stat.size };
|
|
12721
|
+
} catch {
|
|
12722
|
+
return { exists: false };
|
|
12723
|
+
}
|
|
12724
|
+
}
|
|
12725
|
+
function persistSingleOutput(outputPath, fullOutput) {
|
|
12726
|
+
if (!outputPath)
|
|
12727
|
+
return {};
|
|
12728
|
+
try {
|
|
12729
|
+
fs15.mkdirSync(path15.dirname(outputPath), { recursive: true });
|
|
12730
|
+
fs15.writeFileSync(outputPath, fullOutput, "utf-8");
|
|
12731
|
+
return { savedPath: outputPath };
|
|
12732
|
+
} catch (err) {
|
|
12733
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
12734
|
+
}
|
|
12735
|
+
}
|
|
12736
|
+
function resolveSingleOutput(outputPath, fallbackOutput, beforeRun) {
|
|
12737
|
+
if (!outputPath)
|
|
12738
|
+
return { fullOutput: fallbackOutput };
|
|
12739
|
+
let changedSinceStart = false;
|
|
12740
|
+
try {
|
|
12741
|
+
const stat = fs15.statSync(outputPath);
|
|
12742
|
+
changedSinceStart = !beforeRun?.exists || stat.mtimeMs !== beforeRun.mtimeMs || stat.size !== beforeRun.size;
|
|
12743
|
+
} catch (error) {
|
|
12744
|
+
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
12745
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
12746
|
+
return {
|
|
12747
|
+
fullOutput: fallbackOutput,
|
|
12748
|
+
saveError: `Failed to inspect output file: ${error instanceof Error ? error.message : String(error)}`
|
|
12749
|
+
};
|
|
12750
|
+
}
|
|
12751
|
+
}
|
|
12752
|
+
if (changedSinceStart) {
|
|
12753
|
+
try {
|
|
12754
|
+
return { fullOutput: fs15.readFileSync(outputPath, "utf-8"), savedPath: outputPath };
|
|
12755
|
+
} catch (error) {
|
|
12756
|
+
return {
|
|
12757
|
+
fullOutput: fallbackOutput,
|
|
12758
|
+
saveError: `Failed to read changed output file: ${error instanceof Error ? error.message : String(error)}`
|
|
12759
|
+
};
|
|
12760
|
+
}
|
|
12761
|
+
}
|
|
12762
|
+
const save = persistSingleOutput(outputPath, fallbackOutput);
|
|
12763
|
+
if (save.savedPath)
|
|
12764
|
+
return { fullOutput: fallbackOutput, savedPath: save.savedPath };
|
|
12765
|
+
return { fullOutput: fallbackOutput, saveError: save.error };
|
|
12766
|
+
}
|
|
12706
12767
|
function finalizeSingleOutput(params) {
|
|
12707
12768
|
let displayOutput = params.truncatedOutput || params.fullOutput;
|
|
12708
12769
|
if (params.status === "ok" && params.savedPath) {
|
|
@@ -12727,13 +12788,13 @@ ${params.saveError}`;
|
|
|
12727
12788
|
|
|
12728
12789
|
// dist/builtin/subagents/src/runs/shared/worktree.ts
|
|
12729
12790
|
import { spawnSync } from "node:child_process";
|
|
12730
|
-
import * as
|
|
12791
|
+
import * as fs18 from "node:fs";
|
|
12731
12792
|
import * as os7 from "node:os";
|
|
12732
12793
|
import * as path18 from "node:path";
|
|
12733
12794
|
import { createChildProcessEnvironment as createChildProcessEnvironment3, createGitEnvironment } from "@bastani/atomic";
|
|
12734
12795
|
|
|
12735
12796
|
// dist/builtin/subagents/src/runs/shared/worktree-post-create.ts
|
|
12736
|
-
import * as
|
|
12797
|
+
import * as fs16 from "node:fs";
|
|
12737
12798
|
import * as path16 from "node:path";
|
|
12738
12799
|
function tracked(runGit, repo, relativePath) {
|
|
12739
12800
|
return runGit(repo, ["ls-files", "--error-unmatch", "--", relativePath]).status === 0;
|
|
@@ -12752,10 +12813,10 @@ function hasTrackedPathComponent(runGit, repo, relativePath) {
|
|
|
12752
12813
|
function copySettings(runGit, mainRoot, worktreeRoot, relativePath) {
|
|
12753
12814
|
const source = path16.join(mainRoot, relativePath);
|
|
12754
12815
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
12755
|
-
if (!
|
|
12816
|
+
if (!fs16.existsSync(source) || fs16.existsSync(destination) || hasTrackedPathComponent(runGit, worktreeRoot, relativePath))
|
|
12756
12817
|
return false;
|
|
12757
|
-
|
|
12758
|
-
|
|
12818
|
+
fs16.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
12819
|
+
fs16.copyFileSync(source, destination);
|
|
12759
12820
|
return true;
|
|
12760
12821
|
}
|
|
12761
12822
|
function configureHooks(runGit, mainRoot) {
|
|
@@ -12763,12 +12824,12 @@ function configureHooks(runGit, mainRoot) {
|
|
|
12763
12824
|
const ordinary = path16.join(mainRoot, ".git", "hooks");
|
|
12764
12825
|
let desired;
|
|
12765
12826
|
try {
|
|
12766
|
-
if (
|
|
12827
|
+
if (fs16.statSync(husky).isDirectory())
|
|
12767
12828
|
desired = husky;
|
|
12768
12829
|
} catch {}
|
|
12769
12830
|
if (!desired) {
|
|
12770
12831
|
try {
|
|
12771
|
-
if (
|
|
12832
|
+
if (fs16.readdirSync(ordinary, { withFileTypes: true }).some((entry) => entry.isFile() && !entry.name.endsWith(".sample")))
|
|
12772
12833
|
desired = ordinary;
|
|
12773
12834
|
} catch {}
|
|
12774
12835
|
}
|
|
@@ -12782,7 +12843,7 @@ function configureHooks(runGit, mainRoot) {
|
|
|
12782
12843
|
throw new Error(result.stderr.trim() || "failed to configure shared core.hooksPath");
|
|
12783
12844
|
}
|
|
12784
12845
|
function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
12785
|
-
if (!
|
|
12846
|
+
if (!fs16.existsSync(path16.join(mainRoot, ".worktreeinclude")))
|
|
12786
12847
|
return;
|
|
12787
12848
|
const ignored = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-standard"]);
|
|
12788
12849
|
const included = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-from=.worktreeinclude"]);
|
|
@@ -12795,10 +12856,10 @@ function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
|
12795
12856
|
const source = path16.join(mainRoot, relativePath);
|
|
12796
12857
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
12797
12858
|
try {
|
|
12798
|
-
if (!
|
|
12859
|
+
if (!fs16.statSync(source).isFile() || fs16.existsSync(destination))
|
|
12799
12860
|
continue;
|
|
12800
|
-
|
|
12801
|
-
|
|
12861
|
+
fs16.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
12862
|
+
fs16.copyFileSync(source, destination);
|
|
12802
12863
|
} catch {}
|
|
12803
12864
|
}
|
|
12804
12865
|
}
|
|
@@ -12812,9 +12873,9 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
12812
12873
|
configureHooks(runGit, mainRoot);
|
|
12813
12874
|
const source = path16.join(mainRoot, "node_modules");
|
|
12814
12875
|
const destination = path16.join(worktreeRoot, "node_modules");
|
|
12815
|
-
if (
|
|
12876
|
+
if (fs16.existsSync(source) && !fs16.existsSync(destination) && !tracked(runGit, worktreeRoot, "node_modules")) {
|
|
12816
12877
|
try {
|
|
12817
|
-
|
|
12878
|
+
fs16.symlinkSync(source, destination, process.platform === "win32" ? "junction" : undefined);
|
|
12818
12879
|
synthetic.push("node_modules");
|
|
12819
12880
|
} catch {}
|
|
12820
12881
|
}
|
|
@@ -12823,19 +12884,19 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
12823
12884
|
}
|
|
12824
12885
|
|
|
12825
12886
|
// dist/builtin/subagents/src/runs/shared/worktree-root.ts
|
|
12826
|
-
import * as
|
|
12887
|
+
import * as fs17 from "node:fs";
|
|
12827
12888
|
import * as path17 from "node:path";
|
|
12828
12889
|
function readText(file) {
|
|
12829
12890
|
try {
|
|
12830
|
-
return
|
|
12891
|
+
return fs17.readFileSync(file, "utf8");
|
|
12831
12892
|
} catch {
|
|
12832
12893
|
return;
|
|
12833
12894
|
}
|
|
12834
12895
|
}
|
|
12835
12896
|
function samePath(left, right) {
|
|
12836
12897
|
try {
|
|
12837
|
-
const a =
|
|
12838
|
-
const b =
|
|
12898
|
+
const a = fs17.realpathSync.native(left);
|
|
12899
|
+
const b = fs17.realpathSync.native(right);
|
|
12839
12900
|
return process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
12840
12901
|
} catch {
|
|
12841
12902
|
return false;
|
|
@@ -12844,14 +12905,14 @@ function samePath(left, right) {
|
|
|
12844
12905
|
function findGitRoot(cwd) {
|
|
12845
12906
|
let current = path17.resolve(cwd);
|
|
12846
12907
|
try {
|
|
12847
|
-
if (!
|
|
12908
|
+
if (!fs17.statSync(current).isDirectory())
|
|
12848
12909
|
current = path17.dirname(current);
|
|
12849
12910
|
} catch {
|
|
12850
12911
|
return;
|
|
12851
12912
|
}
|
|
12852
12913
|
while (true) {
|
|
12853
12914
|
try {
|
|
12854
|
-
const entry =
|
|
12915
|
+
const entry = fs17.statSync(path17.join(current, ".git"));
|
|
12855
12916
|
if (entry.isDirectory() || entry.isFile())
|
|
12856
12917
|
return current;
|
|
12857
12918
|
} catch {}
|
|
@@ -12865,7 +12926,7 @@ function resolveMainRepoRoot(repoRoot) {
|
|
|
12865
12926
|
const gitEntry = path17.join(repoRoot, ".git");
|
|
12866
12927
|
let stats;
|
|
12867
12928
|
try {
|
|
12868
|
-
stats =
|
|
12929
|
+
stats = fs17.statSync(gitEntry);
|
|
12869
12930
|
} catch {
|
|
12870
12931
|
return;
|
|
12871
12932
|
}
|
|
@@ -12952,7 +13013,7 @@ function resolveRepoState(cwd) {
|
|
|
12952
13013
|
function normalizeComparableCwd(cwd) {
|
|
12953
13014
|
const resolved = path18.resolve(cwd);
|
|
12954
13015
|
try {
|
|
12955
|
-
return
|
|
13016
|
+
return fs18.realpathSync(resolved);
|
|
12956
13017
|
} catch {
|
|
12957
13018
|
return resolved;
|
|
12958
13019
|
}
|
|
@@ -12987,8 +13048,8 @@ function buildWorktreePath(mainRoot, runId, index) {
|
|
|
12987
13048
|
}
|
|
12988
13049
|
function ensureWorktreeIgnore(mainRoot) {
|
|
12989
13050
|
const root = path18.join(mainRoot, ".atomic", "worktrees");
|
|
12990
|
-
|
|
12991
|
-
|
|
13051
|
+
fs18.mkdirSync(root, { recursive: true });
|
|
13052
|
+
fs18.writeFileSync(path18.join(root, ".gitignore"), `*
|
|
12992
13053
|
`, "utf8");
|
|
12993
13054
|
}
|
|
12994
13055
|
function resolveRepoCwdRelative(cwd) {
|
|
@@ -13024,10 +13085,10 @@ function resolveWorktreeSetupHook(repoRoot, config) {
|
|
|
13024
13085
|
} else {
|
|
13025
13086
|
throw new Error("worktree setup hook must be an absolute path or a repo-relative path");
|
|
13026
13087
|
}
|
|
13027
|
-
if (!
|
|
13088
|
+
if (!fs18.existsSync(resolvedPath)) {
|
|
13028
13089
|
throw new Error(`worktree setup hook not found: ${resolvedPath}`);
|
|
13029
13090
|
}
|
|
13030
|
-
if (
|
|
13091
|
+
if (fs18.statSync(resolvedPath).isDirectory()) {
|
|
13031
13092
|
throw new Error(`worktree setup hook must be a file, got directory: ${resolvedPath}`);
|
|
13032
13093
|
}
|
|
13033
13094
|
return {
|
|
@@ -13174,7 +13235,7 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13174
13235
|
}
|
|
13175
13236
|
let stat;
|
|
13176
13237
|
try {
|
|
13177
|
-
stat =
|
|
13238
|
+
stat = fs18.lstatSync(resolved);
|
|
13178
13239
|
} catch (error) {
|
|
13179
13240
|
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
13180
13241
|
if (code === "ENOENT")
|
|
@@ -13182,14 +13243,14 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13182
13243
|
throw error;
|
|
13183
13244
|
}
|
|
13184
13245
|
if (stat.isSymbolicLink()) {
|
|
13185
|
-
|
|
13246
|
+
fs18.unlinkSync(resolved);
|
|
13186
13247
|
return;
|
|
13187
13248
|
}
|
|
13188
13249
|
if (stat.isDirectory()) {
|
|
13189
|
-
|
|
13250
|
+
fs18.rmSync(resolved, { recursive: true, force: true });
|
|
13190
13251
|
return;
|
|
13191
13252
|
}
|
|
13192
|
-
|
|
13253
|
+
fs18.rmSync(resolved, { force: true });
|
|
13193
13254
|
}
|
|
13194
13255
|
function removeSyntheticPathsBeforeDiff(worktree) {
|
|
13195
13256
|
if (worktree.syntheticPaths.length === 0)
|
|
@@ -13238,7 +13299,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13238
13299
|
const diffStat = runGitChecked(worktree.path, ["diff", "--cached", "--stat", setup.baseCommit]).trim();
|
|
13239
13300
|
const patch = runGitChecked(worktree.path, ["diff", "--cached", setup.baseCommit]);
|
|
13240
13301
|
const numstat = runGitChecked(worktree.path, ["diff", "--cached", "--numstat", setup.baseCommit]);
|
|
13241
|
-
|
|
13302
|
+
fs18.writeFileSync(patchPath, patch, "utf-8");
|
|
13242
13303
|
if (!patch.trim()) {
|
|
13243
13304
|
return emptyDiff(worktree.index, agent, worktree.branch, patchPath);
|
|
13244
13305
|
}
|
|
@@ -13256,7 +13317,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13256
13317
|
}
|
|
13257
13318
|
function writeEmptyPatch(patchPath) {
|
|
13258
13319
|
try {
|
|
13259
|
-
|
|
13320
|
+
fs18.writeFileSync(patchPath, "", "utf-8");
|
|
13260
13321
|
} catch {}
|
|
13261
13322
|
}
|
|
13262
13323
|
function hasWorktreeChanges(diff) {
|
|
@@ -13279,7 +13340,7 @@ function createWorktrees(cwd, runId, count, options) {
|
|
|
13279
13340
|
}
|
|
13280
13341
|
function diffWorktrees(setup, agents, diffsDir) {
|
|
13281
13342
|
try {
|
|
13282
|
-
|
|
13343
|
+
fs18.mkdirSync(diffsDir, { recursive: true });
|
|
13283
13344
|
} catch {
|
|
13284
13345
|
return [];
|
|
13285
13346
|
}
|
|
@@ -13347,7 +13408,7 @@ function createDetachedCleanupBarrier(onReady) {
|
|
|
13347
13408
|
}
|
|
13348
13409
|
|
|
13349
13410
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts
|
|
13350
|
-
import { join as
|
|
13411
|
+
import { join as join19 } from "node:path";
|
|
13351
13412
|
|
|
13352
13413
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-worktree.ts
|
|
13353
13414
|
import * as path19 from "node:path";
|
|
@@ -13411,6 +13472,75 @@ function findDuplicateParallelOutputPath(input) {
|
|
|
13411
13472
|
return;
|
|
13412
13473
|
}
|
|
13413
13474
|
|
|
13475
|
+
// dist/builtin/subagents/src/runs/foreground/task-output-retention.ts
|
|
13476
|
+
import { mkdtempSync, readFileSync as readFileSync11, rmSync as rmSync3, writeFileSync as writeFileSync8 } from "node:fs";
|
|
13477
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
13478
|
+
import { join as join18 } from "node:path";
|
|
13479
|
+
var INLINE_TASK_OUTPUT_MAX_BYTES = 16 * 1024;
|
|
13480
|
+
var MAX_RETAINED_TASK_OUTPUTS = 256;
|
|
13481
|
+
var retained = new Map;
|
|
13482
|
+
var copyRoot;
|
|
13483
|
+
function retentionKey(ownerId, taskId) {
|
|
13484
|
+
return `${ownerId}\x00${taskId}`;
|
|
13485
|
+
}
|
|
13486
|
+
function fileSafe(value) {
|
|
13487
|
+
return value.replace(/[^A-Za-z0-9._-]+/g, "_");
|
|
13488
|
+
}
|
|
13489
|
+
function privateCopyRoot() {
|
|
13490
|
+
if (copyRoot)
|
|
13491
|
+
return copyRoot;
|
|
13492
|
+
const root = mkdtempSync(join18(tmpdir2(), "atomic-subagent-output-"));
|
|
13493
|
+
copyRoot = root;
|
|
13494
|
+
process.once("exit", () => rmSync3(root, { recursive: true, force: true }));
|
|
13495
|
+
return root;
|
|
13496
|
+
}
|
|
13497
|
+
function removeCopy(entry) {
|
|
13498
|
+
if (entry?.path)
|
|
13499
|
+
rmSync3(entry.path, { force: true });
|
|
13500
|
+
}
|
|
13501
|
+
function fullOutputText(child, text) {
|
|
13502
|
+
if (child.outputMode !== "file-only" || !child.outputReference)
|
|
13503
|
+
return text;
|
|
13504
|
+
try {
|
|
13505
|
+
return readFileSync11(child.outputReference.path, "utf-8");
|
|
13506
|
+
} catch {
|
|
13507
|
+
return text;
|
|
13508
|
+
}
|
|
13509
|
+
}
|
|
13510
|
+
function writePrivateCopy(ownerId, taskId, text) {
|
|
13511
|
+
try {
|
|
13512
|
+
const path = join18(privateCopyRoot(), `${fileSafe(ownerId)}-${fileSafe(taskId)}.md`);
|
|
13513
|
+
writeFileSync8(path, text, { encoding: "utf-8", mode: 384 });
|
|
13514
|
+
return path;
|
|
13515
|
+
} catch {
|
|
13516
|
+
return;
|
|
13517
|
+
}
|
|
13518
|
+
}
|
|
13519
|
+
function retainTaskOutput(child, text, ref) {
|
|
13520
|
+
const bytes = Buffer.from(text);
|
|
13521
|
+
const path = writePrivateCopy(ref.ownerId, ref.taskId, fullOutputText(child, text));
|
|
13522
|
+
const key = retentionKey(ref.ownerId, ref.taskId);
|
|
13523
|
+
removeCopy(retained.get(key));
|
|
13524
|
+
retained.delete(key);
|
|
13525
|
+
retained.set(key, {
|
|
13526
|
+
...path ? { path } : {},
|
|
13527
|
+
...child.outputReference ? { requestedPath: child.outputReference.path } : {},
|
|
13528
|
+
...child.outputSaveError ? { saveError: child.outputSaveError } : {},
|
|
13529
|
+
head: new TextDecoder().decode(bytes.subarray(0, INLINE_TASK_OUTPUT_MAX_BYTES)),
|
|
13530
|
+
totalBytes: bytes.byteLength
|
|
13531
|
+
});
|
|
13532
|
+
while (retained.size > MAX_RETAINED_TASK_OUTPUTS) {
|
|
13533
|
+
const oldest = retained.keys().next().value;
|
|
13534
|
+
if (oldest === undefined)
|
|
13535
|
+
break;
|
|
13536
|
+
removeCopy(retained.get(oldest));
|
|
13537
|
+
retained.delete(oldest);
|
|
13538
|
+
}
|
|
13539
|
+
}
|
|
13540
|
+
function retainedTaskOutput(ownerId, taskId) {
|
|
13541
|
+
return retained.get(retentionKey(ownerId, taskId));
|
|
13542
|
+
}
|
|
13543
|
+
|
|
13414
13544
|
// dist/builtin/subagents/src/runs/foreground/task-execution.ts
|
|
13415
13545
|
function subagentTaskResultLabel(result) {
|
|
13416
13546
|
return result.kind === "cancelled" && result.cause === "user" ? "killed (non-resumable)" : result.kind;
|
|
@@ -13421,6 +13551,69 @@ function subagentTaskResponseText(response) {
|
|
|
13421
13551
|
return `${killed.length ? `${killed.length} killed. These children cannot be resumed. Underlying host response:
|
|
13422
13552
|
` : ""}${JSON.stringify(response)}`;
|
|
13423
13553
|
}
|
|
13554
|
+
function settledOutputsFromResponse(response) {
|
|
13555
|
+
const outcomes = response.kind === "parallel" ? response.slots.map((slot) => slot.outcome) : [response];
|
|
13556
|
+
return outcomes.flatMap((outcome) => outcome.kind === "admitted" && outcome.observation.kind === "settled" ? [{ taskId: outcome.observation.taskId, result: outcome.observation.result }] : []);
|
|
13557
|
+
}
|
|
13558
|
+
function settledOutputsFromRecords(records) {
|
|
13559
|
+
return records.flatMap((record) => record.execution.kind === "settled" ? [{ taskId: record.ref.taskId, result: record.execution.result }] : []);
|
|
13560
|
+
}
|
|
13561
|
+
function settledOutputSection(taskId, label, output) {
|
|
13562
|
+
const truncated = output.shown < output.total ? `, first ${output.shown} shown${output.path ? "; read the full output file for the rest" : ""}` : "";
|
|
13563
|
+
const lines = [`Output of ${taskId} (${label}, ${output.total} bytes${truncated}):`];
|
|
13564
|
+
if (output.requestedPath)
|
|
13565
|
+
lines.push(`Requested output: ${output.requestedPath}`);
|
|
13566
|
+
if (output.saveError)
|
|
13567
|
+
lines.push(`Output file error: ${output.saveError}`);
|
|
13568
|
+
if (output.path)
|
|
13569
|
+
lines.push(`Full output: ${output.path}`);
|
|
13570
|
+
lines.push(output.head);
|
|
13571
|
+
return lines.join(`
|
|
13572
|
+
`);
|
|
13573
|
+
}
|
|
13574
|
+
async function readSettledOutput(host, settled) {
|
|
13575
|
+
const output = settled.result.output;
|
|
13576
|
+
if (!output)
|
|
13577
|
+
return;
|
|
13578
|
+
const label = subagentTaskResultLabel(settled.result);
|
|
13579
|
+
const kept = retainedTaskOutput(output.ownerId, output.taskId);
|
|
13580
|
+
if (kept) {
|
|
13581
|
+
return settledOutputSection(settled.taskId, label, {
|
|
13582
|
+
...kept,
|
|
13583
|
+
shown: Math.min(kept.totalBytes, INLINE_TASK_OUTPUT_MAX_BYTES),
|
|
13584
|
+
total: kept.totalBytes
|
|
13585
|
+
});
|
|
13586
|
+
}
|
|
13587
|
+
const unavailable = (reason) => `Output of ${settled.taskId} (${label}) is unavailable: ${reason}`;
|
|
13588
|
+
const lease = host.resolveTask(settled.taskId);
|
|
13589
|
+
if (!lease.ok)
|
|
13590
|
+
return unavailable(lease.error.message);
|
|
13591
|
+
try {
|
|
13592
|
+
const page = await host.ownerBinding.supervisor.readTaskOutput(lease.value, {
|
|
13593
|
+
start: "0",
|
|
13594
|
+
maximumBytes: INLINE_TASK_OUTPUT_MAX_BYTES
|
|
13595
|
+
});
|
|
13596
|
+
if (!page.ok)
|
|
13597
|
+
return unavailable(page.error.message);
|
|
13598
|
+
const decoder = new TextDecoder;
|
|
13599
|
+
const head = page.value.chunks.map((chunk) => decoder.decode(chunk.bytes, { stream: true })).join("") + decoder.decode();
|
|
13600
|
+
const shown = page.value.chunks.reduce((sum, chunk) => sum + chunk.bytes.byteLength, 0);
|
|
13601
|
+
return settledOutputSection(settled.taskId, label, { head, shown, total: Number(output.byteCount) });
|
|
13602
|
+
} catch (error) {
|
|
13603
|
+
return unavailable(error instanceof Error ? error.message : String(error));
|
|
13604
|
+
}
|
|
13605
|
+
}
|
|
13606
|
+
async function settledTaskOutputText(host, settled) {
|
|
13607
|
+
if (!host || settled.length === 0)
|
|
13608
|
+
return "";
|
|
13609
|
+
const sections = await Promise.all(settled.map((entry) => readSettledOutput(host, entry)));
|
|
13610
|
+
const present = sections.filter((section) => section !== undefined);
|
|
13611
|
+
return present.length ? `
|
|
13612
|
+
|
|
13613
|
+
${present.join(`
|
|
13614
|
+
|
|
13615
|
+
`)}` : "";
|
|
13616
|
+
}
|
|
13424
13617
|
function taskToolResult(response, host) {
|
|
13425
13618
|
return {
|
|
13426
13619
|
content: [{ type: "text", text: subagentTaskResponseText(response) }],
|
|
@@ -13433,6 +13626,16 @@ function taskToolResult(response, host) {
|
|
|
13433
13626
|
...response.kind === "unstarted" ? { isError: true } : {}
|
|
13434
13627
|
};
|
|
13435
13628
|
}
|
|
13629
|
+
async function taskToolResultWithOutput(response, host) {
|
|
13630
|
+
const result = taskToolResult(response, host);
|
|
13631
|
+
const outputText = await settledTaskOutputText(host, settledOutputsFromResponse(response));
|
|
13632
|
+
if (!outputText)
|
|
13633
|
+
return result;
|
|
13634
|
+
return {
|
|
13635
|
+
...result,
|
|
13636
|
+
content: [{ type: "text", text: `${subagentTaskResponseText(response)}${outputText}` }]
|
|
13637
|
+
};
|
|
13638
|
+
}
|
|
13436
13639
|
function taskResponseRecords(response, host) {
|
|
13437
13640
|
const outcomes = response.kind === "parallel" ? response.slots.map((slot) => slot.outcome) : [response];
|
|
13438
13641
|
const ids = new Set(outcomes.flatMap((outcome) => outcome.kind === "admitted" ? [outcome.observation.taskId] : []));
|
|
@@ -13505,6 +13708,7 @@ async function runAgentTask(input) {
|
|
|
13505
13708
|
});
|
|
13506
13709
|
input.onTerminal?.(child);
|
|
13507
13710
|
const text = input.outputText?.(child) ?? getSingleResultOutput(child);
|
|
13711
|
+
retainTaskOutput(child, text, context.ref);
|
|
13508
13712
|
const bytes = Buffer.from(text);
|
|
13509
13713
|
context.reportActivity({
|
|
13510
13714
|
reportId: "terminal-output",
|
|
@@ -13664,7 +13868,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
13664
13868
|
}
|
|
13665
13869
|
const agentConfig = input.agentConfigs?.[index] ?? input.agents.find((agent) => agent.name === task.agent);
|
|
13666
13870
|
const taskAgents = input.agentConfigs && agentConfig ? [agentConfig] : input.agents;
|
|
13667
|
-
const sharedProgress = index === input.behaviors.findIndex((candidate) => candidate.progress) ?
|
|
13871
|
+
const sharedProgress = index === input.behaviors.findIndex((candidate) => candidate.progress) ? join19(input.paramsCwd, "progress.md") : undefined;
|
|
13668
13872
|
const runOptions = {
|
|
13669
13873
|
getChildSessionOptions: input.ctx.getChildSessionOptions,
|
|
13670
13874
|
resourceLoaderInheritanceSnapshot: input.resourceLoaderInheritanceSnapshot,
|
|
@@ -14319,6 +14523,7 @@ async function runParallelPath(data, deps) {
|
|
|
14319
14523
|
agent: agentConfigs[index],
|
|
14320
14524
|
task: task.task,
|
|
14321
14525
|
modelConstraints: task.modelConstraints,
|
|
14526
|
+
taskNeeds: task.taskNeeds,
|
|
14322
14527
|
signal: routing.signal
|
|
14323
14528
|
}) : undefined)),
|
|
14324
14529
|
cancelled.promise
|
|
@@ -14442,7 +14647,12 @@ async function runParallelPath(data, deps) {
|
|
|
14442
14647
|
};
|
|
14443
14648
|
worktreeCleanupDeferred = detachedCleanup.defer(response.slots.flatMap(({ ordinal, outcome }) => outcome.kind === "admitted" && outcome.observation.kind === "yielded" ? [ordinal] : []));
|
|
14444
14649
|
return {
|
|
14445
|
-
content: [
|
|
14650
|
+
content: [
|
|
14651
|
+
{
|
|
14652
|
+
type: "text",
|
|
14653
|
+
text: `${subagentTaskResponseText(response)}${await settledTaskOutputText(ctx.getAgentTaskHost(), settledOutputsFromResponse(response))}`
|
|
14654
|
+
}
|
|
14655
|
+
],
|
|
14446
14656
|
details: {
|
|
14447
14657
|
mode: "parallel",
|
|
14448
14658
|
results: [],
|
|
@@ -14530,8 +14740,8 @@ ${worktreeSuffix}` : childContent;
|
|
|
14530
14740
|
}
|
|
14531
14741
|
|
|
14532
14742
|
// dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts
|
|
14533
|
-
import { existsSync as existsSync15, statSync as
|
|
14534
|
-
import { join as
|
|
14743
|
+
import { existsSync as existsSync15, statSync as statSync9 } from "node:fs";
|
|
14744
|
+
import { join as join20 } from "node:path";
|
|
14535
14745
|
|
|
14536
14746
|
// dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts
|
|
14537
14747
|
function providerFromModel(model) {
|
|
@@ -14841,7 +15051,7 @@ async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
|
14841
15051
|
const cwd = options.cwd ?? runtimeCwd;
|
|
14842
15052
|
if (!existsSync15(cwd))
|
|
14843
15053
|
return refusedResult(agent, task, `cwd does not exist: ${cwd}`);
|
|
14844
|
-
if (!
|
|
15054
|
+
if (!statSync9(cwd).isDirectory())
|
|
14845
15055
|
return refusedResult(agent, task, `cwd is not a directory: ${cwd}`);
|
|
14846
15056
|
options.modelRoute?.assertCurrent();
|
|
14847
15057
|
const seenModels = new Set;
|
|
@@ -14871,6 +15081,7 @@ async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
|
14871
15081
|
if (options.modelRoute && !resolvedCandidate)
|
|
14872
15082
|
throw new Error("Subagent auto-selected model could not be resolved before execution. Retry explicitly with the current catalog.");
|
|
14873
15083
|
const orchestrationContext = workflowOrchestrationContext(options);
|
|
15084
|
+
const outputSnapshot = captureSingleOutputSnapshot(options.outputPath);
|
|
14874
15085
|
const parent = {
|
|
14875
15086
|
path: options.runId,
|
|
14876
15087
|
depth: options.parentDepth ?? 0,
|
|
@@ -14880,7 +15091,7 @@ async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
|
14880
15091
|
...options.workflowStageSubagentGuard === undefined ? {} : { workflowStageSubagentGuard: options.workflowStageSubagentGuard },
|
|
14881
15092
|
...orchestrationContext ? { orchestrationContext } : {}
|
|
14882
15093
|
};
|
|
14883
|
-
const sessionRoot = options.sessionDir ??
|
|
15094
|
+
const sessionRoot = options.sessionDir ?? join20(options.artifactsDir ?? cwd, ".atomic", "subagents");
|
|
14884
15095
|
const control = getOrCreateSubagentControl(parent, sessionRoot);
|
|
14885
15096
|
control.registerAgents([agent]);
|
|
14886
15097
|
const artifactsDir = options.artifactsDir && options.artifactConfig?.enabled !== false ? options.artifactsDir : undefined;
|
|
@@ -15020,6 +15231,7 @@ ${task}`);
|
|
|
15020
15231
|
recovered.envelope = delivered.envelope;
|
|
15021
15232
|
recovered.finalOutput = delivered.envelope;
|
|
15022
15233
|
}
|
|
15234
|
+
persistRequestedOutput(recovered, options, outputSnapshot);
|
|
15023
15235
|
options.onDetachedExit?.(recovered);
|
|
15024
15236
|
});
|
|
15025
15237
|
const continuedModel = running.currentModel ?? candidate;
|
|
@@ -15082,6 +15294,7 @@ ${task}`);
|
|
|
15082
15294
|
result.envelope = delivered.envelope;
|
|
15083
15295
|
result.finalOutput = delivered.envelope;
|
|
15084
15296
|
}
|
|
15297
|
+
persistRequestedOutput(result, options, outputSnapshot);
|
|
15085
15298
|
const update = {
|
|
15086
15299
|
content: [{ type: "text", text: result.finalOutput ?? "(no output)" }],
|
|
15087
15300
|
details: {
|
|
@@ -15094,6 +15307,18 @@ ${task}`);
|
|
|
15094
15307
|
options.onUpdate?.(update);
|
|
15095
15308
|
return result;
|
|
15096
15309
|
}
|
|
15310
|
+
function persistRequestedOutput(result, options, outputSnapshot) {
|
|
15311
|
+
result.outputMode = options.outputMode ?? "inline";
|
|
15312
|
+
if (!options.outputPath || result.status !== "ok")
|
|
15313
|
+
return;
|
|
15314
|
+
const resolved = resolveSingleOutput(options.outputPath, result.finalOutput ?? "", outputSnapshot);
|
|
15315
|
+
result.savedOutputPath = resolved.savedPath;
|
|
15316
|
+
result.outputSaveError = resolved.saveError;
|
|
15317
|
+
if (!resolved.savedPath)
|
|
15318
|
+
return;
|
|
15319
|
+
result.outputReference = formatSavedOutputReference(resolved.savedPath, resolved.fullOutput);
|
|
15320
|
+
result.finalOutput = result.outputMode === "file-only" ? result.outputReference.message : resolved.fullOutput;
|
|
15321
|
+
}
|
|
15097
15322
|
async function runSync(runtimeCwd, agents, agentName, task, options) {
|
|
15098
15323
|
const agent = agents.find((candidate) => candidate.name === agentName);
|
|
15099
15324
|
if (!agent)
|
|
@@ -15130,7 +15355,7 @@ function resolveSubagentExecutorRuntimeDeps(overrides) {
|
|
|
15130
15355
|
}
|
|
15131
15356
|
|
|
15132
15357
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts
|
|
15133
|
-
import * as
|
|
15358
|
+
import * as fs19 from "node:fs";
|
|
15134
15359
|
import * as path20 from "node:path";
|
|
15135
15360
|
function formatFailedSingleRunOutput(result, displayOutput) {
|
|
15136
15361
|
const error = result.error || "Failed";
|
|
@@ -15149,7 +15374,7 @@ function cleanupTransientProgress(progressDir, artifactsEnabled) {
|
|
|
15149
15374
|
if (!progressDir || artifactsEnabled)
|
|
15150
15375
|
return;
|
|
15151
15376
|
try {
|
|
15152
|
-
|
|
15377
|
+
fs19.rmSync(progressDir, { recursive: true, force: true });
|
|
15153
15378
|
} catch {}
|
|
15154
15379
|
}
|
|
15155
15380
|
function createForwardSingleUpdate(onUpdate, foregroundControl, agent, index) {
|
|
@@ -15212,6 +15437,7 @@ async function runSinglePath(data, deps) {
|
|
|
15212
15437
|
agent: agentConfig,
|
|
15213
15438
|
task: params.task,
|
|
15214
15439
|
modelConstraints: params.modelConstraints,
|
|
15440
|
+
taskNeeds: params.taskNeeds,
|
|
15215
15441
|
signal
|
|
15216
15442
|
}) : undefined;
|
|
15217
15443
|
const modelOverride = modelRoute?.modelOverride ?? resolveModelCandidate(effectiveModel, availableModels, currentProvider);
|
|
@@ -15344,7 +15570,7 @@ async function runSinglePath(data, deps) {
|
|
|
15344
15570
|
}) : getSingleResultOutput(child)
|
|
15345
15571
|
});
|
|
15346
15572
|
if (!parentAsk || !settledChild?.interrupted)
|
|
15347
|
-
return
|
|
15573
|
+
return await taskToolResultWithOutput(response, ctx.getAgentTaskHost());
|
|
15348
15574
|
r = settledChild;
|
|
15349
15575
|
} else
|
|
15350
15576
|
r = await deps.runtime.runSync(ctx.cwd, agents, params.agent, task, runOptions);
|
|
@@ -15516,12 +15742,15 @@ async function handleManagementRequest(input) {
|
|
|
15516
15742
|
}
|
|
15517
15743
|
if (action === "wait") {
|
|
15518
15744
|
const observed = ctx.getAgentTaskHost && params.id !== undefined ? await ctx.getAgentTaskHost().waitForTask(params.id, params.budgetMs) : { ok: false, error: { code: "UnknownTask", message: "Task not found in this owner" } };
|
|
15745
|
+
const settledOutput = observed.ok && observed.value.kind === "settled" ? await settledTaskOutputText(ctx.getAgentTaskHost?.(), [
|
|
15746
|
+
{ taskId: observed.value.taskId, result: observed.value.result }
|
|
15747
|
+
]) : "";
|
|
15519
15748
|
return {
|
|
15520
15749
|
content: [
|
|
15521
15750
|
{
|
|
15522
15751
|
type: "text",
|
|
15523
15752
|
text: `${observed.ok && observed.value.kind === "settled" && subagentTaskResultLabel(observed.value.result) === "killed (non-resumable)" ? `Killed. This child cannot be resumed. Underlying host observation:
|
|
15524
|
-
` : ""}${JSON.stringify(observed.ok ? observed.value : observed.error)}`
|
|
15753
|
+
` : ""}${JSON.stringify(observed.ok ? observed.value : observed.error)}${settledOutput}`
|
|
15525
15754
|
}
|
|
15526
15755
|
],
|
|
15527
15756
|
details: {
|
|
@@ -15553,13 +15782,14 @@ async function handleManagementRequest(input) {
|
|
|
15553
15782
|
if (watched.ok) {
|
|
15554
15783
|
const records = watched.value.snapshot.tasks.filter((task) => task.ref.taskId === taskId);
|
|
15555
15784
|
watched.value.dispose();
|
|
15785
|
+
const settledOutput = action === "status" ? await settledTaskOutputText(host, settledOutputsFromRecords(records)) : "";
|
|
15556
15786
|
return {
|
|
15557
15787
|
content: [
|
|
15558
15788
|
{
|
|
15559
15789
|
type: "text",
|
|
15560
15790
|
text: `${records.some((task) => task.execution.kind === "settled" && subagentTaskResultLabel(task.execution.result) === "killed (non-resumable)") ? `Killed. This child cannot be resumed. Underlying host records:
|
|
15561
15791
|
` : action === "kill" ? `Kill requested. This child cannot be resumed. Underlying host records:
|
|
15562
|
-
` : ""}${JSON.stringify(records)}`
|
|
15792
|
+
` : ""}${JSON.stringify(records)}${settledOutput}`
|
|
15563
15793
|
}
|
|
15564
15794
|
],
|
|
15565
15795
|
details: { mode: "management", results: [], taskRecords: records }
|
|
@@ -17238,13 +17468,13 @@ function renderSubagentResult(result, options, theme) {
|
|
|
17238
17468
|
return appendParentAskOutput(c, handoffOutput, theme);
|
|
17239
17469
|
}
|
|
17240
17470
|
// dist/builtin/subagents/src/extension/config.ts
|
|
17241
|
-
import * as
|
|
17471
|
+
import * as fs20 from "node:fs";
|
|
17242
17472
|
import { getAgentConfigPaths as getAgentConfigPaths5 } from "@bastani/atomic";
|
|
17243
17473
|
function loadConfig() {
|
|
17244
17474
|
for (const configPath of getAgentConfigPaths5("extensions", "subagent", "config.json")) {
|
|
17245
17475
|
try {
|
|
17246
|
-
if (
|
|
17247
|
-
return JSON.parse(
|
|
17476
|
+
if (fs20.existsSync(configPath)) {
|
|
17477
|
+
return JSON.parse(fs20.readFileSync(configPath, "utf-8"));
|
|
17248
17478
|
}
|
|
17249
17479
|
} catch (error) {
|
|
17250
17480
|
console.error(`Failed to load subagent config from '${configPath}':`, error);
|
|
@@ -17406,6 +17636,7 @@ var TaskItem = Type.Object({
|
|
|
17406
17636
|
description: "Concrete model override, or 'auto' to select an available model and effort for this task."
|
|
17407
17637
|
})),
|
|
17408
17638
|
modelConstraints: Type.Optional(ModelConstraintsSchema),
|
|
17639
|
+
taskNeeds: Type.Optional(TaskNeedsSchema),
|
|
17409
17640
|
skill: Type.Optional(SkillOverride),
|
|
17410
17641
|
group: Type.Optional(GroupSchema)
|
|
17411
17642
|
});
|
|
@@ -17499,7 +17730,8 @@ var SubagentParams = Type.Object({
|
|
|
17499
17730
|
model: Type.Optional(Type.String({
|
|
17500
17731
|
description: "Concrete model override, or 'auto' to select an available model and effort for this task."
|
|
17501
17732
|
})),
|
|
17502
|
-
modelConstraints: Type.Optional(ModelConstraintsSchema)
|
|
17733
|
+
modelConstraints: Type.Optional(ModelConstraintsSchema),
|
|
17734
|
+
taskNeeds: Type.Optional(TaskNeedsSchema)
|
|
17503
17735
|
}, { additionalProperties: false });
|
|
17504
17736
|
|
|
17505
17737
|
// dist/builtin/subagents/src/extension/tool-description.ts
|
|
@@ -17674,11 +17906,11 @@ function getApiScopedSet(pi, key) {
|
|
|
17674
17906
|
import * as path22 from "node:path";
|
|
17675
17907
|
|
|
17676
17908
|
// dist/builtin/subagents/src/runs/inprocess/runtime-support/temp-cleanup.ts
|
|
17677
|
-
import * as
|
|
17909
|
+
import * as fs21 from "node:fs";
|
|
17678
17910
|
import * as path21 from "node:path";
|
|
17679
17911
|
var SUBAGENT_RUNTIME_TEMP_DIR = path21.join(TEMP_ROOT_DIR, "nested-subagent-events");
|
|
17680
17912
|
function hasEntryNewerThan(filePath, cutoff) {
|
|
17681
|
-
const stat =
|
|
17913
|
+
const stat = fs21.statSync(filePath);
|
|
17682
17914
|
if (stat.mtimeMs >= cutoff)
|
|
17683
17915
|
return true;
|
|
17684
17916
|
if (!stat.isDirectory())
|
|
@@ -17688,14 +17920,14 @@ function hasEntryNewerThan(filePath, cutoff) {
|
|
|
17688
17920
|
function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
17689
17921
|
let entries;
|
|
17690
17922
|
try {
|
|
17691
|
-
entries =
|
|
17923
|
+
entries = fs21.readdirSync(dirPath);
|
|
17692
17924
|
} catch {
|
|
17693
17925
|
return false;
|
|
17694
17926
|
}
|
|
17695
17927
|
for (const entry of entries) {
|
|
17696
17928
|
const childPath = path21.join(dirPath, entry);
|
|
17697
17929
|
try {
|
|
17698
|
-
const stat =
|
|
17930
|
+
const stat = fs21.statSync(childPath);
|
|
17699
17931
|
if (stat.mtimeMs >= cutoff)
|
|
17700
17932
|
return true;
|
|
17701
17933
|
if (stat.isDirectory() && directoryHasEntryNewerThan(childPath, cutoff))
|
|
@@ -17707,7 +17939,7 @@ function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
|
17707
17939
|
function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
17708
17940
|
let entries;
|
|
17709
17941
|
try {
|
|
17710
|
-
entries =
|
|
17942
|
+
entries = fs21.readdirSync(root);
|
|
17711
17943
|
} catch (error) {
|
|
17712
17944
|
if (error.code === "ENOENT")
|
|
17713
17945
|
return;
|
|
@@ -17718,7 +17950,7 @@ function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
|
17718
17950
|
const entryPath = path21.join(root, entry);
|
|
17719
17951
|
try {
|
|
17720
17952
|
if (!hasEntryNewerThan(entryPath, cutoff))
|
|
17721
|
-
|
|
17953
|
+
fs21.rmSync(entryPath, { recursive: true, force: true });
|
|
17722
17954
|
} catch {}
|
|
17723
17955
|
}
|
|
17724
17956
|
}
|
|
@@ -17823,7 +18055,7 @@ function getSubagentSessionRoot(parentSessionFile) {
|
|
|
17823
18055
|
const sessionsDir = path23.dirname(parentSessionFile);
|
|
17824
18056
|
return path23.join(sessionsDir, baseName);
|
|
17825
18057
|
}
|
|
17826
|
-
return
|
|
18058
|
+
return fs22.mkdtempSync(path23.join(os8.tmpdir(), `${APP_NAME3}-subagent-session-`));
|
|
17827
18059
|
}
|
|
17828
18060
|
function expandTilde2(p) {
|
|
17829
18061
|
return p.startsWith("~/") ? path23.join(os8.homedir(), p.slice(2)) : p;
|