@bastani/atomic 0.10.0 → 0.10.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 +98 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +12 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +33 -3
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +21 -6
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/lifecycle-timings.d.ts +6 -0
- package/dist/core/lifecycle-timings.d.ts.map +1 -1
- package/dist/core/lifecycle-timings.js +12 -0
- package/dist/core/lifecycle-timings.js.map +1 -1
- package/dist/core/queued-message-delivery.d.ts +41 -0
- package/dist/core/queued-message-delivery.d.ts.map +1 -0
- package/dist/core/queued-message-delivery.js +48 -0
- package/dist/core/queued-message-delivery.js.map +1 -0
- package/dist/core/storage/node-sqlite-thread.d.ts +64 -0
- package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -0
- package/dist/core/storage/node-sqlite-thread.js +326 -0
- package/dist/core/storage/node-sqlite-thread.js.map +1 -0
- package/dist/core/storage/node-sqlite.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite.js +230 -104
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/tasks/agent-panel-source.d.ts +5 -0
- package/dist/core/tasks/agent-panel-source.d.ts.map +1 -1
- package/dist/core/tasks/agent-panel-source.js +1 -1
- package/dist/core/tasks/agent-panel-source.js.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +8 -1
- 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 +11 -5
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/agent-view-switcher.js +17 -5
- package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +5 -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 +6 -3
- package/dist/modes/interactive/agent-view/install.js.map +1 -1
- package/dist/modes/interactive/agent-view/local-port.d.ts +5 -0
- package/dist/modes/interactive/agent-view/local-port.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/local-port.js +8 -0
- package/dist/modes/interactive/agent-view/local-port.js.map +1 -1
- package/dist/modes/interactive/agent-view/remote-port.d.ts +4 -1
- package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/remote-port.js +22 -8
- package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
- package/dist/modes/interactive/agent-view/transcript-slot.d.ts +9 -0
- package/dist/modes/interactive/agent-view/transcript-slot.d.ts.map +1 -1
- package/dist/modes/interactive/agent-view/transcript-slot.js +141 -1
- package/dist/modes/interactive/agent-view/transcript-slot.js.map +1 -1
- package/dist/modes/interactive/components/agent-panel.d.ts +6 -0
- package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/agent-panel.js +40 -10
- package/dist/modes/interactive/components/agent-panel.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.d.ts +15 -0
- package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.js +51 -3
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +5 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +17 -6
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +35 -4
- package/dist/modes/interactive/components/chat-session-host-events.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 +70 -13
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +7 -0
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.js +25 -4
- package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +41 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +24 -3
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-steering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-steering.js +2 -1
- package/dist/modes/interactive/components/chat-session-host-steering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +13 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +20 -2
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts +15 -0
- package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.js +14 -1
- package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +5 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +2 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +5 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +2 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +5 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/model-column.d.ts +96 -0
- package/dist/modes/interactive/components/model-column.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-column.js +207 -0
- package/dist/modes/interactive/components/model-column.js.map +1 -0
- package/dist/modes/interactive/components/prompt-slot.d.ts +73 -0
- package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -0
- package/dist/modes/interactive/components/prompt-slot.js +201 -0
- package/dist/modes/interactive/components/prompt-slot.js.map +1 -0
- package/dist/modes/interactive/components/queued-messages-view.d.ts +6 -3
- package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/queued-messages-view.js +7 -4
- package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +4 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/task-board.d.ts +12 -3
- package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-board.js +33 -17
- package/dist/modes/interactive/components/task-board.js.map +1 -1
- package/dist/modes/interactive/components/task-inspector.d.ts +6 -1
- package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-inspector.js +27 -7
- package/dist/modes/interactive/components/task-inspector.js.map +1 -1
- package/dist/modes/interactive/components/task-row.d.ts +4 -0
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-row.js +7 -1
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.d.ts +5 -0
- package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-transcript-page.js +25 -0
- package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +7 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +19 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-group-tracker.d.ts +20 -3
- package/dist/modes/interactive/components/tool-group-tracker.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-group-tracker.js +34 -7
- package/dist/modes/interactive/components/tool-group-tracker.js.map +1 -1
- package/dist/modes/interactive/components/transcript-block-clicks.d.ts +14 -2
- package/dist/modes/interactive/components/transcript-block-clicks.d.ts.map +1 -1
- package/dist/modes/interactive/components/transcript-block-clicks.js +23 -2
- package/dist/modes/interactive/components/transcript-block-clicks.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +10 -2
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.d.ts +12 -1
- package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +37 -5
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +70 -46
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +7 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.js +17 -9
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +2 -1
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts +18 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +90 -10
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +2 -0
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-task-projection.js +2 -2
- package/dist/modes/interactive/interactive-task-projection.js.map +1 -1
- package/dist/modes/interactive/screen-hold.d.ts +41 -0
- package/dist/modes/interactive/screen-hold.d.ts.map +1 -0
- package/dist/modes/interactive/screen-hold.js +80 -0
- package/dist/modes/interactive/screen-hold.js.map +1 -0
- package/dist/modes/interactive/started-run-echo.d.ts +66 -0
- package/dist/modes/interactive/started-run-echo.d.ts.map +1 -0
- package/dist/modes/interactive/started-run-echo.js +75 -0
- package/dist/modes/interactive/started-run-echo.js.map +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +25 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.js +3 -0
- package/dist/modes/interactive-engine/engine-quit-intent.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 +7 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +10 -2
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +19 -2
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts +10 -0
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +24 -4
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/interactive-engine/transcript-frame-layout.d.ts +50 -0
- package/dist/modes/interactive-engine/transcript-frame-layout.d.ts.map +1 -0
- package/dist/modes/interactive-engine/transcript-frame-layout.js +95 -0
- package/dist/modes/interactive-engine/transcript-frame-layout.js.map +1 -0
- package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
- package/dist/modes/rpc/agent-panel-bridge.js +16 -0
- package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
- package/dist/modes/rpc/agent-view-engine-registry.d.ts.map +1 -1
- package/dist/modes/rpc/agent-view-engine-registry.js +36 -1
- package/dist/modes/rpc/agent-view-engine-registry.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 +5 -1
- package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
- package/dist/modes/rpc/task-ui-bridge.js +1 -1
- package/dist/modes/rpc/task-ui-bridge.js.map +1 -1
- package/docs/background-tasks.md +1 -1
- package/docs/development.md +2 -0
- package/docs/extensions/authoring.md +1 -1
- package/docs/keybindings.md +2 -2
- package/docs/storage.md +1 -0
- package/npm-shrinkwrap.json +49 -49
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-transcript-page.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-transcript-page.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,IAAI,EAIJ,eAAe,EACf,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAmB,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAEN,gBAAgB,EAChB,aAAa,EACb,aAAa,GACb,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAOxH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EAInB,iBAAiB,GACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;A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AI,CAAC,IAAI,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO;QACN,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;IAED,WAAW,CAAC,IAAY;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,OAAO;YAAE,IAAI,CAAC,aAAa,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,QAAQ;QACP,OAAO,KAAK,CAAC;IACd,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC;IACb,CAAC;IAED,WAAW;QACV,OAAO,KAAK,CAAC;IACd,CAAC;IAED,aAAa;QACZ,OAAO,KAAK,CAAC;IACd,CAAC;IAED,KAAK,CAAC,SAAS;QACd,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,EAAE,CAAC;IACxF,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,IAAY;QACjC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACD","sourcesContent":["import {\n\tgetKeybindings,\n\tisHintActivation,\n\tmatchesKey,\n\tText,\n\ttype KeybindingsManager as TuiKeybindingsManager,\n\ttype TuiMouseEvent,\n\ttype TuiMouseEventResult,\n\ttruncateToWidth,\n\twrapTextWithAnsi,\n} from \"@bastani/atomic-tui\";\nimport { chatReceiptWrite } from \"../../../core/chat-receipts.js\";\nimport { type HeldPrompt, heldPrompts } from \"../../../core/extensions/held-prompts.ts\";\nimport type { ReadonlyFooterDataProvider } from \"../../../core/footer-data-provider.ts\";\nimport { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport type { CustomMessage } from \"../../../core/messages.ts\";\nimport { sessionWaitsToRetry } from \"../../../core/session-retry-status.js\";\nimport { shortTaskTitle } from \"../../../core/tasks/agent-panel-source.ts\";\nimport {\n\tlatestSubagentAttempt,\n\treleasedWaitingOn,\n\twaitingReleasedShells,\n\twaitingReleasedTools,\n} from \"../../../core/tasks/completion.js\";\nimport type { TaskId, TaskRecord } from \"../../../core/tasks/contracts.js\";\nimport {\n\ttype TaskElapsedClocks,\n\ttaskClockRunning,\n\ttaskClocksFor,\n\ttaskElapsedMs,\n} from \"../../../core/tasks/live-elapsed.js\";\nimport { getOwnerTaskSession, isTaskTurnInterrupted, setTaskTurnInterrupted } from \"../../../core/tasks/owner-store.js\";\nimport type {\n\tChatBoxSession,\n\tQueuedTaskMessages,\n\tTaskMessageLane,\n\tTaskTranscriptSource,\n} from \"../../../core/tasks/supervisor.js\";\nimport { observedTaskChatWrite, withTaskChatRows } from \"../../../core/tasks/task-chat-records.js\";\nimport {\n\tlaunchedTaskViewSource,\n\tliveTaskRowOrigin,\n\treadTaskPageForChat,\n\treadTaskPageForView,\n\tretainTaskWindowReader,\n\tsavedBoundaryCursor,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n\ttaskCursorsAround,\n} from \"../../../core/tasks/task-view-source.js\";\nimport { noteSavedSeq } from \"../../../core/tasks/transcript-origin.js\";\nimport { copyToClipboard } from \"../../../utils/clipboard.js\";\nimport { pauseAgent, resumeAgent, sendAgentMessage, takeAgentQueue } from \"../agent-view/agent-steering.ts\";\nimport type { AgentViewState, AgentViewStatus } from \"../agent-view/contracts.ts\";\nimport { combineQueuedMessagesForEditor } from \"../chat-input-actions.ts\";\nimport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSkillCatalogCommands,\n} from \"../skill-command-autocomplete.ts\";\nimport { subagentChatCommand, subagentChatUnavailableNotice } from \"../subagent-chat-commands.ts\";\nimport { theme } from \"../theme/theme.js\";\nimport { formatPanelElapsed } from \"./agent-panel.ts\";\nimport type { ChatSessionHost, SavedPageHandle } from \"./chat-session-host.ts\";\nimport type { SavedPageNeighbours } from \"./chat-session-host-saved-calls.ts\";\nimport type { ChatSteeringTarget } from \"./chat-session-host-steering.ts\";\nimport type { ChatSessionHostOpts, ChatSessionHostStyle } from \"./chat-session-host-types.ts\";\nimport { parseWheelReport, ScrollableComponentViewport } from \"./chat-transcript.js\";\nimport { type HeldPromptForm, heldPromptForm } from \"./held-prompt-form.ts\";\nimport { applyAttachedComposer } from \"./input-label.ts\";\nimport { clickableKeyTextHint, navActionText } from \"./nav-keys.ts\";\nimport type { ParkedTaskRows } from \"./parked-rows.ts\";\nimport { dismissedTasks } from \"./task-dismissal.ts\";\nimport { taskDisplayText, taskState } from \"./task-row.js\";\nimport { pagedNotices, TaskTranscriptNotices } from \"./task-transcript-notices.ts\";\nimport { retainedToolRenderer, unavailableToolRenderer } from \"./tool-renderer-scope.js\";\nimport { repaintAfterSingleClick } from \"./transcript-block-clicks.ts\";\nimport { TRANSCRIPT_JUMP_TO_END_URL } from \"./transcript-follow-indicator.ts\";\n\n/** Where a task's transcript view is mounted: the chat host it builds on and the render settings it inherits. */\nexport interface TaskTranscriptEnvironment {\n\tcreateChat(opts: ChatSessionHostOpts): ChatSessionHost;\n\treadonly tui?: ChatSessionHostOpts[\"tui\"];\n\treadonly keybindings?: unknown;\n\treadonly editorTheme: ChatSessionHostOpts[\"editorTheme\"];\n\treadonly editorFactory?: ChatSessionHostOpts[\"editorFactory\"];\n\treadonly style: ChatSessionHostStyle;\n\treadonly getChatRenderSettings?: ChatSessionHostOpts[\"getChatRenderSettings\"];\n\t/** What the transcript chat's footer reads of git and providers; without it the footer counts tasks only. */\n\treadonly footerData?: ChatSessionHostOpts[\"footerData\"];\n\treadonly getToolsExpanded?: () => boolean;\n\treadonly setToolsExpanded?: (expanded: boolean) => void;\n\t/** Tells the reader about a message that failed after they left its transcript and the task pages. */\n\treadonly notify?: (message: string) => void;\n}\n\n/** A message that failed after its reader left the transcript, kept for when they open it again. */\ninterface UndeliveredMessage {\n\treadonly text: string;\n\treadonly reason: string;\n}\n\n/** The last live frame is already complete. An archiving child must not replace it with a snapshot that\n * predates its last diagnostic. Only the view tracks these writes; it immediately releases the live child. */\nclass ObservedChatWrites {\n\tprivate count = 0;\n\tonIdle?: () => void;\n\tget pending(): boolean {\n\t\treturn this.count > 0;\n\t}\n\tobserve(write: Promise<void>): void {\n\t\tthis.count++;\n\t\tobserveChatWrite(write, new WeakRef(this));\n\t}\n\tsettle(): void {\n\t\tif (--this.count === 0) {\n\t\t\tconst ready = this.onIdle;\n\t\t\tthis.onIdle = undefined;\n\t\t\tready?.();\n\t\t}\n\t}\n}\nfunction observeChatWrite(write: Promise<void>, view: WeakRef<ObservedChatWrites>): void {\n\tvoid write.then(\n\t\t() => view.deref()?.settle(),\n\t\t() => view.deref()?.settle(),\n\t);\n}\n\nconst undeliveredMessages = new WeakMap<TaskViewSource, Map<TaskId, UndeliveredMessage>>();\n/** What the reader had typed in a task's chat when they left it, per chat, for when they come back. */\nconst keptDrafts = new WeakMap<TaskViewSource, Map<TaskId, string>>();\n/** What Up recalled in a task's chat when the reader left it, oldest first, for when they come back. */\nconst keptPromptHistories = new WeakMap<TaskViewSource, Map<TaskId, readonly string[]>>();\n\nfunction failureText(error: unknown): string {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\n/** What the task inspector shows under a task's title while its transcript is open. */\nexport interface TaskTranscriptPage {\n\t/** Loading, retention and failure notes for the page's footer. */\n\treadonly status: string;\n\tload(): Promise<void>;\n\t/** The task changed: follow its session again or read its latest page again. */\n\trefresh(): void;\n\thandleInput(data: string): boolean;\n\t/** Whether the reader is typing, so a key such as Left edits instead of leaving. */\n\thasDraft(): boolean;\n\thasTasks?(): boolean;\n\texpandable?(): boolean;\n\tcanSend?(): boolean;\n\t/** Whether the prompt's cursor is at its start, where ← leaves and keeps any draft for the return. */\n\tcursorAtStart(): boolean;\n\t/** Whether the page takes Escape and Left itself, as while its own task list is open. */\n\thandlesBack(): boolean;\n\ttakesEscape?(): boolean;\n\tcapturesPageScroll?(): boolean;\n\t/** Whether Esc would pause the task now: a turn runs or waits to retry, or messages are queued, as in the main chat. */\n\tinterruptible(): boolean;\n\t/**\n\t * Pauses the task, as Esc does: its queued messages come back to the prompt, steering first, ahead of the draft, and\n\t * its turn ends. The task keeps running, paused, and its next message continues it.\n\t */\n\tinterrupt(): Promise<TaskViewResult<undefined>>;\n\t/**\n\t * Put messages taken back from the task's queue into the prompt, steering messages first and then follow-ups, in\n\t * front of what is typed, as Alt+Up does. Answers how many came back.\n\t */\n\trestoreQueuedToEditor?(taken: QueuedTaskMessages): number;\n\trender(width: number, rows: number): string[];\n\t/** A single click at row `event.y` of the last frame `render` drew; a result when the page takes it. */\n\thandleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;\n\t/** What the last frame `render` drew on `row`, such as the transcript entry there; undefined when it cannot say. */\n\tpaintedRowKey?(row: number): string | undefined;\n\t/** Ctrl+O was pressed where the page is shown: its blocks follow the tool-output setting again. */\n\ttoolOutputToggled?(): void;\n\tinvalidate(): void;\n\tdispose(): void;\n}\n\n/** Atomic's global theme, as the shared chat host's style. */\nexport function themedChatHostStyle(): ChatSessionHostStyle {\n\treturn {\n\t\tdim: (text) => theme.fg(\"dim\", text),\n\t\ttext: (text) => theme.fg(\"text\", text),\n\t\ttextMuted: (text) => theme.fg(\"muted\", text),\n\t\taccent: (text) => theme.fg(\"accent\", text),\n\t\taccentBold: (text) => theme.bold(theme.fg(\"accent\", text)),\n\t\tworkingIndicatorUseGlobalTheme: true,\n\t\trule: (_hex, text) => theme.fg(\"borderMuted\", text),\n\t\tcursor: () => \"\\x1b[7m \\x1b[27m\",\n\t\tblank: (width) => \" \".repeat(Math.max(0, width)),\n\t\teditorRuleColor: () => \"\",\n\t};\n}\n\nfunction keybindingsOf(candidate: unknown): Pick<TuiKeybindingsManager, \"matches\"> {\n\tconst keybindings = candidate as Partial<Pick<TuiKeybindingsManager, \"matches\">> | undefined;\n\treturn typeof keybindings?.matches === \"function\"\n\t\t? (keybindings as Pick<TuiKeybindingsManager, \"matches\">)\n\t\t: getKeybindings();\n}\n\n/** The subagent's footer shows its own session: the extension statuses of the chat that opened it are not its own. */\nfunction withoutExtensionStatuses(data: ReadonlyFooterDataProvider): ReadonlyFooterDataProvider {\n\treturn {\n\t\tgetGitBranch: (cwd) => data.getGitBranch(cwd),\n\t\tgetAvailableProviderCount: () => data.getAvailableProviderCount(),\n\t\tonBranchChange: (callback, cwd) => data.onBranchChange(callback, cwd),\n\t\tgetExtensionStatuses: () => new Map(),\n\t};\n}\n\nfunction defaultUnnamedSessionAlias(sessionId: string): string {\n\tconst normalized = sessionId.startsWith(\"session-\") ? sessionId.slice(\"session-\".length) : sessionId;\n\treturn `subagent-chat-${normalized}`;\n}\n\nfunction friendlyOriginIntercomMessage(\n\tmessage: CustomMessage<unknown>,\n\towner: ChatBoxSession | undefined,\n): CustomMessage<unknown> {\n\tconst details = message.details as\n\t\t| {\n\t\t\t\treadonly from?: { readonly id?: string; readonly name?: string; readonly cwd?: string };\n\t\t }\n\t\t| undefined;\n\tif (!details?.from) return message;\n\tconst ownerSessionId = owner?.sessionManager?.getSessionId?.()?.trim();\n\tif (!ownerSessionId) return message;\n\tconst ownerAlias = defaultUnnamedSessionAlias(ownerSessionId);\n\tconst rawName = details.from.name?.trim() ?? \"\";\n\tconst matchesOwnerAlias = rawName === ownerAlias;\n\tconst matchesOwnerId =\n\t\tdetails.from.id === ownerSessionId && (rawName === \"\" || rawName === ownerSessionId || matchesOwnerAlias);\n\tif (!matchesOwnerAlias && !matchesOwnerId) {\n\t\treturn message;\n\t}\n\treturn {\n\t\t...message,\n\t\tdetails: {\n\t\t\t...(message.details as object),\n\t\t\tfrom: {\n\t\t\t\t...details.from,\n\t\t\t\tname: \"main\",\n\t\t\t},\n\t\t},\n\t};\n}\n\n/** A subagent stopped resumably (`x x`, Ctrl+X Ctrl+K): a message resumes it, and never anything else. */\nexport const STOPPED_NOTE = \"Stopped · send to resume\";\n/** A subagent paused from its chat (Esc): it is still running, and a message continues it. */\nexport const PAUSED_NOTE = \"Paused · send to continue\";\n\n/** A note under the transcript on the single chat screen: at most two rows, cut to the width. */\nfunction wrapViewNote(note: string, width: number): string[] {\n\tconst room = Math.max(1, width);\n\tconst rows = wrapTextWithAnsi(note, room);\n\tconst shown = rows.slice(0, 2).map((row) => truncateToWidth(row, room));\n\tif (rows.length > 2) shown[1] = truncateToWidth(`${rows[1]}…`, room);\n\treturn shown;\n}\n\nconst PAGE_UP = \"\\x1b[5~\";\nconst PAGE_DOWN = \"\\x1b[6~\";\n/** The screen's scroll keys the transcript's own viewport answers, besides the page keys, lines and the wheel. */\nconst VIEW_KEY_ACTIONS = [\n\t\"tui.altScreen.halfPageUp\",\n\t\"tui.altScreen.halfPageDown\",\n\t\"tui.altScreen.previousPrompt\",\n\t\"tui.altScreen.nextPrompt\",\n\t\"tui.altScreen.top\",\n\t\"tui.altScreen.bottom\",\n] as const;\n\n/** Printable text, Enter, Backspace or Delete: keys that type into or send the prompt. */\nfunction isTyping(data: string): boolean {\n\tif (matchesKey(data, \"enter\") || matchesKey(data, \"backspace\") || matchesKey(data, \"delete\")) return true;\n\treturn [...data].every((ch) => ch >= \" \" && ch !== \"\\x7f\");\n}\n\ninterface AdjacentRequest {\n\tedge: \"older\" | \"newer\";\n\tcursor: string;\n\tgeneration: number;\n\tcontroller: AbortController;\n\tsource?: WeakRef<TaskTranscriptSource>;\n}\nconst finishAdjacent = Symbol();\nfunction deliverAdjacent(\n\tweak: WeakRef<TaskAgentTranscriptPage>,\n\trequest: AdjacentRequest,\n\tread: TaskViewResult<TaskTranscriptView> | Promise<TaskViewResult<TaskTranscriptView>>,\n): void {\n\tvoid Promise.resolve(read).then(\n\t\t(page) => weak.deref()?.[finishAdjacent](request, page),\n\t\t(error) => weak.deref()?.[finishAdjacent](request, { ok: false, error: { message: failureText(error) } }),\n\t);\n}\n\n/**\n * An agent task's transcript on the shared chat host: it opens at the latest page, follows the task's live session\n * where it has one, loads earlier retained history as the reader nears the top, and sends what the reader types to\n * the task through its Intercom target.\n */\nexport class TaskAgentTranscriptPage implements TaskTranscriptPage {\n\tprivate readonly elapsedClocks: TaskElapsedClocks;\n\t/** How many rows the transcript took at the top of the last frame. */\n\tprivate bodyRows = 0;\n\treadonly chat: ChatSessionHost;\n\tprivate loadStatus = \"Loading transcript…\";\n\t/** Loading and failure notes, then why the chat is read-only when it is. */\n\tget status(): string {\n\t\treturn [this.loadStatus, this.releasedNote() ?? \"\", this.readOnlyReason() ?? \"\"].filter(Boolean).join(\" · \");\n\t}\n\t/**\n\t * What a subagent released while it waits waits on, that it wakes by itself, and the shells it launched that still\n\t * run, with the key that opens the newest one's output. Its transcript is its saved session, read without waking it.\n\t */\n\tprivate releasedNote(): string | undefined {\n\t\tconst task = this.liveTask();\n\t\tconst waitingOn =\n\t\t\ttask?.execution.kind === \"settled\" && waitingReleasedTools(task) !== undefined\n\t\t\t\t? releasedWaitingOn(task.execution.result)\n\t\t\t\t: undefined;\n\t\tif (task === undefined || waitingOn === undefined) return undefined;\n\t\tconst shells = waitingReleasedShells(task, this.source.ownerTasks ?? this.source.tasks);\n\t\tconst openKey = navActionText(getKeybindings(), \"app.tasks.openWaited\");\n\t\tconst opens = openKey ? clickableKeyTextHint(openKey, \" opens\") : \"/tasks opens\";\n\t\tconst shellNote =\n\t\t\tshells.length === 0\n\t\t\t\t? \"\"\n\t\t\t\t: shells.length === 1\n\t\t\t\t\t? ` · its shell ${taskDisplayText(shortTaskTitle(shells[0]!.title || \"shell\"))} is running · ${opens} it`\n\t\t\t\t\t: ` · ${shells.length} of its shells are running · ${opens} ${openKey ? \"the newest\" : \"them\"}`;\n\t\treturn `Waiting on ${taskDisplayText(waitingOn)} · wakes by itself when it finishes${shellNote}`;\n\t}\n\tset status(value: string) {\n\t\tthis.loadStatus = value;\n\t}\n\t/** Why messages cannot reach this task any more, or `undefined` while they can. */\n\treadOnlyReason(): string | undefined {\n\t\treturn this.source.taskReadOnlyReason?.(this.liveTaskId());\n\t}\n\tprivate readonly source: TaskViewSource;\n\t/**\n\t * The attempt whose transcript the page shows and follows. A resumed subagent runs as a new task in the same\n\t * conversation: the page moves to it on its next read, as the subagent's one row in the lists does.\n\t */\n\tprivate taskId: TaskId;\n\tprivate readonly env: TaskTranscriptEnvironment;\n\tprivate readonly requestRender: () => void;\n\tprivate followed?: TaskTranscriptSource;\n\tprivate followedSessionId?: string;\n\tprivate legacyWindow?: ReturnType<typeof retainTaskWindowReader>;\n\tprivate legacyWindowActive = false;\n\tprivate observedWrites?: ObservedChatWrites;\n\tprivate unsubscribe?: () => void;\n\tprivate cursor?: string;\n\tprivate newerCursor?: string;\n\tprivate liveHistoryStart?: string;\n\tprivate olderIntent = false;\n\t/** Which way the reader last scrolled: a live chat reads saved pages only that way, never both at once. */\n\tprivate travel: \"older\" | \"newer\" | undefined;\n\tprivate goToFirst = false;\n\tprivate windowGeneration = 0;\n\tprivate readonly savedPages: (SavedPageHandle & { older?: string; newer?: string })[] = [];\n\t/** Reads of the single saved entries next to the shown window; a new window or a closed view stops them. */\n\tprivate boundaryReads = new AbortController();\n\treadonly #notices = new TaskTranscriptNotices();\n\tprivate loading = false;\n\tprivate reloadPending = false;\n\tprivate loadingEarlier?: AdjacentRequest;\n\tprivate failedCursor?: string;\n\tprivate latestRead?: AbortController;\n\t/** A history-only transcript changed while the reader was away from its end; it is read again when they return. */\n\tprivate behind = false;\n\t/** A compaction retired the window while the reader was above its end: the next window keeps what they see. */\n\tprivate parkOnLoad = false;\n\tprivate disposed = false;\n\tprivate shownPromptSessionId?: string;\n\tprivate readonly unsubscribePrompts: () => void;\n\n\tprivate readonly reportLate: (reason: string) => void;\n\tprivate readonly showKeys: (() => void) | undefined;\n\n\t/**\n\t * `reportLate` shows the reason a message failed after the reader left this transcript; `showKeys` opens the chat's\n\t * keys, as `/hotkeys` does.\n\t */\n\tconstructor(\n\t\tsource: TaskViewSource,\n\t\ttaskId: TaskId,\n\t\tenv: TaskTranscriptEnvironment,\n\t\trequestRender: () => void,\n\t\treportLate: (reason: string) => void = (reason) => env.notify?.(reason),\n\t\toptions: { readonly showKeys?: () => void } = {},\n\t) {\n\t\tthis.source = source;\n\t\tthis.elapsedClocks = taskClocksFor(source);\n\t\tthis.taskId = latestSubagentAttempt(source.tasks, taskId)?.ref.taskId ?? taskId;\n\t\tthis.env = env;\n\t\tthis.requestRender = requestRender;\n\t\tthis.reportLate = reportLate;\n\t\tthis.showKeys = options.showKeys;\n\t\tthis.chat = env.createChat({\n\t\t\tstyle: env.style,\n\t\t\ttui: env.tui,\n\t\t\tkeybindings: env.keybindings,\n\t\t\teditorTheme: env.editorTheme,\n\t\t\teditorFactory: env.editorFactory,\n\t\t\tgetChatRenderSettings: () => {\n\t\t\t\tconst inherited = env.getChatRenderSettings?.();\n\t\t\t\treturn {\n\t\t\t\t\t...inherited,\n\t\t\t\t\tcreateToolComponent: inherited?.createToolComponent\n\t\t\t\t\t\t? (entry, context) =>\n\t\t\t\t\t\t\t\tinherited.createToolComponent!({ ...entry, rendererTaskId: this.taskId }, context)\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tgetToolDefinition: (toolName) => {\n\t\t\t\t\t\tconst session = this.followed?.chatSession;\n\t\t\t\t\t\tif (session?.getToolDefinition || session?.extensionRunner?.resolveToolRenderers) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\tsession.extensionRunner?.resolveToolRenderers?.(toolName, () =>\n\t\t\t\t\t\t\t\t\tsession.getToolDefinition?.(toolName),\n\t\t\t\t\t\t\t\t) ??\n\t\t\t\t\t\t\t\tsession.getToolDefinition?.(toolName) ??\n\t\t\t\t\t\t\t\tunavailableToolRenderer(toolName)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst owner = getOwnerTaskSession(this.source) as ChatBoxSession | undefined;\n\t\t\t\t\t\treturn retainedToolRenderer(\n\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t(name) =>\n\t\t\t\t\t\t\t\tinherited?.getToolDefinition?.(name) ??\n\t\t\t\t\t\t\t\towner?.extensionRunner?.resolveToolRenderers?.(name, () => owner.getToolDefinition?.(name)) ??\n\t\t\t\t\t\t\t\towner?.getToolDefinition?.(name),\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\tgetCustomMessageRenderer: (customType) => {\n\t\t\t\t\t\tconst owner = getOwnerTaskSession(this.source) as ChatBoxSession | undefined;\n\t\t\t\t\t\tconst base =\n\t\t\t\t\t\t\tthis.followed?.chatSession?.extensionRunner?.getMessageRenderer?.(customType) ??\n\t\t\t\t\t\t\tinherited?.getCustomMessageRenderer?.(customType) ??\n\t\t\t\t\t\t\towner?.extensionRunner?.getMessageRenderer?.(customType);\n\t\t\t\t\t\tif (!base || customType !== \"intercom_message\") return base;\n\t\t\t\t\t\treturn (message, renderOptions, renderTheme) =>\n\t\t\t\t\t\t\tbase(friendlyOriginIntercomMessage(message, owner), renderOptions, renderTheme);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t\t...(env.footerData === undefined ? {} : { footerData: withoutExtensionStatuses(env.footerData) }),\n\t\t\tgetChatBoxSession: () => this.followed?.chatSession,\n\t\t\tgetPromptEntries: () =>\n\t\t\t\t(this.followed ?? this.source.followTaskTranscript(this.taskId)?.session)?.getEntries(),\n\t\t\trequestRender,\n\t\t\ttaskRowsInChat: false,\n\t\t\tsavedTaskPages: true,\n\t\t\tliveRowOrigin: (seq) => {\n\t\t\t\tconst session = this.followed ?? this.source.followTaskTranscript(this.taskId)?.session;\n\t\t\t\treturn session === undefined ? undefined : liveTaskRowOrigin(session, this.taskId, seq);\n\t\t\t},\n\t\t\tisStreaming: () => this.followed?.getStreamingMessage?.() !== undefined,\n\t\t\t// The inspector takes Esc for this chat: it cancels the retry the subagent waits on, unless a question holds it.\n\t\t\tcanCancelRetry: () => !this.takesEscape() && this.interruptible(),\n\t\t\tworkingTokenCount: () => this.liveTask()?.metrics?.tokenCount,\n\t\t\t// A finished subagent's chat stays live, and a message resumes it; one stopped for good is read-only.\n\t\t\tisDisabled: () => source.sendTaskMessage === undefined || this.readOnlyReason() !== undefined,\n\t\t\tonNearTop: () => this.loadAdjacent(\"older\"),\n\t\t\tonNearBottom: () => this.loadAdjacent(\"newer\"),\n\t\t\t// A subagent's `/tasks` lists the tasks it launched.\n\t\t\tgetTaskSource: () => launchedTaskViewSource(source, taskId),\n\t\t\t// The completion the subagent's chat offers, from its own cwd and skills.\n\t\t\tautocompleteProvider: createSessionSkillAutocompleteProvider(async () => {\n\t\t\t\tconst commands = await source.taskCommands?.(this.liveTaskId());\n\t\t\t\treturn commands === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: { cwd: commands.cwd, skillCommands: getSkillCatalogCommands(commands.skillCommands) };\n\t\t\t}),\n\t\t\t// What the reader types goes to the subagent's own session as the main chat's goes to its own: queued in its\n\t\t\t// lane while it works, else its next turn, and the dequeue key takes the queue back.\n\t\t\tsteering: this.steeringTarget(),\n\t\t\t// Esc paused it: the reader's next message continues it, as their send continues the main chat after Esc.\n\t\t\tisPaused: () => this.paused(),\n\t\t\tcommands: { handleSlashCommand: (text) => this.runCommand(text) },\n\t\t});\n\t\tpagedNotices.set(this.chat, this.#notices);\n\t\tthis.chat.seedPromptHistory(keptPromptHistories.get(source)?.get(taskId) ?? []);\n\t\tthis.restoreDraft();\n\t\tthis.restoreUndelivered();\n\t\tthis.unsubscribePrompts = heldPrompts().subscribe((sessionId) => {\n\t\t\tif (sessionId === this.childSessionId() || sessionId === this.shownPromptSessionId) this.requestRender();\n\t\t});\n\t}\n\n\tprivate childSessionId(): string | undefined {\n\t\tconst task = this.liveTask();\n\t\tconst sessionId =\n\t\t\ttask?.attention.kind === \"input-needed\"\n\t\t\t\t? task.attention.route.sessionId\n\t\t\t\t: (this.followed?.getSessionId() ?? this.source.followTaskTranscript(this.taskId)?.session?.getSessionId());\n\t\tif (sessionId !== undefined) this.shownPromptSessionId = sessionId;\n\t\treturn sessionId;\n\t}\n\n\theldPrompt(): HeldPrompt | undefined {\n\t\tconst task = this.liveTask();\n\t\tif (task?.execution.kind === \"settled\") return undefined;\n\t\tconst sessionId = this.childSessionId();\n\t\treturn sessionId === undefined ? undefined : heldPrompts().current(sessionId);\n\t}\n\n\tprivate heldForm(): HeldPromptForm | undefined {\n\t\tconst prompt = this.heldPrompt();\n\t\tif (prompt === undefined) return undefined;\n\t\treturn heldPromptForm(prompt, {\n\t\t\t...(this.env.tui === undefined ? {} : { tui: this.env.tui }),\n\t\t\t...(this.env.keybindings instanceof KeybindingsManager ? { keybindings: this.env.keybindings } : {}),\n\t\t\trequestRender: this.requestRender,\n\t\t});\n\t}\n\n\t/**\n\t * The latest attempt of this chat's subagent, which its state, prompt, messages and interrupt are about: a resume\n\t * runs the subagent as a new task, and a message typed here goes to the attempt that runs now.\n\t */\n\tprivate liveTask(): TaskRecord | undefined {\n\t\treturn latestSubagentAttempt(this.source.tasks, this.taskId);\n\t}\n\n\tprivate liveTaskId(): TaskId {\n\t\treturn this.liveTask()?.ref.taskId ?? this.taskId;\n\t}\n\n\t/**\n\t * The attempt the page reads: the live one, once there is a session to follow. A resumed attempt is listed before\n\t * its session is bound, and until then the page keeps the conversation it shows rather than read nothing.\n\t */\n\tprivate readTarget(): TaskId {\n\t\tconst live = this.liveTaskId();\n\t\tif (live === this.taskId) return live;\n\t\treturn this.source.followTaskTranscript(live) === undefined &&\n\t\t\tthis.source.followTaskTranscript(this.taskId) !== undefined\n\t\t\t? this.taskId\n\t\t\t: live;\n\t}\n\n\t/** Restores what was typed here before the reader left. */\n\tprivate restoreDraft(): void {\n\t\tconst kept = keptDrafts.get(this.source);\n\t\tconst draft = kept?.get(this.taskId);\n\t\tif (draft === undefined) return;\n\t\tkept?.delete(this.taskId);\n\t\tthis.chat.setInputText(draft);\n\t}\n\n\tasync load(): Promise<void> {\n\t\tif (this.loading) {\n\t\t\tthis.reloadPending = true;\n\t\t\treturn;\n\t\t}\n\t\t// The latest page is the live attempt's: a resumed subagent's chat follows the attempt that runs now.\n\t\tconst id = this.readTarget();\n\t\tif (this.observedWrites?.pending && this.deferArchiveRead(this.source.followTaskTranscript(id))) return;\n\t\tthis.loading = true;\n\t\tconst controller = new AbortController();\n\t\tthis.latestRead = controller;\n\t\ttry {\n\t\t\t// A synchronous read subscribes in the same turn. A pending read never binds old rows to a replacement owner.\n\t\t\tconst before = this.source.followTaskTranscript(id);\n\t\t\tconst read = readTaskPageForChat(this, this.source, id, undefined, controller.signal);\n\t\t\tconst page = read instanceof Promise ? await read : read;\n\t\t\tif (this.disposed) return;\n\t\t\tif (\n\t\t\t\tread instanceof Promise &&\n\t\t\t\t(id !== this.readTarget() || before?.session !== this.source.followTaskTranscript(id)?.session)\n\t\t\t) {\n\t\t\t\tthis.reloadPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.adoptLatestPage(page, id);\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.status = error instanceof Error ? error.message : String(error);\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t\tthis.requestRender();\n\t\t\tif (this.reloadPending && !this.disposed) {\n\t\t\t\tthis.reloadPending = false;\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deferArchiveRead(follow: ReturnType<TaskViewSource[\"followTaskTranscript\"]>): boolean {\n\t\tconst writes = this.observedWrites;\n\t\tif (\n\t\t\t!writes?.pending ||\n\t\t\t!follow?.historyOnly ||\n\t\t\t!this.followedSessionId ||\n\t\t\tfollow.session?.getSessionId() !== this.followedSessionId\n\t\t)\n\t\t\treturn false;\n\t\tif (this.followed) {\n\t\t\tthis.unsubscribe?.();\n\t\t\tthis.unsubscribe = undefined;\n\t\t\tthis.followed = undefined;\n\t\t\tthis.chat.resetFollowedSession({ preserveWorkedRun: true });\n\t\t\tthis.chat.refreshTaskStore();\n\t\t}\n\t\twrites.onIdle = () => {\n\t\t\tif (!this.disposed) {\n\t\t\t\tobservedTaskChatWrite(this);\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t};\n\t\treturn true;\n\t}\n\n\trefresh(): void {\n\t\tif (this.disposed) return;\n\t\tconst follow = this.source.followTaskTranscript(this.readTarget());\n\t\tif (this.deferArchiveRead(follow)) return;\n\t\tif (follow?.session !== undefined && follow.session === this.followed) return;\n\t\t// Reading a history-only transcript again replaces what is shown, so it waits while the reader is above the end.\n\t\tif (follow?.historyOnly === true && (this.newerCursor !== undefined || this.chat.bodyScrollFromBottom() > 0)) {\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\tvoid this.load();\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tconst handled = this.route(data);\n\t\tthis.catchUp();\n\t\treturn handled;\n\t}\n\n\t/** A history-only transcript that changed while the reader was above its end is read again once they are back. */\n\tprivate catchUp(): void {\n\t\tif (this.behind && this.newerCursor === undefined && this.chat.bodyScrollFromBottom() === 0) {\n\t\t\tthis.behind = false;\n\t\t\tvoid this.load();\n\t\t}\n\t}\n\n\t/**\n\t * A scroll or paging key for the transcript where it is shown on the single chat screen: the page keys, the wheel,\n\t * a line, half a page, the previous or next prompt, the top and the bottom, and the jump to the latest row. Earlier\n\t * and later pages are read the way the reader scrolls, as in the chat page. Answers whether it was such a key.\n\t */\n\thandleViewKey(data: string): boolean {\n\t\tif (this.disposed || this.chat.hasTaskInspector) return false;\n\t\tconst keybindings = keybindingsOf(this.env.keybindings);\n\t\tconst line = keybindings.matches(data, \"tui.altScreen.lineUp\")\n\t\t\t? -1\n\t\t\t: keybindings.matches(data, \"tui.altScreen.lineDown\")\n\t\t\t\t? 1\n\t\t\t\t: 0;\n\t\t// The screen's page keys may be remapped; the transcript's viewport pages on the keys themselves.\n\t\tif (keybindings.matches(data, \"tui.altScreen.pageUp\")) data = PAGE_UP;\n\t\telse if (keybindings.matches(data, \"tui.altScreen.pageDown\")) data = PAGE_DOWN;\n\t\tif (\n\t\t\tdata !== TRANSCRIPT_JUMP_TO_END_URL &&\n\t\t\tline === 0 &&\n\t\t\t!parseWheelReport(data) &&\n\t\t\t!matchesKey(data, \"pageUp\") &&\n\t\t\t!matchesKey(data, \"pageDown\") &&\n\t\t\t!VIEW_KEY_ACTIONS.some((action) => keybindings.matches(data, action))\n\t\t)\n\t\t\treturn false;\n\t\tif (line !== 0) {\n\t\t\tthis.failedCursor = undefined;\n\t\t\tif (line < 0) {\n\t\t\t\tthis.goToFirst = false;\n\t\t\t\tthis.olderIntent = true;\n\t\t\t\tthis.travel = \"older\";\n\t\t\t} else this.travel = \"newer\";\n\t\t\tconst top = Math.max(0, this.chat.bodyMaxScroll() - this.chat.bodyScrollFromBottom());\n\t\t\tthis.chat.scrollBodyTo(Math.max(0, top + line));\n\t\t\tthis.requestRender();\n\t\t} else this.route(data);\n\t\tthis.catchUp();\n\t\treturn true;\n\t}\n\n\tprivate route(data: string): boolean {\n\t\tif (data === TRANSCRIPT_JUMP_TO_END_URL) {\n\t\t\tif (this.newerCursor !== undefined || this.savedPages.length || this.loadingEarlier)\n\t\t\t\tthis.goToLatestSavedPage();\n\t\t\tthis.chat.scrollToBottom();\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst keybindings = keybindingsOf(this.env.keybindings);\n\t\tif (\n\t\t\tthis.failedCursor &&\n\t\t\t(parseWheelReport(data) ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.top\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.bottom\"))\n\t\t)\n\t\t\tthis.failedCursor = undefined;\n\t\tif (!this.chat.hasTaskInspector && this.chat.hasTransientModal) {\n\t\t\tconst handled = this.chat.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn handled;\n\t\t}\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\tkeybindings.matches(data, \"app.agents.focus\") &&\n\t\t\t(!this.hasDraft() || isHintActivation())\n\t\t) {\n\t\t\treturn this.hasTasks() ? this.chat.openTasks() : true;\n\t\t}\n\t\t// The host owns thinking display; only its default physical key leaves the composer.\n\t\tif (matchesKey(data, \"ctrl+t\") && keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\t\tif (keybindings.matches(data, \"app.tools.expand\")) {\n\t\t\tif (this.env.setToolsExpanded === undefined) return false;\n\t\t\tthis.env.setToolsExpanded(this.env.getToolsExpanded?.() !== true);\n\t\t\tthis.chat.toolOutputToggled();\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tif (form !== undefined) {\n\t\t\tconst selectorPages =\n\t\t\t\tthis.capturesPageScroll() && (matchesKey(data, \"pageUp\") || matchesKey(data, \"pageDown\"));\n\t\t\tif (!selectorPages && this.chat.handleScrollInput(data)) {\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tform.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (!this.chat.hasTaskInspector) {\n\t\t\tif (keybindings.matches(data, \"tui.altScreen.top\")) this.goToFirst = true;\n\t\t\telse if (\n\t\t\t\tparseWheelReport(data) ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageUp\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.previousPrompt\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.nextPrompt\")\n\t\t\t)\n\t\t\t\tthis.goToFirst = false;\n\t\t}\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(keybindings.matches(data, \"tui.altScreen.top\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageUp\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.previousPrompt\") ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tparseWheelReport(data)?.direction === -1)\n\t\t) {\n\t\t\tthis.olderIntent = true;\n\t\t\tthis.travel = \"older\";\n\t\t} else if (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(keybindings.matches(data, \"tui.altScreen.halfPageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.nextPrompt\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tparseWheelReport(data)?.direction === 1)\n\t\t)\n\t\t\tthis.travel = \"newer\";\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(this.newerCursor !== undefined || this.savedPages.length > 0 || this.loadingEarlier) &&\n\t\t\tkeybindings.matches(data, \"tui.altScreen.bottom\")\n\t\t) {\n\t\t\tthis.goToLatestSavedPage();\n\t\t\treturn true;\n\t\t}\n\t\t// A read-only chat scrolls and keeps its keys, but takes no typing: nothing it sends could reach the task.\n\t\tif (!this.chat.hasTaskInspector && this.readOnlyReason() !== undefined && isTyping(data)) return true;\n\t\t// The subagent's own task list is modal while it is open.\n\t\tconst handled = this.chat.hasTaskInspector ? this.chat.handleTaskInput(data) : this.chat.handleInput(data);\n\t\tthis.requestRender();\n\t\treturn handled;\n\t}\n\n\t/** A single click on any row of a block in the transcript expands or collapses that block. */\n\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\tif (event.y < 0 || event.y >= this.bodyRows) return undefined;\n\t\t// While the task's held question owns input below the transcript, a click on the transcript does nothing.\n\t\tif (!this.chat.hasTaskInspector && this.heldPrompt() !== undefined) return undefined;\n\t\treturn repaintAfterSingleClick(this.chat.handleBodyClick(event), () => this.requestRender());\n\t}\n\n\tpaintedRowKey(row: number): string | undefined {\n\t\treturn row < 0 || row >= this.bodyRows ? undefined : this.chat.bodyRowKey(row);\n\t}\n\n\ttoolOutputToggled(): void {\n\t\tthis.chat.toolOutputToggled();\n\t}\n\n\t/**\n\t * The transcript alone, `rows` rows tall, as the single chat screen draws it where the main transcript is: the body,\n\t * then the page's notes (loading, read failures, what a released subagent waits on, why it is read-only) in dim\n\t * rows, then the question form a held prompt opens, which keeps its rows first.\n\t */\n\trenderView(width: number, rows: number): string[] {\n\t\tlet remaining = Math.max(0, rows);\n\t\tthis.bodyRows = 0;\n\t\tif (remaining === 0) return [];\n\t\tconst reserve = (lines: readonly string[], fromEnd = false): string[] => {\n\t\t\t// The transcript keeps a row whatever the form and notes take.\n\t\t\tconst room = Math.max(0, remaining - 1);\n\t\t\tconst shown = fromEnd ? lines.slice(Math.max(0, lines.length - room)) : lines.slice(0, room);\n\t\t\tremaining -= shown.length;\n\t\t\treturn shown;\n\t\t};\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tconst formLines = form === undefined ? [] : reserve(form.render(width));\n\t\tconst note = this.status;\n\t\tconst notes = note\n\t\t\t? reserve(\n\t\t\t\t\twrapViewNote(note, width).map((line) => this.env.style.dim(line)),\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t: [];\n\t\tconst body = this.chat.renderBody(width, remaining);\n\t\tthis.bodyRows = body.length;\n\t\tconst gap = Array.from({ length: Math.max(0, remaining - body.length) }, () => \"\");\n\t\treturn [...body, ...gap, ...notes, ...formLines];\n\t}\n\n\t/** Whether the question form of a held prompt is open in the view and takes the keys. */\n\tcapturesInput(): boolean {\n\t\treturn !this.chat.hasTaskInspector && this.heldPrompt() !== undefined;\n\t}\n\n\t/** The subagent is no longer listed (dismissed or removed): the screen showing it shows main again. */\n\tget gone(): boolean {\n\t\tif (this.disposed) return true;\n\t\tconst task = this.liveTask();\n\t\treturn task === undefined || dismissedTasks(this.source).has(task.ref.taskId);\n\t}\n\n\t/** The subagent as the single chat screen's prompt, rule, working line and panel show it. */\n\tviewStatus(agentKey: string): AgentViewStatus {\n\t\tconst { name, label, placeholder, state } = this.composerText(\"view\");\n\t\tconst session = this.followed;\n\t\tconst retrying = session?.chatSession?.isRetrying === true;\n\t\tconst busy = session?.isRunning?.() === true || retrying;\n\t\tconst queued = this.chat.queuedMessages();\n\t\tconst readOnlyReason =\n\t\t\tthis.readOnlyReason() ??\n\t\t\t(this.source.sendTaskMessage === undefined ? \"Messages cannot reach this subagent from here.\" : undefined);\n\t\tconst working = this.chat.workingLine(this.source.followTaskTranscript(this.liveTaskId())?.publishedActivity);\n\t\treturn {\n\t\t\ttaskId: this.liveTaskId(),\n\t\t\tagentKey,\n\t\t\tname,\n\t\t\truleLabel: label,\n\t\t\tplaceholder,\n\t\t\tstate,\n\t\t\tbusy,\n\t\t\tpaused: this.paused(),\n\t\t\tretrying,\n\t\t\tqueued: { steering: [...queued.steering], followUp: [...queued.followUp] },\n\t\t\t...(readOnlyReason === undefined ? {} : { readOnlyReason }),\n\t\t\theldPrompt: this.heldPrompt() !== undefined,\n\t\t\t...(working === undefined ? {} : { working }),\n\t\t\tgone: this.gone,\n\t\t};\n\t}\n\n\t/** The chat box of a subagent's chat: the transcript, then pending, working, usage, the named editor and the footer. */\n\trender(width: number, rows: number): string[] {\n\t\tconst viewport = Math.max(1, rows);\n\t\tthis.bodyRows = 0;\n\t\tif (this.chat.hasTaskInspector) {\n\t\t\tconst footer = this.chat.taskInspectorFullscreen ? [] : this.chat.renderFooter(width);\n\t\t\tconst shownFooter = footer.slice(0, viewport - 1);\n\t\t\t// The chat's own task list or a task's transcript takes the top rows, and clicks there.\n\t\t\tconst body = this.chat.renderBody(width, viewport - shownFooter.length);\n\t\t\tthis.bodyRows = body.length;\n\t\t\treturn [...body, ...shownFooter];\n\t\t}\n\t\tlet remaining = viewport;\n\t\t// The editor keeps its rows first, then the footer, then the status rows; the transcript takes what is left.\n\t\tconst reserve = (lines: string[], fromEnd = false): string[] => {\n\t\t\tconst shown = fromEnd ? lines.slice(Math.max(0, lines.length - remaining)) : lines.slice(0, remaining);\n\t\t\tremaining -= shown.length;\n\t\t\treturn shown;\n\t\t};\n\t\tconst form = this.heldForm();\n\t\tconst editor = reserve(\n\t\t\tform !== undefined ? form.render(width) : this.decorateComposer(this.chat.renderEditor(width)),\n\t\t);\n\t\tconst footer = reserve(this.chat.renderFooter(width));\n\t\tconst pending = reserve(this.chat.renderPendingMessages(width));\n\t\tconst working = reserve(\n\t\t\tthis.chat.renderWorkingStatus(width, this.source.followTaskTranscript(this.liveTaskId())?.publishedActivity),\n\t\t\ttrue,\n\t\t);\n\t\tconst usage = reserve(this.chat.renderUsageRow(width));\n\t\tconst body = remaining > 0 ? this.chat.renderBody(width, remaining) : [];\n\t\tthis.bodyRows = body.length;\n\t\treturn [...body, ...pending, ...working, ...usage, ...editor, ...footer];\n\t}\n\n\t/**\n\t * The composer's top-rule label (`name · title · state`), its empty-prompt placeholder and the state they show:\n\t * needs input, done, failed, paused, stopped, waiting on what it released, or its elapsed time while it runs.\n\t */\n\tprivate composerText(at: \"page\" | \"view\" = \"page\"): {\n\t\treadonly name: string;\n\t\treadonly label: string;\n\t\treadonly placeholder: string;\n\t\treadonly state: AgentViewState;\n\t} {\n\t\tconst task = this.liveTask();\n\t\tconst name = taskDisplayText(task?.agentName ?? this.sessionName() ?? \"subagent\");\n\t\tconst waiting = task?.attention.kind === \"input-needed\";\n\t\tconst paused = this.paused();\n\t\tconst outcome = task?.execution.kind === \"settled\" ? taskState(task) : undefined;\n\t\tconst state =\n\t\t\ttask === undefined\n\t\t\t\t? undefined\n\t\t\t\t: waiting\n\t\t\t\t\t? \"needs input\"\n\t\t\t\t\t: outcome !== undefined\n\t\t\t\t\t\t? outcome === \"completed\"\n\t\t\t\t\t\t\t? \"done\"\n\t\t\t\t\t\t\t: outcome\n\t\t\t\t\t\t: paused\n\t\t\t\t\t\t\t? \"paused\"\n\t\t\t\t\t\t\t: task.metrics?.elapsedMs === undefined\n\t\t\t\t\t\t\t\t? \"running\"\n\t\t\t\t\t\t\t\t: formatPanelElapsed(\n\t\t\t\t\t\t\t\t\t\ttaskElapsedMs(task, taskClockRunning(task.execution.kind), this.elapsedClocks) ??\n\t\t\t\t\t\t\t\t\t\t\ttask.metrics.elapsedMs,\n\t\t\t\t\t\t\t\t\t);\n\t\tconst released = task === undefined ? undefined : waitingReleasedTools(task);\n\t\tconst stopped = !paused && released === undefined && this.source.taskStopped?.(this.liveTaskId()) === true;\n\t\tconst label = [\n\t\t\tname,\n\t\t\ttask?.title ? taskDisplayText(shortTaskTitle(task.title)) : \"\",\n\t\t\tstopped ? \"stopped\" : released !== undefined ? `waiting on ${taskDisplayText(released)}` : (state ?? \"\"),\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" · \");\n\t\tconst addressed = at === \"view\" ? `@${name}` : name;\n\t\tconst placeholder = paused\n\t\t\t? PAUSED_NOTE\n\t\t\t: stopped\n\t\t\t\t? STOPPED_NOTE\n\t\t\t\t: released !== undefined\n\t\t\t\t\t? `Message ${addressed} to wake it…`\n\t\t\t\t\t: `${waiting ? \"Answer\" : \"Message\"} ${addressed}…`;\n\t\tconst viewState: AgentViewState = waiting\n\t\t\t? \"input\"\n\t\t\t: stopped\n\t\t\t\t? \"stopped\"\n\t\t\t\t: released !== undefined\n\t\t\t\t\t? \"waiting\"\n\t\t\t\t\t: paused\n\t\t\t\t\t\t? \"paused\"\n\t\t\t\t\t\t: outcome === undefined\n\t\t\t\t\t\t\t? task?.execution.kind === \"cancelling\"\n\t\t\t\t\t\t\t\t? \"stopping\"\n\t\t\t\t\t\t\t\t: task?.execution.kind === \"queued\"\n\t\t\t\t\t\t\t\t\t? \"queued\"\n\t\t\t\t\t\t\t\t\t: \"running\"\n\t\t\t\t\t\t\t: outcome === \"completed\"\n\t\t\t\t\t\t\t\t? \"done\"\n\t\t\t\t\t\t\t\t: outcome === \"killed\" || outcome === \"cancelled\" || outcome === \"paused\"\n\t\t\t\t\t\t\t\t\t? \"stopped\"\n\t\t\t\t\t\t\t\t\t: \"failed\";\n\t\treturn { name, label, placeholder, state: viewState };\n\t}\n\n\tprivate decorateComposer(lines: readonly string[]): string[] {\n\t\tconst { label, placeholder } = this.composerText();\n\t\treturn applyAttachedComposer(\n\t\t\t{ accent: this.env.style.accent, text: this.env.style.text, dim: this.env.style.dim },\n\t\t\tlabel,\n\t\t\tthis.chat.hasInputText() || this.source.sendTaskMessage === undefined || this.readOnlyReason() !== undefined\n\t\t\t\t? undefined\n\t\t\t\t: placeholder,\n\t\t\tlines,\n\t\t);\n\t}\n\n\t/** What the subagent's session is called: its Intercom name, else its agent's name. */\n\tprivate sessionName(): string | undefined {\n\t\treturn (\n\t\t\tthis.source.followTaskTranscript(this.taskId)?.session?.completionSource?.intercomTarget ??\n\t\t\tthis.liveTask()?.agentName\n\t\t);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.chat.invalidate();\n\t}\n\n\tdispose(): void {\n\t\tif (!this.disposed && this.chat.hasInputText()) {\n\t\t\tconst kept = keptDrafts.get(this.source) ?? new Map<TaskId, string>();\n\t\t\tkept.set(this.liveTaskId(), this.chat.inputText());\n\t\t\tkeptDrafts.set(this.source, kept);\n\t\t}\n\t\tif (!this.disposed && this.chat.promptHistory().length > 0) {\n\t\t\t// Up recalls what was sent from this chat when the reader opens it again, as the main chat, which stays, does.\n\t\t\tconst kept = keptPromptHistories.get(this.source) ?? new Map<TaskId, readonly string[]>();\n\t\t\tkept.set(this.taskId, this.chat.promptHistory());\n\t\t\tkeptPromptHistories.set(this.source, kept);\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.cancelAdjacent();\n\t\tthis.latestRead?.abort();\n\t\tthis.boundaryReads.abort();\n\t\tthis.savedPages.length = 0;\n\t\tthis.legacyWindow = undefined;\n\t\tif (this.observedWrites) this.observedWrites.onIdle = undefined;\n\t\tthis.observedWrites = undefined;\n\t\tthis.#notices.reset();\n\t\tthis.unsubscribePrompts();\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.chat.dispose();\n\t}\n\n\thasDraft(): boolean {\n\t\tif (!this.chat.hasTaskInspector && this.heldPrompt() !== undefined) return true;\n\t\treturn this.chat.hasInputText();\n\t}\n\n\thasTasks(): boolean {\n\t\treturn this.chat.hasBackgroundTasks();\n\t}\n\n\texpandable(): boolean {\n\t\treturn this.env.setToolsExpanded !== undefined;\n\t}\n\n\tcanSend(): boolean {\n\t\treturn this.source.sendTaskMessage !== undefined && this.readOnlyReason() === undefined;\n\t}\n\n\tcursorAtStart(): boolean {\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tif (form !== undefined) return form.capturesBack?.() !== true;\n\t\treturn this.chat.inputCursorAtStart();\n\t}\n\n\thandlesBack(): boolean {\n\t\treturn this.chat.hasTaskInspector || this.chat.hasTransientModal;\n\t}\n\n\ttakesEscape(): boolean {\n\t\treturn !this.chat.hasTaskInspector && this.heldPrompt() !== undefined;\n\t}\n\n\tcapturesPageScroll(): boolean {\n\t\treturn (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\tthis.heldPrompt()?.kind === \"select\" &&\n\t\t\t(this.heldPrompt()?.choices?.length ?? 0) > 10\n\t\t);\n\t}\n\n\t/** Whether Esc paused the subagent: it waits, still running, for the reader's next message. */\n\tprivate paused(): boolean {\n\t\tconst task = this.liveTask();\n\t\treturn task !== undefined && isTaskTurnInterrupted(task);\n\t}\n\n\tinterruptible(): boolean {\n\t\tif (this.source.pauseTask === undefined && this.source.interruptTask === undefined) return false;\n\t\tconst session = this.followed;\n\t\tconst queued = session?.getQueuedMessages?.();\n\t\t// Between two attempts of a retry nothing streams, and Esc cancels the retry, as it does in the main chat. Queued\n\t\t// messages alone are enough too: Esc hands them back, as the main chat's Esc does.\n\t\treturn (\n\t\t\tsession?.isRunning?.() === true ||\n\t\t\tsession?.chatSession?.isRetrying === true ||\n\t\t\t(queued !== undefined && queued.steering.length + queued.followUp.length > 0)\n\t\t);\n\t}\n\n\tasync interrupt(): Promise<TaskViewResult<undefined>> {\n\t\tif (this.source.pauseTask !== undefined) {\n\t\t\tconst paused = await pauseAgent(this.source, this.liveTaskId());\n\t\t\tif (!paused.ok) return paused;\n\t\t\t// A pause a restart would not keep is shown with why: in the chat, or in the main chat once the reader left.\n\t\t\tconst warning = paused.value.warning;\n\t\t\tif (warning !== undefined) {\n\t\t\t\tif (this.disposed) this.reportLate(warning);\n\t\t\t\telse this.chat.showWarning(warning);\n\t\t\t}\n\t\t\tif (!this.disposed) this.restoreQueuedToEditor(paused.value);\n\t\t\telse {\n\t\t\t\t// The reader left while the turn ended: what came back waits in the prompt for their return.\n\t\t\t\tconst taken = [...paused.value.steering, ...paused.value.followUp];\n\t\t\t\tconst kept = keptDrafts.get(this.source) ?? new Map<TaskId, string>();\n\t\t\t\tconst id = this.liveTaskId();\n\t\t\t\tif (taken.length > 0) kept.set(id, combineQueuedMessagesForEditor(taken, kept.get(id) ?? \"\"));\n\t\t\t\tkeptDrafts.set(this.source, kept);\n\t\t\t}\n\t\t\treturn { ok: true, value: undefined };\n\t\t}\n\t\tconst interrupt = this.source.interruptTask;\n\t\tif (interrupt === undefined)\n\t\t\treturn { ok: false, error: { message: \"This task's turn cannot be interrupted from here.\" } };\n\t\treturn interrupt.call(this.source, this.liveTaskId());\n\t}\n\n\tprivate adoptLatestPage(page: TaskViewResult<TaskTranscriptView>, id: TaskId = this.taskId): void {\n\t\tif (!page.ok) {\n\t\t\tthis.status = page.error.message;\n\t\t\treturn;\n\t\t}\n\t\tconst follow = this.source.followTaskTranscript(id);\n\t\tif (this.deferArchiveRead(follow)) return;\n\t\t// A reader who moved above the end while this read was on its way keeps their rows until they return.\n\t\tif (follow?.historyOnly === true && this.chat.bodyScrollFromBottom() > 0) {\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\tconst session = follow?.session?.subscribe === undefined ? undefined : follow.session;\n\t\tconst nextSessionId = follow?.session?.getSessionId?.();\n\t\tconst sameConversation =\n\t\t\tthis.followedSessionId !== undefined &&\n\t\t\tnextSessionId !== undefined &&\n\t\t\tnextSessionId === this.followedSessionId;\n\t\tconst sessionChanged =\n\t\t\tsession !== this.followed || (!sameConversation && nextSessionId !== this.followedSessionId);\n\t\tconst parked = this.parkOnLoad && !sessionChanged && session ? this.parkedRows(session) : undefined;\n\t\tconst parking = this.parkOnLoad;\n\t\tthis.parkOnLoad = false;\n\t\tif (parking && !parked && !sessionChanged && this.chat.bodyScrollFromBottom() > 0) {\n\t\t\t// A row the reader sees cannot be placed among the saved entries: keep the window until they return.\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\t// From here the window is the one `id` read: its cursors and rows are that attempt's.\n\t\tthis.taskId = id;\n\t\tif (sessionChanged) {\n\t\t\tif (this.observedWrites) {\n\t\t\t\tthis.observedWrites.onIdle = undefined;\n\t\t\t\tthis.observedWrites = undefined;\n\t\t\t}\n\t\t\tthis.unsubscribe?.();\n\t\t\tthis.unsubscribe = undefined;\n\t\t\tthis.followed = session;\n\t\t\tthis.chat.resetFollowedSession({ preserveWorkedRun: sameConversation && session === undefined });\n\t\t}\n\t\tthis.followedSessionId = nextSessionId;\n\t\tthis.cancelAdjacent();\n\t\tthis.windowGeneration++;\n\t\tthis.savedPages.length = 0;\n\t\tthis.boundaryReads.abort();\n\t\tthis.boundaryReads = new AbortController();\n\t\tthis.newerCursor = undefined;\n\t\tthis.liveHistoryStart = undefined;\n\t\tthis.cursor = page.value.nextCursor;\n\t\tthis.legacyWindow = undefined;\n\t\tthis.legacyWindowActive = false;\n\t\tthis.chat.onUnplacedWidget?.(\n\t\t\tsession &&\n\t\t\t\t!session.getEntrySeq &&\n\t\t\t\t!session.entryReceipt &&\n\t\t\t\tsession.readHistory &&\n\t\t\t\tsession.getEarlierCursor &&\n\t\t\t\tthis.cursor &&\n\t\t\t\t!this.cursor.includes(\":\")\n\t\t\t\t? () => {\n\t\t\t\t\t\tthis.legacyWindow = retainTaskWindowReader(session, this.taskId);\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t);\n\t\tconst messages = page.value.messages;\n\t\tif (page.value.savedWindow && !session) this.attachSavedPage(page.value, \"latest\", page);\n\t\telse\n\t\t\twithTaskChatRows(this.chat, page, () =>\n\t\t\t\tthis.chat.replaceMessages(messages, {\n\t\t\t\t\tpreserveUnread: !sessionChanged,\n\t\t\t\t\tparked,\n\t\t\t\t\tbefore: this.boundaryReader(this.cursor, true, this.boundaryReads.signal),\n\t\t\t\t}),\n\t\t\t);\n\t\tif (session && parked?.rows.length) {\n\t\t\t// The rows the reader sees of the retired window stay as the saved page they are on; reads continue past it.\n\t\t\tconst around = taskCursorsAround(session, this.taskId, parked.first, parked.last);\n\t\t\tthis.liveHistoryStart = this.cursor;\n\t\t\tthis.savedPages.push({ ...this.chat.keptPage(parked.rows), ...around });\n\t\t\tthis.cursor = around.older;\n\t\t\tthis.newerCursor = around.newer;\n\t\t}\n\t\tthis.#notices.adopt(page, messages, this.cursor !== undefined);\n\t\tthis.chat.hydrateToolExecutionStarts(page.value.activeToolStarts ?? []);\n\t\tthis.chat.hydrateCompactionStatus(\n\t\t\tpage.value.compactionReason,\n\t\t\tpage.value.compactionStartedAt ?? session?.chatSession?.compactionStartedAt,\n\t\t);\n\t\tthis.status = \"\";\n\t\tif (!sessionChanged || session === undefined) return;\n\t\tthis.chat.hydrateStreamingAssistantMessage(session.getStreamingMessage?.());\n\t\tthis.hydrateRunningTurn(session, page.value.messages);\n\t\tlet turnAborted = false;\n\t\tthis.unsubscribe = session.subscribe?.((event) => {\n\t\t\tif (event.type === \"agent_start\" || event.type === \"turn_start\" || event.type === \"message_start\") {\n\t\t\t\tturnAborted = false;\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\t} else if (\n\t\t\t\tevent.type === \"message_end\" &&\n\t\t\t\t(event.message as { role?: string; stopReason?: string }).role === \"assistant\" &&\n\t\t\t\t(event.message as { stopReason?: string }).stopReason === \"aborted\"\n\t\t\t) {\n\t\t\t\tturnAborted = true;\n\t\t\t} else if (event.type === \"agent_end\" && turnAborted && session.isRunning?.() !== true) {\n\t\t\t\tturnAborted = false;\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, true);\n\t\t\t}\n\t\t\tif (event.type === \"message_end\") {\n\t\t\t\t// The receipt arrives with the end of the message the row was drawn from as it streamed.\n\t\t\t\tconst sent = event as { seq?: unknown };\n\t\t\t\tconst seq =\n\t\t\t\t\tsession.entryReceipt?.(event.message)?.seq ?? (typeof sent.seq === \"number\" ? sent.seq : undefined);\n\t\t\t\tif (seq !== undefined) noteSavedSeq(event.message, seq);\n\t\t\t}\n\t\t\tconst write = chatReceiptWrite(event);\n\t\t\tif (write) {\n\t\t\t\tthis.observedWrites ??= new ObservedChatWrites();\n\t\t\t\tthis.observedWrites.observe(write);\n\t\t\t}\n\t\t\tthis.chat.applyTaskAgentEvent(event);\n\t\t\tif (event.type === \"compaction_end\" && event.result && !event.aborted && session.getEarlierCursor?.()) {\n\t\t\t\t// Only a source that can replay the previous context authorizes releasing those rows. Never clear\n\t\t\t\t// private SDK rows merely because they arrived before a new boundary.\n\t\t\t\tthis.cancelAdjacent();\n\t\t\t\tthis.windowGeneration++;\n\t\t\t\tif (!session.getEntrySeq && !session.entryReceipt && this.chat.hasUnplacedWidget()) {\n\t\t\t\t\t// With neither occurrence capability, only the original live transcript can place this stateful\n\t\t\t\t\t// widget. Keep that view, including its new boundary. Never guess by text or display it twice.\n\t\t\t\t\tthis.legacyWindowActive = true;\n\t\t\t\t\tthis.behind = false;\n\t\t\t\t\tthis.parkOnLoad = false;\n\t\t\t\t} else if (this.chat.bodyScrollFromBottom() === 0 && this.newerCursor === undefined) void this.load();\n\t\t\t\telse if (session.getEntrySeq) {\n\t\t\t\t\t// A reader above the end keeps only the rows they see; the rest of the retired window is released.\n\t\t\t\t\tthis.parkOnLoad = true;\n\t\t\t\t\tvoid this.load();\n\t\t\t\t} else this.behind = true;\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t});\n\t}\n\n\t/**\n\t * A page opened mid-turn missed `agent_start` and `queue_update`, so it reads the turn and the queue now. Between\n\t * two attempts of a retry the page shows the retry's wait instead, also while a session with fallback models keeps\n\t * its run open through the wait.\n\t */\n\tprivate hydrateRunningTurn(session: TaskTranscriptSource, messages: TaskTranscriptView[\"messages\"]): void {\n\t\tconst chatSession = session.chatSession;\n\t\tif (chatSession && sessionWaitsToRetry(chatSession)) {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tconst retry = chatSession.retryStatus;\n\t\t\tthis.chat.hydrateRetryWait(\n\t\t\t\tmessages,\n\t\t\t\tchatSession.turnStartedAt,\n\t\t\t\tretry?.type === \"auto_retry_start\" ? retry : undefined,\n\t\t\t);\n\t\t} else if (chatSession?.retryStatus?.type === \"model_fallback_start\") {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tthis.chat.hydrateModelSwitch(chatSession.turnStartedAt, messages);\n\t\t} else if (session.isRunning?.() === true) {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tthis.chat.beginExternalPromptLifecycle();\n\t\t\tthis.chat.hydrateRunningTurn(messages, session.getStreamingMessage?.(), chatSession?.turnStartedAt);\n\t\t} else if (session.isRunning?.() === false) {\n\t\t\tconst lastAssistant = [...messages]\n\t\t\t\t.reverse()\n\t\t\t\t.find((message): message is Extract<typeof message, { role: \"assistant\" }> => message.role === \"assistant\");\n\t\t\tif (lastAssistant?.stopReason === \"aborted\") {\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, true);\n\t\t\t}\n\t\t}\n\t\tconst queued = session.getQueuedMessages?.();\n\t\tif (queued === undefined) return;\n\t\tthis.chat.applyAgentEvent({ type: \"queue_update\", steering: queued.steering, followUp: queued.followUp });\n\t}\n\n\t/** The rows the reader sees, at the window the followed session holds now. */\n\tprivate parkedRows(session: TaskTranscriptSource): ParkedTaskRows | undefined {\n\t\tlet current = Number.POSITIVE_INFINITY;\n\t\tfor (const entry of session.getEntries()) current = Math.min(current, session.getEntrySeq?.(entry.id) ?? current);\n\t\treturn Number.isFinite(current) ? this.chat.parkedRows(current) : undefined;\n\t}\n\n\tprivate goToLatestSavedPage(): void {\n\t\tthis.cancelAdjacent();\n\t\tthis.windowGeneration++;\n\t\tthis.newerCursor = undefined;\n\t\tthis.behind = false;\n\t\tthis.olderIntent = false;\n\t\tthis.goToFirst = false;\n\t\tthis.chat.scrollToBottom();\n\t\tif (this.followed) {\n\t\t\tfor (const page of this.savedPages.splice(0)) page.discard();\n\t\t\tif (this.liveHistoryStart) this.cursor = this.liveHistoryStart;\n\t\t\tthis.requestRender();\n\t\t} else void this.load();\n\t}\n\n\t/**\n\t * Reads, one saved entry per step, the entries from `cursor` on: newest first with `calls` (replies reduced to their\n\t * calls), else oldest first. Only saved transcripts read single entries.\n\t */\n\tprivate boundaryReader(\n\t\tcursor: string | undefined,\n\t\tcalls: boolean,\n\t\tsignal: AbortSignal,\n\t): SavedPageNeighbours[\"before\"] | undefined {\n\t\tif (cursor === undefined || !cursor.includes(\":\")) return undefined;\n\t\tconst { source, taskId } = this;\n\t\treturn () => {\n\t\t\tlet next: string | undefined = cursor;\n\t\t\treturn {\n\t\t\t\tasync next() {\n\t\t\t\t\tif (next === undefined || signal.aborted) return { done: true, value: undefined };\n\t\t\t\t\tconst page = await readTaskPageForView(source, taskId, savedBoundaryCursor(next, calls), signal);\n\t\t\t\t\tif (!page.ok) throw new Error(page.error.message);\n\t\t\t\t\tnext = calls ? page.value.nextCursor : page.value.newerCursor;\n\t\t\t\t\treturn { done: false, value: page.value.messages };\n\t\t\t\t},\n\t\t\t};\n\t\t};\n\t}\n\n\tprivate attachSavedPage(\n\t\tpage: TaskTranscriptView,\n\t\tedge: \"latest\" | \"older\" | \"newer\",\n\t\tresult?: TaskViewResult<TaskTranscriptView>,\n\t): void {\n\t\tconst reads = new AbortController();\n\t\tconst windowReads = this.boundaryReads.signal;\n\t\tconst signal = AbortSignal.any([reads.signal, windowReads]);\n\t\tconst neighbours: SavedPageNeighbours = {\n\t\t\tbefore: this.boundaryReader(page.nextCursor, true, signal),\n\t\t\tafter: this.boundaryReader(page.newerCursor, false, signal),\n\t\t};\n\t\tlet kept!: SavedPageHandle;\n\t\tconst show = () => {\n\t\t\tkept = this.chat.showSavedPage(\n\t\t\t\tpage.messages,\n\t\t\t\tedge,\n\t\t\t\tneighbours,\n\t\t\t\tedge === \"newer\" ? this.savedPages.at(-1)?.lastRow() : undefined,\n\t\t\t);\n\t\t};\n\t\t// The page's rows carry where its saved lines go.\n\t\tif (result) withTaskChatRows(this.chat, result, show);\n\t\telse show();\n\t\tconst shown = {\n\t\t\t...kept,\n\t\t\tdiscard: () => {\n\t\t\t\treads.abort();\n\t\t\t\tkept.discard();\n\t\t\t},\n\t\t\tolder: page.nextCursor,\n\t\t\tnewer: page.newerCursor,\n\t\t};\n\t\tif (edge === \"older\") this.savedPages.unshift(shown);\n\t\telse this.savedPages.push(shown);\n\t\t// Keep the viewport and an adjacent page. A tall screen can span more: never evict a painted row.\n\t\twhile (this.savedPages.length > 2) {\n\t\t\tconst far = edge === \"older\" ? this.savedPages.at(-1)! : this.savedPages[0]!;\n\t\t\tif (far.visible()) break;\n\t\t\tif (edge === \"older\") this.savedPages.pop();\n\t\t\telse this.savedPages.shift();\n\t\t\tfar.discard();\n\t\t}\n\t\tthis.cursor = this.savedPages[0]?.older;\n\t\tthis.newerCursor = this.savedPages.at(-1)?.newer;\n\t}\n\n\tprivate cancelAdjacent(): void {\n\t\tthis.loadingEarlier?.controller.abort();\n\t\tthis.loadingEarlier = undefined;\n\t\tthis.failedCursor = undefined;\n\t}\n\tprivate loadAdjacent(edge: \"older\" | \"newer\"): void {\n\t\tconst cursor = edge === \"older\" ? this.cursor : this.newerCursor;\n\t\tif (!cursor || cursor === this.failedCursor || this.loadingEarlier || this.loading || this.disposed) return;\n\t\tif (edge === \"older\" && this.followed && cursor.includes(\":\") && !this.olderIntent) return;\n\t\t// Saved pages on both sides of a live reader (pages kept through a compaction): read on the way they scroll.\n\t\tif (this.followed && this.savedPages.length > 0 && this.travel !== edge) return;\n\t\tconst src = this.source.followTaskTranscript(this.taskId)?.session;\n\t\tconst request: AdjacentRequest = {\n\t\t\tedge,\n\t\t\tcursor,\n\t\t\tgeneration: this.windowGeneration,\n\t\t\tcontroller: new AbortController(),\n\t\t\tsource: src && new WeakRef(src),\n\t\t};\n\t\tthis.loadingEarlier = request;\n\t\ttry {\n\t\t\tdeliverAdjacent(\n\t\t\t\tnew WeakRef(this),\n\t\t\t\trequest,\n\t\t\t\tthis.legacyWindowActive && this.legacyWindow && !cursor.includes(\":\")\n\t\t\t\t\t? this.legacyWindow(cursor)\n\t\t\t\t\t: readTaskPageForChat(this, this.source, this.taskId, cursor, request.controller.signal),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthis[finishAdjacent](request, { ok: false, error: { message: failureText(error) } });\n\t\t}\n\t}\n\t[finishAdjacent](request: AdjacentRequest, page: TaskViewResult<TaskTranscriptView>): void {\n\t\tconst { edge, cursor } = request;\n\t\tif (this.disposed || this.loadingEarlier !== request) return;\n\t\tthis.loadingEarlier = undefined;\n\t\tif (\n\t\t\trequest.generation !== this.windowGeneration ||\n\t\t\tcursor !== (edge === \"older\" ? this.cursor : this.newerCursor) ||\n\t\t\trequest.source?.deref() !== this.source.followTaskTranscript(this.taskId)?.session\n\t\t)\n\t\t\treturn;\n\t\ttry {\n\t\t\tif (!page.ok) {\n\t\t\t\tthis.failedCursor = cursor;\n\t\t\t\tthis.status = page.error.message;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (page.value.savedWindow && (this.savedPages.length || this.followed)) {\n\t\t\t\tif (this.followed && this.liveHistoryStart === undefined) this.liveHistoryStart = cursor;\n\t\t\t\tif (edge === \"older\") this.#notices.adopt(page, page.value.messages, page.value.nextCursor !== undefined);\n\t\t\t\tthis.attachSavedPage(page.value, edge, page);\n\t\t\t\tif (edge === \"older\" && this.goToFirst) this.chat.scrollBodyTo(0);\n\t\t\t} else {\n\t\t\t\tthis.cursor = page.value.nextCursor;\n\t\t\t\tthis.#notices.adopt(page, page.value.messages, this.cursor !== undefined);\n\t\t\t\twithTaskChatRows(this.chat, page, () => this.chat.prependMessages(page.value.messages));\n\t\t\t}\n\t\t\tthis.status = \"\";\n\t\t} catch (error) {\n\t\t\tthis.failedCursor = cursor;\n\t\t\tthis.status = failureText(error);\n\t\t} finally {\n\t\t\tif (!this.cursor) this.#notices.finishPaging();\n\t\t\tthis.requestRender();\n\t\t}\n\t}\n\n\t/** The subagent as its chat steers it: messages go to its own session, and its queue comes back from it. */\n\tprivate steeringTarget(): ChatSteeringTarget {\n\t\treturn {\n\t\t\tprompt: (text, options) => this.send(text, options?.streamingBehavior ?? \"steer\"),\n\t\t\tresume: async (text, lane) => {\n\t\t\t\tawait resumeAgent(this.source, this.liveTaskId());\n\t\t\t\tawait this.send(text, lane === \"followUp\" ? \"followUp\" : \"steer\");\n\t\t\t},\n\t\t\tclearQueue: async () => {\n\t\t\t\tconst taken = await this.takeQueue();\n\t\t\t\treturn { steering: [...taken.steering], followUp: [...taken.followUp] };\n\t\t\t},\n\t\t};\n\t}\n\n\t/** Resolves once the subagent's session accepted `text`, waiting on `lane` while it works. */\n\tprivate async send(text: string, lane: TaskMessageLane): Promise<void> {\n\t\ttry {\n\t\t\tawait sendAgentMessage(this.source, () => this.liveTask(), this.taskId, text, lane);\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) throw error;\n\t\t\tthis.keepUndelivered(text, failureText(error));\n\t\t}\n\t}\n\n\t/** Every message waiting in the subagent's queue, taken back in its own answer. */\n\tprivate takeQueue(): Promise<QueuedTaskMessages> {\n\t\treturn takeAgentQueue(this.source, this.liveTaskId());\n\t}\n\n\trestoreQueuedToEditor(taken: QueuedTaskMessages): number {\n\t\treturn this.chat.restoreTakenQueuedMessages(taken);\n\t}\n\n\t/**\n\t * A slash command typed into the chat: `/tasks`, `/copy` and `/hotkeys` run here at once; a built-in that belongs to\n\t * the main chat is refused with a notice; anything else goes to the subagent, whose session runs its own commands\n\t * and expands its skills and prompt templates. Answers whether the chat handled it.\n\t */\n\tprivate runCommand(text: string): boolean {\n\t\tif (classifyChatCommand(text) === \"tasks\") return this.chat.openTasks(text.split(/\\s+/)[1]);\n\t\tconst command = subagentChatCommand(text);\n\t\tif (command.kind === \"agent\") return false;\n\t\tif (command.kind === \"unavailable\") {\n\t\t\tthis.chat.showWarning(subagentChatUnavailableNotice(command.name));\n\t\t\treturn true;\n\t\t}\n\t\tif (command.name === \"copy\") void this.copyLastMessage();\n\t\telse if (command.name === \"hotkeys\") this.showKeys?.();\n\t\telse this.chat.openTasks();\n\t\treturn true;\n\t}\n\n\tprivate async copyLastMessage(): Promise<void> {\n\t\tconst text = this.chat.lastAgentMessageText();\n\t\tif (!text) {\n\t\t\tthis.chat.showWarning(\"No agent messages to copy yet.\");\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait copyToClipboard(text);\n\t\t\tif (!this.disposed) this.chat.showStatus(\"Copied last agent message to clipboard\");\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.chat.showWarning(failureText(error));\n\t\t}\n\t}\n\n\t/** The reader left before the answer: report it once, and give the text back when they return. */\n\tprivate keepUndelivered(text: string, reason: string): void {\n\t\tconst kept = undeliveredMessages.get(this.source) ?? new Map<TaskId, UndeliveredMessage>();\n\t\tconst taskId = this.liveTaskId();\n\t\tconst earlier = kept.get(taskId);\n\t\tkept.set(taskId, { text: earlier === undefined ? text : `${earlier.text}\\n${text}`, reason });\n\t\tundeliveredMessages.set(this.source, kept);\n\t\tthis.reportLate(reason);\n\t}\n\n\tprivate restoreUndelivered(): void {\n\t\tconst kept = undeliveredMessages.get(this.source);\n\t\tconst message = kept?.get(this.taskId);\n\t\tif (message === undefined) return;\n\t\tkept?.delete(this.taskId);\n\t\tconst draft = this.chat.inputText();\n\t\tthis.chat.setInputText(draft ? `${message.text}\\n${draft}` : message.text);\n\t\tthis.chat.showWarning(message.reason);\n\t}\n}\n\n/** The retained tail of a shell task's output on the shared viewport. */\nexport class TaskCommandOutputPage implements TaskTranscriptPage {\n\tstatic readonly TAIL_BYTES = 8192;\n\tstatus = \"Loading output…\";\n\tprivate readonly source: TaskViewSource;\n\tprivate readonly taskId: TaskId;\n\tprivate readonly byteCount: () => bigint;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly viewport: ScrollableComponentViewport;\n\tprivate output = new Text(\"\", 0, 0);\n\tprivate loading = false;\n\tprivate reloadPending = false;\n\tprivate disposed = false;\n\n\tconstructor(\n\t\tsource: TaskViewSource,\n\t\ttaskId: TaskId,\n\t\tbyteCount: () => bigint,\n\t\tenv: Pick<TaskTranscriptEnvironment, \"keybindings\" | \"getChatRenderSettings\"> | undefined,\n\t\trequestRender: () => void,\n\t) {\n\t\tthis.source = source;\n\t\tthis.taskId = taskId;\n\t\tthis.byteCount = byteCount;\n\t\tthis.requestRender = requestRender;\n\t\tthis.viewport = new ScrollableComponentViewport(env?.keybindings, {\n\t\t\twheelScrollLines: () => env?.getChatRenderSettings?.()?.fullscreenWheelScrollLines,\n\t\t\tscrollbar: () => env?.getChatRenderSettings?.()?.fullscreenScrollbar,\n\t\t\tscrollbarThumbStyle: (text) => theme.bg(\"scrollbarThumb\", text),\n\t\t\trequestRender,\n\t\t});\n\t\tthis.viewport.setComponents([this.output]);\n\t}\n\n\tasync load(): Promise<void> {\n\t\tif (this.loading) {\n\t\t\tthis.reloadPending = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.loading = true;\n\t\tconst count = this.byteCount();\n\t\tconst tail = BigInt(TaskCommandOutputPage.TAIL_BYTES);\n\t\ttry {\n\t\t\tconst page = await this.source.readTaskOutput(this.taskId, {\n\t\t\t\tstart: String(count > tail ? count - tail : 0n),\n\t\t\t\tmaximumBytes: TaskCommandOutputPage.TAIL_BYTES,\n\t\t\t});\n\t\t\tif (this.disposed) return;\n\t\t\tconst text = page.ok ? page.value.text : page.error.message;\n\t\t\tthis.output = new Text(text.split(\"\\n\").map(taskDisplayText).join(\"\\n\") || \"No output available\", 0, 0);\n\t\t\tthis.viewport.setComponents([this.output]);\n\t\t\tthis.status = count > tail ? \"Earlier output omitted · showing retained 8 KiB tail\" : \"Retained shell output\";\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.status = error instanceof Error ? error.message : String(error);\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t\tthis.requestRender();\n\t\t\tif (this.reloadPending && !this.disposed) {\n\t\t\t\tthis.reloadPending = false;\n\t\t\t\tvoid this.load();\n\t\t\t}\n\t\t}\n\t}\n\n\trefresh(): void {\n\t\tif (!this.disposed) void this.load();\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tconst handled = this.viewport.handleInput(data);\n\t\tif (handled) this.requestRender();\n\t\treturn handled;\n\t}\n\n\thasDraft(): boolean {\n\t\treturn false;\n\t}\n\n\tcursorAtStart(): boolean {\n\t\treturn true;\n\t}\n\n\thandlesBack(): boolean {\n\t\treturn false;\n\t}\n\n\tinterruptible(): boolean {\n\t\treturn false;\n\t}\n\n\tasync interrupt(): Promise<TaskViewResult<undefined>> {\n\t\treturn { ok: false, error: { message: \"A shell's output has no turn to interrupt.\" } };\n\t}\n\n\trender(width: number, rows: number): string[] {\n\t\tthis.viewport.setVisibleRows(Math.max(1, rows));\n\t\treturn this.viewport.render(width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.viewport.invalidate();\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.viewport.dispose();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"task-transcript-page.js","sourceRoot":"","sources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AAQ;QACP,OAAO,KAAK,CAAC;IACd,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC;IACb,CAAC;IAED,WAAW;QACV,OAAO,KAAK,CAAC;IACd,CAAC;IAED,aAAa;QACZ,OAAO,KAAK,CAAC;IACd,CAAC;IAED,KAAK,CAAC,SAAS;QACd,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,EAAE,CAAC;IACxF,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,IAAY;QACjC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACD","sourcesContent":["import {\n\tgetKeybindings,\n\tisHintActivation,\n\tmatchesKey,\n\tText,\n\ttype KeybindingsManager as TuiKeybindingsManager,\n\ttype TuiMouseEvent,\n\ttype TuiMouseEventResult,\n\ttruncateToWidth,\n\twrapTextWithAnsi,\n} from \"@bastani/atomic-tui\";\nimport { chatReceiptWrite } from \"../../../core/chat-receipts.js\";\nimport { type HeldPrompt, heldPrompts } from \"../../../core/extensions/held-prompts.ts\";\nimport type { ReadonlyFooterDataProvider } from \"../../../core/footer-data-provider.ts\";\nimport { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport type { CustomMessage } from \"../../../core/messages.ts\";\nimport { sessionWaitsToRetry } from \"../../../core/session-retry-status.js\";\nimport { shortTaskTitle } from \"../../../core/tasks/agent-panel-source.ts\";\nimport {\n\tlatestSubagentAttempt,\n\treleasedWaitingOn,\n\twaitingReleasedShells,\n\twaitingReleasedTools,\n} from \"../../../core/tasks/completion.js\";\nimport type { TaskId, TaskRecord } from \"../../../core/tasks/contracts.js\";\nimport {\n\ttype TaskElapsedClocks,\n\ttaskClockRunning,\n\ttaskClocksFor,\n\ttaskElapsedMs,\n} from \"../../../core/tasks/live-elapsed.js\";\nimport { getOwnerTaskSession, isTaskTurnInterrupted, setTaskTurnInterrupted } from \"../../../core/tasks/owner-store.js\";\nimport type {\n\tChatBoxSession,\n\tQueuedTaskMessages,\n\tTaskMessageLane,\n\tTaskTranscriptSource,\n} from \"../../../core/tasks/supervisor.js\";\nimport { observedTaskChatWrite, withTaskChatRows } from \"../../../core/tasks/task-chat-records.js\";\nimport {\n\tlaunchedTaskViewSource,\n\tliveTaskRowOrigin,\n\treadTaskPageForChat,\n\treadTaskPageForView,\n\tretainTaskWindowReader,\n\tsavedBoundaryCursor,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n\ttaskCursorsAround,\n} from \"../../../core/tasks/task-view-source.js\";\nimport { noteSavedSeq } from \"../../../core/tasks/transcript-origin.js\";\nimport { copyToClipboard } from \"../../../utils/clipboard.js\";\nimport type { TranscriptFrameLayout } from \"../../interactive-engine/transcript-frame-layout.ts\";\nimport { pauseAgent, resumeAgent, sendAgentMessage, takeAgentQueue } from \"../agent-view/agent-steering.ts\";\nimport type { AgentViewState, AgentViewStatus } from \"../agent-view/contracts.ts\";\nimport { combineQueuedMessagesForEditor } from \"../chat-input-actions.ts\";\nimport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSkillCatalogCommands,\n} from \"../skill-command-autocomplete.ts\";\nimport { subagentChatCommand, subagentChatUnavailableNotice } from \"../subagent-chat-commands.ts\";\nimport { theme } from \"../theme/theme.js\";\nimport { formatPanelElapsed } from \"./agent-panel.ts\";\nimport type { ChatSessionHost, SavedPageHandle } from \"./chat-session-host.ts\";\nimport type { SavedPageNeighbours } from \"./chat-session-host-saved-calls.ts\";\nimport type { ChatSteeringTarget } from \"./chat-session-host-steering.ts\";\nimport type { ChatSessionHostOpts, ChatSessionHostStyle } from \"./chat-session-host-types.ts\";\nimport { parseWheelReport, ScrollableComponentViewport } from \"./chat-transcript.js\";\nimport { type HeldPromptForm, heldPromptForm } from \"./held-prompt-form.ts\";\nimport { applyAttachedComposer } from \"./input-label.ts\";\nimport { clickableKeyTextHint, navActionText } from \"./nav-keys.ts\";\nimport type { ParkedTaskRows } from \"./parked-rows.ts\";\nimport { dismissedTasks } from \"./task-dismissal.ts\";\nimport { taskDisplayText, taskState } from \"./task-row.js\";\nimport { pagedNotices, TaskTranscriptNotices } from \"./task-transcript-notices.ts\";\nimport { retainedToolRenderer, unavailableToolRenderer } from \"./tool-renderer-scope.js\";\nimport { repaintAfterSingleClick } from \"./transcript-block-clicks.ts\";\nimport { TRANSCRIPT_JUMP_TO_END_URL } from \"./transcript-follow-indicator.ts\";\n\n/** Where a task's transcript view is mounted: the chat host it builds on and the render settings it inherits. */\nexport interface TaskTranscriptEnvironment {\n\tcreateChat(opts: ChatSessionHostOpts): ChatSessionHost;\n\treadonly tui?: ChatSessionHostOpts[\"tui\"];\n\treadonly keybindings?: unknown;\n\treadonly editorTheme: ChatSessionHostOpts[\"editorTheme\"];\n\treadonly editorFactory?: ChatSessionHostOpts[\"editorFactory\"];\n\treadonly style: ChatSessionHostStyle;\n\treadonly getChatRenderSettings?: ChatSessionHostOpts[\"getChatRenderSettings\"];\n\t/** What the transcript chat's footer reads of git and providers; without it the footer counts tasks only. */\n\treadonly footerData?: ChatSessionHostOpts[\"footerData\"];\n\treadonly getToolsExpanded?: () => boolean;\n\treadonly setToolsExpanded?: (expanded: boolean) => void;\n\t/** Tells the reader about a message that failed after they left its transcript and the task pages. */\n\treadonly notify?: (message: string) => void;\n}\n\n/** A message that failed after its reader left the transcript, kept for when they open it again. */\ninterface UndeliveredMessage {\n\treadonly text: string;\n\treadonly reason: string;\n}\n\n/** The last live frame is already complete. An archiving child must not replace it with a snapshot that\n * predates its last diagnostic. Only the view tracks these writes; it immediately releases the live child. */\nclass ObservedChatWrites {\n\tprivate count = 0;\n\tonIdle?: () => void;\n\tget pending(): boolean {\n\t\treturn this.count > 0;\n\t}\n\tobserve(write: Promise<void>): void {\n\t\tthis.count++;\n\t\tobserveChatWrite(write, new WeakRef(this));\n\t}\n\tsettle(): void {\n\t\tif (--this.count === 0) {\n\t\t\tconst ready = this.onIdle;\n\t\t\tthis.onIdle = undefined;\n\t\t\tready?.();\n\t\t}\n\t}\n}\nfunction observeChatWrite(write: Promise<void>, view: WeakRef<ObservedChatWrites>): void {\n\tvoid write.then(\n\t\t() => view.deref()?.settle(),\n\t\t() => view.deref()?.settle(),\n\t);\n}\n\nconst undeliveredMessages = new WeakMap<TaskViewSource, Map<TaskId, UndeliveredMessage>>();\n/** What the reader had typed in a task's chat when they left it, per chat, for when they come back. */\nconst keptDrafts = new WeakMap<TaskViewSource, Map<TaskId, string>>();\n/** What Up recalled in a task's chat when the reader left it, oldest first, for when they come back. */\nconst keptPromptHistories = new WeakMap<TaskViewSource, Map<TaskId, readonly string[]>>();\n\nfunction failureText(error: unknown): string {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\n/** What the task inspector shows under a task's title while its transcript is open. */\nexport interface TaskTranscriptPage {\n\t/** Loading, retention and failure notes for the page's footer. */\n\treadonly status: string;\n\tload(): Promise<void>;\n\t/** The task changed: follow its session again or read its latest page again. */\n\trefresh(): void;\n\thandleInput(data: string): boolean;\n\t/** Whether the reader is typing, so a key such as Left edits instead of leaving. */\n\thasDraft(): boolean;\n\thasTasks?(): boolean;\n\texpandable?(): boolean;\n\tcanSend?(): boolean;\n\t/** Whether the prompt's cursor is at its start, where ← leaves and keeps any draft for the return. */\n\tcursorAtStart(): boolean;\n\t/** Whether the page takes Escape and Left itself, as while its own task list is open. */\n\thandlesBack(): boolean;\n\ttakesEscape?(): boolean;\n\tcapturesPageScroll?(): boolean;\n\t/** Whether Esc would pause the task now: a turn runs or waits to retry, or messages are queued, as in the main chat. */\n\tinterruptible(): boolean;\n\t/**\n\t * Pauses the task, as Esc does: its queued messages come back to the prompt, steering first, ahead of the draft, and\n\t * its turn ends. The task keeps running, paused, and its next message continues it.\n\t */\n\tinterrupt(): Promise<TaskViewResult<undefined>>;\n\t/**\n\t * Put messages taken back from the task's queue into the prompt, steering messages first and then follow-ups, in\n\t * front of what is typed, as Alt+Up does. Answers how many came back.\n\t */\n\trestoreQueuedToEditor?(taken: QueuedTaskMessages): number;\n\trender(width: number, rows: number): string[];\n\t/** A single click at row `event.y` of the last frame `render` drew; a result when the page takes it. */\n\thandleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;\n\t/** What the last frame `render` drew on `row`, such as the transcript entry there; undefined when it cannot say. */\n\tpaintedRowKey?(row: number): string | undefined;\n\t/** Ctrl+O was pressed where the page is shown: its blocks follow the tool-output setting again. */\n\ttoolOutputToggled?(): void;\n\tinvalidate(): void;\n\tdispose(): void;\n}\n\n/** Atomic's global theme, as the shared chat host's style. */\nexport function themedChatHostStyle(): ChatSessionHostStyle {\n\treturn {\n\t\tdim: (text) => theme.fg(\"dim\", text),\n\t\ttext: (text) => theme.fg(\"text\", text),\n\t\ttextMuted: (text) => theme.fg(\"muted\", text),\n\t\taccent: (text) => theme.fg(\"accent\", text),\n\t\taccentBold: (text) => theme.bold(theme.fg(\"accent\", text)),\n\t\tworkingIndicatorUseGlobalTheme: true,\n\t\trule: (_hex, text) => theme.fg(\"borderMuted\", text),\n\t\tcursor: () => \"\\x1b[7m \\x1b[27m\",\n\t\tblank: (width) => \" \".repeat(Math.max(0, width)),\n\t\teditorRuleColor: () => \"\",\n\t};\n}\n\nfunction keybindingsOf(candidate: unknown): Pick<TuiKeybindingsManager, \"matches\"> {\n\tconst keybindings = candidate as Partial<Pick<TuiKeybindingsManager, \"matches\">> | undefined;\n\treturn typeof keybindings?.matches === \"function\"\n\t\t? (keybindings as Pick<TuiKeybindingsManager, \"matches\">)\n\t\t: getKeybindings();\n}\n\n/** The subagent's footer shows its own session: the extension statuses of the chat that opened it are not its own. */\nfunction withoutExtensionStatuses(data: ReadonlyFooterDataProvider): ReadonlyFooterDataProvider {\n\treturn {\n\t\tgetGitBranch: (cwd) => data.getGitBranch(cwd),\n\t\tgetAvailableProviderCount: () => data.getAvailableProviderCount(),\n\t\tonBranchChange: (callback, cwd) => data.onBranchChange(callback, cwd),\n\t\tgetExtensionStatuses: () => new Map(),\n\t};\n}\n\nfunction defaultUnnamedSessionAlias(sessionId: string): string {\n\tconst normalized = sessionId.startsWith(\"session-\") ? sessionId.slice(\"session-\".length) : sessionId;\n\treturn `subagent-chat-${normalized}`;\n}\n\nfunction friendlyOriginIntercomMessage(\n\tmessage: CustomMessage<unknown>,\n\towner: ChatBoxSession | undefined,\n): CustomMessage<unknown> {\n\tconst details = message.details as\n\t\t| {\n\t\t\t\treadonly from?: { readonly id?: string; readonly name?: string; readonly cwd?: string };\n\t\t }\n\t\t| undefined;\n\tif (!details?.from) return message;\n\tconst ownerSessionId = owner?.sessionManager?.getSessionId?.()?.trim();\n\tif (!ownerSessionId) return message;\n\tconst ownerAlias = defaultUnnamedSessionAlias(ownerSessionId);\n\tconst rawName = details.from.name?.trim() ?? \"\";\n\tconst matchesOwnerAlias = rawName === ownerAlias;\n\tconst matchesOwnerId =\n\t\tdetails.from.id === ownerSessionId && (rawName === \"\" || rawName === ownerSessionId || matchesOwnerAlias);\n\tif (!matchesOwnerAlias && !matchesOwnerId) {\n\t\treturn message;\n\t}\n\treturn {\n\t\t...message,\n\t\tdetails: {\n\t\t\t...(message.details as object),\n\t\t\tfrom: {\n\t\t\t\t...details.from,\n\t\t\t\tname: \"main\",\n\t\t\t},\n\t\t},\n\t};\n}\n\n/** A subagent stopped resumably (`x x`, Ctrl+X Ctrl+K): a message resumes it, and never anything else. */\nexport const STOPPED_NOTE = \"Stopped · send to resume\";\n/** A subagent paused from its chat (Esc): it is still running, and a message continues it. */\nexport const PAUSED_NOTE = \"Paused · send to continue\";\n\n/** A note under the transcript on the single chat screen: at most two rows, cut to the width. */\nfunction wrapViewNote(note: string, width: number): string[] {\n\tconst room = Math.max(1, width);\n\tconst rows = wrapTextWithAnsi(note, room);\n\tconst shown = rows.slice(0, 2).map((row) => truncateToWidth(row, room));\n\tif (rows.length > 2) shown[1] = truncateToWidth(`${rows[1]}…`, room);\n\treturn shown;\n}\n\nconst PAGE_UP = \"\\x1b[5~\";\nconst PAGE_DOWN = \"\\x1b[6~\";\n/** The screen's scroll keys the transcript's own viewport answers, besides the page keys, lines and the wheel. */\nconst VIEW_KEY_ACTIONS = [\n\t\"tui.altScreen.halfPageUp\",\n\t\"tui.altScreen.halfPageDown\",\n\t\"tui.altScreen.previousPrompt\",\n\t\"tui.altScreen.nextPrompt\",\n\t\"tui.altScreen.top\",\n\t\"tui.altScreen.bottom\",\n] as const;\n\n/** Printable text, Enter, Backspace or Delete: keys that type into or send the prompt. */\nfunction isTyping(data: string): boolean {\n\tif (matchesKey(data, \"enter\") || matchesKey(data, \"backspace\") || matchesKey(data, \"delete\")) return true;\n\treturn [...data].every((ch) => ch >= \" \" && ch !== \"\\x7f\");\n}\n\ninterface AdjacentRequest {\n\tedge: \"older\" | \"newer\";\n\tcursor: string;\n\tgeneration: number;\n\tcontroller: AbortController;\n\tsource?: WeakRef<TaskTranscriptSource>;\n}\nconst finishAdjacent = Symbol();\nfunction deliverAdjacent(\n\tweak: WeakRef<TaskAgentTranscriptPage>,\n\trequest: AdjacentRequest,\n\tread: TaskViewResult<TaskTranscriptView> | Promise<TaskViewResult<TaskTranscriptView>>,\n): void {\n\tvoid Promise.resolve(read).then(\n\t\t(page) => weak.deref()?.[finishAdjacent](request, page),\n\t\t(error) => weak.deref()?.[finishAdjacent](request, { ok: false, error: { message: failureText(error) } }),\n\t);\n}\n\n/**\n * An agent task's transcript on the shared chat host: it opens at the latest page, follows the task's live session\n * where it has one, loads earlier retained history as the reader nears the top, and sends what the reader types to\n * the task through its Intercom target.\n */\nexport class TaskAgentTranscriptPage implements TaskTranscriptPage {\n\tprivate readonly elapsedClocks: TaskElapsedClocks;\n\t/** How many rows the transcript took at the top of the last frame. */\n\tprivate bodyRows = 0;\n\t/** How the last `renderView` laid out its frame. */\n\tprivate viewLayout: TranscriptFrameLayout | undefined;\n\treadonly chat: ChatSessionHost;\n\tprivate loadStatus = \"Loading transcript…\";\n\t/** Loading and failure notes, then why the chat is read-only when it is. */\n\tget status(): string {\n\t\treturn [this.loadStatus, this.releasedNote() ?? \"\", this.readOnlyReason() ?? \"\"].filter(Boolean).join(\" · \");\n\t}\n\t/**\n\t * What a subagent released while it waits waits on, that it wakes by itself, and the shells it launched that still\n\t * run, with the key that opens the newest one's output. Its transcript is its saved session, read without waking it.\n\t */\n\tprivate releasedNote(): string | undefined {\n\t\tconst task = this.liveTask();\n\t\tconst waitingOn =\n\t\t\ttask?.execution.kind === \"settled\" && waitingReleasedTools(task) !== undefined\n\t\t\t\t? releasedWaitingOn(task.execution.result)\n\t\t\t\t: undefined;\n\t\tif (task === undefined || waitingOn === undefined) return undefined;\n\t\tconst shells = waitingReleasedShells(task, this.source.ownerTasks ?? this.source.tasks);\n\t\tconst openKey = navActionText(getKeybindings(), \"app.tasks.openWaited\");\n\t\tconst opens = openKey ? clickableKeyTextHint(openKey, \" opens\") : \"/tasks opens\";\n\t\tconst shellNote =\n\t\t\tshells.length === 0\n\t\t\t\t? \"\"\n\t\t\t\t: shells.length === 1\n\t\t\t\t\t? ` · its shell ${taskDisplayText(shortTaskTitle(shells[0]!.title || \"shell\"))} is running · ${opens} it`\n\t\t\t\t\t: ` · ${shells.length} of its shells are running · ${opens} ${openKey ? \"the newest\" : \"them\"}`;\n\t\treturn `Waiting on ${taskDisplayText(waitingOn)} · wakes by itself when it finishes${shellNote}`;\n\t}\n\tset status(value: string) {\n\t\tthis.loadStatus = value;\n\t}\n\t/** Why messages cannot reach this task any more, or `undefined` while they can. */\n\treadOnlyReason(): string | undefined {\n\t\treturn this.source.taskReadOnlyReason?.(this.liveTaskId());\n\t}\n\tprivate readonly source: TaskViewSource;\n\t/**\n\t * The attempt whose transcript the page shows and follows. A resumed subagent runs as a new task in the same\n\t * conversation: the page moves to it on its next read, as the subagent's one row in the lists does.\n\t */\n\tprivate taskId: TaskId;\n\tprivate readonly env: TaskTranscriptEnvironment;\n\tprivate readonly requestRender: () => void;\n\tprivate followed?: TaskTranscriptSource;\n\tprivate followedSessionId?: string;\n\tprivate legacyWindow?: ReturnType<typeof retainTaskWindowReader>;\n\tprivate legacyWindowActive = false;\n\tprivate observedWrites?: ObservedChatWrites;\n\tprivate unsubscribe?: () => void;\n\tprivate cursor?: string;\n\tprivate newerCursor?: string;\n\tprivate liveHistoryStart?: string;\n\tprivate olderIntent = false;\n\t/** Which way the reader last scrolled: a live chat reads saved pages only that way, never both at once. */\n\tprivate travel: \"older\" | \"newer\" | undefined;\n\tprivate goToFirst = false;\n\tprivate windowGeneration = 0;\n\tprivate readonly savedPages: (SavedPageHandle & { older?: string; newer?: string })[] = [];\n\t/** Reads of the single saved entries next to the shown window; a new window or a closed view stops them. */\n\tprivate boundaryReads = new AbortController();\n\treadonly #notices = new TaskTranscriptNotices();\n\tprivate loading = false;\n\tprivate reloadPending = false;\n\tprivate loadingEarlier?: AdjacentRequest;\n\tprivate failedCursor?: string;\n\tprivate latestRead?: AbortController;\n\t/** A history-only transcript changed while the reader was away from its end; it is read again when they return. */\n\tprivate behind = false;\n\t/** A compaction retired the window while the reader was above its end: the next window keeps what they see. */\n\tprivate parkOnLoad = false;\n\tprivate disposed = false;\n\tprivate shownPromptSessionId?: string;\n\tprivate readonly unsubscribePrompts: () => void;\n\n\tprivate readonly reportLate: (reason: string) => void;\n\tprivate readonly showKeys: (() => void) | undefined;\n\n\t/**\n\t * `reportLate` shows the reason a message failed after the reader left this transcript; `showKeys` opens the chat's\n\t * keys, as `/hotkeys` does.\n\t */\n\tconstructor(\n\t\tsource: TaskViewSource,\n\t\ttaskId: TaskId,\n\t\tenv: TaskTranscriptEnvironment,\n\t\trequestRender: () => void,\n\t\treportLate: (reason: string) => void = (reason) => env.notify?.(reason),\n\t\toptions: { readonly showKeys?: () => void } = {},\n\t) {\n\t\tthis.source = source;\n\t\tthis.elapsedClocks = taskClocksFor(source);\n\t\tthis.taskId = latestSubagentAttempt(source.tasks, taskId)?.ref.taskId ?? taskId;\n\t\tthis.env = env;\n\t\tthis.requestRender = requestRender;\n\t\tthis.reportLate = reportLate;\n\t\tthis.showKeys = options.showKeys;\n\t\tthis.chat = env.createChat({\n\t\t\tstyle: env.style,\n\t\t\ttui: env.tui,\n\t\t\tkeybindings: env.keybindings,\n\t\t\teditorTheme: env.editorTheme,\n\t\t\teditorFactory: env.editorFactory,\n\t\t\tgetChatRenderSettings: () => {\n\t\t\t\tconst inherited = env.getChatRenderSettings?.();\n\t\t\t\treturn {\n\t\t\t\t\t...inherited,\n\t\t\t\t\tcreateToolComponent: inherited?.createToolComponent\n\t\t\t\t\t\t? (entry, context) =>\n\t\t\t\t\t\t\t\tinherited.createToolComponent!({ ...entry, rendererTaskId: this.taskId }, context)\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tgetToolDefinition: (toolName) => {\n\t\t\t\t\t\tconst session = this.followed?.chatSession;\n\t\t\t\t\t\tif (session?.getToolDefinition || session?.extensionRunner?.resolveToolRenderers) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\tsession.extensionRunner?.resolveToolRenderers?.(toolName, () =>\n\t\t\t\t\t\t\t\t\tsession.getToolDefinition?.(toolName),\n\t\t\t\t\t\t\t\t) ??\n\t\t\t\t\t\t\t\tsession.getToolDefinition?.(toolName) ??\n\t\t\t\t\t\t\t\tunavailableToolRenderer(toolName)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst owner = getOwnerTaskSession(this.source) as ChatBoxSession | undefined;\n\t\t\t\t\t\treturn retainedToolRenderer(\n\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t(name) =>\n\t\t\t\t\t\t\t\tinherited?.getToolDefinition?.(name) ??\n\t\t\t\t\t\t\t\towner?.extensionRunner?.resolveToolRenderers?.(name, () => owner.getToolDefinition?.(name)) ??\n\t\t\t\t\t\t\t\towner?.getToolDefinition?.(name),\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\tgetCustomMessageRenderer: (customType) => {\n\t\t\t\t\t\tconst owner = getOwnerTaskSession(this.source) as ChatBoxSession | undefined;\n\t\t\t\t\t\tconst base =\n\t\t\t\t\t\t\tthis.followed?.chatSession?.extensionRunner?.getMessageRenderer?.(customType) ??\n\t\t\t\t\t\t\tinherited?.getCustomMessageRenderer?.(customType) ??\n\t\t\t\t\t\t\towner?.extensionRunner?.getMessageRenderer?.(customType);\n\t\t\t\t\t\tif (!base || customType !== \"intercom_message\") return base;\n\t\t\t\t\t\treturn (message, renderOptions, renderTheme) =>\n\t\t\t\t\t\t\tbase(friendlyOriginIntercomMessage(message, owner), renderOptions, renderTheme);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t\t...(env.footerData === undefined ? {} : { footerData: withoutExtensionStatuses(env.footerData) }),\n\t\t\tgetChatBoxSession: () => this.followed?.chatSession,\n\t\t\tgetPromptEntries: () =>\n\t\t\t\t(this.followed ?? this.source.followTaskTranscript(this.taskId)?.session)?.getEntries(),\n\t\t\trequestRender,\n\t\t\ttaskRowsInChat: false,\n\t\t\tsavedTaskPages: true,\n\t\t\tliveRowOrigin: (seq) => {\n\t\t\t\tconst session = this.followed ?? this.source.followTaskTranscript(this.taskId)?.session;\n\t\t\t\treturn session === undefined ? undefined : liveTaskRowOrigin(session, this.taskId, seq);\n\t\t\t},\n\t\t\tisStreaming: () => this.followed?.getStreamingMessage?.() !== undefined,\n\t\t\t// The inspector takes Esc for this chat: it cancels the retry the subagent waits on, unless a question holds it.\n\t\t\tcanCancelRetry: () => !this.takesEscape() && this.interruptible(),\n\t\t\tworkingTokenCount: () => this.liveTask()?.metrics?.tokenCount,\n\t\t\t// A finished subagent's chat stays live, and a message resumes it; one stopped for good is read-only.\n\t\t\tisDisabled: () => source.sendTaskMessage === undefined || this.readOnlyReason() !== undefined,\n\t\t\tonNearTop: () => this.loadAdjacent(\"older\"),\n\t\t\tonNearBottom: () => this.loadAdjacent(\"newer\"),\n\t\t\t// A subagent's `/tasks` lists the tasks it launched.\n\t\t\tgetTaskSource: () => launchedTaskViewSource(source, taskId),\n\t\t\t// The completion the subagent's chat offers, from its own cwd and skills.\n\t\t\tautocompleteProvider: createSessionSkillAutocompleteProvider(async () => {\n\t\t\t\tconst commands = await source.taskCommands?.(this.liveTaskId());\n\t\t\t\treturn commands === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: { cwd: commands.cwd, skillCommands: getSkillCatalogCommands(commands.skillCommands) };\n\t\t\t}),\n\t\t\t// What the reader types goes to the subagent's own session as the main chat's goes to its own: queued in its\n\t\t\t// lane while it works, else its next turn, and the dequeue key takes the queue back.\n\t\t\tsteering: this.steeringTarget(),\n\t\t\t// Esc paused it: the reader's next message continues it, as their send continues the main chat after Esc.\n\t\t\tisPaused: () => this.paused(),\n\t\t\tcommands: { handleSlashCommand: (text) => this.runCommand(text) },\n\t\t});\n\t\tpagedNotices.set(this.chat, this.#notices);\n\t\tthis.chat.seedPromptHistory(keptPromptHistories.get(source)?.get(taskId) ?? []);\n\t\tthis.restoreDraft();\n\t\tthis.restoreUndelivered();\n\t\tthis.unsubscribePrompts = heldPrompts().subscribe((sessionId) => {\n\t\t\tif (sessionId === this.childSessionId() || sessionId === this.shownPromptSessionId) this.requestRender();\n\t\t});\n\t}\n\n\tprivate childSessionId(): string | undefined {\n\t\tconst task = this.liveTask();\n\t\tconst sessionId =\n\t\t\ttask?.attention.kind === \"input-needed\"\n\t\t\t\t? task.attention.route.sessionId\n\t\t\t\t: (this.followed?.getSessionId() ?? this.source.followTaskTranscript(this.taskId)?.session?.getSessionId());\n\t\tif (sessionId !== undefined) this.shownPromptSessionId = sessionId;\n\t\treturn sessionId;\n\t}\n\n\theldPrompt(): HeldPrompt | undefined {\n\t\tconst task = this.liveTask();\n\t\tif (task?.execution.kind === \"settled\") return undefined;\n\t\tconst sessionId = this.childSessionId();\n\t\treturn sessionId === undefined ? undefined : heldPrompts().current(sessionId);\n\t}\n\n\tprivate heldForm(): HeldPromptForm | undefined {\n\t\tconst prompt = this.heldPrompt();\n\t\tif (prompt === undefined) return undefined;\n\t\treturn heldPromptForm(prompt, {\n\t\t\t...(this.env.tui === undefined ? {} : { tui: this.env.tui }),\n\t\t\t...(this.env.keybindings instanceof KeybindingsManager ? { keybindings: this.env.keybindings } : {}),\n\t\t\trequestRender: this.requestRender,\n\t\t});\n\t}\n\n\t/**\n\t * The latest attempt of this chat's subagent, which its state, prompt, messages and interrupt are about: a resume\n\t * runs the subagent as a new task, and a message typed here goes to the attempt that runs now.\n\t */\n\tprivate liveTask(): TaskRecord | undefined {\n\t\treturn latestSubagentAttempt(this.source.tasks, this.taskId);\n\t}\n\n\tprivate liveTaskId(): TaskId {\n\t\treturn this.liveTask()?.ref.taskId ?? this.taskId;\n\t}\n\n\t/**\n\t * The attempt the page reads: the live one, once there is a session to follow. A resumed attempt is listed before\n\t * its session is bound, and until then the page keeps the conversation it shows rather than read nothing.\n\t */\n\tprivate readTarget(): TaskId {\n\t\tconst live = this.liveTaskId();\n\t\tif (live === this.taskId) return live;\n\t\treturn this.source.followTaskTranscript(live) === undefined &&\n\t\t\tthis.source.followTaskTranscript(this.taskId) !== undefined\n\t\t\t? this.taskId\n\t\t\t: live;\n\t}\n\n\t/** Restores what was typed here before the reader left. */\n\tprivate restoreDraft(): void {\n\t\tconst kept = keptDrafts.get(this.source);\n\t\tconst draft = kept?.get(this.taskId);\n\t\tif (draft === undefined) return;\n\t\tkept?.delete(this.taskId);\n\t\tthis.chat.setInputText(draft);\n\t}\n\n\tasync load(): Promise<void> {\n\t\tif (this.loading) {\n\t\t\tthis.reloadPending = true;\n\t\t\treturn;\n\t\t}\n\t\t// The latest page is the live attempt's: a resumed subagent's chat follows the attempt that runs now.\n\t\tconst id = this.readTarget();\n\t\tif (this.observedWrites?.pending && this.deferArchiveRead(this.source.followTaskTranscript(id))) return;\n\t\tthis.loading = true;\n\t\tconst controller = new AbortController();\n\t\tthis.latestRead = controller;\n\t\ttry {\n\t\t\t// A synchronous read subscribes in the same turn. A pending read never binds old rows to a replacement owner.\n\t\t\tconst before = this.source.followTaskTranscript(id);\n\t\t\tconst read = readTaskPageForChat(this, this.source, id, undefined, controller.signal);\n\t\t\tconst page = read instanceof Promise ? await read : read;\n\t\t\tif (this.disposed) return;\n\t\t\tif (\n\t\t\t\tread instanceof Promise &&\n\t\t\t\t(id !== this.readTarget() || before?.session !== this.source.followTaskTranscript(id)?.session)\n\t\t\t) {\n\t\t\t\tthis.reloadPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.adoptLatestPage(page, id);\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.status = error instanceof Error ? error.message : String(error);\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t\tthis.requestRender();\n\t\t\tif (this.reloadPending && !this.disposed) {\n\t\t\t\tthis.reloadPending = false;\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deferArchiveRead(follow: ReturnType<TaskViewSource[\"followTaskTranscript\"]>): boolean {\n\t\tconst writes = this.observedWrites;\n\t\tif (\n\t\t\t!writes?.pending ||\n\t\t\t!follow?.historyOnly ||\n\t\t\t!this.followedSessionId ||\n\t\t\tfollow.session?.getSessionId() !== this.followedSessionId\n\t\t)\n\t\t\treturn false;\n\t\tif (this.followed) {\n\t\t\tthis.unsubscribe?.();\n\t\t\tthis.unsubscribe = undefined;\n\t\t\tthis.followed = undefined;\n\t\t\tthis.chat.resetFollowedSession({ preserveWorkedRun: true });\n\t\t\tthis.chat.refreshTaskStore();\n\t\t}\n\t\twrites.onIdle = () => {\n\t\t\tif (!this.disposed) {\n\t\t\t\tobservedTaskChatWrite(this);\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t};\n\t\treturn true;\n\t}\n\n\trefresh(): void {\n\t\tif (this.disposed) return;\n\t\tconst follow = this.source.followTaskTranscript(this.readTarget());\n\t\tif (this.deferArchiveRead(follow)) return;\n\t\tif (follow?.session !== undefined && follow.session === this.followed) return;\n\t\t// Reading a history-only transcript again replaces what is shown, so it waits while the reader is above the end.\n\t\tif (follow?.historyOnly === true && (this.newerCursor !== undefined || this.chat.bodyScrollFromBottom() > 0)) {\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\tvoid this.load();\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tconst handled = this.route(data);\n\t\tthis.catchUp();\n\t\treturn handled;\n\t}\n\n\t/** A history-only transcript that changed while the reader was above its end is read again once they are back. */\n\tprivate catchUp(): void {\n\t\tif (this.behind && this.newerCursor === undefined && this.chat.bodyScrollFromBottom() === 0) {\n\t\t\tthis.behind = false;\n\t\t\tvoid this.load();\n\t\t}\n\t}\n\n\t/**\n\t * A scroll or paging key for the transcript where it is shown on the single chat screen: the page keys, the wheel,\n\t * a line, half a page, the previous or next prompt, the top and the bottom, and the jump to the latest row. Earlier\n\t * and later pages are read the way the reader scrolls, as in the chat page. Answers whether it was such a key.\n\t */\n\thandleViewKey(data: string): boolean {\n\t\tif (this.disposed || this.chat.hasTaskInspector) return false;\n\t\tconst keybindings = keybindingsOf(this.env.keybindings);\n\t\tconst line = keybindings.matches(data, \"tui.altScreen.lineUp\")\n\t\t\t? -1\n\t\t\t: keybindings.matches(data, \"tui.altScreen.lineDown\")\n\t\t\t\t? 1\n\t\t\t\t: 0;\n\t\t// The screen's page keys may be remapped; the transcript's viewport pages on the keys themselves.\n\t\tif (keybindings.matches(data, \"tui.altScreen.pageUp\")) data = PAGE_UP;\n\t\telse if (keybindings.matches(data, \"tui.altScreen.pageDown\")) data = PAGE_DOWN;\n\t\tif (\n\t\t\tdata !== TRANSCRIPT_JUMP_TO_END_URL &&\n\t\t\tline === 0 &&\n\t\t\t!parseWheelReport(data) &&\n\t\t\t!matchesKey(data, \"pageUp\") &&\n\t\t\t!matchesKey(data, \"pageDown\") &&\n\t\t\t!VIEW_KEY_ACTIONS.some((action) => keybindings.matches(data, action))\n\t\t)\n\t\t\treturn false;\n\t\tif (line !== 0) {\n\t\t\tthis.failedCursor = undefined;\n\t\t\tif (line < 0) {\n\t\t\t\tthis.goToFirst = false;\n\t\t\t\tthis.olderIntent = true;\n\t\t\t\tthis.travel = \"older\";\n\t\t\t} else this.travel = \"newer\";\n\t\t\tconst top = Math.max(0, this.chat.bodyMaxScroll() - this.chat.bodyScrollFromBottom());\n\t\t\tthis.chat.scrollBodyTo(Math.max(0, top + line));\n\t\t\tthis.requestRender();\n\t\t} else this.route(data);\n\t\tthis.catchUp();\n\t\treturn true;\n\t}\n\n\tprivate route(data: string): boolean {\n\t\tif (data === TRANSCRIPT_JUMP_TO_END_URL) {\n\t\t\tif (this.newerCursor !== undefined || this.savedPages.length || this.loadingEarlier)\n\t\t\t\tthis.goToLatestSavedPage();\n\t\t\tthis.chat.scrollToBottom();\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst keybindings = keybindingsOf(this.env.keybindings);\n\t\tif (\n\t\t\tthis.failedCursor &&\n\t\t\t(parseWheelReport(data) ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.top\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.bottom\"))\n\t\t)\n\t\t\tthis.failedCursor = undefined;\n\t\tif (!this.chat.hasTaskInspector && this.chat.hasTransientModal) {\n\t\t\tconst handled = this.chat.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn handled;\n\t\t}\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\tkeybindings.matches(data, \"app.agents.focus\") &&\n\t\t\t(!this.hasDraft() || isHintActivation())\n\t\t) {\n\t\t\treturn this.hasTasks() ? this.chat.openTasks() : true;\n\t\t}\n\t\t// The host owns thinking display; only its default physical key leaves the composer.\n\t\tif (matchesKey(data, \"ctrl+t\") && keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\t\tif (keybindings.matches(data, \"app.tools.expand\")) {\n\t\t\tif (this.env.setToolsExpanded === undefined) return false;\n\t\t\tthis.env.setToolsExpanded(this.env.getToolsExpanded?.() !== true);\n\t\t\tthis.chat.toolOutputToggled();\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tif (form !== undefined) {\n\t\t\tconst selectorPages =\n\t\t\t\tthis.capturesPageScroll() && (matchesKey(data, \"pageUp\") || matchesKey(data, \"pageDown\"));\n\t\t\tif (!selectorPages && this.chat.handleScrollInput(data)) {\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tform.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (!this.chat.hasTaskInspector) {\n\t\t\tif (keybindings.matches(data, \"tui.altScreen.top\")) this.goToFirst = true;\n\t\t\telse if (\n\t\t\t\tparseWheelReport(data) ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageUp\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.previousPrompt\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.nextPrompt\")\n\t\t\t)\n\t\t\t\tthis.goToFirst = false;\n\t\t}\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(keybindings.matches(data, \"tui.altScreen.top\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.halfPageUp\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.previousPrompt\") ||\n\t\t\t\tmatchesKey(data, \"pageUp\") ||\n\t\t\t\tparseWheelReport(data)?.direction === -1)\n\t\t) {\n\t\t\tthis.olderIntent = true;\n\t\t\tthis.travel = \"older\";\n\t\t} else if (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(keybindings.matches(data, \"tui.altScreen.halfPageDown\") ||\n\t\t\t\tkeybindings.matches(data, \"tui.altScreen.nextPrompt\") ||\n\t\t\t\tmatchesKey(data, \"pageDown\") ||\n\t\t\t\tparseWheelReport(data)?.direction === 1)\n\t\t)\n\t\t\tthis.travel = \"newer\";\n\t\tif (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\t(this.newerCursor !== undefined || this.savedPages.length > 0 || this.loadingEarlier) &&\n\t\t\tkeybindings.matches(data, \"tui.altScreen.bottom\")\n\t\t) {\n\t\t\tthis.goToLatestSavedPage();\n\t\t\treturn true;\n\t\t}\n\t\t// A read-only chat scrolls and keeps its keys, but takes no typing: nothing it sends could reach the task.\n\t\tif (!this.chat.hasTaskInspector && this.readOnlyReason() !== undefined && isTyping(data)) return true;\n\t\t// The subagent's own task list is modal while it is open.\n\t\tconst handled = this.chat.hasTaskInspector ? this.chat.handleTaskInput(data) : this.chat.handleInput(data);\n\t\tthis.requestRender();\n\t\treturn handled;\n\t}\n\n\t/** A single click on any row of a block in the transcript expands or collapses that block. */\n\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\tif (event.y < 0 || event.y >= this.bodyRows) return undefined;\n\t\t// While the task's held question owns input below the transcript, a click on the transcript does nothing.\n\t\tif (!this.chat.hasTaskInspector && this.heldPrompt() !== undefined) return undefined;\n\t\treturn repaintAfterSingleClick(this.chat.handleBodyClick(event), () => this.requestRender());\n\t}\n\n\tpaintedRowKey(row: number): string | undefined {\n\t\treturn row < 0 || row >= this.bodyRows ? undefined : this.chat.bodyRowKey(row);\n\t}\n\n\ttoolOutputToggled(): void {\n\t\tthis.chat.toolOutputToggled();\n\t}\n\n\t/**\n\t * The transcript alone, `rows` rows tall, as the single chat screen draws it where the main transcript is: the body,\n\t * then the page's notes (loading, read failures, what a released subagent waits on, why it is read-only) in dim\n\t * rows, then the question form a held prompt opens, which keeps its rows first.\n\t */\n\trenderView(width: number, rows: number): string[] {\n\t\tlet remaining = Math.max(0, rows);\n\t\tthis.bodyRows = 0;\n\t\tthis.viewLayout = undefined;\n\t\tif (remaining === 0) return [];\n\t\tlet cut = false;\n\t\tconst reserve = (lines: readonly string[], fromEnd = false): string[] => {\n\t\t\t// The transcript keeps a row whatever the form and notes take.\n\t\t\tconst room = Math.max(0, remaining - 1);\n\t\t\tconst shown = fromEnd ? lines.slice(Math.max(0, lines.length - room)) : lines.slice(0, room);\n\t\t\tif (shown.length < lines.length) cut = true;\n\t\t\tremaining -= shown.length;\n\t\t\treturn shown;\n\t\t};\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tconst formLines = form === undefined ? [] : reserve(form.render(width));\n\t\tconst note = this.status;\n\t\tconst notes = note\n\t\t\t? reserve(\n\t\t\t\t\twrapViewNote(note, width).map((line) => this.env.style.dim(line)),\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t: [];\n\t\tconst body = this.chat.renderBody(width, remaining);\n\t\tthis.bodyRows = body.length;\n\t\tconst gap = Array.from({ length: Math.max(0, remaining - body.length) }, () => \"\");\n\t\tconst painted = this.chat.bodyWindow();\n\t\t// Notes or a form cut to fit leave rows the frame does not have: such a frame says nothing of its layout.\n\t\tif (!cut && painted !== undefined && painted.rows === body.length && gap.length === 0)\n\t\t\tthis.viewLayout = {\n\t\t\t\twidth,\n\t\t\t\tbodyRows: body.length,\n\t\t\t\tfirstRow: painted.firstRow,\n\t\t\t\ttotalRows: painted.totalRows,\n\t\t\t\theadRows: painted.headRows,\n\t\t\t\tfootRows: painted.footRows,\n\t\t\t};\n\t\treturn [...body, ...gap, ...notes, ...formLines];\n\t}\n\n\t/** How the last `renderView` laid out its frame, when the frame shows the scrolled transcript over notes and form. */\n\tviewFrameLayout(): TranscriptFrameLayout | undefined {\n\t\treturn this.viewLayout;\n\t}\n\n\t/** Whether the question form of a held prompt is open in the view and takes the keys. */\n\tcapturesInput(): boolean {\n\t\treturn !this.chat.hasTaskInspector && this.heldPrompt() !== undefined;\n\t}\n\n\t/** The subagent is no longer listed (dismissed or removed): the screen showing it shows main again. */\n\tget gone(): boolean {\n\t\tif (this.disposed) return true;\n\t\tconst task = this.liveTask();\n\t\treturn task === undefined || dismissedTasks(this.source).has(task.ref.taskId);\n\t}\n\n\t/** The subagent as the single chat screen's prompt, rule, working line and panel show it. */\n\tviewStatus(agentKey: string): AgentViewStatus {\n\t\tconst { name, label, placeholder, state } = this.composerText(\"view\");\n\t\tconst session = this.followed;\n\t\tconst retrying = session?.chatSession?.isRetrying === true;\n\t\tconst busy = session?.isRunning?.() === true || retrying;\n\t\tconst queued = this.chat.queuedMessages();\n\t\tconst delivering = this.chat.deliveringMessages();\n\t\tconst readOnlyReason =\n\t\t\tthis.readOnlyReason() ??\n\t\t\t(this.source.sendTaskMessage === undefined ? \"Messages cannot reach this subagent from here.\" : undefined);\n\t\tconst working = this.chat.workingLine(this.source.followTaskTranscript(this.liveTaskId())?.publishedActivity);\n\t\treturn {\n\t\t\ttaskId: this.liveTaskId(),\n\t\t\tagentKey,\n\t\t\tname,\n\t\t\truleLabel: label,\n\t\t\tplaceholder,\n\t\t\tstate,\n\t\t\tbusy,\n\t\t\tpaused: this.paused(),\n\t\t\tretrying,\n\t\t\tqueued: { steering: [...queued.steering], followUp: [...queued.followUp] },\n\t\t\t...(delivering.steering.length === 0 && delivering.followUp.length === 0\n\t\t\t\t? {}\n\t\t\t\t: { delivering: { steering: [...delivering.steering], followUp: [...delivering.followUp] } }),\n\t\t\t...(readOnlyReason === undefined ? {} : { readOnlyReason }),\n\t\t\theldPrompt: this.heldPrompt() !== undefined,\n\t\t\t...(working === undefined ? {} : { working }),\n\t\t\tgone: this.gone,\n\t\t};\n\t}\n\n\t/** The chat box of a subagent's chat: the transcript, then pending, working, usage, the named editor and the footer. */\n\trender(width: number, rows: number): string[] {\n\t\tconst viewport = Math.max(1, rows);\n\t\tthis.bodyRows = 0;\n\t\tif (this.chat.hasTaskInspector) {\n\t\t\tconst footer = this.chat.taskInspectorFullscreen ? [] : this.chat.renderFooter(width);\n\t\t\tconst shownFooter = footer.slice(0, viewport - 1);\n\t\t\t// The chat's own task list or a task's transcript takes the top rows, and clicks there.\n\t\t\tconst body = this.chat.renderBody(width, viewport - shownFooter.length);\n\t\t\tthis.bodyRows = body.length;\n\t\t\treturn [...body, ...shownFooter];\n\t\t}\n\t\tlet remaining = viewport;\n\t\t// The editor keeps its rows first, then the footer, then the status rows; the transcript takes what is left.\n\t\tconst reserve = (lines: string[], fromEnd = false): string[] => {\n\t\t\tconst shown = fromEnd ? lines.slice(Math.max(0, lines.length - remaining)) : lines.slice(0, remaining);\n\t\t\tremaining -= shown.length;\n\t\t\treturn shown;\n\t\t};\n\t\tconst form = this.heldForm();\n\t\tconst editor = reserve(\n\t\t\tform !== undefined ? form.render(width) : this.decorateComposer(this.chat.renderEditor(width)),\n\t\t);\n\t\tconst footer = reserve(this.chat.renderFooter(width));\n\t\tconst pending = reserve(this.chat.renderPendingMessages(width));\n\t\tconst working = reserve(\n\t\t\tthis.chat.renderWorkingStatus(width, this.source.followTaskTranscript(this.liveTaskId())?.publishedActivity),\n\t\t\ttrue,\n\t\t);\n\t\tconst usage = reserve(this.chat.renderUsageRow(width));\n\t\tconst body = remaining > 0 ? this.chat.renderBody(width, remaining) : [];\n\t\tthis.bodyRows = body.length;\n\t\treturn [...body, ...pending, ...working, ...usage, ...editor, ...footer];\n\t}\n\n\t/**\n\t * The composer's top-rule label (`name · title · state`), its empty-prompt placeholder and the state they show:\n\t * needs input, done, failed, paused, stopped, waiting on what it released, or its elapsed time while it runs.\n\t */\n\tprivate composerText(at: \"page\" | \"view\" = \"page\"): {\n\t\treadonly name: string;\n\t\treadonly label: string;\n\t\treadonly placeholder: string;\n\t\treadonly state: AgentViewState;\n\t} {\n\t\tconst task = this.liveTask();\n\t\tconst name = taskDisplayText(task?.agentName ?? this.sessionName() ?? \"subagent\");\n\t\tconst waiting = task?.attention.kind === \"input-needed\";\n\t\tconst paused = this.paused();\n\t\tconst outcome = task?.execution.kind === \"settled\" ? taskState(task) : undefined;\n\t\tconst state =\n\t\t\ttask === undefined\n\t\t\t\t? undefined\n\t\t\t\t: waiting\n\t\t\t\t\t? \"needs input\"\n\t\t\t\t\t: outcome !== undefined\n\t\t\t\t\t\t? outcome === \"completed\"\n\t\t\t\t\t\t\t? \"done\"\n\t\t\t\t\t\t\t: outcome\n\t\t\t\t\t\t: paused\n\t\t\t\t\t\t\t? \"paused\"\n\t\t\t\t\t\t\t: task.metrics?.elapsedMs === undefined\n\t\t\t\t\t\t\t\t? \"running\"\n\t\t\t\t\t\t\t\t: formatPanelElapsed(\n\t\t\t\t\t\t\t\t\t\ttaskElapsedMs(task, taskClockRunning(task.execution.kind), this.elapsedClocks) ??\n\t\t\t\t\t\t\t\t\t\t\ttask.metrics.elapsedMs,\n\t\t\t\t\t\t\t\t\t);\n\t\tconst released = task === undefined ? undefined : waitingReleasedTools(task);\n\t\tconst stopped = !paused && released === undefined && this.source.taskStopped?.(this.liveTaskId()) === true;\n\t\tconst label = [\n\t\t\tname,\n\t\t\ttask?.title ? taskDisplayText(shortTaskTitle(task.title)) : \"\",\n\t\t\tstopped ? \"stopped\" : released !== undefined ? `waiting on ${taskDisplayText(released)}` : (state ?? \"\"),\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" · \");\n\t\tconst addressed = at === \"view\" ? `@${name}` : name;\n\t\tconst placeholder = paused\n\t\t\t? PAUSED_NOTE\n\t\t\t: stopped\n\t\t\t\t? STOPPED_NOTE\n\t\t\t\t: released !== undefined\n\t\t\t\t\t? `Message ${addressed} to wake it…`\n\t\t\t\t\t: `${waiting ? \"Answer\" : \"Message\"} ${addressed}…`;\n\t\tconst viewState: AgentViewState = waiting\n\t\t\t? \"input\"\n\t\t\t: stopped\n\t\t\t\t? \"stopped\"\n\t\t\t\t: released !== undefined\n\t\t\t\t\t? \"waiting\"\n\t\t\t\t\t: paused\n\t\t\t\t\t\t? \"paused\"\n\t\t\t\t\t\t: outcome === undefined\n\t\t\t\t\t\t\t? task?.execution.kind === \"cancelling\"\n\t\t\t\t\t\t\t\t? \"stopping\"\n\t\t\t\t\t\t\t\t: task?.execution.kind === \"queued\"\n\t\t\t\t\t\t\t\t\t? \"queued\"\n\t\t\t\t\t\t\t\t\t: \"running\"\n\t\t\t\t\t\t\t: outcome === \"completed\"\n\t\t\t\t\t\t\t\t? \"done\"\n\t\t\t\t\t\t\t\t: outcome === \"killed\" || outcome === \"cancelled\" || outcome === \"paused\"\n\t\t\t\t\t\t\t\t\t? \"stopped\"\n\t\t\t\t\t\t\t\t\t: \"failed\";\n\t\treturn { name, label, placeholder, state: viewState };\n\t}\n\n\tprivate decorateComposer(lines: readonly string[]): string[] {\n\t\tconst { label, placeholder } = this.composerText();\n\t\treturn applyAttachedComposer(\n\t\t\t{ accent: this.env.style.accent, text: this.env.style.text, dim: this.env.style.dim },\n\t\t\tlabel,\n\t\t\tthis.chat.hasInputText() || this.source.sendTaskMessage === undefined || this.readOnlyReason() !== undefined\n\t\t\t\t? undefined\n\t\t\t\t: placeholder,\n\t\t\tlines,\n\t\t);\n\t}\n\n\t/** What the subagent's session is called: its Intercom name, else its agent's name. */\n\tprivate sessionName(): string | undefined {\n\t\treturn (\n\t\t\tthis.source.followTaskTranscript(this.taskId)?.session?.completionSource?.intercomTarget ??\n\t\t\tthis.liveTask()?.agentName\n\t\t);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.chat.invalidate();\n\t}\n\n\tdispose(): void {\n\t\tif (!this.disposed && this.chat.hasInputText()) {\n\t\t\tconst kept = keptDrafts.get(this.source) ?? new Map<TaskId, string>();\n\t\t\tkept.set(this.liveTaskId(), this.chat.inputText());\n\t\t\tkeptDrafts.set(this.source, kept);\n\t\t}\n\t\tif (!this.disposed && this.chat.promptHistory().length > 0) {\n\t\t\t// Up recalls what was sent from this chat when the reader opens it again, as the main chat, which stays, does.\n\t\t\tconst kept = keptPromptHistories.get(this.source) ?? new Map<TaskId, readonly string[]>();\n\t\t\tkept.set(this.taskId, this.chat.promptHistory());\n\t\t\tkeptPromptHistories.set(this.source, kept);\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.cancelAdjacent();\n\t\tthis.latestRead?.abort();\n\t\tthis.boundaryReads.abort();\n\t\tthis.savedPages.length = 0;\n\t\tthis.legacyWindow = undefined;\n\t\tif (this.observedWrites) this.observedWrites.onIdle = undefined;\n\t\tthis.observedWrites = undefined;\n\t\tthis.#notices.reset();\n\t\tthis.unsubscribePrompts();\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.chat.dispose();\n\t}\n\n\thasDraft(): boolean {\n\t\tif (!this.chat.hasTaskInspector && this.heldPrompt() !== undefined) return true;\n\t\treturn this.chat.hasInputText();\n\t}\n\n\thasTasks(): boolean {\n\t\treturn this.chat.hasBackgroundTasks();\n\t}\n\n\texpandable(): boolean {\n\t\treturn this.env.setToolsExpanded !== undefined;\n\t}\n\n\tcanSend(): boolean {\n\t\treturn this.source.sendTaskMessage !== undefined && this.readOnlyReason() === undefined;\n\t}\n\n\tcursorAtStart(): boolean {\n\t\tconst form = this.chat.hasTaskInspector ? undefined : this.heldForm();\n\t\tif (form !== undefined) return form.capturesBack?.() !== true;\n\t\treturn this.chat.inputCursorAtStart();\n\t}\n\n\thandlesBack(): boolean {\n\t\treturn this.chat.hasTaskInspector || this.chat.hasTransientModal;\n\t}\n\n\ttakesEscape(): boolean {\n\t\treturn !this.chat.hasTaskInspector && this.heldPrompt() !== undefined;\n\t}\n\n\tcapturesPageScroll(): boolean {\n\t\treturn (\n\t\t\t!this.chat.hasTaskInspector &&\n\t\t\tthis.heldPrompt()?.kind === \"select\" &&\n\t\t\t(this.heldPrompt()?.choices?.length ?? 0) > 10\n\t\t);\n\t}\n\n\t/** Whether Esc paused the subagent: it waits, still running, for the reader's next message. */\n\tprivate paused(): boolean {\n\t\tconst task = this.liveTask();\n\t\treturn task !== undefined && isTaskTurnInterrupted(task);\n\t}\n\n\tinterruptible(): boolean {\n\t\tif (this.source.pauseTask === undefined && this.source.interruptTask === undefined) return false;\n\t\tconst session = this.followed;\n\t\tconst queued = session?.getQueuedMessages?.();\n\t\t// Between two attempts of a retry nothing streams, and Esc cancels the retry, as it does in the main chat. Queued\n\t\t// messages alone are enough too: Esc hands them back, as the main chat's Esc does.\n\t\treturn (\n\t\t\tsession?.isRunning?.() === true ||\n\t\t\tsession?.chatSession?.isRetrying === true ||\n\t\t\t(queued !== undefined && queued.steering.length + queued.followUp.length > 0)\n\t\t);\n\t}\n\n\tasync interrupt(): Promise<TaskViewResult<undefined>> {\n\t\tif (this.source.pauseTask !== undefined) {\n\t\t\tconst paused = await pauseAgent(this.source, this.liveTaskId());\n\t\t\tif (!paused.ok) return paused;\n\t\t\t// A pause a restart would not keep is shown with why: in the chat, or in the main chat once the reader left.\n\t\t\tconst warning = paused.value.warning;\n\t\t\tif (warning !== undefined) {\n\t\t\t\tif (this.disposed) this.reportLate(warning);\n\t\t\t\telse this.chat.showWarning(warning);\n\t\t\t}\n\t\t\tif (!this.disposed) this.restoreQueuedToEditor(paused.value);\n\t\t\telse {\n\t\t\t\t// The reader left while the turn ended: what came back waits in the prompt for their return.\n\t\t\t\tconst taken = [...paused.value.steering, ...paused.value.followUp];\n\t\t\t\tconst kept = keptDrafts.get(this.source) ?? new Map<TaskId, string>();\n\t\t\t\tconst id = this.liveTaskId();\n\t\t\t\tif (taken.length > 0) kept.set(id, combineQueuedMessagesForEditor(taken, kept.get(id) ?? \"\"));\n\t\t\t\tkeptDrafts.set(this.source, kept);\n\t\t\t}\n\t\t\treturn { ok: true, value: undefined };\n\t\t}\n\t\tconst interrupt = this.source.interruptTask;\n\t\tif (interrupt === undefined)\n\t\t\treturn { ok: false, error: { message: \"This task's turn cannot be interrupted from here.\" } };\n\t\treturn interrupt.call(this.source, this.liveTaskId());\n\t}\n\n\tprivate adoptLatestPage(page: TaskViewResult<TaskTranscriptView>, id: TaskId = this.taskId): void {\n\t\tif (!page.ok) {\n\t\t\tthis.status = page.error.message;\n\t\t\treturn;\n\t\t}\n\t\tconst follow = this.source.followTaskTranscript(id);\n\t\tif (this.deferArchiveRead(follow)) return;\n\t\t// A reader who moved above the end while this read was on its way keeps their rows until they return.\n\t\tif (follow?.historyOnly === true && this.chat.bodyScrollFromBottom() > 0) {\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\tconst session = follow?.session?.subscribe === undefined ? undefined : follow.session;\n\t\tconst nextSessionId = follow?.session?.getSessionId?.();\n\t\tconst sameConversation =\n\t\t\tthis.followedSessionId !== undefined &&\n\t\t\tnextSessionId !== undefined &&\n\t\t\tnextSessionId === this.followedSessionId;\n\t\tconst sessionChanged =\n\t\t\tsession !== this.followed || (!sameConversation && nextSessionId !== this.followedSessionId);\n\t\tconst parked = this.parkOnLoad && !sessionChanged && session ? this.parkedRows(session) : undefined;\n\t\tconst parking = this.parkOnLoad;\n\t\tthis.parkOnLoad = false;\n\t\tif (parking && !parked && !sessionChanged && this.chat.bodyScrollFromBottom() > 0) {\n\t\t\t// A row the reader sees cannot be placed among the saved entries: keep the window until they return.\n\t\t\tthis.behind = true;\n\t\t\treturn;\n\t\t}\n\t\t// From here the window is the one `id` read: its cursors and rows are that attempt's.\n\t\tthis.taskId = id;\n\t\tif (sessionChanged) {\n\t\t\tif (this.observedWrites) {\n\t\t\t\tthis.observedWrites.onIdle = undefined;\n\t\t\t\tthis.observedWrites = undefined;\n\t\t\t}\n\t\t\tthis.unsubscribe?.();\n\t\t\tthis.unsubscribe = undefined;\n\t\t\tthis.followed = session;\n\t\t\tthis.chat.resetFollowedSession({ preserveWorkedRun: sameConversation && session === undefined });\n\t\t}\n\t\tthis.followedSessionId = nextSessionId;\n\t\tthis.cancelAdjacent();\n\t\tthis.windowGeneration++;\n\t\tthis.savedPages.length = 0;\n\t\tthis.boundaryReads.abort();\n\t\tthis.boundaryReads = new AbortController();\n\t\tthis.newerCursor = undefined;\n\t\tthis.liveHistoryStart = undefined;\n\t\tthis.cursor = page.value.nextCursor;\n\t\tthis.legacyWindow = undefined;\n\t\tthis.legacyWindowActive = false;\n\t\tthis.chat.onUnplacedWidget?.(\n\t\t\tsession &&\n\t\t\t\t!session.getEntrySeq &&\n\t\t\t\t!session.entryReceipt &&\n\t\t\t\tsession.readHistory &&\n\t\t\t\tsession.getEarlierCursor &&\n\t\t\t\tthis.cursor &&\n\t\t\t\t!this.cursor.includes(\":\")\n\t\t\t\t? () => {\n\t\t\t\t\t\tthis.legacyWindow = retainTaskWindowReader(session, this.taskId);\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t);\n\t\tconst messages = page.value.messages;\n\t\tif (page.value.savedWindow && !session) this.attachSavedPage(page.value, \"latest\", page);\n\t\telse\n\t\t\twithTaskChatRows(this.chat, page, () =>\n\t\t\t\tthis.chat.replaceMessages(messages, {\n\t\t\t\t\tpreserveUnread: !sessionChanged,\n\t\t\t\t\tparked,\n\t\t\t\t\tbefore: this.boundaryReader(this.cursor, true, this.boundaryReads.signal),\n\t\t\t\t}),\n\t\t\t);\n\t\tif (session && parked?.rows.length) {\n\t\t\t// The rows the reader sees of the retired window stay as the saved page they are on; reads continue past it.\n\t\t\tconst around = taskCursorsAround(session, this.taskId, parked.first, parked.last);\n\t\t\tthis.liveHistoryStart = this.cursor;\n\t\t\tthis.savedPages.push({ ...this.chat.keptPage(parked.rows), ...around });\n\t\t\tthis.cursor = around.older;\n\t\t\tthis.newerCursor = around.newer;\n\t\t}\n\t\tthis.#notices.adopt(page, messages, this.cursor !== undefined);\n\t\tthis.chat.hydrateToolExecutionStarts(page.value.activeToolStarts ?? []);\n\t\tthis.chat.hydrateCompactionStatus(\n\t\t\tpage.value.compactionReason,\n\t\t\tpage.value.compactionStartedAt ?? session?.chatSession?.compactionStartedAt,\n\t\t);\n\t\tthis.status = \"\";\n\t\tif (!sessionChanged || session === undefined) return;\n\t\tthis.chat.hydrateStreamingAssistantMessage(session.getStreamingMessage?.());\n\t\tthis.hydrateRunningTurn(session, page.value.messages);\n\t\tlet turnAborted = false;\n\t\tthis.unsubscribe = session.subscribe?.((event) => {\n\t\t\tif (event.type === \"agent_start\" || event.type === \"turn_start\" || event.type === \"message_start\") {\n\t\t\t\tturnAborted = false;\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\t} else if (\n\t\t\t\tevent.type === \"message_end\" &&\n\t\t\t\t(event.message as { role?: string; stopReason?: string }).role === \"assistant\" &&\n\t\t\t\t(event.message as { stopReason?: string }).stopReason === \"aborted\"\n\t\t\t) {\n\t\t\t\tturnAborted = true;\n\t\t\t} else if (event.type === \"agent_end\" && turnAborted && session.isRunning?.() !== true) {\n\t\t\t\tturnAborted = false;\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, true);\n\t\t\t}\n\t\t\tif (event.type === \"message_end\") {\n\t\t\t\t// The receipt arrives with the end of the message the row was drawn from as it streamed.\n\t\t\t\tconst sent = event as { seq?: unknown };\n\t\t\t\tconst seq =\n\t\t\t\t\tsession.entryReceipt?.(event.message)?.seq ?? (typeof sent.seq === \"number\" ? sent.seq : undefined);\n\t\t\t\tif (seq !== undefined) noteSavedSeq(event.message, seq);\n\t\t\t}\n\t\t\tconst write = chatReceiptWrite(event);\n\t\t\tif (write) {\n\t\t\t\tthis.observedWrites ??= new ObservedChatWrites();\n\t\t\t\tthis.observedWrites.observe(write);\n\t\t\t}\n\t\t\tthis.chat.applyTaskAgentEvent(event);\n\t\t\tif (event.type === \"compaction_end\" && event.result && !event.aborted && session.getEarlierCursor?.()) {\n\t\t\t\t// Only a source that can replay the previous context authorizes releasing those rows. Never clear\n\t\t\t\t// private SDK rows merely because they arrived before a new boundary.\n\t\t\t\tthis.cancelAdjacent();\n\t\t\t\tthis.windowGeneration++;\n\t\t\t\tif (!session.getEntrySeq && !session.entryReceipt && this.chat.hasUnplacedWidget()) {\n\t\t\t\t\t// With neither occurrence capability, only the original live transcript can place this stateful\n\t\t\t\t\t// widget. Keep that view, including its new boundary. Never guess by text or display it twice.\n\t\t\t\t\tthis.legacyWindowActive = true;\n\t\t\t\t\tthis.behind = false;\n\t\t\t\t\tthis.parkOnLoad = false;\n\t\t\t\t} else if (this.chat.bodyScrollFromBottom() === 0 && this.newerCursor === undefined) void this.load();\n\t\t\t\telse if (session.getEntrySeq) {\n\t\t\t\t\t// A reader above the end keeps only the rows they see; the rest of the retired window is released.\n\t\t\t\t\tthis.parkOnLoad = true;\n\t\t\t\t\tvoid this.load();\n\t\t\t\t} else this.behind = true;\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t});\n\t}\n\n\t/**\n\t * A page opened mid-turn missed `agent_start` and `queue_update`, so it reads the turn and the queue now. Between\n\t * two attempts of a retry the page shows the retry's wait instead, also while a session with fallback models keeps\n\t * its run open through the wait.\n\t */\n\tprivate hydrateRunningTurn(session: TaskTranscriptSource, messages: TaskTranscriptView[\"messages\"]): void {\n\t\tconst chatSession = session.chatSession;\n\t\tif (chatSession && sessionWaitsToRetry(chatSession)) {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tconst retry = chatSession.retryStatus;\n\t\t\tthis.chat.hydrateRetryWait(\n\t\t\t\tmessages,\n\t\t\t\tchatSession.turnStartedAt,\n\t\t\t\tretry?.type === \"auto_retry_start\" ? retry : undefined,\n\t\t\t);\n\t\t} else if (chatSession?.retryStatus?.type === \"model_fallback_start\") {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tthis.chat.hydrateModelSwitch(chatSession.turnStartedAt, messages);\n\t\t} else if (session.isRunning?.() === true) {\n\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, false);\n\t\t\tthis.chat.beginExternalPromptLifecycle();\n\t\t\tthis.chat.hydrateRunningTurn(messages, session.getStreamingMessage?.(), chatSession?.turnStartedAt);\n\t\t} else if (session.isRunning?.() === false) {\n\t\t\tconst lastAssistant = [...messages]\n\t\t\t\t.reverse()\n\t\t\t\t.find((message): message is Extract<typeof message, { role: \"assistant\" }> => message.role === \"assistant\");\n\t\t\tif (lastAssistant?.stopReason === \"aborted\") {\n\t\t\t\tsetTaskTurnInterrupted(this.source, this.taskId, true);\n\t\t\t}\n\t\t}\n\t\tconst queued = session.getQueuedMessages?.();\n\t\tif (queued === undefined) return;\n\t\tthis.chat.applyAgentEvent({ type: \"queue_update\", steering: queued.steering, followUp: queued.followUp });\n\t}\n\n\t/** The rows the reader sees, at the window the followed session holds now. */\n\tprivate parkedRows(session: TaskTranscriptSource): ParkedTaskRows | undefined {\n\t\tlet current = Number.POSITIVE_INFINITY;\n\t\tfor (const entry of session.getEntries()) current = Math.min(current, session.getEntrySeq?.(entry.id) ?? current);\n\t\treturn Number.isFinite(current) ? this.chat.parkedRows(current) : undefined;\n\t}\n\n\tprivate goToLatestSavedPage(): void {\n\t\tthis.cancelAdjacent();\n\t\tthis.windowGeneration++;\n\t\tthis.newerCursor = undefined;\n\t\tthis.behind = false;\n\t\tthis.olderIntent = false;\n\t\tthis.goToFirst = false;\n\t\tthis.chat.scrollToBottom();\n\t\tif (this.followed) {\n\t\t\tfor (const page of this.savedPages.splice(0)) page.discard();\n\t\t\tif (this.liveHistoryStart) this.cursor = this.liveHistoryStart;\n\t\t\tthis.requestRender();\n\t\t} else void this.load();\n\t}\n\n\t/**\n\t * Reads, one saved entry per step, the entries from `cursor` on: newest first with `calls` (replies reduced to their\n\t * calls), else oldest first. Only saved transcripts read single entries.\n\t */\n\tprivate boundaryReader(\n\t\tcursor: string | undefined,\n\t\tcalls: boolean,\n\t\tsignal: AbortSignal,\n\t): SavedPageNeighbours[\"before\"] | undefined {\n\t\tif (cursor === undefined || !cursor.includes(\":\")) return undefined;\n\t\tconst { source, taskId } = this;\n\t\treturn () => {\n\t\t\tlet next: string | undefined = cursor;\n\t\t\treturn {\n\t\t\t\tasync next() {\n\t\t\t\t\tif (next === undefined || signal.aborted) return { done: true, value: undefined };\n\t\t\t\t\tconst page = await readTaskPageForView(source, taskId, savedBoundaryCursor(next, calls), signal);\n\t\t\t\t\tif (!page.ok) throw new Error(page.error.message);\n\t\t\t\t\tnext = calls ? page.value.nextCursor : page.value.newerCursor;\n\t\t\t\t\treturn { done: false, value: page.value.messages };\n\t\t\t\t},\n\t\t\t};\n\t\t};\n\t}\n\n\tprivate attachSavedPage(\n\t\tpage: TaskTranscriptView,\n\t\tedge: \"latest\" | \"older\" | \"newer\",\n\t\tresult?: TaskViewResult<TaskTranscriptView>,\n\t): void {\n\t\tconst reads = new AbortController();\n\t\tconst windowReads = this.boundaryReads.signal;\n\t\tconst signal = AbortSignal.any([reads.signal, windowReads]);\n\t\tconst neighbours: SavedPageNeighbours = {\n\t\t\tbefore: this.boundaryReader(page.nextCursor, true, signal),\n\t\t\tafter: this.boundaryReader(page.newerCursor, false, signal),\n\t\t};\n\t\tlet kept!: SavedPageHandle;\n\t\tconst show = () => {\n\t\t\tkept = this.chat.showSavedPage(\n\t\t\t\tpage.messages,\n\t\t\t\tedge,\n\t\t\t\tneighbours,\n\t\t\t\tedge === \"newer\" ? this.savedPages.at(-1)?.lastRow() : undefined,\n\t\t\t);\n\t\t};\n\t\t// The page's rows carry where its saved lines go.\n\t\tif (result) withTaskChatRows(this.chat, result, show);\n\t\telse show();\n\t\tconst shown = {\n\t\t\t...kept,\n\t\t\tdiscard: () => {\n\t\t\t\treads.abort();\n\t\t\t\tkept.discard();\n\t\t\t},\n\t\t\tolder: page.nextCursor,\n\t\t\tnewer: page.newerCursor,\n\t\t};\n\t\tif (edge === \"older\") this.savedPages.unshift(shown);\n\t\telse this.savedPages.push(shown);\n\t\t// Keep the viewport and an adjacent page. A tall screen can span more: never evict a painted row.\n\t\twhile (this.savedPages.length > 2) {\n\t\t\tconst far = edge === \"older\" ? this.savedPages.at(-1)! : this.savedPages[0]!;\n\t\t\tif (far.visible()) break;\n\t\t\tif (edge === \"older\") this.savedPages.pop();\n\t\t\telse this.savedPages.shift();\n\t\t\tfar.discard();\n\t\t}\n\t\tthis.cursor = this.savedPages[0]?.older;\n\t\tthis.newerCursor = this.savedPages.at(-1)?.newer;\n\t}\n\n\tprivate cancelAdjacent(): void {\n\t\tthis.loadingEarlier?.controller.abort();\n\t\tthis.loadingEarlier = undefined;\n\t\tthis.failedCursor = undefined;\n\t}\n\tprivate loadAdjacent(edge: \"older\" | \"newer\"): void {\n\t\tconst cursor = edge === \"older\" ? this.cursor : this.newerCursor;\n\t\tif (!cursor || cursor === this.failedCursor || this.loadingEarlier || this.loading || this.disposed) return;\n\t\tif (edge === \"older\" && this.followed && cursor.includes(\":\") && !this.olderIntent) return;\n\t\t// Saved pages on both sides of a live reader (pages kept through a compaction): read on the way they scroll.\n\t\tif (this.followed && this.savedPages.length > 0 && this.travel !== edge) return;\n\t\tconst src = this.source.followTaskTranscript(this.taskId)?.session;\n\t\tconst request: AdjacentRequest = {\n\t\t\tedge,\n\t\t\tcursor,\n\t\t\tgeneration: this.windowGeneration,\n\t\t\tcontroller: new AbortController(),\n\t\t\tsource: src && new WeakRef(src),\n\t\t};\n\t\tthis.loadingEarlier = request;\n\t\ttry {\n\t\t\tdeliverAdjacent(\n\t\t\t\tnew WeakRef(this),\n\t\t\t\trequest,\n\t\t\t\tthis.legacyWindowActive && this.legacyWindow && !cursor.includes(\":\")\n\t\t\t\t\t? this.legacyWindow(cursor)\n\t\t\t\t\t: readTaskPageForChat(this, this.source, this.taskId, cursor, request.controller.signal),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthis[finishAdjacent](request, { ok: false, error: { message: failureText(error) } });\n\t\t}\n\t}\n\t[finishAdjacent](request: AdjacentRequest, page: TaskViewResult<TaskTranscriptView>): void {\n\t\tconst { edge, cursor } = request;\n\t\tif (this.disposed || this.loadingEarlier !== request) return;\n\t\tthis.loadingEarlier = undefined;\n\t\tif (\n\t\t\trequest.generation !== this.windowGeneration ||\n\t\t\tcursor !== (edge === \"older\" ? this.cursor : this.newerCursor) ||\n\t\t\trequest.source?.deref() !== this.source.followTaskTranscript(this.taskId)?.session\n\t\t)\n\t\t\treturn;\n\t\ttry {\n\t\t\tif (!page.ok) {\n\t\t\t\tthis.failedCursor = cursor;\n\t\t\t\tthis.status = page.error.message;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (page.value.savedWindow && (this.savedPages.length || this.followed)) {\n\t\t\t\tif (this.followed && this.liveHistoryStart === undefined) this.liveHistoryStart = cursor;\n\t\t\t\tif (edge === \"older\") this.#notices.adopt(page, page.value.messages, page.value.nextCursor !== undefined);\n\t\t\t\tthis.attachSavedPage(page.value, edge, page);\n\t\t\t\tif (edge === \"older\" && this.goToFirst) this.chat.scrollBodyTo(0);\n\t\t\t} else {\n\t\t\t\tthis.cursor = page.value.nextCursor;\n\t\t\t\tthis.#notices.adopt(page, page.value.messages, this.cursor !== undefined);\n\t\t\t\twithTaskChatRows(this.chat, page, () => this.chat.prependMessages(page.value.messages));\n\t\t\t}\n\t\t\tthis.status = \"\";\n\t\t} catch (error) {\n\t\t\tthis.failedCursor = cursor;\n\t\t\tthis.status = failureText(error);\n\t\t} finally {\n\t\t\tif (!this.cursor) this.#notices.finishPaging();\n\t\t\tthis.requestRender();\n\t\t}\n\t}\n\n\t/** The subagent as its chat steers it: messages go to its own session, and its queue comes back from it. */\n\tprivate steeringTarget(): ChatSteeringTarget {\n\t\treturn {\n\t\t\tprompt: (text, options) => this.send(text, options?.streamingBehavior ?? \"steer\"),\n\t\t\tresume: async (text, lane) => {\n\t\t\t\tawait resumeAgent(this.source, this.liveTaskId());\n\t\t\t\tawait this.send(text, lane === \"followUp\" ? \"followUp\" : \"steer\");\n\t\t\t},\n\t\t\tclearQueue: async () => {\n\t\t\t\tconst taken = await this.takeQueue();\n\t\t\t\treturn { steering: [...taken.steering], followUp: [...taken.followUp] };\n\t\t\t},\n\t\t};\n\t}\n\n\t/** Resolves once the subagent's session accepted `text`, waiting on `lane` while it works. */\n\tprivate async send(text: string, lane: TaskMessageLane): Promise<void> {\n\t\ttry {\n\t\t\tawait sendAgentMessage(this.source, () => this.liveTask(), this.taskId, text, lane);\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) throw error;\n\t\t\tthis.keepUndelivered(text, failureText(error));\n\t\t}\n\t}\n\n\t/** Every message waiting in the subagent's queue, taken back in its own answer. */\n\tprivate takeQueue(): Promise<QueuedTaskMessages> {\n\t\treturn takeAgentQueue(this.source, this.liveTaskId());\n\t}\n\n\trestoreQueuedToEditor(taken: QueuedTaskMessages): number {\n\t\treturn this.chat.restoreTakenQueuedMessages(taken);\n\t}\n\n\t/**\n\t * A slash command typed into the chat: `/tasks`, `/copy` and `/hotkeys` run here at once; a built-in that belongs to\n\t * the main chat is refused with a notice; anything else goes to the subagent, whose session runs its own commands\n\t * and expands its skills and prompt templates. Answers whether the chat handled it.\n\t */\n\tprivate runCommand(text: string): boolean {\n\t\tif (classifyChatCommand(text) === \"tasks\") return this.chat.openTasks(text.split(/\\s+/)[1]);\n\t\tconst command = subagentChatCommand(text);\n\t\tif (command.kind === \"agent\") return false;\n\t\tif (command.kind === \"unavailable\") {\n\t\t\tthis.chat.showWarning(subagentChatUnavailableNotice(command.name));\n\t\t\treturn true;\n\t\t}\n\t\tif (command.name === \"copy\") void this.copyLastMessage();\n\t\telse if (command.name === \"hotkeys\") this.showKeys?.();\n\t\telse this.chat.openTasks();\n\t\treturn true;\n\t}\n\n\tprivate async copyLastMessage(): Promise<void> {\n\t\tconst text = this.chat.lastAgentMessageText();\n\t\tif (!text) {\n\t\t\tthis.chat.showWarning(\"No agent messages to copy yet.\");\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait copyToClipboard(text);\n\t\t\tif (!this.disposed) this.chat.showStatus(\"Copied last agent message to clipboard\");\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.chat.showWarning(failureText(error));\n\t\t}\n\t}\n\n\t/** The reader left before the answer: report it once, and give the text back when they return. */\n\tprivate keepUndelivered(text: string, reason: string): void {\n\t\tconst kept = undeliveredMessages.get(this.source) ?? new Map<TaskId, UndeliveredMessage>();\n\t\tconst taskId = this.liveTaskId();\n\t\tconst earlier = kept.get(taskId);\n\t\tkept.set(taskId, { text: earlier === undefined ? text : `${earlier.text}\\n${text}`, reason });\n\t\tundeliveredMessages.set(this.source, kept);\n\t\tthis.reportLate(reason);\n\t}\n\n\tprivate restoreUndelivered(): void {\n\t\tconst kept = undeliveredMessages.get(this.source);\n\t\tconst message = kept?.get(this.taskId);\n\t\tif (message === undefined) return;\n\t\tkept?.delete(this.taskId);\n\t\tconst draft = this.chat.inputText();\n\t\tthis.chat.setInputText(draft ? `${message.text}\\n${draft}` : message.text);\n\t\tthis.chat.showWarning(message.reason);\n\t}\n}\n\n/** The retained tail of a shell task's output on the shared viewport. */\nexport class TaskCommandOutputPage implements TaskTranscriptPage {\n\tstatic readonly TAIL_BYTES = 8192;\n\tstatus = \"Loading output…\";\n\tprivate readonly source: TaskViewSource;\n\tprivate readonly taskId: TaskId;\n\tprivate readonly byteCount: () => bigint;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly viewport: ScrollableComponentViewport;\n\tprivate output = new Text(\"\", 0, 0);\n\tprivate loading = false;\n\tprivate reloadPending = false;\n\tprivate disposed = false;\n\n\tconstructor(\n\t\tsource: TaskViewSource,\n\t\ttaskId: TaskId,\n\t\tbyteCount: () => bigint,\n\t\tenv: Pick<TaskTranscriptEnvironment, \"keybindings\" | \"getChatRenderSettings\"> | undefined,\n\t\trequestRender: () => void,\n\t) {\n\t\tthis.source = source;\n\t\tthis.taskId = taskId;\n\t\tthis.byteCount = byteCount;\n\t\tthis.requestRender = requestRender;\n\t\tthis.viewport = new ScrollableComponentViewport(env?.keybindings, {\n\t\t\twheelScrollLines: () => env?.getChatRenderSettings?.()?.fullscreenWheelScrollLines,\n\t\t\tscrollbar: () => env?.getChatRenderSettings?.()?.fullscreenScrollbar,\n\t\t\tscrollbarThumbStyle: (text) => theme.bg(\"scrollbarThumb\", text),\n\t\t\trequestRender,\n\t\t});\n\t\tthis.viewport.setComponents([this.output]);\n\t}\n\n\tasync load(): Promise<void> {\n\t\tif (this.loading) {\n\t\t\tthis.reloadPending = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.loading = true;\n\t\tconst count = this.byteCount();\n\t\tconst tail = BigInt(TaskCommandOutputPage.TAIL_BYTES);\n\t\ttry {\n\t\t\tconst page = await this.source.readTaskOutput(this.taskId, {\n\t\t\t\tstart: String(count > tail ? count - tail : 0n),\n\t\t\t\tmaximumBytes: TaskCommandOutputPage.TAIL_BYTES,\n\t\t\t});\n\t\t\tif (this.disposed) return;\n\t\t\tconst text = page.ok ? page.value.text : page.error.message;\n\t\t\tthis.output = new Text(text.split(\"\\n\").map(taskDisplayText).join(\"\\n\") || \"No output available\", 0, 0);\n\t\t\tthis.viewport.setComponents([this.output]);\n\t\t\tthis.status = count > tail ? \"Earlier output omitted · showing retained 8 KiB tail\" : \"Retained shell output\";\n\t\t} catch (error) {\n\t\t\tif (!this.disposed) this.status = error instanceof Error ? error.message : String(error);\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t\tthis.requestRender();\n\t\t\tif (this.reloadPending && !this.disposed) {\n\t\t\t\tthis.reloadPending = false;\n\t\t\t\tvoid this.load();\n\t\t\t}\n\t\t}\n\t}\n\n\trefresh(): void {\n\t\tif (!this.disposed) void this.load();\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tconst handled = this.viewport.handleInput(data);\n\t\tif (handled) this.requestRender();\n\t\treturn handled;\n\t}\n\n\thasDraft(): boolean {\n\t\treturn false;\n\t}\n\n\tcursorAtStart(): boolean {\n\t\treturn true;\n\t}\n\n\thandlesBack(): boolean {\n\t\treturn false;\n\t}\n\n\tinterruptible(): boolean {\n\t\treturn false;\n\t}\n\n\tasync interrupt(): Promise<TaskViewResult<undefined>> {\n\t\treturn { ok: false, error: { message: \"A shell's output has no turn to interrupt.\" } };\n\t}\n\n\trender(width: number, rows: number): string[] {\n\t\tthis.viewport.setVisibleRows(Math.max(1, rows));\n\t\treturn this.viewport.render(width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.viewport.invalidate();\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.viewport.dispose();\n\t}\n}\n"]}
|