@bastani/atomic 0.10.2-alpha.1 → 0.10.3-alpha.1
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 +112 -0
- package/dist/builtin/intercom/CHANGELOG.md +17 -0
- package/dist/builtin/intercom/broker/broker-instance.ts +2 -13
- package/dist/builtin/intercom/broker/broker.ts +158 -73
- package/dist/builtin/intercom/broker/durable-ended-queue.ts +14 -2
- package/dist/builtin/intercom/broker/host-command-environment.ts +13 -0
- package/dist/builtin/intercom/broker/hosted-session-errors.ts +1 -0
- package/dist/builtin/intercom/broker/multinode-router.ts +111 -16
- package/dist/builtin/intercom/broker/multinode-state-store.ts +50 -4
- package/dist/builtin/intercom/broker/open-broker-state.ts +5 -4
- package/dist/builtin/intercom/broker/spawn.ts +144 -25
- package/dist/builtin/intercom/broker/sql-add-column.ts +33 -0
- package/dist/builtin/intercom/broker/sql-known-session-store.ts +120 -36
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +75 -13
- package/dist/builtin/intercom/broker/start-announcement.ts +55 -10
- package/dist/builtin/intercom/broker/watchdog.ts +10 -7
- package/dist/builtin/intercom/index.bundle.mjs +111 -27
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +29 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/skill-creator/SKILL.md +30 -52
- package/dist/builtin/subagents/skills/skill-creator/eval-viewer/generate_review.py +34 -40
- package/dist/builtin/subagents/skills/skill-creator/eval-viewer/viewer.html +2 -2
- package/dist/builtin/subagents/skills/skill-creator/scripts/atomic_cli.py +668 -0
- package/dist/builtin/subagents/skills/skill-creator/scripts/generate_report.py +3 -3
- package/dist/builtin/subagents/skills/skill-creator/scripts/improve_description.py +42 -38
- package/dist/builtin/subagents/skills/skill-creator/scripts/run_eval.py +268 -176
- package/dist/builtin/subagents/skills/skill-creator/scripts/run_loop.py +20 -11
- package/dist/builtin/subagents/skills/skill-creator/scripts/utils.py +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +163 -97
- package/dist/builtin/web-access/CHANGELOG.md +14 -0
- package/dist/builtin/web-access/index.bundle.mjs +5 -4
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts +10 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +54 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts +4 -0
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +17 -2
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +3 -1
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-events.d.ts +2 -0
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +34 -13
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +3 -0
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +27 -0
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +213 -30
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +6 -1
- 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.map +1 -1
- package/dist/core/agent-session-prompt.js +35 -3
- 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 +2 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +6 -1
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +15 -2
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-typed-queue.d.ts +14 -1
- package/dist/core/agent-session-typed-queue.d.ts.map +1 -1
- package/dist/core/agent-session-typed-queue.js +26 -1
- package/dist/core/agent-session-typed-queue.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -0
- 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.map +1 -1
- package/dist/core/agent-session.js +2 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/async-scope.d.ts +9 -4
- package/dist/core/async-scope.d.ts.map +1 -1
- package/dist/core/async-scope.js +13 -5
- package/dist/core/async-scope.js.map +1 -1
- package/dist/core/builtin-diagnostics.js +2 -2
- package/dist/core/builtin-diagnostics.js.map +1 -1
- package/dist/core/chat-admission-order.d.ts.map +1 -1
- package/dist/core/chat-admission-order.js +2 -1
- package/dist/core/chat-admission-order.js.map +1 -1
- package/dist/core/chat-record-saves.d.ts +4 -0
- package/dist/core/chat-record-saves.d.ts.map +1 -0
- package/dist/core/chat-record-saves.js +25 -0
- package/dist/core/chat-record-saves.js.map +1 -0
- package/dist/core/command-deliveries.d.ts +62 -0
- package/dist/core/command-deliveries.d.ts.map +1 -0
- package/dist/core/command-deliveries.js +139 -0
- package/dist/core/command-deliveries.js.map +1 -0
- package/dist/core/diagnostic-writer.d.ts.map +1 -1
- package/dist/core/diagnostic-writer.js +5 -4
- package/dist/core/diagnostic-writer.js.map +1 -1
- package/dist/core/extension-startup-close.d.ts +1 -2
- package/dist/core/extension-startup-close.d.ts.map +1 -1
- package/dist/core/extension-startup-close.js +2 -2
- package/dist/core/extension-startup-close.js.map +1 -1
- package/dist/core/extensions/jiti-aliases.d.ts +11 -0
- package/dist/core/extensions/jiti-aliases.d.ts.map +1 -0
- package/dist/core/extensions/jiti-aliases.js +28 -0
- package/dist/core/extensions/jiti-aliases.js.map +1 -0
- package/dist/core/extensions/loader-api.js +3 -3
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-bindings.js +2 -2
- package/dist/core/extensions/loader-bindings.js.map +1 -1
- package/dist/core/extensions/loader-rollback.d.ts +1 -2
- package/dist/core/extensions/loader-rollback.d.ts.map +1 -1
- package/dist/core/extensions/loader-rollback.js +2 -2
- package/dist/core/extensions/loader-rollback.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +53 -9
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/native-builtin-entries.d.ts +5 -0
- package/dist/core/extensions/native-builtin-entries.d.ts.map +1 -1
- package/dist/core/extensions/native-builtin-entries.js +8 -1
- package/dist/core/extensions/native-builtin-entries.js.map +1 -1
- package/dist/core/extensions/reloadable-scripts.d.ts +21 -2
- package/dist/core/extensions/reloadable-scripts.d.ts.map +1 -1
- package/dist/core/extensions/reloadable-scripts.js +11 -3
- package/dist/core/extensions/reloadable-scripts.js.map +1 -1
- package/dist/core/extensions/source-builtin-imports.d.ts +40 -0
- package/dist/core/extensions/source-builtin-imports.d.ts.map +1 -0
- package/dist/core/extensions/source-builtin-imports.js +142 -0
- package/dist/core/extensions/source-builtin-imports.js.map +1 -0
- package/dist/core/extensions/transform-graph.d.ts +15 -0
- package/dist/core/extensions/transform-graph.d.ts.map +1 -0
- package/dist/core/extensions/transform-graph.js +85 -0
- package/dist/core/extensions/transform-graph.js.map +1 -0
- package/dist/core/extensions/ts-source-specifiers.d.ts +2 -0
- package/dist/core/extensions/ts-source-specifiers.d.ts.map +1 -1
- package/dist/core/extensions/ts-source-specifiers.js +7 -0
- package/dist/core/extensions/ts-source-specifiers.js.map +1 -1
- package/dist/core/extensions/ts-transform-worker.d.ts +2 -0
- package/dist/core/extensions/ts-transform-worker.d.ts.map +1 -0
- package/dist/core/extensions/ts-transform-worker.js +43 -0
- package/dist/core/extensions/ts-transform-worker.js.map +1 -0
- package/dist/core/message-admission.d.ts.map +1 -1
- package/dist/core/message-admission.js +4 -4
- package/dist/core/message-admission.js.map +1 -1
- package/dist/core/messages.d.ts +5 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +35 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-fallback-failures.d.ts +1 -1
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +18 -1
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/process-start-token.d.ts +7 -0
- package/dist/core/process-start-token.d.ts.map +1 -1
- package/dist/core/process-start-token.js +14 -0
- package/dist/core/process-start-token.js.map +1 -1
- package/dist/core/project-trust-electorate.d.ts +24 -0
- package/dist/core/project-trust-electorate.d.ts.map +1 -0
- package/dist/core/project-trust-electorate.js +52 -0
- package/dist/core/project-trust-electorate.js.map +1 -0
- package/dist/core/project-trust-state.d.ts +15 -0
- package/dist/core/project-trust-state.d.ts.map +1 -1
- package/dist/core/project-trust-state.js +15 -0
- package/dist/core/project-trust-state.js.map +1 -1
- package/dist/core/provider-request-admission.d.ts.map +1 -1
- package/dist/core/provider-request-admission.js +2 -2
- package/dist/core/provider-request-admission.js.map +1 -1
- package/dist/core/queued-input-admission.js +2 -2
- package/dist/core/queued-input-admission.js.map +1 -1
- package/dist/core/queued-message-delivery.d.ts +2 -2
- package/dist/core/queued-message-delivery.d.ts.map +1 -1
- package/dist/core/queued-message-delivery.js +6 -3
- package/dist/core/queued-message-delivery.js.map +1 -1
- package/dist/core/resource-admission-scope.js +2 -2
- package/dist/core/resource-admission-scope.js.map +1 -1
- package/dist/core/resume/blueprint/process.d.ts +3 -4
- package/dist/core/resume/blueprint/process.d.ts.map +1 -1
- package/dist/core/resume/blueprint/process.js +33 -17
- package/dist/core/resume/blueprint/process.js.map +1 -1
- package/dist/core/resume/path-mapping.js +4 -4
- package/dist/core/resume/path-mapping.js.map +1 -1
- package/dist/core/resume/session-resume.d.ts +9 -0
- package/dist/core/resume/session-resume.d.ts.map +1 -1
- package/dist/core/resume/session-resume.js +27 -2
- package/dist/core/resume/session-resume.js.map +1 -1
- package/dist/core/resume-cache-checkpoint.d.ts +27 -1
- package/dist/core/resume-cache-checkpoint.d.ts.map +1 -1
- package/dist/core/resume-cache-checkpoint.js +45 -0
- package/dist/core/resume-cache-checkpoint.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -31
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-lifecycle-scope.d.ts +1 -2
- package/dist/core/session-lifecycle-scope.d.ts.map +1 -1
- package/dist/core/session-lifecycle-scope.js +2 -2
- package/dist/core/session-lifecycle-scope.js.map +1 -1
- package/dist/core/session-lifecycle-work.js +2 -2
- package/dist/core/session-lifecycle-work.js.map +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +3 -0
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-storage.d.ts +12 -0
- package/dist/core/session-storage.d.ts.map +1 -1
- package/dist/core/session-storage.js +68 -1
- package/dist/core/session-storage.js.map +1 -1
- package/dist/core/settings-lock-directory.d.ts.map +1 -1
- package/dist/core/settings-lock-directory.js +4 -3
- package/dist/core/settings-lock-directory.js.map +1 -1
- package/dist/core/settings-write-ownership.d.ts +1 -2
- package/dist/core/settings-write-ownership.d.ts.map +1 -1
- package/dist/core/settings-write-ownership.js +2 -2
- package/dist/core/settings-write-ownership.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +6 -4
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite.js +22 -8
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/system-prompt.d.ts +16 -2
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +33 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
- package/dist/core/tasks/agent-adapter.js +2 -1
- package/dist/core/tasks/agent-adapter.js.map +1 -1
- package/dist/core/tasks/completion.d.ts +3 -2
- package/dist/core/tasks/completion.d.ts.map +1 -1
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tasks/execution-scope.js +2 -2
- package/dist/core/tasks/execution-scope.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +2 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/history-regex-worker.d.ts.map +1 -1
- package/dist/core/tools/history-regex-worker.js +3 -2
- package/dist/core/tools/history-regex-worker.js.map +1 -1
- package/dist/core/tools/shell-task-render.d.ts +3 -2
- package/dist/core/tools/shell-task-render.d.ts.map +1 -1
- package/dist/core/tools/shell-task-render.js +7 -5
- package/dist/core/tools/shell-task-render.js.map +1 -1
- package/dist/core/tools/shell-task-status.d.ts +6 -2
- package/dist/core/tools/shell-task-status.d.ts.map +1 -1
- package/dist/core/tools/shell-task-status.js +13 -8
- package/dist/core/tools/shell-task-status.js.map +1 -1
- package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
- package/dist/core/tools/sqlite-selector-connection.js +4 -3
- package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
- package/dist/core/tools/windows-directory-security.d.ts.map +1 -1
- package/dist/core/tools/windows-directory-security.js +2 -1
- package/dist/core/tools/windows-directory-security.js.map +1 -1
- package/dist/core/worktree-snapshot/git.js +2 -2
- package/dist/core/worktree-snapshot/git.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +6 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +150 -18
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/tool-records.d.ts +44 -9
- package/dist/extensions/mcp/tool-records.d.ts.map +1 -1
- package/dist/extensions/mcp/tool-records.js +58 -16
- package/dist/extensions/mcp/tool-records.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/main-session.d.ts +3 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +1 -0
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +230 -96
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +5 -0
- package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-bridge.js.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +5 -2
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-switcher.js +3 -3
- package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +6 -0
- package/dist/modes/interactive/agent-view/contracts.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/contracts.js.map +1 -1
- package/dist/modes/interactive/agent-view/install.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/install.js +2 -1
- package/dist/modes/interactive/agent-view/install.js.map +1 -1
- package/dist/modes/interactive/agent-view/open-port.d.ts +4 -2
- package/dist/modes/interactive/agent-view/open-port.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/open-port.js +4 -3
- package/dist/modes/interactive/agent-view/open-port.js.map +1 -1
- package/dist/modes/interactive/agent-view/prompt-retarget.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/prompt-retarget.js +18 -5
- package/dist/modes/interactive/agent-view/prompt-retarget.js.map +1 -1
- package/dist/modes/interactive/agent-view/remote-port.d.ts +10 -1
- package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/remote-port.js +36 -4
- package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
- package/dist/modes/interactive/agent-view/viewed-keys.d.ts +56 -0
- package/dist/modes/interactive/agent-view/viewed-keys.d.ts.map +1 -0
- package/dist/modes/interactive/agent-view/viewed-keys.js +63 -0
- package/dist/modes/interactive/agent-view/viewed-keys.js.map +1 -0
- package/dist/modes/interactive/agent-view/viewed-submit.d.ts +14 -4
- package/dist/modes/interactive/agent-view/viewed-submit.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/viewed-submit.js +51 -17
- package/dist/modes/interactive/agent-view/viewed-submit.js.map +1 -1
- package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/agent-panel.js +8 -21
- package/dist/modes/interactive/components/agent-panel.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +18 -5
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +6 -0
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +1 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +2 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts +5 -0
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +33 -2
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +58 -2
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.js +2 -2
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/main-composer-keys.d.ts +16 -5
- package/dist/modes/interactive/components/main-composer-keys.d.ts.map +1 -1
- package/dist/modes/interactive/components/main-composer-keys.js +27 -8
- package/dist/modes/interactive/components/main-composer-keys.js.map +1 -1
- package/dist/modes/interactive/components/notice-line.d.ts +8 -25
- package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
- package/dist/modes/interactive/components/notice-line.js +18 -17
- package/dist/modes/interactive/components/notice-line.js.map +1 -1
- package/dist/modes/interactive/components/prompt-slot.d.ts +20 -3
- package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -1
- package/dist/modes/interactive/components/prompt-slot.js +82 -32
- package/dist/modes/interactive/components/prompt-slot.js.map +1 -1
- package/dist/modes/interactive/components/queued-messages-view.d.ts +5 -2
- package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/queued-messages-view.js +12 -5
- package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
- package/dist/modes/interactive/components/task-board.d.ts +5 -8
- package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-board.js +5 -49
- package/dist/modes/interactive/components/task-board.js.map +1 -1
- package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-completion-message.js +9 -2
- package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
- package/dist/modes/interactive/components/task-marks.d.ts +19 -0
- package/dist/modes/interactive/components/task-marks.d.ts.map +1 -0
- package/dist/modes/interactive/components/task-marks.js +25 -0
- package/dist/modes/interactive/components/task-marks.js.map +1 -0
- package/dist/modes/interactive/components/task-row.d.ts +10 -2
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-row.js +39 -32
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.d.ts +7 -0
- package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.js +106 -10
- package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
- package/dist/modes/interactive/components/tool-block-families.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-block-families.js +8 -9
- package/dist/modes/interactive/components/tool-block-families.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +5 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/extension-command-hold.d.ts.map +1 -1
- package/dist/modes/interactive/extension-command-hold.js +5 -7
- package/dist/modes/interactive/extension-command-hold.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +6 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +21 -7
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-initial-session-binding.d.ts +1 -2
- package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-initial-session-binding.js +2 -2
- package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +13 -4
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +6 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +4 -2
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +6 -0
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +5 -0
- 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-process-lifecycle.js +96 -17
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +5 -0
- package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +37 -5
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +45 -4
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.d.ts +4 -1
- package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js +20 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +3 -0
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +43 -5
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.d.ts +6 -3
- package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.js +3 -2
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
- package/dist/modes/interactive-engine/engine-health.d.ts +2 -0
- package/dist/modes/interactive-engine/engine-health.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-health.js.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts +10 -0
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.js +33 -0
- package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +7 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +15 -2
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/host-listener-failures.d.ts +24 -0
- package/dist/modes/interactive-engine/host-listener-failures.d.ts.map +1 -0
- package/dist/modes/interactive-engine/host-listener-failures.js +98 -0
- package/dist/modes/interactive-engine/host-listener-failures.js.map +1 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +16 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +74 -7
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +5 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +8 -2
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +13 -0
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +69 -4
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +34 -6
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/agent-panel-bridge.d.ts +7 -0
- package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
- package/dist/modes/rpc/agent-panel-bridge.js +11 -1
- package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
- package/dist/modes/rpc/agent-view-rpc-panel.d.ts.map +1 -1
- package/dist/modes/rpc/agent-view-rpc-panel.js +11 -5
- package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +8 -1
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +89 -65
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +21 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +77 -33
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.d.ts +5 -0
- package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.js +8 -2
- package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +9 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/shell.d.ts +5 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +14 -7
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/worker-threads.d.ts +10 -4
- package/dist/utils/worker-threads.d.ts.map +1 -1
- package/dist/utils/worker-threads.js +10 -4
- package/dist/utils/worker-threads.js.map +1 -1
- package/docs/background-tasks.md +10 -10
- package/docs/compaction.md +1 -0
- package/docs/development.md +1 -1
- package/docs/environment-variables.md +4 -0
- package/docs/extensions/api-reference.md +2 -0
- package/docs/extensions/events.md +1 -1
- package/docs/getting-started/installation.md +1 -0
- package/docs/guides/non-interactive.md +2 -0
- package/docs/guides/resume-on-any-machine.md +3 -1
- package/docs/intercom/reference.md +1 -1
- package/docs/keybindings.md +6 -5
- package/docs/libraries/ai.md +2 -1
- package/docs/mcp-servers.md +1 -1
- package/docs/sdk/reference.md +1 -1
- package/docs/sdk.md +6 -0
- package/docs/security.md +4 -2
- package/docs/settings.md +2 -1
- package/docs/storage.md +2 -0
- package/docs/subagents.md +2 -2
- package/docs/tui/reference.md +3 -1
- package/npm-shrinkwrap.json +49 -49
- package/package.json +6 -6
|
@@ -14949,7 +14949,6 @@ ${output}` : ""
|
|
|
14949
14949
|
}
|
|
14950
14950
|
|
|
14951
14951
|
// dist/builtin/subagents/src/runs/shared/worktree.ts
|
|
14952
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
14953
14952
|
import { spawn } from "node:child_process";
|
|
14954
14953
|
import * as fs3 from "node:fs/promises";
|
|
14955
14954
|
import * as os4 from "node:os";
|
|
@@ -14966,6 +14965,23 @@ import {
|
|
|
14966
14965
|
untrackDetachedChildPid
|
|
14967
14966
|
} from "@bastani/atomic";
|
|
14968
14967
|
|
|
14968
|
+
// dist/builtin/subagents/src/shared/async-scope.ts
|
|
14969
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
14970
|
+
var storeKey = Symbol.for("atomic.async-scopes.v1");
|
|
14971
|
+
var host = globalThis;
|
|
14972
|
+
host[storeKey] ??= new AsyncLocalStorage;
|
|
14973
|
+
var scopes = host[storeKey];
|
|
14974
|
+
function asyncScope() {
|
|
14975
|
+
const scope = {
|
|
14976
|
+
getStore: () => scopes.getStore()?.get(scope),
|
|
14977
|
+
run: (value, operation) => {
|
|
14978
|
+
const outer = scopes.getStore();
|
|
14979
|
+
return scopes.run(Object.is(outer?.get(scope), value) ? outer : new Map(outer).set(scope, value), operation);
|
|
14980
|
+
}
|
|
14981
|
+
};
|
|
14982
|
+
return scope;
|
|
14983
|
+
}
|
|
14984
|
+
|
|
14969
14985
|
// dist/builtin/subagents/src/runs/shared/worktree-post-create.ts
|
|
14970
14986
|
import * as fs from "node:fs/promises";
|
|
14971
14987
|
import * as path7 from "node:path";
|
|
@@ -15281,8 +15297,8 @@ function spawnCollect(command, args, options) {
|
|
|
15281
15297
|
});
|
|
15282
15298
|
}
|
|
15283
15299
|
var STALLED_CHECK_GIT_TIMEOUT_MS = 1e4;
|
|
15284
|
-
var stalledCheck =
|
|
15285
|
-
var finishing =
|
|
15300
|
+
var stalledCheck = asyncScope();
|
|
15301
|
+
var finishing = asyncScope();
|
|
15286
15302
|
function withFinishingWorktree(work) {
|
|
15287
15303
|
return finishing.run(true, work);
|
|
15288
15304
|
}
|
|
@@ -17595,6 +17611,9 @@ function currentModelFullId(model) {
|
|
|
17595
17611
|
return `${String(model.provider)}/${model.id}`;
|
|
17596
17612
|
}
|
|
17597
17613
|
|
|
17614
|
+
// dist/builtin/subagents/src/runs/foreground/released-wake-prompt.ts
|
|
17615
|
+
var SUBAGENT_RELEASED_WAKE_PROMPT = "You were released while you waited, and something you were waiting for arrived: read the new messages and tool results, then continue your task. If you have finished, stop.";
|
|
17616
|
+
|
|
17598
17617
|
// dist/builtin/subagents/src/runs/foreground/subagent-child-owner.ts
|
|
17599
17618
|
import { registerExtensionContextRetirementEffect } from "@bastani/atomic";
|
|
17600
17619
|
var acquireWriter = Symbol.for("atomic.subagents/acquire-child-record-writer@1");
|
|
@@ -17691,7 +17710,11 @@ function heldTaskExpands(held) {
|
|
|
17691
17710
|
function pendingMessagesOfResult(result) {
|
|
17692
17711
|
if (!result.pendingMessages?.length)
|
|
17693
17712
|
return;
|
|
17694
|
-
return {
|
|
17713
|
+
return {
|
|
17714
|
+
messages: result.pendingMessages,
|
|
17715
|
+
taskExpands: result.pendingTaskExpands === true,
|
|
17716
|
+
withoutWakePrompt: true
|
|
17717
|
+
};
|
|
17695
17718
|
}
|
|
17696
17719
|
function currentWakeFailure(record) {
|
|
17697
17720
|
return record.wakeFailure?.taskId === record.taskId ? record.wakeFailure : undefined;
|
|
@@ -17713,6 +17736,16 @@ function summarizeSubagentTask(task) {
|
|
|
17713
17736
|
function subagentChildTask(task, options) {
|
|
17714
17737
|
return options.resumeSession === true || task.trim() === "" ? {} : { task: summarizeSubagentTask(task) };
|
|
17715
17738
|
}
|
|
17739
|
+
function subagentChildTitle(task, options) {
|
|
17740
|
+
const title = options.resumeSession === true ? undefined : firstLine(task);
|
|
17741
|
+
if (title === undefined)
|
|
17742
|
+
return {};
|
|
17743
|
+
return { title: title.length > TASK_SUMMARY_LIMIT ? `${sliceHead(title, TASK_SUMMARY_LIMIT - 1)}…` : title };
|
|
17744
|
+
}
|
|
17745
|
+
function firstLine(text) {
|
|
17746
|
+
return text.split(`
|
|
17747
|
+
`).find((line) => line.trim() !== "")?.replace(/\r$/, "");
|
|
17748
|
+
}
|
|
17716
17749
|
function subagentChildInheritance(options) {
|
|
17717
17750
|
return {
|
|
17718
17751
|
...options.currentModel ? { model: options.currentModel } : {},
|
|
@@ -17904,14 +17937,20 @@ async function holdSubagentChildMessages(pi, ownerSessionId, childId, messages)
|
|
|
17904
17937
|
...latest,
|
|
17905
17938
|
heldMessages: {
|
|
17906
17939
|
taskId: latest.taskId,
|
|
17907
|
-
messages: [...held
|
|
17908
|
-
taskExpands: held?.taskExpands ?? false
|
|
17940
|
+
messages: [...messagesSent(held), ...messages],
|
|
17941
|
+
taskExpands: held?.taskExpands ?? false,
|
|
17942
|
+
withoutWakePrompt: true
|
|
17909
17943
|
}
|
|
17910
17944
|
}));
|
|
17911
17945
|
outcome = kind;
|
|
17912
17946
|
});
|
|
17913
17947
|
return outcome;
|
|
17914
17948
|
}
|
|
17949
|
+
function messagesSent(held) {
|
|
17950
|
+
if (held === undefined)
|
|
17951
|
+
return [];
|
|
17952
|
+
return held.withoutWakePrompt ? held.messages : held.messages.filter((message) => message !== SUBAGENT_RELEASED_WAKE_PROMPT);
|
|
17953
|
+
}
|
|
17915
17954
|
function requestSubagentChildStop(taskId, status) {
|
|
17916
17955
|
stopRequests.set(taskId, status);
|
|
17917
17956
|
}
|
|
@@ -21608,6 +21647,9 @@ async function cancelledEnvelope(session, spec, stats, ownTurns) {
|
|
|
21608
21647
|
})).text;
|
|
21609
21648
|
}
|
|
21610
21649
|
var LITERAL_TEXT = { expandPromptTemplates: false };
|
|
21650
|
+
function unsentTask(spec) {
|
|
21651
|
+
return spec.skipTaskPrompt || spec.resumeTaskFallback ? undefined : spec.task;
|
|
21652
|
+
}
|
|
21611
21653
|
async function recoverChildSession(session, spec) {
|
|
21612
21654
|
if (!spec.resumeToolResults?.length && spec.redispatchDetachedCalls !== true) {
|
|
21613
21655
|
await session.startPendingRecovery("resume");
|
|
@@ -21961,7 +22003,10 @@ class SubagentControlRuntime {
|
|
|
21961
22003
|
status: killed ? "killed" : "interrupted",
|
|
21962
22004
|
...waitResult === PARENT_CANCEL_CAUSE && !killed ? {
|
|
21963
22005
|
cause: PARENT_CANCEL_CAUSE,
|
|
21964
|
-
...pendingMessagesOf(undefined, {
|
|
22006
|
+
...pendingMessagesOf(undefined, {
|
|
22007
|
+
task: unsentTask(admitted.spec),
|
|
22008
|
+
followUps: [...admitted.spec.resumeFollowUps ?? []]
|
|
22009
|
+
}, admitted.spec.resumeTaskLiteral)
|
|
21965
22010
|
} : {},
|
|
21966
22011
|
stats,
|
|
21967
22012
|
path: admitted.identity.path,
|
|
@@ -22008,7 +22053,10 @@ class SubagentControlRuntime {
|
|
|
22008
22053
|
let termination;
|
|
22009
22054
|
let interruptedTurnSettlement;
|
|
22010
22055
|
let taskPending = true;
|
|
22011
|
-
const unsent = {
|
|
22056
|
+
const unsent = {
|
|
22057
|
+
task: unsentTask(admitted.spec),
|
|
22058
|
+
followUps: [...admitted.spec.resumeFollowUps ?? []]
|
|
22059
|
+
};
|
|
22012
22060
|
let terminating;
|
|
22013
22061
|
let terminationWasKill = false;
|
|
22014
22062
|
let unsubscribe;
|
|
@@ -22389,8 +22437,11 @@ class SubagentControlRuntime {
|
|
|
22389
22437
|
markTaskDispatched = () => resolve();
|
|
22390
22438
|
});
|
|
22391
22439
|
eventLog = admitted.spec.artifactJsonlPath ? createEventLog(admitted.spec.artifactJsonlPath) : undefined;
|
|
22440
|
+
let turnStartedBeforeTask = false;
|
|
22392
22441
|
unsubscribe = session.subscribe((event) => {
|
|
22393
22442
|
eventLog?.append(event);
|
|
22443
|
+
if (event.type === "agent_start")
|
|
22444
|
+
turnStartedBeforeTask = true;
|
|
22394
22445
|
if (event.type === "message_start" && event.message.role === "assistant")
|
|
22395
22446
|
observedStreamingMessage = beginStreamingAssistantMessage(event.message);
|
|
22396
22447
|
else if (event.type === "message_update" && observedStreamingMessage)
|
|
@@ -22529,13 +22580,14 @@ class SubagentControlRuntime {
|
|
|
22529
22580
|
}
|
|
22530
22581
|
if (!termination) {
|
|
22531
22582
|
unsent.task = undefined;
|
|
22532
|
-
if (admitted.spec.skipTaskPrompt) {
|
|
22583
|
+
if (admitted.spec.skipTaskPrompt || admitted.spec.resumeTaskFallback && (turnStartedBeforeTask || session.isStreaming || session._activePromptCount > 0)) {
|
|
22533
22584
|
taskPending = false;
|
|
22534
22585
|
startBudget.end();
|
|
22535
22586
|
} else {
|
|
22536
22587
|
const prompting = session.prompt(admitted.spec.task, {
|
|
22537
22588
|
streamingBehavior: "steer",
|
|
22538
|
-
...admitted.spec.resumeTaskLiteral ? LITERAL_TEXT : {}
|
|
22589
|
+
...admitted.spec.resumeTaskLiteral ? LITERAL_TEXT : {},
|
|
22590
|
+
...admitted.spec.resumeTaskFallback ? { startTurnOnly: true } : {}
|
|
22539
22591
|
});
|
|
22540
22592
|
prompting.then(markTaskDispatched, markTaskDispatched);
|
|
22541
22593
|
await beforeStartDeadline(taskDispatched);
|
|
@@ -23013,7 +23065,6 @@ function processOwnerGeneration() {
|
|
|
23013
23065
|
|
|
23014
23066
|
// dist/builtin/subagents/src/runs/foreground/released-children.ts
|
|
23015
23067
|
var SUBAGENT_RELEASE_AFTER_MS = 60000;
|
|
23016
|
-
var SUBAGENT_RELEASED_WAKE_PROMPT = "You were released while you waited, and something you were waiting for arrived: read the new messages and tool results, then continue your task. If you have finished, stop.";
|
|
23017
23068
|
var SUBAGENT_STILL_RUNNING_RESULT = "This call is still running in the background. Its result arrives later as a message; do not start it again.";
|
|
23018
23069
|
var SUBAGENT_INTERRUPTED_BY_RESTART_RESULT = "This call was interrupted when Atomic restarted, so its result will never arrive. Re-run it if you still need it.";
|
|
23019
23070
|
function subagentWakeNamespace(ownerSessionId) {
|
|
@@ -24877,6 +24928,7 @@ async function runAgentTask(input) {
|
|
|
24877
24928
|
...input.options.intercomGroup ? { intercomGroup: input.options.intercomGroup } : {},
|
|
24878
24929
|
...input.options.orchestratorIntercomTarget ? { orchestratorTarget: input.options.orchestratorIntercomTarget } : {},
|
|
24879
24930
|
...subagentChildTask(input.intentTask ?? input.task, input.options),
|
|
24931
|
+
...subagentChildTitle(input.intentTask ?? input.task, input.options),
|
|
24880
24932
|
...worktree ? { worktree } : {},
|
|
24881
24933
|
...terminalStatus ? { terminalStatus } : {},
|
|
24882
24934
|
waitingOn: waitingOn ?? [],
|
|
@@ -25613,6 +25665,7 @@ function runOwnerlessChild(input) {
|
|
|
25613
25665
|
...input.options.intercomGroup ? { intercomGroup: input.options.intercomGroup } : {},
|
|
25614
25666
|
...input.options.orchestratorIntercomTarget ? { orchestratorTarget: input.options.orchestratorIntercomTarget } : {},
|
|
25615
25667
|
...subagentChildTask(input.task, input.options),
|
|
25668
|
+
...subagentChildTitle(input.task, input.options),
|
|
25616
25669
|
...worktree ? { worktree } : {},
|
|
25617
25670
|
...terminalStatus ? { terminalStatus } : {},
|
|
25618
25671
|
...held?.messages.length ? { heldMessages: { taskId: launchId, ...held } } : {},
|
|
@@ -26340,6 +26393,7 @@ ${task}`);
|
|
|
26340
26393
|
...options.onBeforeRelease ? { onBeforeRelease: options.onBeforeRelease } : {},
|
|
26341
26394
|
...options.resumeToolResults?.length ? { resumeToolResults: options.resumeToolResults } : {},
|
|
26342
26395
|
...options.skipTaskPrompt ? { skipTaskPrompt: true } : {},
|
|
26396
|
+
...options.resumeTaskFallback ? { resumeTaskFallback: true } : {},
|
|
26343
26397
|
...options.resumePaused ? { resumePaused: true } : {},
|
|
26344
26398
|
...options.redispatchDetachedCalls ? { redispatchDetachedCalls: true } : {},
|
|
26345
26399
|
...options.onChildSession ? { onChildSession: options.onChildSession } : {},
|
|
@@ -27365,22 +27419,26 @@ async function ownSessionModelCandidate(sessionManager, record, resolveCandidate
|
|
|
27365
27419
|
}
|
|
27366
27420
|
function resumedPrompts(record, resume) {
|
|
27367
27421
|
const prompt = resume?.prompt ?? SUBAGENT_RESUME_CONTINUATION_PROMPT;
|
|
27422
|
+
const recorded = record.heldMessages && record.heldMessages.taskId === record.taskId ? record.heldMessages : undefined;
|
|
27423
|
+
const heldAllSent = resume?.wakeFallback === true && recorded?.withoutWakePrompt === true;
|
|
27368
27424
|
const continuations = new Set([
|
|
27369
27425
|
SUBAGENT_RESUME_CONTINUATION_PROMPT,
|
|
27370
27426
|
resume?.continuation,
|
|
27371
|
-
resume?.message ? undefined : prompt
|
|
27427
|
+
resume?.message || heldAllSent ? undefined : prompt
|
|
27372
27428
|
]);
|
|
27373
|
-
const recorded = record.heldMessages && record.heldMessages.taskId === record.taskId ? record.heldMessages : undefined;
|
|
27374
27429
|
const held = recorded ? recorded.messages.filter((message) => !continuations.has(message)) : [];
|
|
27375
27430
|
const taskExpands = recorded !== undefined && heldTaskExpands(recorded) && held.length > 0 && held[0] === recorded.messages[0];
|
|
27376
|
-
const [task =
|
|
27431
|
+
const [task = "", ...followUps] = [
|
|
27377
27432
|
...held,
|
|
27378
|
-
prompt,
|
|
27433
|
+
...resume?.wakeFallback ? [] : [prompt],
|
|
27379
27434
|
...resume?.followUps ?? [],
|
|
27380
27435
|
...resume?.continuation ? [resume.continuation] : []
|
|
27381
27436
|
];
|
|
27382
27437
|
return { task, followUps, taskLiteral: !taskExpands };
|
|
27383
27438
|
}
|
|
27439
|
+
function promptsAnything(prompts) {
|
|
27440
|
+
return prompts.task !== "" || prompts.followUps.length > 0;
|
|
27441
|
+
}
|
|
27384
27442
|
function freshPrompts(record, launch, resume) {
|
|
27385
27443
|
const recorded = record.heldMessages && record.heldMessages.taskId === record.taskId ? record.heldMessages : undefined;
|
|
27386
27444
|
const held = recorded?.messages ?? [];
|
|
@@ -27559,10 +27617,14 @@ async function relaunchChild(deps, ctx, record, hold, release, onReopened, resum
|
|
|
27559
27617
|
const toolResults = sessionManager ? formatReleasedReplyResults(sessionManager, heldResults, deps.pi.events) : heldResults;
|
|
27560
27618
|
const heldMessages = record.heldMessages && record.heldMessages.taskId === record.taskId ? record.heldMessages.messages : [];
|
|
27561
27619
|
const restoredPaused = resume === undefined && !fresh && sessionManager !== undefined && latest.pausedByUser === true && pauseStillHolds(savedBranch, latest.pausedAtLeafId, latest.pausedAtLeafId === undefined ? pauseRecordedAt(ctx, record.childId) : undefined);
|
|
27562
|
-
const promptless = resume?.promptless === true && heldMessages.length === 0;
|
|
27563
|
-
const wakePlan = !redispatch && !restoredPaused && !fresh && sessionManager && (record.terminalStatus === SUBAGENT_CHILD_RELEASED_STATUS || (record.waitingOn?.length ?? 0) > 0 || toolResults.length > 0) ? planReleasedChildWake(pendingToolCalls(sessionManager), toolResults, !promptless, interruptedByRestart(record)) : undefined;
|
|
27564
27620
|
const basePrompts = fresh ? freshPrompts(record, fresh, resume) : resumedPrompts(record, resume);
|
|
27565
|
-
const
|
|
27621
|
+
const wakeFallback = resume?.wakeFallback === true && !fresh;
|
|
27622
|
+
const promptless = wakeFallback ? !promptsAnything(basePrompts) : resume?.promptless === true && heldMessages.length === 0;
|
|
27623
|
+
const wakePlan = !redispatch && !restoredPaused && !fresh && sessionManager && (record.terminalStatus === SUBAGENT_CHILD_RELEASED_STATUS || (record.waitingOn?.length ?? 0) > 0 || toolResults.length > 0) ? planReleasedChildWake(pendingToolCalls(sessionManager), toolResults, !promptless, interruptedByRestart(record)) : undefined;
|
|
27624
|
+
const wokenPrompts = redispatch ? { task: resume?.prompt ?? SUBAGENT_RESUME_CONTINUATION_PROMPT, followUps: heldMessages, taskLiteral: true } : wakePlan ? wakePrompts(basePrompts, wakePlan.lateMessages, promptless) : basePrompts;
|
|
27625
|
+
const fallback = wakeFallback && resume?.promptless !== true && !redispatch && (wakePlan?.resumeToolResults.length ?? 0) === 0 && !promptsAnything(wokenPrompts) && resume !== undefined;
|
|
27626
|
+
const prompts = fallback ? { task: resume.prompt, followUps: [], taskLiteral: true } : wokenPrompts;
|
|
27627
|
+
const taskFallback = fallback || redispatch && wakeFallback;
|
|
27566
27628
|
const options = {
|
|
27567
27629
|
runningCapacity: deps.config.parallel?.runningCapacity,
|
|
27568
27630
|
sessionStartTimeoutMs: deps.config.sessionStartTimeoutMs,
|
|
@@ -27588,7 +27650,8 @@ async function relaunchChild(deps, ctx, record, hold, release, onReopened, resum
|
|
|
27588
27650
|
wakeToolResultIds: toolResults.map((result) => result.toolCallId),
|
|
27589
27651
|
stillRunning: stillRunningAfterWake(latest, toolResults, wakePlan.resumeToolResults)
|
|
27590
27652
|
} : {},
|
|
27591
|
-
...wakePlan?.skipPrompt ? { skipTaskPrompt: true } : {},
|
|
27653
|
+
...wakePlan?.skipPrompt && !fallback ? { skipTaskPrompt: true } : {},
|
|
27654
|
+
...taskFallback ? { resumeTaskFallback: true } : {},
|
|
27592
27655
|
...redispatch ? { redispatchDetachedCalls: true } : {},
|
|
27593
27656
|
intercomEvents: deps.pi.events,
|
|
27594
27657
|
parentDepth: getCurrentSubagentDepth(ctx),
|
|
@@ -27633,7 +27696,7 @@ async function relaunchChild(deps, ctx, record, hold, release, onReopened, resum
|
|
|
27633
27696
|
agents: [agent],
|
|
27634
27697
|
agent: agent.name,
|
|
27635
27698
|
task: prompts.task,
|
|
27636
|
-
...fresh
|
|
27699
|
+
...fresh ? fresh.intentTask === undefined ? {} : { intentTask: fresh.intentTask } : resume?.wakeFallback === true ? { intentTask: resumedTaskLabel(record) } : {},
|
|
27637
27700
|
...resume || fresh ? { operation: `${record.runId}:${record.index}:resume:${randomUUID10()}` } : {},
|
|
27638
27701
|
options,
|
|
27639
27702
|
runtime,
|
|
@@ -27655,6 +27718,9 @@ function wakePrompts(base, lateMessages, promptless) {
|
|
|
27655
27718
|
const [task = "", ...followUps] = promptless ? lateMessages : [...lateMessages, base.task, ...base.followUps];
|
|
27656
27719
|
return { task, followUps, taskLiteral: true };
|
|
27657
27720
|
}
|
|
27721
|
+
function resumedTaskLabel(record) {
|
|
27722
|
+
return record.title || record.launch?.intentTask || record.launch?.task || record.task || record.agent;
|
|
27723
|
+
}
|
|
27658
27724
|
function startedFresh(outcome) {
|
|
27659
27725
|
return outcome.kind === "restored" ? { ...outcome, fresh: true } : outcome;
|
|
27660
27726
|
}
|
|
@@ -28944,6 +29010,7 @@ function bindReleasedChildWakes(deps, ctx, events, dispatcher = agentWakeDispatc
|
|
|
28944
29010
|
await restore(record, {
|
|
28945
29011
|
prompt: SUBAGENT_RELEASED_WAKE_PROMPT,
|
|
28946
29012
|
toolResults: decision.toolResults,
|
|
29013
|
+
wakeFallback: true,
|
|
28947
29014
|
...decision.prompt ? {} : { promptless: true }
|
|
28948
29015
|
}, slot);
|
|
28949
29016
|
},
|
|
@@ -28958,7 +29025,7 @@ function bindReleasedChildWakes(deps, ctx, events, dispatcher = agentWakeDispatc
|
|
|
28958
29025
|
settleReleasedChildRelaunch(key);
|
|
28959
29026
|
return outcome;
|
|
28960
29027
|
},
|
|
28961
|
-
redispatch: (record, slot) => restore(record, { prompt: SUBAGENT_RELEASED_WAKE_PROMPT, redispatch: true }, slot),
|
|
29028
|
+
redispatch: (record, slot) => restore(record, { prompt: SUBAGENT_RELEASED_WAKE_PROMPT, wakeFallback: true, redispatch: true }, slot),
|
|
28962
29029
|
fail: (record, toolResults, failure) => recordSubagentChildWakeFailure(deps.pi, ownerSessionId, record.childId, toolResults, failure)
|
|
28963
29030
|
}, dispatcher, resolveTopLevelParallelRunningCapacity(deps.config?.parallel?.runningCapacity));
|
|
28964
29031
|
const unbindResume = bindResumeDispatcher(ownerSessionId, dispatcher);
|
|
@@ -32687,11 +32754,6 @@ function truncLine(text, maxWidth) {
|
|
|
32687
32754
|
}
|
|
32688
32755
|
return `${result + activeStyles.join("")}…`;
|
|
32689
32756
|
}
|
|
32690
|
-
var PULSE_FRAMES = ["·", "•", "●", "•"];
|
|
32691
|
-
function pulseGlyph(frame) {
|
|
32692
|
-
const index = Number.isFinite(frame) ? Math.abs(Math.trunc(frame)) : 0;
|
|
32693
|
-
return PULSE_FRAMES[index % PULSE_FRAMES.length];
|
|
32694
|
-
}
|
|
32695
32757
|
// dist/builtin/subagents/src/tui/render-result.ts
|
|
32696
32758
|
import { formatTokenCount as formatTokenCount3, getMarkdownTheme, keyHintIfBound as keyHintIfBound3 } from "@bastani/atomic";
|
|
32697
32759
|
|
|
@@ -32796,16 +32858,13 @@ function clearResultAnimationTimer(context) {
|
|
|
32796
32858
|
context.state.subagentResultAnimationTimer = undefined;
|
|
32797
32859
|
context.state.subagentResultAnimationCleanup = undefined;
|
|
32798
32860
|
}
|
|
32799
|
-
function advanceResultPulseFrame(frame) {
|
|
32800
|
-
return (frame ?? 0) + 1;
|
|
32801
|
-
}
|
|
32802
32861
|
function stopResultAnimations() {}
|
|
32803
32862
|
|
|
32804
32863
|
// dist/builtin/subagents/src/tui/render-result-compact.ts
|
|
32805
|
-
import { formatTokenSegment, keyHintIfBound, navEntryKeyParts } from "@bastani/atomic";
|
|
32864
|
+
import { formatTokenSegment, keyHintIfBound, navEntryKeyParts, TASK_MARKS as TASK_MARKS2 } from "@bastani/atomic";
|
|
32806
32865
|
|
|
32807
32866
|
// dist/builtin/subagents/src/tui/render-status-progress.ts
|
|
32808
|
-
import { formatTokenCount as formatTokenCount2, sliceHead as sliceHead6 } from "@bastani/atomic";
|
|
32867
|
+
import { formatTokenCount as formatTokenCount2, sliceHead as sliceHead6, TASK_MARKS } from "@bastani/atomic";
|
|
32809
32868
|
function extractOutputTarget(task) {
|
|
32810
32869
|
const writeToMatch = task.match(/\[Write to:(?:[^\S\n]*\n)*([^\]\n]+)\]/i);
|
|
32811
32870
|
if (writeToMatch?.[1]?.trim())
|
|
@@ -32911,18 +32970,21 @@ function resultStatusLine(result, output) {
|
|
|
32911
32970
|
return "Done (no text output)";
|
|
32912
32971
|
return "Done";
|
|
32913
32972
|
}
|
|
32914
|
-
function
|
|
32973
|
+
function markText(theme, mark) {
|
|
32974
|
+
return theme.fg(mark.color, mark.glyph);
|
|
32975
|
+
}
|
|
32976
|
+
function resultGlyph(result, output, theme, running = result.progress?.status === "running") {
|
|
32915
32977
|
if (running)
|
|
32916
|
-
return theme
|
|
32978
|
+
return markText(theme, TASK_MARKS.running);
|
|
32917
32979
|
if (result.detached || result.status === "continued")
|
|
32918
|
-
return theme
|
|
32980
|
+
return markText(theme, TASK_MARKS.running);
|
|
32919
32981
|
if (result.status === "killed" || result.interrupted || result.status === "interrupted" || result.status === "skipped")
|
|
32920
|
-
return theme
|
|
32982
|
+
return markText(theme, TASK_MARKS.stopped);
|
|
32921
32983
|
if (result.status === "error")
|
|
32922
|
-
return theme
|
|
32984
|
+
return markText(theme, TASK_MARKS.failed);
|
|
32923
32985
|
if (hasEmptyTextOutputWithoutOutputTarget(result.task, output))
|
|
32924
32986
|
return theme.fg("warning", "!");
|
|
32925
|
-
return theme
|
|
32987
|
+
return markText(theme, TASK_MARKS.done);
|
|
32926
32988
|
}
|
|
32927
32989
|
function compactCurrentActivity(progress, now) {
|
|
32928
32990
|
const snapshotNow = snapshotNowForProgress(progress, now);
|
|
@@ -32931,22 +32993,22 @@ function compactCurrentActivity(progress, now) {
|
|
|
32931
32993
|
|
|
32932
32994
|
// dist/builtin/subagents/src/tui/render-result-compact.ts
|
|
32933
32995
|
var RUNNING_BLOCK_RECENT_TOOLS = 3;
|
|
32934
|
-
function renderSingleCompact(d, r, theme, now
|
|
32996
|
+
function renderSingleCompact(d, r, theme, now) {
|
|
32935
32997
|
return {
|
|
32936
32998
|
render(width) {
|
|
32937
32999
|
if (width < 1)
|
|
32938
33000
|
return [];
|
|
32939
|
-
return renderSingleCompactAtWidth(d, r, theme, Math.floor(width), now
|
|
33001
|
+
return renderSingleCompactAtWidth(d, r, theme, Math.floor(width), now).render(width);
|
|
32940
33002
|
},
|
|
32941
33003
|
invalidate() {}
|
|
32942
33004
|
};
|
|
32943
33005
|
}
|
|
32944
|
-
function renderSingleCompactAtWidth(_d, r, theme, width, now
|
|
33006
|
+
function renderSingleCompactAtWidth(_d, r, theme, width, now) {
|
|
32945
33007
|
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
32946
33008
|
const progress = r.progress || r.progressSummary;
|
|
32947
33009
|
const isRunning = r.progress?.status === "running";
|
|
32948
33010
|
const c = new Container;
|
|
32949
|
-
const glyph = resultGlyph(r, output, theme, isRunning
|
|
33011
|
+
const glyph = resultGlyph(r, output, theme, isRunning);
|
|
32950
33012
|
if (isRunning && r.progress) {
|
|
32951
33013
|
const hasCurrentTool = Boolean(r.progress.currentTool);
|
|
32952
33014
|
const recentLimit = RUNNING_BLOCK_RECENT_TOOLS - (hasCurrentTool ? 1 : 0);
|
|
@@ -32983,7 +33045,7 @@ function renderSingleCompactAtWidth(_d, r, theme, width, now, pulseFrame) {
|
|
|
32983
33045
|
const outcome = finished ? "finished" : resultStatusLine(r, output).toLowerCase();
|
|
32984
33046
|
const durationMs = progress ? displayProgressDurationMs(progress, now) : 0;
|
|
32985
33047
|
const stats = durationMs > 0 ? theme.fg("dim", formatDuration(durationMs)) : "";
|
|
32986
|
-
const outcomeGlyph = finished ? theme
|
|
33048
|
+
const outcomeGlyph = finished ? markText(theme, TASK_MARKS2.done) : glyph;
|
|
32987
33049
|
c.addChild(new Text(truncLine(`${outcomeGlyph} ${theme.fg("toolTitle", themeBold(theme, r.agent))} ${theme.fg("dim", outcome)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
32988
33050
|
const headline = firstOutputLine(output);
|
|
32989
33051
|
const showHeadline = headline && r.status === "ok" && !hasEmptyTextOutputWithoutOutputTarget(r.task, output);
|
|
@@ -32997,11 +33059,12 @@ function renderSingleCompactAtWidth(_d, r, theme, width, now, pulseFrame) {
|
|
|
32997
33059
|
c.addChild(new Text(truncLine(theme.fg("dim", ` full output: ${shortenPath(r.truncation.artifactPath)}`), width), 0, 0));
|
|
32998
33060
|
return c;
|
|
32999
33061
|
}
|
|
33000
|
-
function renderMultiCompact(d, theme, now
|
|
33062
|
+
function renderMultiCompact(d, theme, now) {
|
|
33001
33063
|
const hasRunning = d.progress?.some((p) => p.status === "running") || d.results.some((r) => r.progress?.status === "running");
|
|
33002
33064
|
const failed = d.results.some((r) => r.status === "error" && r.progress?.status !== "running");
|
|
33003
33065
|
const hasKilled = d.results.some((r) => r.status === "killed" && r.progress?.status !== "running");
|
|
33004
|
-
const
|
|
33066
|
+
const interrupted = d.results.some((r) => (r.interrupted || r.status === "interrupted" || r.status === "skipped") && r.progress?.status !== "running");
|
|
33067
|
+
const continued = d.results.some((r) => (r.detached || r.status === "continued") && r.progress?.status !== "running");
|
|
33005
33068
|
let totalSummary = d.progressSummary;
|
|
33006
33069
|
if (!totalSummary) {
|
|
33007
33070
|
let sawProgress = false;
|
|
@@ -33025,7 +33088,7 @@ function renderMultiCompact(d, theme, now, pulseFrame) {
|
|
|
33025
33088
|
!hasRunning && hasKilled ? theme.fg("warning", "killed (non-resumable)") : "",
|
|
33026
33089
|
formatProgressStats(theme, totalSummary, true, now)
|
|
33027
33090
|
]);
|
|
33028
|
-
const glyph = hasRunning ?
|
|
33091
|
+
const glyph = markText(theme, hasRunning ? TASK_MARKS2.running : failed ? TASK_MARKS2.failed : hasKilled || interrupted ? TASK_MARKS2.stopped : continued ? TASK_MARKS2.running : TASK_MARKS2.done);
|
|
33029
33092
|
const c = new Container;
|
|
33030
33093
|
const width = getTermWidth() - 4;
|
|
33031
33094
|
c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(d.mode))}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
@@ -33057,7 +33120,7 @@ function renderMultiCompact(d, theme, now, pulseFrame) {
|
|
|
33057
33120
|
if (runningProg) {
|
|
33058
33121
|
const runningStats = formatProgressStats(theme, runningProg, true, now);
|
|
33059
33122
|
const runningBadge = modelThinkingBadge(theme, runningProg.model, runningProg.thinking);
|
|
33060
|
-
const runningLine = `${theme
|
|
33123
|
+
const runningLine = `${markText(theme, TASK_MARKS2.running)} ${rowLabel}: ${themeBold(theme, agentName)}${runningBadge}${runningStats ? ` ${theme.fg("dim", "·")} ${runningStats}` : ""}`;
|
|
33061
33124
|
c.addChild(new Text(truncLine(` ${runningLine}`, width), 0, 0));
|
|
33062
33125
|
const activity = compactCurrentActivity(runningProg, now);
|
|
33063
33126
|
c.addChild(new Text(truncLine(theme.fg("dim", ` ⎿ ${activity}`), width), 0, 0));
|
|
@@ -33068,7 +33131,7 @@ function renderMultiCompact(d, theme, now, pulseFrame) {
|
|
|
33068
33131
|
}
|
|
33069
33132
|
continue;
|
|
33070
33133
|
}
|
|
33071
|
-
c.addChild(new Text(truncLine(theme.fg("dim",
|
|
33134
|
+
c.addChild(new Text(truncLine(` ${markText(theme, TASK_MARKS2.queued)} ${theme.fg("dim", `${rowLabel}: ${agentName} · pending`)}`, width), 0, 0));
|
|
33072
33135
|
continue;
|
|
33073
33136
|
}
|
|
33074
33137
|
const output = getSingleResultOutput(r);
|
|
@@ -33079,7 +33142,7 @@ function renderMultiCompact(d, theme, now, pulseFrame) {
|
|
|
33079
33142
|
const stepNumber = r.progress?.index !== undefined ? r.progress.index + 1 : progressFromArray?.index !== undefined ? progressFromArray.index + 1 : i + 1;
|
|
33080
33143
|
const stepStats = formatProgressStats(theme, rProg, true, now);
|
|
33081
33144
|
const modelDisplay = modelThinkingBadge(theme, r.model ?? rProg?.model, r.thinking ?? rProg?.thinking);
|
|
33082
|
-
const glyph = rPending ? theme
|
|
33145
|
+
const glyph = rPending ? markText(theme, TASK_MARKS2.queued) : resultGlyph(r, output, theme, rRunning);
|
|
33083
33146
|
const pendingLabel = rPending ? ` ${theme.fg("dim", "· pending")}` : "";
|
|
33084
33147
|
const stepLabel = resultRowLabel(d, multiLabel, i, stepNumber);
|
|
33085
33148
|
const line = `${glyph} ${stepLabel}: ${themeBold(theme, agentName)}${modelDisplay}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}${pendingLabel}`;
|
|
@@ -33157,23 +33220,23 @@ function subagentResultRenderKey(result, options) {
|
|
|
33157
33220
|
}
|
|
33158
33221
|
|
|
33159
33222
|
// dist/builtin/subagents/src/tui/render-status.ts
|
|
33160
|
-
import { keyHintIfBound as keyHintIfBound2 } from "@bastani/atomic";
|
|
33223
|
+
import { keyHintIfBound as keyHintIfBound2, TASK_MARKS as TASK_MARKS3 } from "@bastani/atomic";
|
|
33161
33224
|
var COMPACT_CHILD_LIMIT = 6;
|
|
33162
33225
|
var statusStyles = {
|
|
33163
|
-
pending: {
|
|
33164
|
-
running: {
|
|
33165
|
-
ok: {
|
|
33166
|
-
error: {
|
|
33167
|
-
interrupted: {
|
|
33168
|
-
killed: {
|
|
33169
|
-
continued: {
|
|
33226
|
+
pending: { mark: TASK_MARKS3.queued, label: "Pending", color: "dim" },
|
|
33227
|
+
running: { mark: TASK_MARKS3.running, label: "Running", color: "accent" },
|
|
33228
|
+
ok: { mark: TASK_MARKS3.done, label: "Completed", color: "success" },
|
|
33229
|
+
error: { mark: TASK_MARKS3.failed, label: "Failed", color: "error" },
|
|
33230
|
+
interrupted: { mark: TASK_MARKS3.stopped, label: "Interrupted", color: "warning" },
|
|
33231
|
+
killed: { mark: TASK_MARKS3.stopped, label: "Killed (non-resumable)", color: "warning" },
|
|
33232
|
+
continued: { mark: TASK_MARKS3.running, label: "Continued", color: "warning" }
|
|
33170
33233
|
};
|
|
33171
33234
|
var displayText = (value) => stripTerminalSequences(value).replace(/[\x00-\x1f\x7f-\x9f]/g, " ");
|
|
33172
33235
|
function childStatusLines(child, expanded, theme, width) {
|
|
33173
33236
|
const style = statusStyles[child.status];
|
|
33174
33237
|
const name = displayText(child.path.split("/").at(-1) || child.taskName);
|
|
33175
33238
|
const label = expanded ? name : displayText(truncateToWidth(name, Math.max(1, width - visibleWidth(style.label) - 5), "…"));
|
|
33176
|
-
const heading = `${theme.fg(style.color, style.glyph)} ${theme.fg("toolTitle", theme.bold(label))}${theme.fg("dim", " · ")}${theme.fg(style.color, style.label)}`;
|
|
33239
|
+
const heading = `${theme.fg(style.mark.color, style.mark.glyph)} ${theme.fg("toolTitle", theme.bold(label))}${theme.fg("dim", " · ")}${theme.fg(style.color, style.label)}`;
|
|
33177
33240
|
const model = formatModelThinking(child.model, child.thinking);
|
|
33178
33241
|
const metadata = model ? [theme.fg("dim", ` ${displayText(model)}`)] : [];
|
|
33179
33242
|
if (!expanded)
|
|
@@ -33244,16 +33307,10 @@ function renderLiveSubagentResult(result, options, theme, context) {
|
|
|
33244
33307
|
if (context.state.subagentResultSnapshotKey !== nextKey) {
|
|
33245
33308
|
context.state.subagentResultSnapshotKey = nextKey;
|
|
33246
33309
|
context.state.subagentResultSnapshotNow = Date.now();
|
|
33247
|
-
context.state.subagentResultPulseFrame = advanceResultPulseFrame(context.state.subagentResultPulseFrame);
|
|
33248
33310
|
}
|
|
33249
33311
|
context.state.subagentResultSnapshotNow ??= Date.now();
|
|
33250
|
-
context.state.subagentResultPulseFrame ??= 0;
|
|
33251
33312
|
clearResultAnimationTimer(context);
|
|
33252
|
-
return renderSubagentResult(result, {
|
|
33253
|
-
...options,
|
|
33254
|
-
now: context.state.subagentResultSnapshotNow,
|
|
33255
|
-
pulseFrame: context.state.subagentResultPulseFrame
|
|
33256
|
-
}, theme);
|
|
33313
|
+
return renderSubagentResult(result, { ...options, now: context.state.subagentResultSnapshotNow }, theme);
|
|
33257
33314
|
}
|
|
33258
33315
|
function renderSubagentResult(result, options, theme) {
|
|
33259
33316
|
const d = result.details;
|
|
@@ -33271,7 +33328,7 @@ function renderSubagentResult(result, options, theme) {
|
|
|
33271
33328
|
if (d.mode === "single" && d.results.length === 1) {
|
|
33272
33329
|
const r = d.results[0];
|
|
33273
33330
|
if (!expanded)
|
|
33274
|
-
return appendParentAskOutput(renderSingleCompact(d, r, theme, options.now
|
|
33331
|
+
return appendParentAskOutput(renderSingleCompact(d, r, theme, options.now), handoffOutput, theme);
|
|
33275
33332
|
const isRunning = r.progress?.status === "running";
|
|
33276
33333
|
const icon = isRunning ? theme.fg("warning", "running") : d.parentAskYielded ? theme.fg("warning", "yielded") : r.detached || r.status === "continued" ? theme.fg("warning", "detached") : r.status === "killed" ? theme.fg("warning", "killed (non-resumable)") : isParentCancellation(r.cause) && (r.interrupted || r.status === "interrupted") ? theme.fg("warning", "cancelled") : r.status === "ok" ? theme.fg("success", "ok") : theme.fg("error", "failed");
|
|
33277
33334
|
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
@@ -33343,7 +33400,7 @@ function renderSubagentResult(result, options, theme) {
|
|
|
33343
33400
|
return appendParentAskOutput(c, handoffOutput, theme);
|
|
33344
33401
|
}
|
|
33345
33402
|
if (!expanded)
|
|
33346
|
-
return appendParentAskOutput(renderMultiCompact(d, theme, options.now
|
|
33403
|
+
return appendParentAskOutput(renderMultiCompact(d, theme, options.now), handoffOutput, theme);
|
|
33347
33404
|
const hasRunning = d.progress?.some((p) => p.status === "running") || d.results.some((r) => r.progress?.status === "running");
|
|
33348
33405
|
const ok = d.results.filter((r) => r.progress?.status === "completed" || r.status === "ok" && r.progress?.status !== "running").length;
|
|
33349
33406
|
const hasEmptyWithoutTarget = d.results.some((r) => r.status === "ok" && r.progress?.status !== "running" && hasEmptyTextOutputWithoutOutputTarget(r.task, getSingleResultOutput(r)));
|
|
@@ -33845,6 +33902,7 @@ import {
|
|
|
33845
33902
|
navEntryKeys,
|
|
33846
33903
|
slashCommandHint as slashCommandHint2,
|
|
33847
33904
|
spanElapsedMs as spanElapsedMs6,
|
|
33905
|
+
TASK_MARKS as TASK_MARKS4,
|
|
33848
33906
|
ToolBlock,
|
|
33849
33907
|
ToolBlockGroup,
|
|
33850
33908
|
ToolBlockMarkdown,
|
|
@@ -33963,6 +34021,9 @@ class OneLine {
|
|
|
33963
34021
|
constructor(text) {
|
|
33964
34022
|
this.text = text;
|
|
33965
34023
|
}
|
|
34024
|
+
isWorking() {
|
|
34025
|
+
return typeof this.text === "function";
|
|
34026
|
+
}
|
|
33966
34027
|
invalidate() {}
|
|
33967
34028
|
render(width) {
|
|
33968
34029
|
return width < 1 ? [] : [truncateToWidth(typeof this.text === "string" ? this.text : this.text(), width, "…")];
|
|
@@ -34350,7 +34411,7 @@ function buildExpandedDetails(input) {
|
|
|
34350
34411
|
cacheId,
|
|
34351
34412
|
hydratedRef,
|
|
34352
34413
|
statusLine,
|
|
34353
|
-
|
|
34414
|
+
running,
|
|
34354
34415
|
promptText,
|
|
34355
34416
|
buildToolBlocks,
|
|
34356
34417
|
toolCallsUnavailable,
|
|
@@ -34359,7 +34420,7 @@ function buildExpandedDetails(input) {
|
|
|
34359
34420
|
theme
|
|
34360
34421
|
} = input;
|
|
34361
34422
|
const cleanPrompt = unwrapSubagentPrompt(promptText);
|
|
34362
|
-
const runningKey =
|
|
34423
|
+
const runningKey = running ? "1" : "0";
|
|
34363
34424
|
const key = `${runningKey}\x00${cleanPrompt}\x00${toolCallsUnavailable ?? ""}\x00${resultText ?? ""}\x00${failureText ?? ""}`;
|
|
34364
34425
|
if (state && cacheId) {
|
|
34365
34426
|
let cache = expandedSectionCaches.get(state);
|
|
@@ -34375,7 +34436,7 @@ function buildExpandedDetails(input) {
|
|
|
34375
34436
|
const sections = [
|
|
34376
34437
|
new SectionRecord(theme.bold("Prompt"), cleanPrompt ? new ToolBlockMarkdown(cleanPrompt) : new Text(theme.fg("dim", "(none)"), 0, 0)),
|
|
34377
34438
|
new SectionRecord(theme.bold("Tool calls"), toolBlocks.length > 0 ? new ComponentList(toolBlocks) : new Text(theme.fg("dim", toolCallsUnavailable || "(none)"), 0, 0)),
|
|
34378
|
-
new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim",
|
|
34439
|
+
new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim", running ? "Running…" : "(no output)"), 0, 0))
|
|
34379
34440
|
];
|
|
34380
34441
|
cache.set(cacheId, { key, hydratedRef, sections });
|
|
34381
34442
|
return new ToolBlockRecords([new OneLine(statusLine), ...sections]);
|
|
@@ -34385,7 +34446,7 @@ function buildExpandedDetails(input) {
|
|
|
34385
34446
|
new OneLine(statusLine),
|
|
34386
34447
|
new SectionRecord(theme.bold("Prompt"), cleanPrompt ? new ToolBlockMarkdown(cleanPrompt) : new Text(theme.fg("dim", "(none)"), 0, 0)),
|
|
34387
34448
|
new SectionRecord(theme.bold("Tool calls"), toolBlocks.length > 0 ? new ComponentList(toolBlocks) : new Text(theme.fg("dim", toolCallsUnavailable || "(none)"), 0, 0)),
|
|
34388
|
-
new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim",
|
|
34449
|
+
new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim", running ? "Running…" : "(no output)"), 0, 0))
|
|
34389
34450
|
]);
|
|
34390
34451
|
}
|
|
34391
34452
|
function waitingText(tools) {
|
|
@@ -34419,7 +34480,7 @@ function buildOutcomeToolBlock(input) {
|
|
|
34419
34480
|
} : undefined,
|
|
34420
34481
|
details: expanded ? buildExpandedDetails({
|
|
34421
34482
|
statusLine,
|
|
34422
|
-
|
|
34483
|
+
running: false,
|
|
34423
34484
|
promptText,
|
|
34424
34485
|
buildToolBlocks: () => [],
|
|
34425
34486
|
failureText: outcome.reason.error.message,
|
|
@@ -34431,12 +34492,12 @@ function buildOutcomeToolBlock(input) {
|
|
|
34431
34492
|
}
|
|
34432
34493
|
const statusLine = statJoin(theme, ["Stopped"]);
|
|
34433
34494
|
const block = new ToolBlock({
|
|
34434
|
-
status: "stopped",
|
|
34495
|
+
status: "task-stopped",
|
|
34435
34496
|
title: "Agent",
|
|
34436
34497
|
args,
|
|
34437
34498
|
details: expanded ? buildExpandedDetails({
|
|
34438
34499
|
statusLine,
|
|
34439
|
-
|
|
34500
|
+
running: false,
|
|
34440
34501
|
promptText,
|
|
34441
34502
|
buildToolBlocks: () => [],
|
|
34442
34503
|
theme
|
|
@@ -34474,7 +34535,7 @@ function buildOutcomeToolBlock(input) {
|
|
|
34474
34535
|
let status;
|
|
34475
34536
|
let statusLine;
|
|
34476
34537
|
if (task?.attention.kind === "input-needed") {
|
|
34477
|
-
status = "
|
|
34538
|
+
status = "input";
|
|
34478
34539
|
const questionFirstLine = firstDisplayLine(task.attention.prompt || "");
|
|
34479
34540
|
const answerKey = navEntryKeys(getKeybindings(), { action: "app.agents.focus", label: "to answer" });
|
|
34480
34541
|
statusLine = statJoin(theme, [
|
|
@@ -34497,15 +34558,15 @@ function buildOutcomeToolBlock(input) {
|
|
|
34497
34558
|
status = "waiting";
|
|
34498
34559
|
statusLine = statJoin(theme, [waitingText(releasedWaitingTools(taskSettled)), elapsedText]);
|
|
34499
34560
|
} else if (subagentTaskResultLabel(taskSettled) === "paused · awaiting resume") {
|
|
34500
|
-
status = "
|
|
34561
|
+
status = "task-stopped";
|
|
34501
34562
|
statusLine = statJoin(theme, ["Paused · awaiting resume", elapsedText]);
|
|
34502
34563
|
} else {
|
|
34503
|
-
status = "stopped";
|
|
34564
|
+
status = "task-stopped";
|
|
34504
34565
|
statusLine = statJoin(theme, ["Stopped", elapsedText]);
|
|
34505
34566
|
}
|
|
34506
34567
|
} else if (record) {
|
|
34507
34568
|
if (record.state === "running") {
|
|
34508
|
-
status = "running";
|
|
34569
|
+
status = "agent-running";
|
|
34509
34570
|
const manageKey = outcome.kind !== "sdk-handoff" && hasPanelRow(task, observation) ? navEntryKeys(getKeybindings(), { action: "app.agents.focus", label: "to manage" }) : "";
|
|
34510
34571
|
statusLine = statJoin(theme, [
|
|
34511
34572
|
"Running",
|
|
@@ -34523,7 +34584,7 @@ function buildOutcomeToolBlock(input) {
|
|
|
34523
34584
|
const reason = firstDisplayLine(failure ?? (terminal === SUBAGENT_CHILD_GONE_STATUS ? "gone after a restart" : ""));
|
|
34524
34585
|
statusLine = theme.fg("error", ["Failed", elapsedText, reason].filter(Boolean).join(" · "));
|
|
34525
34586
|
} else if (terminal === "paused" || terminal === "quit") {
|
|
34526
|
-
status = "
|
|
34587
|
+
status = "task-stopped";
|
|
34527
34588
|
const label = terminal === "quit" ? "Quit · paused · awaiting resume" : "Paused · awaiting resume";
|
|
34528
34589
|
statusLine = statJoin(theme, [label, elapsedText]);
|
|
34529
34590
|
} else if (terminal === SUBAGENT_CHILD_RELEASED_STATUS) {
|
|
@@ -34533,12 +34594,12 @@ function buildOutcomeToolBlock(input) {
|
|
|
34533
34594
|
elapsedText
|
|
34534
34595
|
]);
|
|
34535
34596
|
} else {
|
|
34536
|
-
status = "stopped";
|
|
34597
|
+
status = "task-stopped";
|
|
34537
34598
|
statusLine = statJoin(theme, ["Stopped", elapsedText]);
|
|
34538
34599
|
}
|
|
34539
34600
|
}
|
|
34540
34601
|
} else if (observation.kind === "yielded") {
|
|
34541
|
-
status = "running";
|
|
34602
|
+
status = "agent-running";
|
|
34542
34603
|
const manageKey = hasPanelRow(task, observation) ? navEntryKeys(getKeybindings(), { action: "app.agents.focus", label: "to manage" }) : "";
|
|
34543
34604
|
statusLine = statJoin(theme, [
|
|
34544
34605
|
"Running",
|
|
@@ -34557,13 +34618,13 @@ function buildOutcomeToolBlock(input) {
|
|
|
34557
34618
|
status = "waiting";
|
|
34558
34619
|
statusLine = statJoin(theme, [waitingText(releasedWaitingTools(observation.result)), elapsedText]);
|
|
34559
34620
|
} else if (subagentTaskResultLabel(observation.result) === "paused · awaiting resume") {
|
|
34560
|
-
status = "
|
|
34621
|
+
status = "task-stopped";
|
|
34561
34622
|
statusLine = statJoin(theme, ["Paused · awaiting resume", elapsedText]);
|
|
34562
34623
|
} else {
|
|
34563
|
-
status = "stopped";
|
|
34624
|
+
status = "task-stopped";
|
|
34564
34625
|
statusLine = statJoin(theme, ["Stopped", elapsedText]);
|
|
34565
34626
|
}
|
|
34566
|
-
const working = status === "running";
|
|
34627
|
+
const working = status === "agent-running";
|
|
34567
34628
|
if (!expanded) {
|
|
34568
34629
|
return {
|
|
34569
34630
|
block: new ToolBlock({
|
|
@@ -34595,9 +34656,9 @@ function buildOutcomeToolBlock(input) {
|
|
|
34595
34656
|
cacheId: activeTaskId,
|
|
34596
34657
|
hydratedRef: hydrated?.toolCalls,
|
|
34597
34658
|
statusLine,
|
|
34598
|
-
|
|
34659
|
+
running: working,
|
|
34599
34660
|
promptText,
|
|
34600
|
-
buildToolBlocks: () => (hydrated?.toolCalls ?? []).map((entry) => innerToolBlockFromEntry(entry,
|
|
34661
|
+
buildToolBlocks: () => (hydrated?.toolCalls ?? []).map((entry) => innerToolBlockFromEntry(entry, working, theme, context)),
|
|
34601
34662
|
toolCallsUnavailable,
|
|
34602
34663
|
resultText,
|
|
34603
34664
|
failureText: failure,
|
|
@@ -34630,8 +34691,9 @@ function buildForegroundChildToolBlock(input) {
|
|
|
34630
34691
|
const output = child ? child.truncation?.text || getSingleResultOutput(child) : "";
|
|
34631
34692
|
let status;
|
|
34632
34693
|
let statusLine;
|
|
34694
|
+
let live = false;
|
|
34633
34695
|
if (taskRecord?.attention.kind === "input-needed") {
|
|
34634
|
-
status = "
|
|
34696
|
+
status = "input";
|
|
34635
34697
|
const questionFirstLine = firstDisplayLine(taskRecord.attention.prompt || "");
|
|
34636
34698
|
const answerKey = navEntryKeys(getKeybindings(), { action: "app.agents.focus", label: "to answer" });
|
|
34637
34699
|
statusLine = statJoin(theme, [
|
|
@@ -34643,7 +34705,8 @@ function buildForegroundChildToolBlock(input) {
|
|
|
34643
34705
|
status = "paused";
|
|
34644
34706
|
statusLine = statJoin(theme, ["Paused", elapsedText]);
|
|
34645
34707
|
} else if (isRunning) {
|
|
34646
|
-
status = "running";
|
|
34708
|
+
status = "agent-running";
|
|
34709
|
+
live = true;
|
|
34647
34710
|
const manageKey = hasPanelRow(taskRecord) ? navEntryKeys(getKeybindings(), { action: "app.agents.focus", label: "to manage" }) : "";
|
|
34648
34711
|
statusLine = () => {
|
|
34649
34712
|
const id = activeProgress?.taskId;
|
|
@@ -34657,14 +34720,17 @@ function buildForegroundChildToolBlock(input) {
|
|
|
34657
34720
|
]);
|
|
34658
34721
|
};
|
|
34659
34722
|
} else if (!child) {
|
|
34660
|
-
status = "stopped";
|
|
34723
|
+
status = "task-stopped";
|
|
34661
34724
|
statusLine = statJoin(theme, ["Stopped", elapsedText]);
|
|
34662
34725
|
} else if (child.status === "error") {
|
|
34663
34726
|
status = "failure";
|
|
34664
34727
|
const reason = firstDisplayLine(child.error ?? (firstOutputLine(output) || "failed"));
|
|
34665
34728
|
statusLine = theme.fg("error", ["Failed", elapsedText, reason].filter(Boolean).join(" · "));
|
|
34666
|
-
} else if (child.detached || child.
|
|
34667
|
-
status = "
|
|
34729
|
+
} else if (child.detached || child.status === "continued") {
|
|
34730
|
+
status = "agent-running";
|
|
34731
|
+
statusLine = statJoin(theme, ["Continued", elapsedText]);
|
|
34732
|
+
} else if (child.interrupted || child.status === "killed" || child.status === "interrupted" || child.status === "skipped") {
|
|
34733
|
+
status = "task-stopped";
|
|
34668
34734
|
statusLine = statJoin(theme, ["Stopped", elapsedText]);
|
|
34669
34735
|
} else {
|
|
34670
34736
|
status = "success";
|
|
@@ -34680,14 +34746,14 @@ function buildForegroundChildToolBlock(input) {
|
|
|
34680
34746
|
});
|
|
34681
34747
|
}
|
|
34682
34748
|
const messageEntries = toolEntriesFromMessages(child?.messages);
|
|
34683
|
-
const toolBlocks = messageEntries.length > 0 ? messageEntries.map((entry) => innerToolBlockFromEntry(entry,
|
|
34749
|
+
const toolBlocks = messageEntries.length > 0 ? messageEntries.map((entry) => innerToolBlockFromEntry(entry, live, theme, context)) : toolBlocksFromSummaries(child?.toolCalls, activeProgress);
|
|
34684
34750
|
return new ToolBlock({
|
|
34685
34751
|
status,
|
|
34686
34752
|
title: "Agent",
|
|
34687
34753
|
args,
|
|
34688
34754
|
details: buildExpandedDetails({
|
|
34689
34755
|
statusLine,
|
|
34690
|
-
|
|
34756
|
+
running: live,
|
|
34691
34757
|
promptText: rawTask,
|
|
34692
34758
|
buildToolBlocks: () => toolBlocks,
|
|
34693
34759
|
resultText: output || undefined,
|
|
@@ -34754,7 +34820,9 @@ function renderSubagentToolResult(result, options, theme, context) {
|
|
|
34754
34820
|
if (failed || runControl.children.length === 0)
|
|
34755
34821
|
return new Text(theme.fg(failed ? "error" : "dim", `${failed ? "✗ " : ""}${displayText2(text?.type === "text" ? text.text : "")}`), 0, 0);
|
|
34756
34822
|
const lines = runControl.children.map((child) => {
|
|
34757
|
-
const
|
|
34823
|
+
const mark = child.state === "running" || child.state === "finishing" ? TASK_MARKS4.running : TASK_MARKS4.stopped;
|
|
34824
|
+
const words = child.state === "running" ? theme.fg("success", `Resumed · ${displayText2(child.agent)}`) : theme.fg("muted", `${child.state === "finishing" ? "Finishing worktree cleanup" : child.state === "paused" ? "Paused" : "Quit (resumable)"} · ${displayText2(child.agent)}`);
|
|
34825
|
+
const state = `${theme.fg(mark.color, mark.glyph)} ${words}`;
|
|
34758
34826
|
const identity = theme.fg("dim", `
|
|
34759
34827
|
${displayText2(child.childId)}${child.intercomTarget ? ` · ${displayText2(child.intercomTarget)}` : ""}${options.expanded && child.taskId ? ` · ${displayText2(child.taskId)}` : ""}`);
|
|
34760
34828
|
return `${state}${identity}${child.state === "running" ? theme.fg("dim", `
|
|
@@ -35146,14 +35214,12 @@ function createSlashResultComponent(details, options, theme, owner) {
|
|
|
35146
35214
|
const container = new Container;
|
|
35147
35215
|
let lastVersion = -1;
|
|
35148
35216
|
let lastSnapshotNow = 0;
|
|
35149
|
-
let pulseFrame = 0;
|
|
35150
35217
|
container.render = (width) => {
|
|
35151
35218
|
const snapshot = getSlashRenderableSnapshot(details, owner);
|
|
35152
35219
|
if (snapshot.version !== lastVersion) {
|
|
35153
35220
|
lastVersion = snapshot.version;
|
|
35154
35221
|
lastSnapshotNow = Date.now();
|
|
35155
|
-
|
|
35156
|
-
rebuildSlashResultContainer(container, snapshot.result, { ...options, now: lastSnapshotNow, pulseFrame }, theme);
|
|
35222
|
+
rebuildSlashResultContainer(container, snapshot.result, { ...options, now: lastSnapshotNow }, theme);
|
|
35157
35223
|
}
|
|
35158
35224
|
return Container.prototype.render.call(container, width);
|
|
35159
35225
|
};
|
|
@@ -35167,7 +35233,7 @@ function renderSubagentNotification(message, options, theme) {
|
|
|
35167
35233
|
const details = message.details ?? parseSubagentNotifyContent(content);
|
|
35168
35234
|
if (!details)
|
|
35169
35235
|
return new Text(content, 0, 0);
|
|
35170
|
-
const status = details.status === "completed" ? "success" : details.status === "interrupted" || details.status === "killed" ? "stopped" : "failure";
|
|
35236
|
+
const status = details.status === "completed" ? "success" : details.status === "interrupted" || details.status === "killed" ? "task-stopped" : "failure";
|
|
35171
35237
|
const meta = [];
|
|
35172
35238
|
if (details.taskInfo)
|
|
35173
35239
|
meta.push(details.taskInfo);
|