@bastani/atomic 0.10.1-alpha.1 → 0.10.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/broker/watchdog.ts +4 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +22 -0
- package/dist/builtin/subagents/README.md +2 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +269 -144
- package/dist/builtin/web-access/CHANGELOG.md +7 -0
- package/dist/builtin/web-access/index.bundle.mjs +9 -5
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -14
- package/dist/cli/list-models.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +13 -9
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +6 -3
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +3 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-nested-tools.d.ts.map +1 -1
- package/dist/core/agent-session-nested-tools.js +2 -1
- package/dist/core/agent-session-nested-tools.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +12 -0
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +6 -0
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +71 -4
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +9 -1
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cache-stats.d.ts +15 -0
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +40 -2
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/diagnostic-writer.d.ts.map +1 -1
- package/dist/core/diagnostic-writer.js +2 -1
- package/dist/core/diagnostic-writer.js.map +1 -1
- package/dist/core/export-html/template.js +14 -4
- package/dist/core/extensions/context-types.d.ts +6 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +5 -2
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/queued-message-delivery.d.ts +100 -7
- package/dist/core/queued-message-delivery.d.ts.map +1 -1
- package/dist/core/queued-message-delivery.js +194 -4
- package/dist/core/queued-message-delivery.js.map +1 -1
- package/dist/core/resume-cache-checkpoint.d.ts +32 -0
- package/dist/core/resume-cache-checkpoint.d.ts.map +1 -0
- package/dist/core/resume-cache-checkpoint.js +67 -0
- package/dist/core/resume-cache-checkpoint.js.map +1 -0
- package/dist/core/sdk-types.d.ts +37 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +57 -28
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +12 -3
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +13 -0
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +38 -6
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/settings-lock-directory.d.ts.map +1 -1
- package/dist/core/settings-lock-directory.js +2 -1
- package/dist/core/settings-lock-directory.js.map +1 -1
- package/dist/core/storage/node-sqlite-file-gate.d.ts +173 -0
- package/dist/core/storage/node-sqlite-file-gate.d.ts.map +1 -0
- package/dist/core/storage/node-sqlite-file-gate.js +1033 -0
- package/dist/core/storage/node-sqlite-file-gate.js.map +1 -0
- package/dist/core/storage/node-sqlite-thread.d.ts +33 -6
- package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +72 -2
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite.js +216 -15
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/session/entry-structure.d.ts.map +1 -1
- package/dist/core/storage/session/entry-structure.js +39 -2
- package/dist/core/storage/session/entry-structure.js.map +1 -1
- package/dist/core/storage/session/session-resume.d.ts.map +1 -1
- package/dist/core/storage/session/session-resume.js +1 -0
- package/dist/core/storage/session/session-resume.js.map +1 -1
- package/dist/core/storage/session/session-search-index.d.ts.map +1 -1
- package/dist/core/storage/session/session-search-index.js +56 -9
- package/dist/core/storage/session/session-search-index.js.map +1 -1
- package/dist/core/storage/statement-sequence.d.ts +36 -0
- package/dist/core/storage/statement-sequence.d.ts.map +1 -0
- package/dist/core/storage/statement-sequence.js +22 -0
- package/dist/core/storage/statement-sequence.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +13 -4
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/heartbeat-notice.d.ts.map +1 -1
- package/dist/core/tasks/heartbeat-notice.js +2 -1
- package/dist/core/tasks/heartbeat-notice.js.map +1 -1
- package/dist/core/tool-loadout.d.ts +4 -2
- package/dist/core/tool-loadout.d.ts.map +1 -1
- package/dist/core/tool-loadout.js +27 -5
- package/dist/core/tool-loadout.js.map +1 -1
- package/dist/core/tools/history-regex-worker.d.ts.map +1 -1
- package/dist/core/tools/history-regex-worker.js +2 -1
- package/dist/core/tools/history-regex-worker.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +22 -22
- package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
- package/dist/core/tools/sqlite-selector-connection.js +7 -0
- package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
- package/dist/core/transformed-system-prompt.d.ts +92 -0
- package/dist/core/transformed-system-prompt.d.ts.map +1 -0
- package/dist/core/transformed-system-prompt.js +240 -0
- package/dist/core/transformed-system-prompt.js.map +1 -0
- package/dist/extensions/codemode/execute.js +1 -1
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +16 -3
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +13 -8
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts +2 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +5 -0
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +4 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +289 -64
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +1 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +2 -2
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tool-records.d.ts +58 -0
- package/dist/extensions/mcp/tool-records.d.ts.map +1 -0
- package/dist/extensions/mcp/tool-records.js +129 -0
- package/dist/extensions/mcp/tool-records.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/agent-panel.d.ts +2 -4
- package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/agent-panel.js +65 -80
- package/dist/modes/interactive/components/agent-panel.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +3 -3
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +35 -28
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/notice-line.d.ts +16 -0
- package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
- package/dist/modes/interactive/components/notice-line.js +7 -0
- package/dist/modes/interactive/components/notice-line.js.map +1 -1
- package/dist/modes/interactive/components/prompt-slot.d.ts +1 -0
- package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -1
- package/dist/modes/interactive/components/prompt-slot.js +8 -4
- package/dist/modes/interactive/components/prompt-slot.js.map +1 -1
- package/dist/modes/interactive/components/task-board.d.ts +0 -1
- package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-board.js +6 -14
- package/dist/modes/interactive/components/task-board.js.map +1 -1
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-row.js +7 -6
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/components/token-segment.d.ts +2 -1
- package/dist/modes/interactive/components/token-segment.d.ts.map +1 -1
- package/dist/modes/interactive/components/token-segment.js +2 -4
- package/dist/modes/interactive/components/token-segment.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +2 -2
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/components/working-run-meter.d.ts +0 -1
- package/dist/modes/interactive/components/working-run-meter.d.ts.map +1 -1
- package/dist/modes/interactive/components/working-run-meter.js +0 -9
- package/dist/modes/interactive/components/working-run-meter.js.map +1 -1
- package/dist/modes/interactive/extension-command-hold.d.ts +25 -0
- package/dist/modes/interactive/extension-command-hold.d.ts.map +1 -0
- package/dist/modes/interactive/extension-command-hold.js +45 -0
- package/dist/modes/interactive/extension-command-hold.js.map +1 -0
- package/dist/modes/interactive/interactive-agent-events.js +2 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.js +18 -10
- package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +3 -0
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +54 -13
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts +6 -0
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +15 -9
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.js +4 -0
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +7 -0
- package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +47 -1
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +6 -0
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +165 -65
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/screen-hold.d.ts +3 -0
- package/dist/modes/interactive/screen-hold.d.ts.map +1 -1
- package/dist/modes/interactive/screen-hold.js +9 -1
- package/dist/modes/interactive/screen-hold.js.map +1 -1
- package/dist/modes/interactive-engine/engine-health.d.ts +11 -3
- package/dist/modes/interactive-engine/engine-health.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-health.js +5 -4
- package/dist/modes/interactive-engine/engine-health.js.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts +7 -0
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.js +19 -0
- package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +18 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +56 -4
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +7 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +1 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
- package/dist/modes/rpc/agent-panel-bridge.js +0 -13
- package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +14 -1
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +74 -10
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +27 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +81 -5
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.d.ts +2 -0
- package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.js +9 -0
- package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +16 -3
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +7 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +10 -2
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +2 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-bootstrap.d.ts.map +1 -1
- package/dist/utils/interactive-engine-bootstrap.js +1 -0
- package/dist/utils/interactive-engine-bootstrap.js.map +1 -1
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts.map +1 -1
- package/dist/utils/interactive-engine-env.js +1 -0
- package/dist/utils/interactive-engine-env.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +2 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/token-count.d.ts +8 -0
- package/dist/utils/token-count.d.ts.map +1 -0
- package/dist/utils/token-count.js +25 -0
- package/dist/utils/token-count.js.map +1 -0
- package/dist/utils/worker-threads.d.ts +18 -0
- package/dist/utils/worker-threads.d.ts.map +1 -0
- package/dist/utils/worker-threads.js +28 -0
- package/dist/utils/worker-threads.js.map +1 -0
- package/docs/background-tasks.md +13 -12
- package/docs/compaction.md +2 -2
- package/docs/development.md +1 -1
- package/docs/extensions/api-reference.md +5 -3
- package/docs/extensions/events.md +2 -0
- package/docs/mcp-servers.md +1 -1
- package/docs/settings.md +2 -0
- package/docs/storage.md +3 -1
- package/docs/subagents.md +6 -2
- package/docs/usage.md +1 -1
- package/npm-shrinkwrap.json +49 -49
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-input-handling.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,kCAAkC,EAClC,yCAAyC,EACzC,iCAAiC,EACjC,0BAA0B,GAC1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GAEjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAqB,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,yBA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AC,IAAI,CAAC;YAE9B,OAAO;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE;YAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7E,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { bindBundledHintCommands, isHintActivation, isKeyRelease, Text } from \"@bastani/atomic-tui\";\nimport { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { parseSlashCommand } from \"../../core/slash-commands.js\";\nimport { sourceError } from \"../../core/tasks/agent-panel-source.ts\";\nimport { getOwnerTaskStore } from \"../../core/tasks/owner-store.js\";\nimport { stopAllBackgroundWork } from \"../../core/tasks/stop-all.ts\";\nimport { yieldToEventLoop } from \"../../utils/event-loop.ts\";\nimport {\n\tgetInteractiveEngineRemoteCommands,\n\tinteractiveEngineNeedsExplicitTermination,\n\tinterruptBlockedInteractiveEngine,\n\tterminateInteractiveEngine,\n} from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport {\n\tdismissRemoteProxy,\n\tremoteEngineProxyOwner,\n\tremoteProxyHandlesCtrlC,\n} from \"../interactive-engine/remote-input-ownership.ts\";\nimport { agentPanelCounts, agentPanelHasRows, showAgentPanel } from \"../rpc/agent-panel-bridge.ts\";\nimport {\n\tagentPanelBoardSource,\n\topenWaitedShellOf,\n\tshowTaskInspector,\n\ttype TaskInspectorUi,\n} from \"../rpc/task-ui-bridge.js\";\nimport { type PromptHandle, promptHandle } from \"./agent-view/agent-drafts.ts\";\nimport { gateMovedDraft } from \"./agent-view/viewed-commands.ts\";\nimport { escapeViewedAgent, submitToViewedAgent } from \"./agent-view/viewed-submit.ts\";\nimport { isChatSessionWorking } from \"./components/footer.ts\";\nimport { LoginDialogComponent } from \"./components/login-dialog.ts\";\nimport { bindMainComposerAgentRows, MainComposerKeyOverlay } from \"./components/main-composer-keys.ts\";\nimport { holdPromptSlot } from \"./components/prompt-slot.ts\";\nimport { ScopedModelsSelectorComponent } from \"./components/scoped-models-selector.ts\";\nimport { StartupIdentityComponent } from \"./components/startup-identity.ts\";\nimport { COMPACTION_ALREADY_IN_PROGRESS_WARNING } from \"./interactive-bash-compact.ts\";\nimport { routeGlobalClearInput } from \"./interactive-global-clear.ts\";\nimport { isPhysicalCtrlC, isPhysicalEscape, isSafetyKeyRelease } from \"./interactive-key-identity.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { pasteClipboardImageToEditor, recordTimeSinceReset } from \"./interactive-mode-deps.ts\";\nimport { BUILTIN_SLASH_COMMAND_NAMES } from \"./interactive-mode-helpers.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft, restoreRefusedSubmission } from \"./interactive-prompt-restore.ts\";\nimport { handOffCompactionQueue, mainSteering } from \"./interactive-queueing.ts\";\nimport { followStartedRunEcho } from \"./interactive-render-chat.ts\";\nimport { createStopAllChord, createStopAllNotices, STOP_ALL_STATUS_KEY } from \"./interactive-stop-all.ts\";\nimport { screenHoldOf } from \"./screen-hold.ts\";\nimport type { SteeringSubmitResult } from \"./steering-queue-controller.ts\";\nimport { theme } from \"./theme/theme.js\";\n\n/** Whether the prompt has the keyboard; a host without focus tracking always gives it the prompt. */\nfunction promptHasFocus(mode: InteractiveModeBase): boolean {\n\tconst focused = (mode.ui as { getFocusedComponent?(): object | null }).getFocusedComponent?.();\n\treturn focused === undefined || focused === mode.editor;\n}\n\n/** Where `/tasks` mounts in this process, with the chat's render settings. */\nfunction taskInspectorUi(mode: InteractiveModeBase): TaskInspectorUi {\n\tconst ui = mode.createExtensionUIContext();\n\treturn {\n\t\tcustom: (factory, options) => mode.showExtensionCustom(factory, options),\n\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\tnotify: ui.notify,\n\t};\n}\n\nfunction mainComposerPanelCounts(mode: InteractiveModeBase) {\n\treturn mode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t? mode.runtimeHost.agentPanelCounts\n\t\t: agentPanelCounts(mode.session);\n}\n\nexport function registerStartupInputListeners(mode: InteractiveModeBase): void {\n\tif (mode.keybindings) {\n\t\tbindMainComposerAgentRows(mode.keybindings, () => mainComposerPanelCounts(mode));\n\t}\n\t// A part of the screen held while a view is on its way is shown live before any key handler acts on the key, a key\n\t// another handler then takes (Ctrl+C, the stop-all chord) included.\n\tmode.addTuiInputListener((data) => {\n\t\tscreenHoldOf(mode).noteInput(data);\n\t\treturn undefined;\n\t});\n\tmode.addTuiInputListener(() =>\n\t\tmode.builtInHeader instanceof StartupIdentityComponent ? void mode.builtInHeader.settle() : undefined,\n\t);\n\tmode.addTuiInputListener((data) =>\n\t\trouteGlobalClearInput(data, {\n\t\t\t// Physical identity first: safety routing must survive an `app.clear` remap.\n\t\t\tmatchesCtrlC: isPhysicalCtrlC,\n\t\t\tmatchesEscape: isPhysicalEscape,\n\t\t\tisSafetyKeyRelease,\n\t\t\tmatchesClear: (candidate) => mode.keybindings.matches(candidate, \"app.clear\"),\n\t\t\thasOverlay: () => mode.ui.hasOverlay(),\n\t\t\tblockingInlineCustomUiActive: () => mode.blockingInlineCustomUiDepth > 0,\n\t\t\teditorOwnsInput: () => mode.editorContainer.children.includes(mode.editor),\n\t\t\tremoteEngineProxyOwner: () =>\n\t\t\t\tremoteEngineProxyOwner(mode.runtimeHost, {\n\t\t\t\t\thasOverlay: () => mode.ui.hasOverlay(),\n\t\t\t\t\tinlineComponents: () => mode.editorContainer.children,\n\t\t\t\t}),\n\t\t\tremoteProxyHandlesCtrlC: (owner) => remoteProxyHandlesCtrlC(mode.runtimeHost, owner),\n\t\t\tonRemoteProxyDismiss: (owner) => {\n\t\t\t\tdismissRemoteProxy(mode.runtimeHost, owner);\n\t\t\t},\n\t\t\tengineNeedsExplicitTermination: () => interactiveEngineNeedsExplicitTermination(mode.runtimeHost),\n\t\t\tonEngineTerminate: () => {\n\t\t\t\tterminateInteractiveEngine(mode.runtimeHost);\n\t\t\t},\n\t\t\tonClear: () => mode.handleCtrlC(),\n\t\t\trequestRender: () => mode.ui.requestRender(),\n\t\t}),\n\t);\n}\n\nInteractiveModeBase.prototype.setupKeyHandlers = async function (this: InteractiveModeBase): Promise<void> {\n\tregisterStartupInputListeners(this);\n\tregisterHintCommandHandler(this);\n\tconst isolated = this.runtimeHost instanceof IsolatedInteractiveRuntime ? this.runtimeHost : undefined;\n\tconst notices = createStopAllNotices({\n\t\t...(isolated === undefined\n\t\t\t? {\n\t\t\t\t\tsetFooterStatus: (text: string | undefined) =>\n\t\t\t\t\t\tthis.footerDataProvider.setExtensionStatus(STOP_ALL_STATUS_KEY, text),\n\t\t\t\t\tshowToast: (text: string) => {\n\t\t\t\t\t\tconst toast = this.ui.showOverlay(new Text(theme.fg(\"warning\", text), 1, 0), {\n\t\t\t\t\t\t\tanchor: \"bottom-center\",\n\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\toffsetY: -3,\n\t\t\t\t\t\t\tnonCapturing: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn () => toast.hide();\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: { setEngineNotice: (text: string | undefined) => void isolated.setStopAllNotice(text).catch(() => {}) }),\n\t\thasOverlay: () => this.ui.hasOverlay(),\n\t\trequestRender: () => this.ui.requestRender(),\n\t});\n\tthis.addTuiInputListener(\n\t\tcreateStopAllChord({\n\t\t\tkeybindings: this.keybindings,\n\t\t\tchordAllowed: () => {\n\t\t\t\tconst focused = (this.ui as { getFocusedComponent?(): object | null }).getFocusedComponent?.();\n\t\t\t\treturn !(focused instanceof LoginDialogComponent || focused instanceof ScopedModelsSelectorComponent);\n\t\t\t},\n\t\t\tstopAll: () =>\n\t\t\t\tthis.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t\t? this.runtimeHost.stopAllBackgroundWork()\n\t\t\t\t\t: stopAllBackgroundWork(this.session),\n\t\t\tshowStatus: (message) => notices.show(message),\n\t\t\tshowWarning: (message) => notices.show(message),\n\t\t\tclearStatus: () => notices.clear(),\n\t\t}),\n\t);\n\tlet agentPanelRequested = false;\n\tthis.addTuiInputListener((data) => {\n\t\tif (isKeyRelease(data) || isPhysicalEscape(data) || !this.keybindings.matches(data, \"app.agents.focus\"))\n\t\t\treturn undefined;\n\t\tif (this.ui.hasOverlay() || !this.editorContainer.children.includes(this.editor)) return undefined;\n\t\tif (this.editor.capturesViewportInput) return undefined;\n\t\t// A shown subagent's question form takes the keys while it has the focus: ↓ moves its choice there.\n\t\tif (this.agentView?.viewed.kind === \"agent\" && !promptHasFocus(this)) return undefined;\n\t\t// A click on the `↓ agents` hint focuses the panel whatever the prompt holds; a typed ↓ does only on an empty one.\n\t\tif (this.editor !== this.defaultEditor || this.isBashMode) return undefined;\n\t\tif (this.editor.getText() !== \"\" && !isHintActivation()) return undefined;\n\t\tif (agentPanelRequested || this.blockingInlineCustomUiDepth > 0) return { consume: true };\n\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime) {\n\t\t\tagentPanelRequested = true;\n\t\t\tvoid this.runtimeHost\n\t\t\t\t.openAgentPanel()\n\t\t\t\t.catch((error: unknown) => this.showWarning(sourceError(error).message))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tagentPanelRequested = false;\n\t\t\t\t});\n\t\t\treturn { consume: true };\n\t\t}\n\t\tif (!agentPanelHasRows(this.session)) return undefined;\n\t\tconst ui = this.createExtensionUIContext();\n\t\tvoid showAgentPanel(this.session, {\n\t\t\tcustom: (factory, options) => this.showExtensionCustom(factory, options),\n\t\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\t\tnotify: ui.notify,\n\t\t}).catch((error: unknown) => this.showWarning(sourceError(error).message));\n\t\treturn { consume: true };\n\t});\n\t// While the screen shows a subagent that waits on its shells, the waited-shell key opens the newest one's output.\n\tthis.addTuiInputListener((data) => {\n\t\tconst viewed = this.agentView?.viewed;\n\t\tif (viewed?.kind !== \"agent\" || isKeyRelease(data) || !this.keybindings.matches(data, \"app.tasks.openWaited\"))\n\t\t\treturn undefined;\n\t\tif (this.ui.hasOverlay() || !this.editorContainer.children.includes(this.editor) || !promptHasFocus(this))\n\t\t\treturn undefined;\n\t\tconst status = viewed.port.status();\n\t\tif (status.state !== \"waiting\") return undefined;\n\t\tconst opened =\n\t\t\tthis.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t? this.runtimeHost.openTaskInspector(undefined, { waitedShellOf: status.taskId })\n\t\t\t\t: openWaitedShellOf(this.session, taskInspectorUi(this), status.taskId);\n\t\tvoid opened.catch((error: unknown) => this.showWarning(sourceError(error).message));\n\t\treturn { consume: true };\n\t});\n\t// Set up handlers on defaultEditor - they use this.editor for text access\n\t// so they work correctly regardless of which editor is active\n\tthis.defaultEditor.onEscape = () => {\n\t\tif (!this.session.isStreaming && interruptBlockedInteractiveEngine(this.runtimeHost)) return;\n\t\t// While a subagent is shown, Esc is about it: it pauses it, and never interrupts the main chat.\n\t\tif (escapeViewedAgent(this)) return;\n\t\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages() || this.session.queuedMessagesPaused) {\n\t\t\tpauseAndAbortInteractiveSession(this, { restoreQueuedMessages: true });\n\t\t} else if (this.session.isRetrying) {\n\t\t\tthis.session.abortRetry();\n\t\t} else if (this.session.isBashRunning) {\n\t\t\tthis.session.abortBash();\n\t\t} else if (this.isBashMode) {\n\t\t\tthis.editor.setText(\"\");\n\t\t\tthis.isBashMode = false;\n\t\t\tthis.updateEditorBorderColor();\n\t\t} else if (!this.editor.getText().trim()) {\n\t\t\t// Double-escape with empty editor triggers /tree, /fork, or nothing based on setting\n\t\t\tconst action = this.settingsManager.getDoubleEscapeAction();\n\t\t\tif (action !== \"none\") {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tif (now - this.lastEscapeTime < 500) {\n\t\t\t\t\tif (action === \"tree\") {\n\t\t\t\t\t\tthis.showTreeSelector();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showUserMessageSelector();\n\t\t\t\t\t}\n\t\t\t\t\tthis.lastEscapeTime = 0;\n\t\t\t\t} else {\n\t\t\t\t\tthis.lastEscapeTime = now;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t// Register app action handlers\n\tthis.defaultEditor.onAction(\"app.clear\", () => this.handleCtrlC());\n\tthis.defaultEditor.onCtrlD = () => this.handleCtrlD();\n\tthis.defaultEditor.onAction(\"app.suspend\", () => this.handleCtrlZ());\n\tthis.defaultEditor.onAction(\"app.thinking.cycle\", () => {\n\t\tvoid this.cycleThinkingLevel().catch((error: Error) => this.showError(error.message));\n\t});\n\tthis.defaultEditor.onAction(\"app.model.cycleForward\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.cycleModel(\"forward\");\n\t\t})();\n\t});\n\tthis.defaultEditor.onAction(\"app.model.cycleBackward\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.cycleModel(\"backward\");\n\t\t})();\n\t});\n\n\t// Global debug handler on TUI (works regardless of focus)\n\tthis.ui.onDebug = () => this.handleDebugCommand();\n\tthis.defaultEditor.onAction(\"app.model.select\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tthis.showModelSelector();\n\t\t})();\n\t});\n\tthis.defaultEditor.onAction(\"app.history.search\", () => this.showPromptHistorySearch());\n\tthis.defaultEditor.onAction(\"app.tools.expand\", () => this.toggleToolOutputExpansion());\n\tthis.defaultEditor.onAction(\"app.keys.help\", () => {\n\t\tvoid this.showExtensionCustom<void>(\n\t\t\t(_tui, _theme, keybindings, done) =>\n\t\t\t\tnew MainComposerKeyOverlay(\n\t\t\t\t\tkeybindings,\n\t\t\t\t\t() => ({\n\t\t\t\t\t\tagentRows: mainComposerPanelCounts(this).total,\n\t\t\t\t\t\tworking: isChatSessionWorking(this.session),\n\t\t\t\t\t}),\n\t\t\t\t\t() => done(),\n\t\t\t\t),\n\t\t);\n\t});\n\tthis.defaultEditor.onAction(\"app.thinking.toggle\", () => this.toggleThinkingBlockVisibility());\n\tthis.defaultEditor.onAction(\"app.editor.external\", () => {\n\t\tvoid this.openExternalEditor();\n\t});\n\tthis.defaultEditor.onAction(\"app.message.followUp\", () => this.handleFollowUp());\n\tthis.defaultEditor.onAction(\"app.message.dequeue\", () => {\n\t\tvoid this.handleDequeue();\n\t});\n\tthis.defaultEditor.onAction(\"app.session.new\", () => this.handleClearCommand());\n\tthis.defaultEditor.onAction(\"app.session.tree\", () => this.showTreeSelector());\n\tthis.defaultEditor.onAction(\"app.session.fork\", () => this.showUserMessageSelector());\n\tthis.defaultEditor.onAction(\"app.session.resume\", () => this.showSessionSelector());\n\n\tthis.defaultEditor.onChange = (text: string) => {\n\t\tconst wasBashMode = this.isBashMode;\n\t\tthis.isBashMode = text.trimStart().startsWith(\"!\");\n\t\tif (wasBashMode !== this.isBashMode) {\n\t\t\tthis.updateEditorBorderColor();\n\t\t}\n\t};\n\n\t// Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,\n\t// images are attached via temporary files, and plain text is the final fallback.\n\tthis.defaultEditor.onPasteImage = () => {\n\t\tthis.handleClipboardImagePaste();\n\t};\n};\n\nInteractiveModeBase.prototype.handleClipboardImagePaste = async function (this: InteractiveModeBase): Promise<void> {\n\tawait pasteClipboardImageToEditor(this.editor, () => this.ui.requestRender(), {\n\t\tshowWarning: (message) => this.showWarning(message),\n\t\tisBashMode: this.isBashMode,\n\t});\n};\n\nInteractiveModeBase.prototype.deliverStartupReplayPrompt = function (this: InteractiveModeBase, text: string): void {\n\tif (this.onInputCallback) {\n\t\tif (!text.startsWith(\"/\")) {\n\t\t\tthis.renderDeferredUserInput(text);\n\t\t}\n\t\tconst callback = this.onInputCallback;\n\t\tthis.onInputCallback = undefined;\n\t\tcallback({ text, draft: text });\n\t} else {\n\t\tthis.pendingUserInputs.push({ text, draft: text });\n\t}\n};\n\nInteractiveModeBase.prototype.drainStartupReplayCommands = async function (this: InteractiveModeBase): Promise<void> {\n\twhile (this.pendingUserInputs.length === 0 && this.startupReplayActiveInput) {\n\t\tconst activeInput = this.startupReplayActiveInput;\n\t\tawait this.defaultEditor.onSubmit?.(activeInput);\n\t\tif (this.editor.getText().trim() === activeInput.trim()) {\n\t\t\tthis.editor.setText(\"\");\n\t\t}\n\t\tif (this.startupReplayActiveInput?.trim() === activeInput.trim()) break;\n\t}\n};\n\nInteractiveModeBase.prototype.advanceStartupInputReplay = function (\n\tthis: InteractiveModeBase,\n\tsubmittedText: string,\n): void {\n\tif (this.startupReplayActiveInput?.trim() !== submittedText.trim()) return;\n\tthis.startupReplayActiveInput = undefined;\n\n\twhile (this.startupReplayInputs.length > 0) {\n\t\tconst nextInput = this.startupReplayInputs.shift();\n\t\tif (nextInput === undefined) break;\n\t\tconst trimmed = nextInput.trimStart();\n\t\tif (trimmed.startsWith(\"/\") || trimmed.startsWith(\"!\")) {\n\t\t\tthis.startupReplayActiveInput = nextInput.trim();\n\t\t\tthis.editor.setText(this.startupReplayActiveInput);\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\t\tthis.deliverStartupReplayPrompt(nextInput);\n\t}\n\n\tif (this.startupDraftText !== undefined) {\n\t\tthis.editor.setText(this.startupDraftText);\n\t\tthis.startupDraftText = undefined;\n\t\tthis.ui.requestRender();\n\t}\n};\n\nInteractiveModeBase.prototype.setupEditorSubmitHandler = function (this: InteractiveModeBase): void {\n\tthis.defaultEditor.onSubmit = async (text: string) => {\n\t\tif (!this.firstSubmitRecorded) {\n\t\t\tthis.firstSubmitRecorded = true;\n\t\t\trecordTimeSinceReset(\"interactive-first-submit\");\n\t\t\tmarkLifecycleTiming(\"interactive-first-submit\");\n\t\t}\n\t\t// pi-tui trims, expands pastes, and clears the editor before it calls\n\t\t// onSubmit, so the callback argument is already reduced. Prefer the buffer\n\t\t// CustomEditor snapshotted for this very dispatch, which is what the user\n\t\t// actually had, and fall back to the argument for other editors and for\n\t\t// tests that invoke onSubmit directly.\n\t\tconst submittedDraft = this.defaultEditor.takeSubmittedDraft?.() ?? text;\n\t\ttext = text.trim();\n\t\tif (!text) return;\n\n\t\tif (this.startupReplayActiveInput && this.startupReplayActiveInput.trim() !== text.trim()) {\n\t\t\tthis.startupReplayInputs.push(text);\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\t// While a subagent is shown, the prompt is its; the main chat's path is untouched otherwise.\n\t\tconst viewed = this.agentView?.viewed;\n\t\tif (viewed?.kind === \"agent\") {\n\t\t\tawait submitToViewedAgent(this, viewed.port, text, submittedDraft);\n\t\t\treturn;\n\t\t}\n\t\t// Text a gone subagent's prompt moved here, submitted unedited, asks first when it would rewrite main. Decided\n\t\t// synchronously: with nothing moved, main's path runs exactly as before.\n\t\tconst moved = gateMovedDraft(this, text, submittedDraft);\n\t\tif (moved !== undefined) {\n\t\t\tawait moved;\n\t\t\treturn;\n\t\t}\n\t\tawait mainSubmit(this, text, submittedDraft);\n\t};\n};\n\n/**\n * What the main chat does with a submission: `text` trimmed and non-empty, `submittedDraft` the buffer as typed.\n * While a subagent is shown, the commands that run as in the main chat come here too.\n */\nexport function mainSubmit(\n\tmode: InteractiveModeBase,\n\ttext: string,\n\tsubmittedDraft: string,\n\tprompt: PromptHandle = promptHandle(mode, \"viewed\"),\n): Promise<void> {\n\treturn submitToMainChat.call(mode, text, submittedDraft, prompt);\n}\n\n/**\n * `prompt` is the prompt the submission came from, captured before anything here awaits: its clears and history reach\n * that prompt even when the screen shows another agent by then. While main is shown it is the editor itself.\n */\nasync function submitToMainChat(\n\tthis: InteractiveModeBase,\n\ttext: string,\n\tsubmittedDraft: string,\n\tprompt: PromptHandle,\n): Promise<void> {\n\ttry {\n\t\t// Built-in commands split their name from their arguments at the first\n\t\t// whitespace, the same way prompt templates, skills and extension commands do.\n\t\tconst { name: command, args } = text.startsWith(\"/\") ? parseSlashCommand(text) : { name: \"\", args: \"\" };\n\t\tconst argument = args.trim() || undefined;\n\t\tconst bare = (name: string) => command === name && args === \"\";\n\t\tif (command === \"tasks\") {\n\t\t\t// The panel takes the prompt's place: until it is up, the prompt's slot keeps showing what it showed.\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\ttry {\n\t\t\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime) {\n\t\t\t\t\tawait this.runtimeHost.openTaskInspector(argument);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!getOwnerTaskStore(this.session)) this.session.getAgentTaskHost();\n\t\t\t\tconst store = getOwnerTaskStore(this.session);\n\t\t\t\tprompt.setText(\"\");\n\t\t\t\tif (!store) {\n\t\t\t\t\tthis.showStatus(\"Launched agents and shells will appear here.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst ui = this.createExtensionUIContext();\n\t\t\t\tawait showTaskInspector(\n\t\t\t\t\t{\n\t\t\t\t\t\tcustom: (factory, options) => this.showExtensionCustom(factory, options),\n\t\t\t\t\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\t\t\t\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\t\t\t\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\t\t\t\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\t\t\t\t\tnotify: ui.notify,\n\t\t\t\t\t},\n\t\t\t\t\tstore,\n\t\t\t\t\targument,\n\t\t\t\t\t{ board: agentPanelBoardSource(this.session) },\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t} finally {\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t}\n\t\tif (bare(\"settings\")) {\n\t\t\tconst shown = this.showSettingsSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait shown;\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"scoped-models\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tthis.showModelsSelector();\n\t\t\t} finally {\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"model\") {\n\t\t\t// Without a model to pick, it opens the selector.\n\t\t\tconst held = argument === undefined ? holdPromptSlot(this.editorContainer) : undefined;\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tawait this.handleModelCommand(argument);\n\t\t\t} finally {\n\t\t\t\theld?.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"thinking\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.handleThinkingCommand(argument);\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"export\") {\n\t\t\tawait this.handleExportCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"import\") {\n\t\t\tawait this.handleImportCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"share\")) {\n\t\t\tawait this.handleShareCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"copy\")) {\n\t\t\tawait this.handleCopyCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"name\") {\n\t\t\tawait this.handleNameCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"session\")) {\n\t\t\tawait this.handleSessionCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"session\" && args === \"snapshot\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleSessionSnapshotCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"tools\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleToolsCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"changelog\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleChangelogCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"hotkeys\")) {\n\t\t\tthis.handleHotkeysCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"fork\")) {\n\t\t\tthis.showUserMessageSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"clone\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleCloneCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"tree\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tconst shown = this.showTreeSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\tvoid shown.finally(() => held.settle());\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"trust\")) {\n\t\t\tvoid this.showTrustSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"login\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleLoginCommand(argument);\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"logout\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.showOAuthSelector(\"logout\", argument);\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"new\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleClearCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"compact\") {\n\t\t\tprompt.setText(\"\");\n\t\t\t// A manual request can take over automatic compaction, but a second manual\n\t\t\t// compaction or branch summary still has no safe independent owner.\n\t\t\tconst automaticCompaction =\n\t\t\t\tthis.session.compactionReason === \"threshold\" || this.session.compactionReason === \"overflow\";\n\t\t\tif (this.manualCompactionTakeoverPending || (this.compactionActive && !automaticCompaction)) {\n\t\t\t\tthis.showWarning(COMPACTION_ALREADY_IN_PROGRESS_WARNING);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait this.handleCompactCommand(args);\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"reload\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.handleReloadCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"debug\")) {\n\t\t\tconst written = this.handleDebugCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait written;\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"arminsayshi\")) {\n\t\t\tthis.handleArminSaysHi();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"dementedelves\")) {\n\t\t\tconst shown = this.handleDementedDelves();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait shown;\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"resume\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tif (argument) await this.handleResumeTarget(argument);\n\t\t\telse {\n\t\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\t\tthis.showSessionSelector();\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"quit\") || bare(\"exit\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.shutdown();\n\t\t\treturn;\n\t\t}\n\n\t\tif (text.startsWith(\"/\") && this.deferredStartupPending) {\n\t\t\tprompt.addToHistory(text);\n\t\t\tprompt.setText(\"\");\n\t\t\tthis.ui.requestRender();\n\t\t\tawait yieldToEventLoop();\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.session.prompt(text);\n\t\t\treturn;\n\t\t}\n\t\t// Handle bash command (! for normal, !! for excluded from context)\n\t\tif (text.startsWith(\"!\")) {\n\t\t\tconst isExcluded = text.startsWith(\"!!\");\n\t\t\tconst command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();\n\t\t\tif (command) {\n\t\t\t\tif (this.session.isBashRunning) {\n\t\t\t\t\tthis.showWarning(\"A bash command is already running. esc cancel first.\");\n\t\t\t\t\tprompt.setText(text);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tprompt.addToHistory(text);\n\t\t\t\tawait this.handleBashCommand(command, isExcluded);\n\t\t\t\tthis.isBashMode = false;\n\t\t\t\tthis.updateEditorBorderColor();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Queue input behind compaction-queued messages (extension commands execute immediately)\n\t\tif (\n\t\t\tthis.compactionActive ||\n\t\t\t(!this.session.queuedMessagesPaused &&\n\t\t\t\t(this.compactionFlushPending || this.compactionSendFailed || this.promptTurn?.dispatched === false))\n\t\t) {\n\t\t\tif (this.isExtensionCommand(text)) {\n\t\t\t\tprompt.addToHistory(text);\n\t\t\t\tprompt.setText(\"\");\n\t\t\t\t// Messages the command sends must follow the ones already typed (#4251).\n\t\t\t\tif (this.compactionActive) handOffCompactionQueue(this);\n\t\t\t\tawait this.session.prompt(text);\n\t\t\t} else {\n\t\t\t\tthis.queueCompactionMessage(text, \"steer\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// A paused submission releases the session queue before its own turn, so move held\n\t\t// messages there first to keep them ahead of this one.\n\t\tif (this.session.queuedMessagesPaused && this.compactionSendFailed && !this.compactionFlushPending) {\n\t\t\tawait this.flushCompactionQueue({ willRetry: false });\n\t\t}\n\n\t\t// If streaming, use prompt() with steer behavior\n\t\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\t\tif ((this.session.isStreaming || this.promptTurn !== undefined) && !this.session.queuedMessagesPaused) {\n\t\t\tprompt.addToHistory(text);\n\t\t\tprompt.setText(\"\");\n\t\t\t// The session can show the message before this prompt's answer arrives: an engine sends its answer as the run\n\t\t\t// starts, before or after the run's first events. If the session already showed the message, echoing it again\n\t\t\t// here would show it twice (#4272). It shows the message as sent, which an `input` hook may have rewritten\n\t\t\t// (#4277), so any message it showed meanwhile counts.\n\t\t\tconst shownBefore = this.userMessagesShownBySession;\n\t\t\tconst startedEcho = followStartedRunEcho(this, text, { sendShowsWorkingRow: false });\n\t\t\tlet submitted: SteeringSubmitResult;\n\t\t\ttry {\n\t\t\t\tsubmitted = await mainSteering(this).submit(text, \"steer\", {\n\t\t\t\t\troute: \"queue\",\n\t\t\t\t\t// An extension command runs at once instead of queueing, so only other input is shown as queued (#4696).\n\t\t\t\t\tshowAsQueued: !this.isExtensionCommand(text),\n\t\t\t\t\tonAnswered: (success, disposition) => {\n\t\t\t\t\t\tconst echoed =\n\t\t\t\t\t\t\tsuccess &&\n\t\t\t\t\t\t\tdisposition === \"started\" &&\n\t\t\t\t\t\t\t!text.startsWith(\"/\") &&\n\t\t\t\t\t\t\tthis.userMessagesShownBySession === shownBefore;\n\t\t\t\t\t\tif (echoed) {\n\t\t\t\t\t\t\tthis.renderDeferredUserInput(text);\n\t\t\t\t\t\t\tthis.expectStartedUserInput(text, shownBefore);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// The run's own events decide this echo (#5135), however they and this answer are ordered.\n\t\t\t\t\t\tstartedEcho.answer(echoed);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstartedEcho.close();\n\t\t\t}\n\t\t\tif (submitted.kind === \"failed\") throw submitted.error;\n\t\t\tif (submitted.kind === \"lost\") {\n\t\t\t\tthis.showError(submitted.error.message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (submitted.kind === \"refused\") {\n\t\t\t\trestoreRefusedSubmission(this, submitted.error, submittedDraft, prompt);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\n\t\t// Normal message submission\n\t\t// First, move any pending bash components to chat\n\t\tthis.flushPendingBashComponents();\n\t\t// The draft travels with this submission, never through shared state: a\n\t\t// later submission whose trimmed text is identical must not be able to\n\t\t// claim, or clear, this one's exact buffer.\n\t\tconst submission = { text, draft: submittedDraft };\n\n\t\tif (this.onInputCallback) {\n\t\t\tif (!text.startsWith(\"/\")) {\n\t\t\t\tthis.renderDeferredUserInput(text);\n\t\t\t}\n\t\t\tthis.promptTurn ??= { dispatched: false };\n\t\t\tthis.onInputCallback(submission);\n\t\t} else {\n\t\t\tthis.pendingUserInputs.push(submission);\n\t\t}\n\t\tprompt.addToHistory(text);\n\t} catch (error) {\n\t\t// Direct dispatch branches above hand text straight to the engine and\n\t\t// never reach runUserPromptTurn(), so this is the only place their send\n\t\t// failures can put the draft back. Anything else is not ours to absorb.\n\t\tif (!restoreFailedSubmissionDraft(this, error, submittedDraft, { prompt })) throw error;\n\t} finally {\n\t\tthis.advanceStartupInputReplay?.(text);\n\t}\n}\n\n/**\n * A click on a hint that names a slash command, such as `/tasks to manage`, runs it as if it were typed into an empty\n * prompt. The prompt keeps what it held.\n */\nfunction registerHintCommandHandler(mode: InteractiveModeBase): void {\n\tconst remoteCommand = (name: string) =>\n\t\tgetInteractiveEngineRemoteCommands(mode.runtimeHost).find((cmd) => cmd.name === name);\n\tbindBundledHintCommands(mode.keybindings, (name) => {\n\t\tconst local = mode.session.extensionRunner.getCommand(name);\n\t\tif (local) return local.sourceInfo.configurationOrigin === \"bundled\";\n\t\tconst remote = remoteCommand(name);\n\t\treturn remote?.source === \"extension\" && remote.sourceInfo.configurationOrigin === \"bundled\";\n\t});\n\tmode.ui.setHintCommandHandler?.((command) => {\n\t\tconst submit = mode.defaultEditor.onSubmit;\n\t\tif (!submit) return;\n\t\tconst { name } = parseSlashCommand(command);\n\t\t// A painted hint may outlive its registration. Never submit unrecognized slash text as a user message.\n\t\tif (\n\t\t\t!BUILTIN_SLASH_COMMAND_NAMES.has(name) &&\n\t\t\t!mode.session.extensionRunner.getCommand(name) &&\n\t\t\t!remoteCommand(name) &&\n\t\t\t!mode.session.promptTemplates?.some((template) => template.name === name) &&\n\t\t\t!mode.skillCommands?.has(name)\n\t\t)\n\t\t\treturn;\n\t\tconst draft = mode.editor.getText();\n\t\tconst run = submit(command);\n\t\tif (draft !== \"\" && mode.editor.getText() === \"\") mode.editor.setText(draft);\n\t\tvoid Promise.resolve(run).catch((error: unknown) => mode.showError(sourceError(error).message));\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-input-handling.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,kCAAkC,EACl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AC,KAAK,CAAC,CAAC;QAC7E,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { bindBundledHintCommands, isHintActivation, isKeyRelease, Text } from \"@bastani/atomic-tui\";\nimport { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { parseSlashCommand } from \"../../core/slash-commands.js\";\nimport { sourceError } from \"../../core/tasks/agent-panel-source.ts\";\nimport { getOwnerTaskStore } from \"../../core/tasks/owner-store.js\";\nimport { stopAllBackgroundWork } from \"../../core/tasks/stop-all.ts\";\nimport { yieldToEventLoop } from \"../../utils/event-loop.ts\";\nimport {\n\tgetInteractiveEngineRemoteCommands,\n\tinteractiveEngineNeedsExplicitTermination,\n\tinterruptBlockedInteractiveEngine,\n\tterminateInteractiveEngine,\n} from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport {\n\tdismissRemoteProxy,\n\tremoteEngineProxyOwner,\n\tremoteProxyHandlesCtrlC,\n} from \"../interactive-engine/remote-input-ownership.ts\";\nimport { agentPanelCounts, agentPanelHasRows, showAgentPanel } from \"../rpc/agent-panel-bridge.ts\";\nimport {\n\tagentPanelBoardSource,\n\topenWaitedShellOf,\n\tshowTaskInspector,\n\ttype TaskInspectorUi,\n} from \"../rpc/task-ui-bridge.js\";\nimport { type PromptHandle, promptHandle } from \"./agent-view/agent-drafts.ts\";\nimport { gateMovedDraft } from \"./agent-view/viewed-commands.ts\";\nimport { escapeViewedAgent, submitToViewedAgent } from \"./agent-view/viewed-submit.ts\";\nimport { isChatSessionWorking } from \"./components/footer.ts\";\nimport { LoginDialogComponent } from \"./components/login-dialog.ts\";\nimport { bindMainComposerAgentRows, MainComposerKeyOverlay } from \"./components/main-composer-keys.ts\";\nimport { holdPromptSlot } from \"./components/prompt-slot.ts\";\nimport { ScopedModelsSelectorComponent } from \"./components/scoped-models-selector.ts\";\nimport { StartupIdentityComponent } from \"./components/startup-identity.ts\";\nimport { holdForExtensionCommand, holdSubmittedExtensionCommand } from \"./extension-command-hold.ts\";\nimport { COMPACTION_ALREADY_IN_PROGRESS_WARNING } from \"./interactive-bash-compact.ts\";\nimport { routeGlobalClearInput } from \"./interactive-global-clear.ts\";\nimport { isPhysicalCtrlC, isPhysicalEscape, isSafetyKeyRelease } from \"./interactive-key-identity.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { pasteClipboardImageToEditor, recordTimeSinceReset } from \"./interactive-mode-deps.ts\";\nimport { BUILTIN_SLASH_COMMAND_NAMES } from \"./interactive-mode-helpers.ts\";\nimport { cachedExactModelMatch } from \"./interactive-model-routing.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft, restoreRefusedSubmission } from \"./interactive-prompt-restore.ts\";\nimport { handOffCompactionQueue, mainSteering } from \"./interactive-queueing.ts\";\nimport { followStartedRunEcho } from \"./interactive-render-chat.ts\";\nimport { createStopAllChord, createStopAllNotices, STOP_ALL_STATUS_KEY } from \"./interactive-stop-all.ts\";\nimport { screenHoldOf } from \"./screen-hold.ts\";\nimport type { SteeringSubmitResult } from \"./steering-queue-controller.ts\";\nimport { theme } from \"./theme/theme.js\";\n\n/** Whether the prompt has the keyboard; a host without focus tracking always gives it the prompt. */\nfunction promptHasFocus(mode: InteractiveModeBase): boolean {\n\tconst focused = (mode.ui as { getFocusedComponent?(): object | null }).getFocusedComponent?.();\n\treturn focused === undefined || focused === mode.editor;\n}\n\n/** Where `/tasks` mounts in this process, with the chat's render settings. */\nfunction taskInspectorUi(mode: InteractiveModeBase): TaskInspectorUi {\n\tconst ui = mode.createExtensionUIContext();\n\treturn {\n\t\tcustom: (factory, options) => mode.showExtensionCustom(factory, options),\n\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\tnotify: ui.notify,\n\t};\n}\n\nfunction mainComposerPanelCounts(mode: InteractiveModeBase) {\n\treturn mode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t? mode.runtimeHost.agentPanelCounts\n\t\t: agentPanelCounts(mode.session);\n}\n\nexport function registerStartupInputListeners(mode: InteractiveModeBase): void {\n\tif (mode.keybindings) {\n\t\tbindMainComposerAgentRows(mode.keybindings, () => mainComposerPanelCounts(mode));\n\t}\n\t// A part of the screen held while a view is on its way is shown live before any key handler acts on the key, a key\n\t// another handler then takes (Ctrl+C, the stop-all chord) included.\n\tmode.addTuiInputListener((data) => {\n\t\tscreenHoldOf(mode).noteInput(data);\n\t\treturn undefined;\n\t});\n\tmode.addTuiInputListener(() =>\n\t\tmode.builtInHeader instanceof StartupIdentityComponent ? void mode.builtInHeader.settle() : undefined,\n\t);\n\tmode.addTuiInputListener((data) =>\n\t\trouteGlobalClearInput(data, {\n\t\t\t// Physical identity first: safety routing must survive an `app.clear` remap.\n\t\t\tmatchesCtrlC: isPhysicalCtrlC,\n\t\t\tmatchesEscape: isPhysicalEscape,\n\t\t\tisSafetyKeyRelease,\n\t\t\tmatchesClear: (candidate) => mode.keybindings.matches(candidate, \"app.clear\"),\n\t\t\thasOverlay: () => mode.ui.hasOverlay(),\n\t\t\tblockingInlineCustomUiActive: () => mode.blockingInlineCustomUiDepth > 0,\n\t\t\teditorOwnsInput: () => mode.editorContainer.children.includes(mode.editor),\n\t\t\tremoteEngineProxyOwner: () =>\n\t\t\t\tremoteEngineProxyOwner(mode.runtimeHost, {\n\t\t\t\t\thasOverlay: () => mode.ui.hasOverlay(),\n\t\t\t\t\tinlineComponents: () => mode.editorContainer.children,\n\t\t\t\t}),\n\t\t\tremoteProxyHandlesCtrlC: (owner) => remoteProxyHandlesCtrlC(mode.runtimeHost, owner),\n\t\t\tonRemoteProxyDismiss: (owner) => {\n\t\t\t\tdismissRemoteProxy(mode.runtimeHost, owner);\n\t\t\t},\n\t\t\tengineNeedsExplicitTermination: () => interactiveEngineNeedsExplicitTermination(mode.runtimeHost),\n\t\t\tonEngineTerminate: () => {\n\t\t\t\tterminateInteractiveEngine(mode.runtimeHost);\n\t\t\t},\n\t\t\tonClear: () => mode.handleCtrlC(),\n\t\t\trequestRender: () => mode.ui.requestRender(),\n\t\t}),\n\t);\n}\n\nInteractiveModeBase.prototype.setupKeyHandlers = async function (this: InteractiveModeBase): Promise<void> {\n\tregisterStartupInputListeners(this);\n\tregisterHintCommandHandler(this);\n\tconst isolated = this.runtimeHost instanceof IsolatedInteractiveRuntime ? this.runtimeHost : undefined;\n\tconst notices = createStopAllNotices({\n\t\t...(isolated === undefined\n\t\t\t? {\n\t\t\t\t\tsetFooterStatus: (text: string | undefined) =>\n\t\t\t\t\t\tthis.footerDataProvider.setExtensionStatus(STOP_ALL_STATUS_KEY, text),\n\t\t\t\t\tshowToast: (text: string) => {\n\t\t\t\t\t\tconst toast = this.ui.showOverlay(new Text(theme.fg(\"warning\", text), 1, 0), {\n\t\t\t\t\t\t\tanchor: \"bottom-center\",\n\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\toffsetY: -3,\n\t\t\t\t\t\t\tnonCapturing: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn () => toast.hide();\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: { setEngineNotice: (text: string | undefined) => void isolated.setStopAllNotice(text).catch(() => {}) }),\n\t\thasOverlay: () => this.ui.hasOverlay(),\n\t\trequestRender: () => this.ui.requestRender(),\n\t});\n\tthis.addTuiInputListener(\n\t\tcreateStopAllChord({\n\t\t\tkeybindings: this.keybindings,\n\t\t\tchordAllowed: () => {\n\t\t\t\tconst focused = (this.ui as { getFocusedComponent?(): object | null }).getFocusedComponent?.();\n\t\t\t\treturn !(focused instanceof LoginDialogComponent || focused instanceof ScopedModelsSelectorComponent);\n\t\t\t},\n\t\t\tstopAll: () =>\n\t\t\t\tthis.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t\t? this.runtimeHost.stopAllBackgroundWork()\n\t\t\t\t\t: stopAllBackgroundWork(this.session),\n\t\t\tshowStatus: (message) => notices.show(message),\n\t\t\tshowWarning: (message) => notices.show(message),\n\t\t\tclearStatus: () => notices.clear(),\n\t\t}),\n\t);\n\tlet agentPanelRequested = false;\n\tthis.addTuiInputListener((data) => {\n\t\tif (isKeyRelease(data) || isPhysicalEscape(data) || !this.keybindings.matches(data, \"app.agents.focus\"))\n\t\t\treturn undefined;\n\t\tif (this.ui.hasOverlay() || !this.editorContainer.children.includes(this.editor)) return undefined;\n\t\tif (this.editor.capturesViewportInput) return undefined;\n\t\t// A shown subagent's question form takes the keys while it has the focus: ↓ moves its choice there.\n\t\tif (this.agentView?.viewed.kind === \"agent\" && !promptHasFocus(this)) return undefined;\n\t\t// A click on the `↓ agents` hint focuses the panel whatever the prompt holds; a typed ↓ does only on an empty one.\n\t\tif (this.editor !== this.defaultEditor || this.isBashMode) return undefined;\n\t\tif (this.editor.getText() !== \"\" && !isHintActivation()) return undefined;\n\t\tif (agentPanelRequested || this.blockingInlineCustomUiDepth > 0) return { consume: true };\n\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime) {\n\t\t\tagentPanelRequested = true;\n\t\t\tvoid this.runtimeHost\n\t\t\t\t.openAgentPanel()\n\t\t\t\t.catch((error: unknown) => this.showWarning(sourceError(error).message))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tagentPanelRequested = false;\n\t\t\t\t});\n\t\t\treturn { consume: true };\n\t\t}\n\t\tif (!agentPanelHasRows(this.session)) return undefined;\n\t\tconst ui = this.createExtensionUIContext();\n\t\tvoid showAgentPanel(this.session, {\n\t\t\tcustom: (factory, options) => this.showExtensionCustom(factory, options),\n\t\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\t\tnotify: ui.notify,\n\t\t}).catch((error: unknown) => this.showWarning(sourceError(error).message));\n\t\treturn { consume: true };\n\t});\n\t// While the screen shows a subagent that waits on its shells, the waited-shell key opens the newest one's output.\n\tthis.addTuiInputListener((data) => {\n\t\tconst viewed = this.agentView?.viewed;\n\t\tif (viewed?.kind !== \"agent\" || isKeyRelease(data) || !this.keybindings.matches(data, \"app.tasks.openWaited\"))\n\t\t\treturn undefined;\n\t\tif (this.ui.hasOverlay() || !this.editorContainer.children.includes(this.editor) || !promptHasFocus(this))\n\t\t\treturn undefined;\n\t\tconst status = viewed.port.status();\n\t\tif (status.state !== \"waiting\") return undefined;\n\t\tconst opened =\n\t\t\tthis.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t? this.runtimeHost.openTaskInspector(undefined, { waitedShellOf: status.taskId })\n\t\t\t\t: openWaitedShellOf(this.session, taskInspectorUi(this), status.taskId);\n\t\tvoid opened.catch((error: unknown) => this.showWarning(sourceError(error).message));\n\t\treturn { consume: true };\n\t});\n\t// Set up handlers on defaultEditor - they use this.editor for text access\n\t// so they work correctly regardless of which editor is active\n\tthis.defaultEditor.onEscape = () => {\n\t\tif (!this.session.isStreaming && interruptBlockedInteractiveEngine(this.runtimeHost)) return;\n\t\t// While a subagent is shown, Esc is about it: it pauses it, and never interrupts the main chat.\n\t\tif (escapeViewedAgent(this)) return;\n\t\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages() || this.session.queuedMessagesPaused) {\n\t\t\tpauseAndAbortInteractiveSession(this, { restoreQueuedMessages: true });\n\t\t} else if (this.session.isRetrying) {\n\t\t\tthis.session.abortRetry();\n\t\t} else if (this.session.isBashRunning) {\n\t\t\tthis.session.abortBash();\n\t\t} else if (this.isBashMode) {\n\t\t\tthis.editor.setText(\"\");\n\t\t\tthis.isBashMode = false;\n\t\t\tthis.updateEditorBorderColor();\n\t\t} else if (!this.editor.getText().trim()) {\n\t\t\t// Double-escape with empty editor triggers /tree, /fork, or nothing based on setting\n\t\t\tconst action = this.settingsManager.getDoubleEscapeAction();\n\t\t\tif (action !== \"none\") {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tif (now - this.lastEscapeTime < 500) {\n\t\t\t\t\tif (action === \"tree\") {\n\t\t\t\t\t\tthis.showTreeSelector();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showUserMessageSelector();\n\t\t\t\t\t}\n\t\t\t\t\tthis.lastEscapeTime = 0;\n\t\t\t\t} else {\n\t\t\t\t\tthis.lastEscapeTime = now;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t// Register app action handlers\n\tthis.defaultEditor.onAction(\"app.clear\", () => this.handleCtrlC());\n\tthis.defaultEditor.onCtrlD = () => this.handleCtrlD();\n\tthis.defaultEditor.onAction(\"app.suspend\", () => this.handleCtrlZ());\n\tthis.defaultEditor.onAction(\"app.thinking.cycle\", () => {\n\t\tvoid this.cycleThinkingLevel().catch((error: Error) => this.showError(error.message));\n\t});\n\tthis.defaultEditor.onAction(\"app.model.cycleForward\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.cycleModel(\"forward\");\n\t\t})();\n\t});\n\tthis.defaultEditor.onAction(\"app.model.cycleBackward\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tawait this.cycleModel(\"backward\");\n\t\t})();\n\t});\n\n\t// Global debug handler on TUI (works regardless of focus)\n\tthis.ui.onDebug = () => this.handleDebugCommand();\n\tthis.defaultEditor.onAction(\"app.model.select\", () => {\n\t\tvoid (async () => {\n\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\tthis.showModelSelector();\n\t\t})();\n\t});\n\tthis.defaultEditor.onAction(\"app.history.search\", () => this.showPromptHistorySearch());\n\tthis.defaultEditor.onAction(\"app.tools.expand\", () => this.toggleToolOutputExpansion());\n\tthis.defaultEditor.onAction(\"app.keys.help\", () => {\n\t\tvoid this.showExtensionCustom<void>(\n\t\t\t(_tui, _theme, keybindings, done) =>\n\t\t\t\tnew MainComposerKeyOverlay(\n\t\t\t\t\tkeybindings,\n\t\t\t\t\t() => ({\n\t\t\t\t\t\tagentRows: mainComposerPanelCounts(this).total,\n\t\t\t\t\t\tworking: isChatSessionWorking(this.session),\n\t\t\t\t\t}),\n\t\t\t\t\t() => done(),\n\t\t\t\t),\n\t\t);\n\t});\n\tthis.defaultEditor.onAction(\"app.thinking.toggle\", () => this.toggleThinkingBlockVisibility());\n\tthis.defaultEditor.onAction(\"app.editor.external\", () => {\n\t\tvoid this.openExternalEditor();\n\t});\n\tthis.defaultEditor.onAction(\"app.message.followUp\", () => this.handleFollowUp());\n\tthis.defaultEditor.onAction(\"app.message.dequeue\", () => {\n\t\tvoid this.handleDequeue();\n\t});\n\tthis.defaultEditor.onAction(\"app.session.new\", () => this.handleClearCommand());\n\tthis.defaultEditor.onAction(\"app.session.tree\", () => this.showTreeSelector());\n\tthis.defaultEditor.onAction(\"app.session.fork\", () => this.showUserMessageSelector());\n\tthis.defaultEditor.onAction(\"app.session.resume\", () => this.showSessionSelector());\n\n\tthis.defaultEditor.onChange = (text: string) => {\n\t\tconst wasBashMode = this.isBashMode;\n\t\tthis.isBashMode = text.trimStart().startsWith(\"!\");\n\t\tif (wasBashMode !== this.isBashMode) {\n\t\t\tthis.updateEditorBorderColor();\n\t\t}\n\t};\n\n\t// Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,\n\t// images are attached via temporary files, and plain text is the final fallback.\n\tthis.defaultEditor.onPasteImage = () => {\n\t\tthis.handleClipboardImagePaste();\n\t};\n};\n\nInteractiveModeBase.prototype.handleClipboardImagePaste = async function (this: InteractiveModeBase): Promise<void> {\n\tawait pasteClipboardImageToEditor(this.editor, () => this.ui.requestRender(), {\n\t\tshowWarning: (message) => this.showWarning(message),\n\t\tisBashMode: this.isBashMode,\n\t});\n};\n\nInteractiveModeBase.prototype.deliverStartupReplayPrompt = function (this: InteractiveModeBase, text: string): void {\n\tif (this.onInputCallback) {\n\t\tif (!text.startsWith(\"/\")) {\n\t\t\tthis.renderDeferredUserInput(text);\n\t\t}\n\t\tconst callback = this.onInputCallback;\n\t\tthis.onInputCallback = undefined;\n\t\tcallback({ text, draft: text });\n\t} else {\n\t\tthis.pendingUserInputs.push({ text, draft: text });\n\t}\n};\n\nInteractiveModeBase.prototype.drainStartupReplayCommands = async function (this: InteractiveModeBase): Promise<void> {\n\twhile (this.pendingUserInputs.length === 0 && this.startupReplayActiveInput) {\n\t\tconst activeInput = this.startupReplayActiveInput;\n\t\tawait this.defaultEditor.onSubmit?.(activeInput);\n\t\tif (this.editor.getText().trim() === activeInput.trim()) {\n\t\t\tthis.editor.setText(\"\");\n\t\t}\n\t\tif (this.startupReplayActiveInput?.trim() === activeInput.trim()) break;\n\t}\n};\n\nInteractiveModeBase.prototype.advanceStartupInputReplay = function (\n\tthis: InteractiveModeBase,\n\tsubmittedText: string,\n): void {\n\tif (this.startupReplayActiveInput?.trim() !== submittedText.trim()) return;\n\tthis.startupReplayActiveInput = undefined;\n\n\twhile (this.startupReplayInputs.length > 0) {\n\t\tconst nextInput = this.startupReplayInputs.shift();\n\t\tif (nextInput === undefined) break;\n\t\tconst trimmed = nextInput.trimStart();\n\t\tif (trimmed.startsWith(\"/\") || trimmed.startsWith(\"!\")) {\n\t\t\tthis.startupReplayActiveInput = nextInput.trim();\n\t\t\tthis.editor.setText(this.startupReplayActiveInput);\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\t\tthis.deliverStartupReplayPrompt(nextInput);\n\t}\n\n\tif (this.startupDraftText !== undefined) {\n\t\tthis.editor.setText(this.startupDraftText);\n\t\tthis.startupDraftText = undefined;\n\t\tthis.ui.requestRender();\n\t}\n};\n\nInteractiveModeBase.prototype.setupEditorSubmitHandler = function (this: InteractiveModeBase): void {\n\tthis.defaultEditor.onSubmit = async (text: string) => {\n\t\tif (!this.firstSubmitRecorded) {\n\t\t\tthis.firstSubmitRecorded = true;\n\t\t\trecordTimeSinceReset(\"interactive-first-submit\");\n\t\t\tmarkLifecycleTiming(\"interactive-first-submit\");\n\t\t}\n\t\t// pi-tui trims, expands pastes, and clears the editor before it calls\n\t\t// onSubmit, so the callback argument is already reduced. Prefer the buffer\n\t\t// CustomEditor snapshotted for this very dispatch, which is what the user\n\t\t// actually had, and fall back to the argument for other editors and for\n\t\t// tests that invoke onSubmit directly.\n\t\tconst submittedDraft = this.defaultEditor.takeSubmittedDraft?.() ?? text;\n\t\ttext = text.trim();\n\t\tif (!text) return;\n\n\t\tif (this.startupReplayActiveInput && this.startupReplayActiveInput.trim() !== text.trim()) {\n\t\t\tthis.startupReplayInputs.push(text);\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\t// While a subagent is shown, the prompt is its; the main chat's path is untouched otherwise.\n\t\tconst viewed = this.agentView?.viewed;\n\t\tif (viewed?.kind === \"agent\") {\n\t\t\tawait submitToViewedAgent(this, viewed.port, text, submittedDraft);\n\t\t\treturn;\n\t\t}\n\t\t// Text a gone subagent's prompt moved here, submitted unedited, asks first when it would rewrite main. Decided\n\t\t// synchronously: with nothing moved, main's path runs exactly as before.\n\t\tconst moved = gateMovedDraft(this, text, submittedDraft);\n\t\tif (moved !== undefined) {\n\t\t\tawait moved;\n\t\t\treturn;\n\t\t}\n\t\tawait mainSubmit(this, text, submittedDraft);\n\t};\n};\n\n/**\n * What the main chat does with a submission: `text` trimmed and non-empty, `submittedDraft` the buffer as typed.\n * While a subagent is shown, the commands that run as in the main chat come here too.\n */\nexport function mainSubmit(\n\tmode: InteractiveModeBase,\n\ttext: string,\n\tsubmittedDraft: string,\n\tprompt: PromptHandle = promptHandle(mode, \"viewed\"),\n): Promise<void> {\n\treturn submitToMainChat.call(mode, text, submittedDraft, prompt);\n}\n\n/**\n * `prompt` is the prompt the submission came from, captured before anything here awaits: its clears and history reach\n * that prompt even when the screen shows another agent by then. While main is shown it is the editor itself.\n */\nasync function submitToMainChat(\n\tthis: InteractiveModeBase,\n\ttext: string,\n\tsubmittedDraft: string,\n\tprompt: PromptHandle,\n): Promise<void> {\n\ttry {\n\t\t// Built-in commands split their name from their arguments at the first\n\t\t// whitespace, the same way prompt templates, skills and extension commands do.\n\t\tconst { name: command, args } = text.startsWith(\"/\") ? parseSlashCommand(text) : { name: \"\", args: \"\" };\n\t\tconst argument = args.trim() || undefined;\n\t\tconst bare = (name: string) => command === name && args === \"\";\n\t\tif (command === \"tasks\") {\n\t\t\t// The panel takes the prompt's place: until it is up, the prompt's slot keeps showing what it showed.\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\ttry {\n\t\t\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime) {\n\t\t\t\t\tawait this.runtimeHost.openTaskInspector(argument);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!getOwnerTaskStore(this.session)) this.session.getAgentTaskHost();\n\t\t\t\tconst store = getOwnerTaskStore(this.session);\n\t\t\t\tprompt.setText(\"\");\n\t\t\t\tif (!store) {\n\t\t\t\t\tthis.showStatus(\"Launched agents and shells will appear here.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst ui = this.createExtensionUIContext();\n\t\t\t\tawait showTaskInspector(\n\t\t\t\t\t{\n\t\t\t\t\t\tcustom: (factory, options) => this.showExtensionCustom(factory, options),\n\t\t\t\t\t\tgetChatRenderSettings: ui.getChatRenderSettings,\n\t\t\t\t\t\tgetFooterDataProvider: ui.getFooterDataProvider,\n\t\t\t\t\t\tgetToolsExpanded: ui.getToolsExpanded,\n\t\t\t\t\t\tsetToolsExpanded: ui.setToolsExpanded,\n\t\t\t\t\t\tnotify: ui.notify,\n\t\t\t\t\t},\n\t\t\t\t\tstore,\n\t\t\t\t\targument,\n\t\t\t\t\t{ board: agentPanelBoardSource(this.session) },\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t} finally {\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t}\n\t\tif (bare(\"settings\")) {\n\t\t\tconst shown = this.showSettingsSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait shown;\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"scoped-models\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tthis.showModelsSelector();\n\t\t\t} finally {\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"model\") {\n\t\t\t// Without a model to pick, it opens the selector. A name that matches no model known yet is looked up after a\n\t\t\t// refresh, and opens the selector unless the refresh finds it.\n\t\t\tconst held =\n\t\t\t\targument === undefined || cachedExactModelMatch(this, argument) === undefined\n\t\t\t\t\t? holdPromptSlot(this.editorContainer)\n\t\t\t\t\t: undefined;\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tawait this.handleModelCommand(argument);\n\t\t\t} finally {\n\t\t\t\theld?.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"thinking\") {\n\t\t\t// Without a level to set, it opens the selector.\n\t\t\tconst held = argument === undefined ? holdPromptSlot(this.editorContainer) : undefined;\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tawait this.handleThinkingCommand(argument);\n\t\t\t} finally {\n\t\t\t\theld?.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"export\") {\n\t\t\tawait this.handleExportCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"import\") {\n\t\t\tawait this.handleImportCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"share\")) {\n\t\t\t// Its loader takes the prompt's place at once; the prompt is back as soon as a cancel shows it.\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleShareCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"copy\")) {\n\t\t\tawait this.handleCopyCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"name\") {\n\t\t\tawait this.handleNameCommand(text);\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"session\")) {\n\t\t\tawait this.handleSessionCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"session\" && args === \"snapshot\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleSessionSnapshotCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"tools\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleToolsCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"changelog\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleChangelogCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"hotkeys\")) {\n\t\t\tthis.handleHotkeysCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"fork\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tconst shown = this.showUserMessageSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\tvoid shown.finally(() => held.settle());\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"clone\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleCloneCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"tree\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tconst shown = this.showTreeSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\tvoid shown.finally(() => held.settle());\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"trust\")) {\n\t\t\tvoid this.showTrustSelector();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"login\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleLoginCommand(argument);\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"logout\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.showOAuthSelector(\"logout\", argument);\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"new\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.handleClearCommand();\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"compact\") {\n\t\t\tprompt.setText(\"\");\n\t\t\t// A manual request can take over automatic compaction, but a second manual\n\t\t\t// compaction or branch summary still has no safe independent owner.\n\t\t\tconst automaticCompaction =\n\t\t\t\tthis.session.compactionReason === \"threshold\" || this.session.compactionReason === \"overflow\";\n\t\t\tif (this.manualCompactionTakeoverPending || (this.compactionActive && !automaticCompaction)) {\n\t\t\t\tthis.showWarning(COMPACTION_ALREADY_IN_PROGRESS_WARNING);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait this.handleCompactCommand(args);\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"reload\")) {\n\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\tprompt.setText(\"\");\n\t\t\ttry {\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tawait this.handleReloadCommand();\n\t\t\t} finally {\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"debug\")) {\n\t\t\tconst written = this.handleDebugCommand();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait written;\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"arminsayshi\")) {\n\t\t\tthis.handleArminSaysHi();\n\t\t\tprompt.setText(\"\");\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"dementedelves\")) {\n\t\t\tconst shown = this.handleDementedDelves();\n\t\t\tprompt.setText(\"\");\n\t\t\tawait shown;\n\t\t\treturn;\n\t\t}\n\t\tif (command === \"resume\") {\n\t\t\tprompt.setText(\"\");\n\t\t\tif (argument) await this.handleResumeTarget(argument);\n\t\t\telse {\n\t\t\t\tconst held = holdPromptSlot(this.editorContainer);\n\t\t\t\tthis.showSessionSelector();\n\t\t\t\theld.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (bare(\"quit\") || bare(\"exit\")) {\n\t\t\tprompt.setText(\"\");\n\t\t\tawait this.shutdown();\n\t\t\treturn;\n\t\t}\n\n\t\tif (text.startsWith(\"/\") && this.deferredStartupPending) {\n\t\t\tprompt.addToHistory(text);\n\t\t\tprompt.setText(\"\");\n\t\t\tthis.ui.requestRender();\n\t\t\t// A command an extension has registered already is held like any extension command; a name not known yet\n\t\t\t// is not.\n\t\t\tconst held = this.isExtensionCommand(text) ? holdForExtensionCommand(this) : undefined;\n\t\t\ttry {\n\t\t\t\tawait yieldToEventLoop();\n\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\tawait this.session.prompt(text);\n\t\t\t} finally {\n\t\t\t\theld?.settle();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// Handle bash command (! for normal, !! for excluded from context)\n\t\tif (text.startsWith(\"!\")) {\n\t\t\tconst isExcluded = text.startsWith(\"!!\");\n\t\t\tconst command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();\n\t\t\tif (command) {\n\t\t\t\tif (this.session.isBashRunning) {\n\t\t\t\t\tthis.showWarning(\"A bash command is already running. esc cancel first.\");\n\t\t\t\t\tprompt.setText(text);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tprompt.addToHistory(text);\n\t\t\t\tawait this.handleBashCommand(command, isExcluded);\n\t\t\t\tthis.isBashMode = false;\n\t\t\t\tthis.updateEditorBorderColor();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Queue input behind compaction-queued messages (extension commands execute immediately)\n\t\tif (\n\t\t\tthis.compactionActive ||\n\t\t\t(!this.session.queuedMessagesPaused &&\n\t\t\t\t(this.compactionFlushPending || this.compactionSendFailed || this.promptTurn?.dispatched === false))\n\t\t) {\n\t\t\tif (this.isExtensionCommand(text)) {\n\t\t\t\tprompt.addToHistory(text);\n\t\t\t\tprompt.setText(\"\");\n\t\t\t\t// Messages the command sends must follow the ones already typed (#4251).\n\t\t\t\tif (this.compactionActive) handOffCompactionQueue(this);\n\t\t\t\tconst held = holdForExtensionCommand(this);\n\t\t\t\ttry {\n\t\t\t\t\tawait this.session.prompt(text);\n\t\t\t\t} finally {\n\t\t\t\t\theld.settle();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.queueCompactionMessage(text, \"steer\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// A paused submission releases the session queue before its own turn, so move held\n\t\t// messages there first to keep them ahead of this one.\n\t\tif (this.session.queuedMessagesPaused && this.compactionSendFailed && !this.compactionFlushPending) {\n\t\t\tawait this.flushCompactionQueue({ willRetry: false });\n\t\t}\n\n\t\t// If streaming, use prompt() with steer behavior\n\t\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\t\tif ((this.session.isStreaming || this.promptTurn !== undefined) && !this.session.queuedMessagesPaused) {\n\t\t\tconst extensionCommand = this.isExtensionCommand(text);\n\t\t\tprompt.addToHistory(text);\n\t\t\tprompt.setText(\"\");\n\t\t\t// The session can show the message before this prompt's answer arrives: an engine sends its answer as the run\n\t\t\t// starts, before or after the run's first events. If the session already showed the message, echoing it again\n\t\t\t// here would show it twice (#4272). It shows the message as sent, which an `input` hook may have rewritten\n\t\t\t// (#4277), so any message it showed meanwhile counts.\n\t\t\tconst shownBefore = this.userMessagesShownBySession;\n\t\t\tconst startedEcho = followStartedRunEcho(this, text, { sendShowsWorkingRow: false });\n\t\t\tconst held = extensionCommand ? holdForExtensionCommand(this) : undefined;\n\t\t\tlet submitted: SteeringSubmitResult;\n\t\t\ttry {\n\t\t\t\tsubmitted = await mainSteering(this).submit(text, \"steer\", {\n\t\t\t\t\troute: \"queue\",\n\t\t\t\t\t// An extension command runs at once instead of queueing, so only other input is shown as queued (#4696).\n\t\t\t\t\tshowAsQueued: !extensionCommand,\n\t\t\t\t\tonAnswered: (success, disposition) => {\n\t\t\t\t\t\tconst echoed =\n\t\t\t\t\t\t\tsuccess &&\n\t\t\t\t\t\t\tdisposition === \"started\" &&\n\t\t\t\t\t\t\t!text.startsWith(\"/\") &&\n\t\t\t\t\t\t\tthis.userMessagesShownBySession === shownBefore;\n\t\t\t\t\t\tif (echoed) {\n\t\t\t\t\t\t\tthis.renderDeferredUserInput(text);\n\t\t\t\t\t\t\tthis.expectStartedUserInput(text, shownBefore);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// The run's own events decide this echo (#5135), however they and this answer are ordered.\n\t\t\t\t\t\tstartedEcho.answer(echoed);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstartedEcho.close();\n\t\t\t\theld?.settle();\n\t\t\t}\n\t\t\tif (submitted.kind === \"failed\") throw submitted.error;\n\t\t\tif (submitted.kind === \"lost\") {\n\t\t\t\tthis.showError(submitted.error.message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (submitted.kind === \"refused\") {\n\t\t\t\trestoreRefusedSubmission(this, submitted.error, submittedDraft, prompt);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\n\t\t// Normal message submission\n\t\t// First, move any pending bash components to chat\n\t\tthis.flushPendingBashComponents();\n\t\t// The draft travels with this submission, never through shared state: a\n\t\t// later submission whose trimmed text is identical must not be able to\n\t\t// claim, or clear, this one's exact buffer.\n\t\tconst submission = { text, draft: submittedDraft };\n\n\t\tif (this.onInputCallback) {\n\t\t\tif (!text.startsWith(\"/\")) {\n\t\t\t\tthis.renderDeferredUserInput(text);\n\t\t\t}\n\t\t\tthis.promptTurn ??= { dispatched: false };\n\t\t\tthis.onInputCallback(submission);\n\t\t} else {\n\t\t\tthis.pendingUserInputs.push(submission);\n\t\t}\n\t\tprompt.addToHistory(text);\n\t\t// The turn that runs an extension command, which starts after this, ends its hold of the prompt's slot.\n\t\tif (text.startsWith(\"/\") && this.isExtensionCommand(text)) holdSubmittedExtensionCommand(this, submission);\n\t} catch (error) {\n\t\t// Direct dispatch branches above hand text straight to the engine and\n\t\t// never reach runUserPromptTurn(), so this is the only place their send\n\t\t// failures can put the draft back. Anything else is not ours to absorb.\n\t\tif (!restoreFailedSubmissionDraft(this, error, submittedDraft, { prompt })) throw error;\n\t} finally {\n\t\tthis.advanceStartupInputReplay?.(text);\n\t}\n}\n\n/**\n * A click on a hint that names a slash command, such as `/tasks to manage`, runs it as if it were typed into an empty\n * prompt. The prompt keeps what it held.\n */\nfunction registerHintCommandHandler(mode: InteractiveModeBase): void {\n\tconst remoteCommand = (name: string) =>\n\t\tgetInteractiveEngineRemoteCommands(mode.runtimeHost).find((cmd) => cmd.name === name);\n\tbindBundledHintCommands(mode.keybindings, (name) => {\n\t\tconst local = mode.session.extensionRunner.getCommand(name);\n\t\tif (local) return local.sourceInfo.configurationOrigin === \"bundled\";\n\t\tconst remote = remoteCommand(name);\n\t\treturn remote?.source === \"extension\" && remote.sourceInfo.configurationOrigin === \"bundled\";\n\t});\n\tmode.ui.setHintCommandHandler?.((command) => {\n\t\tconst submit = mode.defaultEditor.onSubmit;\n\t\tif (!submit) return;\n\t\tconst { name } = parseSlashCommand(command);\n\t\t// A painted hint may outlive its registration. Never submit unrecognized slash text as a user message.\n\t\tif (\n\t\t\t!BUILTIN_SLASH_COMMAND_NAMES.has(name) &&\n\t\t\t!mode.session.extensionRunner.getCommand(name) &&\n\t\t\t!remoteCommand(name) &&\n\t\t\t!mode.session.promptTemplates?.some((template) => template.name === name) &&\n\t\t\t!mode.skillCommands?.has(name)\n\t\t)\n\t\t\treturn;\n\t\tconst draft = mode.editor.getText();\n\t\tconst run = submit(command);\n\t\tif (draft !== \"\" && mode.editor.getText() === \"\") mode.editor.setText(draft);\n\t\tvoid Promise.resolve(run).catch((error: unknown) => mode.showError(sourceError(error).message));\n\t});\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@bastani/atomic-agent-core";
|
|
2
|
+
import { InteractiveModeBase } from "./interactive-mode-base.ts";
|
|
2
3
|
import { type Api, type Model } from "./interactive-mode-deps.ts";
|
|
3
4
|
export declare function resolveThinkingSelectorDefault(rawDefault: ThinkingLevel | undefined, availableLevels: readonly ThinkingLevel[], model: Model<Api> | undefined): ThinkingLevel | undefined;
|
|
4
5
|
/**
|
|
@@ -14,4 +15,9 @@ export declare function resolveSessionThinkingDefault(model: Model<Api> | undefi
|
|
|
14
15
|
getModelThinkingLevel(provider: string, modelId: string): ThinkingLevel | undefined;
|
|
15
16
|
getDefaultThinkingLevel(): ThinkingLevel | undefined;
|
|
16
17
|
}): ThinkingLevel | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The model `searchTerm` names exactly among the models known without a refresh: the scoped models when there are any,
|
|
20
|
+
* else the available models already loaded.
|
|
21
|
+
*/
|
|
22
|
+
export declare function cachedExactModelMatch(mode: InteractiveModeBase, searchTerm: string): Model<Api> | undefined;
|
|
17
23
|
//# sourceMappingURL=interactive-model-routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-model-routing.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-model-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive-model-routing.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-model-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAShE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACN,KAAK,GAAG,EAER,KAAK,KAAK,EAMV,MAAM,4BAA4B,CAAC;AA4BpC,wBAAgB,8BAA8B,CAC7C,UAAU,EAAE,aAAa,GAAG,SAAS,EACrC,eAAe,EAAE,SAAS,aAAa,EAAE,EACzC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,GAC3B,aAAa,GAAG,SAAS,CAO3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,EAC7B,YAAY,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,EACjF,QAAQ,EAAE;IACT,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACpF,uBAAuB,IAAI,aAAa,GAAG,SAAS,CAAC;CACrD,GACC,aAAa,GAAG,SAAS,CAM3B;AA4BD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAa3G"}
|
|
@@ -77,20 +77,26 @@ InteractiveModeBase.prototype.handleModelCommand = async function (searchTerm) {
|
|
|
77
77
|
}
|
|
78
78
|
this.showModelSelector(searchTerm);
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The model `searchTerm` names exactly among the models known without a refresh: the scoped models when there are any,
|
|
82
|
+
* else the available models already loaded.
|
|
83
|
+
*/
|
|
84
|
+
export function cachedExactModelMatch(mode, searchTerm) {
|
|
85
|
+
if (mode.session.scopedModels.length > 0) {
|
|
86
|
+
return findExactModelReferenceMatch(searchTerm, mode.session.scopedModels.map((scoped) => scoped.model));
|
|
83
87
|
}
|
|
84
88
|
try {
|
|
85
|
-
|
|
86
|
-
...this.session.modelRuntime.getAvailableSnapshot(),
|
|
87
|
-
]);
|
|
88
|
-
if (cachedMatch)
|
|
89
|
-
return cachedMatch;
|
|
89
|
+
return findExactModelReferenceMatch(searchTerm, [...mode.session.modelRuntime.getAvailableSnapshot()]);
|
|
90
90
|
}
|
|
91
91
|
catch {
|
|
92
|
-
// A refresh
|
|
92
|
+
// A refresh retries the snapshot read and safely falls back to no match.
|
|
93
|
+
return undefined;
|
|
93
94
|
}
|
|
95
|
+
}
|
|
96
|
+
InteractiveModeBase.prototype.findExactModelMatch = async function (searchTerm) {
|
|
97
|
+
const cachedMatch = cachedExactModelMatch(this, searchTerm);
|
|
98
|
+
if (cachedMatch || this.session.scopedModels.length > 0)
|
|
99
|
+
return cachedMatch;
|
|
94
100
|
const models = await this.getModelCandidates();
|
|
95
101
|
return findExactModelReferenceMatch(searchTerm, models);
|
|
96
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-model-routing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-model-routing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,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B,CAC7C,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,eAAe,EACf,MAAM,EACN,GAAG,EAAE,CAAC,IAAI,EAAE,EACZ,8BAA8B,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,CAAC,CAClE,CAAC;QACF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@bastani/atomic-agent-core\";\nimport { normalizeProviderId } from \"@bastani/atomic-ai\";\nimport { clampThinkingLevel, modelsAreEqual } from \"@bastani/atomic-ai/compat\";\nimport { boundedInteractiveModelRefresh } from \"../../core/bounded-model-refresh.ts\";\nimport { formatModelLabel } from \"../../core/model-label.ts\";\nimport { thinkingLevelForModelSwitch } from \"../../core/model-switch-thinking-level.ts\";\nimport { isOfflineModeEnabled } from \"../../core/package-manager-env.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { promptHandle } from \"./agent-view/agent-drafts.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\ttype Api,\n\tfindExactModelReferenceMatch,\n\ttype Model,\n\tModelSelectorComponent,\n\tresolveModelScopeFromModels,\n\tScopedModelsSelectorComponent,\n\tThinkingSelectorComponent,\n\tUserMessageSelectorComponent,\n} from \"./interactive-mode-deps.ts\";\nimport { ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, isAnthropicSubscriptionAuthKey } from \"./interactive-mode-helpers.ts\";\nimport { mergeRestoredDraft } from \"./interactive-prompt-restore.ts\";\nimport { onPreliminaryCatalogWithdrawn } from \"./interactive-startup-trust.ts\";\nimport { refreshModelCatalogs } from \"./model-catalog-refresh.ts\";\n\n/** A selector already showing a restricted catalog owns its rows and the effort offered for each row. */\nfunction pendingModelView(mode: InteractiveModeBase) {\n\tconst runtime = mode.runtimeHost;\n\tconst isCurrent =\n\t\truntime instanceof IsolatedInteractiveRuntime\n\t\t\t? runtime.captureStartupCatalog()\n\t\t\t: runtime?.isProjectTrustPending?.() && !runtime.pendingProjectResourcesTrusted?.()\n\t\t\t\t? () => runtime.isProjectTrustPending() && !mode.settingsManager.isProjectTrusted()\n\t\t\t\t: undefined;\n\tif (!isCurrent) return undefined;\n\tconst levels = mode.settingsManager.getAllModelThinkingLevels();\n\tconst fallback = mode.settingsManager.getDefaultThinkingLevel();\n\treturn {\n\t\tisCurrent,\n\t\tsettings: {\n\t\t\tgetModelThinkingLevel: (provider: string, modelId: string) =>\n\t\t\t\tlevels[`${normalizeProviderId(provider)}/${modelId}`],\n\t\t\tgetDefaultThinkingLevel: () => fallback,\n\t\t},\n\t};\n}\n\nexport function resolveThinkingSelectorDefault(\n\trawDefault: ThinkingLevel | undefined,\n\tavailableLevels: readonly ThinkingLevel[],\n\tmodel: Model<Api> | undefined,\n): ThinkingLevel | undefined {\n\tif (rawDefault === undefined) return undefined;\n\tif (availableLevels.includes(rawDefault)) return rawDefault;\n\tif (!model) return availableLevels.includes(\"off\") ? \"off\" : availableLevels[0];\n\tconst clamped = clampThinkingLevel(model, rawDefault) as ThinkingLevel;\n\tif (availableLevels.includes(clamped)) return clamped;\n\treturn availableLevels.includes(\"off\") ? \"off\" : availableLevels[0];\n}\n\n/**\n * The saved level the active session would start from, in the precedence\n * `findInitialModel` uses: a scoped `--models \"id:level\"` entry wins over a\n * persisted per-model override, which wins over the global default. Matching\n * it keeps the selector badge from advertising a level the session never used.\n */\nexport function resolveSessionThinkingDefault(\n\tmodel: Model<Api> | undefined,\n\tscopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>,\n\tsettings: {\n\t\tgetModelThinkingLevel(provider: string, modelId: string): ThinkingLevel | undefined;\n\t\tgetDefaultThinkingLevel(): ThinkingLevel | undefined;\n\t},\n): ThinkingLevel | undefined {\n\tif (model === undefined) return settings.getDefaultThinkingLevel();\n\tconst scopedLevel = scopedModels.find(\n\t\t(scoped) => scoped.model.provider === model.provider && scoped.model.id === model.id,\n\t)?.thinkingLevel;\n\treturn scopedLevel ?? settings.getModelThinkingLevel(model.provider, model.id) ?? settings.getDefaultThinkingLevel();\n}\n\nInteractiveModeBase.prototype.handleModelCommand = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm?: string,\n): Promise<void> {\n\tif (!searchTerm) {\n\t\tthis.showModelSelector();\n\t\treturn;\n\t}\n\n\tconst model = await this.findExactModelMatch(searchTerm);\n\tif (model) {\n\t\ttry {\n\t\t\tawait this.session.setModel(model, { persist: true });\n\t\t\tthis.footer.invalidate();\n\t\t\tthis.updateEditorBorderColor();\n\t\t\tthis.showStatus(`Model: ${formatModelLabel(model, { thinkingLevel: this.session.thinkingLevel })}`);\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(model);\n\t\t} catch (error) {\n\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t\treturn;\n\t}\n\n\tthis.showModelSelector(searchTerm);\n};\n\nInteractiveModeBase.prototype.findExactModelMatch = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm: string,\n): Promise<Model<Api> | undefined> {\n\tif (this.session.scopedModels.length > 0) {\n\t\treturn findExactModelReferenceMatch(\n\t\t\tsearchTerm,\n\t\t\tthis.session.scopedModels.map((scoped) => scoped.model),\n\t\t);\n\t}\n\n\ttry {\n\t\tconst cachedMatch = findExactModelReferenceMatch(searchTerm, [\n\t\t\t...this.session.modelRuntime.getAvailableSnapshot(),\n\t\t]);\n\t\tif (cachedMatch) return cachedMatch;\n\t} catch {\n\t\t// A refresh below retries the snapshot read and safely falls back to no match.\n\t}\n\n\tconst models = await this.getModelCandidates();\n\treturn findExactModelReferenceMatch(searchTerm, models);\n};\n\nInteractiveModeBase.prototype.getModelCandidates = async function (this: InteractiveModeBase): Promise<Model<Api>[]> {\n\tif (this.session.scopedModels.length > 0) {\n\t\treturn this.session.scopedModels.map((scoped) => scoped.model);\n\t}\n\n\tconst allowNetwork = !isOfflineModeEnabled();\n\tawait boundedInteractiveModelRefresh(\n\t\t(refreshOptions) => refreshModelCatalogs(this.session.modelRuntime, refreshOptions),\n\t\t{ allowNetwork },\n\t);\n\ttry {\n\t\treturn [...this.session.modelRuntime.getAvailableSnapshot()];\n\t} catch {\n\t\treturn [];\n\t}\n};\n\nInteractiveModeBase.prototype.updateAvailableProviderCount = async function (this: InteractiveModeBase): Promise<void> {\n\tconst models =\n\t\tthis.session.scopedModels.length > 0\n\t\t\t? this.session.scopedModels.map((scoped) => scoped.model)\n\t\t\t: this.session.modelRuntime.getAvailableSnapshot();\n\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n};\n\nInteractiveModeBase.prototype.maybeWarnAboutAnthropicSubscriptionAuth = async function (\n\tthis: InteractiveModeBase,\n\tmodel: Model<Api> | undefined = this.session.model,\n\ttargetContainer = this.chatContainer,\n): Promise<void> {\n\tif (this.settingsManager.getWarnings().anthropicExtraUsage === false) {\n\t\treturn;\n\t}\n\tif (this.anthropicSubscriptionWarningShown) {\n\t\treturn;\n\t}\n\tif (model?.provider !== \"anthropic\") {\n\t\treturn;\n\t}\n\n\tif (this.session.modelRuntime.isUsingOAuth(\"anthropic\")) {\n\t\tthis.anthropicSubscriptionWarningShown = true;\n\t\tthis.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, targetContainer);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst storedCredential = await this.session.modelRuntime.getAuth(\"anthropic\");\n\t\tconst apiKey = storedCredential?.auth.apiKey;\n\t\tif (!isAnthropicSubscriptionAuthKey(apiKey)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.anthropicSubscriptionWarningShown = true;\n\t\tthis.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, targetContainer);\n\t} catch {\n\t\t// Ignore auth lookup failures for warning-only checks.\n\t}\n};\n\nInteractiveModeBase.prototype.showModelSelector = function showModelSelector(\n\tthis: InteractiveModeBase,\n\tinitialSearchInput?: string,\n\tprevious?: ModelSelectorComponent,\n): void {\n\tthis.showSelector((done) => {\n\t\tlet settled = false;\n\t\tconst selector = new ModelSelectorComponent(\n\t\t\tthis.ui,\n\t\t\tthis.session.model,\n\t\t\tthis.settingsManager,\n\t\t\tthis.session.modelRuntime,\n\t\t\tthis.session.scopedModels,\n\t\t\tasync (model, thinkingLevel) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\ttry {\n\t\t\t\t\tawait this.session.setModel(model, { persist: true, thinkingLevel });\n\t\t\t\t\tawait this.updateAvailableProviderCount();\n\t\t\t\t\tthis.footer.invalidate();\n\t\t\t\t\tthis.updateEditorBorderColor();\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(model);\n\t\t\t\t\tthis.showStatus(`Model: ${formatModelLabel(model, { thinkingLevel: this.session.thinkingLevel })}`);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tinitialSearchInput,\n\t\t\tthis.session.thinkingLevel,\n\t\t\tpendingModelView(this),\n\t\t);\n\t\tif (previous) selector.selector.restoreNavigation(previous.selector, true);\n\t\tconst unsubscribe = onPreliminaryCatalogWithdrawn(this, () => showModelSelector.call(this, undefined, selector));\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tunsubscribe?.();\n\t\t\t\tselector.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.showModelsSelector = function showModelsSelector(\n\tthis: InteractiveModeBase,\n\tprevious?: ScopedModelsSelectorComponent,\n): void {\n\tconst view = pendingModelView(this);\n\tconst initial = view ? { model: this.session.model, thinkingLevel: this.session.thinkingLevel } : undefined;\n\tlet availableModels = [...this.session.modelRuntime.getAvailableSnapshot()];\n\tlet availableModelIds = new Set(availableModels.map((model) => `${model.provider}/${model.id}`));\n\tconst sessionScopedModels = this.session.scopedModels;\n\tconst sessionScopedIds = sessionScopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);\n\tconst getConfiguredScope = (\n\t\tmodels: readonly Model<Api>[],\n\t): { enabledIds: string[]; unavailableIds: string[] } | undefined => {\n\t\tconst configuredPatterns = this.settingsManager.getEnabledModels();\n\t\tif (!configuredPatterns?.length) return undefined;\n\t\tconst { scopedModels, diagnostics } = resolveModelScopeFromModels(configuredPatterns, models);\n\t\tconst enabledIds = scopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);\n\t\tconst unavailableIds: string[] = [];\n\t\tfor (const diagnostic of diagnostics) {\n\t\t\tif (diagnostic.code === \"no-match\" && !unavailableIds.includes(diagnostic.pattern)) {\n\t\t\t\tunavailableIds.push(diagnostic.pattern);\n\t\t\t}\n\t\t}\n\t\treturn { enabledIds: [...enabledIds, ...unavailableIds], unavailableIds };\n\t};\n\n\tconst configuredScope = getConfiguredScope(availableModels);\n\tlet currentEnabledIds =\n\t\tsessionScopedIds.length > 0\n\t\t\t? [...sessionScopedIds, ...(configuredScope?.unavailableIds ?? [])]\n\t\t\t: (configuredScope?.enabledIds ?? null);\n\tlet selectionChanged = false;\n\n\tconst updateSessionModels = (enabledIds: string[] | null): void => {\n\t\tcurrentEnabledIds = enabledIds === null ? null : [...enabledIds];\n\t\tconst hasEnabledAvailableModel = enabledIds?.some((id) => availableModelIds.has(id)) ?? false;\n\t\tconst allAvailableModelsEnabled =\n\t\t\tenabledIds !== null && [...availableModelIds].every((id) => enabledIds.includes(id));\n\t\tif (enabledIds && hasEnabledAvailableModel && !allAvailableModelsEnabled) {\n\t\t\tconst newScopedModels = resolveModelScopeFromModels(enabledIds, availableModels).scopedModels;\n\t\t\tthis.session.setScopedModels(\n\t\t\t\tnewScopedModels.map((scoped) => ({ model: scoped.model, thinkingLevel: scoped.thinkingLevel })),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.session.setScopedModels([]);\n\t\t}\n\t\tvoid this.updateAvailableProviderCount();\n\t\tthis.setupAutocompleteProvider();\n\t\tthis.ui.requestRender();\n\t};\n\n\tthis.showSelector((done) => {\n\t\tlet disposed = false;\n\t\tconst refreshAbortController = new AbortController();\n\t\tconst selector = new ScopedModelsSelectorComponent(\n\t\t\t{\n\t\t\t\tallModels: availableModels,\n\t\t\t\tenabledModelIds: currentEnabledIds,\n\t\t\t\trefreshStatus: \"Refreshing model catalogs…\",\n\t\t\t\t// The level Ctrl+P cycling gives each model: its scoped level, else the level a switch to it applies.\n\t\t\t\tthinkingLevelFor: (model) => {\n\t\t\t\t\tconst current = initial ?? { model: this.session.model, thinkingLevel: this.session.thinkingLevel };\n\t\t\t\t\tif (modelsAreEqual(current.model, model)) return current.thinkingLevel;\n\t\t\t\t\tconst scoped = (view ? sessionScopedModels : this.session.scopedModels).find((entry) =>\n\t\t\t\t\t\tmodelsAreEqual(entry.model, model),\n\t\t\t\t\t);\n\t\t\t\t\treturn scoped?.thinkingLevel !== undefined\n\t\t\t\t\t\t? clampThinkingLevel(model, scoped.thinkingLevel)\n\t\t\t\t\t\t: thinkingLevelForModelSwitch(model, {\n\t\t\t\t\t\t\t\tsettings: view?.settings ?? this.settingsManager,\n\t\t\t\t\t\t\t\tcurrent,\n\t\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tonChange: (enabledIds) => {\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\tconst allEnabled =\n\t\t\t\t\t\tenabledIds !== null &&\n\t\t\t\t\t\tenabledIds.length === availableModels.length &&\n\t\t\t\t\t\tenabledIds.every((id) => availableModelIds.has(id));\n\t\t\t\t\tconst newPatterns = enabledIds === null || allEnabled ? undefined : enabledIds;\n\t\t\t\t\tthis.settingsManager.setEnabledModels(newPatterns ? [...newPatterns] : undefined);\n\t\t\t\t\tupdateSessionModels(enabledIds);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\tif (previous) selector.selector.restoreNavigation(previous.selector, true);\n\t\tconst unsubscribe = onPreliminaryCatalogWithdrawn(this, () => showModelsSelector.call(this, selector));\n\t\tvoid boundedInteractiveModelRefresh(\n\t\t\t(options) => refreshModelCatalogs(this.session.modelRuntime, options),\n\t\t\t{ allowNetwork: !isOfflineModeEnabled() },\n\t\t\trefreshAbortController.signal,\n\t\t)\n\t\t\t.then((outcome) => {\n\t\t\t\tif (disposed) return;\n\t\t\t\tif (!view || view.isCurrent()) {\n\t\t\t\t\tavailableModels = [...this.session.modelRuntime.getAvailableSnapshot()];\n\t\t\t\t\tavailableModelIds = new Set(availableModels.map((model) => `${model.provider}/${model.id}`));\n\t\t\t\t\tif (!selectionChanged) {\n\t\t\t\t\t\tconst refreshedConfiguredScope = getConfiguredScope(availableModels);\n\t\t\t\t\t\tcurrentEnabledIds =\n\t\t\t\t\t\t\tsessionScopedIds.length > 0\n\t\t\t\t\t\t\t\t? [...sessionScopedIds, ...(refreshedConfiguredScope?.unavailableIds ?? [])]\n\t\t\t\t\t\t\t\t: (refreshedConfiguredScope?.enabledIds ?? null);\n\t\t\t\t\t\tselector.updateModels(availableModels, currentEnabledIds);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselector.updateModels(availableModels);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (outcome.status === \"timed-out\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh timed out; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.status === \"aborted\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh was cancelled; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.status === \"rejected\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Could not refresh model catalogs; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.value.aborted) {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh was cancelled; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.value.errors.size === 1) {\n\t\t\t\t\tselector.setRefreshStatus(\n\t\t\t\t\t\t`Could not refresh ${outcome.value.errors.keys().next().value}; showing cached models.`,\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t);\n\t\t\t\t} else if (outcome.value.errors.size > 1) {\n\t\t\t\t\tselector.setRefreshStatus(\n\t\t\t\t\t\t`Could not refresh ${outcome.value.errors.size} model catalogs; showing cached models.`,\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tselector.setRefreshStatus(\"Model catalogs refreshed.\", \"success\");\n\t\t\t\t}\n\t\t\t\tthis.ui.requestRender();\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tif (disposed) return;\n\t\t\t\tselector.setRefreshStatus(\"Could not update cached models; showing cached models.\", \"warning\");\n\t\t\t\tthis.ui.requestRender();\n\t\t\t});\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tdisposed = true;\n\t\t\t\tunsubscribe?.();\n\t\t\t\trefreshAbortController.abort();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.showUserMessageSelector = async function (this: InteractiveModeBase): Promise<void> {\n\t// Opened from a subagent's view, the forked message joins main's own draft instead of replacing it.\n\tconst fromSubagentView = this.agentView?.viewed.kind === \"agent\";\n\tawait this.ensureDeferredStartupComplete();\n\t// A session opened at its context window lists its older prompts from the store, keeping only their labels' starts.\n\tconst manager = this.session.sessionManager;\n\tconst stored =\n\t\tmanager?.hasFullHistory?.() === false\n\t\t\t? await (await import(\"./components/user-message-selector-archive.js\")).ForkPromptArchive.open(manager)\n\t\t\t: undefined;\n\tconst userMessages: Array<{ entryId: string; text: string; partial?: true }> =\n\t\tstored?.prompts ?? this.session.getUserMessagesForForking();\n\n\tif (userMessages.length === 0) {\n\t\tstored?.archive.dispose();\n\t\tthis.showStatus(\"No messages to fork from\");\n\t\treturn;\n\t}\n\n\tconst initialSelectedId = userMessages[userMessages.length - 1]?.entryId;\n\n\tthis.showSelector((done) => {\n\t\tlet selectionHandled = false;\n\t\tconst selector = new UserMessageSelectorComponent(\n\t\t\tuserMessages.map((m) => ({ id: m.entryId, text: m.text, ...(m.partial ? { partial: true } : {}) })),\n\t\t\tasync (entryId) => {\n\t\t\t\tif (selectionHandled) return;\n\t\t\t\tselectionHandled = true;\n\t\t\t\tdone();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId);\n\t\t\t\t\tif (result.cancelled) {\n\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\tif (fromSubagentView) {\n\t\t\t\t\t\tconst prompt = promptHandle(this, \"main\");\n\t\t\t\t\t\tprompt.setText(mergeRestoredDraft(result.selectedText ?? \"\", prompt.getExpandedText()));\n\t\t\t\t\t} else this.editor.setText(result.selectedText ?? \"\");\n\t\t\t\t\tthis.showStatus(\"Forked to new session\");\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (selectionHandled) return;\n\t\t\t\tselectionHandled = true;\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tinitialSelectedId,\n\t\t\tstored\n\t\t\t\t? {\n\t\t\t\t\t\treadText: (id, signal) => stored.archive.readText(id, signal),\n\t\t\t\t\t\tonUpdate: () => this.ui.requestRender(),\n\t\t\t\t\t\tonError: (error) => this.showError(error.message),\n\t\t\t\t\t}\n\t\t\t\t: {},\n\t\t);\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector.getMessageList(),\n\t\t\tdispose: () => {\n\t\t\t\tselector.dispose();\n\t\t\t\tstored?.archive.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.handleThinkingCommand = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm?: string,\n): Promise<void> {\n\tif (!searchTerm) {\n\t\tthis.showThinkingSelector();\n\t\treturn;\n\t}\n\tconst levels = this.session.getAvailableThinkingLevels();\n\tconst normalized = searchTerm.trim().toLowerCase();\n\tconst level = levels.find((candidate) => candidate === normalized);\n\tif (!level) {\n\t\tthis.showError(`Unknown thinking level \"${searchTerm}\". Available levels: ${levels.join(\", \")}.`);\n\t\treturn;\n\t}\n\tawait this.selectThinkingLevel(level);\n};\n\nInteractiveModeBase.prototype.selectThinkingLevel = async function (\n\tthis: InteractiveModeBase,\n\tlevel: ThinkingLevel,\n): Promise<void> {\n\tawait this.session.setThinkingLevel(level, { persist: true });\n\tthis.footer.invalidate();\n\tthis.updateEditorBorderColor();\n\tthis.showStatus(`Thinking level: ${level}`);\n};\n\nInteractiveModeBase.prototype.showThinkingSelector = function (this: InteractiveModeBase): void {\n\tthis.showSelector((done) => {\n\t\tconst select = async (level: ThinkingLevel) => {\n\t\t\ttry {\n\t\t\t\tawait this.selectThinkingLevel(level);\n\t\t\t\tdone();\n\t\t\t} catch (error) {\n\t\t\t\tselector.selector.retrySelection();\n\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t}\n\t\t};\n\t\tconst model = this.session.model;\n\t\tconst availableLevels = this.session.getAvailableThinkingLevels();\n\t\tconst rawDefault = resolveSessionThinkingDefault(model, this.session.scopedModels, this.settingsManager);\n\t\tconst selector = new ThinkingSelectorComponent(\n\t\t\tthis.session.thinkingLevel,\n\t\t\tavailableLevels,\n\t\t\tselect,\n\t\t\t() => done(),\n\t\t\tresolveThinkingSelectorDefault(rawDefault, availableLevels, model),\n\t\t);\n\t\treturn { component: selector, focus: selector };\n\t});\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-model-routing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-model-routing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAEN,4BAA4B,EAE5B,sBAAsB,EACtB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,yGAAyG;AACzG,SAAS,gBAAgB,CAAC,IAAyB;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;IACjC,MAAM,SAAS,GACd,OAAO,YAAY,0BAA0B;QAC5C,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE;QACjC,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C,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,GAAG;IACpD,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1B,MAAM,MAAM,GAAG,KAAK,EAAE,KAAoB,EAAE,EAAE;YAC7C,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBACtC,IAAI,EAAE,CAAC;YACR,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;gBACnC,IAAI,CAAC,SAAS,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,CAAC;QACF,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QACjC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC;QAClE,MAAM,UAAU,GAAG,6BAA6B,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACzG,MAAM,QAAQ,GAAG,IAAI,yBAAyB,CAC7C,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,eAAe,EACf,MAAM,EACN,GAAG,EAAE,CAAC,IAAI,EAAE,EACZ,8BAA8B,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,CAAC,CAClE,CAAC;QACF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@bastani/atomic-agent-core\";\nimport { normalizeProviderId } from \"@bastani/atomic-ai\";\nimport { clampThinkingLevel, modelsAreEqual } from \"@bastani/atomic-ai/compat\";\nimport { boundedInteractiveModelRefresh } from \"../../core/bounded-model-refresh.ts\";\nimport { formatModelLabel } from \"../../core/model-label.ts\";\nimport { thinkingLevelForModelSwitch } from \"../../core/model-switch-thinking-level.ts\";\nimport { isOfflineModeEnabled } from \"../../core/package-manager-env.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { promptHandle } from \"./agent-view/agent-drafts.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\ttype Api,\n\tfindExactModelReferenceMatch,\n\ttype Model,\n\tModelSelectorComponent,\n\tresolveModelScopeFromModels,\n\tScopedModelsSelectorComponent,\n\tThinkingSelectorComponent,\n\tUserMessageSelectorComponent,\n} from \"./interactive-mode-deps.ts\";\nimport { ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, isAnthropicSubscriptionAuthKey } from \"./interactive-mode-helpers.ts\";\nimport { mergeRestoredDraft } from \"./interactive-prompt-restore.ts\";\nimport { onPreliminaryCatalogWithdrawn } from \"./interactive-startup-trust.ts\";\nimport { refreshModelCatalogs } from \"./model-catalog-refresh.ts\";\n\n/** A selector already showing a restricted catalog owns its rows and the effort offered for each row. */\nfunction pendingModelView(mode: InteractiveModeBase) {\n\tconst runtime = mode.runtimeHost;\n\tconst isCurrent =\n\t\truntime instanceof IsolatedInteractiveRuntime\n\t\t\t? runtime.captureStartupCatalog()\n\t\t\t: runtime?.isProjectTrustPending?.() && !runtime.pendingProjectResourcesTrusted?.()\n\t\t\t\t? () => runtime.isProjectTrustPending() && !mode.settingsManager.isProjectTrusted()\n\t\t\t\t: undefined;\n\tif (!isCurrent) return undefined;\n\tconst levels = mode.settingsManager.getAllModelThinkingLevels();\n\tconst fallback = mode.settingsManager.getDefaultThinkingLevel();\n\treturn {\n\t\tisCurrent,\n\t\tsettings: {\n\t\t\tgetModelThinkingLevel: (provider: string, modelId: string) =>\n\t\t\t\tlevels[`${normalizeProviderId(provider)}/${modelId}`],\n\t\t\tgetDefaultThinkingLevel: () => fallback,\n\t\t},\n\t};\n}\n\nexport function resolveThinkingSelectorDefault(\n\trawDefault: ThinkingLevel | undefined,\n\tavailableLevels: readonly ThinkingLevel[],\n\tmodel: Model<Api> | undefined,\n): ThinkingLevel | undefined {\n\tif (rawDefault === undefined) return undefined;\n\tif (availableLevels.includes(rawDefault)) return rawDefault;\n\tif (!model) return availableLevels.includes(\"off\") ? \"off\" : availableLevels[0];\n\tconst clamped = clampThinkingLevel(model, rawDefault) as ThinkingLevel;\n\tif (availableLevels.includes(clamped)) return clamped;\n\treturn availableLevels.includes(\"off\") ? \"off\" : availableLevels[0];\n}\n\n/**\n * The saved level the active session would start from, in the precedence\n * `findInitialModel` uses: a scoped `--models \"id:level\"` entry wins over a\n * persisted per-model override, which wins over the global default. Matching\n * it keeps the selector badge from advertising a level the session never used.\n */\nexport function resolveSessionThinkingDefault(\n\tmodel: Model<Api> | undefined,\n\tscopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>,\n\tsettings: {\n\t\tgetModelThinkingLevel(provider: string, modelId: string): ThinkingLevel | undefined;\n\t\tgetDefaultThinkingLevel(): ThinkingLevel | undefined;\n\t},\n): ThinkingLevel | undefined {\n\tif (model === undefined) return settings.getDefaultThinkingLevel();\n\tconst scopedLevel = scopedModels.find(\n\t\t(scoped) => scoped.model.provider === model.provider && scoped.model.id === model.id,\n\t)?.thinkingLevel;\n\treturn scopedLevel ?? settings.getModelThinkingLevel(model.provider, model.id) ?? settings.getDefaultThinkingLevel();\n}\n\nInteractiveModeBase.prototype.handleModelCommand = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm?: string,\n): Promise<void> {\n\tif (!searchTerm) {\n\t\tthis.showModelSelector();\n\t\treturn;\n\t}\n\n\tconst model = await this.findExactModelMatch(searchTerm);\n\tif (model) {\n\t\ttry {\n\t\t\tawait this.session.setModel(model, { persist: true });\n\t\t\tthis.footer.invalidate();\n\t\t\tthis.updateEditorBorderColor();\n\t\t\tthis.showStatus(`Model: ${formatModelLabel(model, { thinkingLevel: this.session.thinkingLevel })}`);\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(model);\n\t\t} catch (error) {\n\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t\treturn;\n\t}\n\n\tthis.showModelSelector(searchTerm);\n};\n\n/**\n * The model `searchTerm` names exactly among the models known without a refresh: the scoped models when there are any,\n * else the available models already loaded.\n */\nexport function cachedExactModelMatch(mode: InteractiveModeBase, searchTerm: string): Model<Api> | undefined {\n\tif (mode.session.scopedModels.length > 0) {\n\t\treturn findExactModelReferenceMatch(\n\t\t\tsearchTerm,\n\t\t\tmode.session.scopedModels.map((scoped) => scoped.model),\n\t\t);\n\t}\n\ttry {\n\t\treturn findExactModelReferenceMatch(searchTerm, [...mode.session.modelRuntime.getAvailableSnapshot()]);\n\t} catch {\n\t\t// A refresh retries the snapshot read and safely falls back to no match.\n\t\treturn undefined;\n\t}\n}\n\nInteractiveModeBase.prototype.findExactModelMatch = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm: string,\n): Promise<Model<Api> | undefined> {\n\tconst cachedMatch = cachedExactModelMatch(this, searchTerm);\n\tif (cachedMatch || this.session.scopedModels.length > 0) return cachedMatch;\n\n\tconst models = await this.getModelCandidates();\n\treturn findExactModelReferenceMatch(searchTerm, models);\n};\n\nInteractiveModeBase.prototype.getModelCandidates = async function (this: InteractiveModeBase): Promise<Model<Api>[]> {\n\tif (this.session.scopedModels.length > 0) {\n\t\treturn this.session.scopedModels.map((scoped) => scoped.model);\n\t}\n\n\tconst allowNetwork = !isOfflineModeEnabled();\n\tawait boundedInteractiveModelRefresh(\n\t\t(refreshOptions) => refreshModelCatalogs(this.session.modelRuntime, refreshOptions),\n\t\t{ allowNetwork },\n\t);\n\ttry {\n\t\treturn [...this.session.modelRuntime.getAvailableSnapshot()];\n\t} catch {\n\t\treturn [];\n\t}\n};\n\nInteractiveModeBase.prototype.updateAvailableProviderCount = async function (this: InteractiveModeBase): Promise<void> {\n\tconst models =\n\t\tthis.session.scopedModels.length > 0\n\t\t\t? this.session.scopedModels.map((scoped) => scoped.model)\n\t\t\t: this.session.modelRuntime.getAvailableSnapshot();\n\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n};\n\nInteractiveModeBase.prototype.maybeWarnAboutAnthropicSubscriptionAuth = async function (\n\tthis: InteractiveModeBase,\n\tmodel: Model<Api> | undefined = this.session.model,\n\ttargetContainer = this.chatContainer,\n): Promise<void> {\n\tif (this.settingsManager.getWarnings().anthropicExtraUsage === false) {\n\t\treturn;\n\t}\n\tif (this.anthropicSubscriptionWarningShown) {\n\t\treturn;\n\t}\n\tif (model?.provider !== \"anthropic\") {\n\t\treturn;\n\t}\n\n\tif (this.session.modelRuntime.isUsingOAuth(\"anthropic\")) {\n\t\tthis.anthropicSubscriptionWarningShown = true;\n\t\tthis.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, targetContainer);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst storedCredential = await this.session.modelRuntime.getAuth(\"anthropic\");\n\t\tconst apiKey = storedCredential?.auth.apiKey;\n\t\tif (!isAnthropicSubscriptionAuthKey(apiKey)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.anthropicSubscriptionWarningShown = true;\n\t\tthis.showWarning(ANTHROPIC_SUBSCRIPTION_AUTH_WARNING, targetContainer);\n\t} catch {\n\t\t// Ignore auth lookup failures for warning-only checks.\n\t}\n};\n\nInteractiveModeBase.prototype.showModelSelector = function showModelSelector(\n\tthis: InteractiveModeBase,\n\tinitialSearchInput?: string,\n\tprevious?: ModelSelectorComponent,\n): void {\n\tthis.showSelector((done) => {\n\t\tlet settled = false;\n\t\tconst selector = new ModelSelectorComponent(\n\t\t\tthis.ui,\n\t\t\tthis.session.model,\n\t\t\tthis.settingsManager,\n\t\t\tthis.session.modelRuntime,\n\t\t\tthis.session.scopedModels,\n\t\t\tasync (model, thinkingLevel) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\ttry {\n\t\t\t\t\tawait this.session.setModel(model, { persist: true, thinkingLevel });\n\t\t\t\t\tawait this.updateAvailableProviderCount();\n\t\t\t\t\tthis.footer.invalidate();\n\t\t\t\t\tthis.updateEditorBorderColor();\n\t\t\t\t\tdone();\n\t\t\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(model);\n\t\t\t\t\tthis.showStatus(`Model: ${formatModelLabel(model, { thinkingLevel: this.session.thinkingLevel })}`);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tinitialSearchInput,\n\t\t\tthis.session.thinkingLevel,\n\t\t\tpendingModelView(this),\n\t\t);\n\t\tif (previous) selector.selector.restoreNavigation(previous.selector, true);\n\t\tconst unsubscribe = onPreliminaryCatalogWithdrawn(this, () => showModelSelector.call(this, undefined, selector));\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tunsubscribe?.();\n\t\t\t\tselector.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.showModelsSelector = function showModelsSelector(\n\tthis: InteractiveModeBase,\n\tprevious?: ScopedModelsSelectorComponent,\n): void {\n\tconst view = pendingModelView(this);\n\tconst initial = view ? { model: this.session.model, thinkingLevel: this.session.thinkingLevel } : undefined;\n\tlet availableModels = [...this.session.modelRuntime.getAvailableSnapshot()];\n\tlet availableModelIds = new Set(availableModels.map((model) => `${model.provider}/${model.id}`));\n\tconst sessionScopedModels = this.session.scopedModels;\n\tconst sessionScopedIds = sessionScopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);\n\tconst getConfiguredScope = (\n\t\tmodels: readonly Model<Api>[],\n\t): { enabledIds: string[]; unavailableIds: string[] } | undefined => {\n\t\tconst configuredPatterns = this.settingsManager.getEnabledModels();\n\t\tif (!configuredPatterns?.length) return undefined;\n\t\tconst { scopedModels, diagnostics } = resolveModelScopeFromModels(configuredPatterns, models);\n\t\tconst enabledIds = scopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);\n\t\tconst unavailableIds: string[] = [];\n\t\tfor (const diagnostic of diagnostics) {\n\t\t\tif (diagnostic.code === \"no-match\" && !unavailableIds.includes(diagnostic.pattern)) {\n\t\t\t\tunavailableIds.push(diagnostic.pattern);\n\t\t\t}\n\t\t}\n\t\treturn { enabledIds: [...enabledIds, ...unavailableIds], unavailableIds };\n\t};\n\n\tconst configuredScope = getConfiguredScope(availableModels);\n\tlet currentEnabledIds =\n\t\tsessionScopedIds.length > 0\n\t\t\t? [...sessionScopedIds, ...(configuredScope?.unavailableIds ?? [])]\n\t\t\t: (configuredScope?.enabledIds ?? null);\n\tlet selectionChanged = false;\n\n\tconst updateSessionModels = (enabledIds: string[] | null): void => {\n\t\tcurrentEnabledIds = enabledIds === null ? null : [...enabledIds];\n\t\tconst hasEnabledAvailableModel = enabledIds?.some((id) => availableModelIds.has(id)) ?? false;\n\t\tconst allAvailableModelsEnabled =\n\t\t\tenabledIds !== null && [...availableModelIds].every((id) => enabledIds.includes(id));\n\t\tif (enabledIds && hasEnabledAvailableModel && !allAvailableModelsEnabled) {\n\t\t\tconst newScopedModels = resolveModelScopeFromModels(enabledIds, availableModels).scopedModels;\n\t\t\tthis.session.setScopedModels(\n\t\t\t\tnewScopedModels.map((scoped) => ({ model: scoped.model, thinkingLevel: scoped.thinkingLevel })),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.session.setScopedModels([]);\n\t\t}\n\t\tvoid this.updateAvailableProviderCount();\n\t\tthis.setupAutocompleteProvider();\n\t\tthis.ui.requestRender();\n\t};\n\n\tthis.showSelector((done) => {\n\t\tlet disposed = false;\n\t\tconst refreshAbortController = new AbortController();\n\t\tconst selector = new ScopedModelsSelectorComponent(\n\t\t\t{\n\t\t\t\tallModels: availableModels,\n\t\t\t\tenabledModelIds: currentEnabledIds,\n\t\t\t\trefreshStatus: \"Refreshing model catalogs…\",\n\t\t\t\t// The level Ctrl+P cycling gives each model: its scoped level, else the level a switch to it applies.\n\t\t\t\tthinkingLevelFor: (model) => {\n\t\t\t\t\tconst current = initial ?? { model: this.session.model, thinkingLevel: this.session.thinkingLevel };\n\t\t\t\t\tif (modelsAreEqual(current.model, model)) return current.thinkingLevel;\n\t\t\t\t\tconst scoped = (view ? sessionScopedModels : this.session.scopedModels).find((entry) =>\n\t\t\t\t\t\tmodelsAreEqual(entry.model, model),\n\t\t\t\t\t);\n\t\t\t\t\treturn scoped?.thinkingLevel !== undefined\n\t\t\t\t\t\t? clampThinkingLevel(model, scoped.thinkingLevel)\n\t\t\t\t\t\t: thinkingLevelForModelSwitch(model, {\n\t\t\t\t\t\t\t\tsettings: view?.settings ?? this.settingsManager,\n\t\t\t\t\t\t\t\tcurrent,\n\t\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tonChange: (enabledIds) => {\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\tconst allEnabled =\n\t\t\t\t\t\tenabledIds !== null &&\n\t\t\t\t\t\tenabledIds.length === availableModels.length &&\n\t\t\t\t\t\tenabledIds.every((id) => availableModelIds.has(id));\n\t\t\t\t\tconst newPatterns = enabledIds === null || allEnabled ? undefined : enabledIds;\n\t\t\t\t\tthis.settingsManager.setEnabledModels(newPatterns ? [...newPatterns] : undefined);\n\t\t\t\t\tupdateSessionModels(enabledIds);\n\t\t\t\t},\n\t\t\t\tonCancel: () => {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t\tif (previous) selector.selector.restoreNavigation(previous.selector, true);\n\t\tconst unsubscribe = onPreliminaryCatalogWithdrawn(this, () => showModelsSelector.call(this, selector));\n\t\tvoid boundedInteractiveModelRefresh(\n\t\t\t(options) => refreshModelCatalogs(this.session.modelRuntime, options),\n\t\t\t{ allowNetwork: !isOfflineModeEnabled() },\n\t\t\trefreshAbortController.signal,\n\t\t)\n\t\t\t.then((outcome) => {\n\t\t\t\tif (disposed) return;\n\t\t\t\tif (!view || view.isCurrent()) {\n\t\t\t\t\tavailableModels = [...this.session.modelRuntime.getAvailableSnapshot()];\n\t\t\t\t\tavailableModelIds = new Set(availableModels.map((model) => `${model.provider}/${model.id}`));\n\t\t\t\t\tif (!selectionChanged) {\n\t\t\t\t\t\tconst refreshedConfiguredScope = getConfiguredScope(availableModels);\n\t\t\t\t\t\tcurrentEnabledIds =\n\t\t\t\t\t\t\tsessionScopedIds.length > 0\n\t\t\t\t\t\t\t\t? [...sessionScopedIds, ...(refreshedConfiguredScope?.unavailableIds ?? [])]\n\t\t\t\t\t\t\t\t: (refreshedConfiguredScope?.enabledIds ?? null);\n\t\t\t\t\t\tselector.updateModels(availableModels, currentEnabledIds);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselector.updateModels(availableModels);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (outcome.status === \"timed-out\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh timed out; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.status === \"aborted\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh was cancelled; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.status === \"rejected\") {\n\t\t\t\t\tselector.setRefreshStatus(\"Could not refresh model catalogs; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.value.aborted) {\n\t\t\t\t\tselector.setRefreshStatus(\"Model refresh was cancelled; showing cached models.\", \"warning\");\n\t\t\t\t} else if (outcome.value.errors.size === 1) {\n\t\t\t\t\tselector.setRefreshStatus(\n\t\t\t\t\t\t`Could not refresh ${outcome.value.errors.keys().next().value}; showing cached models.`,\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t);\n\t\t\t\t} else if (outcome.value.errors.size > 1) {\n\t\t\t\t\tselector.setRefreshStatus(\n\t\t\t\t\t\t`Could not refresh ${outcome.value.errors.size} model catalogs; showing cached models.`,\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tselector.setRefreshStatus(\"Model catalogs refreshed.\", \"success\");\n\t\t\t\t}\n\t\t\t\tthis.ui.requestRender();\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tif (disposed) return;\n\t\t\t\tselector.setRefreshStatus(\"Could not update cached models; showing cached models.\", \"warning\");\n\t\t\t\tthis.ui.requestRender();\n\t\t\t});\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tdisposed = true;\n\t\t\t\tunsubscribe?.();\n\t\t\t\trefreshAbortController.abort();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.showUserMessageSelector = async function (this: InteractiveModeBase): Promise<void> {\n\t// Opened from a subagent's view, the forked message joins main's own draft instead of replacing it.\n\tconst fromSubagentView = this.agentView?.viewed.kind === \"agent\";\n\tawait this.ensureDeferredStartupComplete();\n\t// A session opened at its context window lists its older prompts from the store, keeping only their labels' starts.\n\tconst manager = this.session.sessionManager;\n\tconst stored =\n\t\tmanager?.hasFullHistory?.() === false\n\t\t\t? await (await import(\"./components/user-message-selector-archive.js\")).ForkPromptArchive.open(manager)\n\t\t\t: undefined;\n\tconst userMessages: Array<{ entryId: string; text: string; partial?: true }> =\n\t\tstored?.prompts ?? this.session.getUserMessagesForForking();\n\n\tif (userMessages.length === 0) {\n\t\tstored?.archive.dispose();\n\t\tthis.showStatus(\"No messages to fork from\");\n\t\treturn;\n\t}\n\n\tconst initialSelectedId = userMessages[userMessages.length - 1]?.entryId;\n\n\tthis.showSelector((done) => {\n\t\tlet selectionHandled = false;\n\t\tconst selector = new UserMessageSelectorComponent(\n\t\t\tuserMessages.map((m) => ({ id: m.entryId, text: m.text, ...(m.partial ? { partial: true } : {}) })),\n\t\t\tasync (entryId) => {\n\t\t\t\tif (selectionHandled) return;\n\t\t\t\tselectionHandled = true;\n\t\t\t\tdone();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId);\n\t\t\t\t\tif (result.cancelled) {\n\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\tif (fromSubagentView) {\n\t\t\t\t\t\tconst prompt = promptHandle(this, \"main\");\n\t\t\t\t\t\tprompt.setText(mergeRestoredDraft(result.selectedText ?? \"\", prompt.getExpandedText()));\n\t\t\t\t\t} else this.editor.setText(result.selectedText ?? \"\");\n\t\t\t\t\tthis.showStatus(\"Forked to new session\");\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (selectionHandled) return;\n\t\t\t\tselectionHandled = true;\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tinitialSelectedId,\n\t\t\tstored\n\t\t\t\t? {\n\t\t\t\t\t\treadText: (id, signal) => stored.archive.readText(id, signal),\n\t\t\t\t\t\tonUpdate: () => this.ui.requestRender(),\n\t\t\t\t\t\tonError: (error) => this.showError(error.message),\n\t\t\t\t\t}\n\t\t\t\t: {},\n\t\t);\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector.getMessageList(),\n\t\t\tdispose: () => {\n\t\t\t\tselector.dispose();\n\t\t\t\tstored?.archive.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nInteractiveModeBase.prototype.handleThinkingCommand = async function (\n\tthis: InteractiveModeBase,\n\tsearchTerm?: string,\n): Promise<void> {\n\tif (!searchTerm) {\n\t\tthis.showThinkingSelector();\n\t\treturn;\n\t}\n\tconst levels = this.session.getAvailableThinkingLevels();\n\tconst normalized = searchTerm.trim().toLowerCase();\n\tconst level = levels.find((candidate) => candidate === normalized);\n\tif (!level) {\n\t\tthis.showError(`Unknown thinking level \"${searchTerm}\". Available levels: ${levels.join(\", \")}.`);\n\t\treturn;\n\t}\n\tawait this.selectThinkingLevel(level);\n};\n\nInteractiveModeBase.prototype.selectThinkingLevel = async function (\n\tthis: InteractiveModeBase,\n\tlevel: ThinkingLevel,\n): Promise<void> {\n\tawait this.session.setThinkingLevel(level, { persist: true });\n\tthis.footer.invalidate();\n\tthis.updateEditorBorderColor();\n\tthis.showStatus(`Thinking level: ${level}`);\n};\n\nInteractiveModeBase.prototype.showThinkingSelector = function (this: InteractiveModeBase): void {\n\tthis.showSelector((done) => {\n\t\tconst select = async (level: ThinkingLevel) => {\n\t\t\ttry {\n\t\t\t\tawait this.selectThinkingLevel(level);\n\t\t\t\tdone();\n\t\t\t} catch (error) {\n\t\t\t\tselector.selector.retrySelection();\n\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t}\n\t\t};\n\t\tconst model = this.session.model;\n\t\tconst availableLevels = this.session.getAvailableThinkingLevels();\n\t\tconst rawDefault = resolveSessionThinkingDefault(model, this.session.scopedModels, this.settingsManager);\n\t\tconst selector = new ThinkingSelectorComponent(\n\t\t\tthis.session.thinkingLevel,\n\t\t\tavailableLevels,\n\t\t\tselect,\n\t\t\t() => done(),\n\t\t\tresolveThinkingSelectorDefault(rawDefault, availableLevels, model),\n\t\t);\n\t\treturn { component: selector, focus: selector };\n\t});\n};\n"]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { tryExecuteSessionSlashCommand } from "../../core/agent-session-prompt.js";
|
|
2
2
|
import { yieldToEventLoop } from "../../utils/event-loop.js";
|
|
3
3
|
import { IsolatedInteractiveRuntime } from "../interactive-engine/isolated-runtime.js";
|
|
4
|
+
import { takeSubmittedExtensionCommandHold } from "./extension-command-hold.js";
|
|
4
5
|
import { InteractiveModeBase } from "./interactive-mode-base.js";
|
|
5
6
|
import { restoreFailedSubmissionDraft, restoreRefusedSubmission } from "./interactive-prompt-restore.js";
|
|
6
7
|
import { followStartedRunEcho } from "./interactive-render-chat.js";
|
|
7
8
|
import { toInteractiveSubmission } from "./interactive-submission.js";
|
|
8
9
|
InteractiveModeBase.prototype.runUserPromptTurn = async function (input) {
|
|
9
10
|
const { text: userInput, draft } = toInteractiveSubmission(input);
|
|
11
|
+
// An extension command's hold of the prompt's slot ends with the turn at the latest.
|
|
12
|
+
const extensionCommandHold = typeof input === "string" ? undefined : takeSubmittedExtensionCommandHold(input);
|
|
10
13
|
const turn = this.promptTurn ?? { dispatched: false };
|
|
11
14
|
this.promptTurn = turn;
|
|
12
15
|
const settleDispatch = () => {
|
|
@@ -90,6 +93,7 @@ InteractiveModeBase.prototype.runUserPromptTurn = async function (input) {
|
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
finally {
|
|
96
|
+
extensionCommandHold?.settle();
|
|
93
97
|
unsubscribeTurnStart();
|
|
94
98
|
echo?.close();
|
|
95
99
|
if (this.promptTurn === turn)
|