From d5f2a17cd201b0ffb84de3cb6635d074e2b6100c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:45:49 -0800 Subject: [PATCH] refactor: group agent launch contracts under concrete owners (#37915) --- config/reliability-gates.jsonc | 21 +++--- config/scripts/ci-shard-timings.json | 66 +++++++++---------- config/scripts/pr-code-change-scope.mjs | 2 +- config/scripts/pr-package-test-paths.mjs | 2 +- config/vitest.performance.config.ts | 2 +- .../bug-reproductions/delayed-agent-launch.md | 2 +- mobile/src/automations/automation-draft.ts | 2 +- .../src/automations/automation-operations.ts | 4 +- .../components/MobileDiffReviewRangeSheet.tsx | 2 +- .../components/mobile-agent-icon-assets.ts | 2 +- .../new-worktree-agent-selection.ts | 2 +- .../src/session/MobileSessionCommandDock.tsx | 2 +- mobile/src/session/QuickCommandsList.tsx | 2 +- .../session/agent-send-keyboard-dismissal.ts | 2 +- mobile/src/session/ai-vault-resume-launch.ts | 4 +- .../session/mobile-existing-agent-launch.ts | 10 +-- .../mobile-image-live-input-order.test.tsx | 2 +- .../session/mobile-new-tab-agent-options.ts | 12 ++-- .../src/session/mobile-session-route-types.ts | 2 +- .../mobile-session-tab-card-content.ts | 4 +- .../mobile-source-control-launch-agent.ts | 6 +- .../mobile-structured-agent-session-launch.ts | 2 +- .../session/mobile-terminal-tab-agent.test.ts | 2 +- .../src/session/mobile-terminal-tab-agent.ts | 2 +- .../native-chat/MobileNativeChatOverlay.tsx | 2 +- .../mobile-native-chat-image-send.test.ts | 2 +- ...bile-native-chat-image-attachments.test.ts | 2 +- .../MobileNativeChatSessionOptionPickers.tsx | 2 +- ...use-mobile-native-chat-answer-send.test.ts | 2 +- .../mobile-native-chat-cli-fork.ts | 2 +- ...native-chat-merged-snapshot-parity.test.ts | 2 +- .../mobile-native-chat-send.test.ts | 2 +- .../native-chat/mobile-native-chat-send.ts | 4 +- .../mobile-native-chat-stale-input.test.ts | 2 +- .../mobile-native-chat-unsent-notices.ts | 2 +- ...se-mobile-native-chat-message-send.test.ts | 2 +- .../use-mobile-native-chat-controller.test.ts | 2 +- .../src/session/new-tab-agent-host-launch.ts | 4 +- .../src/session/pr-ai-triage-launch.test.ts | 6 +- mobile/src/session/quick-command-draft.ts | 2 +- .../session/review-terminal-reply-schema.ts | 2 +- ...se-mobile-diff-review-send-actions.test.ts | 2 +- .../session/use-mobile-launch-agent-label.ts | 2 +- ...-mobile-session-image-attachments.test.tsx | 2 +- ...ssion-terminal-create-agent-launch.test.ts | 4 +- .../use-mobile-structured-agent-options.ts | 2 +- .../use-mobile-structured-agent-session.ts | 2 +- .../use-mobile-structured-option-state.ts | 2 +- ...use-mobile-structured-send-with-outcome.ts | 2 +- .../use-mobile-source-control-agent-name.ts | 2 +- .../tasks/agent-launch-mobile-replay.test.ts | 2 +- mobile/src/tasks/agent-launch-request.ts | 8 +-- mobile/src/tasks/blank-workspace-create.ts | 2 +- mobile/src/tasks/mobile-agent-catalog.test.ts | 6 +- mobile/src/tasks/mobile-agent-catalog.ts | 10 ++- .../mobile-agent-launch-architecture.test.ts | 2 +- mobile/src/tasks/mobile-tasks-dependencies.ts | 4 +- .../tasks/mobile-tasks-view-state-types.ts | 2 +- mobile/src/tasks/mobile-tui-agents.ts | 17 ++--- .../mobile-workspace-create-operations.ts | 2 +- .../src/tasks/source-workspace-create.test.ts | 2 +- mobile/src/tasks/source-workspace-create.ts | 2 +- ...bile-tasks-workspace-create-projection.tsx | 4 +- mobile/src/tasks/workspace-agent-selection.ts | 8 +-- mobile/src/tasks/workspace-create-params.ts | 2 +- .../tasks/worktree-create-capability.test.ts | 2 +- mobile/src/tasks/worktree-create-retry.ts | 4 +- mobile/src/terminal/quick-commands.ts | 4 +- .../mobile-agent-icon-assets-node.ts | 2 +- .../session-terminal-create-mount-adapters.ts | 2 +- .../mobile-runtime-client-capabilities.ts | 2 +- src/cli/agent-launch-process.test.ts | 2 +- src/cli/agent-launch-recovery.ts | 2 +- src/cli/agent-launch-request.ts | 18 +++-- src/cli/agent-launch-test-fixtures.ts | 2 +- src/cli/caller-host-worktree-selection.ts | 2 +- src/cli/handlers/automation-handler-flags.ts | 4 +- src/cli/handlers/automation-host-support.ts | 2 +- .../handlers/worktree-create-agent-launch.ts | 4 +- src/cli/handlers/worktree.ts | 2 +- src/cli/orchestration-mutation-recovery.ts | 2 +- src/cli/runtime/websocket-transport.test.ts | 2 +- src/cli/runtime/websocket-transport.ts | 2 +- src/main/acp/acp-launch-specs.ts | 4 +- .../acp-structured-adapter.test-support.ts | 2 +- .../acp/acp-structured-agent-definitions.ts | 4 +- .../acp/acp-structured-launch-resolution.ts | 2 +- .../acp-structured-session-adapter-deps.ts | 2 +- .../managed-agent-hook-controls.ts | 2 +- .../managed-hook-detection-commands.ts | 4 +- ...server-antigravity-resume-identity.test.ts | 2 +- .../server-copilot-resume-identity.test.ts | 2 +- .../server-hermes-resume-identity.test.ts | 2 +- .../server-idle-process-owner.test.ts | 2 +- .../server-startup-prompt-control.test.ts | 2 +- .../server-transport-interference.test.ts | 2 +- .../agent-hooks/server/server-lifecycle.ts | 2 +- .../server/server-status-identity.ts | 2 +- .../agent-hooks/wsl-agent-plugin-readiness.ts | 4 +- .../wsl-opencode-install-race.test.ts | 2 +- .../wsl-opencode-settings-lifetime.test.ts | 2 +- .../agent-hooks/wsl-opencode-settings.test.ts | 2 +- .../agent-launch-account-env.test.ts | 4 +- .../agent-launch-created-workspace.ts | 2 +- ...agent-launch-decided-mode-contract.test.ts | 2 +- .../agent-launch/agent-launch-execution.ts | 14 ++-- .../agent-launch-executor-cancel.test.ts | 2 +- .../agent-launch-executor.test.ts | 5 +- .../agent-launch/agent-launch-executor.ts | 9 +-- .../agent-launch/agent-launch-intent-mode.ts | 6 +- .../agent-launch/agent-launch-legacy-host.ts | 9 +-- src/main/agent-launch/agent-launch-mode.ts | 9 +-- .../agent-launch-opencode-model.test.ts | 6 +- .../agent-launch-pane-attachment.ts | 2 +- .../agent-launch-prompt-delivery.ts | 9 +-- .../agent-launch-surface-factories.ts | 6 +- .../agent-launch-surface-refusal.ts | 2 +- .../agent-launch/agent-launch-warnings.ts | 4 +- .../agent-launch/agent-started-telemetry.ts | 2 +- .../startup-agent-worktree-create.ts | 4 +- .../agent-launch/trust/agent-trust-presets.ts | 2 +- .../trust/agent-workspace-trust-spawn.ts | 2 +- src/main/ai-vault/structured-chat-cli-fork.ts | 5 +- .../structured-chat-conversation-copy.ts | 2 +- ...-session-ownership-client-audience.test.ts | 9 ++- .../automation-agent-run-result.ts | 4 +- .../automation-chat-agent-launch.ts | 2 +- .../automations/automation-run-receipt.ts | 5 +- .../headless-automation-agent-launch.ts | 7 +- .../automations/runtime-automation-service.ts | 4 +- .../automations/runtime-chat-run-observer.ts | 2 +- .../claude/agent-view/agent-view-service.ts | 4 +- .../claude-agent-sdk-contract-pins.test.ts | 2 +- src/main/claude/claude-api-retry-row.ts | 2 +- src/main/claude/claude-command-turn.ts | 2 +- .../claude-structured-dispatch-content.ts | 2 +- .../claude-structured-launch-resolution.ts | 2 +- src/main/codex/codex-journal-command-turn.ts | 2 +- src/main/codex/codex-minimum-version.test.ts | 2 +- src/main/codex/codex-provider-retry-row.ts | 2 +- .../codex-structured-dispatch-test-support.ts | 2 +- .../codex/codex-structured-launch-args.ts | 2 +- ...ex-structured-real-cli-permissions.test.ts | 2 +- .../codex/codex-structured-session-state.ts | 2 +- .../codex-structured-turn-end-settlement.ts | 2 +- .../codex-structured-turn-permission.test.ts | 2 +- .../codex/codex-structured-turn-permission.ts | 2 +- .../codex/codex-unverified-resume-launch.ts | 2 +- src/main/cursor/hook-script.ts | 2 +- .../daemon/daemon-create-or-attach-result.ts | 2 +- src/main/daemon/daemon-terminal-admission.ts | 2 +- src/main/daemon/pty-subprocess.ts | 4 +- .../pty-subprocess/shell-launch-plan.ts | 2 +- .../pty-subprocess/spawn-environment.ts | 4 +- src/main/daemon/session-options.ts | 2 +- src/main/daemon/session.test.ts | 2 +- src/main/daemon/session.ts | 2 +- .../daemon/terminal-host-create-contract.ts | 4 +- src/main/daemon/terminal-host-options.ts | 4 +- src/main/daemon/terminal-host.test.ts | 2 +- .../daemon/terminal-session-teardown.test.ts | 2 +- src/main/daemon/types.ts | 4 +- .../external-conversation-start.ts | 7 +- .../external-conversation.test-fixture.ts | 7 +- .../ipc/dashboard-agent-launch-validation.ts | 2 +- .../desktop-renderer-runtime-capabilities.ts | 2 +- ...filesystem-git-model-discovery-handlers.ts | 2 +- src/main/ipc/pty/host-env/assembly.ts | 4 +- .../ipc/pty/host-env/claude-agent-view.ts | 2 +- src/main/ipc/pty/host-env/codex-resume.ts | 4 +- src/main/ipc/pty/host-env/opencode-config.ts | 4 +- src/main/ipc/pty/host-env/pi-agent.ts | 2 +- .../host-env/remote-viewer-clipboard-env.ts | 2 +- .../pty/host-env/saved-resume-admission.ts | 2 +- src/main/ipc/pty/host-env/types.ts | 2 +- .../ipc/pty/ipc/spawn-agent-launch-end.ts | 6 +- src/main/ipc/pty/ipc/spawn-agent-launch.ts | 4 +- src/main/ipc/pty/ipc/spawn-begin.ts | 2 +- src/main/ipc/pty/ipc/spawn-qoder-command.ts | 2 +- src/main/ipc/pty/ipc/spawn-run.ts | 2 +- src/main/ipc/pty/ipc/spawn-types.ts | 4 +- .../ipc/pty/pane-agent-launch.test-fixture.ts | 2 +- src/main/ipc/pty/pane/launch-authority.ts | 4 +- .../pty/pty-agent-launch-pane-attach.test.ts | 2 +- .../pty-daemon-spawn-agent-home-env.test.ts | 2 +- .../pty/pty-ipc-daemon-provider-fixtures.ts | 2 +- src/main/ipc/pty/pty-ipc-spawn-drivers.ts | 2 +- .../pty/pty-spawn-env-agent-overlays.test.ts | 2 +- .../pty/pty-spawn-env-terminal-basics.test.ts | 2 +- src/main/ipc/pty/runtime/spawn-state.ts | 6 +- .../ipc/pty/spawn-agent-launch-plugin-hook.ts | 2 +- src/main/ipc/pty/spawn-commit-assembly.ts | 2 +- src/main/ipc/pty/spawn-host-env.ts | 4 +- ...pawn-options-agent-workspace-trust.test.ts | 2 +- src/main/ipc/pty/spawn-options-assembly.ts | 4 +- .../ipc/qoder-desktop-execution-host.test.ts | 2 +- ...-independent-renderer-spawn-review.test.ts | 4 +- src/main/ipc/repos/repo-ipc-arg-schemas.ts | 2 +- src/main/ipc/settings.ts | 2 +- .../terminal-startup-color-query-replies.ts | 4 +- src/main/ipc/worktree-remote.ts | 2 +- .../launch-environment.ts | 4 +- .../agent-cli-installation-error.ts | 4 +- .../agent-model-catalog-account-list.ts | 2 +- .../agent-model-catalog-discovery.ts | 2 - .../agent-model-catalog-entry-lifetime.ts | 2 +- .../agent-model-catalog-entry.ts | 2 +- .../agent-model-catalog-listing-waiters.ts | 2 +- .../agent-model-catalog-live-listings.ts | 2 +- .../agent-model-catalog-lookup.ts | 2 +- .../agent-model-catalog-scope.ts | 8 +-- .../agent-model-catalog-snapshot.ts | 2 +- .../agent-model-catalog-store.ts | 2 +- .../agent-model-catalog-workspace.ts | 2 +- ...structured-agent-session-adapter-router.ts | 2 +- .../structured-agent-session-adapter.ts | 2 +- .../structured-agent-session-attach-flow.ts | 2 +- ...ctured-agent-session-delivery-loop-deps.ts | 2 +- ...red-agent-session-failed-create-refusal.ts | 2 +- .../structured-agent-session-failure-text.ts | 2 +- .../structured-agent-session-host-types.ts | 2 +- ...tructured-agent-session-input-admission.ts | 2 +- ...uctured-agent-session-launch-permission.ts | 4 +- .../structured-agent-session-option-intent.ts | 6 +- .../structured-agent-session-options-read.ts | 2 +- ...structured-agent-session-outgrown-child.ts | 2 +- ...tructured-agent-session-resting-options.ts | 2 +- .../structured-agent-session-saved-status.ts | 2 +- ...ructured-agent-session-send-preparation.ts | 4 +- ...-agent-session-startup-attempt-contract.ts | 2 +- ...ured-agent-session-startup-attempt-mint.ts | 2 +- ...structured-agent-session-status-summary.ts | 2 +- ...tructured-agent-session-stop-acceptance.ts | 4 +- .../structured-agent-cli-conversations.ts | 2 +- .../structured-agent-command-resolution.ts | 4 +- .../structured-agent-configured-args.ts | 8 +-- src/main/opencode/opencode-acp-environment.ts | 2 +- .../opencode/opencode-launch-capabilities.ts | 4 +- .../opencode/opencode-model-executable.ts | 5 +- .../opencode-model-startup-plan.test.ts | 4 +- .../opencode/opencode-model-startup-plan.ts | 13 ++-- src/main/opencode/opencode-private-server.ts | 2 +- src/main/opencode/opencode-pty-launch.test.ts | 2 +- src/main/opencode/opencode-pty-launch.ts | 6 +- .../opencode-startup-prompt-installer.ts | 2 +- .../opencode/opencode-startup-prompt-owner.ts | 2 +- .../opencode-startup-prompt-source.test.ts | 2 +- .../opencode-startup-prompt-source.ts | 2 +- src/main/orcad/orcad-account-services.ts | 2 +- .../legacy-chat-permission-write.ts | 4 +- .../persistence-settings-update.test.ts | 2 +- .../applying-settings/settings-update.ts | 4 +- .../terminal-settings-migrations.ts | 2 +- .../normalize-loaded-global-settings.test.ts | 6 +- .../normalize-loaded-global-settings.ts | 2 +- .../prepare-loaded-profile-settings.ts | 8 +-- .../wsl-move-gate-facts.ts | 2 +- ...persistence-load-repair-durability.test.ts | 14 ++-- .../profile-state-offline-settings.ts | 2 +- .../automation-context-migration.ts | 2 +- .../terminal-sleep-quit-resume.test.ts | 2 +- src/main/pi/omp-transcript-metadata.test.ts | 2 +- src/main/pi/titlebar-extension-service.ts | 2 +- .../codex-workspace-relative-path.test.ts | 2 +- .../preflight/installed-agent-detection.ts | 6 +- .../preflight/workspace-agent-detection.ts | 2 +- .../local-pty-finalize-environment.ts | 2 +- .../local-pty-windows-spawn-environment.ts | 2 +- src/main/providers/pty-provider-contract.ts | 4 +- src/main/providers/pty-spawn-result.ts | 2 +- src/main/providers/windows-shell-args.ts | 2 +- .../pty-master-foreground-observation.test.ts | 2 +- .../codex-no-daemon-launch-command.ts | 2 +- .../rate-limits/antigravity-usage-command.ts | 2 +- .../agent-launch-scope-runtime.test.ts | 2 +- .../runtime/agent-launch-scope-runtime.ts | 6 +- .../runtime/agent-launch-settings-rollback.ts | 4 +- .../runtime/agent-prompt-line-settle.test.ts | 2 +- ...ission-runtime-hook-and-generation.test.ts | 2 +- ...-prompt-submission-runtime-test-fixture.ts | 2 +- .../agent-prompt-submission-runtime.test.ts | 2 +- ...pt-submission-windows-submit-delay.test.ts | 2 +- .../ownership/agent-session-claim-identity.ts | 2 +- .../agent-session-permission-backfill.ts | 2 +- .../records/agent-session-record-founding.ts | 2 +- .../agent-state-rules-engine.ts | 2 +- .../agent-state-rules-schema.ts | 4 +- .../agent-transcript-pane-test-harness.ts | 2 +- src/main/runtime/blocked-tail-screen-clear.ts | 2 +- .../runtime/client/runtime-client-state.ts | 2 +- .../runtime/codex-quiet-ready-screen.test.ts | 2 +- .../runtime-construction-services.ts | 2 +- .../construction/runtime-identity-state.ts | 4 +- ...draft-paste-ready-scanner-chunking.test.ts | 2 +- src/main/runtime/dsb-terminal-runtime.test.ts | 2 +- .../dsh-launch-prompt-resubmit.test.ts | 2 +- .../headless-terminal-query-reply-policy.ts | 2 +- src/main/runtime/launch-composer-watch.ts | 2 +- .../launched-agent-composer-readiness.test.ts | 4 +- .../launched-agent-composer-readiness.ts | 4 +- src/main/runtime/launched-agent-exit-watch.ts | 2 +- src/main/runtime/launched-agent-foreground.ts | 4 +- ...ched-agent-shell-handoff-readiness.test.ts | 2 +- .../runtime/launched-agent-write-guard.ts | 4 +- .../runtime/omp-readiness-transcripts.test.ts | 2 +- ...pencode-agent-row-enter-transcript.test.ts | 4 +- ...ca-runtime-agent-session-operation.test.ts | 5 +- .../orca-runtime-create-agent-session.ts | 2 +- ...ctured-agent-session-create-intent.test.ts | 2 +- .../orca-runtime-test-fixtures.spec.ts | 2 +- .../runtime/orca-runtime-test-mocks.spec.ts | 2 +- .../imported-values.spec.ts | 4 +- ...-session-tabs-duplicate-pty-repair.spec.ts | 2 +- ...-session-tabs-headless-wake-report.spec.ts | 7 +- ...obile-session-tabs-split-agent-tab.spec.ts | 2 +- ...nal-creation-and-readiness-part-07.spec.ts | 2 +- ...nal-creation-and-readiness-part-12.spec.ts | 2 +- src/main/runtime/orca-runtime.ts | 4 +- ...ation-mailbox-notification-test-harness.ts | 2 +- .../orchestration-opencode-model-host.test.ts | 2 +- .../chat-worker-error-escalation.ts | 2 +- .../codex-reconnect-failed-dispatch.test.ts | 2 +- .../configured-worker-agent-selector.ts | 6 +- .../worker-follow-up-lineage.ts | 4 +- src/main/runtime/orchestration/groups.ts | 2 +- .../write-orchestration-pointer-pty.ts | 4 +- .../worker-launch-observation.ts | 2 +- .../qoder-independent-spawn-review.test.ts | 2 +- .../qoder-mobile-resume-adoption.test.ts | 2 +- .../qoder-terminal-command-resolution.ts | 7 +- src/main/runtime/remote-viewer-launch-env.ts | 2 +- .../rpc/agent-launch-feature-requirement.ts | 2 +- src/main/runtime/rpc/errors.ts | 10 +-- .../rpc/methods/agent-launch-at-rest.test.ts | 2 +- .../methods/agent-launch-caller-selection.ts | 7 +- .../methods/agent-launch-cwd-refusal.test.ts | 4 +- .../methods/agent-launch-execution-outcome.ts | 2 +- .../rpc/methods/agent-launch-failure-code.ts | 6 +- ...ent-launch-folder-workspace-create.test.ts | 2 +- .../agent-launch-folder-workspace-creation.ts | 2 +- .../rpc/methods/agent-launch-handoff-card.ts | 2 +- .../methods/agent-launch-instant-tab.test.ts | 12 ++-- .../methods/agent-launch-intent-resolution.ts | 12 ++-- .../agent-launch-prestart-failure.test.ts | 4 +- .../rpc/methods/agent-launch-replay.test.ts | 4 +- .../rpc/methods/agent-launch-replay.ts | 11 ++-- .../agent-launch-restart-replay.test.ts | 7 +- .../agent-launch-session-reservation.test.ts | 2 +- .../agent-launch-settings-work.test.ts | 6 +- .../rpc/methods/agent-launch-surfaces.ts | 6 +- .../methods/agent-launch-tab-publication.ts | 8 +-- .../agent-launch-target-authorization.ts | 6 +- .../agent-launch-terminal-identity.test.ts | 2 +- ...gent-launch-terminal-prompt-writer.test.ts | 2 +- .../methods/agent-launch-terminal-prompt.ts | 2 +- .../methods/agent-launch-worktree-creation.ts | 4 +- .../rpc/methods/agent-launch.test-fixture.ts | 8 +-- .../runtime/rpc/methods/agent-launch.test.ts | 2 +- src/main/runtime/rpc/methods/agent-launch.ts | 6 +- .../managed-cwd-mobile.test-fixture.ts | 2 +- ...orchestration-structured-worker-session.ts | 2 +- ...ration-worker-start-mode-selection.test.ts | 2 +- .../orchestration-worker-start-mode.test.ts | 4 +- .../orchestration-worker-start-mode.ts | 7 +- ...tion-worker-start-registered-agent.test.ts | 2 +- .../orchestration/chat-assignee-admission.ts | 2 +- .../federated-worker-agent-launch.ts | 2 +- .../federation/federated-worker-start.ts | 2 +- .../worker/local-worker-start-dispatch.ts | 4 +- .../worker/local-worker-start.ts | 6 +- .../worker-configured-agent-preflight.ts | 2 +- .../worker/worker-earlier-work.ts | 2 +- .../worker/worker-launch-preferences.ts | 4 +- .../worker/worker-release.test-support.ts | 2 +- .../worker/worker-start-agent-placement.ts | 8 +-- ...orker-start-launch-executor-parity.test.ts | 6 +- .../worker/worker-start-prompt-budget.test.ts | 2 +- .../worker-start-prompt-contract.test.ts | 4 +- .../worker-start-readiness-settlement.ts | 2 +- .../worker/worker-start-receipt.ts | 2 +- .../worker/worker-start-validation.ts | 4 +- .../orchestration/worker/worker-topology.ts | 2 +- .../worker/worker-worktree-creation.ts | 2 +- ...structured-agent-session-admission.test.ts | 2 +- ...structured-agent-session-create-handler.ts | 2 +- .../structured-agent-session-create.ts | 2 +- ...agent-session-pi-dialog-capability.test.ts | 2 +- .../terminal-prompt-delivery-receipt.test.ts | 2 +- .../runtime-agent-launch-resolution.ts | 10 +-- .../runtime-agent-terminal-startup.test.ts | 8 +-- .../runtime/runtime-agent-terminal-startup.ts | 12 ++-- ...ntime-client-agent-launch-rollback.test.ts | 2 +- ...t-agent-launch-settings-durability.test.ts | 11 ++-- ...ntime-client-agent-launch-settings.test.ts | 4 +- src/main/runtime/runtime-client-settings.ts | 10 +-- .../runtime/runtime-folder-worktree-create.ts | 4 +- .../runtime-git-generation-commands.ts | 2 +- .../runtime-local-worktree-materialization.ts | 2 +- ...runtime-local-worktree-terminal-startup.ts | 4 +- .../runtime-managed-worktree-create-types.ts | 2 +- src/main/runtime/runtime-notifier-contract.ts | 6 +- .../runtime-pty-controller-contract.ts | 4 +- .../runtime-rpc/runtime-rpc-lifecycle.ts | 2 +- .../runtime/runtime-terminal-contracts.ts | 6 +- .../runtime-terminal-idle-polls.test.ts | 4 +- .../runtime/runtime-terminal-pane-identity.ts | 2 +- .../runtime/runtime-terminal-state-records.ts | 2 +- src/main/runtime/runtime-terminal-writer.ts | 2 +- .../runtime-worktree-agent-startup.test.ts | 2 +- .../runtime/runtime-worktree-agent-startup.ts | 20 ++++-- ...untime-worktree-lineage-controller.test.ts | 2 +- .../runtime-worktree-lineage-resolution.ts | 2 +- .../runtime-worktree-startup-readiness.ts | 4 +- .../runtime-worktree-status-projection.ts | 2 +- src/main/runtime/screen-input-veto.ts | 2 +- .../screen-ruled-agent-transcript-suite.ts | 2 +- .../get-agent-session-execution-namespace.ts | 10 +-- .../projection/agent-session-resume-claims.ts | 2 +- .../projection/restored-pane-materialize.ts | 4 +- .../resume-agent-session-in-workspace.ts | 2 +- .../main-layout-agent-launch-tabs.ts | 6 +- .../structured-session-tab-restoration.ts | 4 +- ...d-agent-launch-composition.test-support.ts | 2 +- .../structured-agent-launch-composition.ts | 2 +- .../structured-agent-launch-parity.test.ts | 4 +- .../structured-agent-launch-support.ts | 4 +- ...ured-agent-new-chat-effort-at-rest.test.ts | 2 +- .../structured-chat-naming-agent-launch.ts | 2 +- .../structured-chat-naming-contract.test.ts | 2 +- .../runtime/structured-chat-naming-runtime.ts | 2 +- .../runtime/structured-worker-authority.ts | 4 +- .../runtime/structured-worker-identity.ts | 2 +- src/main/runtime/terminal-foreground-group.ts | 2 +- src/main/runtime/terminal-image-viewer-env.ts | 2 +- src/main/runtime/terminal-wait-detection.ts | 2 +- .../terminal-wait-name-only-idle.test.ts | 2 +- .../input/terminal-agent-prompt-resubmit.ts | 4 +- .../terminal/input/terminal-agent-prompt.ts | 2 +- .../terminal/input/terminal-input-dispatch.ts | 2 +- .../mobile-terminal-chat-fork-create.ts | 2 +- .../launch/mobile-terminal-chat-fork.ts | 8 +-- .../terminal/launch/mobile-terminal-create.ts | 4 +- .../launch/mobile-terminal-owned-create.ts | 2 +- .../launch/mobile-terminal-startup.ts | 16 ++--- .../launch/terminal-create-deduplication.ts | 2 +- .../terminal/launch/terminal-launch-result.ts | 2 +- .../terminal/lifecycle/pty-registration.ts | 4 +- .../output/headless-terminal-hydration.ts | 2 +- .../wait/terminal-interactive-wait.ts | 10 +-- .../terminal/wait/terminal-wait-permission.ts | 2 +- .../wait/terminal-wait-visible-probe.ts | 2 +- .../runtime/terminal/wait/terminal-wait.ts | 2 +- .../trust-dialog-status-observer.test.ts | 2 +- .../runtime/trust-dialog-status-observer.ts | 2 +- .../tui-idle-delivery-and-quiescence.test.ts | 2 +- src/main/runtime/tui-idle-evidence-source.ts | 2 +- src/main/runtime/tui-idle-evidence.test.ts | 2 +- src/main/runtime/tui-idle-evidence.ts | 4 +- .../tui-idle-hook-lane-runtime.test.ts | 2 +- src/main/runtime/tui-idle-hook-lane.ts | 2 +- .../managed-worktree-create-startup.ts | 4 +- .../workspaces/workspace-activation.ts | 2 +- .../workspace-foreground-inspection.ts | 2 +- .../workspace-process-listing-dependencies.ts | 4 +- .../workspaces/workspace-process-listing.ts | 4 +- .../worktree-agent-first-surface.test.ts | 2 +- .../wsl-host-agent-terminal-launch.test.ts | 4 +- .../runtime/wsl-host-agent-terminal-launch.ts | 10 +-- src/main/skills/discovery.test.ts | 2 +- .../skills/skill-wsl-provider-detection.ts | 2 +- .../ssh/orcad-migration-catalog-client.ts | 2 +- .../startup/main-process-runtime-service.ts | 2 +- .../commit-message-model-discovery-policy.ts | 2 +- .../commit-message-model-discovery.ts | 2 +- .../commit-message-text-generation.ts | 2 +- .../window/agent-launch-tab-publish-relay.ts | 2 +- .../catalog/provisioned-root-checkout.ts | 2 +- src/main/wsl/orcad/wsl-orcad-account-env.ts | 6 +- src/preload/api/git-operation-api.ts | 2 +- src/preload/api/pty-api.ts | 6 +- src/preload/api/pty-bridge-session-control.ts | 6 +- .../ui-bridge-terminal-and-session-tabs.ts | 6 +- src/preload/api/ui-command-event-api.ts | 6 +- .../components/NewWorkspaceComposerCard.tsx | 6 +- ...kspaceComposerModal.agent-surface.test.tsx | 6 +- ...wWorkspaceComposerModal.retention.test.tsx | 4 +- .../components/NewWorkspaceComposerModal.tsx | 4 +- .../AgentSessionContinuationDialog.test.tsx | 4 +- .../AgentSessionContinuationDialog.tsx | 6 +- .../agent-session-continuation-selection.ts | 7 +- .../agent-tab-shortcut-launch.test.ts | 2 +- .../components/agent-tab-shortcut-launch.ts | 2 +- .../agent/AgentCombobox.surface.test.tsx | 7 +- .../components/agent/AgentCombobox.test.tsx | 2 +- .../src/components/agent/AgentCombobox.tsx | 2 +- .../agent/AgentLaunchPicker.form.test.tsx | 4 +- .../agent/AgentLaunchPicker.trigger.test.tsx | 5 +- .../components/agent/AgentLaunchPicker.tsx | 4 +- .../AgentLaunchPickerMenu.geometry.test.tsx | 2 +- .../AgentLaunchPickerMenu.keyboard.test.tsx | 2 +- .../AgentLaunchPickerMenu.language.test.tsx | 2 +- .../AgentLaunchPickerMenu.search.test.tsx | 2 +- .../agent/AgentLaunchPickerMenu.test.tsx | 4 +- .../agent/AgentLaunchPickerMenu.tsx | 8 +-- .../agent/AgentLaunchPromptComposer.tsx | 2 +- .../agent/AgentLaunchSetupActions.tsx | 5 +- .../AgentLaunchSetupButton.retention.test.tsx | 2 +- .../agent/AgentLaunchSetupButton.tsx | 13 ++-- .../agent/AgentLaunchSetupFooter.tsx | 4 +- .../AgentLaunchSetupPanel.arguments.test.tsx | 14 ++-- .../AgentLaunchSetupPanel.authority.test.tsx | 6 +- .../AgentLaunchSetupPanel.catalog.test.tsx | 2 +- .../agent/AgentLaunchSetupPanel.perf.test.tsx | 16 ++--- .../AgentLaunchSetupPanel.prompt.test.tsx | 2 +- .../AgentLaunchSetupPanel.shortcuts.test.tsx | 2 +- .../agent/AgentLaunchSetupPanel.test.tsx | 8 +-- .../agent/AgentLaunchSetupPanel.tsx | 16 ++--- .../agent/AgentLaunchTextModelDefault.tsx | 6 +- .../agent/agent-combobox-surface-items.tsx | 4 +- .../agent/agent-launch-picker-acquisition.ts | 4 +- ...icker-committed-selection-test-fixture.tsx | 4 +- .../agent/agent-launch-picker-drafts.ts | 5 +- ...t-launch-picker-freshness-test-fixture.tsx | 4 +- .../agent-launch-picker-menu-test-fixture.ts | 8 +-- .../agent/agent-launch-picker-retirement.ts | 4 +- .../agent/agent-launch-setup-option-rows.ts | 10 +-- .../agent-launch-setup-panel-test-fixture.ts | 5 +- .../AgentChatChoiceControls.tsx | 2 +- .../launch-settings/AgentChoiceControls.tsx | 6 +- .../AgentLaunchChoiceEditor.test.tsx | 4 +- .../AgentLaunchChoiceEditor.tsx | 6 +- .../AgentPermissionChoiceControls.tsx | 4 +- .../AgentPermissionChoiceItems.tsx | 2 +- .../agent-model-choice-chips.test.ts | 4 +- .../agent-model-choice-chips.ts | 10 +-- ...t-launch-picker-inventory.catalog.test.tsx | 7 +- ...use-agent-launch-picker-inventory.test.tsx | 6 +- .../use-agent-launch-picker-inventory.ts | 12 ++-- .../automations/AutomationEditorDialog.tsx | 4 +- .../AutomationExtraAgentArgsField.tsx | 2 +- .../automation-capability-probe.ts | 2 +- .../automations/automation-draft-model.ts | 2 +- .../automation-extra-agent-args-error-copy.ts | 2 +- .../automations/automation-launch-surface.ts | 2 +- .../automations/automation-list-view.ts | 2 +- .../automation-run-workspace-action.ts | 2 +- .../automations/automation-save-action.ts | 2 +- .../automations/automation-templates.ts | 2 +- .../use-automations-page-store-state.ts | 5 +- .../dashboard-card-terminal-input.ts | 2 +- .../dashboard-worktree-launch-options.ts | 6 +- .../ReviewNotesSendMenuContent.test.tsx | 2 +- .../FeatureWallSetupChecklist.tsx | 2 +- .../ai-commit-pr-settings-helpers.ts | 2 +- .../feature-wall/useAiCommitPrSettings.ts | 2 +- .../FloatingTerminalWindowControls.tsx | 2 +- ...NativeChatComposer.resume-command.test.tsx | 2 +- .../native-chat/NativeChatPaneHeader.tsx | 2 +- .../NativeChatPermissionModePicker.test.tsx | 2 +- .../NativeChatPermissionModePicker.tsx | 2 +- ...ResolvedView.prompt-card-composer.test.tsx | 2 +- .../NativeChatUsageLimitActions.tsx | 2 +- .../native-chat-composer-draft-memory.ts | 4 +- .../native-chat/native-chat-input-clear.ts | 2 +- .../native-chat-launch-draft-send.ts | 2 +- .../native-chat-launch-draft-source.ts | 4 +- .../native-chat/native-chat-layout-actions.ts | 2 +- .../native-chat/native-chat-leaf-routing.ts | 2 +- .../native-chat-pane-resolution.test.ts | 2 +- .../native-chat-pane-resolution.ts | 2 +- .../native-chat-permission-mode-labels.ts | 2 +- .../native-chat-quote-focus.test.tsx | 2 +- ...ive-chat-runtime-send-launch-draft.test.ts | 2 +- .../native-chat-runtime-send.test.ts | 2 +- .../native-chat/native-chat-runtime-send.ts | 2 +- .../native-chat-session-option-discovery.ts | 2 +- .../native-chat/native-chat-view-types.ts | 2 +- ...ructured-conversation-command-send.test.ts | 2 +- .../native-chat/use-native-chat-hand-off.tsx | 2 +- .../use-native-chat-host-permission-gate.ts | 2 +- ...se-native-chat-session-context-actions.tsx | 2 +- ...se-native-chat-structured-composer-send.ts | 2 +- .../use-native-chat-terminal-draft-pickup.ts | 6 +- ...e-structured-agent-session-option-state.ts | 2 +- .../new-workspace-composer-card-props.ts | 7 +- .../src/components/onboarding/AgentStep.tsx | 2 +- .../onboarding/agent-picked-payload.ts | 2 +- .../onboarding/onboarding-flow-state.ts | 2 +- .../onboarding-settings-hydration.ts | 2 +- .../onboarding/use-onboarding-flow-actions.ts | 2 +- .../use-onboarding-flow-persistence.ts | 6 +- .../onboarding/use-onboarding-flow.ts | 2 +- .../orchestration-crew/CrewAgentIcons.tsx | 2 +- ...ceControlAgentActionDialog.picker.test.tsx | 12 ++-- ...ControlAgentActionDialog.settings.test.tsx | 6 +- .../SourceControlAgentActionDialog.test.tsx | 2 +- .../SourceControlAgentActionDialog.tsx | 2 +- ...ourceControlAgentActionDialogForm.test.tsx | 2 +- .../SourceControlAgentActionDialogForm.tsx | 4 +- .../ai-vault-session-cli-fork.ts | 5 +- .../ai-vault-session-resume-in-chat-launch.ts | 2 +- .../buildSourceControlAgentDeliveryPlan.ts | 2 +- .../saved-action-delivery.test.tsx | 2 +- .../runSourceControlAgentActionStart.test.ts | 2 +- .../runSourceControlAgentActionStart.ts | 2 +- ...rce-control-action-dialog.test-fixture.tsx | 6 +- ...urce-control-agent-action-dialog-result.ts | 7 +- ...rce-control-agent-action-dialog-support.ts | 4 +- .../source-control-fix-split-button.tsx | 2 +- ...control-launch-agent-args-applicability.ts | 2 +- .../source-control/ai/recovery-launch.ts | 4 +- .../ai/source-control-action-model-copy.ts | 2 +- .../ai/text-generation-dialog-form.tsx | 2 +- .../ai/use-ai.operation-recovery.test.tsx | 4 +- .../source-control/commit/component-gates.ts | 2 +- .../use-saved-source-control-action-start.ts | 2 +- .../use-source-control-action-agent-choice.ts | 6 +- .../use-source-control-launchable-agents.ts | 2 +- ...useSourceControlAgentActionDialog.test.tsx | 2 +- .../useSourceControlAgentActionDialog.ts | 7 +- .../useSourceControlAgentActionStart.ts | 2 +- .../SourceControlTextActionAgentPicker.tsx | 4 +- .../settings-persistence-test-fixture.ts | 2 +- .../settings/agents/AgentsPane.test.tsx | 4 +- .../agents/launch/AgentCatalogRow.tsx | 6 +- .../agents/launch/AgentDefaultSetting.tsx | 2 +- .../launch/AgentLaunchSettingsCatalog.tsx | 20 +++--- .../launch/AgentLaunchSettingsSection.tsx | 6 +- .../launch/HostAgentEnvironmentEditor.tsx | 4 +- .../launch/HostAgentLaunchSettings.test.tsx | 6 +- .../agents/launch/HostAgentLaunchSettings.tsx | 2 +- .../permissions/AgentPermissionModeMenu.tsx | 2 +- .../permissions/AgentPermissionsSetting.tsx | 2 +- .../permissions/AgentRowPermissions.tsx | 2 +- .../permissions/agent-permission-baseline.ts | 4 +- ...permission-conversion-persistence.test.tsx | 6 +- .../agent-permission-mode-label.ts | 2 +- .../agent-permission-override-notice.tsx | 6 +- .../permissions/agent-row-permission-model.ts | 10 +-- .../settings/chat/ChatNamingSetting.tsx | 2 +- .../chat/ChatPermissionSetting.test.tsx | 2 +- .../settings/chat/ChatPermissionSetting.tsx | 8 +-- .../chat/use-chat-permission-settings.ts | 2 +- .../RepositorySourceControlAiActionRows.tsx | 2 +- .../RepositorySourceControlAiSection.test.ts | 10 +-- ...ory-source-control-ai-action-rows-props.ts | 2 +- .../repository-source-control-ai-global-ux.ts | 2 +- .../repository-source-control-ai-labels.ts | 2 +- .../shortcuts/keybinding-title-copy.ts | 2 +- .../shortcuts/shortcut-definition-catalog.ts | 2 +- .../settings/shortcuts/shortcut-groups.ts | 4 +- ...urce-control-text-action-picker-entries.ts | 2 +- .../source-control-text-action-picker-save.ts | 4 +- .../CommitMessageAiPane.test.tsx | 2 +- .../source-control/CommitMessageAiPane.tsx | 2 +- .../SourceControlActionAgentPicker.tsx | 4 +- .../SourceControlActionArguments.tsx | 10 +-- .../SourceControlActionRecipeRow.tsx | 2 +- .../SourceControlAiActionRecipeDefaults.tsx | 2 +- ...rce-control-action-arguments-visibility.ts | 2 +- ...source-control-action-card-layout.test.tsx | 14 ++-- ...e-control-action-permission-draft.test.tsx | 4 +- .../source-control-action-recipe-options.ts | 2 +- ...e-control-ai-settings-persistence.test.tsx | 4 +- .../use-source-control-action-agent.ts | 2 +- .../use-text-action-model-discovery.ts | 2 +- .../sidebar/folder-workspace-agent-startup.ts | 8 +-- .../folder-workspace-composer-submit-input.ts | 6 +- .../folder-workspace-composer-submit.ts | 4 +- .../worktree-title-derived-agent-rows.test.ts | 2 +- .../status-bar/status-bar-agent-gating.ts | 2 +- .../components/tab-bar/QuickLaunchButton.tsx | 6 +- .../tab-bar/TabBarCreateEntryRow.tsx | 2 +- .../tab-bar/agent-menu-shortcut-labels.ts | 2 +- .../cli-chat-resume-close-admission.ts | 2 +- ...t-agent-launch-preferences-source.test.tsx | 6 +- .../tab-bar/native-chat-tab-agent-evidence.ts | 4 +- ...gent-menu-host-preferences-test-fixture.ts | 4 +- .../tab-bar/new-tab-agent-menu-model.ts | 4 +- .../tab-bar/tab-agent-launch-options.test.ts | 2 +- .../tab-bar/tab-agent-launch-options.ts | 18 ++--- .../tab-bar/tab-agent-row-presentation.ts | 5 +- .../tab-bar/tab-bar-create-menu-contract.ts | 2 +- .../tab-bar/tab-create-entry-props.ts | 2 +- .../tab-bar/tab-session-history-switch.ts | 2 +- ...w-tab-agent-menu-host-preferences.test.tsx | 4 +- .../use-new-tab-agent-menu-rows.test.tsx | 22 +++++-- .../tab-bar/use-new-tab-agent-menu-rows.ts | 8 +-- .../use-tab-bar-create-menu-controller.ts | 2 +- .../src/components/tab-group/tab-drag-data.ts | 2 +- .../components/terminal-agent-tab-shortcut.ts | 2 +- .../terminal-pane/AgentLaunchPaneNotice.tsx | 2 +- .../agent-launch-pane-notice-text.ts | 4 +- .../antigravity-auto-approved-permission.ts | 4 +- .../terminal-pane/ipc-pty-connect-result.ts | 2 +- ...ane-startup-color-reply-leak.repro.test.ts | 2 +- .../native-chat-leaf-title-agent.ts | 4 +- .../pty-agent-pane-launch.test.ts | 4 +- ...nnection-foreground-agent-sampling.spec.ts | 2 +- ...on-foreground-routing-confirmation.spec.ts | 2 +- .../terminal-pane/pty-connection-types.ts | 6 +- .../agent-pre-ready-typed-draft.ts | 4 +- .../cold-restore-resume-startup.ts | 4 +- .../command-inferred-pane-agent.ts | 4 +- .../pty-connection/fresh-spawn-types.ts | 2 +- .../pty-connection/pane-agent-identity.ts | 7 +- .../pane-launch-agent-candidate.ts | 6 +- .../pty-connection/pty-input-recovery.ts | 2 +- .../pty-connection/sleeping-record-access.ts | 4 +- .../terminal-pane/pty-transport-types.ts | 6 +- .../terminal-agent-paste-bracketing.ts | 5 +- .../terminal-agent-session-continuation.ts | 4 +- .../terminal-agent-session-fork.ts | 4 +- .../terminal-pane/terminal-ctrl-enter.ts | 5 +- .../terminal-keyboard-protocol-pane-agent.ts | 2 +- .../terminal-keyboard-runtime.ts | 2 +- .../terminal-startup-command-classifier.ts | 7 +- .../terminal-windows-shift-enter.ts | 5 +- .../use-terminal-pane-title-state.ts | 2 +- .../TerminalQuickCommandContentSection.tsx | 2 +- .../TerminalQuickCommandDialog.tsx | 2 +- .../terminal-quick-command-agent-options.ts | 2 +- .../terminal-quick-command-dialog-draft.ts | 2 +- .../terminal-workspace-keydown.test.ts | 2 +- .../hooks/agent-hook-turn-end-ownership.ts | 2 +- .../composer-state/composer-submit-model.ts | 2 +- .../folder-submit-orchestration.ts | 4 +- .../composer-state/host-runtime-effects.ts | 5 +- .../hooks/composer-state/identity-model.ts | 2 +- .../quick-creation-execution.ts | 2 +- .../composer-state/quick-creation-request.ts | 4 +- .../composer-state/quick-startup-plan.ts | 8 +-- .../composer-state/quick-submit-action.ts | 2 +- .../quick-submit-preparation.ts | 2 +- .../quick-submit-source-preparation.ts | 4 +- .../composer-state/runtime-target-model.ts | 4 +- .../runtime-target-selection.ts | 4 +- .../workspace-identity-state.ts | 7 +- ...c-events-terminal-create-scenario-types.ts | 2 +- ...ts-terminal-create-window-test-fixtures.ts | 2 +- .../ipc-events/agent-launch-tab-ipc-bridge.ts | 2 +- src/renderer/src/hooks/useComposerState.ts | 2 +- src/renderer/src/hooks/useDetectedAgents.ts | 2 +- .../lib/active-agent-note-send-delivery.ts | 7 +- .../lib/agent-account-restart-startup.test.ts | 2 +- .../src/lib/agent-account-restart-startup.ts | 8 +-- .../lib/agent-background-draft-delivery.ts | 2 +- .../lib/agent-background-session-contract.ts | 4 +- ...ent-background-session-launch-host.test.ts | 2 +- .../agent-background-session-launch-host.ts | 2 +- .../agent-background-session-test-state.ts | 2 +- .../agent-background-session-timeout-toast.ts | 2 +- .../src/lib/agent-catalog-entries-primary.ts | 5 +- src/renderer/src/lib/agent-catalog-entries.ts | 2 +- src/renderer/src/lib/agent-catalog.tsx | 2 +- .../agent-detection-target-inventory.test.ts | 2 +- .../lib/agent-detection-target-inventory.ts | 2 +- src/renderer/src/lib/agent-draft-readiness.ts | 2 +- src/renderer/src/lib/agent-favicon-assets.ts | 2 +- .../src/lib/agent-followup-delivery.test.ts | 2 +- .../src/lib/agent-followup-delivery.ts | 2 +- .../lib/agent-hibernation-pane-eligibility.ts | 2 +- .../agent-launch-caller-permissions.test.ts | 2 +- ...ent-launch-caller-prompt-transport.test.ts | 2 +- .../lib/agent-launch-caller-routing.test.ts | 2 +- ...nt-launch-pane-verdict-application.test.ts | 2 +- .../agent-launch-pane-verdict-application.ts | 2 +- .../src/lib/agent-launch-prompt-delivery.ts | 2 +- .../src/lib/agent-launch-route-input.ts | 2 +- ...ent-launch-route-registered-agents.test.ts | 2 +- src/renderer/src/lib/agent-launch-routing.ts | 2 +- .../lib/agent-launch-tab-main-written.test.ts | 2 +- .../src/lib/agent-launch-tab-main-written.ts | 4 +- .../src/lib/agent-launch-tab-presentation.ts | 2 +- .../lib/agent-launch-tab-publication.test.ts | 2 +- .../src/lib/agent-launch-tab-publication.ts | 4 +- .../src/lib/agent-launch-through-host.test.ts | 4 +- .../src/lib/agent-launch-through-host.ts | 2 +- src/renderer/src/lib/agent-menu-selection.ts | 7 +- .../src/lib/agent-native-draft-prefill.ts | 4 +- .../agent-paste-draft-submit-retry.test.ts | 4 +- .../src/lib/agent-paste-draft.test.ts | 4 +- src/renderer/src/lib/agent-paste-draft.ts | 8 +-- src/renderer/src/lib/agent-ready-wait.test.ts | 2 +- src/renderer/src/lib/agent-ready-wait.ts | 2 +- .../src/lib/agent-resume-launch-target.ts | 2 +- .../src/lib/agent-session-continuation.ts | 2 +- .../src/lib/agent-session-launch-plan.ts | 2 +- .../launch/agent-settings-update-queue.ts | 4 +- .../native-chat-provider-choice.test.tsx | 6 +- .../launch/native-chat-provider-choice.ts | 4 +- ...structured-agent-session-host-admission.ts | 2 +- ...-agent-session-launch-admission-notices.ts | 2 +- ...ructured-agent-session-launch-admission.ts | 2 +- ...red-agent-session-launch-create-message.ts | 2 +- ...-agent-session-launch-permission-notice.ts | 4 +- .../structured-agent-session-launch-record.ts | 4 +- ...tructured-agent-session-launch-registry.ts | 2 +- .../structured-agent-session-launch-status.ts | 2 +- ...structured-agent-session-launch-surface.ts | 2 +- .../launch/structured-agent-session-launch.ts | 2 +- ...gent-startup-creation-continuation.test.ts | 4 +- .../src/lib/agent-startup-delayed-delivery.ts | 2 +- src/renderer/src/lib/agent-status.ts | 2 +- src/renderer/src/lib/agent-tab-shortcuts.ts | 9 ++- .../ai-vault-antigravity-reference-startup.ts | 8 +-- .../src/lib/ai-vault-omp-cold-resume.test.ts | 2 +- src/renderer/src/lib/ai-vault-resume-shell.ts | 2 +- .../ai-vault-session-resume-preparation.ts | 2 +- .../src/lib/automation-session-reuse.ts | 2 +- src/renderer/src/lib/chat-provider-agents.ts | 4 +- .../src/lib/codex-pane-restart-eligibility.ts | 2 +- .../src/lib/codex-session-restart.test.ts | 2 +- src/renderer/src/lib/codex-session-restart.ts | 2 +- .../direct-work-item-setup-callers.test.tsx | 2 +- .../lib/empty-workspace-default-agent-chat.ts | 2 +- src/renderer/src/lib/execution-host-facts.ts | 2 +- .../src/lib/fix-checks-agent-launch.test.ts | 6 +- .../src/lib/fix-checks-agent-launch.ts | 4 +- .../src/lib/host-chat-program-acquisition.ts | 4 +- src/renderer/src/lib/host-chat-program.ts | 2 +- src/renderer/src/lib/ipc-error.ts | 2 +- .../lib/launch-agent-background-session.ts | 6 +- .../src/lib/launch-agent-execution-context.ts | 4 +- .../src/lib/launch-agent-in-new-tab-args.ts | 2 +- .../launch-agent-in-new-tab-host-agents.ts | 2 +- .../src/lib/launch-agent-in-new-tab.test.ts | 2 +- .../src/lib/launch-agent-in-new-tab.ts | 4 +- .../lib/launch-agent-paste-timeout-notice.ts | 2 +- .../lib/launch-agent-picker-contract.test.ts | 31 +++++---- .../lib/launch-agent-picker-prompt.test.tsx | 2 +- .../lib/launch-agent-session-continuation.ts | 4 +- .../lib/launch-agent-startup-prompt-plan.ts | 2 +- .../src/lib/launch-agent-tab-prompt-paste.ts | 2 +- .../src/lib/launch-agent-web-host-tab.ts | 6 +- ...nch-parity-workspace-start.test-fixture.ts | 2 +- .../lib/launch-structured-agent-session.ts | 2 +- .../launch-work-item-direct-agent-routing.ts | 6 +- .../src/lib/launch-work-item-direct-agent.ts | 12 ++-- .../launch-work-item-direct-defaults.test.ts | 2 +- .../lib/launch-work-item-direct-messages.ts | 9 ++- .../lib/launch-work-item-direct-preflight.ts | 13 ++-- ...unch-work-item-direct-route-preparation.ts | 2 +- .../launch-work-item-direct-test-fixture.ts | 14 ++-- .../src/lib/launch-work-item-direct-types.ts | 4 +- .../src/lib/native-chat-launch-prompt.ts | 2 +- src/renderer/src/lib/native-chat-telemetry.ts | 2 +- .../src/lib/new-tab-agent-menu-rows.ts | 9 +-- src/renderer/src/lib/new-workspace.ts | 2 +- .../src/lib/onboarding-folder-agent-launch.ts | 2 +- .../lib/onboarding-folder-agent-startup.ts | 12 ++-- .../onboarding-folder-cancellation.test.ts | 2 +- .../src/lib/open-tab-occupant-agent.ts | 2 +- .../src/lib/orchestration-skill-coverage.ts | 4 +- .../terminal-keyboard-protocol.ts | 2 +- .../src/lib/pending-worktree-creation.ts | 6 +- .../lib/quick-workspace-agent-selection.ts | 4 +- .../lib/runtime-agent-background-create.ts | 6 +- .../src/lib/sleeping-agent-session-launch.ts | 4 +- ...ource-control-agent-action-launch-check.ts | 7 +- ...control-agent-launch-picker.source.test.ts | 17 +++-- ...source-control-agent-launch-picker.test.ts | 12 ++-- .../lib/source-control-agent-launch-picker.ts | 7 +- ...ource-control-agent-picker-test-fixture.ts | 2 +- .../src/lib/source-control-agent-picker.ts | 6 +- .../src/lib/startup-draft-input-kind.test.ts | 2 +- .../lib/structured-agent-launch-settlement.ts | 2 +- ...t-session-tab-open-through-layout-owner.ts | 2 +- src/renderer/src/lib/tui-agent-startup.ts | 14 ---- ...eb-runtime-worktree-terminal-after-wake.ts | 2 +- src/renderer/src/lib/workspace-session.ts | 2 +- .../lib/worktree-activation-store-contract.ts | 2 +- .../worktree-activation-surface-selection.ts | 2 +- .../src/lib/worktree-creation-agent-seeds.ts | 2 +- .../worktree-creation-host-agent-launch.ts | 2 +- ...on-structured-session-host-decline.test.ts | 2 +- .../src/lib/worktree-startup-payload.ts | 4 +- src/renderer/src/lib/worktree-status.ts | 2 +- .../agent-launch-settings-transport.ts | 4 +- .../host-agent-launch-preferences-resource.ts | 2 +- .../agent-resume-host-authority-capability.ts | 2 +- .../antigravity-generation-compatibility.ts | 2 +- .../structured-chat-host-permission.ts | 8 +-- .../web-runtime-agent-launch-options.test.ts | 10 +-- .../src/runtime/web-runtime-session-types.ts | 4 +- .../runtime/web-runtime-terminal-creation.ts | 2 +- .../agent-status-nested-resume.spec.ts | 2 +- .../agent-status-provider-session-actions.ts | 2 +- .../agent-status-recovery-collection.ts | 2 +- ...k-session-binding-renderer.test-fixture.ts | 2 +- .../src/store/slices/detected-agents.ts | 2 +- .../slices/local-agent-inventory-outcome.ts | 2 +- .../slices/local-agent-inventory-refresh.ts | 6 +- .../slices/local-detected-agent-state.ts | 6 +- .../local-detected-agent-store-state.ts | 2 +- .../runtime-detected-agents-pairing.test.ts | 2 +- .../store/slices/runtime-detected-agents.ts | 2 +- src/renderer/src/store/slices/settings.ts | 4 +- .../store/slices/tabs/tabs-close-actions.ts | 4 +- .../store/slices/tabs/tabs-label-actions.ts | 2 +- .../store/slices/ui/ui-slice-contract-core.ts | 2 +- .../src/store/slices/worktree-helpers.ts | 2 +- .../create/host-planned-agent-launch.ts | 2 +- .../create/worktree-create-payload.ts | 2 +- .../src/store/terminals/terminal-actions.ts | 4 +- .../src/store/terminals/terminal-contracts.ts | 2 +- .../src/store/terminals/terminal-state.ts | 6 +- .../web-chat-permission-normalization.test.ts | 4 +- .../web-preference-normalization.ts | 12 ++-- .../pane-provider-session.ts | 2 +- src/shared/agent-kind.ts | 2 +- .../agent-cli-installation-problem.ts | 4 +- .../catalog}/tui-agent-config-types.ts | 0 .../catalog}/tui-agent-config.ts | 13 ++-- .../catalog}/tui-agent-detection-commands.ts | 8 +-- .../catalog}/tui-agent-display-names.ts | 0 .../catalog}/tui-agent-favicon-domains.ts | 0 .../catalog}/tui-agent-selection.test.ts | 0 .../catalog}/tui-agent-selection.ts | 2 +- .../{ => agent-launch/catalog}/tui-agent.ts | 0 .../choices}/agent-choice-args-analysis.ts | 8 +-- .../choices}/agent-choice-args.ts | 12 ++-- .../choices}/agent-choice-cli-apply.test.ts | 2 +- .../choices}/agent-choice-cli-apply.ts | 6 +- .../choices}/agent-choice-layers.ts | 10 +-- .../choices}/agent-choice-reconciliation.ts | 15 ++--- .../choices}/agent-choice-settings.ts | 6 +- .../choices}/agent-effort-level.ts | 0 .../choices}/agent-launch-choice-updates.ts | 6 +- .../choices}/agent-launch-choices.test.ts | 14 ++-- .../choices}/agent-launch-choices.ts | 8 +-- .../agent-launch-default-choices.test.ts | 11 ++-- .../agent-launch-environment-updates.ts | 11 ++-- .../agent-launch-legacy-publication.test.ts | 6 +- .../agent-launch-model-preferences.ts | 8 +-- .../agent-launch-permission-updates.ts | 17 +++-- .../choices}/agent-launch-preferences.ts | 12 ++-- .../choices}/agent-launch-profile.ts | 17 +++-- ...nt-launch-settings-auto-projection.test.ts | 2 +- .../agent-launch-settings-permissions.test.ts | 2 +- .../choices}/agent-launch-settings.ts | 23 ++++--- .../choices}/default-agent-settings.test.ts | 0 .../choices}/default-agent-settings.ts | 4 +- .../tui-agent-launch-defaults.spec.ts | 4 +- .../choices}/tui-agent-launch-defaults.ts | 22 ++++--- .../contracts}/agent-launch-intent.ts | 2 +- .../contracts}/agent-launch-operation.test.ts | 2 +- .../contracts}/agent-launch-operation.ts | 4 +- .../agent-launch-pane-already-live.ts | 0 .../contracts}/agent-launch-pane-verdict.ts | 0 .../contracts}/agent-launch-replay-refusal.ts | 0 .../agent-launch-runtime-capability.ts | 0 .../agent-launch-session-already-exists.ts | 0 .../contracts}/agent-launch-surface.ts | 0 .../contracts}/agent-launch-tab-closed.ts | 0 .../agent-launch-tab-publication.ts | 2 +- .../agent-launch-target-forbidden.ts | 0 .../contracts}/agent-pane-launch-request.ts | 2 +- ...agent-chat-permission-host-support.test.ts | 0 .../agent-chat-permission-host-support.ts | 8 +-- .../agent-chat-permission-mode.test.ts | 7 +- .../agent-chat-permission-mode.ts | 12 ++-- .../agent-chat-permission-support.ts | 0 .../permissions}/agent-permission-args.ts | 10 +-- .../permissions}/agent-permission-env.ts | 0 .../agent-scoped-permission-defaults.test.ts | 8 +-- .../tui-agent-auto-permissions.test.ts | 11 ++-- .../tui-agent-permission-choice.test.ts | 30 ++++----- .../tui-agent-permission-choice.ts | 4 +- .../permissions}/tui-agent-permission-lift.ts | 12 ++-- .../tui-agent-permissions.test.ts | 0 .../permissions}/tui-agent-permissions.ts | 4 +- .../picker}/agent-launch-picker-arguments.ts | 10 +-- .../picker}/agent-launch-picker-authority.ts | 0 .../picker}/agent-launch-picker-catalog.ts | 14 ++-- .../picker}/agent-launch-picker-defaults.ts | 12 ++-- .../picker}/agent-launch-picker-edits.ts | 16 ++--- ...nt-launch-picker-legacy-permission.test.ts | 10 +-- .../picker}/agent-launch-picker-permission.ts | 18 ++--- .../picker}/agent-launch-picker-receipt.ts | 14 ++-- .../picker}/agent-launch-picker-rows.ts | 12 ++-- .../picker}/agent-launch-picker-search.ts | 4 +- .../picker}/agent-launch-picker-speed.ts | 17 ++--- .../agent-launch-picker-text-action.ts} | 2 +- .../picker}/agent-launch-picker.test.ts | 2 +- .../picker}/agent-launch-picker.ts | 34 ++++------ .../agent-command-line-intent.test.ts | 4 +- .../startup}/agent-command-line-intent.ts | 4 +- .../startup}/agent-command-plan.ts | 4 +- .../startup}/agent-draft-platform-limit.ts | 0 .../startup}/agent-launch-account-env.ts | 2 +- .../startup}/agent-launch-remote.ts | 6 +- .../startup}/agent-launch-runtime.ts | 10 +-- .../startup}/agent-overlay-env.ts | 0 .../startup}/agent-prompt-injection.test.ts | 0 .../startup}/agent-prompt-injection.ts | 8 +-- .../startup}/agent-resume-argv-drop.spec.ts | 2 +- .../startup}/agent-resume-argv-drop.ts | 2 +- .../startup}/agent-resume-argv.ts | 2 +- .../agent-resume-launch-command.spec.ts | 3 +- .../startup}/agent-resume-launch-command.ts | 2 +- .../agent-startup-default-lifetime.test.ts | 9 +-- ...artup-plan-inputs-baseline-test-fixture.ts | 11 ++-- ...artup-plan-inputs-extra-agent-args.spec.ts | 2 +- .../agent-startup-plan-inputs.spec.ts | 0 .../startup}/agent-startup-plan-inputs.ts | 10 +-- .../agent-startup-update-suppression.test.ts | 0 .../startup}/agent-tui-command-typing.ts | 0 .../startup}/agent-tui-input-clear.test.ts | 0 .../startup}/agent-tui-input-clear.ts | 0 .../automation-extra-agent-args.spec.ts | 2 +- .../startup}/automation-extra-agent-args.ts | 10 +-- .../startup}/codex-startup-delivery.test.ts | 0 .../startup}/codex-startup-delivery.ts | 4 +- .../startup}/dsh-startup.spec.ts | 2 +- .../startup}/flag-prompt-startup.ts | 10 +-- .../startup}/freebuff-launch.spec.ts | 4 +- .../startup}/freebuff-startup.spec.ts | 0 .../startup}/hermes-startup-query.ts | 2 +- .../hermes-startup-query.windows.test.ts | 0 .../startup}/omp-draft-launch-shell.test.ts | 0 .../startup}/omp-draft-launch-windows.test.ts | 0 .../startup}/omp-draft-launch.ts | 0 .../startup}/omp-fresh-config.ts | 0 .../omp-fresh-launch-cmd.win32.test.ts | 0 .../startup}/omp-fresh-launch-shell.test.ts | 0 .../startup}/omp-fresh-launch.spec.ts | 0 .../startup}/omp-fresh-launch.ts | 0 .../startup}/opencode-startup-prompt.spec.ts | 0 .../startup}/opencode-startup-prompt.ts | 6 +- .../opencode2-resume-launch-mode.spec.ts | 4 +- .../startup}/qoder-cn-launch-recipe.spec.ts | 3 +- .../startup}/tui-agent-fork-startup.spec.ts | 2 +- ...ent-launch-command-argument-values.test.ts | 10 +-- .../tui-agent-launch-command-override.test.ts | 0 .../tui-agent-launch-command-override.ts | 4 +- ...ui-agent-launch-command-pick-flags.test.ts | 0 .../startup}/tui-agent-launch-command.ts | 20 +++--- .../tui-agent-prompt-transport.spec.ts | 4 +- .../startup}/tui-agent-resume-startup.ts | 18 ++--- .../tui-agent-startup-copilot-resume.spec.ts | 2 +- .../startup}/tui-agent-startup-hermes.spec.ts | 3 +- .../tui-agent-startup-kiro-resume.test.ts | 0 .../tui-agent-startup-script.test-fixture.ts | 0 .../tui-agent-startup-session-options.spec.ts | 7 +- .../startup}/tui-agent-startup-shell.spec.ts | 0 .../startup}/tui-agent-startup-shell.ts | 4 +- .../startup}/tui-agent-startup.spec.ts | 17 +++-- .../startup}/tui-agent-startup.test.ts | 2 +- .../startup}/tui-agent-startup.ts | 23 ++----- src/shared/agent-model-probe-spec.ts | 2 +- .../agent-node-entrypoint-identities.ts | 2 +- src/shared/agent-process-recognition.test.ts | 4 +- src/shared/agent-process-recognition.ts | 8 ++- src/shared/agent-resume-record-from-status.ts | 2 +- .../agent-session-host-authority.ts | 2 +- .../failures/agent-session-failure-copy.ts | 4 +- .../failures/agent-session-refusal-details.ts | 6 +- .../failures/agent-session-refusal-notice.ts | 2 +- .../failures/agent-session-write-failure.ts | 4 +- .../lifecycle/agent-session-resume.ts | 4 +- .../lifecycle/agent-session-sign-in.ts | 2 +- .../lifecycle/agent-session-turn-record.ts | 2 +- .../options}/agent-cli-flag-detection.test.ts | 0 .../options}/agent-cli-flag-detection.ts | 2 +- .../options}/agent-model-catalog-ownership.ts | 0 ...gent-session-option-catalog-antigravity.ts | 2 +- ...ent-session-option-catalog-claude-codex.ts | 2 +- .../agent-session-option-catalog-codebuddy.ts | 2 +- ...nt-session-option-catalog-gemini-cursor.ts | 2 +- .../agent-session-option-catalog-grok.ts | 2 +- .../agent-session-option-catalog-muse.ts | 2 +- .../agent-session-option-catalog-omp.ts | 2 +- .../agent-session-option-catalog-opencode.ts | 2 +- .../agent-session-option-catalog-types.ts | 2 +- .../options/agent-session-option-launch.ts | 20 ++++-- .../structured-agent-session-option-view.ts | 2 +- ...tured-agent-session-options-write-owner.ts | 2 +- .../structured-agent-session-options.ts | 4 +- ...uctured-agent-session-permission-option.ts | 4 +- src/shared/agent-status-hooks-setting.ts | 4 +- src/shared/agent-status-identity.ts | 2 +- src/shared/agent-title-name-anchoring.ts | 2 +- src/shared/agent-type-icon-agent.ts | 2 +- src/shared/ai-vault-resume-command.ts | 4 +- src/shared/ai-vault-resume-host-startup.ts | 2 +- src/shared/ai-vault-resume-startup.ts | 12 ++-- src/shared/ai-vault-types.ts | 2 +- .../automation-extra-agent-args-record.ts | 2 +- src/shared/automation-session-reuse.ts | 2 +- src/shared/automations-types.ts | 2 +- src/shared/claude-agent-view-launch.test.ts | 5 +- src/shared/claude-agent-view-launch.ts | 4 +- src/shared/cli-workspace-provenance.ts | 2 +- src/shared/codebuddy-agent.test.ts | 2 +- src/shared/codex-permission-policy.ts | 2 +- src/shared/command-environment.test.ts | 3 +- src/shared/commit-message-agent-spec.ts | 4 +- .../commit-message-agent-specs-primary.ts | 2 +- .../commit-message-agent-specs-secondary.ts | 2 +- src/shared/commit-message-ai-types.ts | 2 +- src/shared/commit-message-generation.ts | 2 +- src/shared/commit-message-plan.test.ts | 3 +- src/shared/commit-message-plan.ts | 6 +- src/shared/dashboard-snapshot.ts | 2 +- src/shared/default-global-settings.ts | 2 +- ...te-ready-scanner-grok-trace-replay.test.ts | 2 +- src/shared/draft-paste-ready-scanner.test.ts | 2 +- src/shared/draft-paste-ready-scanner.ts | 5 +- src/shared/draft-paste-ready-timeout.ts | 4 +- src/shared/folder-workspace-types.ts | 2 +- src/shared/folder-workspaces.ts | 2 +- src/shared/global-settings-base.ts | 2 +- src/shared/global-settings-test-fixture.ts | 2 +- src/shared/global-settings-types.ts | 6 +- src/shared/host-account-launch-env.ts | 2 +- .../keybindings-default-bindings.test.ts | 2 +- src/shared/keybindings/definitions.ts | 7 +- src/shared/keybindings/types.ts | 2 +- src/shared/live-resume-anchor-record.ts | 2 +- src/shared/managed-agent-hook-targets.ts | 7 +- .../every-agent-chat.test-fixture.ts | 2 +- .../native-chat-launch-draft-mirrorability.ts | 2 +- .../native-chat-session-option-defaults.ts | 6 +- .../native-chat-session-option-snapshot.ts | 2 +- .../native-chat/native-chat-agent-support.ts | 2 +- .../native-chat/native-chat-availability.ts | 2 +- .../native-chat/native-chat-providers.ts | 2 +- src/shared/opencode-headless-command.test.ts | 2 +- src/shared/opencode-headless-command.ts | 2 +- src/shared/opencode-launch-command.ts | 4 +- src/shared/orca-cli-command-name.test.ts | 2 +- ...migration-dormant-automation-validation.ts | 2 +- ...orchestration-dispatch-refusal-contract.ts | 2 +- ...rchestration-worker-start-prompt-budget.ts | 2 +- src/shared/pane-agent-identity-adapter.ts | 2 +- src/shared/pi-agent-kind.ts | 6 +- .../plugin-host-api-workspace-methods.ts | 2 +- ...powershell-native-argument.windows.test.ts | 4 +- src/shared/protocol-version.ts | 2 +- src/shared/published-pane-agent-identity.ts | 2 +- src/shared/qoder-agent.test.ts | 5 +- src/shared/require-tui-agent-config.test.ts | 2 +- src/shared/require-tui-agent-config.ts | 5 +- .../agent-launch-params-account-env.test.ts | 2 +- ...-launch-params-native-chat-default.test.ts | 2 +- ...nch-params.pre-observation.test-fixture.ts | 8 +-- .../rpc-contract/agent-launch-params.ts | 8 +-- .../agent-launch-settings-params.ts | 6 +- .../rpc-contract/agent-session-params.ts | 8 +-- src/shared/rpc-contract/automation-params.ts | 2 +- .../rpc-contract/client-settings-params.ts | 8 +-- .../rpc-contract/folder-workspace-params.ts | 2 +- src/shared/rpc-contract/preflight-params.ts | 2 +- .../session-tabs-schemas-params.ts | 4 +- .../rpc-contract/terminal-unary-params.ts | 2 +- .../workspace-layout-terminal-tab-params.ts | 4 +- ...ate-params.pre-observation.test-fixture.ts | 2 +- .../rpc-contract/worktree-create-params.ts | 2 +- src/shared/rpc-contract/worktree-params.ts | 4 +- .../runtime-mobile-session-tab-contracts.ts | 2 +- src/shared/runtime-session-contracts.ts | 2 +- src/shared/runtime-terminal-contracts.ts | 5 +- src/shared/skill-install-providers.ts | 2 +- src/shared/skills-cli-agent-keys.ts | 2 +- .../source-control-action-argument-choices.ts | 11 ++-- ...source-control-action-argument-document.ts | 14 ++-- ...ource-control-action-choice-preferences.ts | 7 +- ...ource-control-action-launch-preferences.ts | 21 +++--- .../source-control-action-model-selection.ts | 8 +-- src/shared/source-control-action-options.ts | 6 +- .../source-control-action-permission-lift.ts | 2 +- src/shared/source-control-action-selection.ts | 4 +- .../source-control-ai-action-model-choice.ts | 2 +- ...urce-control-ai-action-model-edits.test.ts | 2 +- .../source-control-ai-action-model-edits.ts | 2 +- src/shared/source-control-ai-actions.ts | 6 +- .../source-control-ai-command-template.ts | 2 +- ...source-control-ai-legacy-reconciliation.ts | 2 +- .../source-control-ai-model-selection.ts | 2 +- .../source-control-ai-operation-policy.ts | 2 +- src/shared/source-control-ai-repo-settings.ts | 2 +- src/shared/source-control-ai-types.ts | 2 +- src/shared/source-control-ai.ts | 2 +- .../source-control-launch-agent-selection.ts | 7 +- .../startup-command-staging.node-pty.test.ts | 2 +- src/shared/startup-command-staging.ts | 2 +- src/shared/startup-line-prompt-carry.test.ts | 2 +- src/shared/startup-line-prompt-carry.ts | 9 ++- ...artup-shell-portability.live-shell.test.ts | 6 +- .../structured-native-chat-launch-route.ts | 2 +- src/shared/synthetic-agent-title.ts | 2 +- src/shared/tab-agent-from-signals.ts | 2 +- src/shared/terminal-agent.ts | 3 +- .../terminal-attachment-launch-result.ts | 4 +- src/shared/terminal-git-credential-guard.ts | 2 +- src/shared/terminal-quick-command-types.ts | 2 +- src/shared/terminal-quick-commands.ts | 2 +- src/shared/terminal-tab-types.ts | 4 +- src/shared/tui-agent-rest-signal.ts | 4 +- src/shared/windows-terminal-shell.ts | 2 +- src/shared/workspace-launch-kind.ts | 2 +- src/shared/workspace-session-schema.ts | 4 +- .../workspace-session-sleeping-agents.ts | 4 +- src/shared/worktree/create-types.ts | 2 +- src/shared/worktree/launch-types.ts | 4 +- src/shared/worktree/meta-types.ts | 2 +- src/shared/worktree/types.ts | 2 +- .../zcode-orchestration-contract.test.ts | 2 +- src/wsl-guest/plugin-overlay.ts | 2 +- tests/e2e/agent-launch-cli.unit.test.ts | 2 +- .../agent-launch-setup-choice.unit.test.ts | 2 +- tests/e2e/codex-ctrl-c-status.spec.ts | 2 +- ...agent-permission-legacy-spawn.unit.test.ts | 10 +-- ...dless-automation-agent-launch.unit.test.ts | 2 +- .../helpers/fake-agent-command-override.ts | 5 +- ...agent-launch-preferences-work.unit.test.ts | 8 +-- ...ent-background-session-remote.unit.test.ts | 2 +- ...-agent-in-new-tab-web-runtime.unit.test.ts | 4 +- .../launch-agent-web-terminal.test-fixture.ts | 2 +- .../e2e/nested-agent-idle-owner.unit.test.ts | 2 +- .../omp-child-session-recovery.unit.test.ts | 4 +- tests/e2e/omp-launch-environment.spec.ts | 2 +- tests/e2e/omp-model-picker.spec.ts | 2 +- tests/e2e/omp-prefill-runtime.spec.ts | 2 +- tests/e2e/omp-title-marker.spec.ts | 2 +- tests/e2e/onboarding.spec.ts | 2 +- .../e2e/paired-cli-agent-launch.unit.test.ts | 2 +- .../prepared-action-launch.test-fixture.ts | 6 +- ...agent-background-create-owner.unit.test.ts | 4 +- ...e-control-action-phone-launch.unit.test.ts | 6 +- ...al-agent-fork-draft-ownership.unit.test.ts | 4 +- .../tools/omp-child-session-resume-smoke.mjs | 2 +- tests/tools/omp-fresh-launch-windows-smoke.ts | 2 +- .../tools/omp-fresh-session-runtime-smoke.mjs | 2 +- .../omp-picker-search-rendered/fixture.tsx | 2 +- .../omp-resume-transcript-locator-smoke.mjs | 2 +- tests/tools/omp-transcript-runtime-smoke.mjs | 2 +- 1238 files changed, 2460 insertions(+), 2319 deletions(-) delete mode 100644 src/renderer/src/lib/tui-agent-startup.ts rename src/shared/{ => agent-launch/catalog}/agent-cli-installation-problem.ts (91%) rename src/shared/{ => agent-launch/catalog}/tui-agent-config-types.ts (100%) rename src/shared/{ => agent-launch/catalog}/tui-agent-config.ts (98%) rename src/shared/{ => agent-launch/catalog}/tui-agent-detection-commands.ts (92%) rename src/shared/{ => agent-launch/catalog}/tui-agent-display-names.ts (100%) rename src/shared/{ => agent-launch/catalog}/tui-agent-favicon-domains.ts (100%) rename src/shared/{ => agent-launch/catalog}/tui-agent-selection.test.ts (100%) rename src/shared/{ => agent-launch/catalog}/tui-agent-selection.ts (98%) rename src/shared/{ => agent-launch/catalog}/tui-agent.ts (100%) rename src/shared/{ => agent-launch/choices}/agent-choice-args-analysis.ts (98%) rename src/shared/{ => agent-launch/choices}/agent-choice-args.ts (86%) rename src/shared/{ => agent-launch/choices}/agent-choice-cli-apply.test.ts (97%) rename src/shared/{ => agent-launch/choices}/agent-choice-cli-apply.ts (90%) rename src/shared/{ => agent-launch/choices}/agent-choice-layers.ts (92%) rename src/shared/{ => agent-launch/choices}/agent-choice-reconciliation.ts (95%) rename src/shared/{ => agent-launch/choices}/agent-choice-settings.ts (93%) rename src/shared/{ => agent-launch/choices}/agent-effort-level.ts (100%) rename src/shared/{ => agent-launch/choices}/agent-launch-choice-updates.ts (94%) rename src/shared/{ => agent-launch/choices}/agent-launch-choices.test.ts (98%) rename src/shared/{ => agent-launch/choices}/agent-launch-choices.ts (89%) rename src/shared/{ => agent-launch/choices}/agent-launch-default-choices.test.ts (93%) rename src/shared/{ => agent-launch/choices}/agent-launch-environment-updates.ts (91%) rename src/shared/{ => agent-launch/choices}/agent-launch-legacy-publication.test.ts (97%) rename src/shared/{ => agent-launch/choices}/agent-launch-model-preferences.ts (91%) rename src/shared/{ => agent-launch/choices}/agent-launch-permission-updates.ts (95%) rename src/shared/{ => agent-launch/choices}/agent-launch-preferences.ts (80%) rename src/shared/{ => agent-launch/choices}/agent-launch-profile.ts (92%) rename src/shared/{ => agent-launch/choices}/agent-launch-settings-auto-projection.test.ts (96%) rename src/shared/{ => agent-launch/choices}/agent-launch-settings-permissions.test.ts (89%) rename src/shared/{ => agent-launch/choices}/agent-launch-settings.ts (93%) rename src/shared/{ => agent-launch/choices}/default-agent-settings.test.ts (100%) rename src/shared/{ => agent-launch/choices}/default-agent-settings.ts (75%) rename src/shared/{ => agent-launch/choices}/tui-agent-launch-defaults.spec.ts (97%) rename src/shared/{ => agent-launch/choices}/tui-agent-launch-defaults.ts (94%) rename src/shared/{ => agent-launch/contracts}/agent-launch-intent.ts (99%) rename src/shared/{ => agent-launch/contracts}/agent-launch-operation.test.ts (96%) rename src/shared/{ => agent-launch/contracts}/agent-launch-operation.ts (93%) rename src/shared/{ => agent-launch/contracts}/agent-launch-pane-already-live.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-pane-verdict.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-replay-refusal.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-runtime-capability.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-session-already-exists.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-surface.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-tab-closed.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-launch-tab-publication.ts (97%) rename src/shared/{ => agent-launch/contracts}/agent-launch-target-forbidden.ts (100%) rename src/shared/{ => agent-launch/contracts}/agent-pane-launch-request.ts (83%) rename src/shared/{ => agent-launch/permissions}/agent-chat-permission-host-support.test.ts (100%) rename src/shared/{ => agent-launch/permissions}/agent-chat-permission-host-support.ts (92%) rename src/shared/{ => agent-launch/permissions}/agent-chat-permission-mode.test.ts (89%) rename src/shared/{ => agent-launch/permissions}/agent-chat-permission-mode.ts (91%) rename src/shared/{ => agent-launch/permissions}/agent-chat-permission-support.ts (100%) rename src/shared/{ => agent-launch/permissions}/agent-permission-args.ts (95%) rename src/shared/{ => agent-launch/permissions}/agent-permission-env.ts (100%) rename src/shared/{ => agent-launch/permissions}/agent-scoped-permission-defaults.test.ts (81%) rename src/shared/{ => agent-launch/permissions}/tui-agent-auto-permissions.test.ts (89%) rename src/shared/{ => agent-launch/permissions}/tui-agent-permission-choice.test.ts (96%) rename src/shared/{ => agent-launch/permissions}/tui-agent-permission-choice.ts (98%) rename src/shared/{ => agent-launch/permissions}/tui-agent-permission-lift.ts (95%) rename src/shared/{ => agent-launch/permissions}/tui-agent-permissions.test.ts (100%) rename src/shared/{ => agent-launch/permissions}/tui-agent-permissions.ts (98%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-arguments.ts (90%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-authority.ts (100%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-catalog.ts (85%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-defaults.ts (80%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-edits.ts (93%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-legacy-permission.test.ts (91%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-permission.ts (89%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-receipt.ts (93%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-rows.ts (92%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-search.ts (94%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker-speed.ts (91%) rename src/shared/{source-control-text-action-picker.ts => agent-launch/picker/agent-launch-picker-text-action.ts} (95%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker.test.ts (99%) rename src/shared/{ => agent-launch/picker}/agent-launch-picker.ts (91%) rename src/shared/{ => agent-launch/startup}/agent-command-line-intent.test.ts (92%) rename src/shared/{ => agent-launch/startup}/agent-command-line-intent.ts (95%) rename src/shared/{ => agent-launch/startup}/agent-command-plan.ts (92%) rename src/shared/{ => agent-launch/startup}/agent-draft-platform-limit.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-launch-account-env.ts (98%) rename src/shared/{ => agent-launch/startup}/agent-launch-remote.ts (84%) rename src/shared/{ => agent-launch/startup}/agent-launch-runtime.ts (81%) rename src/shared/{ => agent-launch/startup}/agent-overlay-env.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-prompt-injection.test.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-prompt-injection.ts (97%) rename src/shared/{ => agent-launch/startup}/agent-resume-argv-drop.spec.ts (98%) rename src/shared/{ => agent-launch/startup}/agent-resume-argv-drop.ts (97%) rename src/shared/{ => agent-launch/startup}/agent-resume-argv.ts (98%) rename src/shared/{ => agent-launch/startup}/agent-resume-launch-command.spec.ts (98%) rename src/shared/{ => agent-launch/startup}/agent-resume-launch-command.ts (98%) rename src/shared/{ => agent-launch/startup}/agent-startup-default-lifetime.test.ts (95%) rename src/shared/{ => agent-launch/startup}/agent-startup-plan-inputs-baseline-test-fixture.ts (88%) rename src/shared/{ => agent-launch/startup}/agent-startup-plan-inputs-extra-agent-args.spec.ts (97%) rename src/shared/{ => agent-launch/startup}/agent-startup-plan-inputs.spec.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-startup-plan-inputs.ts (90%) rename src/shared/{ => agent-launch/startup}/agent-startup-update-suppression.test.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-tui-command-typing.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-tui-input-clear.test.ts (100%) rename src/shared/{ => agent-launch/startup}/agent-tui-input-clear.ts (100%) rename src/shared/{ => agent-launch/startup}/automation-extra-agent-args.spec.ts (99%) rename src/shared/{ => agent-launch/startup}/automation-extra-agent-args.ts (96%) rename src/shared/{ => agent-launch/startup}/codex-startup-delivery.test.ts (100%) rename src/shared/{ => agent-launch/startup}/codex-startup-delivery.ts (93%) rename src/shared/{ => agent-launch/startup}/dsh-startup.spec.ts (92%) rename src/shared/{ => agent-launch/startup}/flag-prompt-startup.ts (81%) rename src/shared/{ => agent-launch/startup}/freebuff-launch.spec.ts (95%) rename src/shared/{ => agent-launch/startup}/freebuff-startup.spec.ts (100%) rename src/shared/{ => agent-launch/startup}/hermes-startup-query.ts (98%) rename src/shared/{ => agent-launch/startup}/hermes-startup-query.windows.test.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-draft-launch-shell.test.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-draft-launch-windows.test.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-draft-launch.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-fresh-config.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-fresh-launch-cmd.win32.test.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-fresh-launch-shell.test.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-fresh-launch.spec.ts (100%) rename src/shared/{ => agent-launch/startup}/omp-fresh-launch.ts (100%) rename src/shared/{ => agent-launch/startup}/opencode-startup-prompt.spec.ts (100%) rename src/shared/{ => agent-launch/startup}/opencode-startup-prompt.ts (89%) rename src/shared/{ => agent-launch/startup}/opencode2-resume-launch-mode.spec.ts (96%) rename src/shared/{ => agent-launch/startup}/qoder-cn-launch-recipe.spec.ts (92%) rename src/shared/{ => agent-launch/startup}/tui-agent-fork-startup.spec.ts (94%) rename src/shared/{ => agent-launch/startup}/tui-agent-launch-command-argument-values.test.ts (93%) rename src/shared/{ => agent-launch/startup}/tui-agent-launch-command-override.test.ts (100%) rename src/shared/{ => agent-launch/startup}/tui-agent-launch-command-override.ts (90%) rename src/shared/{ => agent-launch/startup}/tui-agent-launch-command-pick-flags.test.ts (100%) rename src/shared/{ => agent-launch/startup}/tui-agent-launch-command.ts (93%) rename src/shared/{ => agent-launch/startup}/tui-agent-prompt-transport.spec.ts (93%) rename src/shared/{ => agent-launch/startup}/tui-agent-resume-startup.ts (87%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-copilot-resume.spec.ts (94%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-hermes.spec.ts (97%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-kiro-resume.test.ts (100%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-script.test-fixture.ts (100%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-session-options.spec.ts (96%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-shell.spec.ts (100%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup-shell.ts (98%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup.spec.ts (97%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup.test.ts (93%) rename src/shared/{ => agent-launch/startup}/tui-agent-startup.ts (93%) rename src/shared/{ => agent-session/options}/agent-cli-flag-detection.test.ts (100%) rename src/shared/{ => agent-session/options}/agent-cli-flag-detection.ts (82%) rename src/shared/{ => agent-session/options}/agent-model-catalog-ownership.ts (100%) diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 0004f15bbb1..fffd26fd852 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -506,10 +506,10 @@ "invariant": "A literal sleep followed by && must not cause the later harness to lose hook/account preparation or hidden renderer query delivery. Preparation and typed-command hints are not live process evidence. Fresh agent startup output may request one bounded host confirmation after the initial command read window has expired.", "oracle": "Delayed OpenCode 2 installs v2 hooks rather than v1, disabled harnesses do not fall back, selected managed accounts survive, and Pi/OMP/Prime preparation targets the requested harness. A captured Claude startup title at 30 seconds yields process-confirmed routing, never title-authorized routing. A title storm causes at most three additional reads; close and untrackable providers cause none.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2" + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-launch/startup/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2" ], "testFiles": [ - "src/shared/agent-command-line-intent.test.ts", + "src/shared/agent-launch/startup/agent-command-line-intent.test.ts", "src/shared/pi-agent-kind.test.ts", "src/shared/opencode-launch-command.test.ts", "src/main/ipc/pty/host-env/opencode-hook-installation.test.ts", @@ -546,7 +546,7 @@ "result": "passed", "durationSeconds": 1.86, "summary": "214 assertions pass across nine files, including all 45 harness classifications, actual hook files, delayed account preparation, late process routing, hidden query delivery and bounded recovery.", - "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2" + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-launch/startup/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2" } ], "runtimeBudget": { @@ -14815,7 +14815,7 @@ "invariant": "A public CLI send containing non-empty text plus Enter and no interrupt identifies agent-prompt intent. The owning runtime uses bracketed-paste and settled submit only when a fresh foreground-process read positively identifies the exact target as Claude or Codex on a desktop call; every other agent, stale agent metadata over a shell, text-only input, bare Enter, interrupts, mobile input, query replies, and older clients keep the direct terminal contract.", "oracle": "Launch a bare fake Codex through the real Electron PTY and delay its composer render for 1,200 ms, beyond the legacy generic 500 ms gap. Send a 557-byte prompt with the public CLI and require the marker, zero premature Enter, no rescue Enter, and one submission. POSIX child stdin must retain one bracketed-paste frame; Windows ConPTY consumes that control frame, so runtime tests require the frame at the PTY write boundary while the Windows child requires the exact prompt. The same harness against the installed pre-fix runtime must record one premature Enter and require one bare rescue Enter. Focused units require CLI intent only for text plus Enter, settlement only for freshly identified Claude/Codex, the legacy platform delay for every other configured agent, stale Codex launch identity over a shell to fall back, no wrapper polling, and byte-for-byte direct delivery for non-targets.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/cli/handlers/terminal.test.ts src/main/runtime/rpc/terminal-agent-prompt-send.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/orca-runtime.test.ts src/shared/agent-prompt-injection.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/cli/handlers/terminal.test.ts src/main/runtime/rpc/terminal-agent-prompt-send.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/orca-runtime.test.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts", "pnpm run build:cli && pnpm exec playwright test tests/e2e/terminal-send-agent-prompt-submit.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm.cmd exec playwright test tests/e2e/terminal-send-agent-prompt-submit.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "node tests/tools/repro-terminal-send-submit.mjs --cli orca --worktree --discard-report" @@ -14825,7 +14825,7 @@ "src/main/runtime/rpc/terminal-agent-prompt-send.test.ts", "src/main/runtime/rpc/terminal-send.test.ts", "src/main/runtime/orca-runtime.test.ts", - "src/shared/agent-prompt-injection.test.ts", + "src/shared/agent-launch/startup/agent-prompt-injection.test.ts", "tests/e2e/terminal-send-agent-prompt-submit.spec.ts", "tests/tools/repro-terminal-send-submit.mjs" ], @@ -14895,6 +14895,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/cli/handlers/terminal.test.ts src/main/runtime/rpc/terminal-agent-prompt-send.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/orca-runtime.test.ts src/shared/agent-prompt-injection.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/cli/handlers/terminal.test.ts src/main/runtime/rpc/terminal-agent-prompt-send.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/orca-runtime.test.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts", "result": "passed", "durationSeconds": 23.2, "summary": "After rebasing onto current main, the final narrowed runtime/CLI/RPC suite passed 1,201 tests with one skip, including fresh Claude/Codex identity, stale-agent shell fallback, and legacy timing for every other configured agent." @@ -14958,12 +14959,12 @@ "invariant": "Injected orchestration task prompts for recognized agent CLIs must send the prompt body inside one bracketed-paste frame, sanitize embedded ESC bytes, preserve chunk boundaries without losing the frame, and submit exactly once only after the agent can accept Enter. Local worker-start with supported observation must preserve an unobserved turn as start_unknown without revoking authority, closing questions, or triggering a rescue Enter; a worker report during observation must settle normally. Claude and Codex must emit a post-paste composer marker and then settle, or reach the bounded fallback first; every other agent retains the platform delay.", "oracle": "Runtime tests assert the exact PTY write sequence, failure cleanup, Claude/Codex marker-gated multi-frame renders, and the legacy platform delay for every other configured agent. The candidate resets settlement on later frames, gives a late marker a fresh bounded window, and still submits once at the hard deadline if output never settles. The worker-start contract drives the production RPC through a delayed fake Codex composer and independently checks exact turn/Enter counts plus reopened SQLite Task, Dispatch, worker receipt, and mutation receipt state for accepted and swallowed outcomes. Other orchestration tests assert dispatch/coordinator use the agent prompt path; the live CLI harness covers long Codex-like framing.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts --reporter=dot", "node tests/tools/repro-orchestration-long-prompt.mjs --cli out/bin/orca-dev --mode codex-like --size-kb 32 --timeout-ms 20000" ], "testFiles": [ - "src/shared/agent-prompt-injection.test.ts", + "src/shared/agent-launch/startup/agent-prompt-injection.test.ts", "src/main/runtime/orca-runtime.test.ts", "src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts", "src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts", @@ -14972,7 +14973,7 @@ ], "assertionRefs": [ { - "file": "src/shared/agent-prompt-injection.test.ts", + "file": "src/shared/agent-launch/startup/agent-prompt-injection.test.ts", "assertions": [ "agent prompts are always framed as bracketed paste", "Deferred unit obligation: OMP joins submit to the paste frame while Claude, Codex and unidentified agents keep submit separate; the direct predicate table was removed. Runtime-writer coverage is unchanged.", @@ -15040,6 +15041,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", "result": "passed", "durationSeconds": 11.32, "summary": "4 files and 1,303 tests passed with one skipped. Claude and Codex both wait for post-marker quiescence, and a Codex marker arriving at 7.9 seconds receives a fresh window through its final slow frame. Exact-build live Codex workers accepted injected prompts without manual Enter, replied, called worker_done, and settled successfully in the rendered Electron UI." @@ -15049,6 +15051,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", "result": "passed", "durationSeconds": 13.3, "summary": "4 files and 1,283 tests passed. The hardened multi-frame oracle failed on the first-marker candidate because it submitted at 751 ms during an intermediate Claude frame; the quiescence candidate waited through the final 1,000 ms frame and submitted once at 2,500 ms. Continuous render output remained bounded to one fallback submit at 8 seconds. An isolated Claude Code 2.1.231 Haiku probe saw the first marker at 400 ms, continued output through 1,500 ms, sent one Enter at 3,000 ms after 1.5 seconds quiet, and created the expected marker; no Fable or Opus probe was used." @@ -15058,6 +15061,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", "result": "passed", "durationSeconds": 16.9, "summary": "4 files and 1,282 tests passed. Unmodified main wrote Enter at 500 ms before the deterministic Claude composer rendered at 750 ms; the candidate waited for the split show-cursor marker and wrote one Enter. A live Claude Code 2.1.231 Haiku trace rendered the pasted marker and show-cursor in one 523-byte frame without submitting a model request." @@ -15067,6 +15071,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-launch/startup/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts src/main/runtime/orchestration/coordinator.test.ts", "result": "passed", "durationSeconds": 7.4, "summary": "4 test files passed, 697 tests passed; covers framing, runtime PTY writes, orchestration RPC dispatch, and coordinator dispatch behavior." diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index ee0ffe34852..fbe17133186 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -11359,12 +11359,12 @@ "src/shared/__tests__/process-host/windows-tree-kill-late-taskkill.win32.test.ts": 65, "src/shared/abort-signal-reason-memory.test.ts": 80, "src/shared/abort-signal-reason.test.ts": 81, - "src/shared/agent-chat-permission-host-support.test.ts": 195, - "src/shared/agent-chat-permission-mode.test.ts": 199, + "src/shared/agent-launch/permissions/agent-chat-permission-host-support.test.ts": 195, + "src/shared/agent-launch/permissions/agent-chat-permission-mode.test.ts": 199, "src/shared/agent-child-row-model.test.ts": 84, - "src/shared/agent-cli-flag-detection.test.ts": 56, + "src/shared/agent-session/options/agent-cli-flag-detection.test.ts": 56, "src/shared/agent-cli-install-dir-fallback.test.ts": 130, - "src/shared/agent-command-line-intent.test.ts": 95, + "src/shared/agent-launch/startup/agent-command-line-intent.test.ts": 95, "src/shared/agent-decorative-title-signature.test.ts": 81, "src/shared/agent-detection.test.ts": 188, "src/shared/agent-hook-endpoint-file.test.ts": 58, @@ -11417,23 +11417,23 @@ "src/shared/agent-hook-status-cache.test.ts": 79, "src/shared/agent-hook-transport-interference.test.ts": 49, "src/shared/agent-image-paste.test.ts": 55, - "src/shared/agent-launch-choices.test.ts": 387, - "src/shared/agent-launch-default-choices.test.ts": 209, - "src/shared/agent-launch-legacy-publication.test.ts": 314, - "src/shared/agent-launch-operation.test.ts": 176, - "src/shared/agent-launch-picker-legacy-permission.test.ts": 299, - "src/shared/agent-launch-picker.test.ts": 303, - "src/shared/agent-launch-settings-auto-projection.test.ts": 219, - "src/shared/agent-launch-settings-permissions.test.ts": 199, + "src/shared/agent-launch/choices/agent-launch-choices.test.ts": 387, + "src/shared/agent-launch/choices/agent-launch-default-choices.test.ts": 209, + "src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts": 314, + "src/shared/agent-launch/contracts/agent-launch-operation.test.ts": 176, + "src/shared/agent-launch/picker/agent-launch-picker-legacy-permission.test.ts": 299, + "src/shared/agent-launch/picker/agent-launch-picker.test.ts": 303, + "src/shared/agent-launch/choices/agent-launch-settings-auto-projection.test.ts": 219, + "src/shared/agent-launch/choices/agent-launch-settings-permissions.test.ts": 199, "src/shared/agent-lead-status-fold.test.ts": 59, "src/shared/agent-pending-prompt.test.ts": 99, "src/shared/agent-process-presence-platform.test.ts": 64, "src/shared/agent-process-presence-probe.test.ts": 88, "src/shared/agent-process-recognition.test.ts": 342, - "src/shared/agent-prompt-injection.test.ts": 88, + "src/shared/agent-launch/startup/agent-prompt-injection.test.ts": 88, "src/shared/agent-row-conversation-name.test.ts": 116, "src/shared/agent-row-primary-text.test.ts": 60, - "src/shared/agent-scoped-permission-defaults.test.ts": 213, + "src/shared/agent-launch/permissions/agent-scoped-permission-defaults.test.ts": 213, "src/shared/agent-scratch-worktrees.test.ts": 61, "src/shared/agent-session-handoff-context.test.ts": 216, "src/shared/agent-session/agent-message-display-text.test.ts": 147, @@ -11497,8 +11497,8 @@ "src/shared/agent-session/view/structured-agent-session-turn-bars.test.ts": 178, "src/shared/agent-session/view/structured-agent-session-turn-timing-retention.test.ts": 221, "src/shared/agent-session/view/structured-agent-session-turn-timing.test.ts": 166, - "src/shared/agent-startup-default-lifetime.test.ts": 272, - "src/shared/agent-startup-update-suppression.test.ts": 206, + "src/shared/agent-launch/startup/agent-startup-default-lifetime.test.ts": 272, + "src/shared/agent-launch/startup/agent-startup-update-suppression.test.ts": 206, "src/shared/agent-status-child-work-admission-activity.test.ts": 232, "src/shared/agent-status-child-work-admission-collision.test.ts": 214, "src/shared/agent-status-child-work-admission-parse.test.ts": 412, @@ -11531,7 +11531,7 @@ "src/shared/agent-title-evidence.test.ts": 166, "src/shared/agent-transcript-poll-scheduler.test.ts": 113, "src/shared/agent-transitions.test.ts": 105, - "src/shared/agent-tui-input-clear.test.ts": 57, + "src/shared/agent-launch/startup/agent-tui-input-clear.test.ts": 57, "src/shared/ai-vault-resume-command.test.ts": 70, "src/shared/ai-vault-resume-target.test.ts": 85, "src/shared/ai-vault-scope-paths.test.ts": 73, @@ -11634,7 +11634,7 @@ "src/shared/codex-reset-credit-scope.test.ts": 49, "src/shared/codex-rollout-jsonl-cursor.test.ts": 231, "src/shared/codex-shared-server-command.test.ts": 76, - "src/shared/codex-startup-delivery.test.ts": 76, + "src/shared/agent-launch/startup/codex-startup-delivery.test.ts": 76, "src/shared/codex-status-transcript-line.test.ts": 78, "src/shared/codex-subagent-poll-scheduler.test.ts": 52, "src/shared/codex-subagent-rollout-lifecycle.test.ts": 239, @@ -11670,7 +11670,7 @@ "src/shared/darwin-terminal-names-real-ps.test.ts": 42, "src/shared/darwin-terminal-names.test.ts": 267, "src/shared/darwin-terminal-naming-single-flight.test.ts": 69, - "src/shared/default-agent-settings.test.ts": 31, + "src/shared/agent-launch/choices/default-agent-settings.test.ts": 31, "src/shared/device-key-proof.test.ts": 112, "src/shared/dictation-audio-meter.test.ts": 49, "src/shared/dictation-transcript-spacing.test.ts": 48, @@ -11802,7 +11802,7 @@ "src/shared/hard-wrapped-terminal-http-links.test.ts": 91, "src/shared/harness-injected-user-turns.test.ts": 43, "src/shared/headless-serve-ozone-platform.test.ts": 44, - "src/shared/hermes-startup-query.windows.test.ts": 43, + "src/shared/agent-launch/startup/hermes-startup-query.windows.test.ts": 43, "src/shared/home-or-filesystem-root.test.ts": 54, "src/shared/hook-command-source-policy.test.ts": 43, "src/shared/host-authority.test.ts": 47, @@ -11994,10 +11994,10 @@ "src/shared/notebook-venv-location.test.ts": 50, "src/shared/nul-delimited-fields.test.ts": 37, "src/shared/nvm-default-alias.test.ts": 81, - "src/shared/omp-draft-launch-shell.test.ts": 382, - "src/shared/omp-draft-launch-windows.test.ts": 270, - "src/shared/omp-fresh-launch-cmd.win32.test.ts": 286, - "src/shared/omp-fresh-launch-shell.test.ts": 301, + "src/shared/agent-launch/startup/omp-draft-launch-shell.test.ts": 382, + "src/shared/agent-launch/startup/omp-draft-launch-windows.test.ts": 270, + "src/shared/agent-launch/startup/omp-fresh-launch-cmd.win32.test.ts": 286, + "src/shared/agent-launch/startup/omp-fresh-launch-shell.test.ts": 301, "src/shared/omp-owner-state-title.test.ts": 96, "src/shared/omp-pi-semantic-title-preservation.test.ts": 123, "src/shared/open-in-applications.test.ts": 48, @@ -12462,15 +12462,15 @@ "src/shared/tmux-client-attachment.test.ts": 50, "src/shared/tmux-hook-refresh-retirement.test.ts": 608, "src/shared/tmux-host-attachment-probe.test.ts": 69, - "src/shared/tui-agent-auto-permissions.test.ts": 293, - "src/shared/tui-agent-launch-command-argument-values.test.ts": 266, - "src/shared/tui-agent-launch-command-override.test.ts": 63, - "src/shared/tui-agent-launch-command-pick-flags.test.ts": 242, - "src/shared/tui-agent-permission-choice.test.ts": 1009, - "src/shared/tui-agent-permissions.test.ts": 42, - "src/shared/tui-agent-selection.test.ts": 47, - "src/shared/tui-agent-startup-kiro-resume.test.ts": 205, - "src/shared/tui-agent-startup.test.ts": 636, + "src/shared/agent-launch/permissions/tui-agent-auto-permissions.test.ts": 293, + "src/shared/agent-launch/startup/tui-agent-launch-command-argument-values.test.ts": 266, + "src/shared/agent-launch/startup/tui-agent-launch-command-override.test.ts": 63, + "src/shared/agent-launch/startup/tui-agent-launch-command-pick-flags.test.ts": 242, + "src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts": 1009, + "src/shared/agent-launch/permissions/tui-agent-permissions.test.ts": 42, + "src/shared/agent-launch/catalog/tui-agent-selection.test.ts": 47, + "src/shared/agent-launch/startup/tui-agent-startup-kiro-resume.test.ts": 205, + "src/shared/agent-launch/startup/tui-agent-startup.test.ts": 636, "src/shared/ui-locale.test.ts": 68, "src/shared/updated-at-order.test.ts": 81, "src/shared/usage-percentage-display-change-notice.test.ts": 35, diff --git a/config/scripts/pr-code-change-scope.mjs b/config/scripts/pr-code-change-scope.mjs index ab2787af96a..fa078e7182b 100644 --- a/config/scripts/pr-code-change-scope.mjs +++ b/config/scripts/pr-code-change-scope.mjs @@ -193,7 +193,7 @@ const CROSS_VERSION_WIRE_PREFIXES = [ 'src/main/runtime/rpc/ws-transport.ts', 'src/shared/web-origin-security.ts', 'src/shared/browser-client-host-placement', - 'src/shared/agent-launch-intent', + 'src/shared/agent-launch/contracts/agent-launch-intent', 'src/shared/rpc-contract/agent-launch-params', 'src/shared/agent-session/agent-session-wire', 'src/shared/agent-session/view/structured-agent-session-projection.test.ts', diff --git a/config/scripts/pr-package-test-paths.mjs b/config/scripts/pr-package-test-paths.mjs index 6ba00edfbf4..688fa827f18 100644 --- a/config/scripts/pr-package-test-paths.mjs +++ b/config/scripts/pr-package-test-paths.mjs @@ -56,7 +56,7 @@ export const WINDOWS_BOUNDARY_TESTS = [ 'src/shared/__tests__/process-host/windows-cmd-shim-resolution.test.ts', 'src/shared/__tests__/process-host/windows-cmd-shim-resolution.win32.test.ts', 'src/shared/__tests__/process-host/windows-tree-kill-late-taskkill.win32.test.ts', - 'src/shared/omp-fresh-launch-cmd.win32.test.ts', + 'src/shared/agent-launch/startup/omp-fresh-launch-cmd.win32.test.ts', 'src/shared/windows-batch-spawn.win32.test.ts', 'src/main/agent-hooks/windows-hook-payload-delivery.test.ts', 'src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts', diff --git a/config/vitest.performance.config.ts b/config/vitest.performance.config.ts index 1e9cb0a8302..f8aa4be9e80 100644 --- a/config/vitest.performance.config.ts +++ b/config/vitest.performance.config.ts @@ -10,7 +10,7 @@ const contracts = [ 'src/main/ipc/pty/runtime/spawn-preflight-saved-resume.test.ts', 'src/main/native-chat/agent-session-wire/structured-agent-session-terminal-writer-acquire.test.ts', 'src/main/runtime/hook-status-resume-sleep-ordering.test.ts', - 'src/shared/tui-agent-permission-choice.test.ts', + 'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts', 'src/renderer/src/components/settings/agents/permissions/agent-permission-conversion-persistence.test.tsx', 'src/main/runtime/rpc/methods/repo.test.ts', 'src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx', diff --git a/docs/bug-reproductions/delayed-agent-launch.md b/docs/bug-reproductions/delayed-agent-launch.md index e26ce2e63e1..79f3e977728 100644 --- a/docs/bug-reproductions/delayed-agent-launch.md +++ b/docs/bug-reproductions/delayed-agent-launch.md @@ -47,7 +47,7 @@ precedence. Process-table command recognition still treats the waiting shell as a shell. Callers use shared launch-token and launch-recognition APIs. Prefix handling is -contained in `src/shared/agent-command-line-intent.ts`; the setup-sequence resolver +contained in `src/shared/agent-launch/startup/agent-command-line-intent.ts`; the setup-sequence resolver continues to return its supplied command. Launch recognition reuses the existing agent registry and headless filters without changing strict process recognition. diff --git a/mobile/src/automations/automation-draft.ts b/mobile/src/automations/automation-draft.ts index d9bf5a2b1ce..2bf7442aeb7 100644 --- a/mobile/src/automations/automation-draft.ts +++ b/mobile/src/automations/automation-draft.ts @@ -1,6 +1,6 @@ import { translate } from '../i18n/mobile-i18n' import { assertAutomationExtraAgentArgs } from '../../../src/shared/automation-extra-agent-args-record' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' import type { RpcSendParams } from '../transport/rpc-params-contract' import type { MobileAutomation } from './automation-reply-schema' import type { AutomationTargets } from './automation-target-inventory' diff --git a/mobile/src/automations/automation-operations.ts b/mobile/src/automations/automation-operations.ts index 81c749ba3b3..34f15ea7192 100644 --- a/mobile/src/automations/automation-operations.ts +++ b/mobile/src/automations/automation-operations.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc-operation' import { rpcResultVariant } from '../transport/rpc-operation-result-reader' import { salvagedOptional } from '../../../src/shared/zod-salvage' diff --git a/mobile/src/components/MobileDiffReviewRangeSheet.tsx b/mobile/src/components/MobileDiffReviewRangeSheet.tsx index de1f769f812..cfd5d1c1435 100644 --- a/mobile/src/components/MobileDiffReviewRangeSheet.tsx +++ b/mobile/src/components/MobileDiffReviewRangeSheet.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { KeyboardAvoidingView, Pressable, Text, View } from 'react-native' import { Sparkles } from 'lucide-react-native' import { getRuntimePathBasename } from '../../../src/shared/cross-platform-path' -import { tuiAgentDisplayName } from '../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { hostOs } from '../platform/host-os' import { canCommentOnGitHub } from '../session/mobile-diff-review-github' diff --git a/mobile/src/components/mobile-agent-icon-assets.ts b/mobile/src/components/mobile-agent-icon-assets.ts index 058e2316d4d..87da7702bc5 100644 --- a/mobile/src/components/mobile-agent-icon-assets.ts +++ b/mobile/src/components/mobile-agent-icon-assets.ts @@ -1,5 +1,5 @@ import type { ImageSourcePropType } from 'react-native' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' // Bundle desktop-shared favicons for offline/regional access (#8451), via Metro’s src/shared watch. // Keep literal require paths: Metro cannot resolve dynamic agent-id asset paths. diff --git a/mobile/src/components/new-worktree-agent-selection.ts b/mobile/src/components/new-worktree-agent-selection.ts index a761dcf23e9..75eea27555c 100644 --- a/mobile/src/components/new-worktree-agent-selection.ts +++ b/mobile/src/components/new-worktree-agent-selection.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { translate } from '../i18n/mobile-i18n' import { MOBILE_AGENT_CATALOG } from '../tasks/mobile-agent-catalog' import { isMobileTuiAgentEnabled } from '../tasks/mobile-tui-agents' diff --git a/mobile/src/session/MobileSessionCommandDock.tsx b/mobile/src/session/MobileSessionCommandDock.tsx index ad3081449cf..30e5830dc44 100644 --- a/mobile/src/session/MobileSessionCommandDock.tsx +++ b/mobile/src/session/MobileSessionCommandDock.tsx @@ -1,5 +1,5 @@ import { View } from 'react-native' -import { tuiAgentDisplayName } from '../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { hostOs } from '../platform/host-os' import { ComposerSendButton } from '../components/composer-input/ComposerSendButton' import { MessageBox } from '../components/composer-input/MessageBox' diff --git a/mobile/src/session/QuickCommandsList.tsx b/mobile/src/session/QuickCommandsList.tsx index 403407e6364..e4f4a726b38 100644 --- a/mobile/src/session/QuickCommandsList.tsx +++ b/mobile/src/session/QuickCommandsList.tsx @@ -7,7 +7,7 @@ import { MobileAgentIcon } from '../components/MobileAgentIcon' import { TextField } from '../components/composer-input/TextField' import { MOBILE_AGENT_CATALOG } from '../tasks/mobile-agent-catalog' import type { TerminalQuickCommand } from '../../../src/shared/terminal-quick-command-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { supportsTerminalAgentQuickCommand } from '../terminal/quick-commands' import { QuickCommandRow } from './QuickCommandRow' import { useMobileTranslation } from '../i18n/use-mobile-translation' diff --git a/mobile/src/session/agent-send-keyboard-dismissal.ts b/mobile/src/session/agent-send-keyboard-dismissal.ts index f52b77f371d..a61ed04c9a3 100644 --- a/mobile/src/session/agent-send-keyboard-dismissal.ts +++ b/mobile/src/session/agent-send-keyboard-dismissal.ts @@ -1,5 +1,5 @@ import type { AgentStatusEntry } from '../../../src/shared/agent-status-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { isMobileTerminalTabRunningAgent } from './mobile-terminal-tab-agent' export type AgentSendKeyboardDismissalTab = { diff --git a/mobile/src/session/ai-vault-resume-launch.ts b/mobile/src/session/ai-vault-resume-launch.ts index 38055ed6595..90bc7069165 100644 --- a/mobile/src/session/ai-vault-resume-launch.ts +++ b/mobile/src/session/ai-vault-resume-launch.ts @@ -11,8 +11,8 @@ import { buildAiVaultRemoteResumeStartup, resolveAiVaultResumeHostShell } from '../../../src/shared/ai-vault-resume-host-startup' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { parseWslUncPath } from '../../../src/shared/wsl-paths' import { resolveWindowsShellStartupFamily } from '../../../src/shared/windows-terminal-shell' import { RESUME_RPC_TIMEOUT_MS } from './ai-vault-resume-preparation' diff --git a/mobile/src/session/mobile-existing-agent-launch.ts b/mobile/src/session/mobile-existing-agent-launch.ts index d936bc58c94..d798ebbe465 100644 --- a/mobile/src/session/mobile-existing-agent-launch.ts +++ b/mobile/src/session/mobile-existing-agent-launch.ts @@ -3,24 +3,24 @@ import { AGENT_LAUNCH_CHAT_OPTIONS_RUNTIME_CAPABILITY, AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import type { AgentLaunchPlacement, AgentLaunchPrompt, AgentLaunchResult -} from '../../../src/shared/agent-launch-intent' +} from '../../../src/shared/agent-launch/contracts/agent-launch-intent' import { isStructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' -import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../src/shared/agent-launch-tab-closed' +import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../src/shared/agent-launch/contracts/agent-launch-tab-closed' import { makePaneKey } from '../../../src/shared/stable-pane-id' import { createStructuredAgentSessionId } from '../../../src/shared/agent-session/structured-agent-session-create' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc-client' import { agentLaunchReplayRun } from '../tasks/mobile-workspace-create-operations' import { agentLaunchExistingParams, readAgentLaunchSupport } from '../tasks/agent-launch-request' import { classifyAgentLaunchReplayRefusal, isAgentLaunchReservationTakenRefusal -} from '../../../src/shared/agent-launch-replay-refusal' +} from '../../../src/shared/agent-launch/contracts/agent-launch-replay-refusal' import { sendReplayingAmbiguousDelivery } from '../tasks/replay-on-ambiguous-delivery' import { structuredSessionOperationId } from './structured-session-operation-id' import { randomV4Uuid } from '../platform/random-v4-uuid' diff --git a/mobile/src/session/mobile-image-live-input-order.test.tsx b/mobile/src/session/mobile-image-live-input-order.test.tsx index f6315b3a85d..8e8853648bf 100644 --- a/mobile/src/session/mobile-image-live-input-order.test.tsx +++ b/mobile/src/session/mobile-image-live-input-order.test.tsx @@ -2,7 +2,7 @@ import { terminalInputSend } from '../terminal/mobile-terminal-operations' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc-client' import type { RpcResponse } from '../transport/types' import type { TerminalLiveInputSender } from '../terminal/terminal-live-input-sender' diff --git a/mobile/src/session/mobile-new-tab-agent-options.ts b/mobile/src/session/mobile-new-tab-agent-options.ts index 82e06bd8f30..e76c473cbec 100644 --- a/mobile/src/session/mobile-new-tab-agent-options.ts +++ b/mobile/src/session/mobile-new-tab-agent-options.ts @@ -1,10 +1,8 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { - filterEnabledMobileTuiAgents, - isMobileTuiAgent, - MOBILE_TUI_AGENT_AUTO_PICK_ORDER, - MOBILE_TUI_AGENT_LABELS -} from '../tasks/mobile-tui-agents' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { filterEnabledMobileTuiAgents } from '../tasks/mobile-tui-agents' +import { isTuiAgent as isMobileTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' +import { TUI_AGENT_AUTO_PICK_ORDER as MOBILE_TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' +import { TUI_AGENT_DISPLAY_NAMES as MOBILE_TUI_AGENT_LABELS } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' export type MobileNewTabAgentSettings = { defaultTuiAgent?: TuiAgent | 'blank' | null diff --git a/mobile/src/session/mobile-session-route-types.ts b/mobile/src/session/mobile-session-route-types.ts index f8fab601a50..94ca9457849 100644 --- a/mobile/src/session/mobile-session-route-types.ts +++ b/mobile/src/session/mobile-session-route-types.ts @@ -1,7 +1,7 @@ import type { MobileFileMedia } from '../files/mobile-file-media' import type { StructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' import type { DiffComment } from '../../../src/shared/diff-comment-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { AgentStatusEntry } from '../../../src/shared/agent-status-types' import type { RuntimeMobileSessionAgentTabStatus, diff --git a/mobile/src/session/mobile-session-tab-card-content.ts b/mobile/src/session/mobile-session-tab-card-content.ts index e350b10544c..8f3a6c0c46d 100644 --- a/mobile/src/session/mobile-session-tab-card-content.ts +++ b/mobile/src/session/mobile-session-tab-card-content.ts @@ -1,7 +1,7 @@ import { stripLeadingAgentTitleDecoration } from '../../../src/shared/agent-title-decoration' import { redactKagiSessionToken } from '../../../src/shared/browser-url' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/tui-agent-display-names' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' import { isBlankBrowserUrl } from '../browser/browser-url' import { translate } from '../i18n/mobile-i18n' import { agentDotState, type AgentDotState } from '../worktree/agent-row-display' diff --git a/mobile/src/session/mobile-source-control-launch-agent.ts b/mobile/src/session/mobile-source-control-launch-agent.ts index 2dd826fd012..a9641ad699a 100644 --- a/mobile/src/session/mobile-source-control-launch-agent.ts +++ b/mobile/src/session/mobile-source-control-launch-agent.ts @@ -9,9 +9,9 @@ import { pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId } from '../../../src/shared/source-control-launch-agent-selection' -import { filterEnabledTuiAgents } from '../../../src/shared/tui-agent-selection' -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { isMobileTuiAgent } from '../tasks/mobile-tui-agents' +import { filterEnabledTuiAgents } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { isTuiAgent as isMobileTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' import { translate } from '../i18n/mobile-i18n' import type { MobileAgentLaunchContext } from './mobile-new-tab-agent-loader' diff --git a/mobile/src/session/mobile-structured-agent-session-launch.ts b/mobile/src/session/mobile-structured-agent-session-launch.ts index 895291b6e0d..a354f53e14c 100644 --- a/mobile/src/session/mobile-structured-agent-session-launch.ts +++ b/mobile/src/session/mobile-structured-agent-session-launch.ts @@ -9,7 +9,7 @@ import { structuredAgentSessionCreateParams, type StructuredAgentSessionCreateParams } from '../../../src/shared/agent-session/structured-agent-session-create' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { hasRuntimeRpcErrorCode } from '../../../src/shared/runtime-rpc-error-code' import type { RpcClient } from '../transport/rpc-client' import { diff --git a/mobile/src/session/mobile-terminal-tab-agent.test.ts b/mobile/src/session/mobile-terminal-tab-agent.test.ts index 0310e7d8a4e..b4294c8bcc5 100644 --- a/mobile/src/session/mobile-terminal-tab-agent.test.ts +++ b/mobile/src/session/mobile-terminal-tab-agent.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { createTerminalTitleTracker } from '../../../src/shared/terminal-output-side-effects' import type { AgentStatusEntry } from '../../../src/shared/agent-status-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { MobileSessionTab } from './mobile-session-route-types' import { getMobileSessionTabTitle, diff --git a/mobile/src/session/mobile-terminal-tab-agent.ts b/mobile/src/session/mobile-terminal-tab-agent.ts index 6fa6b0abf4d..2af239734b2 100644 --- a/mobile/src/session/mobile-terminal-tab-agent.ts +++ b/mobile/src/session/mobile-terminal-tab-agent.ts @@ -4,7 +4,7 @@ import { isShellProcess } from '../../../src/shared/shell-process-detection' import { agentTypeToIconAgent } from '../../../src/shared/agent-type-icon-agent' import { resolveTabAgentFromSignalSnapshot } from '../../../src/shared/tab-agent-from-signals' import type { AgentStatusEntry } from '../../../src/shared/agent-status-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { isBlankBrowserUrl } from '../browser/browser-url' import { translate } from '../i18n/mobile-i18n' import type { MobileSessionTab } from './mobile-session-route-types' diff --git a/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx b/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx index fcb0a49b63c..0e45d3ddc5d 100644 --- a/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx +++ b/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx @@ -17,7 +17,7 @@ import { } from './transcript/mobile-native-chat-reply-reveals' import { MobileNativeChatRowOverlaysHost } from './transcript/MobileNativeChatRowOverlaysHost' import { nativeChatAskRequiresTerminal } from '../../../../src/shared/native-chat/native-chat-agent-support' -import { tuiAgentDisplayName } from '../../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { MobileNativeChatNoticeContext } from '../mobile-native-chat-notice-context' import type { MobileNativeChatImageSource } from './visual/mobile-native-chat-image-preview' diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.test.ts index 654990aa4ba..9d5e43ecc5c 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.test.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest' import type { RpcClient } from '../../../transport/rpc-client' import type { RpcResponse, RpcSuccess } from '../../../transport/types' import { pasteMobileNativeChatImagePaths } from './mobile-native-chat-image-send' -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' function sendResult(accepted: boolean, id = 'send'): RpcSuccess { return { id, ok: true, result: { send: { accepted } }, _meta: { runtimeId: 'r' } } diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts index 9553a6613ce..6c40c4f5089 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts @@ -1,7 +1,7 @@ import { resetMobileNativeChatDraftInputsForTests } from './mobile-native-chat-draft-inputs' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { RpcClient } from '../../../transport/rpc-client' import type { RpcResponse, RpcSuccess } from '../../../transport/types' diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx index d8d3d9cd200..559941f3332 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx @@ -46,7 +46,7 @@ import { AGENT_CHAT_PERMISSION_MODE_ICON_NAMES, AGENT_CHAT_PERMISSION_MODE_OPTION_ID, isAgentChatPermissionMode -} from '../../../../../src/shared/agent-chat-permission-mode' +} from '../../../../../src/shared/agent-launch/permissions/agent-chat-permission-mode' import type { MobileNativeChatSessionOptionsController } from './use-mobile-native-chat-session-options' import { sessionOptionPickerStyles as styles } from './mobile-native-chat-session-option-picker-styles' diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts index 154510ddf43..6816c04fb7b 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/mobile/src/session/native-chat/mobile-native-chat-cli-fork.ts b/mobile/src/session/native-chat/mobile-native-chat-cli-fork.ts index 6c24c0f8e29..13e10120b6a 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-cli-fork.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-cli-fork.ts @@ -2,7 +2,7 @@ import { SquareTerminal } from 'lucide-react-native' import type { ActionSheetAction } from '../../components/ActionSheetModal' import { translate } from '../../i18n/mobile-i18n' import type { MobileSessionController } from '../use-mobile-session-controller' -import { agentForksConversations } from '../../../../src/shared/agent-resume-argv' +import { agentForksConversations } from '../../../../src/shared/agent-launch/startup/agent-resume-argv' import { SESSION_TABS_CHAT_FORK_CLI_RUNTIME_CAPABILITY } from '../../../../src/shared/session-tabs-runtime-capabilities' export function canOfferMobileNativeChatCliFork(args: { diff --git a/mobile/src/session/native-chat/mobile-native-chat-merged-snapshot-parity.test.ts b/mobile/src/session/native-chat/mobile-native-chat-merged-snapshot-parity.test.ts index e83b3430aa2..fd57d0c8972 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-merged-snapshot-parity.test.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-merged-snapshot-parity.test.ts @@ -17,7 +17,7 @@ import { type StructuredAgentSessionState } from '../../../../src/shared/agent-session/structured-agent-session-reducer' import { selectStructuredAgentTurnBars } from '../../../../src/shared/agent-session/view/structured-agent-session-turn-timing' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../../src/shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { buildMobileNativeChatTransientData, foldMobileNativeChatMessages diff --git a/mobile/src/session/native-chat/mobile-native-chat-send.test.ts b/mobile/src/session/native-chat/mobile-native-chat-send.test.ts index db911323ea8..31180bd0fb6 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-send.test.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-send.test.ts @@ -11,7 +11,7 @@ import { sendMobileNativeChatMessageWithOutcome, typeMobileNativeChatCommandWithOutcome } from './mobile-native-chat-send' -import { buildAgentTuiClearInputForText } from '../../../../src/shared/agent-tui-input-clear' +import { buildAgentTuiClearInputForText } from '../../../../src/shared/agent-launch/startup/agent-tui-input-clear' afterEach(() => vi.useRealTimers()) diff --git a/mobile/src/session/native-chat/mobile-native-chat-send.ts b/mobile/src/session/native-chat/mobile-native-chat-send.ts index 0f7da04f290..72b26d0bd7d 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-send.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-send.ts @@ -2,13 +2,13 @@ import type { RpcClient } from '../../transport/rpc-client' import { isRpcDeliveryUnknown } from '../../transport/rpc-delivery-ambiguity' import { isLogicalClientCutoverError } from '../../transport/stable-logical-rpc-client' import { nativeChatTerminalWrite } from '../mobile-session-write-operations' -import { typeAgentTuiCommand } from '../../../../src/shared/agent-tui-command-typing' +import { typeAgentTuiCommand } from '../../../../src/shared/agent-launch/startup/agent-tui-command-typing' import { readTerminalSendAcknowledgment } from '../../../../src/shared/terminal-send-acknowledgment' import { AGENT_TUI_CLEAR_MAX_LINES, countAgentTuiInputLines, buildAgentTuiClearInputForText -} from '../../../../src/shared/agent-tui-input-clear' +} from '../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { nativeChatTerminalDraftRead } from '../mobile-session-read-operations' export type MobileNativeChatRpcSender = Parameters[0] diff --git a/mobile/src/session/native-chat/mobile-native-chat-stale-input.test.ts b/mobile/src/session/native-chat/mobile-native-chat-stale-input.test.ts index 00a0480fe36..af8adaa7b56 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-stale-input.test.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-stale-input.test.ts @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { RpcClient } from '../../transport/rpc-client' import { diff --git a/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts b/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts index 59f6f17357c..fb40c24539c 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts @@ -4,7 +4,7 @@ import { agentSessionVisibleFailureFacts } from '../../../../src/shared/agent-se import type { NativeChatTurnJournal } from '../../../../src/shared/native-chat/transcript/native-chat-turn-membership' import { dispatchWasWithdrawn } from '../../../../src/shared/agent-session/requests/structured-agent-session-dispatch-rejection' import { structuredAgentSessionRecordedRejectionParts } from '../../../../src/shared/agent-session/failures/structured-agent-session-rejection-words' -import { tuiAgentDisplayName } from '../../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../../src/shared/agent-launch/catalog/tui-agent-display-names' const NO_NOTICES: ReadonlyMap = new Map() diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts index 2f3cc01887d..760584fdcb7 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts @@ -23,7 +23,7 @@ vi.mock('../mobile-native-chat-stale-input', () => ({ import { useMobileNativeChatMessageSend } from './use-mobile-native-chat-message-send' import { resetMobileNativeChatTerminalWritesForTests } from '../mobile-native-chat-terminal-write-lock' -import { buildAgentTuiClearInputForText } from '../../../../../src/shared/agent-tui-input-clear' +import { buildAgentTuiClearInputForText } from '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' type Send = ReturnType diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts b/mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts index 608385362ae..cd2b7e0ab0b 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { mobileNativeChatDraftDestination } from './composer/mobile-native-chat-draft-inputs' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' diff --git a/mobile/src/session/new-tab-agent-host-launch.ts b/mobile/src/session/new-tab-agent-host-launch.ts index fdcf3bbe9db..9bf3bf570c8 100644 --- a/mobile/src/session/new-tab-agent-host-launch.ts +++ b/mobile/src/session/new-tab-agent-host-launch.ts @@ -1,7 +1,7 @@ import type { MobileQuickCommandLaunch } from '../terminal/quick-commands' import type { MobileSessionTab } from './mobile-session-route-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { AGENT_LAUNCH_PLACEMENT_RUNTIME_CAPABILITY } from '../../../src/shared/agent-launch-runtime-capability' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { AGENT_LAUNCH_PLACEMENT_RUNTIME_CAPABILITY } from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import type { RpcClient } from '../transport/rpc-client' import { triggerError, triggerSuccess } from '../platform/haptics' import { diff --git a/mobile/src/session/pr-ai-triage-launch.test.ts b/mobile/src/session/pr-ai-triage-launch.test.ts index a9c4d8d9493..508d17ac9cc 100644 --- a/mobile/src/session/pr-ai-triage-launch.test.ts +++ b/mobile/src/session/pr-ai-triage-launch.test.ts @@ -5,9 +5,9 @@ import { getDefaultSourceControlAiSettings, resolveSourceControlActionRecipe } from '../../../src/shared/source-control-ai' -import { buildAgentStartupPlan } from '../../../src/shared/tui-agent-startup' -import { resolveAgentStartupPlanInputs } from '../../../src/shared/agent-startup-plan-inputs' -import { toAgentLaunchPreferences } from '../../../src/shared/agent-launch-preferences' +import { buildAgentStartupPlan } from '../../../src/shared/agent-launch/startup/tui-agent-startup' +import { resolveAgentStartupPlanInputs } from '../../../src/shared/agent-launch/startup/agent-startup-plan-inputs' +import { toAgentLaunchPreferences } from '../../../src/shared/agent-launch/choices/agent-launch-preferences' import { AgentLaunchReplay } from '../../../src/shared/rpc-contract/agent-launch-params' import { AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } from './mobile-existing-agent-launch' import { diff --git a/mobile/src/session/quick-command-draft.ts b/mobile/src/session/quick-command-draft.ts index 052cebcae33..bc51029eba8 100644 --- a/mobile/src/session/quick-command-draft.ts +++ b/mobile/src/session/quick-command-draft.ts @@ -3,7 +3,7 @@ import type { TerminalQuickCommandAction, TerminalQuickCommandScope } from '../../../src/shared/terminal-quick-command-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { getTerminalQuickCommandBodySize, isAgentQuickCommand, diff --git a/mobile/src/session/review-terminal-reply-schema.ts b/mobile/src/session/review-terminal-reply-schema.ts index 10858270578..57892dc893f 100644 --- a/mobile/src/session/review-terminal-reply-schema.ts +++ b/mobile/src/session/review-terminal-reply-schema.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import { salvagedOptional, salvagingArray } from '../../../src/shared/zod-salvage' import { AGENT_STATUS_STATES } from '../../../src/shared/agent-status-types' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' import { isMobileTerminalTabRunningAgent, resolveMobileTerminalTabOwnedAgentId diff --git a/mobile/src/session/use-mobile-diff-review-send-actions.test.ts b/mobile/src/session/use-mobile-diff-review-send-actions.test.ts index 3c4923be942..21008bf68af 100644 --- a/mobile/src/session/use-mobile-diff-review-send-actions.test.ts +++ b/mobile/src/session/use-mobile-diff-review-send-actions.test.ts @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest' diff --git a/mobile/src/session/use-mobile-launch-agent-label.ts b/mobile/src/session/use-mobile-launch-agent-label.ts index 84fc2b2883e..c464e399109 100644 --- a/mobile/src/session/use-mobile-launch-agent-label.ts +++ b/mobile/src/session/use-mobile-launch-agent-label.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import type { SourceControlLaunchActionId } from '../../../src/shared/source-control-ai-actions' import type { RpcClient } from '../transport/rpc-client' -import { MOBILE_TUI_AGENT_LABELS } from '../tasks/mobile-tui-agents' +import { TUI_AGENT_DISPLAY_NAMES as MOBILE_TUI_AGENT_LABELS } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { hostRefusesOtherRuntimeWorkspace, loadMobileAgentLaunchContext diff --git a/mobile/src/session/use-mobile-session-image-attachments.test.tsx b/mobile/src/session/use-mobile-session-image-attachments.test.tsx index fddd7742ed0..17367d7ca28 100644 --- a/mobile/src/session/use-mobile-session-image-attachments.test.tsx +++ b/mobile/src/session/use-mobile-session-image-attachments.test.tsx @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../src/shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { createElement } from 'react' import { resetMobileNativeChatDraftInputsForTests } from './native-chat/composer/mobile-native-chat-draft-inputs' import { act, create, type ReactTestRenderer } from 'react-test-renderer' diff --git a/mobile/src/session/use-mobile-session-terminal-create-agent-launch.test.ts b/mobile/src/session/use-mobile-session-terminal-create-agent-launch.test.ts index 4de5cb2e148..f446c6a6436 100644 --- a/mobile/src/session/use-mobile-session-terminal-create-agent-launch.test.ts +++ b/mobile/src/session/use-mobile-session-terminal-create-agent-launch.test.ts @@ -1,11 +1,11 @@ import { createElement } from 'react' -import { AGENT_LAUNCH_PLACEMENT_RUNTIME_CAPABILITY } from '../../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_PLACEMENT_RUNTIME_CAPABILITY } from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' import type { AgentLaunchOutcome, AgentLaunchPromptReceipt -} from '../../../src/shared/agent-launch-intent' +} from '../../../src/shared/agent-launch/contracts/agent-launch-intent' import { parsePaneKey } from '../../../src/shared/stable-pane-id' import type { RpcClient } from '../transport/rpc-client' import { markRpcDeliveryUnknown } from '../transport/rpc-delivery-ambiguity' diff --git a/mobile/src/session/use-mobile-structured-agent-options.ts b/mobile/src/session/use-mobile-structured-agent-options.ts index 8a4bc63cdcd..92a7ec361e3 100644 --- a/mobile/src/session/use-mobile-structured-agent-options.ts +++ b/mobile/src/session/use-mobile-structured-agent-options.ts @@ -10,7 +10,7 @@ import { structuredAgentSessionMessageSelection, structuredAgentSessionShownSnapshot } from '../../../src/shared/agent-session/options/structured-agent-session-option-view' -import { agentChatPermissionModes } from '../../../src/shared/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../src/shared/agent-launch/permissions/agent-chat-permission-support' import { legacyHostPermissionDescriptor } from '../../../src/shared/agent-session/options/structured-agent-session-permission-option' import type { RpcClient } from '../transport/rpc-client' import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' diff --git a/mobile/src/session/use-mobile-structured-agent-session.ts b/mobile/src/session/use-mobile-structured-agent-session.ts index 4b289a35d08..9937c0bbcfb 100644 --- a/mobile/src/session/use-mobile-structured-agent-session.ts +++ b/mobile/src/session/use-mobile-structured-agent-session.ts @@ -6,7 +6,7 @@ import { createStructuredQuestionProjection } from '../../../src/shared/structur import { projectStructuredAgentStartItem } from '../../../src/shared/structured-agent-start-projection' import { withNativeChatCutTurnNotices } from '../../../src/shared/native-chat/transcript/native-chat-cut-turn-notice' import { agentSessionTranscriptRows } from '../../../src/shared/agent-session/agent-session-context-clear' -import { tuiAgentDisplayName } from '../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { mobileStructuredAgentSessionWorking } from './mobile-structured-agent-session-working' import { isFinalAgentSessionReadRefusal } from '../../../src/shared/agent-session/failures/structured-agent-session-read-refusal' import { diff --git a/mobile/src/session/use-mobile-structured-option-state.ts b/mobile/src/session/use-mobile-structured-option-state.ts index fde87484342..82966550c26 100644 --- a/mobile/src/session/use-mobile-structured-option-state.ts +++ b/mobile/src/session/use-mobile-structured-option-state.ts @@ -9,7 +9,7 @@ import { createStructuredAgentSessionOptionsReadOwner } from '../../../src/share import { BoundedMap } from '../../../src/shared/bounded-map' import type { RpcClient } from '../transport/rpc-client' import type { AgentSessionOptionCatalog } from '../../../src/shared/agent-session/options/agent-session-option-catalog-types' -import { usesInstalledAgentModelCatalog } from '../../../src/shared/agent-model-catalog-ownership' +import { usesInstalledAgentModelCatalog } from '../../../src/shared/agent-session/options/agent-model-catalog-ownership' import { createStructuredAgentSessionOptionState, structuredAgentSessionReportsAtFence diff --git a/mobile/src/session/use-mobile-structured-send-with-outcome.ts b/mobile/src/session/use-mobile-structured-send-with-outcome.ts index c54bdf7c42f..755a7882a9b 100644 --- a/mobile/src/session/use-mobile-structured-send-with-outcome.ts +++ b/mobile/src/session/use-mobile-structured-send-with-outcome.ts @@ -5,7 +5,7 @@ import { runningStructuredAgentSessionTurnId } from '../../../src/shared/agent-s import { mobileStructuredAgentSessionWorking } from './mobile-structured-agent-session-working' import { structuredSessionBackgroundTasksView } from '../../../src/shared/structured-session-background-tasks-view' import { agentSessionVisibleFailureFacts } from '../../../src/shared/agent-session/failures/agent-session-visible-failures' -import { tuiAgentDisplayName } from '../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { pendingPromptsAllUnanswerableHere } from '../../../src/shared/agent-session/agent-session-approval-subject' import { SkillRefLimitError, diff --git a/mobile/src/source-control/use-mobile-source-control-agent-name.ts b/mobile/src/source-control/use-mobile-source-control-agent-name.ts index ddca59882e1..ff157472037 100644 --- a/mobile/src/source-control/use-mobile-source-control-agent-name.ts +++ b/mobile/src/source-control/use-mobile-source-control-agent-name.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import type { SourceControlLaunchActionId } from '../../../src/shared/source-control-ai-actions' -import { tuiAgentDisplayName } from '../../../src/shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' import type { RpcClient } from '../transport/rpc-client' import type { ConnectionState } from '../transport/types' import { diff --git a/mobile/src/tasks/agent-launch-mobile-replay.test.ts b/mobile/src/tasks/agent-launch-mobile-replay.test.ts index 5ef5a241012..a5cbcccafb8 100644 --- a/mobile/src/tasks/agent-launch-mobile-replay.test.ts +++ b/mobile/src/tasks/agent-launch-mobile-replay.test.ts @@ -21,7 +21,7 @@ import { import { AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, AGENT_LAUNCH_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { launchAgentInExistingWorkspace, reserveMobileAgentLaunch diff --git a/mobile/src/tasks/agent-launch-request.ts b/mobile/src/tasks/agent-launch-request.ts index 936ac82d34a..e53752dde4c 100644 --- a/mobile/src/tasks/agent-launch-request.ts +++ b/mobile/src/tasks/agent-launch-request.ts @@ -6,12 +6,12 @@ import { type AgentLaunchPlacement, type AgentLaunchPrompt, type AgentLaunchResult -} from '../../../src/shared/agent-launch-intent' +} from '../../../src/shared/agent-launch/contracts/agent-launch-intent' import { AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, AGENT_LAUNCH_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' -import type { TuiAgent } from '../../../src/shared/tui-agent' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcSendParams } from '../transport/rpc-params-contract' import type { WorkspaceCreateParams } from './workspace-create-params' @@ -112,5 +112,3 @@ export function isAgentLaunchUnsupportedRefusal(error: { } return (error.message ?? '').includes('agent_launch_unsupported') } - -export { isAgentLaunchReplayUnsupportedRefusal } from '../../../src/shared/agent-launch-replay-refusal' diff --git a/mobile/src/tasks/blank-workspace-create.ts b/mobile/src/tasks/blank-workspace-create.ts index 20a61229705..2c9ba0bae2e 100644 --- a/mobile/src/tasks/blank-workspace-create.ts +++ b/mobile/src/tasks/blank-workspace-create.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc-client' import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry' import type { WorktreeCreateAgentLaunch } from './agent-launch-request' diff --git a/mobile/src/tasks/mobile-agent-catalog.test.ts b/mobile/src/tasks/mobile-agent-catalog.test.ts index 6e7be5bb48f..b9e1e1123fd 100644 --- a/mobile/src/tasks/mobile-agent-catalog.test.ts +++ b/mobile/src/tasks/mobile-agent-catalog.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { TUI_AGENT_CONFIG } from '../../../src/shared/tui-agent-config' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/tui-agent-display-names' -import { TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/tui-agent-selection' +import { TUI_AGENT_CONFIG } from '../../../src/shared/agent-launch/catalog/tui-agent-config' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' import { MOBILE_AGENT_CATALOG } from './mobile-agent-catalog' describe('mobile agent catalog', () => { diff --git a/mobile/src/tasks/mobile-agent-catalog.ts b/mobile/src/tasks/mobile-agent-catalog.ts index c5da71ee272..3b447a1fa06 100644 --- a/mobile/src/tasks/mobile-agent-catalog.ts +++ b/mobile/src/tasks/mobile-agent-catalog.ts @@ -1,9 +1,7 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { - MOBILE_TUI_AGENT_AUTO_PICK_ORDER, - MOBILE_TUI_AGENT_FAVICON_DOMAINS, - MOBILE_TUI_AGENT_LABELS -} from './mobile-tui-agents' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_AUTO_PICK_ORDER as MOBILE_TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' +import { MOBILE_TUI_AGENT_FAVICON_DOMAINS } from './mobile-tui-agents' +import { TUI_AGENT_DISPLAY_NAMES as MOBILE_TUI_AGENT_LABELS } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' export type MobileAgentCatalogEntry = { id: TuiAgent diff --git a/mobile/src/tasks/mobile-agent-launch-architecture.test.ts b/mobile/src/tasks/mobile-agent-launch-architecture.test.ts index b4d0b66e31d..440e7e24a8b 100644 --- a/mobile/src/tasks/mobile-agent-launch-architecture.test.ts +++ b/mobile/src/tasks/mobile-agent-launch-architecture.test.ts @@ -26,7 +26,7 @@ import { readNewWorktreeRuntimeCapabilities } from './worktree-create-capability import { AGENT_LAUNCH_RUNTIME_CAPABILITY, AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' const createStructuredSession = vi.fn() vi.mock('../../../src/main/runtime/rpc/methods/structured-agent-session-create', () => ({ diff --git a/mobile/src/tasks/mobile-tasks-dependencies.ts b/mobile/src/tasks/mobile-tasks-dependencies.ts index 88b2cba565d..3039c6741f7 100644 --- a/mobile/src/tasks/mobile-tasks-dependencies.ts +++ b/mobile/src/tasks/mobile-tasks-dependencies.ts @@ -141,7 +141,7 @@ export { hasSettledHostRepoList } from './host-repo-list' export { useHostRepoList } from './use-host-repo-list' export { isHostedTaskRepo, reconcileRepoSelection } from './hosted-repo-selection' export type { LinearMobileIssue } from './linear-mobile-issue-read' -export { MOBILE_TUI_AGENT_AUTO_PICK_ORDER } from './mobile-tui-agents' + export { resolveComposerBranchSelection } from './mobile-composer-branch-selection' export { clearMobileTaskCopyFeedbackTimer, @@ -154,7 +154,7 @@ export type { } from '../../../src/shared/github/pull-request-types' export type { PersistedTrustedOrcaHooks } from '../../../src/shared/orca-yaml-hook-types' export type { SparsePreset } from '../../../src/shared/worktree/create-types' -export type { TuiAgent } from '../../../src/shared/tui-agent' + export type { SshConnectionState } from '../../../src/shared/ssh-types' export type { HostedReviewDecision } from '../../../src/shared/hosted-review' export { diff --git a/mobile/src/tasks/mobile-tasks-view-state-types.ts b/mobile/src/tasks/mobile-tasks-view-state-types.ts index c4115157558..03fa7ec5bdf 100644 --- a/mobile/src/tasks/mobile-tasks-view-state-types.ts +++ b/mobile/src/tasks/mobile-tasks-view-state-types.ts @@ -1,6 +1,6 @@ import type { DetailComment } from './mobile-tasks-provider-detail-types' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { - TuiAgent, TaskProvider, GitHubProjectSettings, GitHubProjectRef diff --git a/mobile/src/tasks/mobile-tui-agents.ts b/mobile/src/tasks/mobile-tui-agents.ts index 6a9ffa3d41b..9bcf4ac413b 100644 --- a/mobile/src/tasks/mobile-tui-agents.ts +++ b/mobile/src/tasks/mobile-tui-agents.ts @@ -1,17 +1,16 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' -import { isTuiAgent } from '../../../src/shared/tui-agent-config' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/tui-agent-display-names' -import { TUI_AGENT_FAVICON_DOMAINS } from '../../../src/shared/tui-agent-favicon-domains' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { TUI_AGENT_FAVICON_DOMAINS } from '../../../src/shared/agent-launch/catalog/tui-agent-favicon-domains' import { - TUI_AGENT_AUTO_PICK_ORDER, filterEnabledTuiAgents, isTuiAgentEnabled, pickTuiAgent -} from '../../../src/shared/tui-agent-selection' +} from '../../../src/shared/agent-launch/catalog/tui-agent-selection' // Reuse the shared registry; Metro cannot load renderer ?url icons, so the phone draws favicons. -export const MOBILE_TUI_AGENT_AUTO_PICK_ORDER = TUI_AGENT_AUTO_PICK_ORDER -export const MOBILE_TUI_AGENT_LABELS: Record = TUI_AGENT_DISPLAY_NAMES + +const MOBILE_TUI_AGENT_LABELS: Record = TUI_AGENT_DISPLAY_NAMES // Desktop draws these agents with built-in icons; the phone has only favicons for them. export const MOBILE_TUI_AGENT_FAVICON_DOMAINS: Partial> = { @@ -25,8 +24,6 @@ export const MOBILE_TUI_AGENT_FAVICON_DOMAINS: Partial> droid: 'factory.ai' } -export const isMobileTuiAgent: (value: unknown) => value is TuiAgent = isTuiAgent - /** A newer host's agent reads by its id until this build knows its name. */ export function mobileTuiAgentLabel(agent: string): string { return isTuiAgent(agent) ? MOBILE_TUI_AGENT_LABELS[agent] : agent diff --git a/mobile/src/tasks/mobile-workspace-create-operations.ts b/mobile/src/tasks/mobile-workspace-create-operations.ts index 8a5c6eae9b1..0630b9987d9 100644 --- a/mobile/src/tasks/mobile-workspace-create-operations.ts +++ b/mobile/src/tasks/mobile-workspace-create-operations.ts @@ -2,7 +2,7 @@ import { z } from 'zod' import { isAgentLaunchResult, type AgentLaunchResult -} from '../../../src/shared/agent-launch-intent' +} from '../../../src/shared/agent-launch/contracts/agent-launch-intent' import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc-operation' import { rpcResultVariant } from '../transport/rpc-operation-result-reader' import { diff --git a/mobile/src/tasks/source-workspace-create.test.ts b/mobile/src/tasks/source-workspace-create.test.ts index 3e7a5e1d74e..4a7358e6f67 100644 --- a/mobile/src/tasks/source-workspace-create.test.ts +++ b/mobile/src/tasks/source-workspace-create.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import type { RpcClient } from '../transport/rpc-client' import { createFakeRpcClient } from '../mobile-web-shell/bridge-host-test-fakes' -import type { AgentLaunchResult } from '../../../src/shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../../src/shared/agent-launch/contracts/agent-launch-intent' import { createWorkspaceFromComposerSource } from './source-workspace-create' import type { MobileComposerCreateSelection } from './mobile-composer-source-types' import { WORKTREE_CREATE_DEDUPE_TTL_LEGACY_HOST_MS } from './worktree-create-idempotency-policy' diff --git a/mobile/src/tasks/source-workspace-create.ts b/mobile/src/tasks/source-workspace-create.ts index a084edb0db2..96d58cc39aa 100644 --- a/mobile/src/tasks/source-workspace-create.ts +++ b/mobile/src/tasks/source-workspace-create.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc-client' import { resolveComposerMrBase, resolveComposerPrBase } from './composer-source-base-resolve' import type { diff --git a/mobile/src/tasks/use-mobile-tasks-workspace-create-projection.tsx b/mobile/src/tasks/use-mobile-tasks-workspace-create-projection.tsx index 7c565b849be..ff9fe859714 100644 --- a/mobile/src/tasks/use-mobile-tasks-workspace-create-projection.tsx +++ b/mobile/src/tasks/use-mobile-tasks-workspace-create-projection.tsx @@ -2,10 +2,8 @@ import type { ProjectMetadataLoadingModel } from './use-mobile-tasks-project-met import { useMobileTranslation } from '../i18n/use-mobile-translation' import { type BaseRefSearchResult, - MOBILE_TUI_AGENT_AUTO_PICK_ORDER, MobileAgentIcon, type PickerOption, - type TuiAgent, type WorkspaceAgentChoice, deriveWorkspaceSshGate, filterWorkspaceAgents, @@ -16,6 +14,8 @@ import { useMemo, workspaceAgentLabel } from './mobile-tasks-dependencies' +import { TUI_AGENT_AUTO_PICK_ORDER as MOBILE_TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { type ActionableTaskItem, type RepoSummary, diff --git a/mobile/src/tasks/workspace-agent-selection.ts b/mobile/src/tasks/workspace-agent-selection.ts index 8b2b76f09e7..301ed4018c3 100644 --- a/mobile/src/tasks/workspace-agent-selection.ts +++ b/mobile/src/tasks/workspace-agent-selection.ts @@ -1,13 +1,13 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { translate } from '../i18n/mobile-i18n' import { filterEnabledMobileTuiAgents, - isMobileTuiAgent, isMobileTuiAgentEnabled, - MOBILE_TUI_AGENT_AUTO_PICK_ORDER, - MOBILE_TUI_AGENT_LABELS, pickMobileTuiAgent } from './mobile-tui-agents' +import { isTuiAgent as isMobileTuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent-config' +import { TUI_AGENT_AUTO_PICK_ORDER as MOBILE_TUI_AGENT_AUTO_PICK_ORDER } from '../../../src/shared/agent-launch/catalog/tui-agent-selection' +import { TUI_AGENT_DISPLAY_NAMES as MOBILE_TUI_AGENT_LABELS } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' export type WorkspaceAgentChoice = TuiAgent | 'blank' diff --git a/mobile/src/tasks/workspace-create-params.ts b/mobile/src/tasks/workspace-create-params.ts index 14be24af91d..22c4b5ccaa4 100644 --- a/mobile/src/tasks/workspace-create-params.ts +++ b/mobile/src/tasks/workspace-create-params.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { CreateSparseCheckoutRequest, SetupDecision diff --git a/mobile/src/tasks/worktree-create-capability.test.ts b/mobile/src/tasks/worktree-create-capability.test.ts index 03125ae3f9f..a0c9f8b1a51 100644 --- a/mobile/src/tasks/worktree-create-capability.test.ts +++ b/mobile/src/tasks/worktree-create-capability.test.ts @@ -3,7 +3,7 @@ import { AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, AGENT_LAUNCH_REPLAY_RUNTIME_CAPABILITY, AGENT_LAUNCH_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import type { RpcClient } from '../transport/rpc-client' import { LogicalClientCutoverError } from '../transport/stable-logical-rpc-client' import { readNewWorktreeRuntimeCapabilities } from './worktree-create-capability' diff --git a/mobile/src/tasks/worktree-create-retry.ts b/mobile/src/tasks/worktree-create-retry.ts index 2a738026dec..59875448b4e 100644 --- a/mobile/src/tasks/worktree-create-retry.ts +++ b/mobile/src/tasks/worktree-create-retry.ts @@ -1,5 +1,5 @@ import { translate } from '../i18n/mobile-i18n' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc-client' import type { RpcResponse } from '../transport/types' import { @@ -15,11 +15,11 @@ import { } from '../../../src/shared/new-workspace/worktree-create-retry-policy' import { agentLaunchCreateParams, - isAgentLaunchReplayUnsupportedRefusal, isAgentLaunchUnsupportedRefusal, readAgentLaunchCreateOutcome, type WorktreeCreateAgentLaunch } from './agent-launch-request' +import { isAgentLaunchReplayUnsupportedRefusal } from '../../../src/shared/agent-launch/contracts/agent-launch-replay-refusal' import { structuredSessionOperationId } from '../session/structured-session-operation-id' import { WORKTREE_CREATE_TIMEOUT_MS } from './workspace-create-timeout' import type { WorkspaceCreateParams } from './workspace-create-params' diff --git a/mobile/src/terminal/quick-commands.ts b/mobile/src/terminal/quick-commands.ts index 26d31a895bc..2b09e7e07f3 100644 --- a/mobile/src/terminal/quick-commands.ts +++ b/mobile/src/terminal/quick-commands.ts @@ -1,5 +1,5 @@ import type { TerminalQuickCommand } from '../../../src/shared/terminal-quick-command-types' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import { applyTerminalQuickCommandMutation, flattenTerminalQuickCommand, @@ -18,7 +18,7 @@ import { terminalQuickCommandAgentPromptMaxLength } from '../../../src/shared/terminal-quick-command-prompt-limit' import { TERMINAL_QUICK_COMMANDS_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version' -import { MOBILE_TUI_AGENT_LABELS } from '../tasks/mobile-tui-agents' +import { TUI_AGENT_DISPLAY_NAMES as MOBILE_TUI_AGENT_LABELS } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' // Reuse the pure desktop command logic; renderer-only labels and native truncation stay here. export { diff --git a/mobile/src/test-support/mobile-agent-icon-assets-node.ts b/mobile/src/test-support/mobile-agent-icon-assets-node.ts index 0169ca00eaf..0c3af267091 100644 --- a/mobile/src/test-support/mobile-agent-icon-assets-node.ts +++ b/mobile/src/test-support/mobile-agent-icon-assets-node.ts @@ -1,5 +1,5 @@ import type { ImageSourcePropType } from 'react-native' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' export const MOBILE_AGENT_ICON_ASSETS: Partial> = { openclaude: 1, diff --git a/mobile/src/test-support/rpc-recording/adapters/session-terminal-create-mount-adapters.ts b/mobile/src/test-support/rpc-recording/adapters/session-terminal-create-mount-adapters.ts index 113015ed1b7..4d737473e15 100644 --- a/mobile/src/test-support/rpc-recording/adapters/session-terminal-create-mount-adapters.ts +++ b/mobile/src/test-support/rpc-recording/adapters/session-terminal-create-mount-adapters.ts @@ -8,7 +8,7 @@ import type { MobileSessionTabType, Terminal } from '../../../session/mobile-session-route-types' -import type { TuiAgent } from '../../../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../../../src/shared/agent-launch/catalog/tui-agent' import { SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY } from '../../../../../src/shared/protocol-version' const PREVIOUS_HANDLE = 'terminal-0' diff --git a/mobile/src/transport/mobile-runtime-client-capabilities.ts b/mobile/src/transport/mobile-runtime-client-capabilities.ts index d690c093a20..116c77a5121 100644 --- a/mobile/src/transport/mobile-runtime-client-capabilities.ts +++ b/mobile/src/transport/mobile-runtime-client-capabilities.ts @@ -21,7 +21,7 @@ import { AGENT_LAUNCH_RUNTIME_CAPABILITY, AGENT_LAUNCH_TAB_CLOSED_CLIENT_CAPABILITY, AGENT_LAUNCH_UNSTARTED_TAB_CLIENT_CAPABILITY -} from '../../../src/shared/agent-launch-runtime-capability' +} from '../../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { AGENT_SESSION_OPTIONAL_MODEL_CLIENT_CAPABILITY } from '../../../src/shared/agent-session/options/agent-session-optional-model-capability' import { remoteRuntimeClientCapabilities } from '../../../src/shared/remote-runtime/remote-runtime-client-capabilities' import { AGENT_SESSION_CREATE_MESSAGE_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-create-capabilities' diff --git a/src/cli/agent-launch-process.test.ts b/src/cli/agent-launch-process.test.ts index 9ef5912bf9b..3ee338d04af 100644 --- a/src/cli/agent-launch-process.test.ts +++ b/src/cli/agent-launch-process.test.ts @@ -10,7 +10,7 @@ import { z } from 'zod' import { AGENT_LAUNCH_RUNTIME_CAPABILITIES, AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY -} from '../shared/agent-launch-runtime-capability' +} from '../shared/agent-launch/contracts/agent-launch-runtime-capability' import { agentLaunchFixture } from './agent-launch-test-fixtures' it('real CLI processes carry surface choices and refuse invalid or unsupported picks before mutation', async () => { diff --git a/src/cli/agent-launch-recovery.ts b/src/cli/agent-launch-recovery.ts index 5e44998b808..2311b86f86e 100644 --- a/src/cli/agent-launch-recovery.ts +++ b/src/cli/agent-launch-recovery.ts @@ -1,5 +1,5 @@ import { RuntimeClientError, RuntimeRpcFailureError } from './runtime-client' -import { classifyAgentLaunchReplayRefusal } from '../shared/agent-launch-replay-refusal' +import { classifyAgentLaunchReplayRefusal } from '../shared/agent-launch/contracts/agent-launch-replay-refusal' import { recoverableOrchestrationArgs, resolveOrchestrationCliExecutable diff --git a/src/cli/agent-launch-request.ts b/src/cli/agent-launch-request.ts index b6a39f0ec7e..df2508164af 100644 --- a/src/cli/agent-launch-request.ts +++ b/src/cli/agent-launch-request.ts @@ -1,21 +1,27 @@ // agent.launch shares desktop/mobile policy; absent --surface uses the host's Chat | CLI choice for the agent. import { randomUUID } from 'node:crypto' -import type { AgentLaunchPrompt, AgentLaunchResult } from '../shared/agent-launch-intent' -import { AGENT_LAUNCH_SURFACES, type AgentLaunchSurface } from '../shared/agent-launch-surface' -import { checkAgentLaunchModelPreferences } from '../shared/agent-launch-model-preferences' +import type { + AgentLaunchPrompt, + AgentLaunchResult +} from '../shared/agent-launch/contracts/agent-launch-intent' +import { + AGENT_LAUNCH_SURFACES, + type AgentLaunchSurface +} from '../shared/agent-launch/contracts/agent-launch-surface' +import { checkAgentLaunchModelPreferences } from '../shared/agent-launch/choices/agent-launch-model-preferences' import { AGENT_LAUNCH_RUNTIME_CAPABILITY, AGENT_LAUNCH_PROMPT_CARRY_RUNTIME_CAPABILITY, AGENT_LAUNCH_LOCAL_PRESENTATION_RUNTIME_CAPABILITY, AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY -} from '../shared/agent-launch-runtime-capability' +} from '../shared/agent-launch/contracts/agent-launch-runtime-capability' import { createStructuredAgentSessionOperationId } from '../shared/agent-session/lifecycle/structured-agent-session-mutation' import { parseAgentSessionOperationTimestamp } from '../shared/agent-session/agent-session-host-authority' import type { RuntimeStatus } from '../shared/runtime-types' -import type { TuiAgent } from '../shared/tui-agent' -import { isTuiAgent } from '../shared/tui-agent-config' +import type { TuiAgent } from '../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../shared/agent-launch/catalog/tui-agent-config' import { getOptionalStringFlag, getRequiredStringFlag, diff --git a/src/cli/agent-launch-test-fixtures.ts b/src/cli/agent-launch-test-fixtures.ts index 07a53cf4f8a..f8ead416d7a 100644 --- a/src/cli/agent-launch-test-fixtures.ts +++ b/src/cli/agent-launch-test-fixtures.ts @@ -1,4 +1,4 @@ -import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../shared/agent-launch/contracts/agent-launch-runtime-capability' import { okFixture } from './test-fixtures' export function agentLaunchHostFixture() { diff --git a/src/cli/caller-host-worktree-selection.ts b/src/cli/caller-host-worktree-selection.ts index 89ce4f59046..1146b8aad60 100644 --- a/src/cli/caller-host-worktree-selection.ts +++ b/src/cli/caller-host-worktree-selection.ts @@ -1,5 +1,5 @@ import { resolve as resolvePath } from 'node:path' -import type { TuiAgent } from '../shared/tui-agent' +import type { TuiAgent } from '../shared/agent-launch/catalog/tui-agent' import { isPathInsideOrEqual, normalizeRuntimePathForComparison diff --git a/src/cli/handlers/automation-handler-flags.ts b/src/cli/handlers/automation-handler-flags.ts index c67f592ab7c..2962894ea86 100644 --- a/src/cli/handlers/automation-handler-flags.ts +++ b/src/cli/handlers/automation-handler-flags.ts @@ -3,14 +3,14 @@ import { normalizeTaskSourceContext, type TaskSourceContext } from '../../shared/task-source-context' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { DEFAULT_AUTOMATION_PRECHECK_TIMEOUT_SECONDS, MAX_AUTOMATION_PRECHECK_TIMEOUT_SECONDS } from '../../shared/automation-precheck' import { buildAutomationRrule } from '../../shared/automation-schedule-occurrences' import { isValidAutomationSchedule } from '../../shared/automation-schedule-parsing' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { getOptionalPositiveIntegerFlag, getOptionalStringFlag, diff --git a/src/cli/handlers/automation-host-support.ts b/src/cli/handlers/automation-host-support.ts index 0b1dec11e6d..a2b85d2fafe 100644 --- a/src/cli/handlers/automation-host-support.ts +++ b/src/cli/handlers/automation-host-support.ts @@ -5,7 +5,7 @@ import { import { EXTRA_AGENT_ARGS_HOST_UPDATE_REQUIRED, hasExtraAgentArgs -} from '../../shared/automation-extra-agent-args' +} from '../../shared/agent-launch/startup/automation-extra-agent-args' import type { RuntimeStatus } from '../../shared/runtime-types' import type { RuntimeClient } from '../runtime-client' import { RuntimeClientError } from '../runtime-client' diff --git a/src/cli/handlers/worktree-create-agent-launch.ts b/src/cli/handlers/worktree-create-agent-launch.ts index 1a5d630cc36..c7ff60c6142 100644 --- a/src/cli/handlers/worktree-create-agent-launch.ts +++ b/src/cli/handlers/worktree-create-agent-launch.ts @@ -1,10 +1,10 @@ // Use agent.launch for surface/model/effort; older hosts fall back to the create startup terminal. -import type { AgentLaunchResult } from '../../shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../shared/agent-launch/contracts/agent-launch-intent' import { AGENT_LAUNCH_LOCAL_PRESENTATION_RUNTIME_CAPABILITY, AGENT_LAUNCH_PROMPT_CARRY_RUNTIME_CAPABILITY -} from '../../shared/agent-launch-runtime-capability' +} from '../../shared/agent-launch/contracts/agent-launch-runtime-capability' import type { RuntimeWorktreeCreateResult, RuntimeWorktreeRecord } from '../../shared/runtime-types' import { callAgentLaunch, diff --git a/src/cli/handlers/worktree.ts b/src/cli/handlers/worktree.ts index 53b004184b4..e450a106cc4 100644 --- a/src/cli/handlers/worktree.ts +++ b/src/cli/handlers/worktree.ts @@ -28,7 +28,7 @@ import { resolveWorktreeCreateCwdContext, resolveCurrentWorktreeSelector } from '../selectors' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { parseCliAgent, readCliAgentLaunch } from '../agent-launch-request' import { createWorktreeWithAgent } from './worktree-create-agent-launch' import { printLineageSummary } from './worktree-lineage-summary' diff --git a/src/cli/orchestration-mutation-recovery.ts b/src/cli/orchestration-mutation-recovery.ts index 36420a49fe9..4de9cfa22e4 100644 --- a/src/cli/orchestration-mutation-recovery.ts +++ b/src/cli/orchestration-mutation-recovery.ts @@ -7,7 +7,7 @@ import { import { quoteWindowsCmdArgument } from '@orca/process-host/windows-command-line' import { quotePowerShellNativeArgument } from '../shared/powershell-native-argument' import { resolveWindowsShellStartupFamily } from '../shared/windows-terminal-shell' -import type { AgentStartupShell } from '../shared/tui-agent-startup-shell' +import type { AgentStartupShell } from '../shared/agent-launch/startup/tui-agent-startup-shell' export function orchestrationMutationRecoveryError( error: unknown, diff --git a/src/cli/runtime/websocket-transport.test.ts b/src/cli/runtime/websocket-transport.test.ts index 2470f44353f..5627291cba1 100644 --- a/src/cli/runtime/websocket-transport.test.ts +++ b/src/cli/runtime/websocket-transport.test.ts @@ -1,5 +1,5 @@ import { SKILL_INSTALL_RESULT_V2_CAPABILITY } from '../../shared/skill-install-capability' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { createServer, type Server } from 'node:http' import { mkdtempSync } from 'node:fs' import { tmpdir } from 'node:os' diff --git a/src/cli/runtime/websocket-transport.ts b/src/cli/runtime/websocket-transport.ts index 76253b4d92f..7dd04e82131 100644 --- a/src/cli/runtime/websocket-transport.ts +++ b/src/cli/runtime/websocket-transport.ts @@ -4,7 +4,7 @@ import type { RuntimeOrchestrationEnvelope } from '../../shared/runtime-rpc-envelope' import { RemoteRuntimeClientError } from '../../shared/remote-runtime/remote-runtime-client-error' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { sendRemoteRuntimeRequest, sendRemoteRuntimeRequestWithStatusPreflight diff --git a/src/main/acp/acp-launch-specs.ts b/src/main/acp/acp-launch-specs.ts index 2c544ebbfdd..85f787a7800 100644 --- a/src/main/acp/acp-launch-specs.ts +++ b/src/main/acp/acp-launch-specs.ts @@ -8,9 +8,9 @@ import { ANTIGRAVITY_ACP_DIALECT } from './acp-dialects/antigravity-dialect' import { directoryAccountBinding, type AcpAccountBinding } from './acp-account-binding' import { openCodeAcpAccountBinding } from '../opencode/opencode-structured-account-home' import { scrubOpenCodeAcpEnvironment } from '../opencode/opencode-acp-environment' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentSessionModelOption } from '../../shared/agent-session/agent-session-wire' -import type { AgentChatPermissionMode } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionMode } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { InitializeResponse } from './generated/acp-protocol.generated' import { compareAppVersions } from '../../shared/app-version' import type { ManagedRuntime } from '../node-runtime/managed-runtime-release' diff --git a/src/main/acp/acp-structured-adapter.test-support.ts b/src/main/acp/acp-structured-adapter.test-support.ts index 96d28fd26a3..265aa4fa3e8 100644 --- a/src/main/acp/acp-structured-adapter.test-support.ts +++ b/src/main/acp/acp-structured-adapter.test-support.ts @@ -6,7 +6,7 @@ import { join } from 'node:path' import { vi } from 'vitest' import { z } from 'zod' import type { AgentJournalMessageItem } from '../../shared/agent-session/journal/agent-session-journal-types' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StructuredAgentSessionLifecycleEvent } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import type { StructuredAgentSessionProviderOpenResult } from '../native-chat/agent-session-wire/structured-agent-session-provider-open-contract' import { diff --git a/src/main/acp/acp-structured-agent-definitions.ts b/src/main/acp/acp-structured-agent-definitions.ts index 378d2ab624b..33fb2a9077a 100644 --- a/src/main/acp/acp-structured-agent-definitions.ts +++ b/src/main/acp/acp-structured-agent-definitions.ts @@ -1,7 +1,7 @@ import type { StructuredAgentDefinition } from '../native-chat/agent-session-wire/structured-agent-definition' import type { AcpLaunchSpec } from './acp-launch-specs' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' export function acpAgentName(agent: string): string { return isTuiAgent(agent) ? TUI_AGENT_DISPLAY_NAMES[agent] : agent diff --git a/src/main/acp/acp-structured-launch-resolution.ts b/src/main/acp/acp-structured-launch-resolution.ts index 26b0277dc66..3efc91df43a 100644 --- a/src/main/acp/acp-structured-launch-resolution.ts +++ b/src/main/acp/acp-structured-launch-resolution.ts @@ -28,7 +28,7 @@ import { copyBesidePinnedMembers, resolveInstalledRuntimeRelease } from '../node-runtime/managed-runtime-release' -import { hasExplicitTuiLaunchCommand } from '../../shared/tui-agent-launch-command-override' +import { hasExplicitTuiLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-launch-command-override' import { readAgentJournalTurn } from '../../shared/agent-session/lifecycle/agent-session-turn-record' import type { JournalLoad } from '../native-chat/agent-session-journal/journal-open' import { diff --git a/src/main/acp/acp-structured-session-adapter-deps.ts b/src/main/acp/acp-structured-session-adapter-deps.ts index cca438f879c..7bb8c98a0f1 100644 --- a/src/main/acp/acp-structured-session-adapter-deps.ts +++ b/src/main/acp/acp-structured-session-adapter-deps.ts @@ -14,7 +14,7 @@ import type { AgentJournalDispatchRejection } from '../../shared/agent-session/f import type { AcpLaunchSpec } from './acp-launch-specs' import type { ConnectAcpAgent } from './acp-structured-connection' import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-work-evidence' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' // Grace begins at cancellation, before process close. export const ACP_STOP_GRACE_MS = 4_000 diff --git a/src/main/agent-hooks/managed-agent-hook-controls.ts b/src/main/agent-hooks/managed-agent-hook-controls.ts index 8ce0b92d611..47fb5b6b2cd 100644 --- a/src/main/agent-hooks/managed-agent-hook-controls.ts +++ b/src/main/agent-hooks/managed-agent-hook-controls.ts @@ -3,7 +3,7 @@ import { getManagedAgentHookTarget, isManagedAgentHookTarget } from '../../shared/managed-agent-hook-targets' -import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection' +import { normalizeDisabledTuiAgents } from '../../shared/agent-launch/catalog/tui-agent-selection' import type { GlobalSettings } from '../../shared/global-settings-types' import { isAgentStatusHooksEnabled, diff --git a/src/main/agent-hooks/managed-hook-detection-commands.ts b/src/main/agent-hooks/managed-hook-detection-commands.ts index 48166c91d72..47e3d2e82f6 100644 --- a/src/main/agent-hooks/managed-hook-detection-commands.ts +++ b/src/main/agent-hooks/managed-hook-detection-commands.ts @@ -4,9 +4,9 @@ import { isSafeOverrideExecutableToken } from '../../shared/managed-agent-command-token' import { MANAGED_AGENT_HOOK_TARGETS } from '../../shared/managed-agent-hook-targets' -import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection' +import { normalizeDisabledTuiAgents } from '../../shared/agent-launch/catalog/tui-agent-selection' import type { GlobalSettings } from '../../shared/global-settings-types' -import type { TuiAgentDetectionCommand } from '../../shared/tui-agent-detection-commands' +import type { TuiAgentDetectionCommand } from '../../shared/agent-launch/catalog/tui-agent-detection-commands' import { parseClaudeCliVersionOutput } from '../claude/claude-hook-event-versions' export type ManagedHookDetectionSettings = Partial< diff --git a/src/main/agent-hooks/server-antigravity-resume-identity.test.ts b/src/main/agent-hooks/server-antigravity-resume-identity.test.ts index 8da8fd91085..11b1f02cb7e 100644 --- a/src/main/agent-hooks/server-antigravity-resume-identity.test.ts +++ b/src/main/agent-hooks/server-antigravity-resume-identity.test.ts @@ -5,7 +5,7 @@ import { expect, it } from 'vitest' import { normalizeHookPayload } from '../../shared/agent-hook-listener' import { createHookListenerState } from '../../shared/agent-hook-listener/listener-state' import { resumeRecordFromStatus } from '../../shared/agent-resume-record-from-status' -import { getAgentResumeArgv } from '../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../shared/agent-launch/startup/agent-resume-argv' import { TRANSCRIPT_MAX_SCAN_BYTES } from '../../shared/agent-hook-listener/transcript-reader' import { AgentHookServer } from './server' import { buildBody, PANE } from './server.test-fixtures' diff --git a/src/main/agent-hooks/server-copilot-resume-identity.test.ts b/src/main/agent-hooks/server-copilot-resume-identity.test.ts index 7483d8d2712..f557653fe62 100644 --- a/src/main/agent-hooks/server-copilot-resume-identity.test.ts +++ b/src/main/agent-hooks/server-copilot-resume-identity.test.ts @@ -5,7 +5,7 @@ import { expect, it } from 'vitest' import { normalizeHookPayload } from '../../shared/agent-hook-listener' import { createHookListenerState } from '../../shared/agent-hook-listener/listener-state' import { resumeRecordFromStatus } from '../../shared/agent-resume-record-from-status' -import { getAgentResumeArgv } from '../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../shared/agent-launch/startup/agent-resume-argv' import { AgentHookServer } from './server' import { type Body, buildBody, PANE, postHookEvent } from './server.test-fixtures' diff --git a/src/main/agent-hooks/server-hermes-resume-identity.test.ts b/src/main/agent-hooks/server-hermes-resume-identity.test.ts index 74f9ed2b8f8..62bfeca6fd7 100644 --- a/src/main/agent-hooks/server-hermes-resume-identity.test.ts +++ b/src/main/agent-hooks/server-hermes-resume-identity.test.ts @@ -5,7 +5,7 @@ import { expect, it } from 'vitest' import { normalizeHookPayload } from '../../shared/agent-hook-listener' import { createHookListenerState } from '../../shared/agent-hook-listener/listener-state' import { resumeRecordFromStatus } from '../../shared/agent-resume-record-from-status' -import { getAgentResumeArgv } from '../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../shared/agent-launch/startup/agent-resume-argv' import type { AgentHookRelayEnvelope } from '../../shared/agent-hook-relay' import { RelayAgentHookServer } from '../../wsl-guest/agent-hook-server' import { AgentHookServer } from './server' diff --git a/src/main/agent-hooks/server-idle-process-owner.test.ts b/src/main/agent-hooks/server-idle-process-owner.test.ts index e48cc8d1794..4cbe652c90a 100644 --- a/src/main/agent-hooks/server-idle-process-owner.test.ts +++ b/src/main/agent-hooks/server-idle-process-owner.test.ts @@ -5,7 +5,7 @@ import { join } from 'node:path' import { AgentHookServer } from './server' import { buildBody, PANE, postHookEvent } from './server.test-fixtures' import { buildRuntimeMobileAgentStatus } from '../runtime/runtime-mobile-agent-status-builder' -import { getAgentResumeArgv } from '../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../shared/agent-launch/startup/agent-resume-argv' import type { probeAgentProcessPresence } from '../../shared/agent-process-presence-probe' vi.mock('../telemetry/client', () => ({ track: vi.fn() })) diff --git a/src/main/agent-hooks/server-startup-prompt-control.test.ts b/src/main/agent-hooks/server-startup-prompt-control.test.ts index 19a6efd5a89..88ab74ef37b 100644 --- a/src/main/agent-hooks/server-startup-prompt-control.test.ts +++ b/src/main/agent-hooks/server-startup-prompt-control.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { AgentHookServer } from './server' import { parseAgentHookEndpointFile } from '../../shared/agent-hook-endpoint-file' -import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../shared/opencode-startup-prompt' +import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../shared/agent-launch/startup/opencode-startup-prompt' import { PANE } from './server.test-fixtures' describe('startup prompt control with status hooks disabled', () => { diff --git a/src/main/agent-hooks/server-transport-interference.test.ts b/src/main/agent-hooks/server-transport-interference.test.ts index 42aebba2d0c..6039d61e60d 100644 --- a/src/main/agent-hooks/server-transport-interference.test.ts +++ b/src/main/agent-hooks/server-transport-interference.test.ts @@ -4,7 +4,7 @@ import { IncomingMessage, ServerResponse } from 'node:http' import { afterEach, describe, expect, it, vi } from 'vitest' import type { HookTransportInterferenceReport } from '../../shared/agent-hook-transport-interference' import { AgentHookServer } from './server' -import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../shared/opencode-startup-prompt' +import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../shared/agent-launch/startup/opencode-startup-prompt' import { HOOK_REQUEST_SLOWLORIS_MS } from '../../shared/agent-hook-listener/listener-limits' async function postTruncatedHook( diff --git a/src/main/agent-hooks/server/server-lifecycle.ts b/src/main/agent-hooks/server/server-lifecycle.ts index 1dcdb86e74f..25a9e3273e7 100644 --- a/src/main/agent-hooks/server/server-lifecycle.ts +++ b/src/main/agent-hooks/server/server-lifecycle.ts @@ -15,7 +15,7 @@ import { isHookRequestTruncatedError } from '../../../shared/agent-hook-transpor import { clearAllListenerCaches } from '../../../shared/agent-hook-listener/listener-state' import { trackEmptyPaneKeyHook } from './server-transport-rules' import { AgentHookServerStatusHookLifecycle } from './server-status-hook-lifecycle' -import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../../shared/opencode-startup-prompt' +import { OPENCODE_STARTUP_PROMPT_CLAIM_PATH } from '../../../shared/agent-launch/startup/opencode-startup-prompt' import { CLAUDE_AGENT_VIEW_PATH } from '../../../shared/claude-agent-view' import { respondAfterAgentToolPluginHooks } from '../agent-tool-plugin-hooks' diff --git a/src/main/agent-hooks/server/server-status-identity.ts b/src/main/agent-hooks/server/server-status-identity.ts index eb137793210..d82933750ab 100644 --- a/src/main/agent-hooks/server/server-status-identity.ts +++ b/src/main/agent-hooks/server/server-status-identity.ts @@ -1,5 +1,5 @@ import type { AgentKind } from '../../../shared/telemetry-events' -import { getAgentResumeArgv } from '../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../shared/agent-launch/startup/agent-resume-argv' import type { AgentProviderSessionMetadata } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { parseLegacyNumericPaneKey, parsePaneKey } from '../../../shared/stable-pane-id' import { diff --git a/src/main/agent-hooks/wsl-agent-plugin-readiness.ts b/src/main/agent-hooks/wsl-agent-plugin-readiness.ts index c0c95fae4e8..4b2a1d750cd 100644 --- a/src/main/agent-hooks/wsl-agent-plugin-readiness.ts +++ b/src/main/agent-hooks/wsl-agent-plugin-readiness.ts @@ -1,4 +1,4 @@ -import { getAgentLaunchExecutableName } from '../../shared/agent-command-line-intent' +import { getAgentLaunchExecutableName } from '../../shared/agent-launch/startup/agent-command-line-intent' import { isAgentStatusHooksEnabledForAgent, type AgentStatusHooksSettings @@ -9,7 +9,7 @@ import { isPiCompatibleAgentType, type PiAgentKind } from '../../shared/pi-agent-kind' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { wslHookRelayManager, type WslHookRelayManager } from './wsl-hook-relay-manager' import { blockedWslDistroForExec } from '../wsl/discovery/wsl-background-exec-gate' diff --git a/src/main/agent-hooks/wsl-opencode-install-race.test.ts b/src/main/agent-hooks/wsl-opencode-install-race.test.ts index 240feeac6c6..e64efaf7bdb 100644 --- a/src/main/agent-hooks/wsl-opencode-install-race.test.ts +++ b/src/main/agent-hooks/wsl-opencode-install-race.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { mkdirSync, mkdtempSync, readFileSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { RelayDispatcher } from '../../wsl-guest/dispatcher' import { PluginOverlayManager } from '../../wsl-guest/plugin-overlay' import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins-handler' diff --git a/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts b/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts index f2ff4355e5e..d9f5734d369 100644 --- a/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts +++ b/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts @@ -10,7 +10,7 @@ import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins import { WslHookRelayManager } from './wsl-hook-relay-manager' import { REINSTALL_MIN_INTERVAL_MS } from './wsl-hook-relay-deps' import type { MultiplexerTransport } from '../ssh/ssh-channel-multiplexer' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD, AGENT_HOOK_REQUEST_REPLAY_METHOD diff --git a/src/main/agent-hooks/wsl-opencode-settings.test.ts b/src/main/agent-hooks/wsl-opencode-settings.test.ts index c2a260c6d1f..0eed218fc43 100644 --- a/src/main/agent-hooks/wsl-opencode-settings.test.ts +++ b/src/main/agent-hooks/wsl-opencode-settings.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { RelayDispatcher } from '../../wsl-guest/dispatcher' import { PluginOverlayManager } from '../../wsl-guest/plugin-overlay' import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins-handler' diff --git a/src/main/agent-launch/agent-launch-account-env.test.ts b/src/main/agent-launch/agent-launch-account-env.test.ts index 926899071ad..a6ae2e389ac 100644 --- a/src/main/agent-launch/agent-launch-account-env.test.ts +++ b/src/main/agent-launch/agent-launch-account-env.test.ts @@ -1,8 +1,8 @@ import { EVERY_AGENT_CHAT } from '../../shared/native-chat/every-agent-chat.test-fixture' import { describe, expect, it, vi } from 'vitest' import { executeAgentLaunch, type AgentLaunchExecution } from './agent-launch-executor' -import type { AgentLaunchIntent } from '../../shared/agent-launch-intent' -import { STRUCTURED_ACCOUNT_ENV_IGNORED_WARNING } from '../../shared/agent-launch-account-env' +import type { AgentLaunchIntent } from '../../shared/agent-launch/contracts/agent-launch-intent' +import { STRUCTURED_ACCOUNT_ENV_IGNORED_WARNING } from '../../shared/agent-launch/startup/agent-launch-account-env' const ACCOUNT_ENV = { CLAUDE_CONFIG_DIR: '/home/u/.orca/claude/a', CODEX_HOME: '/home/u/.codex-b' } diff --git a/src/main/agent-launch/agent-launch-created-workspace.ts b/src/main/agent-launch/agent-launch-created-workspace.ts index 3d606e97ab7..0e3974da583 100644 --- a/src/main/agent-launch/agent-launch-created-workspace.ts +++ b/src/main/agent-launch/agent-launch-created-workspace.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RuntimeMobileSessionTabsResult } from '../../shared/runtime-types' import type { AgentLaunchExecution } from './agent-launch-execution' import type { AgentLaunchWorkspaceFactory } from './agent-launch-surface-factories' diff --git a/src/main/agent-launch/agent-launch-decided-mode-contract.test.ts b/src/main/agent-launch/agent-launch-decided-mode-contract.test.ts index 0286a613381..6d0fe5f8436 100644 --- a/src/main/agent-launch/agent-launch-decided-mode-contract.test.ts +++ b/src/main/agent-launch/agent-launch-decided-mode-contract.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { AgentLaunchExecution } from './agent-launch-executor' -import type { AgentLaunchModeReceipt } from './agent-launch-mode' +import type { AgentLaunchModeReceipt } from '../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentLaunchSurfaceFactory } from './agent-launch-surface-factories' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: only the execution's type is checked; nothing runs it. diff --git a/src/main/agent-launch/agent-launch-execution.ts b/src/main/agent-launch/agent-launch-execution.ts index c4839e5162a..dc60a4bed85 100644 --- a/src/main/agent-launch/agent-launch-execution.ts +++ b/src/main/agent-launch/agent-launch-execution.ts @@ -1,21 +1,19 @@ import type { AgentLaunchIntent, AgentLaunchResult, - AgentLaunchTarget -} from '../../shared/agent-launch-intent' + AgentLaunchTarget, + AgentLaunchModeReceipt +} from '../../shared/agent-launch/contracts/agent-launch-intent' import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import type { - readAgentLaunchModeSettings, - AgentLaunchModeReceipt, - AgentLaunchModeVocabulary -} from './agent-launch-mode' +import type { readAgentLaunchModeSettings, AgentLaunchModeVocabulary } from './agent-launch-mode' + import type { AgentLaunchSurfaceFactory, AgentLaunchWorkspaceFactory } from './agent-launch-surface-factories' /** Persist the surface result before delivery so a host crash leaves an honest prompt receipt. */ -export type AgentLaunchPublishedSurface = AgentLaunchResult +type AgentLaunchPublishedSurface = AgentLaunchResult type AgentLaunchExecutionBase = { runtime: Pick & diff --git a/src/main/agent-launch/agent-launch-executor-cancel.test.ts b/src/main/agent-launch/agent-launch-executor-cancel.test.ts index 0366a7301bf..5a08f139b5b 100644 --- a/src/main/agent-launch/agent-launch-executor-cancel.test.ts +++ b/src/main/agent-launch/agent-launch-executor-cancel.test.ts @@ -2,7 +2,7 @@ import { EVERY_AGENT_CHAT } from '../../shared/native-chat/every-agent-chat.test import { describe, expect, it, vi } from 'vitest' import { executeAgentLaunch, type AgentLaunchExecution } from './agent-launch-executor' import { AgentLaunchStructuredSessionRefusedError } from './agent-launch-surface-factories' -import type { AgentLaunchIntent } from '../../shared/agent-launch-intent' +import type { AgentLaunchIntent } from '../../shared/agent-launch/contracts/agent-launch-intent' const PROMPT = { text: 'fix the flaky test', delivery: 'submit' as const } diff --git a/src/main/agent-launch/agent-launch-executor.test.ts b/src/main/agent-launch/agent-launch-executor.test.ts index 8cc332e7dad..c6ad5d19591 100644 --- a/src/main/agent-launch/agent-launch-executor.test.ts +++ b/src/main/agent-launch/agent-launch-executor.test.ts @@ -3,7 +3,10 @@ import { describe, expect, it, vi } from 'vitest' import { executeAgentLaunch, type AgentLaunchExecution } from './agent-launch-executor' import { AgentLaunchStructuredSessionRefusedError } from './agent-launch-surface-factories' import type { AgentLaunchSurfaceFactory } from './agent-launch-surface-factories' -import type { AgentLaunchIntent, AgentLaunchResult } from '../../shared/agent-launch-intent' +import type { + AgentLaunchIntent, + AgentLaunchResult +} from '../../shared/agent-launch/contracts/agent-launch-intent' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../shared/constants' import { readCreatedWorkspaceLaunch } from './agent-launch-created-workspace' diff --git a/src/main/agent-launch/agent-launch-executor.ts b/src/main/agent-launch/agent-launch-executor.ts index c628b23b35d..771a28ea813 100644 --- a/src/main/agent-launch/agent-launch-executor.ts +++ b/src/main/agent-launch/agent-launch-executor.ts @@ -7,8 +7,9 @@ import { assertAgentPromptRequestActive } from '../runtime/orca-runtime-core' import { parsePaneKey } from '../../shared/stable-pane-id' import { type AgentLaunchResult, - withoutReservedAgentCreateFields -} from '../../shared/agent-launch-intent' + withoutReservedAgentCreateFields, + type AgentLaunchModeReceipt +} from '../../shared/agent-launch/contracts/agent-launch-intent' import { combineLaunchWarnings, ignoredStructuredLaunchInputsWarning @@ -25,12 +26,12 @@ import { import { isDefinitiveAgentSessionCreateRefusal } from '../../shared/agent-session/failures/agent-session-definitive-refusal' import { resolveAgentLaunchModeOnHost, - type AgentLaunchModeReceipt, type AgentLaunchModeSettlement, DEFAULT_LAUNCH_VOCABULARY, downgradeAgentLaunchModeForStructuredRefusal, warnStructuredLaunchDowngrade } from './agent-launch-mode' + import { assertLegacyHostTarget, createLaunchPromptInputs, @@ -49,7 +50,7 @@ import { recoverCreatedWorkspace } from './agent-launch-created-workspace' -export type { AgentLaunchExecution, AgentLaunchPublishedSurface } from './agent-launch-execution' +export type { AgentLaunchExecution } from './agent-launch-execution' export async function executeAgentLaunch( execution: AgentLaunchExecution diff --git a/src/main/agent-launch/agent-launch-intent-mode.ts b/src/main/agent-launch/agent-launch-intent-mode.ts index 4075f07c662..ec0b6c3e4b1 100644 --- a/src/main/agent-launch/agent-launch-intent-mode.ts +++ b/src/main/agent-launch/agent-launch-intent-mode.ts @@ -1,10 +1,12 @@ -import type { AgentLaunchIntent } from '../../shared/agent-launch-intent' +import type { + AgentLaunchIntent, + AgentLaunchModeReceipt +} from '../../shared/agent-launch/contracts/agent-launch-intent' import { workspaceKindForLaunchTarget } from '../../shared/workspace-launch-kind' import { decideAgentLaunchMode, readAgentLaunchModeSettings, DEFAULT_LAUNCH_VOCABULARY, - type AgentLaunchModeReceipt, type AgentLaunchModeVocabulary } from './agent-launch-mode' diff --git a/src/main/agent-launch/agent-launch-legacy-host.ts b/src/main/agent-launch/agent-launch-legacy-host.ts index efeba6f5ef2..4b1fcfd4e6b 100644 --- a/src/main/agent-launch/agent-launch-legacy-host.ts +++ b/src/main/agent-launch/agent-launch-legacy-host.ts @@ -3,11 +3,12 @@ import type { AgentLaunchPrompt, AgentLaunchPromptDisposal, - AgentLaunchResult -} from '../../shared/agent-launch-intent' -import { agentPromptRidesLaunchCommand } from '../../shared/tui-agent-startup' + AgentLaunchResult, + AgentLaunchModeReceipt +} from '../../shared/agent-launch/contracts/agent-launch-intent' +import { agentPromptRidesLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-startup' import type { AgentLaunchExecution, AgentLaunchLegacyHostExecution } from './agent-launch-execution' -import type { AgentLaunchModeReceipt } from './agent-launch-mode' + import { HANDED_TO_TERMINAL, launchCommandPrompt, diff --git a/src/main/agent-launch/agent-launch-mode.ts b/src/main/agent-launch/agent-launch-mode.ts index a2c7f7423ef..ef93c929f88 100644 --- a/src/main/agent-launch/agent-launch-mode.ts +++ b/src/main/agent-launch/agent-launch-mode.ts @@ -2,10 +2,9 @@ import { requestsCwdOutsideWorkspaceRoot } from '../../shared/terminal-startup-cwd' import type { - AgentLaunchMode, AgentLaunchModeReason, AgentLaunchModeReceipt -} from '../../shared/agent-launch-intent' +} from '../../shared/agent-launch/contracts/agent-launch-intent' import { RUNTIME_CAPABILITIES } from '../../shared/protocol-version' import { STRUCTURED_AGENT_RUNTIME_METADATA } from '../runtime/structured-agent-runtime-metadata' import { @@ -14,15 +13,13 @@ import { type NativeChatDefaultSettings, type StructuredNativeChatBlocker } from '../../shared/structured-native-chat-launch-route' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceLaunchKind } from '../../shared/workspace-launch-kind' import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import type { AgentLaunchSurface } from '../../shared/agent-launch-surface' +import type { AgentLaunchSurface } from '../../shared/agent-launch/contracts/agent-launch-surface' import { formatAgentTypeLabel } from '../../shared/agent-type-label' import { AgentLaunchSurfaceUnavailableError } from './agent-launch-surface-refusal' -export type { AgentLaunchMode, AgentLaunchModeReason, AgentLaunchModeReceipt } - type AgentLaunchDowngradeReason = Exclude /** Caller-specific receipt wording, shared across desktop, mobile and orchestration. */ diff --git a/src/main/agent-launch/agent-launch-opencode-model.test.ts b/src/main/agent-launch/agent-launch-opencode-model.test.ts index b86fb8ca9ef..36961d181cd 100644 --- a/src/main/agent-launch/agent-launch-opencode-model.test.ts +++ b/src/main/agent-launch/agent-launch-opencode-model.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, vi } from 'vitest' import recordings from '../../shared/fixtures/source-control-launch-recordings.json' -import type { AgentLaunchIntent } from '../../shared/agent-launch-intent' +import type { AgentLaunchIntent } from '../../shared/agent-launch/contracts/agent-launch-intent' import { executeAgentLaunch } from './agent-launch-executor' -import { toAgentLaunchPreferences } from '../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../shared/agent-launch/choices/agent-launch-preferences' import { assertOpenCodeModelLaunchPreferencesAbsent } from '../opencode/opencode-model-startup-plan' -import { agentPermissionChoices } from '../../shared/tui-agent-permission-choice' +import { agentPermissionChoices } from '../../shared/agent-launch/permissions/tui-agent-permission-choice' function harness() { const readSettings = vi.fn(() => { diff --git a/src/main/agent-launch/agent-launch-pane-attachment.ts b/src/main/agent-launch/agent-launch-pane-attachment.ts index 6b69411c9f9..1261dc32c4c 100644 --- a/src/main/agent-launch/agent-launch-pane-attachment.ts +++ b/src/main/agent-launch/agent-launch-pane-attachment.ts @@ -1,6 +1,6 @@ /** Use process-local launch state; after restart, ordinary pane attachment handles recovery. */ -import type { AgentLaunchPaneVerdict } from '../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdict } from '../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { parsePaneKey } from '../../shared/stable-pane-id' import type { TerminalSurfaceCloseTarget } from '../../shared/terminal-surface-close-target' diff --git a/src/main/agent-launch/agent-launch-prompt-delivery.ts b/src/main/agent-launch/agent-launch-prompt-delivery.ts index 9cc587fba07..03141544c67 100644 --- a/src/main/agent-launch/agent-launch-prompt-delivery.ts +++ b/src/main/agent-launch/agent-launch-prompt-delivery.ts @@ -6,10 +6,11 @@ import type { StructuredAgentSessionFirstMessage } from '../../shared/agent-sess import type { AgentLaunchIntent, AgentLaunchPromptDisposal, - AgentLaunchResult -} from '../../shared/agent-launch-intent' -import { agentPromptRidesLaunchCommand } from '../../shared/tui-agent-startup' -import type { AgentLaunchModeReceipt } from './agent-launch-mode' + AgentLaunchResult, + AgentLaunchModeReceipt +} from '../../shared/agent-launch/contracts/agent-launch-intent' +import { agentPromptRidesLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-startup' + import type { CreatedSurface } from './agent-launch-executor' import type { AgentLaunchSurfaceExecution } from './agent-launch-execution' import type { AgentLaunchStructuredSurface } from './agent-launch-surface-factories' diff --git a/src/main/agent-launch/agent-launch-surface-factories.ts b/src/main/agent-launch/agent-launch-surface-factories.ts index 448908d5f32..4f355e6efea 100644 --- a/src/main/agent-launch/agent-launch-surface-factories.ts +++ b/src/main/agent-launch/agent-launch-surface-factories.ts @@ -9,12 +9,12 @@ import type { AgentLaunchIntent, AgentLaunchPrompt, AgentLaunchMode -} from '../../shared/agent-launch-intent' +} from '../../shared/agent-launch/contracts/agent-launch-intent' import type { StructuredAgentId } from '../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { StructuredAgentSessionFirstMessage } from '../../shared/agent-session/structured-agent-session-create' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchParams } from '../../shared/rpc-contract/agent-launch-params' -import { toAgentLaunchPreferences } from '../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../shared/agent-launch/choices/agent-launch-preferences' import { assertOpenCodeModelLaunchPreferencesAbsent } from '../opencode/opencode-model-startup-plan' /** Inject creation so orchestration can add subscriptions without duplicating launch sequencing. */ diff --git a/src/main/agent-launch/agent-launch-surface-refusal.ts b/src/main/agent-launch/agent-launch-surface-refusal.ts index 4f64a54ade7..1ab5aeac97d 100644 --- a/src/main/agent-launch/agent-launch-surface-refusal.ts +++ b/src/main/agent-launch/agent-launch-surface-refusal.ts @@ -1,4 +1,4 @@ -import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../shared/agent-launch-surface' +import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../shared/agent-launch/contracts/agent-launch-surface' import { OrchestrationError } from '../runtime/orchestration/orchestration-error' /** Proves no launch effects occurred, so replay may return the same definitive refusal. */ diff --git a/src/main/agent-launch/agent-launch-warnings.ts b/src/main/agent-launch/agent-launch-warnings.ts index 62e5a73550d..57b814398d2 100644 --- a/src/main/agent-launch/agent-launch-warnings.ts +++ b/src/main/agent-launch/agent-launch-warnings.ts @@ -1,5 +1,5 @@ -import type { AgentLaunchIntent } from '../../shared/agent-launch-intent' -import { STRUCTURED_ACCOUNT_ENV_IGNORED_WARNING } from '../../shared/agent-launch-account-env' +import type { AgentLaunchIntent } from '../../shared/agent-launch/contracts/agent-launch-intent' +import { STRUCTURED_ACCOUNT_ENV_IGNORED_WARNING } from '../../shared/agent-launch/startup/agent-launch-account-env' export function combineLaunchWarnings( create: string | undefined, diff --git a/src/main/agent-launch/agent-started-telemetry.ts b/src/main/agent-launch/agent-started-telemetry.ts index bcd1321daa8..d2834ffb33d 100644 --- a/src/main/agent-launch/agent-started-telemetry.ts +++ b/src/main/agent-launch/agent-started-telemetry.ts @@ -2,7 +2,7 @@ import { tuiAgentToAgentKind } from '../../shared/agent-kind' import { launchSourceSchema } from '../../shared/telemetry-property-schemas' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' export function agentStartedTelemetry( diff --git a/src/main/agent-launch/startup-agent-worktree-create.ts b/src/main/agent-launch/startup-agent-worktree-create.ts index 28a43fc6388..286c09f977a 100644 --- a/src/main/agent-launch/startup-agent-worktree-create.ts +++ b/src/main/agent-launch/startup-agent-worktree-create.ts @@ -1,8 +1,8 @@ /** Preserve worktree.create’s terminal startup and prompt delivery through the shared executor. */ -import type { AgentLaunchPrompt } from '../../shared/agent-launch-intent' +import type { AgentLaunchPrompt } from '../../shared/agent-launch/contracts/agent-launch-intent' import { getRepoSshConnectionId } from '../../shared/execution-host' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { CreateWorktreeResult } from '../../shared/worktree/create-types' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import type { RuntimeManagedWorktreeCreateArgs } from '../runtime/runtime-managed-worktree-create-types' diff --git a/src/main/agent-launch/trust/agent-trust-presets.ts b/src/main/agent-launch/trust/agent-trust-presets.ts index 84397ea3194..49e93c472d7 100644 --- a/src/main/agent-launch/trust/agent-trust-presets.ts +++ b/src/main/agent-launch/trust/agent-trust-presets.ts @@ -4,7 +4,7 @@ import { dirname, join, resolve } from 'node:path' import { writeFileAtomically } from '../../codex-accounts/fs-utils' import { upsertProjectTrustLevel } from '../../codex/config-toml-trust' import { runExclusivelyForCodexTrustConfig } from '../../codex/codex-trust-config-mutation-queue' -import type { TuiAgentConfig } from '../../../shared/tui-agent-config-types' +import type { TuiAgentConfig } from '../../../shared/agent-launch/catalog/tui-agent-config-types' export type AgentTrustPreset = NonNullable diff --git a/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts b/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts index 18468407c7e..947792d965a 100644 --- a/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts +++ b/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_CONFIG, isTuiAgent } from '../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG, isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import type { GlobalSettings } from '../../../shared/global-settings-types' import { resolveTerminalWorkspacePath } from '../../../shared/terminal-startup-cwd' import { diff --git a/src/main/ai-vault/structured-chat-cli-fork.ts b/src/main/ai-vault/structured-chat-cli-fork.ts index 0f526cc5634..3f27a62b00a 100644 --- a/src/main/ai-vault/structured-chat-cli-fork.ts +++ b/src/main/ai-vault/structured-chat-cli-fork.ts @@ -2,7 +2,10 @@ import { stat } from 'node:fs/promises' import { isAbsolute, join } from 'node:path' import { getSystemCodexHomePath } from '../codex/codex-home-paths' import { codexDatedRolloutRelativePath } from '../codex/codex-session-resume-home' -import { agentForksConversations, agentForksThroughChat } from '../../shared/agent-resume-argv' +import { + agentForksConversations, + agentForksThroughChat +} from '../../shared/agent-launch/startup/agent-resume-argv' import { isLegacyAgentSessionAccountHome } from '../../shared/agent-session/lifecycle/agent-session-account-home' import { agentSessionProviderHandleChainHead } from '../../shared/agent-session/lifecycle/agent-session-provider-handle' import { pendingAgentSessionRewindFork } from '../../shared/agent-session/lifecycle/agent-session-rewind' diff --git a/src/main/ai-vault/structured-chat-conversation-copy.ts b/src/main/ai-vault/structured-chat-conversation-copy.ts index c54881c41fc..e9aae94ffc4 100644 --- a/src/main/ai-vault/structured-chat-conversation-copy.ts +++ b/src/main/ai-vault/structured-chat-conversation-copy.ts @@ -1,5 +1,5 @@ import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' -import { agentForksThroughChat } from '../../shared/agent-resume-argv' +import { agentForksThroughChat } from '../../shared/agent-launch/startup/agent-resume-argv' import { agentSessionProviderHandleChainHead } from '../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { AiVaultPrepareSessionResumeArgs, diff --git a/src/main/ai-vault/structured-session-ownership-client-audience.test.ts b/src/main/ai-vault/structured-session-ownership-client-audience.test.ts index 258d246ca74..4546804714c 100644 --- a/src/main/ai-vault/structured-session-ownership-client-audience.test.ts +++ b/src/main/ai-vault/structured-session-ownership-client-audience.test.ts @@ -5,10 +5,13 @@ import { buildAiVaultResumeCommand, buildAiVaultResumeShellCommand } from '../../shared/ai-vault-resume-command' -import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-resume-startup' -import { agentForksConversations, agentForksThroughChat } from '../../shared/agent-resume-argv' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' +import { + agentForksConversations, + agentForksThroughChat +} from '../../shared/agent-launch/startup/agent-resume-argv' import { isResumableTuiAgent } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { AgentStartupShell } from '../../shared/tui-agent-startup-shell' +import type { AgentStartupShell } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { claudeProviderHandle, codexProviderHandle diff --git a/src/main/automations/automation-agent-run-result.ts b/src/main/automations/automation-agent-run-result.ts index e2042d8e056..4d08d3c9fbf 100644 --- a/src/main/automations/automation-agent-run-result.ts +++ b/src/main/automations/automation-agent-run-result.ts @@ -1,8 +1,8 @@ -import type { AgentLaunchResult } from '../../shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../shared/agent-launch/contracts/agent-launch-intent' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import type { AutomationRun } from '../../shared/automations-types' import type { AutomationChatAgentLaunch } from './automation-chat-agent-launch' -import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../shared/agent-launch/catalog/tui-agent-display-names' import { parsePaneKey } from '../../shared/stable-pane-id' import { readAutomationRunReceipt } from './automation-run-receipt' import { AutomationRunLaunchError } from './headless-dispatch' diff --git a/src/main/automations/automation-chat-agent-launch.ts b/src/main/automations/automation-chat-agent-launch.ts index 90d97e7fa2b..107c894f63d 100644 --- a/src/main/automations/automation-chat-agent-launch.ts +++ b/src/main/automations/automation-chat-agent-launch.ts @@ -15,7 +15,7 @@ import { } from './automation-agent-run-result' import { automationRunOperationId, AUTOMATION_AGENT_CALLER } from './automation-run-operation' import { createAutomationDispatchToken } from './dispatch-tokens' -import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../shared/agent-launch/catalog/tui-agent-display-names' export type AutomationChatAgentLaunch = HeadlessAutomationDispatchLaunch & { terminalHandle: string | null diff --git a/src/main/automations/automation-run-receipt.ts b/src/main/automations/automation-run-receipt.ts index 5851b86e1bb..665b87dca72 100644 --- a/src/main/automations/automation-run-receipt.ts +++ b/src/main/automations/automation-run-receipt.ts @@ -1,5 +1,8 @@ import type { AutomationRun } from '../../shared/automations-types' -import { isAgentLaunchResult, type AgentLaunchResult } from '../../shared/agent-launch-intent' +import { + isAgentLaunchResult, + type AgentLaunchResult +} from '../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentSessionRecordStore } from '../runtime/agent-session/records/agent-session-record-store' import { rpcCallerOperationKey } from '../runtime/rpc/rpc-caller-identity' import { AUTOMATION_AGENT_CALLER, automationRunOperationId } from './automation-run-operation' diff --git a/src/main/automations/headless-automation-agent-launch.ts b/src/main/automations/headless-automation-agent-launch.ts index 96021eaedb3..b7ddf94309c 100644 --- a/src/main/automations/headless-automation-agent-launch.ts +++ b/src/main/automations/headless-automation-agent-launch.ts @@ -2,10 +2,9 @@ import { parseWorkspaceKey } from '../../shared/workspace-scope' import { getRepoExecutionHostId } from '../../shared/execution-host' // Automations observe PTYs, so launch terminal agents regardless of the chat default. -import type { - AgentLaunchPublishedSurface, - AgentLaunchSurfaceExecution -} from '../agent-launch/agent-launch-execution' +import type { AgentLaunchResult as AgentLaunchPublishedSurface } from '../../shared/agent-launch/contracts/agent-launch-intent' + +import type { AgentLaunchSurfaceExecution } from '../agent-launch/agent-launch-execution' import { executeAgentLaunch } from '../agent-launch/agent-launch-executor' import type { RuntimeTerminalCreate } from '../../shared/runtime-terminal-create-contract' import type { Automation, AutomationRun } from '../../shared/automations-types' diff --git a/src/main/automations/runtime-automation-service.ts b/src/main/automations/runtime-automation-service.ts index cab4bbfa5ab..c2223f057ce 100644 --- a/src/main/automations/runtime-automation-service.ts +++ b/src/main/automations/runtime-automation-service.ts @@ -2,7 +2,7 @@ import { observeAutomationChatRun } from './runtime-chat-run-observer' import { readAutomationRunReceipt } from './automation-run-receipt' import { publishedLaunchTarget } from './automation-agent-run-result' import { launchAutomationChatAgent } from './automation-chat-agent-launch' -import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../shared/agent-launch/catalog/tui-agent-display-names' import type { ClaudeUsageStore } from '../claude-usage/store' import type { CodexUsageStore } from '../codex-usage/store' import type { Store } from '../persistence/loading-store/store' @@ -13,7 +13,7 @@ import { getTuiAgentDetectCommands, isTuiAgent, TUI_AGENT_CONFIG -} from '../../shared/tui-agent-config' +} from '../../shared/agent-launch/catalog/tui-agent-config' import { launchHeadlessAutomationAgent, runOwnHandle } from './headless-automation-agent-launch' import { AGENT_HOOKS_REVIEW_BLOCKED_ERROR, diff --git a/src/main/automations/runtime-chat-run-observer.ts b/src/main/automations/runtime-chat-run-observer.ts index cd7a53ea2b4..ff4bd1a05a4 100644 --- a/src/main/automations/runtime-chat-run-observer.ts +++ b/src/main/automations/runtime-chat-run-observer.ts @@ -11,7 +11,7 @@ import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { getStructuredAgentSessionHost } from '../native-chat/agent-session-wire/structured-agent-session-registry' import { readAutomationRunReceipt } from './automation-run-receipt' import type { AutomationRunCompletionObservation } from './run-completion-watcher' -import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../shared/agent-launch/catalog/tui-agent-display-names' export async function observeAutomationChatRun( runtime: OrcaRuntimeService, diff --git a/src/main/claude/agent-view/agent-view-service.ts b/src/main/claude/agent-view/agent-view-service.ts index 5abbafdf043..4ac781ef983 100644 --- a/src/main/claude/agent-view/agent-view-service.ts +++ b/src/main/claude/agent-view/agent-view-service.ts @@ -3,9 +3,9 @@ import { join, resolve } from 'node:path' import { getAppEnvironment } from '../../../shared/app-environment' import type { GlobalSettings } from '../../../shared/global-settings-types' import { isAgentStatusHooksEnabledForAgent } from '../../../shared/agent-status-hooks-setting' -import { getAgentLaunchExecutableName } from '../../../shared/agent-command-line-intent' +import { getAgentLaunchExecutableName } from '../../../shared/agent-launch/startup/agent-command-line-intent' import { withTimeout } from '../../../shared/promise-timeout-fallback' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { listClaudeProfileHomesAsync } from '../../claude-accounts/claude-profile-homes' import { resolveLoginShellEnvironment } from '../../startup/login-shell-environment' import { reconcileClaudeAgentViewConfig } from './agent-view-config' diff --git a/src/main/claude/claude-agent-sdk-contract-pins.test.ts b/src/main/claude/claude-agent-sdk-contract-pins.test.ts index 6d070a84e8e..16112dc0fcf 100644 --- a/src/main/claude/claude-agent-sdk-contract-pins.test.ts +++ b/src/main/claude/claude-agent-sdk-contract-pins.test.ts @@ -14,7 +14,7 @@ import { import { afterEach, describe, expect, it, vi } from 'vitest' import { spawnProcess } from '@orca/process-host' import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' import { claudeQuerySettingsReader } from './claude-agent-sdk-control-requests' import { ClaudePromptRegistry } from './claude-prompt-registry' diff --git a/src/main/claude/claude-api-retry-row.ts b/src/main/claude/claude-api-retry-row.ts index 75c447b490a..d5f0ff4111c 100644 --- a/src/main/claude/claude-api-retry-row.ts +++ b/src/main/claude/claude-api-retry-row.ts @@ -5,7 +5,7 @@ import { } from '../../shared/agent-session/failures/agent-session-failure' import { agentSessionFailureWords } from '../../shared/agent-session/failures/agent-session-failure-words' import type { AgentJournalStatusItem } from '../../shared/agent-session/journal/agent-session-journal-types' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' export const CLAUDE_API_RETRY_FRAME_KIND = 'message:system:api_retry' diff --git a/src/main/claude/claude-command-turn.ts b/src/main/claude/claude-command-turn.ts index 827a41fc87b..d5587d14732 100644 --- a/src/main/claude/claude-command-turn.ts +++ b/src/main/claude/claude-command-turn.ts @@ -8,7 +8,7 @@ import { type ProviderDiagnostic } from '../../shared/agent-session/failures/agent-session-failure' import { agentSessionFailureWords } from '../../shared/agent-session/failures/agent-session-failure-words' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' import type { StructuredAgentSessionCommandRun } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import { structuredCompactionOutcome } from '../native-chat/agent-session-wire/structured-conversation-command-outcome' import { claudeText } from './structured/journal/claude-structured-item-translation' diff --git a/src/main/claude/structured/claude-structured-dispatch-content.ts b/src/main/claude/structured/claude-structured-dispatch-content.ts index ab24cef65e6..3d3f691bbef 100644 --- a/src/main/claude/structured/claude-structured-dispatch-content.ts +++ b/src/main/claude/structured/claude-structured-dispatch-content.ts @@ -12,7 +12,7 @@ import { agentSessionFailureWords, type AgentJournalDispatchRejection } from '../../../shared/agent-session/failures/agent-session-failure-words' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/agent-launch/catalog/tui-agent-display-names' import { claudeRecord } from './journal/claude-structured-item-translation' export class ClaudeDispatchContentError extends Error { diff --git a/src/main/claude/structured/launch/claude-structured-launch-resolution.ts b/src/main/claude/structured/launch/claude-structured-launch-resolution.ts index c706f080008..5fbfa5a0034 100644 --- a/src/main/claude/structured/launch/claude-structured-launch-resolution.ts +++ b/src/main/claude/structured/launch/claude-structured-launch-resolution.ts @@ -11,7 +11,7 @@ import type { import type { AgentChatPermissionChoice, AgentChatPermissionMode -} from '../../../../shared/agent-chat-permission-mode' +} from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { agentSessionProviderHandleKey, agentSessionProviderHandleRoot, diff --git a/src/main/codex/codex-journal-command-turn.ts b/src/main/codex/codex-journal-command-turn.ts index 66694a452d5..e66023c993f 100644 --- a/src/main/codex/codex-journal-command-turn.ts +++ b/src/main/codex/codex-journal-command-turn.ts @@ -6,7 +6,7 @@ import { agentJournalItemKey } from '../../shared/agent-session/journal/agent-se import { agentJournalTurnBody } from '../../shared/agent-session/lifecycle/agent-session-turn-record' import { providerDiagnostic } from '../../shared/agent-session/failures/agent-session-failure' import { agentSessionFailureWords } from '../../shared/agent-session/failures/agent-session-failure-words' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' import type { JournalLifecycleIdentityMutationInput } from '../native-chat/agent-session-journal/journal-row-builders' import type { StructuredAgentSessionCommandRun } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import { structuredCompactionOutcome } from '../native-chat/agent-session-wire/structured-conversation-command-outcome' diff --git a/src/main/codex/codex-minimum-version.test.ts b/src/main/codex/codex-minimum-version.test.ts index 492d52f8e79..07d0804109c 100644 --- a/src/main/codex/codex-minimum-version.test.ts +++ b/src/main/codex/codex-minimum-version.test.ts @@ -4,7 +4,7 @@ import { agentSessionRecordFixture } from '../../shared/agent-session/lifecycle/ import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' import { codexProviderHandle } from '../../shared/agent-session/lifecycle/agent-session-provider-handle-encoding' import { readWholeAgentSessionFailureFact } from '../../shared/agent-session/failures/agent-session-failure' -import { resolveAgentLaunchCommand } from '../../shared/tui-agent-launch-command' +import { resolveAgentLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-launch-command' import type { AgentCliVersionReader } from '../agent-launch/preflight/agent-cli-version-probe' import { AgentCliInstallationError } from '../native-chat/agent-cli-installation-error' import { diff --git a/src/main/codex/codex-provider-retry-row.ts b/src/main/codex/codex-provider-retry-row.ts index 9c54cf2da5d..aa3be56d509 100644 --- a/src/main/codex/codex-provider-retry-row.ts +++ b/src/main/codex/codex-provider-retry-row.ts @@ -7,7 +7,7 @@ import { } from '../../shared/agent-session/failures/agent-session-failure' import { agentSessionFailureWords } from '../../shared/agent-session/failures/agent-session-failure-words' import type { AgentJournalStatusItem } from '../../shared/agent-session/journal/agent-session-journal-types' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' import { boundPayload, PROVIDER_FRAME_PAYLOAD_LIMITS diff --git a/src/main/codex/codex-structured-dispatch-test-support.ts b/src/main/codex/codex-structured-dispatch-test-support.ts index 7a4e29d031e..8bbe8bc98f5 100644 --- a/src/main/codex/codex-structured-dispatch-test-support.ts +++ b/src/main/codex/codex-structured-dispatch-test-support.ts @@ -1,6 +1,6 @@ import { acquireReadyCodexForTest } from './codex-structured-session-adapter-fixture' import { expect, vi } from 'vitest' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentJournalMessageItem } from '../../shared/agent-session/journal/agent-session-journal-types' import type { AgentSessionJournalIdentity } from '../../shared/agent-session/journal/agent-session-journal-identity' import type { diff --git a/src/main/codex/codex-structured-launch-args.ts b/src/main/codex/codex-structured-launch-args.ts index bb9fba71b3a..29c9ef34f8d 100644 --- a/src/main/codex/codex-structured-launch-args.ts +++ b/src/main/codex/codex-structured-launch-args.ts @@ -1,4 +1,4 @@ -import { CODEX_PERMISSION_CONFIG_ROOTS } from '../../shared/agent-permission-args' +import { CODEX_PERMISSION_CONFIG_ROOTS } from '../../shared/agent-launch/permissions/agent-permission-args' import { parseTomlKeyPath } from './config-toml-key-path' import { StructuredAgentArgumentsError } from '../native-chat/structured-agent-arguments-error' diff --git a/src/main/codex/codex-structured-real-cli-permissions.test.ts b/src/main/codex/codex-structured-real-cli-permissions.test.ts index 648ff4f2f59..f27b8ccc5ba 100644 --- a/src/main/codex/codex-structured-real-cli-permissions.test.ts +++ b/src/main/codex/codex-structured-real-cli-permissions.test.ts @@ -2,7 +2,7 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' -import type { AgentChatPermissionMode } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionMode } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import { resolveCodexCommand } from '../codex-cli/command' import { openCodexAppServerConnection } from './app-server/codex-app-server-connection' import { codexStructuredPermissionPolicy } from '../../shared/codex-permission-policy' diff --git a/src/main/codex/codex-structured-session-state.ts b/src/main/codex/codex-structured-session-state.ts index fcd108a1f1e..40f3038c2b1 100644 --- a/src/main/codex/codex-structured-session-state.ts +++ b/src/main/codex/codex-structured-session-state.ts @@ -31,7 +31,7 @@ import type { } from '../native-chat/agent-model-catalog/agent-model-catalog-store' import type { StructuredAgentSessionProviderOpen } from '../native-chat/agent-session-wire/structured-agent-session-provider-open-contract' import type { NativeChatVisualsLaunch } from '../native-chat/native-chat-visuals-delivery' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { CodexSandboxPolicy } from './codex-structured-sandbox-policy' import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' diff --git a/src/main/codex/codex-structured-turn-end-settlement.ts b/src/main/codex/codex-structured-turn-end-settlement.ts index e3e28b32d57..87acd53a20e 100644 --- a/src/main/codex/codex-structured-turn-end-settlement.ts +++ b/src/main/codex/codex-structured-turn-end-settlement.ts @@ -19,7 +19,7 @@ import { readCodexTurnId, readCodexTurnStatus } from './codex-structured-thread-facts' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/agent-launch/catalog/tui-agent-display-names' import { codexAuthenticationFailure } from './codex-authentication-failure' export function codexDispatchRejection( diff --git a/src/main/codex/codex-structured-turn-permission.test.ts b/src/main/codex/codex-structured-turn-permission.test.ts index 0d317079f86..0de5752983b 100644 --- a/src/main/codex/codex-structured-turn-permission.test.ts +++ b/src/main/codex/codex-structured-turn-permission.test.ts @@ -9,7 +9,7 @@ import { } from './codex-structured-session-adapter-fixture' import { CodexAppServerRequestError } from './app-server/codex-app-server-request-error' import { expect, it, vi } from 'vitest' -import type { AgentChatPermissionMode } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionMode } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import { acquiredCodexAdapter, CODEX_TEST_THREAD_ID, diff --git a/src/main/codex/codex-structured-turn-permission.ts b/src/main/codex/codex-structured-turn-permission.ts index 7aa40ebb456..977472ae9de 100644 --- a/src/main/codex/codex-structured-turn-permission.ts +++ b/src/main/codex/codex-structured-turn-permission.ts @@ -7,7 +7,7 @@ import { type StructuredAgentSessionAdmitFreshInput, type StructuredAgentSessionInputAdmission } from '../native-chat/agent-session-wire/structured-agent-session-input-admission' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { CodexSession } from './codex-structured-session-state' import { readCodexAutoSandbox } from './codex-structured-auto-sandbox' import { codexStructuredPermissionPolicy } from '../../shared/codex-permission-policy' diff --git a/src/main/codex/codex-unverified-resume-launch.ts b/src/main/codex/codex-unverified-resume-launch.ts index 45857a253c9..0eceb1df403 100644 --- a/src/main/codex/codex-unverified-resume-launch.ts +++ b/src/main/codex/codex-unverified-resume-launch.ts @@ -1,4 +1,4 @@ -import { dropAgentResumeArgvFromCommand } from '../../shared/agent-resume-argv-drop' +import { dropAgentResumeArgvFromCommand } from '../../shared/agent-launch/startup/agent-resume-argv-drop' import type { AgentProviderSessionMetadata } from '../../shared/agent-session/lifecycle/agent-session-resume' export const UNVERIFIED_CODEX_RESUME_ERROR = diff --git a/src/main/cursor/hook-script.ts b/src/main/cursor/hook-script.ts index 3ccbd5d2a64..bad25d52af8 100644 --- a/src/main/cursor/hook-script.ts +++ b/src/main/cursor/hook-script.ts @@ -14,7 +14,7 @@ import { buildPosixGrokReplayGuardLines, buildWindowsGrokReplayGuardLines } from '../agent-hooks/grok-replay-guard' -import { quoteStartupArg } from '../../shared/tui-agent-startup-shell' +import { quoteStartupArg } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { getCursorHookResponse, type CursorEvent } from './hook-events' const CURSOR_HOOK_RESPONSE_ENV = 'ORCA_CURSOR_HOOK_RESPONSE' diff --git a/src/main/daemon/daemon-create-or-attach-result.ts b/src/main/daemon/daemon-create-or-attach-result.ts index 67c69775ed5..3d47f529a0c 100644 --- a/src/main/daemon/daemon-create-or-attach-result.ts +++ b/src/main/daemon/daemon-create-or-attach-result.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { ShellReadyState, TerminalSnapshot } from './types' import type { AgentSessionClaimedSpawnResult } from '../../shared/agent-session/agent-session-host-authority' import type { PtyIncarnationId } from '../../shared/pty-incarnation' diff --git a/src/main/daemon/daemon-terminal-admission.ts b/src/main/daemon/daemon-terminal-admission.ts index ca050381ffb..386ffd759b0 100644 --- a/src/main/daemon/daemon-terminal-admission.ts +++ b/src/main/daemon/daemon-terminal-admission.ts @@ -13,7 +13,7 @@ import { recordDaemonStreamBacklogEvent } from './daemon-stream-backlog-probe' import type { DaemonStreamDataBatcher } from './daemon-stream-data-batcher' import type { TerminalHistorySeedTransferRegistry } from './terminal-history-seed-transfer-registry' import type { CreateOrAttachOptions, CreateOrAttachResult, TerminalHost } from './terminal-host' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { isSpawnIntent } from '../../shared/host-spawn-admission' import { parsePtyStartupIngressIntent } from '../../shared/pty-startup-ingress' import { diff --git a/src/main/daemon/pty-subprocess.ts b/src/main/daemon/pty-subprocess.ts index 41f944b53cd..7cf5cd12a62 100644 --- a/src/main/daemon/pty-subprocess.ts +++ b/src/main/daemon/pty-subprocess.ts @@ -13,8 +13,8 @@ import { runPtySpawnHealthProbe } from './pty-subprocess/spawn-preflight' import { createDaemonPtySubprocessHandle } from './pty-subprocess/subprocess-handle' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../shared/tui-agent' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' const PTY_SPAWN_HEALTH_RETRY_ATTEMPTS = 2 diff --git a/src/main/daemon/pty-subprocess/shell-launch-plan.ts b/src/main/daemon/pty-subprocess/shell-launch-plan.ts index 5977f916736..0c5fd51be8e 100644 --- a/src/main/daemon/pty-subprocess/shell-launch-plan.ts +++ b/src/main/daemon/pty-subprocess/shell-launch-plan.ts @@ -38,7 +38,7 @@ import { recognizeAgentProcessFromCommandLine, type RecognizedAgentProcess } from '../../../shared/agent-process-recognition' -import { ORCA_HERMES_STARTUP_QUERY_ENV } from '../../../shared/hermes-startup-query' +import { ORCA_HERMES_STARTUP_QUERY_ENV } from '../../../shared/agent-launch/startup/hermes-startup-query' import { CLAUDE_INJECTED_CONFIG_DIR_ENV, CLAUDE_PROFILE_POINTER_ENV diff --git a/src/main/daemon/pty-subprocess/spawn-environment.ts b/src/main/daemon/pty-subprocess/spawn-environment.ts index 35e0f846aea..73381c4e34d 100644 --- a/src/main/daemon/pty-subprocess/spawn-environment.ts +++ b/src/main/daemon/pty-subprocess/spawn-environment.ts @@ -1,6 +1,6 @@ import { getLegacyOpenCodeEnvKeysToDelete } from '../../opencode/legacy-shared-config-dir' import { restoreManagedDataAccountEnvironment } from '../../../shared/managed-data-account-environment' -import { restoreOrStripOverlayEnv } from '../../../shared/agent-overlay-env' +import { restoreOrStripOverlayEnv } from '../../../shared/agent-launch/startup/agent-overlay-env' import { delimiter } from 'node:path' import { dropInheritedOrcaFishHistory } from '../../pty/history/fish-history-session' import { removeAppImageRuntimeEnv } from '../../pty/shell-startup/appimage-terminal-env' @@ -26,7 +26,7 @@ import { expandWindowsPathEnvironmentVariables } from '../../../shared/windows-environment-expansion' import { applyScrubSafeAgentEnvAliases } from '../../../shared/agent-hook-scrub-safe-env' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { PtySubprocessOptions } from '../pty-subprocess' import { REMOTE_VIEWER_CLIPBOARD_ENV } from '../../../shared/remote-viewer-clipboard-env' import { ORCAD_SERVER_LAUNCH_ENV_KEYS } from '../../../shared/orcad-server-launch-env' diff --git a/src/main/daemon/session-options.ts b/src/main/daemon/session-options.ts index caadfac2ec8..cbd92dc3710 100644 --- a/src/main/daemon/session-options.ts +++ b/src/main/daemon/session-options.ts @@ -1,5 +1,5 @@ import type { SubprocessHandle } from './session-subprocess-handle' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { PtyStartupIngressIntent } from '../../shared/pty-startup-ingress' import type { PtyOwnerBackend } from '../../shared/pty-owner-backend' import type { WslGuestRoot } from '../../shared/wsl-guest-root-marker' diff --git a/src/main/daemon/session.test.ts b/src/main/daemon/session.test.ts index 7aaf30a1da6..3ae29c06ac8 100644 --- a/src/main/daemon/session.test.ts +++ b/src/main/daemon/session.test.ts @@ -6,7 +6,7 @@ import { SESSION_FORCE_KILL_RETRY_MS } from './session-termination-controller' import type { SessionState, ShellReadyState } from './types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { _resetPtyOwnerHostColorsForTest, setPtyOwnerHostColors diff --git a/src/main/daemon/session.ts b/src/main/daemon/session.ts index 6e1cd14a4d3..7345957291e 100644 --- a/src/main/daemon/session.ts +++ b/src/main/daemon/session.ts @@ -9,7 +9,7 @@ import { SessionTerminationController } from './session-termination-controller' import { SessionProcessInspection } from './session-process-inspection' import type { JobTerminationOutcome } from '../windows/windows-pty-job' import type { SessionOptions } from './session-options' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { randomUUID } from 'node:crypto' import { PtyStartupIngress } from '../../shared/pty-startup-ingress' diff --git a/src/main/daemon/terminal-host-create-contract.ts b/src/main/daemon/terminal-host-create-contract.ts index 99d57a8a7af..f26bae7acf5 100644 --- a/src/main/daemon/terminal-host-create-contract.ts +++ b/src/main/daemon/terminal-host-create-contract.ts @@ -1,5 +1,5 @@ -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../shared/tui-agent' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { ShellReadyState, TerminalSnapshot } from './types' import type { PtyStartupIngressIntent } from '../../shared/pty-startup-ingress' import type { diff --git a/src/main/daemon/terminal-host-options.ts b/src/main/daemon/terminal-host-options.ts index 8c70339eec0..2106186d85d 100644 --- a/src/main/daemon/terminal-host-options.ts +++ b/src/main/daemon/terminal-host-options.ts @@ -1,6 +1,6 @@ import type { PtyCreationDisposition } from '../../shared/claimed-agent-pty-owner' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../shared/tui-agent' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { SubprocessHandle } from './session-subprocess-handle' import type { TakePendingOutputResult, TerminalSnapshot } from './types' import type { TerminalSpawnGate } from './terminal-spawn-gate' diff --git a/src/main/daemon/terminal-host.test.ts b/src/main/daemon/terminal-host.test.ts index 923be8045ed..ea9e95c7002 100644 --- a/src/main/daemon/terminal-host.test.ts +++ b/src/main/daemon/terminal-host.test.ts @@ -4,7 +4,7 @@ import { Session } from './session' import { IMMEDIATE_KILL_PHYSICAL_EXIT_TIMEOUT_MS } from './session-termination-controller' import type { SubprocessHandle } from './session-subprocess-handle' import { TerminalHost } from './terminal-host' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' const killWithDescendantSweepMock = vi.hoisted(() => vi.fn()) vi.mock('../pty/process-retirement/pty-descendant-termination', () => ({ diff --git a/src/main/daemon/terminal-session-teardown.test.ts b/src/main/daemon/terminal-session-teardown.test.ts index a4c2abc3983..2d54dbb2609 100644 --- a/src/main/daemon/terminal-session-teardown.test.ts +++ b/src/main/daemon/terminal-session-teardown.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { TerminalSessionTeardown } from './terminal-session-teardown' import type { Session } from './session' import type { DescendantSnapshot } from '../pty/process-retirement/pty-descendant-termination' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' const killWithDescendantSweepMock = vi.hoisted(() => vi.fn()) const terminateShutdownDescendantsMock = vi.hoisted(() => vi.fn()) diff --git a/src/main/daemon/types.ts b/src/main/daemon/types.ts index 06ca023e492..9026cdb7ff3 100644 --- a/src/main/daemon/types.ts +++ b/src/main/daemon/types.ts @@ -22,8 +22,8 @@ export type { InspectProcessRequest } from './daemon-foreground-process-protocol' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../shared/tui-agent' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { PtyStartupIngressIntent } from '../../shared/pty-startup-ingress' import type { AgentSessionExecutionClaim, diff --git a/src/main/external-conversations/external-conversation-start.ts b/src/main/external-conversations/external-conversation-start.ts index 2780178a019..9ea12a8dad4 100644 --- a/src/main/external-conversations/external-conversation-start.ts +++ b/src/main/external-conversations/external-conversation-start.ts @@ -1,8 +1,11 @@ -import type { AgentLaunchResult } from '../../shared/agent-launch-intent' +import type { + AgentLaunchResult, + AgentLaunchResult as AgentLaunchPublishedSurface +} from '../../shared/agent-launch/contracts/agent-launch-intent' import type { ConnectorAgent } from '../../shared/external-conversation-link' import type { AgentLaunchParams } from '../../shared/rpc-contract/agent-launch-params' import { executeAgentLaunch } from '../agent-launch/agent-launch-executor' -import type { AgentLaunchPublishedSurface } from '../agent-launch/agent-launch-execution' + import { agentPaneWorkspace, type AgentPaneWorkspace diff --git a/src/main/external-conversations/external-conversation.test-fixture.ts b/src/main/external-conversations/external-conversation.test-fixture.ts index 310dbf66705..47e1d3b76e1 100644 --- a/src/main/external-conversations/external-conversation.test-fixture.ts +++ b/src/main/external-conversations/external-conversation.test-fixture.ts @@ -1,5 +1,8 @@ import { vi } from 'vitest' -import type { AgentLaunchResult } from '../../shared/agent-launch-intent' +import type { + AgentLaunchResult, + AgentLaunchResult as AgentLaunchPublishedSurface +} from '../../shared/agent-launch/contracts/agent-launch-intent' import type { ExecutionHostId } from '../../shared/execution-host' import type { Repo } from '../../shared/repo-types' import type { PtyLivenessVerdict } from '../../shared/pty-liveness-verdict' @@ -7,7 +10,7 @@ import type { RuntimeTerminalSend } from '../../shared/runtime-terminal-send-con import type { HostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import type { AgentPaneWorkspace } from '../agent-hooks/agent-transition-detector' import type { LaunchedAgentForeground } from '../runtime/launched-agent-foreground' -import type { AgentLaunchPublishedSurface } from '../agent-launch/agent-launch-execution' + import type { ExternalConversationLinkStore } from './external-conversation-links' import type { AgentStatusIpcPayload } from '../../shared/agent-status-ipc-payload' import type { RuntimeTerminalWait } from '../../shared/runtime-terminal-contracts' diff --git a/src/main/ipc/dashboard-agent-launch-validation.ts b/src/main/ipc/dashboard-agent-launch-validation.ts index 3c36b9857e0..d364a6e5edf 100644 --- a/src/main/ipc/dashboard-agent-launch-validation.ts +++ b/src/main/ipc/dashboard-agent-launch-validation.ts @@ -1,5 +1,5 @@ import { DASHBOARD_MAX_LAUNCH_WORKTREES } from '../../shared/dashboard-snapshot' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' const MAX_ID_LENGTH = 4_096 const MAX_AGENTS_PER_WORKTREE = 64 diff --git a/src/main/ipc/desktop-renderer-runtime-capabilities.ts b/src/main/ipc/desktop-renderer-runtime-capabilities.ts index 91d795a11dd..7ab651b2b56 100644 --- a/src/main/ipc/desktop-renderer-runtime-capabilities.ts +++ b/src/main/ipc/desktop-renderer-runtime-capabilities.ts @@ -7,7 +7,7 @@ import { AGENT_LAUNCH_PROMPT_UNCONFIRMED_RUNTIME_CAPABILITY, AGENT_LAUNCH_RUNTIME_CAPABILITY, AGENT_LAUNCH_TAB_CLOSED_CLIENT_CAPABILITY -} from '../../shared/agent-launch-runtime-capability' +} from '../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { TERMINAL_QUICK_COMMAND_LARGE_LISTS_RUNTIME_CAPABILITY, TERMINAL_QUICK_COMMAND_LONG_PROMPTS_RUNTIME_CAPABILITY diff --git a/src/main/ipc/filesystem/filesystem-git-model-discovery-handlers.ts b/src/main/ipc/filesystem/filesystem-git-model-discovery-handlers.ts index 2e879cc8037..03ea1c0ebff 100644 --- a/src/main/ipc/filesystem/filesystem-git-model-discovery-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-model-discovery-handlers.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { CommitMessageAgentRuntimeTarget } from '../../text-generation/commit-message-agent-environment' import { discoverCommitMessageModelsLocal, diff --git a/src/main/ipc/pty/host-env/assembly.ts b/src/main/ipc/pty/host-env/assembly.ts index 83f4e3a5d99..0cc3581db40 100644 --- a/src/main/ipc/pty/host-env/assembly.ts +++ b/src/main/ipc/pty/host-env/assembly.ts @@ -19,7 +19,7 @@ import { mergePersistedWindowsPath } from '../../../pty/environment/windows-envi import { resolveCodexShellLaunchPreflightCommand } from '../../../pty/shell-startup/codex-shell-launch-preflight' import { scheduleCodexHookReconcile } from '../../../codex/codex-hook-reconcile' import { buildConfiguredProxyEnv } from '../../../../shared/network-proxy' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import type { BuildPtyHostEnvOptions } from './types' import { stripInheritedOrcaCodexHomeOverride } from './codex-home' import { @@ -30,7 +30,7 @@ import { resolvePiAgentSourceDir, resolveScopedPiAgentSourceDir } from './pi-agent' -import { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env' +import { restoreOrStripOverlayEnv } from '../../../../shared/agent-launch/startup/agent-overlay-env' import { AGENT_HOOK_RUNTIME_ENV_KEYS } from './spawn-env-keys' import { applyManagedDataAccountEnvironment } from '../../../managed-data-accounts/launch-environment' import { applyOpenCodeStatusPluginEnv, captureOpenCodeSourceConfig } from './opencode-config' diff --git a/src/main/ipc/pty/host-env/claude-agent-view.ts b/src/main/ipc/pty/host-env/claude-agent-view.ts index 07bc2425f9f..eec40826b4d 100644 --- a/src/main/ipc/pty/host-env/claude-agent-view.ts +++ b/src/main/ipc/pty/host-env/claude-agent-view.ts @@ -1,5 +1,5 @@ import { delimiter } from 'node:path' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getClaudeAgentViewService } from '../../../claude/agent-view/agent-view-service' import type { BuildPtyHostEnvOptions } from './types' diff --git a/src/main/ipc/pty/host-env/codex-resume.ts b/src/main/ipc/pty/host-env/codex-resume.ts index 28a9bc412bf..92a6bc86e9c 100644 --- a/src/main/ipc/pty/host-env/codex-resume.ts +++ b/src/main/ipc/pty/host-env/codex-resume.ts @@ -1,10 +1,10 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { normalizeAgentProviderSession, type AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import { SETUP_AGENT_SEQUENCE_STARTUP_COMMAND_ENV } from '../../../../shared/setup-agent-sequencing' -import { dropAgentResumeArgvFromCommand } from '../../../../shared/agent-resume-argv-drop' +import { dropAgentResumeArgvFromCommand } from '../../../../shared/agent-launch/startup/agent-resume-argv-drop' import type { CodexAccountSelectionTarget } from '../../../codex-accounts/runtime-selection' import { dropUnverifiedCodexResumeArgv } from '../../../codex/codex-unverified-resume-launch' import type { CodexSessionResumePreparation } from '../../../codex/codex-session-resume-home' diff --git a/src/main/ipc/pty/host-env/opencode-config.ts b/src/main/ipc/pty/host-env/opencode-config.ts index 89a4cdaa4e5..11299d46f29 100644 --- a/src/main/ipc/pty/host-env/opencode-config.ts +++ b/src/main/ipc/pty/host-env/opencode-config.ts @@ -4,9 +4,9 @@ import { } from '../../../opencode/legacy-shared-config-dir' import { openCode2HookService, openCodeHookService } from '../../../opencode/hook-service' import { resolveOpenCodeSourceConfigDir } from './pi-agent' -import { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env' +import { restoreOrStripOverlayEnv } from '../../../../shared/agent-launch/startup/agent-overlay-env' import { selectOpenCodeHookAgent } from '../../../../shared/opencode-launch-command' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { resolveOpenCodeConfigDirectory } from '../../../../shared/opencode-config-directory' import { readSessionShellStartupEnvVar } from '../../../pty/shell-startup/shell-startup-env' import type { BuildPtyHostEnvOptions } from './types' diff --git a/src/main/ipc/pty/host-env/pi-agent.ts b/src/main/ipc/pty/host-env/pi-agent.ts index 6ba922d05fc..5b2c7a24146 100644 --- a/src/main/ipc/pty/host-env/pi-agent.ts +++ b/src/main/ipc/pty/host-env/pi-agent.ts @@ -4,7 +4,7 @@ import { type PiAgentKind } from '../../../../shared/pi-agent-kind' import { readSessionShellStartupEnvVar } from '../../../pty/shell-startup/shell-startup-env' -import { getAgentLaunchExecutableName } from '../../../../shared/agent-command-line-intent' +import { getAgentLaunchExecutableName } from '../../../../shared/agent-launch/startup/agent-command-line-intent' import { AGENT_HOOK_RUNTIME_ENV_KEYS, CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS, diff --git a/src/main/ipc/pty/host-env/remote-viewer-clipboard-env.ts b/src/main/ipc/pty/host-env/remote-viewer-clipboard-env.ts index 71a96380f39..40c5f98190a 100644 --- a/src/main/ipc/pty/host-env/remote-viewer-clipboard-env.ts +++ b/src/main/ipc/pty/host-env/remote-viewer-clipboard-env.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { CODEX_REMOTE_VIEWER_SSH_CONNECTION, REMOTE_VIEWER_CLIPBOARD_ENV diff --git a/src/main/ipc/pty/host-env/saved-resume-admission.ts b/src/main/ipc/pty/host-env/saved-resume-admission.ts index d9a5643f5db..054a63bca98 100644 --- a/src/main/ipc/pty/host-env/saved-resume-admission.ts +++ b/src/main/ipc/pty/host-env/saved-resume-admission.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { normalizeAgentProviderSession, agentProviderSessionsEqual, diff --git a/src/main/ipc/pty/host-env/types.ts b/src/main/ipc/pty/host-env/types.ts index 70c82eb8cac..6e09b5183ba 100644 --- a/src/main/ipc/pty/host-env/types.ts +++ b/src/main/ipc/pty/host-env/types.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { NetworkProxySettings } from '../../../../shared/network-proxy' import type { ClaudeRuntimeAuthPreparation } from '../../../claude-accounts/runtime-auth-service' diff --git a/src/main/ipc/pty/ipc/spawn-agent-launch-end.ts b/src/main/ipc/pty/ipc/spawn-agent-launch-end.ts index 5e3ca1de6b9..9ee747cefeb 100644 --- a/src/main/ipc/pty/ipc/spawn-agent-launch-end.ts +++ b/src/main/ipc/pty/ipc/spawn-agent-launch-end.ts @@ -6,10 +6,10 @@ import { AGENT_LAUNCH_PANE_REFUSED_CODE, type AgentLaunchPaneAddress, type AgentLaunchPaneVerdict -} from '../../../../shared/agent-launch-pane-verdict' -import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch-tab-closed' +} from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' +import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' import type { RunningAgentLaunchPane } from '../../../agent-launch/agent-launch-pane-attachment' -import type { AgentLaunchRuntime } from '../../../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import { agentLaunchFailureCode } from '../../../runtime/rpc/methods/agent-launch-failure-code' import type { PtyIpcSpawnState } from './spawn-state' diff --git a/src/main/ipc/pty/ipc/spawn-agent-launch.ts b/src/main/ipc/pty/ipc/spawn-agent-launch.ts index f413ae0f1e0..836c3642f0d 100644 --- a/src/main/ipc/pty/ipc/spawn-agent-launch.ts +++ b/src/main/ipc/pty/ipc/spawn-agent-launch.ts @@ -1,9 +1,9 @@ import { randomUUID } from 'node:crypto' import { AgentLaunch } from '../../../../shared/rpc-contract/agent-launch-params' -import { toAgentLaunchPreferences } from '../../../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../../../shared/agent-launch/choices/agent-launch-preferences' import { hasClosedTerminalTabRecord } from '../../../../shared/closed-terminal-tab-tombstones' import { parsePaneKey } from '../../../../shared/stable-pane-id' -import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch-tab-closed' +import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' import { trackRunningAgentLaunchPane } from '../../../agent-launch/agent-launch-pane-attachment' import { agentLaunchTokenFor } from '../../../agent-launch/agent-launch-token' import { resolveUnlaunchedIntent } from '../../../runtime/rpc/methods/agent-launch-intent-resolution' diff --git a/src/main/ipc/pty/ipc/spawn-begin.ts b/src/main/ipc/pty/ipc/spawn-begin.ts index 06a89a4c1fb..9df9689a04b 100644 --- a/src/main/ipc/pty/ipc/spawn-begin.ts +++ b/src/main/ipc/pty/ipc/spawn-begin.ts @@ -1,6 +1,6 @@ import { resolveEarlyPaneKey as resolvePaneCoordinates } from '../spawn-pane-coordinates' import { resolveAgentLaunchPaneVerdict } from '../../../agent-launch/agent-launch-pane-attachment' -import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch-pane-verdict' +import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { agentLaunchPaneLiveness } from '../pane/agent-launch-pane-evidence' import { makePaneSpawnReservationKey } from '../pane/spawn-reservation' import type { PtyIpcSpawnState } from './spawn-state' diff --git a/src/main/ipc/pty/ipc/spawn-qoder-command.ts b/src/main/ipc/pty/ipc/spawn-qoder-command.ts index 505490bc5d8..3cd353cc08f 100644 --- a/src/main/ipc/pty/ipc/spawn-qoder-command.ts +++ b/src/main/ipc/pty/ipc/spawn-qoder-command.ts @@ -1,5 +1,5 @@ import { resolveQoderTerminalCommand } from '../../../runtime/qoder-terminal-command-resolution' -import { resolveStartupShell } from '../../../../shared/tui-agent-startup-shell' +import { resolveStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../../../shared/windows-terminal-shell' import type { PtyIpcSpawnState } from './spawn-state' diff --git a/src/main/ipc/pty/ipc/spawn-run.ts b/src/main/ipc/pty/ipc/spawn-run.ts index bd168d560b0..af9d4c6ff75 100644 --- a/src/main/ipc/pty/ipc/spawn-run.ts +++ b/src/main/ipc/pty/ipc/spawn-run.ts @@ -1,4 +1,4 @@ -import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch-pane-verdict' +import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { requireAcceptedSpawn } from '../spawn-outcome' import { runPtySpawn, normalizePtySpawnSessionId } from '../spawn-operation' import { checkPtyIpcLaunchPane, resolveEarlyPaneKey } from './spawn-begin' diff --git a/src/main/ipc/pty/ipc/spawn-types.ts b/src/main/ipc/pty/ipc/spawn-types.ts index 48a433bf32e..9fac7a18f55 100644 --- a/src/main/ipc/pty/ipc/spawn-types.ts +++ b/src/main/ipc/pty/ipc/spawn-types.ts @@ -1,13 +1,13 @@ import type { PtySpawnOutcome } from '../spawn-outcome' import type { PaneSpawnReservation } from '../pane/spawn-reservation' import type { PaneSpawnOperation } from '../pane/pane-spawn-operation' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/project-execution-runtime' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { TerminalStartupCwdMissingDirFallback } from '../../../../shared/terminal-startup-cwd' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' diff --git a/src/main/ipc/pty/pane-agent-launch.test-fixture.ts b/src/main/ipc/pty/pane-agent-launch.test-fixture.ts index 51fc99aa772..9c03c0e60b4 100644 --- a/src/main/ipc/pty/pane-agent-launch.test-fixture.ts +++ b/src/main/ipc/pty/pane-agent-launch.test-fixture.ts @@ -1,7 +1,7 @@ import { vi } from 'vitest' import { OrcaRuntimeService } from '../../runtime/orca-runtime' import { partialRuntimeStore } from '../../runtime/runtime-store-partial-fixture' -import type { AgentStartupSettings } from '../../../shared/agent-startup-plan-inputs' +import type { AgentStartupSettings } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' import type { PtySpawnIpcArgs } from './ipc/spawn-types' import { createPtyIpcSpawnState } from './ipc/spawn-state' import { planPaneAgentLaunch } from './ipc/spawn-agent-launch' diff --git a/src/main/ipc/pty/pane/launch-authority.ts b/src/main/ipc/pty/pane/launch-authority.ts index 4ee2a15decd..f3cd89bf0d0 100644 --- a/src/main/ipc/pty/pane/launch-authority.ts +++ b/src/main/ipc/pty/pane/launch-authority.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import type { SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import { isPtyIncarnationId } from '../../../../shared/pty-incarnation' diff --git a/src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts b/src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts index 8b8e7eea85c..3b71e1c3278 100644 --- a/src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts +++ b/src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts @@ -9,7 +9,7 @@ import { resetAgentLaunchPanesForTests, trackRunningAgentLaunchPane } from '../../agent-launch/agent-launch-pane-attachment' -import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../shared/agent-launch-pane-verdict' +import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { endPaneAgentLaunch } from './ipc/spawn-agent-launch-end' import { createPtyIpcSpawnState } from './ipc/spawn-state' import { OrcaRuntimeService } from '../../runtime/orca-runtime' diff --git a/src/main/ipc/pty/pty-daemon-spawn-agent-home-env.test.ts b/src/main/ipc/pty/pty-daemon-spawn-agent-home-env.test.ts index a7498e2f171..6f3194833ad 100644 --- a/src/main/ipc/pty/pty-daemon-spawn-agent-home-env.test.ts +++ b/src/main/ipc/pty/pty-daemon-spawn-agent-home-env.test.ts @@ -6,7 +6,7 @@ import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures' import { delimiter, join } from 'node:path' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS } from '../../pty/shell-startup/legacy-terminal-shim-dir' import { wslHookRelayManager } from '../../agent-hooks/wsl-hook-relay-manager' import { registerPtyHandlers } from './register-handlers' diff --git a/src/main/ipc/pty/pty-ipc-daemon-provider-fixtures.ts b/src/main/ipc/pty/pty-ipc-daemon-provider-fixtures.ts index 5c2ccf09ac7..ec83a08c091 100644 --- a/src/main/ipc/pty/pty-ipc-daemon-provider-fixtures.ts +++ b/src/main/ipc/pty/pty-ipc-daemon-provider-fixtures.ts @@ -1,5 +1,5 @@ import { vi } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { registerPtyHandlers } from './register-handlers' import { setLocalPtyProvider } from './provider/registry' diff --git a/src/main/ipc/pty/pty-ipc-spawn-drivers.ts b/src/main/ipc/pty/pty-ipc-spawn-drivers.ts index a068810cc97..b8712cd4afa 100644 --- a/src/main/ipc/pty/pty-ipc-spawn-drivers.ts +++ b/src/main/ipc/pty/pty-ipc-spawn-drivers.ts @@ -1,5 +1,5 @@ import { vi } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { registerPtyHandlers } from './register-handlers' import { accessSyncMock, spawnMock, statSyncMock } from './pty-ipc-mock-registry' import { BUNDLED_CLI_PATH, BUNDLED_RESOURCES_PATH } from './pty-ipc-test-constants' diff --git a/src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts b/src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts index 95b8751a460..f72e3830066 100644 --- a/src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts +++ b/src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts @@ -3,7 +3,7 @@ import { buildPtyHostEnv } from './host-env/assembly' import { registerPtyHandlers } from './register-handlers' import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures' import { join } from 'node:path' -import { withFreshOmpLaunch } from '../../../shared/omp-fresh-launch' +import { withFreshOmpLaunch } from '../../../shared/agent-launch/startup/omp-fresh-launch' import { describe, expect, it, vi } from 'vitest' import { readFileSyncMock, diff --git a/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts b/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts index 2235f0b3aa3..b980ee3ca1d 100644 --- a/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts +++ b/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts @@ -1,4 +1,4 @@ -import { withFreshOmpLaunch } from '../../../shared/omp-fresh-launch' +import { withFreshOmpLaunch } from '../../../shared/agent-launch/startup/omp-fresh-launch' import { describe, expect, it, vi } from 'vitest' import { piBuildPtyEnvMock, diff --git a/src/main/ipc/pty/runtime/spawn-state.ts b/src/main/ipc/pty/runtime/spawn-state.ts index 3d15c8113e2..769bb1a6212 100644 --- a/src/main/ipc/pty/runtime/spawn-state.ts +++ b/src/main/ipc/pty/runtime/spawn-state.ts @@ -3,7 +3,7 @@ import type { PtySpawnSizeSeed } from '../spawn-options-assembly' import type { PtySpawnOutcome } from '../spawn-outcome' import type { PtyRegistrationClaim } from '../../../runtime/runtime-terminal-state-records' import type { PaneSpawnOperation } from '../pane/pane-spawn-operation' -import type { AgentLaunchRuntime } from '../../../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' import type { SpawnIntent } from '../../../../shared/host-spawn-admission' import type { IPtyProvider, @@ -20,12 +20,12 @@ import type { PtyBindingSourceExpectation } from '../../../persistence/loading-s import type { TerminalPanePlacement } from '../../../../shared/terminal-pane-placement' import type { ResumeSpawnAdmission } from '../host-env/saved-resume-admission' import type { PtyRuntimeControllerDeps } from './controller-deps' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SleepingAgentLaunchConfig, AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { AgentSessionExecutionClaim, AgentSessionSurfaceBinding diff --git a/src/main/ipc/pty/spawn-agent-launch-plugin-hook.ts b/src/main/ipc/pty/spawn-agent-launch-plugin-hook.ts index 06ba81364f4..1f40b016f43 100644 --- a/src/main/ipc/pty/spawn-agent-launch-plugin-hook.ts +++ b/src/main/ipc/pty/spawn-agent-launch-plugin-hook.ts @@ -1,6 +1,6 @@ import { PLUGIN_HOOK_SPECS } from '../../../shared/plugins/events/plugin-hook-payloads' import { isRestoreSpawnIntent } from '../../../shared/host-spawn-admission' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { workspaceKindForWorktreeId } from '../../../shared/workspace-launch-kind' import { pluginHookWanted, runPluginHook } from '../../plugins/hooks/plugin-hook-dispatch' import { assertLegacyAiVaultResumeCommandAllowed } from '../../ai-vault/structured-session-ownership' diff --git a/src/main/ipc/pty/spawn-commit-assembly.ts b/src/main/ipc/pty/spawn-commit-assembly.ts index f708ec00b70..b37c272638c 100644 --- a/src/main/ipc/pty/spawn-commit-assembly.ts +++ b/src/main/ipc/pty/spawn-commit-assembly.ts @@ -3,7 +3,7 @@ import type { PtySpawnSizeSeed } from './spawn-options-assembly' import { isValidTerminalTabId } from '../../../shared/terminal-tab-id' import type { AgentSessionClaimedSpawnResult } from '../../../shared/agent-session/agent-session-host-authority' import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { Store, PtyBindingSourceExpectation } from '../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { PtyRegistrationClaim } from '../../runtime/runtime-terminal-state-records' diff --git a/src/main/ipc/pty/spawn-host-env.ts b/src/main/ipc/pty/spawn-host-env.ts index 44317683066..eb453149142 100644 --- a/src/main/ipc/pty/spawn-host-env.ts +++ b/src/main/ipc/pty/spawn-host-env.ts @@ -4,8 +4,8 @@ import { getAppEnvironment } from '../../../shared/app-environment' import type { GlobalSettings } from '../../../shared/global-settings-types' import { stampRuntimeSourceEnv } from '../../../shared/runtime-source-env' import { SETUP_AGENT_SEQUENCE_SETUP_SCRIPT_ENV } from '../../../shared/setup-agent-sequencing' -import type { TuiAgent } from '../../../shared/tui-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { addWslEnvKeys } from '../../../shared/wsl-env' import { isAgentStatusHooksEnabled } from '../../agent-hooks/managed-agent-hook-controls' import { awaitExplicitAgentPluginGuestReadiness } from '../../agent-hooks/wsl-agent-plugin-readiness' diff --git a/src/main/ipc/pty/spawn-options-agent-workspace-trust.test.ts b/src/main/ipc/pty/spawn-options-agent-workspace-trust.test.ts index ebddfd7990d..9a359f7e738 100644 --- a/src/main/ipc/pty/spawn-options-agent-workspace-trust.test.ts +++ b/src/main/ipc/pty/spawn-options-agent-workspace-trust.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { ClaudeRuntimeAuthPreparation } from '../../claude-accounts/runtime-auth/runtime-auth-types' import { getDefaultSettings } from '../../../shared/constants' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import * as openCodeCapabilities from '../../opencode/opencode-launch-capabilities' const applyAgentWorkspaceTrust = vi.hoisted(() => diff --git a/src/main/ipc/pty/spawn-options-assembly.ts b/src/main/ipc/pty/spawn-options-assembly.ts index 2c84eb9ed17..6afb7c3ed6e 100644 --- a/src/main/ipc/pty/spawn-options-assembly.ts +++ b/src/main/ipc/pty/spawn-options-assembly.ts @@ -1,9 +1,9 @@ import { withClaudeAgentViewPlugin } from '../../../shared/claude-agent-view-launch' -import { resolveStartupShell } from '../../../shared/tui-agent-startup-shell' +import { resolveStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../../shared/windows-terminal-shell' import { getAppEnvironment } from '../../../shared/app-environment' import type { GlobalSettings } from '../../../shared/global-settings-types' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { withCodexTerminalServerIsolationEnv } from '../../../shared/codex-terminal-server-isolation' import { getLegacyOpenCodeEnvKeysToDelete } from '../../opencode/legacy-shared-config-dir' import { prepareOpenCodePtyLaunch } from '../../opencode/opencode-pty-launch' diff --git a/src/main/ipc/qoder-desktop-execution-host.test.ts b/src/main/ipc/qoder-desktop-execution-host.test.ts index 16431b3de40..29b58fbd05b 100644 --- a/src/main/ipc/qoder-desktop-execution-host.test.ts +++ b/src/main/ipc/qoder-desktop-execution-host.test.ts @@ -8,7 +8,7 @@ import { detectWslCommandsOnPath } from './preflight-wsl-agent-detection' import type * as FsPromises from 'node:fs/promises' import type { Store } from '../persistence/loading-store/store' import type { FolderWorkspace } from '../../shared/folder-workspace-types' -import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-resume-startup' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' import type { PtySpawnIpcArgs } from './pty/ipc/spawn-types' vi.mock('./command-path/command-path-resolver', async (importOriginal) => ({ diff --git a/src/main/ipc/qoder-independent-renderer-spawn-review.test.ts b/src/main/ipc/qoder-independent-renderer-spawn-review.test.ts index 9fd7e8b7cf3..4599c632efc 100644 --- a/src/main/ipc/qoder-independent-renderer-spawn-review.test.ts +++ b/src/main/ipc/qoder-independent-renderer-spawn-review.test.ts @@ -3,8 +3,8 @@ import { setupPtyIpcSuite } from './pty/pty-ipc-test-harness' import { createDaemonActiveProviderFixtures } from './pty/pty-ipc-daemon-provider-fixtures' import { registerPtyHandlers } from './pty/register-handlers' import { detectAgentCommandsOnHost } from '../preflight/agent-command-detection' -import { buildAgentStartupPlan } from '../../shared/tui-agent-startup' -import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-resume-startup' +import { buildAgentStartupPlan } from '../../shared/agent-launch/startup/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' import { trackMock } from './pty/pty-ipc-mock-registry' diff --git a/src/main/ipc/repos/repo-ipc-arg-schemas.ts b/src/main/ipc/repos/repo-ipc-arg-schemas.ts index 1cac2d6fb5e..7ca1a239000 100644 --- a/src/main/ipc/repos/repo-ipc-arg-schemas.ts +++ b/src/main/ipc/repos/repo-ipc-arg-schemas.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { TaskSourceContextSchema } from '../../../shared/task-source-context-schema' import { WorkspaceLinkedItemSchema } from '../../../shared/workspace-linked-item-schema' import { WorkspaceAttachmentsSchema } from '../../../shared/workspace-attachment-schema' diff --git a/src/main/ipc/settings.ts b/src/main/ipc/settings.ts index 5bd02fdfea9..12765c73091 100644 --- a/src/main/ipc/settings.ts +++ b/src/main/ipc/settings.ts @@ -31,7 +31,7 @@ import { scheduleCurrentWorktreeBaseDirectoryWatcherSync } from './worktrees/cre import { applyPRBotAuthorOverride } from '../../shared/pr-bot-author-overrides' import { resolveEnvironment } from '../../shared/runtime-environment-store' import { readSettingsWithRuntimeEnvironmentPreference } from './runtime-environments/runtime-environment-preference' -import { haveSameDisabledTuiAgents } from '../../shared/tui-agent-selection' +import { haveSameDisabledTuiAgents } from '../../shared/agent-launch/catalog/tui-agent-selection' import { normalizeMobilePairingCustomAddress, normalizeMobilePairingCustomAddresses diff --git a/src/main/ipc/terminal-startup-color-query-replies.ts b/src/main/ipc/terminal-startup-color-query-replies.ts index 2907cc764a7..fef2b2d58f2 100644 --- a/src/main/ipc/terminal-startup-color-query-replies.ts +++ b/src/main/ipc/terminal-startup-color-query-replies.ts @@ -1,7 +1,7 @@ import { parsePtyStartupIngressIntent } from '../../shared/pty-startup-ingress-intent' import { normalizeColorQueryReplyColors } from '../../shared/pty-owner-color-query-colors' -import { recognizeAgentLaunchCommand } from '../../shared/agent-command-line-intent' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { recognizeAgentLaunchCommand } from '../../shared/agent-launch/startup/agent-command-line-intent' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { agentKindSchema } from '../../shared/telemetry-events' import type { SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' diff --git a/src/main/ipc/worktree-remote.ts b/src/main/ipc/worktree-remote.ts index c5eccfd4990..3c99d11c8ef 100644 --- a/src/main/ipc/worktree-remote.ts +++ b/src/main/ipc/worktree-remote.ts @@ -62,7 +62,7 @@ import { getEffectiveHooksFromConfig, shouldRunSetupForCreate } from '../workspace-hooks/effective-hook-config' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { runWorktreeChangeInvalidators } from './worktrees/listing/worktree-change-invalidators' type CreateWorktreeArgsWithSystemProvenance = CreateWorktreeArgs & { diff --git a/src/main/managed-data-accounts/launch-environment.ts b/src/main/managed-data-accounts/launch-environment.ts index 6066d39f4c5..2f6f5faefa5 100644 --- a/src/main/managed-data-accounts/launch-environment.ts +++ b/src/main/managed-data-accounts/launch-environment.ts @@ -1,8 +1,8 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { ManagedDataAccountProvider } from '../../shared/managed-account-types' import { getManagedDataAccountService, type ManagedDataAccountService } from './service' import { MANAGED_DATA_ACCOUNT_BASELINE_ENV_KEYS } from '../../shared/managed-data-account-environment' -import { getAgentLaunchExecutableName } from '../../shared/agent-command-line-intent' +import { getAgentLaunchExecutableName } from '../../shared/agent-launch/startup/agent-command-line-intent' import { MANAGED_DATA_ACCOUNT_RESUME_ENV } from '../../shared/managed-data-account-resume' export function applyManagedDataAccountEnvironment( diff --git a/src/main/native-chat/agent-cli-installation-error.ts b/src/main/native-chat/agent-cli-installation-error.ts index a78e698d3ad..060201aadae 100644 --- a/src/main/native-chat/agent-cli-installation-error.ts +++ b/src/main/native-chat/agent-cli-installation-error.ts @@ -1,9 +1,9 @@ -import type { AgentCliInstallationProblem } from '../../shared/agent-cli-installation-problem' +import type { AgentCliInstallationProblem } from '../../shared/agent-launch/catalog/agent-cli-installation-problem' import { agentCliTooOldWords, sayAgentSessionFailureEnglish } from '../../shared/agent-session/failures/agent-session-failure-copy' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { AgentSessionPreSpawnError } from './agent-session-wire/structured-agent-session-adapter' import { findInErrorChain } from '../provider-process/provider-error-chain' diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts index c0a07865163..d255474e947 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts @@ -1,6 +1,6 @@ import type { AgentSessionModelCatalogResult } from '../../../shared/agent-session/agent-session-wire' import { isNativeLocalLocation } from '../../../shared/execution-host' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { agentModelCatalogListingKey, agentModelCatalogResultFromEntry diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-discovery.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-discovery.ts index 0cb0c1ecf2e..51ff5433109 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-discovery.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-discovery.ts @@ -31,8 +31,6 @@ export type AgentModelCatalogProbe = (( ) => Promise } -export { independentAgentModelCatalog } from '../../../shared/agent-model-catalog-ownership' - /** Agents supply probes or opt out; the service owns caching, refresh and publication. */ export type AgentModelCatalogDiscovery = | { diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry-lifetime.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry-lifetime.ts index d11f4ad9ec6..9cb615c2817 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry-lifetime.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry-lifetime.ts @@ -4,7 +4,7 @@ import { type AgentModelCatalogSuccess, type AgentModelCatalogSource } from './agent-model-catalog-entry' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' export const AGENT_MODEL_CATALOG_FRESH_MS = 10 * 60_000 diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts index 5d9117c886f..be9b58f8131 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts @@ -2,7 +2,7 @@ import { configuredDeclarationModels, mergedAgentModelCatalogModels } from './agent-model-catalog-models' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import type { AgentSessionUnavailable } from '../../../shared/agent-session/agent-session-availability' import type { AgentSessionFastModeSupport, diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-listing-waiters.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-listing-waiters.ts index 0af522939e4..e827bdda782 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-listing-waiters.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-listing-waiters.ts @@ -1,7 +1,7 @@ import type { AgentModelCatalogStore } from './agent-model-catalog-store' import type { AgentModelCatalogReadParams } from './agent-model-catalog-service-contract' import type { AgentModelCatalogBinding } from './agent-model-catalog-snapshot' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { withTimeout } from '../../../shared/promise-timeout-fallback' import type { AgentModelCatalogEntry } from './agent-model-catalog-entry' diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-live-listings.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-live-listings.ts index 47dd02fa021..ee06b601a83 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-live-listings.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-live-listings.ts @@ -7,7 +7,7 @@ import type { } from './agent-model-catalog-service-contract' import { agentModelCatalogFingerprintForRecord } from './agent-model-catalog-fingerprint' import { catalogFolder, recordConfiguredDefault } from './agent-model-catalog-workspace' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' export function createAgentModelCatalogLiveListings( deps: AgentModelCatalogServiceDeps, diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-lookup.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-lookup.ts index eda5cfbe78b..80b1b0787c3 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-lookup.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-lookup.ts @@ -15,7 +15,7 @@ import { projectAgentModelCatalogDefault } from './agent-model-catalog-workspace' import { resolveAgentModelCatalogScope } from './agent-model-catalog-scope' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { agentModelCatalogReleasedOwner, bindAgentModelCatalogScope, diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts index afefe6b42c5..dd40b22d050 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts @@ -7,10 +7,10 @@ import type { AgentModelCatalogServiceDeps } from './agent-model-catalog-service-contract' import { agentModelCatalogScopeFingerprint } from './agent-model-catalog-fingerprint' -import { - independentAgentModelCatalog, - type AgentModelCatalogLookup, - type AgentModelCatalogResolvedProbe +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' +import type { + AgentModelCatalogLookup, + AgentModelCatalogResolvedProbe } from './agent-model-catalog-discovery' import { sessionWorkspacePath, type AgentModelCatalogRecord } from './agent-model-catalog-workspace' diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-snapshot.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-snapshot.ts index e6b813e5a50..7bb30767612 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-snapshot.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-snapshot.ts @@ -8,7 +8,7 @@ import { agentSessionPinnedLaunchDirectory } from '../../runtime/agent-session/r import type { AgentSessionConversationView } from '../../../shared/agent-session/lifecycle/agent-session-conversation-view' import type { AgentSessionModelCatalogResult } from '../../../shared/agent-session/agent-session-wire' import { agentModelCatalogResultFromEntry } from './agent-model-catalog-entry' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import type { AgentModelCatalogReadParams, AgentModelCatalogServiceDeps diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts index 1d7a3fa45e6..4e6ff7c9c2c 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts @@ -6,7 +6,7 @@ import { agentModelCatalogEntryIsStale, pruneAgentModelCatalogPartialAttempts } from './agent-model-catalog-entry-lifetime' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' export type { AgentModelCatalogProbe } from './agent-model-catalog-discovery' import type { AgentModelCatalogPersistence } from './agent-model-catalog-persistence' import { diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts index f843b2a3a41..82ffe1aae95 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts @@ -1,6 +1,6 @@ import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { AgentModelCatalogBinding } from './agent-model-catalog-snapshot' -import { independentAgentModelCatalog } from './agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { type AgentSessionAccountHome, isLegacyAgentSessionAccountHome diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.ts index 5574da387da..359026d5f02 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router.ts @@ -1,5 +1,5 @@ import type { StructuredAgentSessionAtRestCommands } from './structured-agent-session-at-rest-commands' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionJournalIdentity } from '../../../shared/agent-session/journal/agent-session-journal-identity' import type { AgentSessionExecutionLocation } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { StructuredAgentSessionAdapter } from './structured-agent-session-adapter' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts index 4a6e5c9a9d6..99855f95407 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts @@ -1,7 +1,7 @@ import type { ClaudeAccountRecipe } from '../../../shared/agent-session/lifecycle/agent-session-acquired-account' import type { StructuredAgentSessionAdmitFreshInput } from './structured-agent-session-input-admission' import type { AiVaultConversationCopy } from '../../../shared/ai-vault-resume-preparation' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionRewindFork, AgentSessionRewindReason, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.ts index c5a0a252f03..b1a526b4f4a 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.ts @@ -17,7 +17,7 @@ import type { import { agentSessionLeaseAdmitsWriter } from '../../../shared/agent-session/lifecycle/agent-session-lease-adjudication' import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { AgentSessionAccountHome } from '../../../shared/agent-session/lifecycle/agent-session-account-home' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { admitAttachOrRefuse, attachJournal, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-delivery-loop-deps.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-delivery-loop-deps.ts index b62f7ce2652..d51aabe6df2 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-delivery-loop-deps.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-delivery-loop-deps.ts @@ -1,6 +1,6 @@ import type { AgentJournalSubmission } from '../../../shared/agent-session/journal/agent-session-journal-types' import type { UnsentSendHold } from '../agent-session-journal/journal-unsent-send-hold' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StructuredAgentSessionStartFlights } from './structured-agent-session-start-flight' import type { StructuredAgentSessionDeliveryOrder } from './structured-agent-session-delivery-order' import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-failed-create-refusal.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-failed-create-refusal.ts index 0351b10f6ac..4b5578ce707 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-failed-create-refusal.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-failed-create-refusal.ts @@ -38,7 +38,7 @@ import { } from '../../provider-process/provider-executable-missing' import { argumentProblemOf } from '../structured-agent-arguments-error' import { agentCliInstallationProblemOf } from '../agent-cli-installation-error' -import { agentCliInstallationFacts } from '../../../shared/agent-cli-installation-problem' +import { agentCliInstallationFacts } from '../../../shared/agent-launch/catalog/agent-cli-installation-problem' export type FailedAcquisitionWording = { record: AgentSessionRecord | null diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-failure-text.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-failure-text.ts index 027b51447cf..059c8166ba1 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-failure-text.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-failure-text.ts @@ -29,7 +29,7 @@ import { providerRequestTimeoutOf } from '../../provider-process/provider-reques import { findInErrorChain } from '../../provider-process/provider-error-chain' import { argumentProblemOf } from '../structured-agent-arguments-error' import { agentCliInstallationProblemOf } from '../agent-cli-installation-error' -import { agentCliInstallationFacts } from '../../../shared/agent-cli-installation-problem' +import { agentCliInstallationFacts } from '../../../shared/agent-launch/catalog/agent-cli-installation-problem' const TYPED_START_REFUSALS = [ 'savedConversationMissing', diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-types.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-types.ts index 5c5ba018f93..77c5ca9d86f 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-types.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-types.ts @@ -50,7 +50,7 @@ import type { StructuredAgentSessionLogger } from './structured-agent-session-lo import type { StructuredAgentId } from '../../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { StructuredAgentRegistry } from './structured-agent-registry' import type { StructuredAgentSessionStartupLimits } from './structured-agent-session-startup-attempt-contract' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionSwitchResult } from '../../../shared/agent-session/requests/agent-session-switch-execution' export type StructuredAgentSessionCaller = { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-input-admission.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-input-admission.ts index 1c3d5427e2e..01dba63421d 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-input-admission.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-input-admission.ts @@ -1,6 +1,6 @@ import type { AgentSessionDispatchOutcome } from './structured-agent-session-adapter' import type { AgentJournalMessageItem } from '../../../shared/agent-session/journal/agent-session-journal-types' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' export type StructuredAgentSessionInputAdmission = | { kind: 'prepare' } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-launch-permission.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-launch-permission.ts index 61e3f87b63c..867cdb3ebcb 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-launch-permission.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-launch-permission.ts @@ -2,11 +2,11 @@ import type { StructuredAgentSessionAttachContext } from './structured-agent-ses import type { StructuredAgentSessionAttachLock } from './structured-agent-session-attach-lock' import { continuingStructuredAgentSessionCompilerPermission } from './structured-agent-session-handing-over' import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' +import { agentChatPermissionModes } from '../../../shared/agent-launch/permissions/agent-chat-permission-support' import { - agentChatPermissionModes, savedChatPermissionMode, type AgentChatPermissionChoice -} from '../../../shared/agent-chat-permission-mode' +} from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StructuredAgentSessionHostDeps } from './structured-agent-session-host-types' /** null for unregistered agents or agents without permission modes. */ diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-option-intent.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-option-intent.ts index 059a8bff93a..116fded93f1 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-option-intent.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-option-intent.ts @@ -4,10 +4,8 @@ import { } from './structured-agent-session-resting-options' import { refuse } from '../../../shared/agent-session/failures/agent-session-wire-refusals' import type { AgentSessionOptionResult } from '../../../shared/agent-session/agent-session-wire' -import { - AGENT_CHAT_PERMISSION_MODE_OPTION_ID, - agentChatPermissionModes -} from '../../../shared/agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../shared/agent-launch/permissions/agent-chat-permission-support' import type { AgentSessionRecordStore } from '../../runtime/agent-session/records/agent-session-record-store' import type { StructuredAgentRegistry } from './structured-agent-registry' import type { AgentSessionTurnContext, TurnOutcome } from './structured-agent-session-turns' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts index 9db2b269ad5..769889745ba 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts @@ -1,7 +1,7 @@ import { structuredAgentSessionCatalogScopeOwned } from './structured-agent-session-catalog-reads' import { withinAgentModelCatalogRead } from '../agent-model-catalog/agent-model-catalog-operation' import { AGENT_MODEL_CATALOG_PICKER_WAIT_MS } from '../agent-model-catalog/agent-model-catalog-listing-waiters' -import { independentAgentModelCatalog } from '../agent-model-catalog/agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { readStructuredAgentSessionOptionsAtRest, IN_PROCESS_OPTIONS_READER, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.ts index 6afb6206afa..7821384dbd6 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.ts @@ -11,7 +11,7 @@ import { type StructuredAgentSessionChildWorkReads } from './structured-agent-session-idle-sweep' import type { StructuredAgentSessionLogger } from './structured-agent-session-logger' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { agentJournalSubmissionKey } from '../../../shared/agent-session/journal/agent-session-journal-item-key' import { agentSessionAccountHomesEqual, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-resting-options.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-resting-options.ts index 2a578df0692..c6be6a22f15 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-resting-options.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-resting-options.ts @@ -3,7 +3,7 @@ import type { AgentSessionModelCatalogResult } from '../../../shared/agent-sessi import { decodeStructuredAgentSessionOptionValue } from '../../../shared/agent-session/options/structured-agent-session-option-codec' import { finishedListingIds } from '../../../shared/agent-session/options/structured-agent-session-listing-verified-ids' import { savedEffectiveServiceTier } from '../../../shared/agent-session/options/structured-agent-session-effective-tier' -import { independentAgentModelCatalog } from '../agent-model-catalog/agent-model-catalog-discovery' +import { independentAgentModelCatalog } from '../../../shared/agent-session/options/agent-model-catalog-ownership' import { AGENT_MODEL_CATALOG_PICKER_WAIT_MS } from '../agent-model-catalog/agent-model-catalog-listing-waiters' import type { StructuredAgentSessionHostDeps } from './structured-agent-session-host-types' import { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-saved-status.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-saved-status.ts index f29b512d7c5..f7210424a7b 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-saved-status.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-saved-status.ts @@ -19,7 +19,7 @@ import { structuredSummaryConversationNaming } from './structured-agent-session- import { agentSessionPinnedLaunchDirectory } from '../../runtime/agent-session/records/agent-session-record-launch-directory' import { normalizeOptionalField } from '../../../shared/agent-status-field-normalization' import { AGENT_MODEL_MAX_LENGTH } from '../../../shared/agent-status-types' -import { isAgentChatPermissionMode } from '../../../shared/agent-chat-permission-mode' +import { isAgentChatPermissionMode } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' export function savedStructuredAgentSessionStatus( record: AgentSessionConversationView, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-send-preparation.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-send-preparation.ts index fe361de89b6..8813d6be431 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-send-preparation.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-send-preparation.ts @@ -3,8 +3,8 @@ import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { AgentSessionMutationEnvelope } from '../../../shared/agent-session/agent-session-wire' import type { AgentSessionWireRefusal } from '../../../shared/agent-session/failures/agent-session-wire-refusals' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/tui-agent-display-names' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/agent-launch/catalog/tui-agent-display-names' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import type { AgentSessionFailureWordsContext } from '../../../shared/agent-session/failures/agent-session-failure-words' import { journalOpenRefusal } from '../agent-session-journal/journal-open-failure' import { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-contract.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-contract.ts index 962060db440..8f5774f7a91 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-contract.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-contract.ts @@ -8,7 +8,7 @@ import type { } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { AgentChildWorkEvidence } from '../../../shared/agent-status-child-work-evidence' import type { StructuredAgentSessionEventSink } from './structured-agent-session-event-sink' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' /** Absolute registration-time ceiling, independent of shorter protocol-step bounds. */ export const STRUCTURED_AGENT_SESSION_STARTUP_CEILING_MS = 10 * 60_000 diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-mint.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-mint.ts index fa10dd7d0a3..be785b5a996 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-mint.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-mint.ts @@ -1,7 +1,7 @@ import { randomUUID } from 'node:crypto' import type { AgentSessionJournalIdentity } from '../../../shared/agent-session/journal/agent-session-journal-identity' import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' -import type { AgentChatPermissionChoice } from '../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StructuredAgentSessionEventSink } from './structured-agent-session-event-sink' import type { StructuredAgentSessionStartupAttempt } from './structured-agent-session-startup-attempt-contract' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts index 0b711a26350..544690731bd 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-summary.ts @@ -11,7 +11,7 @@ import type { } from './structured-agent-session-host-types' import { structuredAgentSessionProviderSessionMetadata } from './structured-agent-session-history-result' import { agentSessionPinnedLaunchDirectory } from '../../runtime/agent-session/records/agent-session-record-launch-directory' -import { isAgentChatPermissionMode } from '../../../shared/agent-chat-permission-mode' +import { isAgentChatPermissionMode } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StructuredAgentSessionStatusFeedDeps, StatusPublication diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-stop-acceptance.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-stop-acceptance.ts index c2c483701b8..f8455b38924 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-stop-acceptance.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-stop-acceptance.ts @@ -7,9 +7,9 @@ import { type AgentSessionWireRefusal } from '../../../shared/agent-session/failures/agent-session-wire-refusals' import type { AgentSessionCancelResult } from '../../../shared/agent-session/agent-session-wire' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/agent-launch/catalog/tui-agent-display-names' import { AGENT_SESSION_WRITE_NOTICE_COPY } from '../../../shared/agent-session/failures/agent-session-write-notice-copy' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { CommandReceiptExistsError } from '../agent-session-journal/command-receipt-transaction' import { classifyJournalOpenFailure, diff --git a/src/main/native-chat/structured-agent-cli-conversations.ts b/src/main/native-chat/structured-agent-cli-conversations.ts index a62e0a31b11..c3b9b5912e6 100644 --- a/src/main/native-chat/structured-agent-cli-conversations.ts +++ b/src/main/native-chat/structured-agent-cli-conversations.ts @@ -6,7 +6,7 @@ import { } from '../../shared/agent-session/lifecycle/agent-session-account-home' import type { AgentSessionProviderHandleLink } from '../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { AiVaultAgent } from '../../shared/ai-vault-types' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import { sessionIdFromFileName } from '../ai-vault/session-scanner-accumulator' export type StructuredAgentTranscriptImportSettings = { diff --git a/src/main/native-chat/structured-agent-command-resolution.ts b/src/main/native-chat/structured-agent-command-resolution.ts index c438e62185a..86468537a0f 100644 --- a/src/main/native-chat/structured-agent-command-resolution.ts +++ b/src/main/native-chat/structured-agent-command-resolution.ts @@ -2,7 +2,7 @@ import { waitForPromiseWithSignal } from '../../shared/abort-signal-reason' import { homedir } from 'node:os' import { delimiter, isAbsolute, resolve as resolvePath } from 'node:path' import type { GlobalSettings } from '../../shared/global-settings-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveCliCommand, resolveExecutableCommand @@ -10,7 +10,7 @@ import { import { hasExplicitTuiLaunchCommand, structuredAgentCommandPlan -} from '../../shared/tui-agent-launch-command-override' +} from '../../shared/agent-launch/startup/tui-agent-launch-command-override' import { AgentSessionPreSpawnError, isAgentSessionPreSpawnError diff --git a/src/main/native-chat/structured-agent-configured-args.ts b/src/main/native-chat/structured-agent-configured-args.ts index 0ce5f429d54..376e9fb2643 100644 --- a/src/main/native-chat/structured-agent-configured-args.ts +++ b/src/main/native-chat/structured-agent-configured-args.ts @@ -1,11 +1,11 @@ -import { projectAgentLaunchProfile } from '../../shared/agent-launch-profile' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { projectAgentLaunchProfile } from '../../shared/agent-launch/choices/agent-launch-profile' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import type { GlobalSettings } from '../../shared/global-settings-types' import { resolveTuiAgentLaunchArgs, type AgentLaunchProfileSettings -} from '../../shared/tui-agent-launch-defaults' -import { tokenizeStartupCommand } from '../../shared/tui-agent-startup-shell' +} from '../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { tokenizeStartupCommand } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../shared/windows-terminal-shell' /** Match terminal argument grouping before filtering provider-owned flags. */ diff --git a/src/main/opencode/opencode-acp-environment.ts b/src/main/opencode/opencode-acp-environment.ts index eca726cab11..32018825b9f 100644 --- a/src/main/opencode/opencode-acp-environment.ts +++ b/src/main/opencode/opencode-acp-environment.ts @@ -1,4 +1,4 @@ -import { restoreOrStripOverlayEnv } from '../../shared/agent-overlay-env' +import { restoreOrStripOverlayEnv } from '../../shared/agent-launch/startup/agent-overlay-env' import { getAppEnvironment } from '../../shared/app-environment' import { isOpenCodeLegacySharedConfigDir } from './legacy-shared-config-dir' diff --git a/src/main/opencode/opencode-launch-capabilities.ts b/src/main/opencode/opencode-launch-capabilities.ts index b93e9964d15..a76392b4ae2 100644 --- a/src/main/opencode/opencode-launch-capabilities.ts +++ b/src/main/opencode/opencode-launch-capabilities.ts @@ -3,14 +3,14 @@ import { getOpenCodeCliCapabilities, type OpenCodeCliCapabilities } from '../../shared/opencode-cli-version' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveCommandOnLocalPath } from '../ipc/command-path/command-path-resolver' import { runWslProcess } from '../wsl/execution/wsl-runner' import { probeOpenCodeCliVersion } from './opencode-cli-version' import { getAgentLaunchCommandToken, getAgentLaunchExecutableName -} from '../../shared/agent-command-line-intent' +} from '../../shared/agent-launch/startup/agent-command-line-intent' export function getOpenCodeLaunchExecutable( command: string | undefined, diff --git a/src/main/opencode/opencode-model-executable.ts b/src/main/opencode/opencode-model-executable.ts index 079769c9baa..4b5b391b3b3 100644 --- a/src/main/opencode/opencode-model-executable.ts +++ b/src/main/opencode/opencode-model-executable.ts @@ -1,4 +1,7 @@ -import { resolveStartupShell, tokenizeStartupCommand } from '../../shared/tui-agent-startup-shell' +import { + resolveStartupShell, + tokenizeStartupCommand +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveCommandOnLocalPath } from '../ipc/command-path/command-path-resolver' export async function resolveOpenCodeDirectModelExecutable(options: { diff --git a/src/main/opencode/opencode-model-startup-plan.test.ts b/src/main/opencode/opencode-model-startup-plan.test.ts index 2e3e735e1a3..35c45ada790 100644 --- a/src/main/opencode/opencode-model-startup-plan.test.ts +++ b/src/main/opencode/opencode-model-startup-plan.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' import { applyManagedDataAccountEnvironment } from '../managed-data-accounts/launch-environment' import { probeOpenCodeLaunchCapabilities } from './opencode-launch-capabilities' import { resolveOpenCodeDirectModelExecutable } from './opencode-model-executable' @@ -9,7 +9,7 @@ import { OPENCODE_MODEL_CONFIG_REFUSAL, OPENCODE_MODEL_TRANSPORT_REFUSAL, OPENCODE_MODEL_VERSION_REFUSAL -} from '../../shared/agent-launch-model-preferences' +} from '../../shared/agent-launch/choices/agent-launch-model-preferences' vi.mock('../managed-data-accounts/launch-environment', () => ({ applyManagedDataAccountEnvironment: vi.fn() diff --git a/src/main/opencode/opencode-model-startup-plan.ts b/src/main/opencode/opencode-model-startup-plan.ts index 98dbe98c3ab..2a4c560fff1 100644 --- a/src/main/opencode/opencode-model-startup-plan.ts +++ b/src/main/opencode/opencode-model-startup-plan.ts @@ -1,20 +1,23 @@ -import type { AgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' +import type { AgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' import { buildAgentDraftLaunchPlan, buildAgentStartupPlan, type AgentStartupPlan -} from '../../shared/tui-agent-startup' +} from '../../shared/agent-launch/startup/tui-agent-startup' import { planStartupWithPromptCandidate } from '../../shared/startup-line-prompt-carry' import { buildSleepingAgentLaunchConfig } from '../../shared/sleeping-agent-launch-config' import type { SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { probeOpenCodeLaunchModelContext } from './opencode-launch-model-context' import { resolveOpenCodeLaunchModelConfig } from './opencode-launch-model-config' import { isVerifiedOpenCodeConfigModelVersion, isVerifiedOpenCodeLegacyModelVersion } from './opencode-model-version-policy' -import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { + getTuiAgentLaunchCommand, + TUI_AGENT_CONFIG +} from '../../shared/agent-launch/catalog/tui-agent-config' import { applyManagedDataAccountEnvironment } from '../managed-data-accounts/launch-environment' import { OrchestrationError } from '../runtime/orchestration/orchestration-error' import { probeOpenCodeLaunchCapabilities } from './opencode-launch-capabilities' @@ -23,7 +26,7 @@ import { OPENCODE_MODEL_CONFIG_REFUSAL, OPENCODE_MODEL_TRANSPORT_REFUSAL, OPENCODE_MODEL_VERSION_REFUSAL -} from '../../shared/agent-launch-model-preferences' +} from '../../shared/agent-launch/choices/agent-launch-model-preferences' type StartupScope = { inputs: AgentStartupPlanInputs diff --git a/src/main/opencode/opencode-private-server.ts b/src/main/opencode/opencode-private-server.ts index 57aed3c943e..716d97b60f6 100644 --- a/src/main/opencode/opencode-private-server.ts +++ b/src/main/opencode/opencode-private-server.ts @@ -8,7 +8,7 @@ import { findOpenCodeRunCommand } from '../../shared/opencode-headless-command' import { tokenizeStartupCommand, type AgentStartupShell -} from '../../shared/tui-agent-startup-shell' +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { managedAccountLaunchEnvironment } from '../managed-data-accounts/launch-environment' import { getManagedDataAccountService } from '../managed-data-accounts/service' diff --git a/src/main/opencode/opencode-pty-launch.test.ts b/src/main/opencode/opencode-pty-launch.test.ts index b8d02244420..3f448a539e3 100644 --- a/src/main/opencode/opencode-pty-launch.test.ts +++ b/src/main/opencode/opencode-pty-launch.test.ts @@ -10,7 +10,7 @@ import { OPENCODE_STARTUP_PROMPT_SHA256_ENV, OPENCODE_STARTUP_PROMPT_BODY_ENV, OPENCODE_STARTUP_PROMPT_SHELL_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' import { buildLocalPtySpawnEnvironment, enforceLocalPtySpawnEnvironmentOverrides diff --git a/src/main/opencode/opencode-pty-launch.ts b/src/main/opencode/opencode-pty-launch.ts index 00351d8a6e2..0ad6af696f0 100644 --- a/src/main/opencode/opencode-pty-launch.ts +++ b/src/main/opencode/opencode-pty-launch.ts @@ -1,11 +1,11 @@ import { addWslEnvKeys } from '../../shared/wsl-env' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { randomUUID, createHash } from 'node:crypto' import { agentHookServer } from '../agent-hooks/server' import { tokenizeStartupCommand, type AgentStartupShell -} from '../../shared/tui-agent-startup-shell' +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { isOpenCodeRunCommand } from '../../shared/opencode-headless-command' import { OPENCODE_STARTUP_PROMPT_SHA256_ENV, @@ -13,7 +13,7 @@ import { OPENCODE_STARTUP_PROMPT_ENDPOINT_ENV, OPENCODE_STARTUP_PROMPT_BODY_ENV, OPENCODE_STARTUP_PROMPT_SHELL_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' const intentKeys = [ OPENCODE_STARTUP_PROMPT_SHA256_ENV, diff --git a/src/main/opencode/opencode-startup-prompt-installer.ts b/src/main/opencode/opencode-startup-prompt-installer.ts index 6ae79cc58d2..3320947ac98 100644 --- a/src/main/opencode/opencode-startup-prompt-installer.ts +++ b/src/main/opencode/opencode-startup-prompt-installer.ts @@ -10,7 +10,7 @@ import { OPENCODE_STARTUP_PROMPT_SHA256_ENV, OPENCODE_STARTUP_PROMPT_BODY_ENV, OPENCODE_STARTUP_PROMPT_ENDPOINT_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' export function createOpenCodeStartupPromptInstaller(source: () => string): OpenCodeHookService { return new OpenCodeHookService({ diff --git a/src/main/opencode/opencode-startup-prompt-owner.ts b/src/main/opencode/opencode-startup-prompt-owner.ts index 1eef58d008c..12c4d98ea6b 100644 --- a/src/main/opencode/opencode-startup-prompt-owner.ts +++ b/src/main/opencode/opencode-startup-prompt-owner.ts @@ -8,7 +8,7 @@ import { isPtyIncarnationId } from '../../shared/pty-incarnation' import { OPENCODE_STARTUP_PROMPT_NONCE_ENV, OPENCODE_STARTUP_PROMPT_SHA256_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' import { OpenCodeStartupPromptClaims } from './opencode-startup-prompt-claims' type OpenCodePromptRuntime = Pick< diff --git a/src/main/opencode/opencode-startup-prompt-source.test.ts b/src/main/opencode/opencode-startup-prompt-source.test.ts index acc8a5846c4..ec6ac18a868 100644 --- a/src/main/opencode/opencode-startup-prompt-source.test.ts +++ b/src/main/opencode/opencode-startup-prompt-source.test.ts @@ -11,7 +11,7 @@ import { OPENCODE_STARTUP_PROMPT_NONCE_ENV, OPENCODE_STARTUP_PROMPT_BODY_ENV, OPENCODE_STARTUP_PROMPT_ENDPOINT_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' import { getOpenCodeStartupPromptSource } from './opencode-startup-prompt-source' import { OpenCodeStartupPromptClaims } from './opencode-startup-prompt-claims' diff --git a/src/main/opencode/opencode-startup-prompt-source.ts b/src/main/opencode/opencode-startup-prompt-source.ts index 94e08869d6d..be038f5b445 100644 --- a/src/main/opencode/opencode-startup-prompt-source.ts +++ b/src/main/opencode/opencode-startup-prompt-source.ts @@ -7,7 +7,7 @@ import { OPENCODE_STARTUP_PROMPT_ENDPOINT_ENV, OPENCODE_STARTUP_PROMPT_CLAIM_PATH, OPENCODE_STARTUP_PROMPT_BODY_ENV -} from '../../shared/opencode-startup-prompt' +} from '../../shared/agent-launch/startup/opencode-startup-prompt' export function getOpenCodeStartupPromptSource(): string { return String.raw` diff --git a/src/main/orcad/orcad-account-services.ts b/src/main/orcad/orcad-account-services.ts index 2398688aeca..58d6b5978b6 100644 --- a/src/main/orcad/orcad-account-services.ts +++ b/src/main/orcad/orcad-account-services.ts @@ -10,7 +10,7 @@ import type { AiVaultPrepareSessionResumeResult } from '../../shared/ai-vault-resume-preparation' import type { ClaudeStatusLineRateLimits } from '../../shared/claude-statusline-rate-limits' -import { resolveTuiAgentLaunchEnv } from '../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchEnv } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { createProviderAccountServices } from '../providers/accounts/provider-account-services' import { createCodexRuntimeHomeLaunchPreparation } from '../codex/codex-runtime-home-launch-preparation' import { createCodexSessionResumeLaunchPreparation } from '../codex/codex-session-resume-launch-preparation' diff --git a/src/main/persistence/applying-settings/legacy-chat-permission-write.ts b/src/main/persistence/applying-settings/legacy-chat-permission-write.ts index f7d874d859f..342332d702e 100644 --- a/src/main/persistence/applying-settings/legacy-chat-permission-write.ts +++ b/src/main/persistence/applying-settings/legacy-chat-permission-write.ts @@ -2,8 +2,8 @@ import type { GlobalSettings } from '../../../shared/global-settings-types' import { isAgentChatPermissionMode, publishedLegacyChatPermissionMode -} from '../../../shared/agent-chat-permission-mode' -import { applyAllAgentsPermission } from '../../../shared/tui-agent-permission-choice' +} from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import { applyAllAgentsPermission } from '../../../shared/agent-launch/permissions/tui-agent-permission-choice' /** Old dropdown writes use the replacement control's reset; an explicit typed write wins. */ export function legacyChatPermissionWrite( diff --git a/src/main/persistence/applying-settings/persistence-settings-update.test.ts b/src/main/persistence/applying-settings/persistence-settings-update.test.ts index 3e34f82318a..e830a7e896f 100644 --- a/src/main/persistence/applying-settings/persistence-settings-update.test.ts +++ b/src/main/persistence/applying-settings/persistence-settings-update.test.ts @@ -1,4 +1,4 @@ -import { composeAgentLaunchProfile } from '../../../shared/tui-agent-launch-defaults' +import { composeAgentLaunchProfile } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { closeTestStores, testState, diff --git a/src/main/persistence/applying-settings/settings-update.ts b/src/main/persistence/applying-settings/settings-update.ts index 7bf5ade195b..cb074b39077 100644 --- a/src/main/persistence/applying-settings/settings-update.ts +++ b/src/main/persistence/applying-settings/settings-update.ts @@ -3,13 +3,13 @@ import { legacyChatPermissionWrite } from './legacy-chat-permission-write' import { stampDefaultOnMigrationGuards } from './default-on-migration-guards' import { normalizeNativeChatAppearanceSettings } from '../../../shared/native-chat/native-chat-appearance-settings' import type { GlobalSettings } from '../../../shared/global-settings-types' -import { normalizeDisabledTuiAgents } from '../../../shared/tui-agent-selection' +import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { normalizeAgentDefaultSurface, normalizeNativeChatProviderChoices } from '../../../shared/native-chat/native-chat-providers' import { resolveNestedWorkerMaxDepth } from '../../../shared/nested-worker-depth' -import { sanitizeAgentLaunchProfileUpdates } from '../../../shared/tui-agent-launch-defaults' +import { sanitizeAgentLaunchProfileUpdates } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { normalizeTerminalQuickCommands } from '../../../shared/terminal-quick-commands' import { assertTerminalQuickCommandsStorable } from '../../../shared/terminal-quick-command-prompt-limit' import { normalizeTerminalCustomThemes } from '../../../shared/terminal-custom-themes' diff --git a/src/main/persistence/applying-settings/terminal-settings-migrations.ts b/src/main/persistence/applying-settings/terminal-settings-migrations.ts index d593fe3457b..9259a8ad9e0 100644 --- a/src/main/persistence/applying-settings/terminal-settings-migrations.ts +++ b/src/main/persistence/applying-settings/terminal-settings-migrations.ts @@ -10,7 +10,7 @@ import { DEFAULT_TUI_AGENT_ENV, normalizeTuiAgentArgsRecord, normalizeTuiAgentEnvRecord -} from '../../../shared/tui-agent-launch-defaults' +} from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { expandLeadingHomePath } from '../../filesystem/home-path-expansion' /** Unexpanded, a leading ~ resolves inside each repo and worktrees land in /~ (#34944). */ diff --git a/src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts b/src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts index 9f0f784d711..d779f624f50 100644 --- a/src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts +++ b/src/main/persistence/loading-store/normalize-loaded-global-settings.test.ts @@ -1,4 +1,4 @@ -import { newChatPermissionModeForSettings } from '../../../shared/agent-chat-permission-mode' +import { newChatPermissionModeForSettings } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { homedir } from 'node:os' import { describe, expect, it, vi } from 'vitest' import { getDefaultPersistedState } from '../../../shared/constants' @@ -7,8 +7,8 @@ import { prepareLoadedTerminalSettings } from './prepare-loaded-terminal-setting import { prepareLoadedProfileSettings } from './prepare-loaded-profile-settings' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { PersistedState } from '../../../shared/persisted-state-types' -import { resolveAgentPermission } from '../../../shared/tui-agent-permission-choice' -import { resolveTuiAgentLaunchArgs } from '../../../shared/tui-agent-launch-defaults' +import { resolveAgentPermission } from '../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import { resolveTuiAgentLaunchArgs } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' function normalizeLegacyProfile(overrides: Record): PersistedState['settings'] { const defaults = getDefaultPersistedState(homedir()) diff --git a/src/main/persistence/loading-store/normalize-loaded-global-settings.ts b/src/main/persistence/loading-store/normalize-loaded-global-settings.ts index eb402561e57..c0c747f4924 100644 --- a/src/main/persistence/loading-store/normalize-loaded-global-settings.ts +++ b/src/main/persistence/loading-store/normalize-loaded-global-settings.ts @@ -15,7 +15,7 @@ import { import { normalizeTerminalDefaultShell } from '../../../shared/terminal-default-shell' import { projectSourceControlAiToLegacyCommitMessageAi } from '../../../shared/source-control-ai' import { normalizeNativeChatShellEnvironmentVariables } from '../../../shared/native-chat/native-chat-shell-environment' -import { publishedLegacyChatPermissionMode } from '../../../shared/agent-chat-permission-mode' +import { publishedLegacyChatPermissionMode } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { expandWorkspaceDirHome, stripRetiredGlobalSettings diff --git a/src/main/persistence/loading-store/prepare-loaded-profile-settings.ts b/src/main/persistence/loading-store/prepare-loaded-profile-settings.ts index 1719426eb03..d3c7bac46a5 100644 --- a/src/main/persistence/loading-store/prepare-loaded-profile-settings.ts +++ b/src/main/persistence/loading-store/prepare-loaded-profile-settings.ts @@ -12,14 +12,14 @@ import { } from '../../../shared/mobile-pairing-custom-address' import { normalizeSourceControlGroupOrder } from '../../../shared/source-control-group-order' import { normalizeProjectGroups } from '../../../shared/project-groups' -import { normalizeDisabledTuiAgents } from '../../../shared/tui-agent-selection' -import { hasUnsupportedTuiAgentArgs } from '../../../shared/tui-agent-launch-defaults' +import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' +import { hasUnsupportedTuiAgentArgs } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { normalizeTerminalCursorStyleDefault } from '../../../shared/terminal-cursor-style-settings' import { normalizeTerminalLineHeight } from '../../../shared/terminal-line-height-settings' import { migratePortugueseUiLanguageOnLoad } from '../../../shared/portuguese-ui-language-migration' import { migrateAgentYoloDefaults } from '../applying-settings/terminal-settings-migrations' -import { hasTypedAgentPermission } from '../../../shared/tui-agent-permission-choice' -import { migrateAgentPermissionChoice } from '../../../shared/tui-agent-permission-lift' +import { hasTypedAgentPermission } from '../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import { migrateAgentPermissionChoice } from '../../../shared/agent-launch/permissions/tui-agent-permission-lift' import { normalizeLoadedOnboardingState, normalizeNotificationSettings, diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-gate-facts.ts b/src/main/persistence/moving-wsl-projects/wsl-move-gate-facts.ts index d1b8cd17aef..0c19f2dcc62 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-gate-facts.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-gate-facts.ts @@ -5,7 +5,7 @@ * automation runs and live orchestration dispatches from their own stores. This only reads. */ import type { AgentStatusIpcPayload } from '../../../shared/agent-status-ipc-payload' -import { getAgentResumeArgv } from '../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../shared/agent-launch/startup/agent-resume-argv' import { isResumableTuiAgent } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { isFinalAutomationRunStatus, type AutomationRun } from '../../../shared/automations-types' import { probePtyRunningWorkWithInspection } from '../../../shared/pty-running-work-probe' diff --git a/src/main/persistence/persistence-load-repair-durability.test.ts b/src/main/persistence/persistence-load-repair-durability.test.ts index 527ec56d7a8..c1f806e894e 100644 --- a/src/main/persistence/persistence-load-repair-durability.test.ts +++ b/src/main/persistence/persistence-load-repair-durability.test.ts @@ -1,14 +1,14 @@ import { projectSourceControlActionLaunch } from '../../shared/source-control-action-launch-preferences' import { resolveSourceControlActionRecipe } from '../../shared/source-control-ai-operation-policy' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' -import { resolveAgentLaunchCommand } from '../../shared/tui-agent-launch-command' -import { isTuiAgent } from '../../shared/tui-agent-config' -import * as reconciliation from '../../shared/agent-choice-reconciliation' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { resolveAgentLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-launch-command' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' +import * as reconciliation from '../../shared/agent-launch/choices/agent-choice-reconciliation' import * as terminalPreparation from './loading-store/prepare-loaded-terminal-settings' import * as domainWrites from './profile-state/profile-state-domain-writes' -import * as choiceArgs from '../../shared/agent-choice-args' -import * as shell from '../../shared/tui-agent-startup-shell' -import { agentPermissionChoices } from '../../shared/tui-agent-permission-choice' +import * as choiceArgs from '../../shared/agent-launch/choices/agent-choice-args' +import * as shell from '../../shared/agent-launch/startup/tui-agent-startup-shell' +import { agentPermissionChoices } from '../../shared/agent-launch/permissions/tui-agent-permission-choice' import { closeTestStores, testState, diff --git a/src/main/persistence/profile-state/profile-state-offline-settings.ts b/src/main/persistence/profile-state/profile-state-offline-settings.ts index c3c0e719dd6..3222cb26baa 100644 --- a/src/main/persistence/profile-state/profile-state-offline-settings.ts +++ b/src/main/persistence/profile-state/profile-state-offline-settings.ts @@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs' import { homedir } from 'node:os' import type { GlobalSettings } from '../../../shared/global-settings-types' import { getDefaultPersistedState } from '../../../shared/constants' -import { normalizeDisabledTuiAgents } from '../../../shared/tui-agent-selection' +import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { profileStateJsonMatchesAcceptance } from './profile-state-documents' import { isRecord, parseProfileStateRoot } from './profile-state-document-validation' import { diff --git a/src/main/persistence/scheduling-automations/automation-context-migration.ts b/src/main/persistence/scheduling-automations/automation-context-migration.ts index 9c262a59f71..51b46fbc95a 100644 --- a/src/main/persistence/scheduling-automations/automation-context-migration.ts +++ b/src/main/persistence/scheduling-automations/automation-context-migration.ts @@ -11,7 +11,7 @@ import type { PersistedState } from '../../../shared/persisted-state-types' import type { ProjectHostSetup } from '../../../shared/project-types' import type { Repo } from '../../../shared/repo-types' import { normalizeAutomationPrecheck } from '../../../shared/automation-precheck' -import { hasExtraAgentArgs } from '../../../shared/automation-extra-agent-args' +import { hasExtraAgentArgs } from '../../../shared/agent-launch/startup/automation-extra-agent-args' import { getAutomationLegacyRepoId } from '../../../shared/automation-run-identity' import { projectHostSetupProjectionFromRepos } from '../../../shared/project-host-setup-projection' import { diff --git a/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts b/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts index 693480a7ebe..a09c5bd928b 100644 --- a/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts +++ b/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import { buildAgentResumeStartupPlan } from '../../../shared/tui-agent-resume-startup' +import { buildAgentResumeStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-resume-startup' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' import type { Store } from '../loading-store/store' import { diff --git a/src/main/pi/omp-transcript-metadata.test.ts b/src/main/pi/omp-transcript-metadata.test.ts index ab1fd1f9fa4..6787474fbee 100644 --- a/src/main/pi/omp-transcript-metadata.test.ts +++ b/src/main/pi/omp-transcript-metadata.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { extractAgentProviderSession } from '../../shared/agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from '../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../shared/agent-launch/startup/agent-resume-argv' import type * as SessionScannerDiscovery from '../ai-vault/session-scanner-discovery' import { walkSessionFiles } from '../ai-vault/session-scanner-discovery' import { resolveSessionFilePath } from '../native-chat/session-file-resolver' diff --git a/src/main/pi/titlebar-extension-service.ts b/src/main/pi/titlebar-extension-service.ts index 7c886871691..6d1b42060fc 100644 --- a/src/main/pi/titlebar-extension-service.ts +++ b/src/main/pi/titlebar-extension-service.ts @@ -1,4 +1,4 @@ -import { materializeOmpFreshConfig } from '../../shared/omp-fresh-config' +import { materializeOmpFreshConfig } from '../../shared/agent-launch/startup/omp-fresh-config' import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' import { homedir } from 'node:os' import { join } from 'node:path' diff --git a/src/main/preflight/codex-workspace-relative-path.test.ts b/src/main/preflight/codex-workspace-relative-path.test.ts index aec2d90c5f0..2d12cc611dd 100644 --- a/src/main/preflight/codex-workspace-relative-path.test.ts +++ b/src/main/preflight/codex-workspace-relative-path.test.ts @@ -12,7 +12,7 @@ import { } from '../runtime/structured-agent-launch-composition.test-support' import { readCodexCliVersion, withSupportedCodexCli } from '../codex/codex-cli-installation-error' import { resolveStructuredAgentCommand } from '../native-chat/structured-agent-command-resolution' -import { resolveTuiAgentLaunchEnv } from '../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchEnv } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { createStructuredAgentEnvironmentResolvers } from '../runtime/structured-agent-shell-environment' import { identityFor } from '../codex/codex-structured-session-adapter-fixture' import type * as CommandResolution from '../../shared/node-cli-command-resolution' diff --git a/src/main/preflight/installed-agent-detection.ts b/src/main/preflight/installed-agent-detection.ts index cc7d3153a74..f54721093d0 100644 --- a/src/main/preflight/installed-agent-detection.ts +++ b/src/main/preflight/installed-agent-detection.ts @@ -4,15 +4,15 @@ import { KNOWN_TUI_AGENT_DETECTION_COMMANDS, resolveDetectedTuiAgentIds, type TuiAgentDetectionCommand -} from '../../shared/tui-agent-detection-commands' +} from '../../shared/agent-launch/catalog/tui-agent-detection-commands' import { hydrateShellPathForAgentDetection } from '../ipc/command-path/agent-detection-shell-path' import { getPreflightWslTarget, type PreflightRuntimeContext } from '../ipc/preflight-runtime-target' import { detectAgentCommandsOnHost } from './agent-command-detection' -import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection' -import type { TuiAgent } from '../../shared/tui-agent' +import { normalizeDisabledTuiAgents } from '../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' export type InstalledAgentDetectionOptions = { /** Agents disabled in Settings → Agents. Background callers skip probing them entirely. */ diff --git a/src/main/preflight/workspace-agent-detection.ts b/src/main/preflight/workspace-agent-detection.ts index 94396a43b74..cca2b88a1a6 100644 --- a/src/main/preflight/workspace-agent-detection.ts +++ b/src/main/preflight/workspace-agent-detection.ts @@ -1,6 +1,6 @@ import { isFolderRepo } from '../../shared/repo-kind' import type { ProjectLaunchContext } from '../../shared/rpc-contract/preflight-params' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { WORKSPACE_ON_OTHER_RUNTIME } from '../../shared/protocol-version' import { refreshAtRestCommandContext } from '../native-chat/agent-session-wire/at-rest-command-context' import { captureHostShellEnvironment } from '../runtime/structured-agent-shell-environment' diff --git a/src/main/providers/local-pty/local-pty-finalize-environment.ts b/src/main/providers/local-pty/local-pty-finalize-environment.ts index 16aa0490140..8cfb51333d2 100644 --- a/src/main/providers/local-pty/local-pty-finalize-environment.ts +++ b/src/main/providers/local-pty/local-pty-finalize-environment.ts @@ -1,5 +1,5 @@ import { win32 as pathWin32 } from 'node:path' -import { shouldUseShellReadyStartupDelivery } from '../../../shared/codex-startup-delivery' +import { shouldUseShellReadyStartupDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' import { expandWindowsPathEnvironmentVariables } from '../../../shared/windows-environment-expansion' import { dropInheritedOrcaFishHistory } from '../../pty/history/fish-history-session' import { dropIncoherentCondaActivationEnv } from '../../pty/shell-startup/conda-activation-env' diff --git a/src/main/providers/local-pty/local-pty-windows-spawn-environment.ts b/src/main/providers/local-pty/local-pty-windows-spawn-environment.ts index 59b183228e2..cef4871e415 100644 --- a/src/main/providers/local-pty/local-pty-windows-spawn-environment.ts +++ b/src/main/providers/local-pty/local-pty-windows-spawn-environment.ts @@ -3,7 +3,7 @@ import { CLAUDE_INJECTED_CONFIG_DIR_ENV, CLAUDE_PROFILE_POINTER_ENV } from '../../../shared/claude-profile-routing' -import { ORCA_HERMES_STARTUP_QUERY_ENV } from '../../../shared/hermes-startup-query' +import { ORCA_HERMES_STARTUP_QUERY_ENV } from '../../../shared/agent-launch/startup/hermes-startup-query' import { isHostCodexHomeForWsl, isWslCodexHomeForHost diff --git a/src/main/providers/pty-provider-contract.ts b/src/main/providers/pty-provider-contract.ts index 45ab217709f..8ac157a3282 100644 --- a/src/main/providers/pty-provider-contract.ts +++ b/src/main/providers/pty-provider-contract.ts @@ -3,11 +3,11 @@ import type { PtyFencedTerminationOutcome } from '../../shared/pty-fenced-termination' import type { SpawnIntent } from '../../shared/host-spawn-admission' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentWorkspaceTrustSpawnRequest } from '../../shared/agent-workspace-trust-spawn-request' import type { PtyStartupIngressIntent } from '../../shared/pty-startup-ingress' import type { TerminalOscColorQueryReplyColors } from '../../shared/terminal-osc-color-reply' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' import type { TerminalOscLinkRange } from '../../shared/terminal-osc-link-ranges' import type { PtyBackgroundStreamEvent, PtyDataEvent } from './pty-provider-events' import type { PtySpawnResult } from './pty-spawn-result' diff --git a/src/main/providers/pty-spawn-result.ts b/src/main/providers/pty-spawn-result.ts index 66d0e8e3fd2..c0b487aae97 100644 --- a/src/main/providers/pty-spawn-result.ts +++ b/src/main/providers/pty-spawn-result.ts @@ -1,7 +1,7 @@ import type { TerminalExitCause } from '../../shared/terminal-exit-cause' import type { TerminalLaunchResult } from '../../shared/agent-session/lifecycle/agent-session-resume' import type { TerminalOscLinkRange } from '../../shared/terminal-osc-link-ranges' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentSessionClaimedSpawnResult } from '../../shared/agent-session/agent-session-host-authority' import type { PtyIncarnationId } from '../../shared/pty-incarnation' import type { TerminalOwner } from '../../shared/terminal-owner' diff --git a/src/main/providers/windows-shell-args.ts b/src/main/providers/windows-shell-args.ts index 088181937ef..00125e125ba 100644 --- a/src/main/providers/windows-shell-args.ts +++ b/src/main/providers/windows-shell-args.ts @@ -14,7 +14,7 @@ import { getPowerShellOsc133Bootstrap, getPowerShellOsc133StartupCommandMark } from '../pty/shell-startup/powershell-osc133-bootstrap' -import { quoteStartupArg } from '../../shared/tui-agent-startup-shell' +import { quoteStartupArg } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { WSL_GUEST_ROOT_MARKER_COMMAND } from '../../shared/wsl-guest-root-marker' /** cmd.exe's own documented ceiling; callers that go through sshd budget below it. */ diff --git a/src/main/pty/process-retirement/pty-master-foreground-observation.test.ts b/src/main/pty/process-retirement/pty-master-foreground-observation.test.ts index 48817cc74dc..d67c01d8306 100644 --- a/src/main/pty/process-retirement/pty-master-foreground-observation.test.ts +++ b/src/main/pty/process-retirement/pty-master-foreground-observation.test.ts @@ -8,7 +8,7 @@ import { import { isTerminalForegroundObservation } from '../../../shared/terminal-foreground-observation' import { judgeTerminalForeground } from '../../runtime/terminal-foreground-group' import type { ProcessTableRow } from '../../../shared/process-table-snapshot' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' const mocks = vi.hoisted(() => ({ rows: vi.fn(), tty: vi.fn(), ps: vi.fn() })) vi.mock('./terminal-process-rows', async (importOriginal) => ({ ...(await importOriginal()), diff --git a/src/main/pty/shell-startup/codex-no-daemon-launch-command.ts b/src/main/pty/shell-startup/codex-no-daemon-launch-command.ts index b6f5746c8e4..ffbe847a2ea 100644 --- a/src/main/pty/shell-startup/codex-no-daemon-launch-command.ts +++ b/src/main/pty/shell-startup/codex-no-daemon-launch-command.ts @@ -1,6 +1,6 @@ import { isAbsolute, win32 as pathWin32 } from 'node:path' import { runProcess } from '@orca/process-host' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../../shared/windows-terminal-shell' import { resolveCommandOnLocalPath } from '../../ipc/command-path/command-path-resolver' import { CODEX_NO_DAEMON_SKIP_ARGS } from '../../../shared/codex-shell-function' diff --git a/src/main/rate-limits/antigravity-usage-command.ts b/src/main/rate-limits/antigravity-usage-command.ts index 769c0a7a71c..007635d83f1 100644 --- a/src/main/rate-limits/antigravity-usage-command.ts +++ b/src/main/rate-limits/antigravity-usage-command.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' // Use agy print-mode /usage: only agy can authenticate daily-cloudcode-pa using its OS-keyring Google credential. // agy 1.2.11 verified zero quota/tokens/turns and empty conversation_id; /usage and /quota resolve identically, but help lists /usage. diff --git a/src/main/runtime/agent-launch-scope-runtime.test.ts b/src/main/runtime/agent-launch-scope-runtime.test.ts index 7f466069097..03d7d55833a 100644 --- a/src/main/runtime/agent-launch-scope-runtime.test.ts +++ b/src/main/runtime/agent-launch-scope-runtime.test.ts @@ -7,7 +7,7 @@ import { resolveAgentLaunchRuntime } from './agent-launch-scope-runtime' import type { TerminalWorkspaceLaunchScope } from './runtime-legacy-worker-terminal-recovery-types' -import { agentLaunchQuotingShell } from '../../shared/agent-launch-runtime' +import { agentLaunchQuotingShell } from '../../shared/agent-launch/startup/agent-launch-runtime' import { buildMobileTerminalChatFork } from './terminal/launch/mobile-terminal-chat-fork' const WIN = 'C:\\repo' diff --git a/src/main/runtime/agent-launch-scope-runtime.ts b/src/main/runtime/agent-launch-scope-runtime.ts index 05e8920f3b2..edf9189e62b 100644 --- a/src/main/runtime/agent-launch-scope-runtime.ts +++ b/src/main/runtime/agent-launch-scope-runtime.ts @@ -3,9 +3,9 @@ import { executionRuntimePlatform, remoteExecutionPlatform, type AgentLaunchRuntime -} from '../../shared/agent-launch-runtime' -import type { AgentStartupShell } from '../../shared/tui-agent-startup-shell' -import type { TuiAgent } from '../../shared/tui-agent' +} from '../../shared/agent-launch/startup/agent-launch-runtime' +import type { AgentStartupShell } from '../../shared/agent-launch/startup/tui-agent-startup-shell' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { Repo } from '../../shared/repo-types' import type { GlobalSettings } from '../../shared/global-settings-types' import { getRepoSshConnectionId } from '../../shared/execution-host' diff --git a/src/main/runtime/agent-launch-settings-rollback.ts b/src/main/runtime/agent-launch-settings-rollback.ts index 06cc336f92c..a8926f900e6 100644 --- a/src/main/runtime/agent-launch-settings-rollback.ts +++ b/src/main/runtime/agent-launch-settings-rollback.ts @@ -1,6 +1,6 @@ import { isDeepStrictEqual } from 'node:util' -import { isTuiAgent } from '../../shared/tui-agent-config' -import type { AgentLaunchSettingsSource } from '../../shared/agent-launch-settings' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' +import type { AgentLaunchSettingsSource } from '../../shared/agent-launch/choices/agent-launch-settings' export function agentLaunchSettingsRollbackUpdates( before: AgentLaunchSettingsSource, diff --git a/src/main/runtime/agent-prompt-line-settle.test.ts b/src/main/runtime/agent-prompt-line-settle.test.ts index 69b488a5dac..f5bcb070c10 100644 --- a/src/main/runtime/agent-prompt-line-settle.test.ts +++ b/src/main/runtime/agent-prompt-line-settle.test.ts @@ -1,7 +1,7 @@ import type * as WorktreeScanCacheModule from '../git/worktrees/catalog/worktree-scan-cache' import type * as WorktreeListingModule from '../git/worktrees/catalog/worktree-listing' import { afterEach, describe, expect, it, vi } from 'vitest' -import { resolveAgentPromptSubmitDelayForAgent } from '../../shared/agent-prompt-injection' +import { resolveAgentPromptSubmitDelayForAgent } from '../../shared/agent-launch/startup/agent-prompt-injection' import { createAgentPromptSubmissionRuntime } from './agent-prompt-submission-runtime-test-fixture' vi.mock('../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => { diff --git a/src/main/runtime/agent-prompt-submission-runtime-hook-and-generation.test.ts b/src/main/runtime/agent-prompt-submission-runtime-hook-and-generation.test.ts index b53aeba0b02..0b1073c5a71 100644 --- a/src/main/runtime/agent-prompt-submission-runtime-hook-and-generation.test.ts +++ b/src/main/runtime/agent-prompt-submission-runtime-hook-and-generation.test.ts @@ -7,7 +7,7 @@ import { AGENT_PROMPT_BRACKETED_PASTE_END, buildAgentPromptPasteBytes, getAgentPromptSubmitDelayMs -} from '../../shared/agent-prompt-injection' +} from '../../shared/agent-launch/startup/agent-prompt-injection' import { AGENT_PROMPT_TEST_WORKTREE_PATH, createAgentPromptSubmissionRuntime diff --git a/src/main/runtime/agent-prompt-submission-runtime-test-fixture.ts b/src/main/runtime/agent-prompt-submission-runtime-test-fixture.ts index bc6c691e94c..26ed7ead833 100644 --- a/src/main/runtime/agent-prompt-submission-runtime-test-fixture.ts +++ b/src/main/runtime/agent-prompt-submission-runtime-test-fixture.ts @@ -1,5 +1,5 @@ import { vi } from 'vitest' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { OrcaRuntimeService } from './orca-runtime' import { makeStore } from './runtime-rpc-worktree-store-fixtures' diff --git a/src/main/runtime/agent-prompt-submission-runtime.test.ts b/src/main/runtime/agent-prompt-submission-runtime.test.ts index e481a77f188..8edab22a305 100644 --- a/src/main/runtime/agent-prompt-submission-runtime.test.ts +++ b/src/main/runtime/agent-prompt-submission-runtime.test.ts @@ -1,7 +1,7 @@ import type * as WorktreeScanCacheModule from '../git/worktrees/catalog/worktree-scan-cache' import type * as WorktreeListingModule from '../git/worktrees/catalog/worktree-listing' import { afterEach, describe, expect, it, vi } from 'vitest' -import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../shared/agent-prompt-injection' +import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../shared/agent-launch/startup/agent-prompt-injection' import { AGENT_PROMPT_TEST_WORKTREE_PATH, createAgentPromptSubmissionRuntime diff --git a/src/main/runtime/agent-prompt-submission-windows-submit-delay.test.ts b/src/main/runtime/agent-prompt-submission-windows-submit-delay.test.ts index 6b1f19ac1dd..b579207e434 100644 --- a/src/main/runtime/agent-prompt-submission-windows-submit-delay.test.ts +++ b/src/main/runtime/agent-prompt-submission-windows-submit-delay.test.ts @@ -5,7 +5,7 @@ import { buildAgentPromptPasteBytes, getAgentPromptSubmitDelayMs, getTerminalPasteIngestMs -} from '../../shared/agent-prompt-injection' +} from '../../shared/agent-launch/startup/agent-prompt-injection' import { setSshTargetRegistryHandlers } from '../ssh/targets/ssh-target-registry' import { OrcaRuntimeService } from './orca-runtime' import { makeStore } from './runtime-rpc-worktree-store-fixtures' diff --git a/src/main/runtime/agent-session/ownership/agent-session-claim-identity.ts b/src/main/runtime/agent-session/ownership/agent-session-claim-identity.ts index e46b3334c3b..ecad828e033 100644 --- a/src/main/runtime/agent-session/ownership/agent-session-claim-identity.ts +++ b/src/main/runtime/agent-session/ownership/agent-session-claim-identity.ts @@ -13,7 +13,7 @@ import { AGENT_SESSION_CLAIM_DIGEST_VERSION, type AgentSessionExecutionClaim } from '../../../../shared/agent-session/agent-session-host-authority' -import { getAgentResumeArgv } from '../../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../../shared/agent-launch/startup/agent-resume-argv' import { isResumableTuiAgent, normalizeAgentProviderSession, diff --git a/src/main/runtime/agent-session/ownership/agent-session-permission-backfill.ts b/src/main/runtime/agent-session/ownership/agent-session-permission-backfill.ts index ffaef71a86b..1a4992f18d7 100644 --- a/src/main/runtime/agent-session/ownership/agent-session-permission-backfill.ts +++ b/src/main/runtime/agent-session/ownership/agent-session-permission-backfill.ts @@ -1,4 +1,4 @@ -import { newChatPermissionMode } from '../../../../shared/agent-chat-permission-mode' +import { newChatPermissionMode } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionStoreTransactions } from '../records/agent-session-store-transactions' /** Backfill once as the chat host installs; legacy chats used their agent's Arguments. */ diff --git a/src/main/runtime/agent-session/records/agent-session-record-founding.ts b/src/main/runtime/agent-session/records/agent-session-record-founding.ts index 2053e8b21e4..4ec98a7e39b 100644 --- a/src/main/runtime/agent-session/records/agent-session-record-founding.ts +++ b/src/main/runtime/agent-session/records/agent-session-record-founding.ts @@ -2,7 +2,7 @@ import { AGENT_SESSION_FOUNDING_FENCE, agentSessionNeverStarted } from '../../../../shared/agent-session/lifecycle/agent-session-conversation-view' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { AGENT_SESSION_RECORD_SCHEMA_VERSION, type AgentSessionRecord diff --git a/src/main/runtime/agent-state-rules/agent-state-rules-engine.ts b/src/main/runtime/agent-state-rules/agent-state-rules-engine.ts index ff726245a7e..758cb10fcaa 100644 --- a/src/main/runtime/agent-state-rules/agent-state-rules-engine.ts +++ b/src/main/runtime/agent-state-rules/agent-state-rules-engine.ts @@ -1,5 +1,5 @@ import type { AgentStatus } from '../../../shared/agent-detection' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { compileScreenCondition } from './agent-state-rule-matchers' import { compiledFromActiveAgentStateRules } from './active-agent-state-rules' import { diff --git a/src/main/runtime/agent-state-rules/agent-state-rules-schema.ts b/src/main/runtime/agent-state-rules/agent-state-rules-schema.ts index 5f5b19082c8..9f17c0c5441 100644 --- a/src/main/runtime/agent-state-rules/agent-state-rules-schema.ts +++ b/src/main/runtime/agent-state-rules/agent-state-rules-schema.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import type { RuntimeTerminalWaitBlockedReason } from '../../../shared/runtime-types' -import type { TuiAgent } from '../../../shared/tui-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { findUnsafePatternReason } from './agent-state-rule-pattern-safety' /** Shipped engine versions must bump when regions, predicates or answers expand. */ diff --git a/src/main/runtime/agent-transcript-pane-test-harness.ts b/src/main/runtime/agent-transcript-pane-test-harness.ts index 7d2a3fb897f..a5b7d305249 100644 --- a/src/main/runtime/agent-transcript-pane-test-harness.ts +++ b/src/main/runtime/agent-transcript-pane-test-harness.ts @@ -1,7 +1,7 @@ import type { RuntimeTerminalCreate } from '../../shared/runtime-terminal-create-contract' import { vi } from 'vitest' import { OrcaRuntimeService } from './orca-runtime' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { PtyProcessInspection } from '../providers/pty-process-inspection' import type { RuntimeStore } from './runtime-store-contract' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch' diff --git a/src/main/runtime/blocked-tail-screen-clear.ts b/src/main/runtime/blocked-tail-screen-clear.ts index 40049a66432..bba2cf9020d 100644 --- a/src/main/runtime/blocked-tail-screen-clear.ts +++ b/src/main/runtime/blocked-tail-screen-clear.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { findTerminalWaitBlockedSignal } from './agent-state-rules/blocked-text-layer' import { evaluateAgentStateRules } from './agent-state-rules/agent-state-rules-engine' diff --git a/src/main/runtime/client/runtime-client-state.ts b/src/main/runtime/client/runtime-client-state.ts index 8d20bd4f42c..59fa2cab51c 100644 --- a/src/main/runtime/client/runtime-client-state.ts +++ b/src/main/runtime/client/runtime-client-state.ts @@ -15,7 +15,7 @@ import { collectMemorySnapshot } from '../../memory/collector' import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' import type { FeatureInteractionId } from '../../../shared/feature-interactions' import type { RuntimeClientSettingsUpdate } from '../runtime-client-settings-shape' -import type { AgentLaunchSettingsMutation } from '../../../shared/agent-launch-settings' +import type { AgentLaunchSettingsMutation } from '../../../shared/agent-launch/choices/agent-launch-settings' import type { TerminalQuickCommand } from '../../../shared/terminal-quick-command-types' import type { TerminalQuickCommandMutation } from '../../../shared/terminal-quick-commands' import type { NativeChatSessionOptionSettingsMutation } from '../../../shared/native-chat/input/native-chat-session-options' diff --git a/src/main/runtime/codex-quiet-ready-screen.test.ts b/src/main/runtime/codex-quiet-ready-screen.test.ts index c8e3e1fb1b0..d3e920b2d78 100644 --- a/src/main/runtime/codex-quiet-ready-screen.test.ts +++ b/src/main/runtime/codex-quiet-ready-screen.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { createTranscriptPane, waitForTranscriptIdle } from './agent-transcript-pane-test-harness' import { readRuntimeFixture, diff --git a/src/main/runtime/construction/runtime-construction-services.ts b/src/main/runtime/construction/runtime-construction-services.ts index fb0efca76a7..f52fe628393 100644 --- a/src/main/runtime/construction/runtime-construction-services.ts +++ b/src/main/runtime/construction/runtime-construction-services.ts @@ -10,7 +10,7 @@ import type { } from '../runtime-terminal-state-records' import type { TerminalAgent } from '../../../shared/terminal-agent' import type { AgentStatus } from '../../../shared/agent-detection' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { TuiIdleHookTurn } from '../tui-idle-hook-lane' import type { RuledScreen } from '../screen-input-veto' import type { diff --git a/src/main/runtime/construction/runtime-identity-state.ts b/src/main/runtime/construction/runtime-identity-state.ts index 9bf37aff4dc..e56cb3c18f1 100644 --- a/src/main/runtime/construction/runtime-identity-state.ts +++ b/src/main/runtime/construction/runtime-identity-state.ts @@ -10,9 +10,9 @@ import { headlessMobileSnapshotContentUnchanged, mobileSnapshotIdentityUnchanged } from '../mobile-session-snapshot-equality' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../../shared/terminal-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import type { RuntimeStore } from '../runtime-store-contract' import type { RuntimeClientSettingsController } from '../runtime-client-settings' import type { RuntimeAutomationController } from '../runtime-automation-controller' diff --git a/src/main/runtime/draft-paste-ready-scanner-chunking.test.ts b/src/main/runtime/draft-paste-ready-scanner-chunking.test.ts index 1753625ddc9..40f3da241e1 100644 --- a/src/main/runtime/draft-paste-ready-scanner-chunking.test.ts +++ b/src/main/runtime/draft-paste-ready-scanner-chunking.test.ts @@ -5,7 +5,7 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { createDraftPasteReadyScanner } from '../../shared/draft-paste-ready-scanner' -import type { DraftPasteReadySignal } from '../../shared/tui-agent-config' +import type { DraftPasteReadySignal } from '../../shared/agent-launch/catalog/tui-agent-config-types' import { GROK_STARTUP_PTY_TRACE } from '../../shared/__fixtures__/grok-startup-pty-trace' import { GROK_INLINE_STARTUP_PTY_TRACE } from '../../shared/__fixtures__/grok-inline-startup-pty-trace' import type { GrokStartupTraceChunk } from '../../shared/__fixtures__/grok-startup-pty-trace' diff --git a/src/main/runtime/dsb-terminal-runtime.test.ts b/src/main/runtime/dsb-terminal-runtime.test.ts index c8b8d5381e1..2b9326072ea 100644 --- a/src/main/runtime/dsb-terminal-runtime.test.ts +++ b/src/main/runtime/dsb-terminal-runtime.test.ts @@ -3,7 +3,7 @@ import type * as WorktreeListingModule from '../git/worktrees/catalog/worktree-l import { readFileSync } from 'node:fs' import { join } from 'node:path' import { afterEach, describe, expect, expectTypeOf, it, vi } from 'vitest' -import { buildAgentPromptPasteBytes } from '../../shared/agent-prompt-injection' +import { buildAgentPromptPasteBytes } from '../../shared/agent-launch/startup/agent-prompt-injection' import type { RuntimeTerminalSummary } from '../../shared/runtime-terminal-contracts' import type { TerminalAgent } from '../../shared/terminal-agent' import { OrcaRuntimeService } from './orca-runtime' diff --git a/src/main/runtime/dsh-launch-prompt-resubmit.test.ts b/src/main/runtime/dsh-launch-prompt-resubmit.test.ts index efaaebdc4bd..40a4f9af9ce 100644 --- a/src/main/runtime/dsh-launch-prompt-resubmit.test.ts +++ b/src/main/runtime/dsh-launch-prompt-resubmit.test.ts @@ -3,7 +3,7 @@ import type * as WorktreeListingModule from '../git/worktrees/catalog/worktree-l import { readFileSync } from 'node:fs' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../shared/agent-prompt-injection' +import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../shared/agent-launch/startup/agent-prompt-injection' import { createAgentPromptSubmissionRuntime } from './agent-prompt-submission-runtime-test-fixture' import { dispatchPreambleSendOptions } from './orchestration/preamble' diff --git a/src/main/runtime/headless-terminal-query-reply-policy.ts b/src/main/runtime/headless-terminal-query-reply-policy.ts index d0cd9f8a68c..8c0c4666a9c 100644 --- a/src/main/runtime/headless-terminal-query-reply-policy.ts +++ b/src/main/runtime/headless-terminal-query-reply-policy.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' /* oxlint-disable no-control-regex -- query replies are ESC/DCS control sequences by definition */ const XTVERSION_REPLY = new RegExp('^\u001bP>\\|[^\u001b]*\u001b\\\\$') diff --git a/src/main/runtime/launch-composer-watch.ts b/src/main/runtime/launch-composer-watch.ts index 62492d157c1..c182cdb4572 100644 --- a/src/main/runtime/launch-composer-watch.ts +++ b/src/main/runtime/launch-composer-watch.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveDraftPasteReadyTimeoutMs } from '../../shared/draft-paste-ready-timeout' import type { LaunchedAgentForeground } from './launched-agent-foreground' import { readFreshComposerHold } from './launched-agent-composer-readiness' diff --git a/src/main/runtime/launched-agent-composer-readiness.test.ts b/src/main/runtime/launched-agent-composer-readiness.test.ts index a0f9da3226f..89a485ca51e 100644 --- a/src/main/runtime/launched-agent-composer-readiness.test.ts +++ b/src/main/runtime/launched-agent-composer-readiness.test.ts @@ -5,8 +5,8 @@ import { createDraftPasteReadyScanner, resolvePasteReadySignal } from '../../shared/draft-paste-ready-scanner' -import type { TuiAgent } from '../../shared/tui-agent' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import type { RuntimeTerminalWait } from '../../shared/runtime-terminal-contracts' import { GROK_STARTUP_PTY_TRACE } from '../../shared/__fixtures__/grok-startup-pty-trace' import type { GrokStartupTraceChunk } from '../../shared/__fixtures__/grok-startup-pty-trace' diff --git a/src/main/runtime/launched-agent-composer-readiness.ts b/src/main/runtime/launched-agent-composer-readiness.ts index 7684d8525e0..821a34852fb 100644 --- a/src/main/runtime/launched-agent-composer-readiness.ts +++ b/src/main/runtime/launched-agent-composer-readiness.ts @@ -8,10 +8,10 @@ import { * Captured-marker agents wait for their marker; others may fall back to tui-idle within the remaining budget. * Readiness alone never authorizes writing: the foreground guard must still admit the agent. */ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RuntimeTerminalWait } from '../../shared/runtime-terminal-contracts' import { resolveDraftPasteReadyTimeoutMs } from '../../shared/draft-paste-ready-timeout' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import { draftPasteReadySignalHasMarker } from '../../shared/draft-paste-ready-scanner' import { nameOnlyIdleNeedsCorroboration } from './tui-idle-evidence' import type { OrcaRuntimeService } from './orca-runtime' diff --git a/src/main/runtime/launched-agent-exit-watch.ts b/src/main/runtime/launched-agent-exit-watch.ts index 128e7142f95..c708fac0f48 100644 --- a/src/main/runtime/launched-agent-exit-watch.ts +++ b/src/main/runtime/launched-agent-exit-watch.ts @@ -1,7 +1,7 @@ import { FOREGROUND_COMMAND_READS } from '../../shared/foreground-command-settle' import { createOsc133CommandFinishedScanner } from '../../shared/terminal-osc133-command-finished' import { terminalSafe } from '../../shared/terminal-safe-text' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from './orca-runtime' import { applyTerminalLineControls } from './terminal-tail-line-controls' diff --git a/src/main/runtime/launched-agent-foreground.ts b/src/main/runtime/launched-agent-foreground.ts index 6288f1f2a51..fa2dd7c377a 100644 --- a/src/main/runtime/launched-agent-foreground.ts +++ b/src/main/runtime/launched-agent-foreground.ts @@ -5,8 +5,8 @@ import { } from '../../shared/agent-process-recognition' import { PROCESS_TABLE_SNAPSHOT_MAX_STALENESS_MS } from '../../shared/process-table-snapshot' import { isShellProcess } from '../../shared/shell-process-detection' -import type { TuiAgent } from '../../shared/tui-agent' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import type { RuntimePtyController } from './runtime-pty-controller-contract' import { judgeTerminalForeground, readTerminalProcessRows } from './terminal-foreground-group' import { isTerminalForegroundObservation } from '../../shared/terminal-foreground-observation' diff --git a/src/main/runtime/launched-agent-shell-handoff-readiness.test.ts b/src/main/runtime/launched-agent-shell-handoff-readiness.test.ts index cbcef1f8924..b3312e0c92e 100644 --- a/src/main/runtime/launched-agent-shell-handoff-readiness.test.ts +++ b/src/main/runtime/launched-agent-shell-handoff-readiness.test.ts @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { waitForWorktreeStartupDraft } from './runtime-worktree-startup-readiness' const QUIET_WINDOW_MS = 1_500 diff --git a/src/main/runtime/launched-agent-write-guard.ts b/src/main/runtime/launched-agent-write-guard.ts index 068b82d0b76..5f40875b3f0 100644 --- a/src/main/runtime/launched-agent-write-guard.ts +++ b/src/main/runtime/launched-agent-write-guard.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from '../../shared/tui-agent' -import { isTuiAgent } from '../../shared/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import type { OrcaRuntimeService } from './orca-runtime' import type { LaunchedAgentForeground } from './launched-agent-foreground' diff --git a/src/main/runtime/omp-readiness-transcripts.test.ts b/src/main/runtime/omp-readiness-transcripts.test.ts index 7bbdd0da05b..1171d0cde72 100644 --- a/src/main/runtime/omp-readiness-transcripts.test.ts +++ b/src/main/runtime/omp-readiness-transcripts.test.ts @@ -3,7 +3,7 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { createTranscriptPane, TRANSCRIPT_PANE_PTY_ID } from './agent-transcript-pane-test-harness' import { extractLastOscTitle } from '../../shared/osc-title-extraction' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { createDraftPasteReadyScanner } from '../../shared/draft-paste-ready-scanner' import { OPENCODE_AGENT_ROW_GRACE_MS } from '../../shared/opencode-agent-row-scanner' import { readTimedRuntimeFixture, replayTranscript } from './agent-transcript-replay-test-harness' diff --git a/src/main/runtime/opencode-agent-row-enter-transcript.test.ts b/src/main/runtime/opencode-agent-row-enter-transcript.test.ts index 7159c16bc85..2e2bab872af 100644 --- a/src/main/runtime/opencode-agent-row-enter-transcript.test.ts +++ b/src/main/runtime/opencode-agent-row-enter-transcript.test.ts @@ -5,8 +5,8 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { createDraftPasteReadyScanner } from '../../shared/draft-paste-ready-scanner' -import type { DraftPasteReadySignal } from '../../shared/tui-agent-config' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import type { DraftPasteReadySignal } from '../../shared/agent-launch/catalog/tui-agent-config-types' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import { readTimedRuntimeFixture, replayTranscript } from './agent-transcript-replay-test-harness' const HELD_PASTE = '[Pasted ~' diff --git a/src/main/runtime/orca-runtime-agent-session-operation.test.ts b/src/main/runtime/orca-runtime-agent-session-operation.test.ts index 237daeb17ca..eb7d6ebe9cb 100644 --- a/src/main/runtime/orca-runtime-agent-session-operation.test.ts +++ b/src/main/runtime/orca-runtime-agent-session-operation.test.ts @@ -8,8 +8,9 @@ import type { RuntimeCreateAgentSessionResult } from '../../shared/agent-session/agent-session-host-authority' import { OrcaRuntimeService } from './orca-runtime' -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from '../../shared/tui-agent-startup' -import { tokenizeStartupCommand } from '../../shared/tui-agent-startup-shell' +import { buildAgentStartupPlan } from '../../shared/agent-launch/startup/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' +import { tokenizeStartupCommand } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import type { TerminalCreateOptions } from './runtime-terminal-contracts' import type { IPtyProvider } from '../providers/pty-provider-contract' diff --git a/src/main/runtime/orca-runtime-create-agent-session.ts b/src/main/runtime/orca-runtime-create-agent-session.ts index ca30862e7f4..b5dc745537f 100644 --- a/src/main/runtime/orca-runtime-create-agent-session.ts +++ b/src/main/runtime/orca-runtime-create-agent-session.ts @@ -10,7 +10,7 @@ import { parseAgentSessionOperationTimestamp } from '../../shared/agent-session/agent-session-host-authority' import { createHash } from 'node:crypto' -import { isTuiAgentEnabled } from '../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../shared/agent-launch/catalog/tui-agent-selection' import type { RuntimeTerminalCreate } from '../../shared/runtime-types' import type { AgentSessionCreateOperation, diff --git a/src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts b/src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts index de2c31efe94..c98fd6ee630 100644 --- a/src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts +++ b/src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchChoices } from '../../shared/agent-launch-choices' +import type { AgentLaunchChoices } from '../../shared/agent-launch/choices/agent-launch-choices' import { prepareStructuredAgentSessionCreateForWorktree } from './rpc/methods/structured-agent-session-create' import { agentSessionConversationView } from '../../shared/agent-session/lifecycle/agent-session-conversation-view' import { prepareAdoptedTranscript } from '../native-chat/agent-session-wire/structured-agent-session-adopted-import' diff --git a/src/main/runtime/orca-runtime-test-fixtures.spec.ts b/src/main/runtime/orca-runtime-test-fixtures.spec.ts index 0c8207d65fa..88eabef7527 100644 --- a/src/main/runtime/orca-runtime-test-fixtures.spec.ts +++ b/src/main/runtime/orca-runtime-test-fixtures.spec.ts @@ -9,7 +9,7 @@ import { OrcaRuntimeService } from './orca-runtime' import { buildAgentPromptPasteBytes, getTerminalPasteIngestMs -} from '../../shared/agent-prompt-injection' +} from '../../shared/agent-launch/startup/agent-prompt-injection' import { getDefaultWorkspaceSession } from '../../shared/constants' import { makePaneKey } from '../../shared/stable-pane-id' import type { LayoutCommand } from '../../shared/workspace-layout/workspace-layout-command-types' diff --git a/src/main/runtime/orca-runtime-test-mocks.spec.ts b/src/main/runtime/orca-runtime-test-mocks.spec.ts index 06aff4faf51..b96e09cb8cc 100644 --- a/src/main/runtime/orca-runtime-test-mocks.spec.ts +++ b/src/main/runtime/orca-runtime-test-mocks.spec.ts @@ -255,7 +255,7 @@ export type { RuntimeTerminalAgentStatusEvent } from './orca-runtime' export type { Tab } from '../../shared/tab-types' export type { TerminalLayoutSnapshot } from '../../shared/terminal-tab-types' export type { TerminalSideEffectBatch } from '../../shared/terminal-side-effect-facts' -export type { TuiAgent } from '../../shared/tui-agent' + export type { WorkspaceLineage, WorktreeLineage } from '../../shared/worktree/lineage-types' export type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' export type { Worktree } from '../../shared/worktree/types' diff --git a/src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts b/src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts index 73065626f76..c7555d22e87 100644 --- a/src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts +++ b/src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts @@ -91,7 +91,7 @@ import { buildAgentPromptPasteBytes, getAgentPromptSubmitDelayMs, getTerminalPasteIngestMs -} from '../../../shared/agent-prompt-injection' +} from '../../../shared/agent-launch/startup/agent-prompt-injection' import { CLIPBOARD_TEXT_MEASURE_YIELD_CODE_UNITS } from '../../../shared/clipboard-text' import { projectHostSetupProjectionFromRepos } from '../../../shared/project-host-setup-projection' import { @@ -113,7 +113,7 @@ import { SETUP_AGENT_SEQUENCE_STARTUP_SCRIPT_ENV } from '../../../shared/setup-agent-sequencing' import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../../shared/worktree/id' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' import { beginWatcherInstall } from '../../workspaces/removal/watcher-removal-gate' import { WATCHER_REMOVAL_DRAIN_BUDGET_MS } from '../../workspaces/removal/watcher-removal-drain' import { diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts index bbfdfaf89cb..3f6d516afce 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts @@ -9,7 +9,7 @@ import { makeWorkspaceSessionWithHeadlessTerminal } from '../orca-runtime-test-fixtures.spec' import { planDuplicatePtyPaneRepair } from '../../persistence/terminal-topology/duplicate-pty-pane-repair' -import type { WorkspaceSessionState } from '../orca-runtime-test-mocks.spec' +import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' // Windowless listing reads stored layout; duplicate PTY bindings need durable repair to avoid duplicate tabs. const duplicate = makeWorkspaceSessionWithHeadlessTerminal({ diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts index b34620394a6..32dbc08e257 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts @@ -1,9 +1,6 @@ import { describe, expect, it, vi } from 'vitest' -import { - OrcaRuntimeService, - electronMocks, - getDefaultWorkspaceSession -} from '../orca-runtime-test-mocks.spec' +import { OrcaRuntimeService, getDefaultWorkspaceSession } from '../orca-runtime-test-mocks.spec' +import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { TEST_REPO_ID, diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts index 9ff519fee67..da7d416ba71 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../orca-runtime-test-mocks.spec' -import type { WorkspaceSessionState } from '../orca-runtime-test-mocks.spec' +import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' import { HEADLESS_LEAF_ID, HEADLESS_SECOND_LEAF_ID, diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts index d6b3a8d8f40..3204b300615 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts @@ -3,7 +3,7 @@ import { AGENT_PROMPT_BRACKETED_PASTE_END, AGENT_PROMPT_BRACKETED_PASTE_START, buildAgentPromptPasteBytes -} from '../../../shared/agent-prompt-injection' +} from '../../../shared/agent-launch/startup/agent-prompt-injection' import { ORCA_DISPATCH_PROMPT_LEAD_LINE } from '../../../shared/orca-dispatch-status-prompt' import { OrcaRuntimeService } from '../orca-runtime' import { acknowledgeAgentPromptSubmit } from '../orca-runtime-test-mocks.spec' diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts index e704b838c47..0a010147c22 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts @@ -11,7 +11,7 @@ import { publishAgentLaunchTabEarly } from '../rpc/methods/agent-launch-tab-publ import { AgentLaunch } from '../../../shared/rpc-contract/agent-launch-params' import { DESKTOP_RPC_CALLER } from '../rpc/rpc-caller-identity' import type { RpcContext } from '../rpc/core' -import type { AgentLaunchTabPublished } from '../../../shared/agent-launch-tab-publication' +import type { AgentLaunchTabPublished } from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' const RESERVED_TAB_ID = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' const RESERVED_LEAF_ID = '3f2504e0-4f89-41d3-9a0c-0305e82c3301' diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index 533ee9ca304..0c8dc9e60b9 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -15,11 +15,11 @@ import type { RuntimeCommandSurfaceHost } from './orca-runtime-core' import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch-tab-publication' +} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' import type { AgentLaunchPaneAddress, AgentLaunchPaneVerdict -} from '../../shared/agent-launch-pane-verdict' +} from '../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { registerWorktreeChangeInvalidator } from '../ipc/worktrees/listing/worktree-change-invalidators' import type { AgentSessionRecordStore } from './agent-session/records/agent-session-record-store' import { peekOpenedAgentSessionRecordStore } from './agent-session/records/agent-session-record-store-slot' diff --git a/src/main/runtime/orchestration-mailbox-notification-test-harness.ts b/src/main/runtime/orchestration-mailbox-notification-test-harness.ts index 6559a3a827e..01bdf2f8f59 100644 --- a/src/main/runtime/orchestration-mailbox-notification-test-harness.ts +++ b/src/main/runtime/orchestration-mailbox-notification-test-harness.ts @@ -5,7 +5,7 @@ import { join } from 'node:path' import { expect, vi } from 'vitest' import { ORCHESTRATION_CONTRACT_VERSION } from '../../shared/protocol-version' import type { AgentStatusIpcPayload } from '../../shared/agent-status-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type Database from '../sqlite/sync-database' import { OrcaRuntimeService } from './orca-runtime' import { OrchestrationDb } from './orchestration/db' diff --git a/src/main/runtime/orchestration-opencode-model-host.test.ts b/src/main/runtime/orchestration-opencode-model-host.test.ts index f0b8b14282f..6e8875d2e28 100644 --- a/src/main/runtime/orchestration-opencode-model-host.test.ts +++ b/src/main/runtime/orchestration-opencode-model-host.test.ts @@ -4,7 +4,7 @@ import { OrcaRuntimeService } from './orca-runtime' import { resolveOpenCodeDirectModelExecutable } from '../opencode/opencode-model-executable' import { probeOpenCodeLaunchCapabilities } from '../opencode/opencode-launch-capabilities' import { resolveLocalProjectRuntimeForRepo } from '../workspaces/execution-host/local-project-runtime-resolution' -import { OPENCODE_MODEL_VERSION_REFUSAL } from '../../shared/agent-launch-model-preferences' +import { OPENCODE_MODEL_VERSION_REFUSAL } from '../../shared/agent-launch/choices/agent-launch-model-preferences' vi.mock('../opencode/opencode-launch-capabilities', () => ({ probeOpenCodeLaunchCapabilities: vi.fn() diff --git a/src/main/runtime/orchestration/chat-worker-error-escalation.ts b/src/main/runtime/orchestration/chat-worker-error-escalation.ts index d18cc9c1d5a..69f93b6bf44 100644 --- a/src/main/runtime/orchestration/chat-worker-error-escalation.ts +++ b/src/main/runtime/orchestration/chat-worker-error-escalation.ts @@ -5,7 +5,7 @@ import { agentSessionFailureFact } from '../../../shared/agent-session/failures/ import { agentSessionFailureWords } from '../../../shared/agent-session/failures/agent-session-failure-words' import { formatOrcaSessionAddress, isOrcaSessionId } from '../../../shared/orca-session-address' import type { StructuredAgentSessionRequestFailure } from '../../native-chat/agent-session-wire/structured-agent-session-request-failures' -import { tuiAgentDisplayName } from '../../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../shared/agent-launch/catalog/tui-agent-display-names' import { resolveStructuredWorkerIdentityForSession } from '../structured-worker-authority' import { canonicalOrcaSessionId } from './canonical-orca-session-id' import { chatRequestError, isSenderOwnRejection } from './chat-worker-error-words' diff --git a/src/main/runtime/orchestration/codex-reconnect-failed-dispatch.test.ts b/src/main/runtime/orchestration/codex-reconnect-failed-dispatch.test.ts index 2ddbd8942bd..66714739887 100644 --- a/src/main/runtime/orchestration/codex-reconnect-failed-dispatch.test.ts +++ b/src/main/runtime/orchestration/codex-reconnect-failed-dispatch.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { makePaneKey } from '../../../shared/stable-pane-id' import { createTranscriptPane, TRANSCRIPT_PANE_PTY_ID } from '../agent-transcript-pane-test-harness' import { OrchestrationDb } from './db' diff --git a/src/main/runtime/orchestration/configured-worker-agent-selector.ts b/src/main/runtime/orchestration/configured-worker-agent-selector.ts index 959eb66c55c..45a11a89edc 100644 --- a/src/main/runtime/orchestration/configured-worker-agent-selector.ts +++ b/src/main/runtime/orchestration/configured-worker-agent-selector.ts @@ -1,12 +1,12 @@ import { extractLeadingEnvAssignments } from '../../../shared/command-environment' import { getCommandTokenPathBasename } from '../../../shared/command-token-scanner' -import type { TuiAgent } from '../../../shared/tui-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { resolveStartupShell, type AgentStartupShell, tokenizeStartupCommand -} from '../../../shared/tui-agent-startup-shell' +} from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { OrchestrationError } from './orchestration-error' export function resolveConfiguredWorkerAgent( diff --git a/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts b/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts index 2aad003f968..52ef3b20dac 100644 --- a/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts +++ b/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts @@ -9,8 +9,8 @@ import { type ExecutionHostId } from '../../../../../shared/execution-host' import type { ExactWorkerProviderSession } from '../../../../../shared/orchestration-worker-output' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { isLocalHookConnectionId } from '../../../../../shared/wsl-hook-relay-contract' import type { DispatchContextRow } from '../../types' import type { WorkerTerminalResourceRow } from '../../worker-terminal-ownership' diff --git a/src/main/runtime/orchestration/groups.ts b/src/main/runtime/orchestration/groups.ts index 3719bea1d0e..5d9d817ebc4 100644 --- a/src/main/runtime/orchestration/groups.ts +++ b/src/main/runtime/orchestration/groups.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { OrchestrationAddressableAgent } from './structured-worker-group-addressing' // Resolve per-recipient mail at send-time; candidates are Run-scoped except explicit @worktree addresses, never host-wide. diff --git a/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts b/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts index 1c42526eac5..6766bcb6e69 100644 --- a/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts +++ b/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts @@ -6,10 +6,10 @@ import type { WriteSettlement } from '../../../../shared/pty-write-settlement' import type { RuntimeLeafRecord } from '../../runtime-terminal-state-records' import type { ExecutionHostId } from '../../../../shared/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal-execution-host' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../../../shared/terminal-agent' import { selectRuntimeHookAgentRowForPane } from '../../runtime-mobile-agent-status-projection' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolvePublishedPaneAgentIdentity } from '../../../../shared/published-pane-agent-identity' import type { RuntimeTerminalSummary } from '../../../../shared/runtime-types' import type { ResolvedWorktree } from '../../runtime-worktree-path-identity' diff --git a/src/main/runtime/orchestration/worker-launch-observation.ts b/src/main/runtime/orchestration/worker-launch-observation.ts index 9e6d7a2f84b..922805c6aab 100644 --- a/src/main/runtime/orchestration/worker-launch-observation.ts +++ b/src/main/runtime/orchestration/worker-launch-observation.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import type { OrchestrationDb } from './db' import { AGENT_TYPE_MAX_LENGTH } from '../../../shared/agent-status-field-normalization' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { salvagedOptional } from '../../../shared/zod-salvage' const object = z.record(z.string(), z.unknown()) diff --git a/src/main/runtime/qoder-independent-spawn-review.test.ts b/src/main/runtime/qoder-independent-spawn-review.test.ts index 9ad7aca23e1..fdc1ee11a6f 100644 --- a/src/main/runtime/qoder-independent-spawn-review.test.ts +++ b/src/main/runtime/qoder-independent-spawn-review.test.ts @@ -3,7 +3,7 @@ import { beforeEach, expect, it, vi } from 'vitest' import filesystem from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' import { buildAiVaultResumeShellCommand } from '../../shared/ai-vault-resume-command' await import('./orca-runtime-test-mocks.spec') diff --git a/src/main/runtime/qoder-mobile-resume-adoption.test.ts b/src/main/runtime/qoder-mobile-resume-adoption.test.ts index 6a5660046df..e33265b2ebb 100644 --- a/src/main/runtime/qoder-mobile-resume-adoption.test.ts +++ b/src/main/runtime/qoder-mobile-resume-adoption.test.ts @@ -1,7 +1,7 @@ import './rpc/unused-default-rpc-methods.test-fixture' import { expect, it, vi } from 'vitest' import type { SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' -import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../shared/agent-launch/startup/tui-agent-resume-startup' await import('./orca-runtime-test-mocks.spec') await import('./orca-runtime-test-lifecycle.spec') diff --git a/src/main/runtime/qoder-terminal-command-resolution.ts b/src/main/runtime/qoder-terminal-command-resolution.ts index 123f2db058e..ffec61b5e38 100644 --- a/src/main/runtime/qoder-terminal-command-resolution.ts +++ b/src/main/runtime/qoder-terminal-command-resolution.ts @@ -1,10 +1,13 @@ import type { PreflightRuntimeContext } from '../preflight/agent-detection' import { detectAgentCommandsOnHost } from '../preflight/agent-detection' -import { getTuiAgentDetectCommands, TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { + getTuiAgentDetectCommands, + TUI_AGENT_CONFIG +} from '../../shared/agent-launch/catalog/tui-agent-config' import { tokenizeStartupCommand, type AgentStartupShell -} from '../../shared/tui-agent-startup-shell' +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' import type { TerminalCreateOptions } from './runtime-terminal-contracts' export async function resolveQoderTerminalCommand< diff --git a/src/main/runtime/remote-viewer-launch-env.ts b/src/main/runtime/remote-viewer-launch-env.ts index 74501e7b7c1..197124a46da 100644 --- a/src/main/runtime/remote-viewer-launch-env.ts +++ b/src/main/runtime/remote-viewer-launch-env.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { applyRemoteViewerClipboardEnv } from '../ipc/pty/host-env/remote-viewer-clipboard-env' import { applyClaudeTerminalImageViewerEnv } from './terminal-image-viewer-env' diff --git a/src/main/runtime/rpc/agent-launch-feature-requirement.ts b/src/main/runtime/rpc/agent-launch-feature-requirement.ts index 8f43263ebfb..d695a7a407b 100644 --- a/src/main/runtime/rpc/agent-launch-feature-requirement.ts +++ b/src/main/runtime/rpc/agent-launch-feature-requirement.ts @@ -1,4 +1,4 @@ -import { recognizeAgentLaunchCommand } from '../../../shared/agent-command-line-intent' +import { recognizeAgentLaunchCommand } from '../../../shared/agent-launch/startup/agent-command-line-intent' import type { OrcadFeature } from './orcad-feature-readiness' const ACCOUNTS: readonly OrcadFeature[] = ['accounts'] diff --git a/src/main/runtime/rpc/errors.ts b/src/main/runtime/rpc/errors.ts index c3d70f4cfce..0b0cf5c61ac 100644 --- a/src/main/runtime/rpc/errors.ts +++ b/src/main/runtime/rpc/errors.ts @@ -1,6 +1,6 @@ import { formatTerminalStartFailure } from '../../../shared/terminal-start-failure' // Centralize the runtimeId envelope and error-code contracts that clients use for decisions and display. -import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../../shared/agent-launch-surface' +import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../../shared/agent-launch/contracts/agent-launch-surface' import { agentSessionRefusalReference, isAgentSessionRefusalError, @@ -38,10 +38,10 @@ import { ARCHIVE_HOOK_FAILED_REMOVAL_CODE } from '../../../shared/worktree/archi import { NESTED_WORKER_DEPTH_EXCEEDED_CODE } from '../../../shared/nested-worker-depth' import { PROJECT_RUNTIME_REPAIR_REQUIRED_CODE } from '../../../shared/project-runtime-repair-message' import { WORKTREE_CREATE_COLLISION_CODE } from '../../../shared/new-workspace/worktree-create-collision' -import { AGENT_LAUNCH_PANE_ALREADY_LIVE_CODE } from '../../../shared/agent-launch-pane-already-live' -import { AGENT_LAUNCH_SESSION_ALREADY_EXISTS_CODE } from '../../../shared/agent-launch-session-already-exists' -import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../shared/agent-launch-tab-closed' -import { AGENT_LAUNCH_TARGET_FORBIDDEN_CODE } from '../../../shared/agent-launch-target-forbidden' +import { AGENT_LAUNCH_PANE_ALREADY_LIVE_CODE } from '../../../shared/agent-launch/contracts/agent-launch-pane-already-live' +import { AGENT_LAUNCH_SESSION_ALREADY_EXISTS_CODE } from '../../../shared/agent-launch/contracts/agent-launch-session-already-exists' +import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../shared/agent-launch/contracts/agent-launch-tab-closed' +import { AGENT_LAUNCH_TARGET_FORBIDDEN_CODE } from '../../../shared/agent-launch/contracts/agent-launch-target-forbidden' import { parseTerminalSpawnDeferral, TERMINAL_SPAWN_DEFERRED_CODE diff --git a/src/main/runtime/rpc/methods/agent-launch-at-rest.test.ts b/src/main/runtime/rpc/methods/agent-launch-at-rest.test.ts index 150f60ee1b8..2794a04b9a0 100644 --- a/src/main/runtime/rpc/methods/agent-launch-at-rest.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-at-rest.test.ts @@ -1,6 +1,6 @@ import '../unused-default-rpc-methods.test-fixture' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { AGENT_SESSION_CREATE_MESSAGE_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-create-capabilities' import { createRestTestRig, diff --git a/src/main/runtime/rpc/methods/agent-launch-caller-selection.ts b/src/main/runtime/rpc/methods/agent-launch-caller-selection.ts index d595922cd77..03dfccbb879 100644 --- a/src/main/runtime/rpc/methods/agent-launch-caller-selection.ts +++ b/src/main/runtime/rpc/methods/agent-launch-caller-selection.ts @@ -2,8 +2,11 @@ * Existing/folder targets select the tab; worktree creates provision setup/default tabs in the background. * In-process callers retain host navigation; folder creation activates nothing. */ -import type { AgentLaunchTarget } from '../../../../shared/agent-launch-intent' -import type { AgentLaunchPublishedSurface } from '../../../agent-launch/agent-launch-executor' +import type { + AgentLaunchTarget, + AgentLaunchResult as AgentLaunchPublishedSurface +} from '../../../../shared/agent-launch/contracts/agent-launch-intent' + import { parsePaneKey } from '../../../../shared/stable-pane-id' import type { OrcaRuntimeService } from '../../orca-runtime' import type { RpcContext } from '../core' diff --git a/src/main/runtime/rpc/methods/agent-launch-cwd-refusal.test.ts b/src/main/runtime/rpc/methods/agent-launch-cwd-refusal.test.ts index af6f64eeaa5..761c4c39b10 100644 --- a/src/main/runtime/rpc/methods/agent-launch-cwd-refusal.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-cwd-refusal.test.ts @@ -57,7 +57,7 @@ import { RuntimeRpcFailureError } from '../../../../cli/runtime/types' import { AGENT_LAUNCH_RUNTIME_CAPABILITIES, AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { RpcDispatcher } from '../dispatcher' import { UnixSocketTransport } from '../unix-socket-transport' import { AGENT_LAUNCH_METHODS } from './agent-launch' @@ -86,7 +86,7 @@ import * as createdWorkspaceLaunch from '../../../agent-launch/agent-launch-crea import { formatAmbiguousCwdParentMessage } from '../../runtime-worktree-lineage-resolution' import { managedCwdMobileFixture } from './managed-cwd-mobile.test-fixture' import { managedCwdLaunchFixture } from './managed-cwd-launch.test-fixture' -import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch-operation' +import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch/contracts/agent-launch-operation' import { AgentLaunchReplay } from '../../../../shared/rpc-contract/agent-launch-params' configureWorktreeAwarenessEnvironment({ diff --git a/src/main/runtime/rpc/methods/agent-launch-execution-outcome.ts b/src/main/runtime/rpc/methods/agent-launch-execution-outcome.ts index f9cd43e130f..0a247e8168a 100644 --- a/src/main/runtime/rpc/methods/agent-launch-execution-outcome.ts +++ b/src/main/runtime/rpc/methods/agent-launch-execution-outcome.ts @@ -1,7 +1,7 @@ import { AGENT_LAUNCH_TAB_CLOSED_CODE, AgentLaunchTabClosedError -} from '../../../../shared/agent-launch-tab-closed' +} from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' import type { RpcContext } from '../core' import { readsAgentLaunchTabClosed, type AgentLaunchRefusal } from './agent-launch-replay' import type { EarlyAgentLaunchTab } from './agent-launch-tab-publication' diff --git a/src/main/runtime/rpc/methods/agent-launch-failure-code.ts b/src/main/runtime/rpc/methods/agent-launch-failure-code.ts index 5214ba2eb22..c4f88c6d392 100644 --- a/src/main/runtime/rpc/methods/agent-launch-failure-code.ts +++ b/src/main/runtime/rpc/methods/agent-launch-failure-code.ts @@ -4,7 +4,7 @@ import { LINEAGE_PARENT_AMBIGUOUS } from '../../runtime-worktree-lineage-resolution' import { OrchestrationError } from '../../orchestration/orchestration-error' -import type { AgentLaunchTarget } from '../../../../shared/agent-launch-intent' +import type { AgentLaunchTarget } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import { WorktreeCreateCollisionError, WORKTREE_CREATE_COLLISION_CODE @@ -12,11 +12,11 @@ import { import { AgentLaunchPaneAlreadyLiveError, AGENT_LAUNCH_PANE_ALREADY_LIVE_CODE -} from '../../../../shared/agent-launch-pane-already-live' +} from '../../../../shared/agent-launch/contracts/agent-launch-pane-already-live' import { AgentLaunchSessionAlreadyExistsError, AGENT_LAUNCH_SESSION_ALREADY_EXISTS_CODE -} from '../../../../shared/agent-launch-session-already-exists' +} from '../../../../shared/agent-launch/contracts/agent-launch-session-already-exists' import type { TerminalSpawnDispatch } from '../../../agent-launch/agent-launch-not-started' import { FolderWorkspaceCreateRefusedError } from '../../../project-groups/folder-workspace-create-refusal' import { WorktreeCreateSetupChoiceRefusedError } from '../../worktree-create-setup-choice-refusal' diff --git a/src/main/runtime/rpc/methods/agent-launch-folder-workspace-create.test.ts b/src/main/runtime/rpc/methods/agent-launch-folder-workspace-create.test.ts index 14993aa0f94..b562a48d7e3 100644 --- a/src/main/runtime/rpc/methods/agent-launch-folder-workspace-create.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-folder-workspace-create.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { AGENT_LAUNCH_TARGET_FORBIDDEN_CODE } from '../../../../shared/agent-launch-target-forbidden' +import { AGENT_LAUNCH_TARGET_FORBIDDEN_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-target-forbidden' import { FolderWorkspaceCreateRefusedError } from '../../../project-groups/folder-workspace-create-refusal' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' import { openTestAgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store-test-harness' diff --git a/src/main/runtime/rpc/methods/agent-launch-folder-workspace-creation.ts b/src/main/runtime/rpc/methods/agent-launch-folder-workspace-creation.ts index 47ae50a2300..96e2e549c3e 100644 --- a/src/main/runtime/rpc/methods/agent-launch-folder-workspace-creation.ts +++ b/src/main/runtime/rpc/methods/agent-launch-folder-workspace-creation.ts @@ -1,7 +1,7 @@ /** Folder creation is metadata-only: no Git, setup or startup terminal; launch its agent as in an existing folder workspace. */ import { folderWorkspaceKey } from '../../../../shared/workspace-scope' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchWorkspaceFactory } from '../../../agent-launch/agent-launch-surface-factories' import type { RpcContext } from '../core' import { resolveRpcWorkspaceCreatorProvenance } from '../workspace-creator-context' diff --git a/src/main/runtime/rpc/methods/agent-launch-handoff-card.ts b/src/main/runtime/rpc/methods/agent-launch-handoff-card.ts index beb6ba8aeec..65c28c63b38 100644 --- a/src/main/runtime/rpc/methods/agent-launch-handoff-card.ts +++ b/src/main/runtime/rpc/methods/agent-launch-handoff-card.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchResult } from '../../../../shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import { isOrcaSessionId, ORCA_SESSION_ADDRESS_PREFIX diff --git a/src/main/runtime/rpc/methods/agent-launch-instant-tab.test.ts b/src/main/runtime/rpc/methods/agent-launch-instant-tab.test.ts index dd1063398fc..00c2ae09672 100644 --- a/src/main/runtime/rpc/methods/agent-launch-instant-tab.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-instant-tab.test.ts @@ -9,22 +9,22 @@ import { AGENT_LAUNCH_RUNTIME_CAPABILITY, AGENT_LAUNCH_TAB_CLOSED_CLIENT_CAPABILITY, AGENT_LAUNCH_UNSTARTED_TAB_CLIENT_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' -import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../../shared/agent-launch-tab-closed' -import { classifyAgentLaunchReplayRefusal } from '../../../../shared/agent-launch-replay-refusal' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' +import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' +import { classifyAgentLaunchReplayRefusal } from '../../../../shared/agent-launch/contracts/agent-launch-replay-refusal' import { mapRuntimeError } from '../errors' -import type { AgentLaunchResult } from '../../../../shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../../../shared/agent-launch-tab-publication' +} from '../../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { parsePaneKey } from '../../../../shared/stable-pane-id' import { markAgentLaunchesClosedByUser, resetAgentLaunchPanesForTests, resolveAgentLaunchPaneVerdict } from '../../../agent-launch/agent-launch-pane-attachment' -import type { AgentLaunchPaneVerdict } from '../../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdict } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' import { openTestAgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store-test-harness' import type { RpcContext } from '../core' diff --git a/src/main/runtime/rpc/methods/agent-launch-intent-resolution.ts b/src/main/runtime/rpc/methods/agent-launch-intent-resolution.ts index 407926a017c..c2e3c00924b 100644 --- a/src/main/runtime/rpc/methods/agent-launch-intent-resolution.ts +++ b/src/main/runtime/rpc/methods/agent-launch-intent-resolution.ts @@ -1,14 +1,16 @@ import { decideAgentLaunchIntentMode } from '../../../agent-launch/agent-launch-intent-mode' /** Resolve selectors and validate terminal reuse without creating a surface. */ -import type { AgentLaunchIntent, AgentLaunchTarget } from '../../../../shared/agent-launch-intent' +import type { + AgentLaunchIntent, + AgentLaunchTarget, + AgentLaunchModeReceipt +} from '../../../../shared/agent-launch/contracts/agent-launch-intent' import type { OrcaRuntimeService } from '../../orca-runtime' import { assertTerminalLaunchAdmissible } from '../../../agent-launch/agent-launch-surface-factories' import type { AgentLaunchParams } from '../../../../shared/rpc-contract/agent-launch-params' -import { - resolveAgentLaunchModeOnHost, - type AgentLaunchModeReceipt -} from '../../../agent-launch/agent-launch-mode' +import { resolveAgentLaunchModeOnHost } from '../../../agent-launch/agent-launch-mode' + import type { EarlyAgentLaunchTab } from './agent-launch-tab-publication' type ResolvedAgentLaunchIntent = Omit & { diff --git a/src/main/runtime/rpc/methods/agent-launch-prestart-failure.test.ts b/src/main/runtime/rpc/methods/agent-launch-prestart-failure.test.ts index 0b39ff04687..3512b9ecbbc 100644 --- a/src/main/runtime/rpc/methods/agent-launch-prestart-failure.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-prestart-failure.test.ts @@ -9,8 +9,8 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch-operation' -import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../../../shared/agent-launch-surface' +import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch/contracts/agent-launch-operation' +import { AGENT_LAUNCH_SURFACE_UNAVAILABLE_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-surface' import { assertOpenCodeModelLaunchPreferencesAbsent } from '../../../opencode/opencode-model-startup-plan' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' import { diff --git a/src/main/runtime/rpc/methods/agent-launch-replay.test.ts b/src/main/runtime/rpc/methods/agent-launch-replay.test.ts index 5fe95b90022..9b919cdbbcc 100644 --- a/src/main/runtime/rpc/methods/agent-launch-replay.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-replay.test.ts @@ -6,12 +6,12 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { computeAgentLaunchFingerprint, deriveAgentLaunchChildOperationId, type AgentLaunchFingerprintInput -} from '../../../../shared/agent-launch-operation' +} from '../../../../shared/agent-launch/contracts/agent-launch-operation' import { agentSessionOperationKey, claimAgentSessionOperation, diff --git a/src/main/runtime/rpc/methods/agent-launch-replay.ts b/src/main/runtime/rpc/methods/agent-launch-replay.ts index 57857b660eb..3a32ab9163f 100644 --- a/src/main/runtime/rpc/methods/agent-launch-replay.ts +++ b/src/main/runtime/rpc/methods/agent-launch-replay.ts @@ -1,13 +1,16 @@ /** Admit before live selector/lease checks so replay returns the recorded answer despite changed preconditions. * At-most-once admission refuses unknown outcomes; recovering stranded surfaces is a separate responsibility. */ -import { deriveAgentLaunchChildOperationId } from '../../../../shared/agent-launch-operation' +import { deriveAgentLaunchChildOperationId } from '../../../../shared/agent-launch/contracts/agent-launch-operation' import { AGENT_LAUNCH_PROMPT_UNCONFIRMED_RUNTIME_CAPABILITY, AGENT_LAUNCH_TAB_CLOSED_CLIENT_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' -import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../../shared/agent-launch-tab-closed' -import { isAgentLaunchResult, type AgentLaunchResult } from '../../../../shared/agent-launch-intent' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' +import { AGENT_LAUNCH_TAB_CLOSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' +import { + isAgentLaunchResult, + type AgentLaunchResult +} from '../../../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentSessionOperationOutcome, AgentSessionOperationRefusalCode diff --git a/src/main/runtime/rpc/methods/agent-launch-restart-replay.test.ts b/src/main/runtime/rpc/methods/agent-launch-restart-replay.test.ts index 0680f6b59f0..6183bc885d6 100644 --- a/src/main/runtime/rpc/methods/agent-launch-restart-replay.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-restart-replay.test.ts @@ -10,8 +10,11 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { AGENT_LAUNCH_PROMPT_UNCONFIRMED_RUNTIME_CAPABILITY, AGENT_LAUNCH_RUNTIME_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' -import { isAgentLaunchResult, type AgentLaunchResult } from '../../../../shared/agent-launch-intent' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' +import { + isAgentLaunchResult, + type AgentLaunchResult +} from '../../../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentSessionOperationRow } from '../../../../shared/agent-session/lifecycle/agent-session-operation-ledger' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' import { openTestAgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store-test-harness' diff --git a/src/main/runtime/rpc/methods/agent-launch-session-reservation.test.ts b/src/main/runtime/rpc/methods/agent-launch-session-reservation.test.ts index 2fefc0ee99c..c5e1f7c5696 100644 --- a/src/main/runtime/rpc/methods/agent-launch-session-reservation.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-session-reservation.test.ts @@ -6,7 +6,7 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch-operation' +import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch/contracts/agent-launch-operation' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' import { openTestAgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store-test-harness' import type { OrcaRuntimeService } from '../../orca-runtime' diff --git a/src/main/runtime/rpc/methods/agent-launch-settings-work.test.ts b/src/main/runtime/rpc/methods/agent-launch-settings-work.test.ts index de38ada0800..acd670ba5ad 100644 --- a/src/main/runtime/rpc/methods/agent-launch-settings-work.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-settings-work.test.ts @@ -9,9 +9,9 @@ import { REPO_METHODS } from './repo' import { AGENT_HOOK_METHODS } from './agent-hooks' import { CLIENT_UI_METHODS } from './client-ui' import { WORKTREE_VISIBILITY_DEFAULTS_RUNTIME_CAPABILITY } from '../../../../shared/protocol-version' -import * as updatesModule from '../../../../shared/agent-launch-permission-updates' -import * as launchProfile from '../../../../shared/tui-agent-launch-defaults' -import * as shell from '../../../../shared/tui-agent-startup-shell' +import * as updatesModule from '../../../../shared/agent-launch/choices/agent-launch-permission-updates' +import * as launchProfile from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import * as shell from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { measureSettingsWork, expectSettingsWorkScale, diff --git a/src/main/runtime/rpc/methods/agent-launch-surfaces.ts b/src/main/runtime/rpc/methods/agent-launch-surfaces.ts index 71a21fdd250..2f16e85d52e 100644 --- a/src/main/runtime/rpc/methods/agent-launch-surfaces.ts +++ b/src/main/runtime/rpc/methods/agent-launch-surfaces.ts @@ -18,16 +18,16 @@ import { structuredCallerFor } from './structured-agent-session-gate' import { createStructuredAgentSessionForWorktree } from './structured-agent-session-create' import { structuredAgentRuntimeMetadata } from '../../structured-agent-runtime-metadata' import { deliverTerminalAgentLaunchPrompt } from './agent-launch-terminal-prompt' -import { AgentLaunchSessionAlreadyExistsError } from '../../../../shared/agent-launch-session-already-exists' +import { AgentLaunchSessionAlreadyExistsError } from '../../../../shared/agent-launch/contracts/agent-launch-session-already-exists' import { AGENT_SESSION_CREATE_MESSAGE_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-create-capabilities' import { createStructuredAgentSessionId } from '../../../../shared/agent-session/structured-agent-session-create' -import { toAgentLaunchPreferences } from '../../../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../../../shared/agent-launch/choices/agent-launch-preferences' import { paneIdentity } from '../../runtime-terminal-pane-identity' import { trackTerminalSpawnDispatch, type TerminalSpawnDispatch } from '../../../agent-launch/agent-launch-not-started' -import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch-tab-closed' +import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' import { agentLaunchMovesHostWindow, agentLaunchTabViewerRule, diff --git a/src/main/runtime/rpc/methods/agent-launch-tab-publication.ts b/src/main/runtime/rpc/methods/agent-launch-tab-publication.ts index ad3dcb0297e..c75de00f0b9 100644 --- a/src/main/runtime/rpc/methods/agent-launch-tab-publication.ts +++ b/src/main/runtime/rpc/methods/agent-launch-tab-publication.ts @@ -6,12 +6,12 @@ import { randomUUID } from 'node:crypto' import type { AgentLaunchPlacementReceipt, AgentLaunchResult -} from '../../../../shared/agent-launch-intent' -import { AGENT_LAUNCH_UNSTARTED_TAB_CLIENT_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +} from '../../../../shared/agent-launch/contracts/agent-launch-intent' +import { AGENT_LAUNCH_UNSTARTED_TAB_CLIENT_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import type { AgentLaunchTabPublished, AgentLaunchTabViewerRule -} from '../../../../shared/agent-launch-tab-publication' +} from '../../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { navigationTargetsHost, resolveRuntimeNavigationTarget @@ -19,7 +19,7 @@ import { import { makePaneKey, parsePaneKey } from '../../../../shared/stable-pane-id' import { workspaceKindForWorktreeId } from '../../../../shared/workspace-launch-kind' import { trackRunningAgentLaunchPane } from '../../../agent-launch/agent-launch-pane-attachment' -import type { AgentLaunchPaneVerdict } from '../../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdict } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { decideAgentLaunchMode, readAgentLaunchModeSettings diff --git a/src/main/runtime/rpc/methods/agent-launch-target-authorization.ts b/src/main/runtime/rpc/methods/agent-launch-target-authorization.ts index 6e5dcf32366..3f742ac1289 100644 --- a/src/main/runtime/rpc/methods/agent-launch-target-authorization.ts +++ b/src/main/runtime/rpc/methods/agent-launch-target-authorization.ts @@ -1,8 +1,8 @@ -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' /** Authorize workspace creation against its own method allowlist; mobile access to agent.launch must not bypass create restrictions. */ -import { AgentLaunchTargetForbiddenError } from '../../../../shared/agent-launch-target-forbidden' -import type { AgentLaunchTarget } from '../../../../shared/agent-launch-intent' +import { AgentLaunchTargetForbiddenError } from '../../../../shared/agent-launch/contracts/agent-launch-target-forbidden' +import type { AgentLaunchTarget } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import { MOBILE_RPC_METHOD_ALLOWLIST } from '../../runtime-rpc/runtime-rpc-mobile-method-allowlist' import type { RpcContext } from '../core' diff --git a/src/main/runtime/rpc/methods/agent-launch-terminal-identity.test.ts b/src/main/runtime/rpc/methods/agent-launch-terminal-identity.test.ts index ab9a81523cc..fdb612e536a 100644 --- a/src/main/runtime/rpc/methods/agent-launch-terminal-identity.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-terminal-identity.test.ts @@ -1,7 +1,7 @@ /** Return runtime-minted paneKey because a client renderer cannot resolve main-side term_* handles. Identity crosses the wire; placement stays with the client. */ import { describe, expect, it, vi } from 'vitest' -import { isAgentLaunchResult } from '../../../../shared/agent-launch-intent' +import { isAgentLaunchResult } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import type { RpcContext } from '../core' import { CAPABLE_CLIENT, diff --git a/src/main/runtime/rpc/methods/agent-launch-terminal-prompt-writer.test.ts b/src/main/runtime/rpc/methods/agent-launch-terminal-prompt-writer.test.ts index 716b3ff4c07..ce8e16f80f7 100644 --- a/src/main/runtime/rpc/methods/agent-launch-terminal-prompt-writer.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch-terminal-prompt-writer.test.ts @@ -4,7 +4,7 @@ import type * as WorktreeListingModule from '../../../git/worktrees/catalog/work * whichever later check the abort then trips. */ import { describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { createAgentPromptSubmissionRuntime } from '../../agent-prompt-submission-runtime-test-fixture' import { deliverTerminalAgentLaunchPrompt } from './agent-launch-terminal-prompt' diff --git a/src/main/runtime/rpc/methods/agent-launch-terminal-prompt.ts b/src/main/runtime/rpc/methods/agent-launch-terminal-prompt.ts index 2d5bfccdd6e..045546e60d0 100644 --- a/src/main/runtime/rpc/methods/agent-launch-terminal-prompt.ts +++ b/src/main/runtime/rpc/methods/agent-launch-terminal-prompt.ts @@ -2,7 +2,7 @@ * Reuse worker readiness and sendTerminalAgentPrompt for serialized, generation-fenced bracketed paste and per-agent Enter timing across local, WSL and SSH. */ import { randomUUID } from 'node:crypto' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeTerminalWait } from '../../../../shared/runtime-terminal-contracts' import { isAgentPromptStalledError } from '../../agent-prompt-submission-verification' import { diff --git a/src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts b/src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts index 3719e0b5c1a..31cbb23a388 100644 --- a/src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts +++ b/src/main/runtime/rpc/methods/agent-launch-worktree-creation.ts @@ -3,7 +3,7 @@ import type { RuntimeTerminalCreate } from '../../../../shared/runtime-terminal- * The executor chooses; setup, default tabs, provenance and lineage use the normal create path. */ import { buildCliWorkspaceProvenance } from '../../../../shared/cli-workspace-provenance' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from '../../orca-runtime' import { finishAutomationWorkspaceProvenanceRequest, @@ -16,7 +16,7 @@ import { combineLaunchWarnings } from '../../../agent-launch/agent-launch-warnin import type { RpcContext } from '../core' import { resolveRpcWorkspaceCreatorProvenance } from '../workspace-creator-context' import { buildManagedWorktreeCreateArgs, worktreeCreateRepoSelector } from './worktree-create-args' -import { toAgentLaunchPreferences } from '../../../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../../../shared/agent-launch/choices/agent-launch-preferences' import type { AgentLaunchParams } from '../../../../shared/rpc-contract/agent-launch-params' import { agentLaunchFolderWorkspaceCreator } from './agent-launch-folder-workspace-creation' import { agentLaunchMovesHostWindow } from './agent-launch-tab-publication' diff --git a/src/main/runtime/rpc/methods/agent-launch.test-fixture.ts b/src/main/runtime/rpc/methods/agent-launch.test-fixture.ts index 330912feff0..8d148ae8eee 100644 --- a/src/main/runtime/rpc/methods/agent-launch.test-fixture.ts +++ b/src/main/runtime/rpc/methods/agent-launch.test-fixture.ts @@ -1,10 +1,10 @@ /** Use one runtime stub for RPC and replay tests so they exercise the same host surface. */ import { vi } from 'vitest' -import { TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { TUI_AGENT_CONFIG } from '../../../../shared/agent-launch/catalog/tui-agent-config' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import type { WorktreeLineageWarning } from '../../../../shared/worktree/lineage-types' -import { AgentLaunchPaneAlreadyLiveError } from '../../../../shared/agent-launch-pane-already-live' +import { AgentLaunchPaneAlreadyLiveError } from '../../../../shared/agent-launch/contracts/agent-launch-pane-already-live' import type { RpcContext } from '../core' import { resolveRpcCallerIdentity } from '../rpc-caller-identity' import type { AgentSessionRecordStore } from '../../agent-session/records/agent-session-record-store' @@ -12,7 +12,7 @@ import type { TerminalWorkspaceLaunchScope } from '../../runtime-legacy-worker-t import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../../../shared/agent-launch-tab-publication' +} from '../../../../shared/agent-launch/contracts/agent-launch-tab-publication' /** Every agent set to chat, so default launches open chats. */ export const STRUCTURED_PREFERENCE = { diff --git a/src/main/runtime/rpc/methods/agent-launch.test.ts b/src/main/runtime/rpc/methods/agent-launch.test.ts index b34cbaeb9b0..6f247b20bc3 100644 --- a/src/main/runtime/rpc/methods/agent-launch.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch.test.ts @@ -1,7 +1,7 @@ /** Exercise RPC authorization, parsing and all surface factories; structured creates must omit startupAgent while legacy worktree.create retains its terminal contract. */ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import type { RpcContext } from '../core' import { CAPABLE_CLIENT, diff --git a/src/main/runtime/rpc/methods/agent-launch.ts b/src/main/runtime/rpc/methods/agent-launch.ts index a83ba226208..b928e57f304 100644 --- a/src/main/runtime/rpc/methods/agent-launch.ts +++ b/src/main/runtime/rpc/methods/agent-launch.ts @@ -3,9 +3,9 @@ * operationId adds durable at-most-once execution and recorded replay; unknown outcomes refuse, while stranded-surface recovery remains separate. */ import { agentLaunchFeatureRequirement } from '../agent-launch-feature-requirement' -import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch-tab-closed' -import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch-operation' -import type { AgentLaunchResult } from '../../../../shared/agent-launch-intent' +import { AgentLaunchTabClosedError } from '../../../../shared/agent-launch/contracts/agent-launch-tab-closed' +import { computeAgentLaunchFingerprint } from '../../../../shared/agent-launch/contracts/agent-launch-operation' +import type { AgentLaunchResult } from '../../../../shared/agent-launch/contracts/agent-launch-intent' import { agentSessionOperationKey } from '../../../../shared/agent-session/lifecycle/agent-session-operation-ledger' import { WorktreeCreateCollisionError, diff --git a/src/main/runtime/rpc/methods/managed-cwd-mobile.test-fixture.ts b/src/main/runtime/rpc/methods/managed-cwd-mobile.test-fixture.ts index f7680f5aac5..0566440094a 100644 --- a/src/main/runtime/rpc/methods/managed-cwd-mobile.test-fixture.ts +++ b/src/main/runtime/rpc/methods/managed-cwd-mobile.test-fixture.ts @@ -3,7 +3,7 @@ import { expect, vi } from 'vitest' import type { WebSocket } from 'ws' import { deriveSharedKey, decrypt, encrypt, generateKeyPair } from '../../../../shared/e2ee-crypto' import type { RuntimeCapability } from '../../../../shared/protocol-version' -import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { REMOTE_RUNTIME_MAX_INBOUND_FRAME_BYTES, REMOTE_RUNTIME_MAX_INBOUND_REQUEST_JSON_BYTES, diff --git a/src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts b/src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts index 591ababde75..40425bcbf44 100644 --- a/src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts +++ b/src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts @@ -19,7 +19,7 @@ import type { } from '../../../../shared/agent-session/journal/agent-session-journal-types' import type { StructuredAgentSessionHost } from '../../../native-chat/agent-session-wire/structured-agent-session-host' import { getStructuredAgentSessionHost } from '../../../native-chat/agent-session-wire/structured-agent-session-registry' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from '../../orca-runtime' import { OrchestrationError } from '../../orchestration/orchestration-error' import { mintAgentSessionOperationId } from '../../orchestration/structured-pointer-operation-id' diff --git a/src/main/runtime/rpc/methods/orchestration-worker-start-mode-selection.test.ts b/src/main/runtime/rpc/methods/orchestration-worker-start-mode-selection.test.ts index c596a0e58fb..b01475b6b08 100644 --- a/src/main/runtime/rpc/methods/orchestration-worker-start-mode-selection.test.ts +++ b/src/main/runtime/rpc/methods/orchestration-worker-start-mode-selection.test.ts @@ -15,7 +15,7 @@ import { OrchestrationDb } from '../../orchestration/db' import { ORCHESTRATION_METHODS } from './orchestration' import { OrchestrationError } from '../../orchestration/orchestration-error' import type { RuntimeTerminalCreate } from '../../../../shared/runtime-terminal-create-contract' -import { OPENCODE_MODEL_VERSION_REFUSAL } from '../../../../shared/agent-launch-model-preferences' +import { OPENCODE_MODEL_VERSION_REFUSAL } from '../../../../shared/agent-launch/choices/agent-launch-model-preferences' const STRUCTURED_HANDLE = 'structworker_abc' // A real Orca session ID: a minted worker's preamble names it by this, not its handle. diff --git a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.test.ts b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.test.ts index e2058f0a18b..06e2718810c 100644 --- a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.test.ts +++ b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.test.ts @@ -4,9 +4,9 @@ import { EVERY_AGENT_CHAT } from '../../../../shared/native-chat/every-agent-cha import { describe, expect, it } from 'vitest' import { decideWorkerStartMode, - downgradeWorkerStartModeForHost, - type WorkerStartModeReceipt + downgradeWorkerStartModeForHost } from './orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../shared/agent-launch/contracts/agent-launch-intent' const STRUCTURED_DEFAULT = { nativeChatProviders: EVERY_AGENT_CHAT diff --git a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts index 449ff83f571..492a1d38dd1 100644 --- a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts +++ b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts @@ -5,14 +5,15 @@ import { downgradeAgentLaunchModeForHost, readAgentLaunchModeSettings, resolveAgentLaunchModeOnHost, - type AgentLaunchModeReceipt, type AgentLaunchModeSettings, type AgentLaunchModeVocabulary } from '../../../agent-launch/agent-launch-mode' -import type { TuiAgent } from '../../../../shared/tui-agent' + +import type { AgentLaunchModeReceipt } from '../../../../shared/agent-launch/contracts/agent-launch-intent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from '../../orca-runtime' -export type WorkerStartModeReceipt = AgentLaunchModeReceipt +type WorkerStartModeReceipt = AgentLaunchModeReceipt /** Keep orchestration's exact worker/reused-terminal wording; receipts are read beside dispatch records. */ export const WORKER_START_VOCABULARY: AgentLaunchModeVocabulary = { diff --git a/src/main/runtime/rpc/methods/orchestration-worker-start-registered-agent.test.ts b/src/main/runtime/rpc/methods/orchestration-worker-start-registered-agent.test.ts index cb7279b6855..cff69e1fdab 100644 --- a/src/main/runtime/rpc/methods/orchestration-worker-start-registered-agent.test.ts +++ b/src/main/runtime/rpc/methods/orchestration-worker-start-registered-agent.test.ts @@ -3,7 +3,7 @@ import { EVERY_AGENT_CHAT } from '../../../../shared/native-chat/every-agent-chat.test-fixture' import { describe, expect, it } from 'vitest' import { decideAgentLaunchMode } from '../../../agent-launch/agent-launch-mode' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { STRUCTURED_AGENT_RUNTIME_REGISTRATIONS } from '../../structured-agent-runtime-registrations' import { decideWorkerStartMode, diff --git a/src/main/runtime/rpc/methods/orchestration/chat-assignee-admission.ts b/src/main/runtime/rpc/methods/orchestration/chat-assignee-admission.ts index fb012b768b4..7e9d3497c14 100644 --- a/src/main/runtime/rpc/methods/orchestration/chat-assignee-admission.ts +++ b/src/main/runtime/rpc/methods/orchestration/chat-assignee-admission.ts @@ -5,7 +5,7 @@ import { } from '../../../../../shared/orca-session-address' import { ORCHESTRATION_SESSION_CALLER_ERROR_CODES as CODES } from '../../../../../shared/orchestration-session-caller-codes' import type { OrcaRuntimeService } from '../../../orca-runtime' -import type { WorkerStartModeReceipt } from '../orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../shared/agent-launch/contracts/agent-launch-intent' import { observeChatAssignee } from '../../../orchestration/chat-assignee' import type { OrchestrationDb } from '../../../orchestration/db' import { OrchestrationError } from '../../../orchestration/orchestration-error' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts index b507e67cfc7..3382e1ba28b 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts @@ -2,7 +2,7 @@ import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-ter /** Execute terminalOnly on the receiving host with federation's agent-first worktree/background-terminal factories. The dispatch brief is delivered later. */ import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { executeAgentLaunch } from '../../../../../agent-launch/agent-launch-executor' import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts index 8ea3d240c19..f7b7ae5e7ed 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts @@ -1,5 +1,5 @@ import type { FederatedWorkerStartRequest } from './federated-worker-start-request' -import { isTuiAgent } from '../../../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config' import type { RuntimeStatus } from '../../../../../../shared/runtime-types' import { ORCHESTRATION_CONTRACT_RUNTIME_CAPABILITY, diff --git a/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start-dispatch.ts b/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start-dispatch.ts index 9fef87be8fa..d95178fb9c3 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start-dispatch.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start-dispatch.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from '../../../../../../shared/tui-agent' -import type { WorkerStartModeReceipt } from '../../orchestration-worker-start-mode' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import type { OrchestrationWorkerLaunchReceipt } from './worker-launch-preferences' import type { WorkerStartInput } from './worker-start-schema' import type { RunRow } from '../../../../orchestration/types' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts b/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts index 814b96ed4f9..923ff0c51ce 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts @@ -11,10 +11,8 @@ import type { OrchestrationSessionCaller } from '../../../../orchestration/orchestration-caller-identity' import { resolveDispatchCallerWorktreeId } from '../../orchestration-caller-workspace' -import { - resolveWorkerStartModeOnHost, - type WorkerStartModeReceipt -} from '../../orchestration-worker-start-mode' +import { resolveWorkerStartModeOnHost } from '../../orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import { EXISTING_WORKTREE_SETUP, placeWorkerAgent } from './worker-start-agent-placement' import { awaitStructuredWorkerSetupGate } from './worker-start-structured-setup-gate' import { assertOrchestrationWorktreeCreationSupported } from './folder-worktree-placement' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-configured-agent-preflight.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-configured-agent-preflight.ts index a61282c6d08..764ebb328ff 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-configured-agent-preflight.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-configured-agent-preflight.ts @@ -1,5 +1,5 @@ import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { isTuiAgent } from '../../../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config' import { OrchestrationError } from '../../../../orchestration/orchestration-error' import { prepareFederationAttachmentWorkerStart } from './worker-start-validation' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.ts index 92239719efc..6941e59392c 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.ts @@ -1,6 +1,6 @@ import { z } from 'zod' import type { OrchestrationDb } from '../../../../orchestration/db' -import { isTuiAgent } from '../../../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config' import type { DispatchContextRow } from '../../../../orchestration/types' const EARLIER_WORK_CLIP = 2_000 diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.ts index 2b0cf554204..eff34317548 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.ts @@ -1,7 +1,7 @@ import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' -import { checkAgentLaunchModelPreferences } from '../../../../../../shared/agent-launch-model-preferences' +import { checkAgentLaunchModelPreferences } from '../../../../../../shared/agent-launch/choices/agent-launch-model-preferences' import { ORCHESTRATION_WORKER_LAUNCH_PREFERENCES_RUNTIME_CAPABILITY } from '../../../../../../shared/protocol-version' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { OrchestrationError } from '../../../../orchestration/orchestration-error' export type OrchestrationWorkerLaunchSelection = { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-release.test-support.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-release.test-support.ts index b6828be6943..13eeca8fbcf 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-release.test-support.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-release.test-support.ts @@ -3,7 +3,7 @@ import { ORCHESTRATION_METHODS } from '../../orchestration' import { isStreamingMethod, eraseRpcMethods, type RpcContext, type RpcMethod } from '../../../core' import { OrchestrationDb } from '../../../../orchestration/db' import { OrcaRuntimeService } from '../../../../orca-runtime' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeStore } from '../../../../runtime-store-contract' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../../shared/layout-owner-switch' import { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.ts index 671a90ff63b..a7e76600e81 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.ts @@ -4,15 +4,13 @@ import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-ter * Structured create refusals fail start through the worker error contract instead of silently downgrading. */ import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { executeAgentLaunch } from '../../../../../agent-launch/agent-launch-executor' import type { AgentLaunchSurfaceFactory } from '../../../../../agent-launch/agent-launch-surface-factories' import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' -import { - WORKER_START_VOCABULARY, - type WorkerStartModeReceipt -} from '../../orchestration-worker-start-mode' +import { WORKER_START_VOCABULARY } from '../../orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import { tearDownFailedWorkerStart } from './failed-worker-start-teardown' import type { WorkerStartInput } from './worker-start-schema' import { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts index 7a894e19907..fad34333b3c 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts @@ -6,10 +6,8 @@ import { import { beforeEach, describe, expect, it, vi } from 'vitest' import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-terminal-create-contract' -import { - downgradeAgentLaunchModeForHost, - type AgentLaunchModeReceipt -} from '../../../../../agent-launch/agent-launch-mode' +import { downgradeAgentLaunchModeForHost } from '../../../../../agent-launch/agent-launch-mode' +import type { AgentLaunchModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import { setStructuredAgentSessionHost } from '../../../../../native-chat/agent-session-wire/structured-agent-session-registry' import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts index 983dc9c4a95..fb2ef902027 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getTerminalPasteIngestMs } from '../../../../../../shared/agent-prompt-injection' +import { getTerminalPasteIngestMs } from '../../../../../../shared/agent-launch/startup/agent-prompt-injection' import { ORCHESTRATION_WORKER_START_CLIENT_GRACE_MS } from '../../../../../../shared/orchestration-timing-budgets' import { isWorkerStartTaskSpecTooLarge, diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts index 0933d4bc120..fbb91067bb8 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts @@ -5,7 +5,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../../../../../shared/agent-prompt-injection' +import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../../../../../shared/agent-launch/startup/agent-prompt-injection' import { ORCHESTRATION_CONTRACT_VERSION } from '../../../../../../shared/protocol-version' import { AGENT_PROMPT_TEST_WORKTREE_ID, @@ -15,7 +15,7 @@ import { OrchestrationDb } from '../../../../orchestration/db' import type { RpcRequest } from '../../../core' import { RpcDispatcher } from '../../../dispatcher' import { ORCHESTRATION_METHODS } from '../../orchestration' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import * as FailedStartTeardown from './failed-worker-start-teardown' vi.mock('../../../../../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts index dd32f52e308..f4f91ed2180 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts @@ -5,7 +5,7 @@ import { import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' import type { RunRow, TaskRow } from '../../../../orchestration/types' -import type { WorkerStartModeReceipt } from '../../orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import { deliverWorkerDispatchPreamble } from './deliver-worker-dispatch-preamble' import { reportedWorkerOutcome } from './worker-start-receipt' import { chatAssigneeSessionId } from '../../../../orchestration/chat-assignee' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts index bac3b4a863f..65b8ad66b44 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts @@ -9,7 +9,7 @@ import { type WorkerSetupReceipt } from './worker-topology' import type { OrchestrationWorkerLaunchReceipt } from './worker-launch-preferences' -import type { WorkerStartModeReceipt } from '../../orchestration-worker-start-mode' +import type { AgentLaunchModeReceipt as WorkerStartModeReceipt } from '../../../../../../shared/agent-launch/contracts/agent-launch-intent' import { isStructuredWorkerHandle } from '../../../../../../shared/structured-worker-handle' type WorkerStartFailureArgs = { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.ts index b32c7465142..3a40539604e 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.ts @@ -1,5 +1,5 @@ -import { isTuiAgent } from '../../../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from '../../../../orca-runtime' import { OrchestrationError } from '../../../../orchestration/orchestration-error' import type { FederationAttachStartInput } from '../federation/federation-start-schema' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts index 8d9f874f8b3..9e12bef403d 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts @@ -1,7 +1,7 @@ import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-terminal-create-contract' import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' import { narrowStructuredLaunchSeedOptions } from '../../../../../../shared/native-chat/input/native-chat-session-option-defaults' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' import { createStructuredWorkerSession } from '../../orchestration-structured-worker-session' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts index 65c02974cbb..13b0cb264fb 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts @@ -2,7 +2,7 @@ import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-ter /** Create PTY worktrees agent-first; structured workers create sessions afterwards without startup agents. Setup/default tabs/lineage stay identical. */ import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { suggestCreatureNameForPaths } from '../../../../../../shared/worktree-name-suggestion' import type { OrcaRuntimeService } from '../../../../orca-runtime' import type { OrchestrationDb } from '../../../../orchestration/db' diff --git a/src/main/runtime/rpc/methods/structured-agent-session-admission.test.ts b/src/main/runtime/rpc/methods/structured-agent-session-admission.test.ts index 85549878e80..9c96ea611e5 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-admission.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-admission.test.ts @@ -7,7 +7,7 @@ import { STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY, STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-runtime-capabilities' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { CLEANUP_METHODS, WORK_METHODS diff --git a/src/main/runtime/rpc/methods/structured-agent-session-create-handler.ts b/src/main/runtime/rpc/methods/structured-agent-session-create-handler.ts index dac0bd6b069..eaa91ae0268 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-create-handler.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-create-handler.ts @@ -1,5 +1,5 @@ import type { StructuredSessionSurface } from '../../agent-session/structured-agent-session-close' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { z } from 'zod' import { agentSessionRefusalError } from '../../../../shared/agent-session/failures/agent-session-wire-refusals' import { agentSessionFingerprintConflict } from '../../../../shared/agent-session/lifecycle/agent-session-mutation-envelope' diff --git a/src/main/runtime/rpc/methods/structured-agent-session-create.ts b/src/main/runtime/rpc/methods/structured-agent-session-create.ts index 7754c21e6d2..383b9e37279 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-create.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-create.ts @@ -4,7 +4,7 @@ import { seededPermissionMode } from '../../../../shared/native-chat/input/nativ // Resolve the host launch identity, then commit an at-rest create or the compatible acquired path. import { assertAgentPromptRequestActive } from '../../orca-runtime-core' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { refuse, AgentSessionRefusalError diff --git a/src/main/runtime/rpc/methods/structured-agent-session-pi-dialog-capability.test.ts b/src/main/runtime/rpc/methods/structured-agent-session-pi-dialog-capability.test.ts index 86f09c5496e..cd98fc4c7b9 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-pi-dialog-capability.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-pi-dialog-capability.test.ts @@ -12,7 +12,7 @@ import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/structured-agent-session-surface-capabilities' import { SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY } from '../../../../shared/protocol-version' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { remoteRuntimeClientCapabilities } from '../../../../shared/remote-runtime/remote-runtime-client-capabilities' import { computeAgentSessionPayloadFingerprint } from '../../../../shared/agent-session/lifecycle/agent-session-mutation-envelope' import { STRUCTURED_AGENT_RUNTIME_REGISTRATIONS } from '../../structured-agent-runtime-registrations' diff --git a/src/main/runtime/rpc/terminal-prompt-delivery-receipt.test.ts b/src/main/runtime/rpc/terminal-prompt-delivery-receipt.test.ts index c7aa8ea008b..05c14428c07 100644 --- a/src/main/runtime/rpc/terminal-prompt-delivery-receipt.test.ts +++ b/src/main/runtime/rpc/terminal-prompt-delivery-receipt.test.ts @@ -2,7 +2,7 @@ import type * as WorktreeScanCacheModule from '../../git/worktrees/catalog/workt import type * as WorktreeListingModule from '../../git/worktrees/catalog/worktree-listing' import './unused-default-rpc-methods.test-fixture' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { createAgentPromptSubmissionRuntime } from '../agent-prompt-submission-runtime-test-fixture' import { OrchestrationDb } from '../orchestration/db' import type { RpcRequest, RpcResponse } from './core' diff --git a/src/main/runtime/runtime-agent-launch-resolution.ts b/src/main/runtime/runtime-agent-launch-resolution.ts index 7990ba51abf..6d86614cac5 100644 --- a/src/main/runtime/runtime-agent-launch-resolution.ts +++ b/src/main/runtime/runtime-agent-launch-resolution.ts @@ -1,21 +1,21 @@ import { getRepoRoutingConnectionId } from '../../shared/execution-host' import { createHash } from 'node:crypto' import type { Repo } from '../../shared/repo-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' import type { ClaudeAgentTeamsMode } from '../../shared/claude-agent-teams-tmux-compat' import type { ProjectExecutionRuntimeResolution } from '../../shared/project-execution-runtime' import { executionRuntimePlatform, remoteExecutionPlatform -} from '../../shared/agent-launch-runtime' +} from '../../shared/agent-launch/startup/agent-launch-runtime' import { getTuiAgentLaunchCommand, isTuiAgent, TUI_AGENT_CONFIG -} from '../../shared/tui-agent-config' -import { isTuiAgentEnabled } from '../../shared/tui-agent-selection' -import { recognizeAgentLaunchCommand } from '../../shared/agent-command-line-intent' +} from '../../shared/agent-launch/catalog/tui-agent-config' +import { isTuiAgentEnabled } from '../../shared/agent-launch/catalog/tui-agent-selection' +import { recognizeAgentLaunchCommand } from '../../shared/agent-launch/startup/agent-command-line-intent' export function mergeTerminalEnvDeletionKeys( first: readonly string[] | undefined, diff --git a/src/main/runtime/runtime-agent-terminal-startup.test.ts b/src/main/runtime/runtime-agent-terminal-startup.test.ts index 10d2fab2994..6cb4ea477ed 100644 --- a/src/main/runtime/runtime-agent-terminal-startup.test.ts +++ b/src/main/runtime/runtime-agent-terminal-startup.test.ts @@ -4,11 +4,11 @@ import { resolveAgentTerminalCreateOptions } from './runtime-agent-terminal-star import { _resetWslCachesForTests, _setWslCachesForTests } from '../wsl/discovery/distro-catalog' import { MIXED_FOLDER, MIXED_GROUP } from '../../shared/folder-workspace-host-routing.test-fixture' import { partialRuntimeStore } from './runtime-store-partial-fixture' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../shared/tui-agent-startup' -import { tokenizeStartupCommand } from '../../shared/tui-agent-startup-shell' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../shared/agent-launch/startup/tui-agent-startup' +import { tokenizeStartupCommand } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import type { SessionOptionValue } from '../../shared/native-chat/input/native-chat-session-options' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { getDefaultWorkspaceSession } from '../../shared/constants' vi.mock('../preflight/agent-detection', () => ({ diff --git a/src/main/runtime/runtime-agent-terminal-startup.ts b/src/main/runtime/runtime-agent-terminal-startup.ts index e5bfb7946a7..f375111fb4e 100644 --- a/src/main/runtime/runtime-agent-terminal-startup.ts +++ b/src/main/runtime/runtime-agent-terminal-startup.ts @@ -1,13 +1,13 @@ import type { RuntimeAccountController } from './runtime-account-controller' import { applyRemoteViewerLaunchEnv } from './remote-viewer-launch-env' import type { SessionOptionValue } from '../../shared/native-chat/input/native-chat-session-options' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchPreferences } from '../../shared/agent-session/agent-session-host-authority' import { agentLaunchQuotingShell, remoteExecutionPlatform, type AgentLaunchRuntime -} from '../../shared/agent-launch-runtime' +} from '../../shared/agent-launch/startup/agent-launch-runtime' import type { RuntimeStore } from './runtime-store-contract' import type { TerminalWorkspaceLaunchScope } from './runtime-legacy-worker-terminal-recovery-types' import type { TerminalCreateOptions } from './runtime-terminal-contracts' @@ -16,13 +16,13 @@ import { buildExecutionHostAgentStartupPlan, planExecutionHostStartupWithPromptCandidate } from '../opencode/opencode-model-startup-plan' -import { agentPromptRidesLaunchCommand } from '../../shared/tui-agent-startup' +import { agentPromptRidesLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-startup' import { launchHostProvesAgentInFront, nameLocalTypedLineShell } from './agent-launch-typed-line-shell' import { resolveTerminalStartupCwd } from '../../shared/terminal-startup-cwd' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' import { terminalShellOverrideRefusal } from './terminal-shell-override-host-support' import { @@ -35,9 +35,9 @@ import { resolveAgentLaunchRuntime } from './agent-launch-scope-runtime' import { resolveQoderTerminalCommand } from './qoder-terminal-command-resolution' -import { resolveStartupShell } from '../../shared/tui-agent-startup-shell' +import { resolveStartupShell } from '../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveWslSessionContext } from '../daemon/wsl-session-context' -import { isTuiAgentEnabled } from '../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../shared/agent-launch/catalog/tui-agent-selection' import { resolveWslHostAgentLaunchInputs } from './wsl-host-agent-terminal-launch' /** No launch command could be built for a requested `startupAgent`. */ diff --git a/src/main/runtime/runtime-client-agent-launch-rollback.test.ts b/src/main/runtime/runtime-client-agent-launch-rollback.test.ts index f454614fe93..e07f8700975 100644 --- a/src/main/runtime/runtime-client-agent-launch-rollback.test.ts +++ b/src/main/runtime/runtime-client-agent-launch-rollback.test.ts @@ -9,7 +9,7 @@ import { agentPermissionChoices, PERMISSION_CHOICE_AGENTS, resolveAgentPermission -} from '../../shared/tui-agent-permission-choice' +} from '../../shared/agent-launch/permissions/tui-agent-permission-choice' vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ diff --git a/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts b/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts index 3324fcd62e3..baad63beb95 100644 --- a/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts +++ b/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts @@ -7,16 +7,19 @@ import { applyClaudeMessageOptions } from '../claude/structured/launch/claude-st import { sessionFor } from '../claude/structured/claude-structured-dispatch-test-support' import { fakeClaude } from '../claude/structured/claude-structured-session-test-support' import { readAgentSessionExecutionOptions } from '../../shared/agent-session/options/agent-session-execution-options' -import { resolveAgentLaunchCommand } from '../../shared/tui-agent-launch-command' -import { quoteStartupArg, tokenizeStartupCommand } from '../../shared/tui-agent-startup-shell' +import { resolveAgentLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-launch-command' +import { + quoteStartupArg, + tokenizeStartupCommand +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' import type { GlobalSettings } from '../../shared/global-settings-types' import { DEFAULT_TUI_AGENT_ARGS, DEFAULT_TUI_AGENT_ENV, resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../shared/tui-agent-launch-defaults' -import { newChatPermissionModeForSettings } from '../../shared/agent-chat-permission-mode' +} from '../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { newChatPermissionModeForSettings } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import { describe, expect, it, vi } from 'vitest' import { deferred, diff --git a/src/main/runtime/runtime-client-agent-launch-settings.test.ts b/src/main/runtime/runtime-client-agent-launch-settings.test.ts index 5966e5f1a24..023fbd190af 100644 --- a/src/main/runtime/runtime-client-agent-launch-settings.test.ts +++ b/src/main/runtime/runtime-client-agent-launch-settings.test.ts @@ -6,8 +6,8 @@ import { structuredAgentConfiguredArgs } from '../native-chat/structured-agent-c import { resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../shared/tui-agent-launch-defaults' -import { agentLaunchSettingsMutationUpdates } from '../../shared/agent-launch-settings' +} from '../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { agentLaunchSettingsMutationUpdates } from '../../shared/agent-launch/choices/agent-launch-settings' import { AgentLaunchSettingsMutation } from '../../shared/rpc-contract/agent-launch-settings-params' import { MOBILE_RPC_METHOD_ALLOWLIST } from './runtime-rpc/runtime-rpc-mobile-method-allowlist' import type { RuntimeStore } from './runtime-store-contract' diff --git a/src/main/runtime/runtime-client-settings.ts b/src/main/runtime/runtime-client-settings.ts index a87f9e0cc94..fd265b8fa11 100644 --- a/src/main/runtime/runtime-client-settings.ts +++ b/src/main/runtime/runtime-client-settings.ts @@ -1,4 +1,4 @@ -import { publishedLegacyChatPermissionMode } from '../../shared/agent-chat-permission-mode' +import { publishedLegacyChatPermissionMode } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import { getClaudeAgentViewService } from '../claude/agent-view/agent-view-service' import { getAppEnvironment } from '../../shared/app-environment' import { isArtifactSharingEnabled } from '../../shared/artifact-sharing-gate' @@ -9,7 +9,7 @@ import { applyTerminalQuickCommandMutation, type TerminalQuickCommandMutation } from '../../shared/terminal-quick-commands' -import { haveSameDisabledTuiAgents } from '../../shared/tui-agent-selection' +import { haveSameDisabledTuiAgents } from '../../shared/agent-launch/catalog/tui-agent-selection' import { normalizeSourceControlAiSettings } from '../../shared/source-control-ai' import { normalizeSourceControlGroupOrder } from '../../shared/source-control-group-order' import { SOURCE_CONTROL_LAUNCH_ACTION_IDS } from '../../shared/source-control-ai-actions' @@ -29,9 +29,9 @@ import { projectAgentLaunchSettings, type AgentLaunchSettings, type AgentLaunchSettingsMutation -} from '../../shared/agent-launch-settings' -import { legacyLaunchTextUpdates } from '../../shared/agent-launch-permission-updates' -import { composeAgentLaunchProfile } from '../../shared/tui-agent-launch-defaults' +} from '../../shared/agent-launch/choices/agent-launch-settings' +import { legacyLaunchTextUpdates } from '../../shared/agent-launch/choices/agent-launch-permission-updates' +import { composeAgentLaunchProfile } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { agentLaunchSettingsRollbackUpdates } from './agent-launch-settings-rollback' import type { RuntimeClientSettings, diff --git a/src/main/runtime/runtime-folder-worktree-create.ts b/src/main/runtime/runtime-folder-worktree-create.ts index c770e917238..b6b43d51b24 100644 --- a/src/main/runtime/runtime-folder-worktree-create.ts +++ b/src/main/runtime/runtime-folder-worktree-create.ts @@ -9,9 +9,9 @@ import { resolveWorktreeCreateDisplayNameRequest } from '../ipc/worktree-display import type { RuntimeTerminalCreate } from '../../shared/runtime-types' import type { CreateWorktreeResult } from '../../shared/worktree/create-types' import type { Repo } from '../../shared/repo-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' import { getRuntimeFolderWorkspaceInstanceId, mergeRuntimeFolderWorkspace diff --git a/src/main/runtime/runtime-git-generation-commands.ts b/src/main/runtime/runtime-git-generation-commands.ts index 7174fa3cf38..166536f2ec2 100644 --- a/src/main/runtime/runtime-git-generation-commands.ts +++ b/src/main/runtime/runtime-git-generation-commands.ts @@ -6,7 +6,7 @@ import type { CommitMessageDraftContext } from '../../shared/commit-message-gene import { getCommitMessageModelDiscoveryHostKey } from '../../shared/commit-message-host-key' import type { HostedReviewProvider } from '../../shared/hosted-review' import { withLinkedIssueDraftContext } from '../../shared/source-control-ai-action-variables' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { getStagedCommitContext } from '../git/source-control/staged-commit-context' import { SSH_HOST_NOT_SERVED_MESSAGE } from '../providers/ssh-host-not-served-error' import { loadPullRequestLinkedIssue } from '../source-control/pull-request-linked-issue' diff --git a/src/main/runtime/runtime-local-worktree-materialization.ts b/src/main/runtime/runtime-local-worktree-materialization.ts index 1554773112e..bc40ca59038 100644 --- a/src/main/runtime/runtime-local-worktree-materialization.ts +++ b/src/main/runtime/runtime-local-worktree-materialization.ts @@ -5,7 +5,7 @@ import { getProjectHostSetupWorktreeMeta } from '../../shared/project-host-setup import type { GitWorktreeInfo, GitPushTarget, Worktree } from '../../shared/worktree/types' import type { Repo } from '../../shared/repo-types' import type { CreateWorktreeArgs } from '../../shared/worktree/create-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveWorktreeIncludePaths } from '../git/worktrees/content-paths/worktree-include-file' import { formatWorktreeIncludeCopyWarning } from '../ipc/worktree-include-copy-budget' import { getWorktreeCreationLayout } from '../ipc/worktree-logic' diff --git a/src/main/runtime/runtime-local-worktree-terminal-startup.ts b/src/main/runtime/runtime-local-worktree-terminal-startup.ts index 1014bbad60a..591e3586afd 100644 --- a/src/main/runtime/runtime-local-worktree-terminal-startup.ts +++ b/src/main/runtime/runtime-local-worktree-terminal-startup.ts @@ -5,10 +5,10 @@ import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch' import { shouldSeedWorktreePrimaryTerminal } from '../../shared/worktree-first-surface' import type { CreateWorktreeResult } from '../../shared/worktree/create-types' import type { Repo } from '../../shared/repo-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { Worktree } from '../../shared/worktree/types' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' import { createSequencedSetupAgentCommands } from '../../shared/setup-agent-sequencing' import { getSetupRunnerCommandPlatformForPath } from '../../shared/setup-runner-command' import type { RuntimeTerminalCreate } from '../../shared/runtime-types' diff --git a/src/main/runtime/runtime-managed-worktree-create-types.ts b/src/main/runtime/runtime-managed-worktree-create-types.ts index 7fa91d1958c..dde8812d278 100644 --- a/src/main/runtime/runtime-managed-worktree-create-types.ts +++ b/src/main/runtime/runtime-managed-worktree-create-types.ts @@ -9,7 +9,7 @@ import type { WorkspaceAttachment, Worktree } from '../../shared/worktree/types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../shared/workspace-source' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' import type { TaskSourceContext } from '../../shared/task-source-context' diff --git a/src/main/runtime/runtime-notifier-contract.ts b/src/main/runtime/runtime-notifier-contract.ts index ba0bb493741..7cad300f070 100644 --- a/src/main/runtime/runtime-notifier-contract.ts +++ b/src/main/runtime/runtime-notifier-contract.ts @@ -3,18 +3,18 @@ import type { RuntimeFileOpenPosition } from '../../shared/runtime-file-contracts' import type { ClaudeAccountSelectionChange } from '../../shared/managed-account-types' -import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' import type { PaneLaunchRecipe } from '../../shared/terminal-attachment-launch-result' import type { AgentLaunchTabPublished, AgentLaunchTabViewerRule, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch-tab-publication' +} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' import type { TerminalPaneSplitSource } from '../../shared/feature-education-telemetry' import type { TerminalRevealIdentity } from '../../shared/terminal-reveal-identity' import type { TerminalPaneRevealTarget } from '../../shared/terminal-pane-reveal' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSleepNotice } from '../../shared/workspace-sleep' import type { RuntimeNavigationTarget } from '../../shared/runtime-navigation' import type { ClientHostedBrowserRowsEvent } from '../../shared/client-hosted-browser-rows' diff --git a/src/main/runtime/runtime-pty-controller-contract.ts b/src/main/runtime/runtime-pty-controller-contract.ts index e17697e29c6..0d6d3ee885b 100644 --- a/src/main/runtime/runtime-pty-controller-contract.ts +++ b/src/main/runtime/runtime-pty-controller-contract.ts @@ -4,7 +4,7 @@ import type { PtySpawnOutcome } from '../ipc/pty/spawn-outcome' import type { RuntimePaneCreateClaim } from '../ipc/pty/pane/spawn-reservation' import type { PaneSpawnOperation } from '../ipc/pty/pane/pane-spawn-operation' import type { TerminalWorkspaceLaunchScope } from './runtime-legacy-worker-terminal-recovery-types' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' import type { AutomaticWorkResumeOutcome, AutomaticWorkStatus, @@ -15,7 +15,7 @@ import type { AgentSessionSurfaceBinding } from '../../shared/agent-session/agent-session-host-authority' import type { AgentProviderSessionMetadata } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' import type { PtyIncarnationId } from '../../shared/pty-incarnation' import type { PtyBindingSourceExpectation } from '../persistence/loading-store/store' diff --git a/src/main/runtime/runtime-rpc/runtime-rpc-lifecycle.ts b/src/main/runtime/runtime-rpc/runtime-rpc-lifecycle.ts index 6f526959ff3..5834c6657a8 100644 --- a/src/main/runtime/runtime-rpc/runtime-rpc-lifecycle.ts +++ b/src/main/runtime/runtime-rpc/runtime-rpc-lifecycle.ts @@ -1,4 +1,4 @@ -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch' import { placeUnshownLiveTerminalsBestEffort } from '../terminal/adoption/unshown-live-terminal-placement' import type { RuntimeTransportMetadata } from '../../../shared/runtime-bootstrap' diff --git a/src/main/runtime/runtime-terminal-contracts.ts b/src/main/runtime/runtime-terminal-contracts.ts index 119570e950d..e08fc81bc45 100644 --- a/src/main/runtime/runtime-terminal-contracts.ts +++ b/src/main/runtime/runtime-terminal-contracts.ts @@ -1,7 +1,7 @@ import type { RuntimePtyWorktreeRecord, RuntimeLeafRecord } from './runtime-terminal-state-records' import type { ProgramStatusFacet } from '../../shared/program-status/facet' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' -import type { AgentLaunchTabViewerRule } from '../../shared/agent-launch-tab-publication' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' +import type { AgentLaunchTabViewerRule } from '../../shared/agent-launch/contracts/agent-launch-tab-publication' import type { SpawnIntent } from '../../shared/host-spawn-admission' import type { ParsedAgentStatusPayload } from '../../shared/agent-status-types' import type { @@ -20,7 +20,7 @@ import type { RuntimeTerminalWait, RuntimeTerminalWaitCondition } from '../../shared/runtime-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' import type { RuntimeTerminalSend } from '../../shared/runtime-terminal-contracts' import type { RuntimeTerminalWriteOptions } from './runtime-terminal-writer' diff --git a/src/main/runtime/runtime-terminal-idle-polls.test.ts b/src/main/runtime/runtime-terminal-idle-polls.test.ts index aeffc2f2b53..c5a01268771 100644 --- a/src/main/runtime/runtime-terminal-idle-polls.test.ts +++ b/src/main/runtime/runtime-terminal-idle-polls.test.ts @@ -3,8 +3,8 @@ import { RuntimeTerminalIdlePolls } from './terminal/wait/terminal-idle-polls' import type { TerminalWaiter } from './runtime-terminal-contracts' import type { RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import type { RuntimeTerminalWait } from '../../shared/runtime-types' -import type { TuiAgent } from '../../shared/tui-agent' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' const INTERVAL_MS = 2000 diff --git a/src/main/runtime/runtime-terminal-pane-identity.ts b/src/main/runtime/runtime-terminal-pane-identity.ts index 12d0a184c2c..645c8ba7c96 100644 --- a/src/main/runtime/runtime-terminal-pane-identity.ts +++ b/src/main/runtime/runtime-terminal-pane-identity.ts @@ -1,5 +1,5 @@ import type { RuntimePtyController } from './runtime-pty-controller-contract' -import { AgentLaunchPaneAlreadyLiveError } from '../../shared/agent-launch-pane-already-live' +import { AgentLaunchPaneAlreadyLiveError } from '../../shared/agent-launch/contracts/agent-launch-pane-already-live' import { isTerminalLeafId, makePaneKey, parsePaneKey } from '../../shared/stable-pane-id' import { isValidHostTerminalTabId } from '../../shared/terminal-tab-id' import { randomUUID } from 'node:crypto' diff --git a/src/main/runtime/runtime-terminal-state-records.ts b/src/main/runtime/runtime-terminal-state-records.ts index 2a50d8ad9b1..867730a4c51 100644 --- a/src/main/runtime/runtime-terminal-state-records.ts +++ b/src/main/runtime/runtime-terminal-state-records.ts @@ -10,7 +10,7 @@ import type { RuntimeTerminalRowMetadata } from '../../shared/runtime-terminal-c import type { TerminalOscLinkRange } from '../../shared/terminal-osc-link-ranges' import type { TerminalSideEffectFact } from '../../shared/terminal-side-effect-facts' import type { TerminalTitleTracker } from '../../shared/terminal-output-side-effects' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../shared/terminal-agent' import type { HeadlessEmulator } from '../daemon/headless-emulator' import type { PtyProviderBufferSnapshot } from '../providers/pty-provider-contract' diff --git a/src/main/runtime/runtime-terminal-writer.ts b/src/main/runtime/runtime-terminal-writer.ts index 25033d077cf..30ce33ffbde 100644 --- a/src/main/runtime/runtime-terminal-writer.ts +++ b/src/main/runtime/runtime-terminal-writer.ts @@ -1,7 +1,7 @@ import { getWindowsInputRecordPasteBurstMs, resolveAgentPromptSubmitDelayForAgent -} from '../../shared/agent-prompt-injection' +} from '../../shared/agent-launch/startup/agent-prompt-injection' import type { TerminalAgent } from '../../shared/terminal-agent' import { iterateTerminalInputChunks } from '../../shared/terminal-input' import type { TerminalInputSource } from './terminal-input-admission' diff --git a/src/main/runtime/runtime-worktree-agent-startup.test.ts b/src/main/runtime/runtime-worktree-agent-startup.test.ts index c988a8b53f0..c3a7f1da710 100644 --- a/src/main/runtime/runtime-worktree-agent-startup.test.ts +++ b/src/main/runtime/runtime-worktree-agent-startup.test.ts @@ -3,7 +3,7 @@ import type { Repo } from '../../shared/repo-types' import { tuiAgentToAgentKind } from '../../shared/agent-kind' import { getDefaultSettings } from '../../shared/constants' import type { RuntimeManagedWorktreeCreateArgs } from './runtime-managed-worktree-create-types' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' const mocks = vi.hoisted(() => ({ detectInstalledAgentsWithShellPathHydration: vi.fn() diff --git a/src/main/runtime/runtime-worktree-agent-startup.ts b/src/main/runtime/runtime-worktree-agent-startup.ts index 9531c1e0c2d..8ba6aad6735 100644 --- a/src/main/runtime/runtime-worktree-agent-startup.ts +++ b/src/main/runtime/runtime-worktree-agent-startup.ts @@ -1,16 +1,22 @@ import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' import type { AgentLaunchPreferences } from '../../shared/agent-session/agent-session-host-authority' import type { Repo } from '../../shared/repo-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' -import { repoIsRemote } from '../../shared/agent-launch-remote' +import { repoIsRemote } from '../../shared/agent-launch/startup/agent-launch-remote' import { getRepoSshConnectionId } from '../../shared/execution-host' -import { isTuiAgent } from '../../shared/tui-agent-config' -import { isTuiAgentEnabled, pickTuiAgent } from '../../shared/tui-agent-selection' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' -import type { AgentLaunchRuntime } from '../../shared/agent-launch-runtime' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' +import { + isTuiAgentEnabled, + pickTuiAgent +} from '../../shared/agent-launch/catalog/tui-agent-selection' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' +import type { AgentLaunchRuntime } from '../../shared/agent-launch/startup/agent-launch-runtime' import type { resolveStartupAgentLaunchRuntime } from './agent-launch-scope-runtime' -import { buildAgentDraftLaunchPlan, buildAgentStartupPlan } from '../../shared/tui-agent-startup' +import { + buildAgentDraftLaunchPlan, + buildAgentStartupPlan +} from '../../shared/agent-launch/startup/tui-agent-startup' import { planStartupWithPromptCandidate } from '../../shared/startup-line-prompt-carry' import { launchHostProvesAgentInFront, diff --git a/src/main/runtime/runtime-worktree-lineage-controller.test.ts b/src/main/runtime/runtime-worktree-lineage-controller.test.ts index dd9f941acef..bd08b369683 100644 --- a/src/main/runtime/runtime-worktree-lineage-controller.test.ts +++ b/src/main/runtime/runtime-worktree-lineage-controller.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { ALL_TUI_AGENTS } from '../../shared/tui-agent-display-names' +import { ALL_TUI_AGENTS } from '../../shared/agent-launch/catalog/tui-agent-display-names' import type { CliWorktreeBuilder } from './rpc/methods/agent-launch-cwd-cli.test-fixture' import { toSshExecutionHostId } from '../../shared/execution-host' import { WorktreeCreate } from '../../shared/rpc-contract/worktree-create-params' diff --git a/src/main/runtime/runtime-worktree-lineage-resolution.ts b/src/main/runtime/runtime-worktree-lineage-resolution.ts index 206041e7608..5bb40d0b10d 100644 --- a/src/main/runtime/runtime-worktree-lineage-resolution.ts +++ b/src/main/runtime/runtime-worktree-lineage-resolution.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../shared/execution-host' import type { FolderWorkspace, WorkspaceKey } from '../../shared/folder-workspace-types' import type { WorktreeLineage, WorktreeLineageWarning } from '../../shared/worktree/lineage-types' diff --git a/src/main/runtime/runtime-worktree-startup-readiness.ts b/src/main/runtime/runtime-worktree-startup-readiness.ts index 3ab3eef8fbd..f13f96a6d33 100644 --- a/src/main/runtime/runtime-worktree-startup-readiness.ts +++ b/src/main/runtime/runtime-worktree-startup-readiness.ts @@ -6,8 +6,8 @@ import { resolvePasteReadySignal } from '../../shared/draft-paste-ready-scanner' import { resolveDraftPasteReadyTimeoutMs } from '../../shared/draft-paste-ready-timeout' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' -import type { TuiAgent } from '../../shared/tui-agent' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { TerminalInputKind } from '../../shared/terminal-input-kind' import type { WorktreeStartupDraftPaste, diff --git a/src/main/runtime/runtime-worktree-status-projection.ts b/src/main/runtime/runtime-worktree-status-projection.ts index e8e9058b656..da0366e4e85 100644 --- a/src/main/runtime/runtime-worktree-status-projection.ts +++ b/src/main/runtime/runtime-worktree-status-projection.ts @@ -13,7 +13,7 @@ import type { RuntimeWorktreePsSummary, RuntimeWorktreeStatus } from '../../shared/runtime-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' const WORKTREE_STATUS_PRIORITY: Record = { inactive: 0, diff --git a/src/main/runtime/screen-input-veto.ts b/src/main/runtime/screen-input-veto.ts index 851ff7da649..5984d93e3f2 100644 --- a/src/main/runtime/screen-input-veto.ts +++ b/src/main/runtime/screen-input-veto.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { isOmpOverlayScreen } from './omp-terminal-readiness' /** An agent's grid as painted on its own PTY, and whether that is the alternate screen. */ diff --git a/src/main/runtime/screen-ruled-agent-transcript-suite.ts b/src/main/runtime/screen-ruled-agent-transcript-suite.ts index 39b66cfb3f9..f07a571a5f6 100644 --- a/src/main/runtime/screen-ruled-agent-transcript-suite.ts +++ b/src/main/runtime/screen-ruled-agent-transcript-suite.ts @@ -13,7 +13,7 @@ import { } from './agent-transcript-replay-test-harness' import { isKnownReadyPromptBody, isQuietReadyScreenBody } from './terminal-wait-detection' import { evaluateAgentStateRules } from './agent-state-rules/agent-state-rules-engine' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' export type ScreenRuledFixture = { name: string; cols: number; rows: number; what: string } diff --git a/src/main/runtime/session-construction/agent-session/get-agent-session-execution-namespace.ts b/src/main/runtime/session-construction/agent-session/get-agent-session-execution-namespace.ts index 8cd5bf454f2..d9449810d5d 100644 --- a/src/main/runtime/session-construction/agent-session/get-agent-session-execution-namespace.ts +++ b/src/main/runtime/session-construction/agent-session/get-agent-session-execution-namespace.ts @@ -1,6 +1,6 @@ import { OrcaRuntimeWithResolveWorktreeRemovalTarget } from '../../workspaces/workspace-removal-target' import type { TerminalWorkspaceLaunchScope } from '../../runtime-legacy-worker-terminal-recovery-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { parseWslUncPath } from '../../../../shared/wsl-paths' import type { AgentLaunchPreferences, @@ -12,16 +12,16 @@ import { canonicalizeAgentSessionIdentity, type ProviderExecutionNamespace } from '../../agent-session/ownership/agent-session-claim-identity' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' -import { buildAgentResumeStartupPlan } from '../../../../shared/tui-agent-startup' -import { agentLaunchQuotingShell } from '../../../../shared/agent-launch-runtime' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import { buildAgentResumeStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-resume-startup' +import { agentLaunchQuotingShell } from '../../../../shared/agent-launch/startup/agent-launch-runtime' import { OrchestrationError } from '../../orchestration/orchestration-error' import { withAgentSessionAccountEnv } from '../../agent-session/agent-session-account-env' import { resolveWslHostAgentResumeInputs } from '../../wsl-host-agent-terminal-launch' import { resolveTuiAgentLaunchRawArgs, resolveTuiAgentLaunchEnv -} from '../../../../shared/tui-agent-launch-defaults' +} from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' export abstract class OrcaRuntimeWithGetAgentSessionExecutionNamespace extends OrcaRuntimeWithResolveWorktreeRemovalTarget { protected getAgentSessionExecutionNamespace( diff --git a/src/main/runtime/session-lifecycle/projection/agent-session-resume-claims.ts b/src/main/runtime/session-lifecycle/projection/agent-session-resume-claims.ts index c6ed4b78672..ed13831f3dc 100644 --- a/src/main/runtime/session-lifecycle/projection/agent-session-resume-claims.ts +++ b/src/main/runtime/session-lifecycle/projection/agent-session-resume-claims.ts @@ -2,7 +2,7 @@ import { agentProviderSessionsEqual, type AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type ResumedAgentSession = { agent: TuiAgent diff --git a/src/main/runtime/session-lifecycle/projection/restored-pane-materialize.ts b/src/main/runtime/session-lifecycle/projection/restored-pane-materialize.ts index f866619ce7f..752e05d878c 100644 --- a/src/main/runtime/session-lifecycle/projection/restored-pane-materialize.ts +++ b/src/main/runtime/session-lifecycle/projection/restored-pane-materialize.ts @@ -11,8 +11,8 @@ import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switc import { isUnclaimedRunningSleepRecord, markResumedRecordLive } from './sleep-record-pane-claim' import { isWorktreeTerminalsSleepingError } from '../../worktree-terminals-sleeping-error' import type { TerminalWorkspaceLaunchScope } from '../../runtime-legacy-worker-terminal-recovery-types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { AgentLaunchRuntime } from '../../../../shared/agent-launch-runtime' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' import type { RuntimeMobileSessionCreateTerminalResult } from '../../../../shared/runtime-session-contracts' import type { RuntimeMobileSessionTerminalTab } from '../../../../shared/runtime-types' import type { RuntimeTerminalCreate } from '../../../../shared/runtime-terminal-create-contract' diff --git a/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts b/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts index ae01fabc0d6..aef0a7e30a3 100644 --- a/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts +++ b/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts @@ -5,7 +5,7 @@ import { normalizeAgentProviderSession, type AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getConnectionExecutionHostId, type ExecutionHostId diff --git a/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts b/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts index d73add86bf8..9008e9474cd 100644 --- a/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts +++ b/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts @@ -3,9 +3,9 @@ import { OrcaRuntimeWithCloseStructuredAgentSessionTab } from './structured-sess import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../../shared/agent-launch-tab-publication' -import type { AgentLaunchPlacementReceipt } from '../../../shared/agent-launch-intent' -import type { AgentLaunchPaneAddress } from '../../../shared/agent-launch-pane-verdict' +} from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' +import type { AgentLaunchPlacementReceipt } from '../../../shared/agent-launch/contracts/agent-launch-intent' +import type { AgentLaunchPaneAddress } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { parseExecutionHostId } from '../../../shared/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch' import type { RuntimePtyWorktreeRecord } from '../runtime-terminal-state-records' diff --git a/src/main/runtime/session-tabs/structured-session-tab-restoration.ts b/src/main/runtime/session-tabs/structured-session-tab-restoration.ts index 5ef1c47cfbd..f090dfeb72c 100644 --- a/src/main/runtime/session-tabs/structured-session-tab-restoration.ts +++ b/src/main/runtime/session-tabs/structured-session-tab-restoration.ts @@ -24,8 +24,8 @@ import { resolveAgentLaunchRuntime, resolveStartupAgentLaunchRuntime } from '../agent-launch-scope-runtime' -import type { TuiAgent } from '../../../shared/tui-agent' -import type { AgentLaunchRuntime } from '../../../shared/agent-launch-runtime' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import type { AgentLaunchRuntime } from '../../../shared/agent-launch/startup/agent-launch-runtime' import type { TerminalWorkspaceLaunchScope } from '../runtime-legacy-worker-terminal-recovery-types' import { parseAppSshPtyId } from '../../../shared/ssh-pty-id' import type { PtyProcessInspection } from '../../providers/pty-process-inspection' diff --git a/src/main/runtime/structured-agent-launch-composition.test-support.ts b/src/main/runtime/structured-agent-launch-composition.test-support.ts index 045a6a7d7ad..58185722b49 100644 --- a/src/main/runtime/structured-agent-launch-composition.test-support.ts +++ b/src/main/runtime/structured-agent-launch-composition.test-support.ts @@ -3,7 +3,7 @@ import type { AgentSessionRecordStore } from './agent-session/records/agent-session-record-store' import { agentSessionRefusalError } from '../../shared/agent-session/failures/agent-session-wire-refusals' import type { AgentSessionJournalIdentity } from '../../shared/agent-session/journal/agent-session-journal-identity' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AcpLaunchSpec } from '../acp/acp-launch-specs' import { acpStructuredAgentDefinition } from '../acp/acp-structured-agent-definitions' import { diff --git a/src/main/runtime/structured-agent-launch-composition.ts b/src/main/runtime/structured-agent-launch-composition.ts index addca59fcbd..f955d07f9b7 100644 --- a/src/main/runtime/structured-agent-launch-composition.ts +++ b/src/main/runtime/structured-agent-launch-composition.ts @@ -1,7 +1,7 @@ // Compose shared admission, cwd, environment, visuals and child sealing; agent parts add only agent-specific inputs and never set cwd/sealed env. import type { AgentSessionJournalIdentity } from '../../shared/agent-session/journal/agent-session-journal-identity' -import type { AgentChatPermissionChoice } from '../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' import { isNativeLocalLocation } from '../../shared/execution-host' import type { StructuredAgentDefinition } from '../native-chat/agent-session-wire/structured-agent-definition' diff --git a/src/main/runtime/structured-agent-launch-parity.test.ts b/src/main/runtime/structured-agent-launch-parity.test.ts index c9ae53b5ab0..508d386f237 100644 --- a/src/main/runtime/structured-agent-launch-parity.test.ts +++ b/src/main/runtime/structured-agent-launch-parity.test.ts @@ -127,8 +127,8 @@ import { ORCA_SCRUB_SAFE_PANE_ENV } from '../../shared/agent-hook-scrub-safe-env' import { STRUCTURED_WORKER_HANDLE_PREFIX } from '../../shared/structured-worker-handle' -import { YOLO_TUI_AGENT_ARGS } from '../../shared/tui-agent-permissions' -import { agentChatPermissionModes } from '../../shared/agent-chat-permission-mode' +import { YOLO_TUI_AGENT_ARGS } from '../../shared/agent-launch/permissions/tui-agent-permissions' +import { agentChatPermissionModes } from '../../shared/agent-launch/permissions/agent-chat-permission-support' import { AGENT_HOOK_RUNTIME_ENV_KEYS, ORCA_AGENT_SESSION_CALLER_ENV_KEYS diff --git a/src/main/runtime/structured-agent-launch-support.ts b/src/main/runtime/structured-agent-launch-support.ts index 9d0232f0ab8..f41e09af9d9 100644 --- a/src/main/runtime/structured-agent-launch-support.ts +++ b/src/main/runtime/structured-agent-launch-support.ts @@ -1,11 +1,11 @@ import type { AgentSessionExecutionLocation } from '../../shared/agent-session/lifecycle/agent-session-record' import type { StructuredAgentId } from '../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { GlobalSettings } from '../../shared/global-settings-types' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { resolveTuiAgentLaunchEnv, type AgentLaunchProfileSettings -} from '../../shared/tui-agent-launch-defaults' +} from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { checkAgentCliVersion, launchableRelease, diff --git a/src/main/runtime/structured-agent-new-chat-effort-at-rest.test.ts b/src/main/runtime/structured-agent-new-chat-effort-at-rest.test.ts index 1a84d5334dd..b279f4ea93f 100644 --- a/src/main/runtime/structured-agent-new-chat-effort-at-rest.test.ts +++ b/src/main/runtime/structured-agent-new-chat-effort-at-rest.test.ts @@ -10,7 +10,7 @@ import type { AgentSessionAccountHome } from '../../shared/agent-session/lifecyc import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' import type { AgentSessionModelOption } from '../../shared/agent-session/agent-session-wire' import { structuredAgentSessionSeedCatalog } from '../../shared/agent-session/options/structured-agent-session-seed-catalog' -import { agentChatPermissionModes } from '../../shared/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../shared/agent-launch/permissions/agent-chat-permission-support' import { applyStructuredAgentSessionModelCatalog, applyStructuredAgentSessionOptions, diff --git a/src/main/runtime/structured-chat-naming-agent-launch.ts b/src/main/runtime/structured-chat-naming-agent-launch.ts index 074d9dadf6c..abcb6fb286e 100644 --- a/src/main/runtime/structured-chat-naming-agent-launch.ts +++ b/src/main/runtime/structured-chat-naming-agent-launch.ts @@ -1,6 +1,6 @@ import type { AgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-record' import { requireLegacyAgentSessionAccountHome } from '../../shared/agent-session/lifecycle/agent-session-account-home' -import { resolveTuiAgentLaunchEnv } from '../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchEnv } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { acpLaunchSpecFor } from '../acp/acp-launch-specs' import { getClaudeProfileRouter } from '../claude-accounts/claude-profile-installed-router' import { diff --git a/src/main/runtime/structured-chat-naming-contract.test.ts b/src/main/runtime/structured-chat-naming-contract.test.ts index 7907a8a0d40..1a9033228f1 100644 --- a/src/main/runtime/structured-chat-naming-contract.test.ts +++ b/src/main/runtime/structured-chat-naming-contract.test.ts @@ -4,7 +4,7 @@ import { dirname } from 'node:path' import { afterEach, beforeEach, expect, it, onTestFinished, vi } from 'vitest' import { getDefaultSettings } from '../../shared/constants' import { agentSessionRecordFixture } from '../../shared/agent-session/lifecycle/agent-session-record.test-fixture' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { getCommitMessageAgentSpec } from '../../shared/commit-message-agent-spec' import { toSshExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' import { diff --git a/src/main/runtime/structured-chat-naming-runtime.ts b/src/main/runtime/structured-chat-naming-runtime.ts index 75d26802519..e18b5c5d818 100644 --- a/src/main/runtime/structured-chat-naming-runtime.ts +++ b/src/main/runtime/structured-chat-naming-runtime.ts @@ -8,7 +8,7 @@ import { sanitizeGeneratedConversationName } from '../../shared/conversation-name-generation' import { chatNamingAgentTarget } from './structured-chat-naming-agent-launch' -import type { AgentLaunchProfileSettings } from '../../shared/tui-agent-launch-defaults' +import type { AgentLaunchProfileSettings } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { chatNamingFailure } from '../../shared/chat-naming-failure-copy' import { agentSessionCurrentContextRows } from '../../shared/agent-session/agent-session-context-clear' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../shared/execution-host' diff --git a/src/main/runtime/structured-worker-authority.ts b/src/main/runtime/structured-worker-authority.ts index fe5b56e3dd8..3f69010cb1e 100644 --- a/src/main/runtime/structured-worker-authority.ts +++ b/src/main/runtime/structured-worker-authority.ts @@ -22,8 +22,8 @@ import { structuredSessionTabRetired, structuredWorkerAddressable } from './structured-worker-custody' -import { isTuiAgent } from '../../shared/tui-agent-config' -import type { TuiAgent } from '../../shared/tui-agent' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { isStructuredWorkerHandle } from '../../shared/structured-worker-handle' import { structuredWorkerIdentities, diff --git a/src/main/runtime/structured-worker-identity.ts b/src/main/runtime/structured-worker-identity.ts index ce489ebf053..2b1fc94a747 100644 --- a/src/main/runtime/structured-worker-identity.ts +++ b/src/main/runtime/structured-worker-identity.ts @@ -13,7 +13,7 @@ import { } from '../../shared/agent-session/view/structured-agent-session-projection' import { isTerminalLeafId, makePaneKey, parsePaneKey } from '../../shared/stable-pane-id' import { isOrcaSessionId, type OrcaSessionId } from '../../shared/orca-session-address' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { STRUCTURED_WORKER_HANDLE_PREFIX, isStructuredWorkerHandle diff --git a/src/main/runtime/terminal-foreground-group.ts b/src/main/runtime/terminal-foreground-group.ts index 238e9e5d9e4..c0483fc8854 100644 --- a/src/main/runtime/terminal-foreground-group.ts +++ b/src/main/runtime/terminal-foreground-group.ts @@ -1,7 +1,7 @@ import { recognizeAgentProcessFromCommandLine } from '../../shared/agent-process-recognition' import { unreadableArgvName, type ProcessTableRow } from '../../shared/process-table-snapshot' import { isShellProcess } from '../../shared/shell-process-detection' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' export { readTerminalProcessRows } from '../pty/process-retirement/terminal-process-rows' function isShellCommand(command: string): boolean { diff --git a/src/main/runtime/terminal-image-viewer-env.ts b/src/main/runtime/terminal-image-viewer-env.ts index e9d1047714e..340ba94b966 100644 --- a/src/main/runtime/terminal-image-viewer-env.ts +++ b/src/main/runtime/terminal-image-viewer-env.ts @@ -1,5 +1,5 @@ import { TERMINAL_IMAGE_VIEWER_CAPABILITY } from '../../shared/terminal-image-viewer-capability' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RpcContext } from './rpc/core' export function terminalImageViewerSupported( diff --git a/src/main/runtime/terminal-wait-detection.ts b/src/main/runtime/terminal-wait-detection.ts index 155ae80d136..40b37bb72f9 100644 --- a/src/main/runtime/terminal-wait-detection.ts +++ b/src/main/runtime/terminal-wait-detection.ts @@ -2,7 +2,7 @@ import { isQoderComposerReady } from './qoder-terminal-readiness' import { memoizeTitleClassification } from '../../shared/terminal-title-classification-memo' import { detectAgentStatusFromTitle, type AgentStatus } from '../../shared/agent-detection' import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { evaluateAgentStateRules, hasQuietReadyRules, diff --git a/src/main/runtime/terminal-wait-name-only-idle.test.ts b/src/main/runtime/terminal-wait-name-only-idle.test.ts index e323a272d78..b27e2053bc5 100644 --- a/src/main/runtime/terminal-wait-name-only-idle.test.ts +++ b/src/main/runtime/terminal-wait-name-only-idle.test.ts @@ -5,7 +5,7 @@ import { RuntimeTerminalWaiterRegistry } from './terminal/wait/terminal-waiter-r import { errorMessage, makeTuiIdlePty, makeTuiIdleRuntime } from './tui-idle-wait-test-harness' import type { RuntimeSyncWindowGraph } from '../../shared/runtime-types' import type { AgentStatus } from '../../shared/agent-detection' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import type { FirstPartyAgentStatus } from './tui-idle-evidence' import { registerBoundPty } from './bind-first-pane.test-fixture' diff --git a/src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts b/src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts index 1c93758e59e..08656d7bd5a 100644 --- a/src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts +++ b/src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts @@ -3,13 +3,13 @@ import type { RuntimeAgentPromptWriteOptions } from '../../runtime-terminal-cont import { AGENT_PROMPT_SUBMIT, isHeldAgentPromptDraft -} from '../../../../shared/agent-prompt-injection' +} from '../../../../shared/agent-launch/startup/agent-prompt-injection' import type { AgentPromptActivity } from '../../agent-prompt-submission-verification' import { isAgentPromptStalledError, verifyAgentPromptSubmission } from '../../agent-prompt-submission-verification' -import { TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../../shared/agent-launch/catalog/tui-agent-config' type HeldAgentPrompt = { baseline: AgentPromptActivity diff --git a/src/main/runtime/terminal/input/terminal-agent-prompt.ts b/src/main/runtime/terminal/input/terminal-agent-prompt.ts index 9e906075e87..d0fef502a5c 100644 --- a/src/main/runtime/terminal/input/terminal-agent-prompt.ts +++ b/src/main/runtime/terminal/input/terminal-agent-prompt.ts @@ -21,7 +21,7 @@ import { getAgentPromptSubmitDelayMs, getTerminalPasteIngestMs, resolveAgentPromptSubmitDelayForAgent -} from '../../../../shared/agent-prompt-injection' +} from '../../../../shared/agent-launch/startup/agent-prompt-injection' import type { AgentPromptActivity, AgentPromptWaitTextCache diff --git a/src/main/runtime/terminal/input/terminal-input-dispatch.ts b/src/main/runtime/terminal/input/terminal-input-dispatch.ts index 02be1b2f67f..bd7da2f5c64 100644 --- a/src/main/runtime/terminal/input/terminal-input-dispatch.ts +++ b/src/main/runtime/terminal/input/terminal-input-dispatch.ts @@ -19,7 +19,7 @@ import { import { agentPromptTakesLeadLine, buildAgentPromptPasteBytes -} from '../../../../shared/agent-prompt-injection' +} from '../../../../shared/agent-launch/startup/agent-prompt-injection' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switch' export abstract class OrcaRuntimeWithControllerKnowsPtyIsLive extends OrcaRuntimeWithResolveTerminalPane { diff --git a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts index 3df9d8ceab6..df28648b14c 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts @@ -11,7 +11,7 @@ import { } from '../../../ai-vault/structured-chat-cli-fork' import { buildMobileTerminalChatFork } from './mobile-terminal-chat-fork' import { isWslUncPath } from '../../../../shared/wsl-paths' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { applyRemoteViewerLaunchEnv } from '../../remote-viewer-launch-env' import { deterministicAgentSessionUuid } from '../../runtime-agent-launch-resolution' import { rendererPublicationThrottle } from '../../../window/renderer-publication-throttle' diff --git a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.ts b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.ts index 12ff7b06b69..880d500a52b 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork.ts @@ -4,12 +4,12 @@ import type { AgentProviderSessionMetadata } from '../../../../shared/agent-sess import { type AgentLaunchRuntime, agentLaunchQuotingShell -} from '../../../../shared/agent-launch-runtime' +} from '../../../../shared/agent-launch/startup/agent-launch-runtime' import { isWslShellName } from '../../../../shared/local-windows-terminal-runtime' import { isWslUncPath } from '../../../../shared/wsl-paths' -import { isTuiAgent } from '../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { AgentStartupShell } from '../../../../shared/tui-agent-startup-shell' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveWslHostAgentCmdOverrides } from '../../wsl-host-agent-terminal-launch' import { type AiVaultResumeLaunchSettings, diff --git a/src/main/runtime/terminal/launch/mobile-terminal-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-create.ts index 558c8074974..5b474410c67 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-create.ts @@ -1,7 +1,7 @@ import type { OrcaRuntimeWithScheduleMobileSessionTabsChanged as SessionTabsPublication } from '../../session-tabs/session-tabs-change-publication' import { OrcaRuntimeWithFailedStartPanes } from './failed-start-pane' import type { WorktreeStartupLaunch } from '../../../../shared/worktree/launch-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig @@ -12,7 +12,7 @@ import type { RuntimeTerminalPresentation } from '../../../../shared/runtime-types' import type { SpawnIntent } from '../../../../shared/host-spawn-admission' -import type { AgentLaunchRuntime } from '../../../../shared/agent-launch-runtime' +import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' import { type RuntimeNavigationTarget, navigationTargetsHost diff --git a/src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts index 99ff49db440..2958de89164 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts @@ -1,6 +1,6 @@ import type { OrcaRuntimeWithScheduleMobileSessionTabsChanged as SessionTabsPublication } from '../../session-tabs/session-tabs-change-publication' import { OrcaRuntimeWithResolveMobileSessionTerminalCommand } from './mobile-terminal-startup' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { RuntimeMobileSessionCreateTerminalResult, diff --git a/src/main/runtime/terminal/launch/mobile-terminal-startup.ts b/src/main/runtime/terminal/launch/mobile-terminal-startup.ts index 3ca30c87510..28c6bfd29df 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-startup.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-startup.ts @@ -1,20 +1,18 @@ import { OrcaRuntimeWithRunCreateMobileSessionTerminal } from './mobile-terminal-renderer-create' import type { TerminalWorkspaceLaunchScope } from '../../runtime-legacy-worker-terminal-recovery-types' import type { WorktreeStartupLaunch } from '../../../../shared/worktree/launch-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { isResumableTuiAgent, normalizeAgentProviderSession, type AgentProviderSessionMetadata, type SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' -import { - buildAgentResumeStartupPlan, - buildAgentStartupPlan -} from '../../../../shared/tui-agent-startup' -import { resolveResumeLaunchRecipe } from '../../../../shared/tui-agent-launch-defaults' -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import { buildAgentResumeStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-resume-startup' +import { buildAgentStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-startup' +import { resolveResumeLaunchRecipe } from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { resolveWslHostAgentLaunchInputs, resolveWslHostAgentResumeInputs @@ -22,7 +20,7 @@ import { import { agentLaunchQuotingShell, type AgentLaunchRuntime -} from '../../../../shared/agent-launch-runtime' +} from '../../../../shared/agent-launch/startup/agent-launch-runtime' export type MobileTerminalCommandOptions = { command?: string diff --git a/src/main/runtime/terminal/launch/terminal-create-deduplication.ts b/src/main/runtime/terminal/launch/terminal-create-deduplication.ts index 1e77652d878..998bf094ac9 100644 --- a/src/main/runtime/terminal/launch/terminal-create-deduplication.ts +++ b/src/main/runtime/terminal/launch/terminal-create-deduplication.ts @@ -17,7 +17,7 @@ import { type ExecutionHostId } from '../../../../shared/execution-host' import { resolveWorktreeLaunchHost } from '../../worktree-launch-host-repo' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalWorkspaceLaunchScope } from '../../runtime-legacy-worker-terminal-recovery-types' export abstract class OrcaRuntimeWithTerminalCreateDeduplication extends OrcaRuntimeWithCreateAgentSession { diff --git a/src/main/runtime/terminal/launch/terminal-launch-result.ts b/src/main/runtime/terminal/launch/terminal-launch-result.ts index c49f5f597b5..28414e60b74 100644 --- a/src/main/runtime/terminal/launch/terminal-launch-result.ts +++ b/src/main/runtime/terminal/launch/terminal-launch-result.ts @@ -3,7 +3,7 @@ import { admitStablePaneAdoption } from '../../runtime-terminal-pane-identity' import type { RuntimePtyController } from '../../runtime-pty-controller-contract' import type { TerminalCreateOptions } from '../../runtime-terminal-contracts' import type { RuntimePtyWorktreeRecord } from '../../runtime-terminal-state-records' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { copySleepingAgentLaunchConfig, resolveLaunchCommandPaneAgent, diff --git a/src/main/runtime/terminal/lifecycle/pty-registration.ts b/src/main/runtime/terminal/lifecycle/pty-registration.ts index 441ad11d760..0610bc29972 100644 --- a/src/main/runtime/terminal/lifecycle/pty-registration.ts +++ b/src/main/runtime/terminal/lifecycle/pty-registration.ts @@ -5,10 +5,10 @@ import { import type { PtySpawnResult } from '../../../providers/pty-provider-contract' import { OrcaRuntimeWithInvalidateAllHandlesForPty } from './pty-handle-invalidation' import type { PtyIncarnationId } from '../../../../shared/pty-incarnation' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { isValidTerminalTabId } from '../../../../shared/terminal-tab-id' import { isTerminalLeafId, makePaneKey } from '../../../../shared/stable-pane-id' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { spawnSurfaceClaimSequence } from '../../pty-recorded-surface-topology' import type { PtyRegistrationClaim, diff --git a/src/main/runtime/terminal/output/headless-terminal-hydration.ts b/src/main/runtime/terminal/output/headless-terminal-hydration.ts index 2e4f8aa1d50..531eeb38cf3 100644 --- a/src/main/runtime/terminal/output/headless-terminal-hydration.ts +++ b/src/main/runtime/terminal/output/headless-terminal-hydration.ts @@ -12,7 +12,7 @@ import { } from '../../codex-notice-terminal-status' import { TrustDialogStatusObserver } from '../../trust-dialog-status-observer' import type { LaunchedAgentForeground } from '../../launched-agent-foreground' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { detectAgentStatusFromTitle, normalizeTerminalTitle diff --git a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts index 05761a457de..e87d7bfb13c 100644 --- a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts +++ b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts @@ -18,19 +18,19 @@ import { TERMINAL_INTERACTIVE_WAIT_PROBE_TIMEOUT_MS } from '../../orca-runtime-c import { parsePaneKey } from '../../../../shared/stable-pane-id' import type { ExactWorkerProviderSession } from '../../../../shared/orchestration-worker-output' import { selectExactWorkerProviderSession } from '../../orchestration/worker-provider-session' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { OrchestrationError } from '../../orchestration/orchestration-error' import { resolveLocalWindowsAgentStartupShell } from '../../../../shared/windows-terminal-shell' import { resolveStartupShell, type AgentStartupShell -} from '../../../../shared/tui-agent-startup-shell' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +} from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveConfiguredWorkerAgent } from '../../orchestration/configured-worker-agent-selector' import { resolveAgentLaunchRuntime } from '../../agent-launch-scope-runtime' import { parseWslUncPath } from '../../../../shared/wsl-paths' -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { resolveOpenCodeModelLaunchRoute } from '../../../opencode/opencode-model-startup-plan' import type { RuntimePtyWorktreeRecord } from '../../runtime-terminal-state-records' import type { OrchestrationDb } from '../../orchestration/db/orchestration-db' diff --git a/src/main/runtime/terminal/wait/terminal-wait-permission.ts b/src/main/runtime/terminal/wait/terminal-wait-permission.ts index 861016b1e1b..1b48c3894d8 100644 --- a/src/main/runtime/terminal/wait/terminal-wait-permission.ts +++ b/src/main/runtime/terminal/wait/terminal-wait-permission.ts @@ -18,7 +18,7 @@ import { createTerminalInputReservation } from '../../terminal-input-admission' import type { RuntimeTerminalWriteOptions } from '../../runtime-terminal-writer' import type { WriteSettlement } from '../../../../shared/pty-write-settlement' import { resolvePtyWriteHostPlatform } from '../input/pty-write-host-platform' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../../../shared/terminal-agent' import type { AgentPromptActivity } from '../../agent-prompt-submission-verification' import { hasExplicitIdleTitle } from '../../tui-idle-evidence' diff --git a/src/main/runtime/terminal/wait/terminal-wait-visible-probe.ts b/src/main/runtime/terminal/wait/terminal-wait-visible-probe.ts index 22905b51460..129b93e2cfa 100644 --- a/src/main/runtime/terminal/wait/terminal-wait-visible-probe.ts +++ b/src/main/runtime/terminal/wait/terminal-wait-visible-probe.ts @@ -25,7 +25,7 @@ import { } from '../../terminal-wait-results' import { outputClockOf } from '../../tui-idle-evidence-source' import { createSetupCompletionScanner } from '../../orchestration/setup-completion-signal' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export abstract class OrcaRuntimeWithStartTuiIdleVisibleReadProbe extends OrcaRuntimeWithCreateAgentPromptRenderGate { /** One bounded readiness read for adopted PTYs with lost metadata; later working-to-idle transitions belong to the poll. */ diff --git a/src/main/runtime/terminal/wait/terminal-wait.ts b/src/main/runtime/terminal/wait/terminal-wait.ts index 6ea3bc2f7b9..df6b5668655 100644 --- a/src/main/runtime/terminal/wait/terminal-wait.ts +++ b/src/main/runtime/terminal/wait/terminal-wait.ts @@ -17,7 +17,7 @@ import { ptyTuiIdleEvidence, type TuiIdleEvidenceSource } from '../../tui-idle-evidence-source' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalWaiter } from '../../runtime-terminal-contracts' import type { RuntimePtyWorktreeRecord } from '../../runtime-terminal-state-records' import type { RuntimeTerminalIdlePolls } from './terminal-idle-polls' diff --git a/src/main/runtime/trust-dialog-status-observer.test.ts b/src/main/runtime/trust-dialog-status-observer.test.ts index 36008cc50d6..a06792d1e34 100644 --- a/src/main/runtime/trust-dialog-status-observer.test.ts +++ b/src/main/runtime/trust-dialog-status-observer.test.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs' import { afterEach, describe, expect, it, vi } from 'vitest' import type { AgentStatusIpcPayload } from '../../shared/agent-status-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { createTranscriptPane, TRANSCRIPT_PANE_PTY_ID } from './agent-transcript-pane-test-harness' function fixture(name: string): { recording: string; cols: number; rows: number } { diff --git a/src/main/runtime/trust-dialog-status-observer.ts b/src/main/runtime/trust-dialog-status-observer.ts index ff15841e81b..9a84de40875 100644 --- a/src/main/runtime/trust-dialog-status-observer.ts +++ b/src/main/runtime/trust-dialog-status-observer.ts @@ -2,7 +2,7 @@ import type { AgentStatusIpcPayload, ParsedAgentStatusPayload } from '../../shared/agent-status-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { HeadlessEmulator } from '../daemon/headless-emulator' import { findTerminalWaitBlockedSignal } from './agent-state-rules/blocked-text-layer' import type { LaunchedAgentForeground } from './launched-agent-foreground' diff --git a/src/main/runtime/tui-idle-delivery-and-quiescence.test.ts b/src/main/runtime/tui-idle-delivery-and-quiescence.test.ts index d45efea8bcd..4c545f149a0 100644 --- a/src/main/runtime/tui-idle-delivery-and-quiescence.test.ts +++ b/src/main/runtime/tui-idle-delivery-and-quiescence.test.ts @@ -5,7 +5,7 @@ import { registerBoundPty } from './bind-first-pane.test-fixture' import { RuntimeMachineName } from './runtime-machine-name' import type { RuntimeSyncWindowGraph } from '../../shared/runtime-types' import type { OrcaRuntimeService } from './orca-runtime' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' // #6011 follow-ups: apply wait evidence ranking to typing/delivery and allow unobserved output clocks on the open quiet lane. diff --git a/src/main/runtime/tui-idle-evidence-source.ts b/src/main/runtime/tui-idle-evidence-source.ts index 04115615282..a7e8ea6d412 100644 --- a/src/main/runtime/tui-idle-evidence-source.ts +++ b/src/main/runtime/tui-idle-evidence-source.ts @@ -1,6 +1,6 @@ // Gathers each tui-idle evaluation's evidence from runtime state; tui-idle-evidence.ts ranks it. import type { AgentStatus } from '../../shared/agent-detection' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import { detectTerminalWaitBlockedReason, diff --git a/src/main/runtime/tui-idle-evidence.test.ts b/src/main/runtime/tui-idle-evidence.test.ts index 40fd8c3356b..9bae0ecafc4 100644 --- a/src/main/runtime/tui-idle-evidence.test.ts +++ b/src/main/runtime/tui-idle-evidence.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { detectAgentStatusFromTitle } from '../../shared/agent-title-status' import { getSyntheticAgentTerminalTitle } from '../../shared/synthetic-agent-title' -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { isTuiAgent, TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import { getTuiAgentRestSignal } from '../../shared/tui-agent-rest-signal' import { isKnownReadyPromptBody } from './terminal-wait-detection' import { diff --git a/src/main/runtime/tui-idle-evidence.ts b/src/main/runtime/tui-idle-evidence.ts index 9b8e99c0f4d..f24c4586e3a 100644 --- a/src/main/runtime/tui-idle-evidence.ts +++ b/src/main/runtime/tui-idle-evidence.ts @@ -7,9 +7,9 @@ import type { AgentStatusState } from '../../shared/agent-status-types' import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' import { getSyntheticAgentTerminalTitle } from '../../shared/synthetic-agent-title' import { resolveTerminalTitlePolicyAgentType } from '../../shared/terminal-title-agent-type' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../shared/terminal-agent' -import { isTuiAgent } from '../../shared/tui-agent-config' +import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config' import { getTuiAgentRestSignal } from '../../shared/tui-agent-rest-signal' import { detectExplicitIdleStatusFromTitle } from './terminal-wait-detection' import { isOmpIdleStateTitle } from './omp-terminal-readiness' diff --git a/src/main/runtime/tui-idle-hook-lane-runtime.test.ts b/src/main/runtime/tui-idle-hook-lane-runtime.test.ts index 3ec44a3cffe..d38c0b8d435 100644 --- a/src/main/runtime/tui-idle-hook-lane-runtime.test.ts +++ b/src/main/runtime/tui-idle-hook-lane-runtime.test.ts @@ -10,7 +10,7 @@ import { createHookListenerState } from '../../shared/agent-hook-listener/listen import { normalizeHermesEvent } from '../../shared/agent-hook-listener/providers/hermes-events' import type { AgentStatusIpcPayload } from '../../shared/agent-status-types' import { makePaneKey } from '../../shared/stable-pane-id' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { OrcaRuntimeService } from './orca-runtime' vi.mock('electron', () => ({ diff --git a/src/main/runtime/tui-idle-hook-lane.ts b/src/main/runtime/tui-idle-hook-lane.ts index 21937df233c..284a4d554ec 100644 --- a/src/main/runtime/tui-idle-hook-lane.ts +++ b/src/main/runtime/tui-idle-hook-lane.ts @@ -1,6 +1,6 @@ import type { AgentStatusIpcPayload } from '../../shared/agent-status-types' import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { hookAuthority } from './agent-state-rules/agent-state-rules-engine' import { selectFreshExplicitAgentStatusRow } from './runtime-hook-agent-row-selection' import { terminalHostConnectionMatches } from './orchestration/worker-provider-session' diff --git a/src/main/runtime/workspaces/managed-worktree-create-startup.ts b/src/main/runtime/workspaces/managed-worktree-create-startup.ts index 3a9bf730164..6da046e82c0 100644 --- a/src/main/runtime/workspaces/managed-worktree-create-startup.ts +++ b/src/main/runtime/workspaces/managed-worktree-create-startup.ts @@ -1,7 +1,7 @@ import { applyRemoteViewerLaunchEnv } from '../remote-viewer-launch-env' import type { RuntimeManagedWorktreeCreateArgs } from '../runtime-managed-worktree-create-types' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../shared/tui-agent' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { type buildWorktreeStartupForDraft, resolveWorktreeCreateAgentStartup diff --git a/src/main/runtime/workspaces/workspace-activation.ts b/src/main/runtime/workspaces/workspace-activation.ts index e898e219a0d..b548e21d96c 100644 --- a/src/main/runtime/workspaces/workspace-activation.ts +++ b/src/main/runtime/workspaces/workspace-activation.ts @@ -9,7 +9,7 @@ import { getRepoExecutionHostId } from '../../../shared/execution-host' import { phoneWakeReport } from '../../../shared/workspace-sleep' import type { Repo } from '../../../shared/repo-types' import type { TerminalWorkspaceLaunchScope } from '../runtime-legacy-worker-terminal-recovery-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeTerminalWait } from '../../../shared/runtime-terminal-contracts' import { type WorktreeStartupDraftPaste, diff --git a/src/main/runtime/workspaces/workspace-foreground-inspection.ts b/src/main/runtime/workspaces/workspace-foreground-inspection.ts index ad367ba5deb..be713762c24 100644 --- a/src/main/runtime/workspaces/workspace-foreground-inspection.ts +++ b/src/main/runtime/workspaces/workspace-foreground-inspection.ts @@ -1,5 +1,5 @@ import { OrcaRuntimeWithListManagedWorktrees } from './managed-workspace-operations' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { describeLaunchedAgentHost, readLaunchedAgentForeground, diff --git a/src/main/runtime/workspaces/workspace-process-listing-dependencies.ts b/src/main/runtime/workspaces/workspace-process-listing-dependencies.ts index 0f92eb49099..e5de6d17c63 100644 --- a/src/main/runtime/workspaces/workspace-process-listing-dependencies.ts +++ b/src/main/runtime/workspaces/workspace-process-listing-dependencies.ts @@ -6,8 +6,8 @@ import { claudeStructuredAuthPolicyForSettings } from '../../claude-accounts/cla import { resolveStructuredAgentCommand } from '../../native-chat/structured-agent-command-resolution' import { structuredAgentConfiguredArgs } from '../../native-chat/structured-agent-configured-args' import { getProfileUserDataPath } from '../../orca-profiles/profile-storage-paths' -import { isTuiAgent } from '../../../shared/tui-agent-config' -import { resolveTuiAgentLaunchEnv } from '../../../shared/tui-agent-launch-defaults' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' +import { resolveTuiAgentLaunchEnv } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { StructuredAgentId } from '../../../shared/agent-session/lifecycle/agent-session-provider-handle' import type { RuntimeWorkspaceCatalog } from './workspace-catalog' diff --git a/src/main/runtime/workspaces/workspace-process-listing.ts b/src/main/runtime/workspaces/workspace-process-listing.ts index 861c9501c80..021ed802107 100644 --- a/src/main/runtime/workspaces/workspace-process-listing.ts +++ b/src/main/runtime/workspaces/workspace-process-listing.ts @@ -46,8 +46,8 @@ import { structuredWorkerOpenTaskTitle, structuredWorkerOwesWork } from '../structured-worker-custody' -import { preModeChatGetsFullAccess } from '../../../shared/agent-chat-permission-mode' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { preModeChatGetsFullAccess } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { claudeCliFlagSupport } from '../../claude/claude-cli-flag-support' import { runtimeHiddenHostIds, diff --git a/src/main/runtime/worktree-agent-first-surface.test.ts b/src/main/runtime/worktree-agent-first-surface.test.ts index 62943a7f6b1..810c94b27c2 100644 --- a/src/main/runtime/worktree-agent-first-surface.test.ts +++ b/src/main/runtime/worktree-agent-first-surface.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest' import { getDefaultWorkspaceSession } from '../../shared/constants' import type { RuntimePtyController } from './runtime-pty-controller-contract' import { beginCreatedWorkspaceLaunch } from '../agent-launch/agent-launch-created-workspace' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch/contracts/agent-launch-runtime-capability' const createStructured = vi.hoisted(() => vi.fn(async (args: { envelope: { sessionId: string } }) => ({ diff --git a/src/main/runtime/wsl-host-agent-terminal-launch.test.ts b/src/main/runtime/wsl-host-agent-terminal-launch.test.ts index 85ac56c0ba5..2de72d29171 100644 --- a/src/main/runtime/wsl-host-agent-terminal-launch.test.ts +++ b/src/main/runtime/wsl-host-agent-terminal-launch.test.ts @@ -2,8 +2,8 @@ import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:f import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' -import type { TuiAgent } from '../../shared/tui-agent' +import { resolveAgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveAgentTerminalCreateOptions } from './runtime-agent-terminal-startup' import { resolveWslHostAgentLaunchInputs, diff --git a/src/main/runtime/wsl-host-agent-terminal-launch.ts b/src/main/runtime/wsl-host-agent-terminal-launch.ts index d65a821f687..b4065ad28a8 100644 --- a/src/main/runtime/wsl-host-agent-terminal-launch.ts +++ b/src/main/runtime/wsl-host-agent-terminal-launch.ts @@ -4,20 +4,20 @@ import { isWindowsOnlyAgentCommand, windowsOnlyCliMessage } from '../codex-cli/windows-only-agent-cli' -import type { AgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' +import type { AgentStartupPlanInputs } from '../../shared/agent-launch/startup/agent-startup-plan-inputs' import { getTuiAgentDetectCommands, getTuiAgentLaunchCommand, TUI_AGENT_CONFIG -} from '../../shared/tui-agent-config' +} from '../../shared/agent-launch/catalog/tui-agent-config' import { getOrcaCliCommandNameForPlatform } from '../../shared/orca-cli-command-name' -import { hasExplicitTuiLaunchCommand } from '../../shared/tui-agent-launch-command-override' +import { hasExplicitTuiLaunchCommand } from '../../shared/agent-launch/startup/tui-agent-launch-command-override' import { quoteStartupArg, resolveStartupShell, type AgentStartupShell -} from '../../shared/tui-agent-startup-shell' -import type { TuiAgent } from '../../shared/tui-agent' +} from '../../shared/agent-launch/startup/tui-agent-startup-shell' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' export type WslHostAgentProbe = { isWslHost?: boolean diff --git a/src/main/skills/discovery.test.ts b/src/main/skills/discovery.test.ts index 0a8510238cc..51e01e4effe 100644 --- a/src/main/skills/discovery.test.ts +++ b/src/main/skills/discovery.test.ts @@ -8,7 +8,7 @@ import { discoverSkills, LAST_KNOWN_ROOT_SCAN_RETENTION_MS } from './discovery' -import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../shared/agent-launch/catalog/tui-agent-config' import * as Plugins from './claude-plugin-skill-sources' import * as SkillRootFileWalk from './skill-root-file-walk' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/skills/skill-wsl-provider-detection.ts b/src/main/skills/skill-wsl-provider-detection.ts index d60b83e283b..1ff5821dc55 100644 --- a/src/main/skills/skill-wsl-provider-detection.ts +++ b/src/main/skills/skill-wsl-provider-detection.ts @@ -3,7 +3,7 @@ import { getTuiAgentDetectionProbeCommands, KNOWN_TUI_AGENT_DETECTION_COMMANDS, resolveDetectedTuiAgentIds -} from '../../shared/tui-agent-detection-commands' +} from '../../shared/agent-launch/catalog/tui-agent-detection-commands' import { quotePosixShell } from '../../shared/shell-argument-quoting' import { runWslProcess } from '../wsl/execution/wsl-runner' diff --git a/src/main/ssh/orcad-migration-catalog-client.ts b/src/main/ssh/orcad-migration-catalog-client.ts index 086ab40a702..8160fb5b861 100644 --- a/src/main/ssh/orcad-migration-catalog-client.ts +++ b/src/main/ssh/orcad-migration-catalog-client.ts @@ -29,7 +29,7 @@ import { sendRemoteRuntimeRequestWithStatusPreflight } from '../../shared/remote import { assertOrcadMigrationRequestFits } from './orcad-migration-manifest-export' import type { RuntimeRpcResponse } from '../../shared/runtime-rpc-envelope' import { AUTOMATION_EXTRA_AGENT_ARGS_RUNTIME_CAPABILITY } from '../../shared/protocol-version' -import { hasExtraAgentArgs } from '../../shared/automation-extra-agent-args' +import { hasExtraAgentArgs } from '../../shared/agent-launch/startup/automation-extra-agent-args' import { requiredOrcadMigrationSourceCapability } from '../../shared/orcad-migration/orcad-migration-source-kind' import type { OrcadServerRepository } from './orcad-migration-repository-link' diff --git a/src/main/startup/main-process-runtime-service.ts b/src/main/startup/main-process-runtime-service.ts index d2b330c8169..55dcf3f6b47 100644 --- a/src/main/startup/main-process-runtime-service.ts +++ b/src/main/startup/main-process-runtime-service.ts @@ -24,7 +24,7 @@ import { getDaemonProvider } from '../daemon/daemon-provider-state' import type { TerminalSideEffectBatch } from '../../shared/terminal-side-effect-facts' import type { OrchestrationEnvironmentTransport } from '../runtime/orchestration/environment-transport' import { resolveEnvironment } from '../../shared/runtime-environment-store' -import { resolveTuiAgentLaunchEnv } from '../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchEnv } from '../../shared/agent-launch/choices/tui-agent-launch-defaults' import { getPreferredPairedRuntimeConnection } from '../../shared/runtime-environments' import { pairedOrchestrationPeers } from '../runtime/orchestration/environment-transport' import { callRuntimeEnvironment } from '../ipc/runtime-environments/runtime-environment-transport-routing' diff --git a/src/main/text-generation/commit-message-model-discovery-policy.ts b/src/main/text-generation/commit-message-model-discovery-policy.ts index 18269b38af2..77ed960d8e9 100644 --- a/src/main/text-generation/commit-message-model-discovery-policy.ts +++ b/src/main/text-generation/commit-message-model-discovery-policy.ts @@ -1,7 +1,7 @@ import { buildClaudeModelListArgs } from '../../shared/claude-model-list-probe' import type { CommandTemplateBackslash } from '../../shared/commit-message-prompt' import type { CommitMessagePlan } from '../../shared/commit-message-plan' -import { planAgentBinary } from '../../shared/commit-message-plan' +import { planAgentBinary } from '../../shared/agent-launch/startup/agent-command-plan' import type { AgentModelProbeSpec } from '../../shared/agent-model-probe-spec' import { formatAgentCliFailureMessage } from './source-control-agent-failure' import type { DiscoverCommitMessageModelsResult } from './source-control-text-generation-types' diff --git a/src/main/text-generation/commit-message-model-discovery.ts b/src/main/text-generation/commit-message-model-discovery.ts index dc86e9c23c4..c290382bf63 100644 --- a/src/main/text-generation/commit-message-model-discovery.ts +++ b/src/main/text-generation/commit-message-model-discovery.ts @@ -10,7 +10,7 @@ import { runClaudeBackgroundAttempts, type ClaudeBackgroundFailedExit } from '../../shared/claude-background-run-isolation' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { resolveCodexHomeProcessLockKeyForSpawnEnv } from '../codex-cli/codex-home-process-lock' import { supervisedProviderSpawnFailure } from '../provider-process/provider-spawn-failure-report' import { diff --git a/src/main/text-generation/commit-message-text-generation.ts b/src/main/text-generation/commit-message-text-generation.ts index cca378393f4..e948420f347 100644 --- a/src/main/text-generation/commit-message-text-generation.ts +++ b/src/main/text-generation/commit-message-text-generation.ts @@ -14,7 +14,7 @@ import { type ResolvedSourceControlAiGenerationParams } from '../../shared/source-control-ai' import type { AiTextOperation } from '../../shared/source-control-ai-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import { discoverModelsLocal, type CommitMessageModelDiscoveryLocalOptions diff --git a/src/main/window/agent-launch-tab-publish-relay.ts b/src/main/window/agent-launch-tab-publish-relay.ts index cef2fd887ce..753b712c273 100644 --- a/src/main/window/agent-launch-tab-publish-relay.ts +++ b/src/main/window/agent-launch-tab-publish-relay.ts @@ -6,7 +6,7 @@ import type { AgentLaunchTabPublished, AgentLaunchTabPublishReply, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch-tab-publication' +} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' const AGENT_LAUNCH_TAB_PUBLISH_TIMEOUT_MS = 10_000 diff --git a/src/main/workspaces/catalog/provisioned-root-checkout.ts b/src/main/workspaces/catalog/provisioned-root-checkout.ts index 015ea02437e..0de1b3669ff 100644 --- a/src/main/workspaces/catalog/provisioned-root-checkout.ts +++ b/src/main/workspaces/catalog/provisioned-root-checkout.ts @@ -7,7 +7,7 @@ import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import type { AutomationWorkspaceProvenance, GitWorktreeInfo } from '../../../shared/worktree/types' import { normalizeRuntimePathForComparison } from '../../../shared/cross-platform-path' import { getProjectHostSetupWorktreeMeta } from '../../../shared/project-host-setup-lookup' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { getWorktreeCreationLayout } from '../../ipc/worktree-logic' import { resolveWorktreeCreateDisplayNameMeta, diff --git a/src/main/wsl/orcad/wsl-orcad-account-env.ts b/src/main/wsl/orcad/wsl-orcad-account-env.ts index 87189ecb6f0..5048e2bec67 100644 --- a/src/main/wsl/orcad/wsl-orcad-account-env.ts +++ b/src/main/wsl/orcad/wsl-orcad-account-env.ts @@ -4,9 +4,9 @@ import { posix } from 'node:path' import { AGENT_LAUNCH_ACCOUNT_ENV_KEYS, AgentLaunchAccountEnv -} from '../../../shared/agent-launch-account-env' -import { isTuiAgent } from '../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../shared/tui-agent' +} from '../../../shared/agent-launch/startup/agent-launch-account-env' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { parseWslUncPath } from '../../../shared/wsl-paths' import type { ClaudeRuntimeAuthPreparation } from '../../claude-accounts/runtime-auth/runtime-auth-types' import { AGENT_SESSION_ACCOUNT_ENV_RUNTIME_CAPABILITY } from '../../../shared/agent-session/agent-session-create-capabilities' diff --git a/src/preload/api/git-operation-api.ts b/src/preload/api/git-operation-api.ts index d77293fed43..e9e3ecffa3c 100644 --- a/src/preload/api/git-operation-api.ts +++ b/src/preload/api/git-operation-api.ts @@ -1,5 +1,5 @@ import type { GitForkSyncExpectedUpstream, GitForkSyncResult } from '../../shared/git-fork-sync' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { GitPushTarget } from '../../shared/worktree/types' import type { GitStageWorktreeScope } from '../../shared/git-stage-worktree-scope' import type { ConflictResolution } from '../../shared/source-control-entry-actions' diff --git a/src/preload/api/pty-api.ts b/src/preload/api/pty-api.ts index c323c60d75c..175caeca1cc 100644 --- a/src/preload/api/pty-api.ts +++ b/src/preload/api/pty-api.ts @@ -11,7 +11,7 @@ import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' import type { TerminalInputKind } from '../../shared/terminal-input-kind' import type { TerminalLeafMoveRequest, @@ -32,9 +32,9 @@ import type { import type { AgentKind, LaunchSource, RequestKind } from '../../shared/telemetry-events' import type { TerminalSideEffectBatch } from '../../shared/terminal-side-effect-facts' import type { TerminalViewAttributes } from '../../shared/terminal-view-attributes' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { TerminalPanePlacement } from '../../shared/terminal-pane-placement' -import type { AgentPaneLaunchRequest } from '../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../shared/agent-launch/contracts/agent-pane-launch-request' import type { PtyManagementApi } from './pty-management-api' import type { TerminalProcessInspection } from '../../shared/terminal-process-inspection' import type { CodexSharedServerStatus } from '../../shared/codex-shared-server-command' diff --git a/src/preload/api/pty-bridge-session-control.ts b/src/preload/api/pty-bridge-session-control.ts index 968160c6205..cb241c2bb3a 100644 --- a/src/preload/api/pty-bridge-session-control.ts +++ b/src/preload/api/pty-bridge-session-control.ts @@ -7,7 +7,7 @@ import type { ResourceViewAdmission } from '../../shared/resource-view-admission import type { SpawnIntent } from '../../shared/host-spawn-admission' import { ipcRenderer } from 'electron' import type { ProjectExecutionRuntimeResolution } from '../../shared/project-execution-runtime' -import type { StartupCommandDelivery } from '../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../shared/agent-launch/startup/codex-startup-delivery' import type { TerminalInputKind } from '../../shared/terminal-input-kind' import type { TerminalLeafMoveRequest, @@ -19,7 +19,7 @@ import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { PtyListedSession, PtySessionListScope } from '../../shared/pty-listed-session' import type { PtyRendererDeliveryHealthReply, @@ -30,7 +30,7 @@ import type { PtyMainDeliveryDiagnostics } from '../../shared/pty-delivery-diagn import type { AgentKind, LaunchSource, RequestKind } from '../../shared/telemetry-events' import type { PreloadApi } from '../api-types' import type { TerminalPanePlacement } from '../../shared/terminal-pane-placement' -import type { AgentPaneLaunchRequest } from '../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../shared/agent-launch/contracts/agent-pane-launch-request' export const ptySessionControlApi = { spawn: (opts: { diff --git a/src/preload/api/ui-bridge-terminal-and-session-tabs.ts b/src/preload/api/ui-bridge-terminal-and-session-tabs.ts index 3ab0e2550ff..b907cbb973d 100644 --- a/src/preload/api/ui-bridge-terminal-and-session-tabs.ts +++ b/src/preload/api/ui-bridge-terminal-and-session-tabs.ts @@ -9,8 +9,8 @@ import type { AgentLaunchTabPublishReply, AgentLaunchTabViewerRule, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch-tab-publication' -import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch-pane-verdict' +} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' +import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { PaneLaunchRecipe } from '../../shared/terminal-attachment-launch-result' import type { TerminalPaneRevealReply, @@ -20,7 +20,7 @@ import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { RuntimeNavigationTarget } from '../../shared/runtime-navigation' import type { RuntimeMobileSessionTabMove, diff --git a/src/preload/api/ui-command-event-api.ts b/src/preload/api/ui-command-event-api.ts index deb8533251c..b5692b08d18 100644 --- a/src/preload/api/ui-command-event-api.ts +++ b/src/preload/api/ui-command-event-api.ts @@ -10,13 +10,13 @@ import type { import type { BrowserTabCreateRequest } from '../../shared/browser-tab-create-request' import type { MarkdownDocument } from '../../shared/filesystem-entry-types' import type { PersistedUIState } from '../../shared/persisted-ui-state-types' -import type { TuiAgent } from '../../shared/tui-agent' +import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchTabPublishReply, AgentLaunchTabViewerRule, AgentLaunchTabPublishRequest -} from '../../shared/agent-launch-tab-publication' -import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch-pane-verdict' +} from '../../shared/agent-launch/contracts/agent-launch-tab-publication' +import type { AgentLaunchPaneVerdictEvent } from '../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { PaneLaunchRecipe } from '../../shared/terminal-attachment-launch-result' import type { TerminalPaneRevealReply, diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.tsx index 971d1ec2818..31647674284 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.tsx @@ -20,9 +20,9 @@ import { translate } from '@/i18n/i18n' import { DEFAULT_DISABLED_TUI_AGENTS, filterEnabledTuiAgents -} from '../../../shared/tui-agent-selection' +} from '../../../shared/agent-launch/catalog/tui-agent-selection' import type { RuntimeStatus } from '../../../shared/runtime-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { NewWorkspaceComposerAdvancedSection } from './new-workspace/NewWorkspaceComposerAdvancedSection' import { NewWorkspaceComposerAgentSection } from './new-workspace/NewWorkspaceComposerAgentSection' import { NewWorkspaceComposerFooter } from './new-workspace/NewWorkspaceComposerFooter' @@ -38,7 +38,7 @@ import { import { getSshStatusLabel } from './new-workspace/new-workspace-composer-ssh-status' import { useNewWorkspaceComposerFileDrop } from './new-workspace/use-new-workspace-composer-file-drop' import { useComposerFileDragOver } from './new-workspace/use-composer-file-drag-over' -import { buildDefaultAgentSettingsUpdate } from '../../../shared/default-agent-settings' +import { buildDefaultAgentSettingsUpdate } from '../../../shared/agent-launch/choices/default-agent-settings' // Lazy-load the project-location browser outside boot; warming shares this module entry with the click. const loadSetProjectLocationDialog = (): Promise => diff --git a/src/renderer/src/components/NewWorkspaceComposerModal.agent-surface.test.tsx b/src/renderer/src/components/NewWorkspaceComposerModal.agent-surface.test.tsx index a2bdfd67dcc..d79f774ab7c 100644 --- a/src/renderer/src/components/NewWorkspaceComposerModal.agent-surface.test.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerModal.agent-surface.test.tsx @@ -13,13 +13,13 @@ import { TooltipProvider } from '@/components/ui/tooltip' import AgentCombobox from '@/components/agent/AgentCombobox' import { AGENT_CATALOG } from '@/lib/agent-catalog' import NewWorkspaceComposerModal from './NewWorkspaceComposerModal' +import { agentPickerChoiceSeeds } from '../../../shared/agent-launch/picker/agent-launch-picker-defaults' import { - agentPickerChoiceSeeds, agentPickerDraft, type AgentPickerDraft, type AgentPickerEntry -} from '../../../shared/agent-launch-picker' -import { applyAgentPickerEdit } from '../../../shared/agent-launch-picker-edits' +} from '../../../shared/agent-launch/picker/agent-launch-picker' +import { applyAgentPickerEdit } from '../../../shared/agent-launch/picker/agent-launch-picker-edits' import * as composerDecisions from '@/hooks/composer-state/composer-decisions' import { useFolderSubmitOrchestration } from '@/hooks/composer-state/folder-submit-orchestration' import { diff --git a/src/renderer/src/components/NewWorkspaceComposerModal.retention.test.tsx b/src/renderer/src/components/NewWorkspaceComposerModal.retention.test.tsx index b989c8a6406..95eb73b3ffb 100644 --- a/src/renderer/src/components/NewWorkspaceComposerModal.retention.test.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerModal.retention.test.tsx @@ -12,8 +12,8 @@ import { TooltipProvider } from '@/components/ui/tooltip' import NewWorkspaceComposerModal from './NewWorkspaceComposerModal' import type { NewWorkspaceComposerCardProps } from './new-workspace/new-workspace-composer-card-props' import type * as SetupButtonModule from './agent/AgentLaunchSetupButton' -import type { TuiAgent } from '../../../shared/tui-agent' -import type { AgentPickerDraft } from '../../../shared/agent-launch-picker' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import type { AgentPickerDraft } from '../../../shared/agent-launch/picker/agent-launch-picker' import { TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' const evidence = vi.hoisted(() => { diff --git a/src/renderer/src/components/NewWorkspaceComposerModal.tsx b/src/renderer/src/components/NewWorkspaceComposerModal.tsx index 28bc04cfa62..4032512b9fd 100644 --- a/src/renderer/src/components/NewWorkspaceComposerModal.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerModal.tsx @@ -2,7 +2,7 @@ import { agentPickerLaunchInputs, type AgentPickerDraft, type AgentPickerEntry -} from '../../../shared/agent-launch-picker' +} from '../../../shared/agent-launch/picker/agent-launch-picker' import { DirectWorkItemSetupDialog } from './new-workspace/DirectWorkItemSetupDialog' import type { DirectWorkItemSetupRequest } from '@/lib/direct-work-item-setup' import { agentChoicePending } from '@/lib/host-chat-program' @@ -33,7 +33,7 @@ import { useAgentsOfferedForLaunch } from '@/lib/host-chat-program-acquisition' import { shouldAllowComposerEnterSubmitTarget } from '@/lib/new-workspace-enter-guard' import { isScreenSubmitShortcut } from '@/lib/screen-submit-shortcut' import type { GitHubWorkItem } from '../../../shared/github/work-item-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../shared/workspace-source' import type { WorkspaceStatus } from '../../../shared/worktree/types' import type { TaskSourceContext } from '../../../shared/task-source-context' diff --git a/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx b/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx index 19d39a042fa..97a2501fa00 100644 --- a/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx +++ b/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.test.tsx @@ -5,7 +5,7 @@ import { afterEach, expect, it, vi } from 'vitest' import { useAppStore } from '@/store' import { getAgentCatalog, getAgentLabel } from '@/lib/agent-catalog' import { i18n, loadRendererUiLanguage } from '@/i18n/i18n' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { TooltipProvider } from '@/components/ui/tooltip' import { useNativeChatHandOff } from '../native-chat/use-native-chat-hand-off' import { AgentSessionContinuationDialog } from './AgentSessionContinuationDialog' @@ -13,7 +13,7 @@ import * as rpc from '@/runtime/runtime-rpc-subscribe' import * as runtimeRpc from '@/runtime/runtime-rpc-client' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environment-revision' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import { makeWorktree } from '@/store/slices/worktrees-slice-test-fixtures' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY as CHAT } from '../../../../shared/agent-session/agent-session-runtime-capabilities' diff --git a/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx b/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx index e1d9d70f3bd..5c1fef7f2b9 100644 --- a/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx +++ b/src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx @@ -8,7 +8,7 @@ import { agentPickerLaunchInputs, type AgentPickerDraft, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { useAgentMenuObservation } from '@/components/tab-bar/use-new-tab-agent-menu-rows' import { useAgentDetectionTargetForWorktree } from '@/hooks/useAgentDetectionTarget' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' @@ -38,8 +38,8 @@ import { } from '@/lib/agent-session-continuation' import { launchAgentSessionContinuation } from '@/lib/launch-agent-session-continuation' import { useAppStore } from '@/store' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../shared/tui-agent' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { chooseInitialContinuationAgent, isContinuationAgentAllowed diff --git a/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.ts b/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.ts index 41e2941def3..9340a1da883 100644 --- a/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.ts +++ b/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.ts @@ -1,5 +1,8 @@ -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../shared/tui-agent' +import { + isTuiAgent, + TUI_AGENT_CONFIG +} from '../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export function isContinuationAgentAllowed( agent: TuiAgent, diff --git a/src/renderer/src/components/agent-tab-shortcut-launch.test.ts b/src/renderer/src/components/agent-tab-shortcut-launch.test.ts index ab281613d77..66ad820f8cd 100644 --- a/src/renderer/src/components/agent-tab-shortcut-launch.test.ts +++ b/src/renderer/src/components/agent-tab-shortcut-launch.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { launchFloatingWorkspaceAgentShortcut } from './agent-tab-shortcut-launch' const mocks = vi.hoisted(() => { diff --git a/src/renderer/src/components/agent-tab-shortcut-launch.ts b/src/renderer/src/components/agent-tab-shortcut-launch.ts index 027e3599943..79711c718ef 100644 --- a/src/renderer/src/components/agent-tab-shortcut-launch.ts +++ b/src/renderer/src/components/agent-tab-shortcut-launch.ts @@ -5,7 +5,7 @@ import { translate } from '@/i18n/i18n' import { selectFloatingWorkspacePanelVisible } from '@/store/floating-workspace-panel-selector' import { useAppStore } from '../store' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { captureAgentTabLaunchContext, type AgentTabLaunchContext diff --git a/src/renderer/src/components/agent/AgentCombobox.surface.test.tsx b/src/renderer/src/components/agent/AgentCombobox.surface.test.tsx index f1c7fa9df8a..23bfcd3794d 100644 --- a/src/renderer/src/components/agent/AgentCombobox.surface.test.tsx +++ b/src/renderer/src/components/agent/AgentCombobox.surface.test.tsx @@ -6,10 +6,13 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { ReactElement } from 'react' import { AGENT_CATALOG } from '@/lib/agent-catalog' import { TooltipProvider } from '@/components/ui/tooltip' -import { buildNewTabAgentMenuRows, type NewTabAgentMenuRow } from '@/lib/new-tab-agent-menu-rows' +import { + buildNewTabAgentMenuRows, + type NewTabAgentMenuRow +} from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { NewTabAgentMenuModel } from '@/components/tab-bar/use-new-tab-agent-menu-rows' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { UseDetectedAgentsResult } from '@/hooks/useDetectedAgents' import AgentCombobox from './AgentCombobox' import { resolveAgentMenuSelection } from '@/lib/agent-menu-selection' diff --git a/src/renderer/src/components/agent/AgentCombobox.test.tsx b/src/renderer/src/components/agent/AgentCombobox.test.tsx index 4224043e67c..49e2500a0f3 100644 --- a/src/renderer/src/components/agent/AgentCombobox.test.tsx +++ b/src/renderer/src/components/agent/AgentCombobox.test.tsx @@ -3,7 +3,7 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { renderToStaticMarkup } from 'react-dom/server' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { AGENT_CATALOG, AgentIcon } from '@/lib/agent-catalog' import { AGENT_FAVICON_ASSETS } from '@/lib/agent-favicon-assets' import AgentCombobox from './AgentCombobox' diff --git a/src/renderer/src/components/agent/AgentCombobox.tsx b/src/renderer/src/components/agent/AgentCombobox.tsx index 0677a7cc5ec..73e36e90fe4 100644 --- a/src/renderer/src/components/agent/AgentCombobox.tsx +++ b/src/renderer/src/components/agent/AgentCombobox.tsx @@ -11,7 +11,7 @@ import { searchAgentPickerEntries } from '@/lib/agent-picker-search' import { cn } from '@/lib/utils' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import * as state from './agent-combobox-command-state' import { AgentDefaultContextMenu, diff --git a/src/renderer/src/components/agent/AgentLaunchPicker.form.test.tsx b/src/renderer/src/components/agent/AgentLaunchPicker.form.test.tsx index 4713d82ec80..985b2f26b7e 100644 --- a/src/renderer/src/components/agent/AgentLaunchPicker.form.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPicker.form.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment happy-dom import { clearNativeChatComposerDraftsForTests } from '../native-chat/native-chat-composer-draft-store' import { launchDraftSource } from '../native-chat/native-chat-launch-draft-source' -import { acceptAgentPickerArguments } from '../../../../shared/agent-launch-picker-edits' +import { acceptAgentPickerArguments } from '../../../../shared/agent-launch/picker/agent-launch-picker-edits' import { agentLaunchPromptScopeKey } from './AgentLaunchPromptComposer' import { act, createElement, useState } from 'react' import { fireEvent, getByRole, render, renderHook, waitFor } from '@testing-library/react' @@ -35,7 +35,7 @@ import type { AgentPickerDraft, AgentPickerDraftOwner, AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('../quick-open-file-list', () => ({ useRuntimeFileListForWorktree: () => ({ files: [], loading: false, loadError: null }) diff --git a/src/renderer/src/components/agent/AgentLaunchPicker.trigger.test.tsx b/src/renderer/src/components/agent/AgentLaunchPicker.trigger.test.tsx index 326e7debdc7..32edbad5893 100644 --- a/src/renderer/src/components/agent/AgentLaunchPicker.trigger.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPicker.trigger.test.tsx @@ -12,7 +12,10 @@ import { import { AgentLaunchPicker } from './AgentLaunchPicker' import { AgentLaunchPickerMenu } from './AgentLaunchPickerMenu' import * as inventoryModule from './use-agent-launch-picker-inventory' -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) const entry: AgentPickerEntry = { agent: 'codex', diff --git a/src/renderer/src/components/agent/AgentLaunchPicker.tsx b/src/renderer/src/components/agent/AgentLaunchPicker.tsx index 96aee79672d..6da90cbb671 100644 --- a/src/renderer/src/components/agent/AgentLaunchPicker.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPicker.tsx @@ -24,8 +24,8 @@ import { agentPickerDraft, type AgentPickerDraft, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' -import { agentPickerPanelArguments } from '../../../../shared/agent-launch-picker-arguments' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { agentPickerPanelArguments } from '../../../../shared/agent-launch/picker/agent-launch-picker-arguments' /** Forms own selection and dispatch; rows and setup remain the same as the new-tab menu. */ export const AgentLaunchPicker = memo( diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.geometry.test.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.geometry.test.tsx index 4eb59f82266..7f18521d69c 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.geometry.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.geometry.test.tsx @@ -13,7 +13,7 @@ import { import { TooltipProvider } from '@/components/ui/tooltip' import { AgentLaunchSetupButton } from './AgentLaunchSetupButton' import { AgentLaunchPickerMenu } from './AgentLaunchPickerMenu' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { clearNativeChatComposerDraftsForTests } from '../native-chat/native-chat-composer-draft-store' import { entry, diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.keyboard.test.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.keyboard.test.tsx index d31afcdc1f7..368a65c25d5 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.keyboard.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.keyboard.test.tsx @@ -10,7 +10,7 @@ import { } from '@/components/ui/dropdown-menu' import { TooltipProvider } from '@/components/ui/tooltip' import { AgentLaunchPickerMenu } from './AgentLaunchPickerMenu' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) afterEach(cleanup) diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.language.test.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.language.test.tsx index 0bc0da0d791..bfb526c2ecb 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.language.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.language.test.tsx @@ -11,7 +11,7 @@ import { TooltipProvider } from '@/components/ui/tooltip' import { i18n } from '@/i18n/i18n' import es from '@/i18n/locales/es.json' import { AgentLaunchPickerMenu } from './AgentLaunchPickerMenu' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.search.test.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.search.test.tsx index 1842669ac4d..ac87120e3a0 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.search.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.search.test.tsx @@ -12,7 +12,7 @@ import { DropdownMenuSub, DropdownMenuSubTrigger } from '@/components/ui/dropdown-menu' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) vi.mock('./AgentLaunchSetupButton', async (importOriginal) => ({ diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.test.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.test.tsx index 8e3ebf78fef..ec2fc88d4a7 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.test.tsx @@ -23,11 +23,11 @@ import { import { TooltipProvider } from '@/components/ui/tooltip' import { AgentLaunchSetupButton } from './AgentLaunchSetupButton' import { AgentLaunchPickerMenu } from './AgentLaunchPickerMenu' +import { agentPickerChoiceSeeds } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' import { - agentPickerChoiceSeeds, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' vi.mock('@floating-ui/dom', async (importOriginal) => { const actual = await importOriginal() diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx index 177e1c276f7..17bfff273df 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx @@ -17,21 +17,21 @@ import { retireAgentPickerDrafts, type AgentPickerSetupIdentity } from './AgentLaunchSetupButton' -import { applyAgentPickerEdit } from '../../../../shared/agent-launch-picker-edits' +import { applyAgentPickerEdit } from '../../../../shared/agent-launch/picker/agent-launch-picker-edits' import type { NewTabAgentMenuModel } from '../tab-bar/use-new-tab-agent-menu-rows' import { chatUnavailableLabel } from '../tab-bar/tab-agent-row-presentation' -import type { NewTabAgentMenuRow } from '../../../../shared/agent-launch-picker-rows' +import type { NewTabAgentMenuRow } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import { useAgentPickerInventoryEntries, type AgentPickerInventorySource } from './use-agent-launch-picker-inventory' +import { searchAgentPickerSetups } from '../../../../shared/agent-launch/picker/agent-launch-picker-search' import { - searchAgentPickerSetups, agentPickerDraft, type AgentPickerDraft, type AgentPickerEntry, type AgentPickerSurface -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' export function pickerLaunchRow( entry: AgentPickerEntry, diff --git a/src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx b/src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx index 65489b157e1..6174a001a53 100644 --- a/src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx @@ -17,7 +17,7 @@ import { } from '../native-chat/native-chat-composer-draft-store' import { getNativeChatAgentProfile } from '../../../../shared/native-chat/native-chat-agent-profiles' import type { SessionOptionsSurface } from '../../../../shared/native-chat/input/native-chat-session-options' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' const NO_OPTIONS_SURFACE: SessionOptionsSurface = { getSnapshot: () => [], diff --git a/src/renderer/src/components/agent/AgentLaunchSetupActions.tsx b/src/renderer/src/components/agent/AgentLaunchSetupActions.tsx index b1db904776e..29cc9e42e9b 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupActions.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupActions.tsx @@ -1,6 +1,9 @@ import { Button } from '@/components/ui/button' import { translate } from '@/i18n/i18n' -import type { AgentPickerEntry, AgentPickerSurface } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerEntry, + AgentPickerSurface +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { AgentLaunchSurfaceButtons } from './AgentLaunchSetupFooter' /** Select mode's buttons: a launch entry picks its surface; a text card's Use stages its draft. */ diff --git a/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx index c32fb0e7ebc..b2b858840ca 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx @@ -24,7 +24,7 @@ import { } from '../native-chat/native-chat-composer-draft-store' import * as sources from '../native-chat/native-chat-launch-draft-source' import { transitionLaunchDrafts } from '../native-chat/native-chat-launch-draft-transition' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { ExecutionHostId } from '../../../../shared/execution-host' vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) diff --git a/src/renderer/src/components/agent/AgentLaunchSetupButton.tsx b/src/renderer/src/components/agent/AgentLaunchSetupButton.tsx index f0bdf69ab3f..06b1ea4e777 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupButton.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupButton.tsx @@ -7,13 +7,14 @@ import { AgentLaunchSetupSubmenu } from './AgentLaunchSetupSubmenu' import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { translate } from '@/i18n/i18n' import { AgentLaunchSetupPanel } from './AgentLaunchSetupPanel' -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry, + AgentPickerDraftOwner +} from '../../../../shared/agent-launch/picker/agent-launch-picker' + +import { useAgentPickerSetup, type AgentPickerSetupIdentity } from './agent-launch-picker-drafts' -import { - useAgentPickerSetup, - type AgentPickerSetupIdentity, - type AgentPickerDraftOwner -} from './agent-launch-picker-drafts' export { invalidateAgentPickerDrafts, retireAgentPickerDrafts, diff --git a/src/renderer/src/components/agent/AgentLaunchSetupFooter.tsx b/src/renderer/src/components/agent/AgentLaunchSetupFooter.tsx index cdce17533f4..d260b230543 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupFooter.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupFooter.tsx @@ -8,10 +8,10 @@ import type { NativeChatComposerHandle } from '../native-chat/NativeChatComposer import { AgentLaunchPromptComposer } from './AgentLaunchPromptComposer' import { agentPickerButtonOrder, - type agentPickerEntryOptions, type AgentPickerEntry, type AgentPickerSurface -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' +import type { agentPickerEntryOptions } from '../../../../shared/agent-launch/picker/agent-launch-picker-catalog' import { formatKeybinding } from '../../../../shared/keybindings' export function agentLaunchSetupArgumentsNote( diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.arguments.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.arguments.test.tsx index 102605b0e90..6f2f49592cb 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.arguments.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.arguments.test.tsx @@ -16,10 +16,10 @@ import { readPiRpcModelOptions } from '../../../../main/pi/rpc-model-options' import { agentPickerDraft, - agentPickerModels, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { agentPickerModels } from '../../../../shared/agent-launch/picker/agent-launch-picker-catalog' it.each([`--settings '{"fastMode":true}' --settings ./team.json`, `--settings '{broken'`])( 'keeps opaque effective settings literal and Fast unclaimed: %s', @@ -115,7 +115,8 @@ it.each(['direct Use', 'blur then Use'] as const)( it.each(['pending click', 'blur then click'] as const)( 'removes the current model domain after accepting newer text through %s', async (transition) => { - const reconcile = await import('../../../../shared/agent-choice-reconciliation') + const reconcile = + await import('../../../../shared/agent-launch/choices/agent-choice-reconciliation') const accepted = vi.spyOn(reconcile, 'reconcileAgentChoiceArgsDetailed') const own: AgentPickerEntry = { ...entry, @@ -234,9 +235,10 @@ it('explains no-flag choices from the recorded Pi catalog and keeps them usable }) it('bounds whole current-snapshot work on rendered replacement, acceptance and chip removal', async () => { - const args = await import('../../../../shared/agent-choice-args') - const reconcile = await import('../../../../shared/agent-choice-reconciliation') - const profile = await import('../../../../shared/agent-launch-profile') + const args = await import('../../../../shared/agent-launch/choices/agent-choice-args') + const reconcile = + await import('../../../../shared/agent-launch/choices/agent-choice-reconciliation') + const profile = await import('../../../../shared/agent-launch/choices/agent-launch-profile') const catalog = await import('../../../../shared/agent-session/options/agent-session-option-catalog') const reconciliation = vi.spyOn(reconcile, 'reconcileAgentChoiceArgsDetailed') diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.authority.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.authority.test.tsx index 48a603036ed..b2afdd4e939 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.authority.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.authority.test.tsx @@ -10,13 +10,13 @@ import { act } from 'react' import { fireEvent } from '@testing-library/react' import { expect, it } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' -import * as shell from '../../../../shared/tui-agent-startup-shell' -import { resolveAgentLaunchCommand } from '../../../../shared/tui-agent-launch-command' +import * as shell from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' +import { resolveAgentLaunchCommand } from '../../../../shared/agent-launch/startup/tui-agent-launch-command' import { agentPickerDraft, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' it('uses chat-style permission icons and separated own settings while keeping raw CLI text selected', () => { act(() => diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.catalog.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.catalog.test.tsx index 301aafb42e2..645c4515978 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.catalog.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.catalog.test.tsx @@ -10,7 +10,7 @@ import { act } from 'react' import { fireEvent } from '@testing-library/react' import { expect, it } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' it.each([ [undefined, { origin: 'unknown' }, 'Pi models are unavailable on this host.', false], diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.perf.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.perf.test.tsx index 5589e4e705a..b143d554ae1 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.perf.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.perf.test.tsx @@ -7,13 +7,13 @@ import { clearNativeChatComposerDraftsForTests } from '../native-chat/native-cha import { resolveAgentLaunchCommand, terminalSessionOptionInputs -} from '../../../../shared/tui-agent-launch-command' -import { tokenizeStartupCommand } from '../../../../shared/tui-agent-startup-shell' -import * as choiceAnalysis from '../../../../shared/agent-choice-args' -import * as choiceSettings from '../../../../shared/agent-choice-settings' -import * as launchProfile from '../../../../shared/agent-launch-profile' +} from '../../../../shared/agent-launch/startup/tui-agent-launch-command' +import { tokenizeStartupCommand } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' +import * as choiceAnalysis from '../../../../shared/agent-launch/choices/agent-choice-args' +import * as choiceSettings from '../../../../shared/agent-launch/choices/agent-choice-settings' +import * as launchProfile from '../../../../shared/agent-launch/choices/agent-launch-profile' import * as optionScanner from '../../../../shared/command-option-occurrence' -import * as pickerCatalog from '../../../../shared/agent-launch-picker-catalog' +import * as pickerCatalog from '../../../../shared/agent-launch/picker/agent-launch-picker-catalog' import { AgentLaunchSetupPanel, entry, @@ -21,12 +21,12 @@ import { root, onUse } from './agent-launch-setup-panel-test-fixture' -import { agentPickerPanelArguments } from '../../../../shared/agent-launch-picker-arguments' +import { agentPickerPanelArguments } from '../../../../shared/agent-launch/picker/agent-launch-picker-arguments' import { agentPickerDraft, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { fetchCodexModelCatalogListing } from '../../lib/codex-model-catalog-reader-test-fixture' diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.prompt.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.prompt.test.tsx index 2722b8e75a4..1728adb52e4 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.prompt.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.prompt.test.tsx @@ -3,7 +3,7 @@ import { compilePickerTerminalLaunch } from './agent-launch-picker-menu-test-fix import { agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { AgentLaunchSetupPanel, entry, diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.shortcuts.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.shortcuts.test.tsx index cfb97fc44f1..98ff9ea7a58 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.shortcuts.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.shortcuts.test.tsx @@ -12,7 +12,7 @@ import { } from './agent-launch-setup-panel-test-fixture' import { changePrompt } from '../native-chat/native-chat-prompt-editor.test-support' import { clearNativeChatComposerDraftsForTests } from '../native-chat/native-chat-composer-draft-store' -import type { AgentPickerSurface } from '../../../../shared/agent-launch-picker' +import type { AgentPickerSurface } from '../../../../shared/agent-launch/picker/agent-launch-picker' beforeEach(() => clearNativeChatComposerDraftsForTests()) afterEach(() => vi.restoreAllMocks()) diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.test.tsx index 974aff7f385..f84eba1fd29 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.test.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.test.tsx @@ -11,19 +11,19 @@ import { act } from 'react' import { fireEvent, getByRole, getByText, isInaccessible, waitFor } from '@testing-library/react' import { expect, it, vi } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' -import * as shell from '../../../../shared/tui-agent-startup-shell' +import * as shell from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveAgentLaunchCommand, terminalSessionOptionInputs -} from '../../../../shared/tui-agent-launch-command' +} from '../../../../shared/agent-launch/startup/tui-agent-launch-command' import { fetchCodexModelCatalogListing } from '../../lib/codex-model-catalog-reader-test-fixture' import { agentPickerDraft, - agentPickerChoiceSeeds, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { agentPickerChoiceSeeds } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' it('shows visible no-match feedback for a nonempty model query', async () => { act(() => diff --git a/src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx b/src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx index 6a927bfef36..ac99528eb5a 100644 --- a/src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx +++ b/src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx @@ -1,5 +1,5 @@ import { AgentLaunchTextModelDefault } from './AgentLaunchTextModelDefault' -import { textActionArgumentsOwnModel } from '../../../../shared/source-control-text-action-picker' +import { textActionArgumentsOwnModel } from '../../../../shared/agent-launch/picker/agent-launch-picker-text-action' import type { AgentLaunchSetupPanelProps } from './AgentLaunchSetupButton' import { agentLaunchSetupOptionRows, @@ -31,20 +31,20 @@ import { type AgentLaunchSetupFooterHandle } from './AgentLaunchSetupFooter' import { AgentLaunchSetupActions } from './AgentLaunchSetupActions' -import { agentPickerPanelArguments } from '../../../../shared/agent-launch-picker-arguments' +import { agentPickerPanelArguments } from '../../../../shared/agent-launch/picker/agent-launch-picker-arguments' import { acceptAgentPickerArguments, applyAgentPickerEdit, type AgentPickerEdit -} from '../../../../shared/agent-launch-picker-edits' +} from '../../../../shared/agent-launch/picker/agent-launch-picker-edits' +import { agentPickerArgumentsKnown } from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' +import { agentPickerEffectiveChoices } from '../../../../shared/agent-launch/picker/agent-launch-picker' +import type { AgentPickerSurface } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { - agentPickerArgumentsKnown, - agentPickerEffectiveChoices, agentPickerModels, agentPickerEntryOptions, - agentPickerPermissions, - type AgentPickerSurface -} from '../../../../shared/agent-launch-picker' + agentPickerPermissions +} from '../../../../shared/agent-launch/picker/agent-launch-picker-catalog' export function AgentLaunchSetupPanel({ entry, diff --git a/src/renderer/src/components/agent/AgentLaunchTextModelDefault.tsx b/src/renderer/src/components/agent/AgentLaunchTextModelDefault.tsx index c55c00f3a78..ac287c2570b 100644 --- a/src/renderer/src/components/agent/AgentLaunchTextModelDefault.tsx +++ b/src/renderer/src/components/agent/AgentLaunchTextModelDefault.tsx @@ -1,8 +1,8 @@ import { CommandItem } from '@/components/ui/command' import { translate } from '@/i18n/i18n' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' -import { TEXT_ACTION_DEFAULT_MODEL } from '../../../../shared/source-control-text-action-picker' -import type { AgentPickerEdit } from '../../../../shared/agent-launch-picker-edits' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { TEXT_ACTION_DEFAULT_MODEL } from '../../../../shared/agent-launch/picker/agent-launch-picker-text-action' +import type { AgentPickerEdit } from '../../../../shared/agent-launch/picker/agent-launch-picker-edits' export function AgentLaunchTextModelDefault({ entry, diff --git a/src/renderer/src/components/agent/agent-combobox-surface-items.tsx b/src/renderer/src/components/agent/agent-combobox-surface-items.tsx index 36977d2ef6f..3fc7e9293aa 100644 --- a/src/renderer/src/components/agent/agent-combobox-surface-items.tsx +++ b/src/renderer/src/components/agent/agent-combobox-surface-items.tsx @@ -3,7 +3,7 @@ import { CommandItem, CommandSeparator } from '@/components/ui/command' import { AgentIcon, getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog' import { searchAgentPickerEntries } from '@/lib/agent-picker-search' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' -import type { NewTabAgentMenuRow } from '@/lib/new-tab-agent-menu-rows' +import type { NewTabAgentMenuRow } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { NewTabAgentMenuModel } from '@/components/tab-bar/use-new-tab-agent-menu-rows' import { chatUnavailableLabel, @@ -13,7 +13,7 @@ import { } from '@/components/tab-bar/tab-agent-row-presentation' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { resolveAgentMenuSelection } from '@/lib/agent-menu-selection' import { renderAgentComboboxItem } from './agent-combobox-items' import { AgentSurfaceLaunchButton } from './AgentSurfaceLaunchButton' diff --git a/src/renderer/src/components/agent/agent-launch-picker-acquisition.ts b/src/renderer/src/components/agent/agent-launch-picker-acquisition.ts index cd912c88d10..c42f29a96f9 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-acquisition.ts +++ b/src/renderer/src/components/agent/agent-launch-picker-acquisition.ts @@ -1,7 +1,7 @@ import { useSyncExternalStore } from 'react' import { shallow } from 'zustand/shallow' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' /** Pending local IPC outlives observers; matching menus must retain its physical owner. */ const pending = new Map() diff --git a/src/renderer/src/components/agent/agent-launch-picker-committed-selection-test-fixture.tsx b/src/renderer/src/components/agent/agent-launch-picker-committed-selection-test-fixture.tsx index 89f878bb996..2c02f8d10c6 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-committed-selection-test-fixture.tsx +++ b/src/renderer/src/components/agent/agent-launch-picker-committed-selection-test-fixture.tsx @@ -5,8 +5,8 @@ import { inventoryModel as model, inventoryCatalog as catalog } from './agent-launch-picker-freshness-test-fixture' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' -import type * as picker from '../../../../shared/agent-launch-picker' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' +import type * as picker from '../../../../shared/agent-launch/picker/agent-launch-picker' import { useAgentLaunchPickerInventory } from './use-agent-launch-picker-inventory' import { agentPickerAcquisitionDiagnostics } from './agent-launch-picker-acquisition' diff --git a/src/renderer/src/components/agent/agent-launch-picker-drafts.ts b/src/renderer/src/components/agent/agent-launch-picker-drafts.ts index 99152a65bf8..1f2f3633312 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-drafts.ts +++ b/src/renderer/src/components/agent/agent-launch-picker-drafts.ts @@ -14,12 +14,12 @@ import { type AgentPickerDraft, type AgentPickerDraftOwner, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { type AgentPickerRetainedSetup as RetainedSetup, currentAgentPickerDraft -} from '../../../../shared/agent-launch-picker-authority' +} from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' import { retireAgentPickerSetups } from './agent-launch-picker-retirement' import { launchDraftSource, @@ -30,7 +30,6 @@ import { writeLaunchSetupOptions } from '../native-chat/native-chat-composer-draft-store' -export type { AgentPickerDraftOwner } from '../../../../shared/agent-launch-picker' export type AgentPickerSetupIdentity = { model: string; effort?: string } const appSession: AgentPickerDraftOwner = {} const sessionDrafts = new WeakMap>() diff --git a/src/renderer/src/components/agent/agent-launch-picker-freshness-test-fixture.tsx b/src/renderer/src/components/agent/agent-launch-picker-freshness-test-fixture.tsx index 3bdbc533a05..a1eb36f2d2c 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-freshness-test-fixture.tsx +++ b/src/renderer/src/components/agent/agent-launch-picker-freshness-test-fixture.tsx @@ -4,7 +4,7 @@ import { DropdownMenuTrigger, DropdownMenuContent } from '@/components/ui/dropdown-menu' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import { createElement } from 'react' import { act, fireEvent, render } from '@testing-library/react' import { expect, vi } from 'vitest' @@ -18,7 +18,7 @@ import { } from './use-agent-launch-picker-inventory' import { agentPickerAcquisitionDiagnostics } from './agent-launch-picker-acquisition' import type { NewTabAgentMenuModel } from '../tab-bar/new-tab-agent-menu-model' -import * as picker from '../../../../shared/agent-launch-picker' +import * as picker from '../../../../shared/agent-launch/picker/agent-launch-picker' import { applyNativeChatSessionOptionPicks, structuredLaunchSeedOptions diff --git a/src/renderer/src/components/agent/agent-launch-picker-menu-test-fixture.ts b/src/renderer/src/components/agent/agent-launch-picker-menu-test-fixture.ts index bb87de7b547..d83816b4aaa 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-menu-test-fixture.ts +++ b/src/renderer/src/components/agent/agent-launch-picker-menu-test-fixture.ts @@ -1,11 +1,11 @@ -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' -import { resolveAgentLaunchCommand } from '../../../../shared/tui-agent-launch-command' -import { tokenizeStartupCommand } from '../../../../shared/tui-agent-startup-shell' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { resolveAgentLaunchCommand } from '../../../../shared/agent-launch/startup/tui-agent-launch-command' +import { tokenizeStartupCommand } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { agentPickerLaunchInputs, type AgentPickerDraft, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' export const entry: AgentPickerEntry = { agent: 'codex', diff --git a/src/renderer/src/components/agent/agent-launch-picker-retirement.ts b/src/renderer/src/components/agent/agent-launch-picker-retirement.ts index cf36deac28c..a99f73d1463 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-retirement.ts +++ b/src/renderer/src/components/agent/agent-launch-picker-retirement.ts @@ -1,5 +1,5 @@ -import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch-picker-authority' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { launchDraftSources } from '../native-chat/native-chat-launch-draft-source' export function retireAgentPickerSetups( diff --git a/src/renderer/src/components/agent/agent-launch-setup-option-rows.ts b/src/renderer/src/components/agent/agent-launch-setup-option-rows.ts index 614817e4f54..a11b540a2ba 100644 --- a/src/renderer/src/components/agent/agent-launch-setup-option-rows.ts +++ b/src/renderer/src/components/agent/agent-launch-setup-option-rows.ts @@ -1,16 +1,18 @@ import { TEXT_ACTION_DEFAULT_MODEL, textActionArgumentsOwnEffort -} from '../../../../shared/source-control-text-action-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker-text-action' import { translate } from '@/i18n/i18n' import type { SessionOptionDescriptor } from '../../../../shared/native-chat/input/native-chat-session-options' import type { agentPickerEntryOptions, - agentPickerModels, + agentPickerModels +} from '../../../../shared/agent-launch/picker/agent-launch-picker-catalog' +import type { AgentPickerEntry, AgentPickerDraft -} from '../../../../shared/agent-launch-picker' -import type { agentPickerPanelArguments } from '../../../../shared/agent-launch-picker-arguments' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' +import type { agentPickerPanelArguments } from '../../../../shared/agent-launch/picker/agent-launch-picker-arguments' type AgentLaunchSetupOptionRowsInput = { options: ReturnType diff --git a/src/renderer/src/components/agent/agent-launch-setup-panel-test-fixture.ts b/src/renderer/src/components/agent/agent-launch-setup-panel-test-fixture.ts index 97ba3ac9ca5..0ead847e12f 100644 --- a/src/renderer/src/components/agent/agent-launch-setup-panel-test-fixture.ts +++ b/src/renderer/src/components/agent/agent-launch-setup-panel-test-fixture.ts @@ -2,7 +2,10 @@ import { act, createElement, type ComponentProps } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, vi } from 'vitest' import { clearNativeChatComposerDraftsForTests } from '../native-chat/native-chat-composer-draft-store' -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' export const entry: AgentPickerEntry = { agent: 'claude', diff --git a/src/renderer/src/components/agent/launch-settings/AgentChatChoiceControls.tsx b/src/renderer/src/components/agent/launch-settings/AgentChatChoiceControls.tsx index 38b761dd049..d644aaf9500 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentChatChoiceControls.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentChatChoiceControls.tsx @@ -1,5 +1,5 @@ import type { RuntimeClientTarget } from '../../../../../shared/runtime-client-target' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' import { antigravityChatSignInRunning } from '@/runtime/antigravity-chat-sign-in-status' import { useManagedRuntimeInstall } from '@/runtime/use-managed-runtime-install' diff --git a/src/renderer/src/components/agent/launch-settings/AgentChoiceControls.tsx b/src/renderer/src/components/agent/launch-settings/AgentChoiceControls.tsx index 9f329ce5704..8be5f236559 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentChoiceControls.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentChoiceControls.tsx @@ -1,9 +1,9 @@ import type { AgentChoicePatch, AgentDedicatedChoices -} from '../../../../../shared/agent-launch-choices' +} from '../../../../../shared/agent-launch/choices/agent-launch-choices' -import { reconcileAgentChoiceArgs } from '../../../../../shared/agent-choice-reconciliation' +import { reconcileAgentChoiceArgs } from '../../../../../shared/agent-launch/choices/agent-choice-reconciliation' import { findCatalogModel, getAgentSessionOptionLaunchCatalog @@ -14,7 +14,7 @@ import { sourceControlActionOptions } from '../../../../../shared/source-control-action-options' import { encodeCatalogOptionValue } from '../../../../../shared/agent-session/options/structured-agent-session-option-codec' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { AgentChoiceMenu } from './AgentChoiceMenu' import { sourceControlActionRouteHint } from './AgentChoiceOptionField' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.test.tsx b/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.test.tsx index e01fb6f489a..bb639f82058 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.test.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.test.tsx @@ -9,8 +9,8 @@ import { agentLaunchSettingsMutationUpdates, projectAgentLaunchSettings, type AgentLaunchSettingsSource -} from '../../../../../shared/agent-launch-settings' -import { resolveAgentPermission } from '../../../../../shared/tui-agent-permission-choice' +} from '../../../../../shared/agent-launch/choices/agent-launch-settings' +import { resolveAgentPermission } from '../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { AgentChoiceControls } from './AgentChoiceControls' vi.stubGlobal( diff --git a/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.tsx b/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.tsx index 0becd86e8b9..741dd735b15 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentLaunchChoiceEditor.tsx @@ -3,14 +3,14 @@ import { AGENT_LAUNCH_CHOICE_KEYS, type AgentModelOptionChoices, type AgentChoicePatch -} from '../../../../../shared/agent-launch-choices' +} from '../../../../../shared/agent-launch/choices/agent-launch-choices' import { AgentDefaultArgsInput } from './AgentLaunchDefaultsEditor' import { AgentPermissionMenu, type AgentPermissionChoiceRow } from './AgentPermissionChoiceControls' import { agentModelChoiceChips } from './agent-model-choice-chips' import { useAgentLaunchFieldWrite } from './use-agent-launch-field-write' -import { reconcileAgentChoiceArgs } from '../../../../../shared/agent-choice-reconciliation' +import { reconcileAgentChoiceArgs } from '../../../../../shared/agent-launch/choices/agent-choice-reconciliation' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' import { AgentChoiceFields } from './AgentChoiceControls' diff --git a/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceControls.tsx b/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceControls.tsx index 13a53889d3c..63dcfd4fe90 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceControls.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceControls.tsx @@ -1,8 +1,8 @@ import { AgentPermissionMenuOptions } from './AgentPermissionMenuOptions' import { ChevronDown, X } from 'lucide-react' import type { Ref } from 'react' -import type { AgentChatPermissionMode } from '../../../../../shared/agent-chat-permission-mode' -import type { AgentPermissionChoice } from '../../../../../shared/tui-agent-permission-choice' +import type { AgentChatPermissionMode } from '../../../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import type { AgentPermissionChoice } from '../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { translate } from '@/i18n/i18n' import { cn } from '@/lib/utils' import { Button } from '../../ui/button' diff --git a/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceItems.tsx b/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceItems.tsx index 37e43e9748f..80ba21bc8d9 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceItems.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentPermissionChoiceItems.tsx @@ -1,5 +1,5 @@ import { Terminal } from 'lucide-react' -import type { AgentPermissionChoice } from '../../../../../shared/tui-agent-permission-choice' +import type { AgentPermissionChoice } from '../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { translate } from '@/i18n/i18n' import { DropdownMenuRadioItem, DropdownMenuSeparator } from '../../ui/dropdown-menu' import { diff --git a/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.test.ts b/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.test.ts index da6ad6b2cbb..6902acf7e2a 100644 --- a/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.test.ts +++ b/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest' import { agentModelChoiceChips } from './agent-model-choice-chips' -import * as profile from '../../../../../shared/agent-launch-profile' -import * as analyzer from '../../../../../shared/agent-choice-args' +import * as profile from '../../../../../shared/agent-launch/choices/agent-launch-profile' +import * as analyzer from '../../../../../shared/agent-launch/choices/agent-choice-args' it('projects the whole selection once and removes actual independent or composed carriers', () => { const project = vi.spyOn(profile, 'projectAgentLaunchProfile') diff --git a/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.ts b/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.ts index deb93e5d06a..b3b66c6a36a 100644 --- a/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.ts +++ b/src/renderer/src/components/agent/launch-settings/agent-model-choice-chips.ts @@ -1,5 +1,5 @@ -import { analyzeAgentChoiceArgs } from '../../../../../shared/agent-choice-args' -import { projectAgentLaunchProfile } from '../../../../../shared/agent-launch-profile' +import { analyzeAgentChoiceArgs } from '../../../../../shared/agent-launch/choices/agent-choice-args' +import { projectAgentLaunchProfile } from '../../../../../shared/agent-launch/choices/agent-launch-profile' import { findCatalogModel, getAgentSessionOptionLaunchCatalog @@ -7,9 +7,9 @@ import { import type { AgentChoicePatch, AgentDedicatedChoices -} from '../../../../../shared/agent-launch-choices' -import type { AgentArgsProjectionContext } from '../../../../../shared/agent-launch-picker-arguments' -import type { TuiAgent } from '../../../../../shared/tui-agent' +} from '../../../../../shared/agent-launch/choices/agent-launch-choices' +import type { AgentArgsProjectionContext } from '../../../../../shared/agent-launch/picker/agent-launch-picker-arguments' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AgentArgsChoice } from './AgentPermissionChoiceControls' export function agentModelChoiceChips( diff --git a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.catalog.test.tsx b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.catalog.test.tsx index fc2b9db425f..5125bccdf30 100644 --- a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.catalog.test.tsx +++ b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.catalog.test.tsx @@ -7,8 +7,9 @@ import { inventoryCatalog as catalog } from './agent-launch-picker-freshness-test-fixture' import { TooltipProvider } from '@/components/ui/tooltip' -import * as picker from '../../../../shared/agent-launch-picker' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import * as picker from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { agentPickerArgumentsText } from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import type { NewTabAgentMenuModel } from '../tab-bar/new-tab-agent-menu-model' import { useAgentLaunchPickerInventory } from './use-agent-launch-picker-inventory' import { AgentLaunchSetupPanel } from './AgentLaunchSetupPanel' @@ -124,7 +125,7 @@ it('shows unsupported rather than perpetual busy for a null-target SSH catalog w expect(entry.arguments).toBe('--debug') expect(draft.arguments).toBeUndefined() expect(picker.agentPickerLaunchInputs(draft, entry)).not.toHaveProperty('agentArgs') - expect(picker.agentPickerArgumentsText(entry, draft)).toBe('--debug') + expect(agentPickerArgumentsText(entry, draft)).toBe('--debug') }) it('uses the existing known host registration to show no-discovery without a futile catalog retry', async () => { diff --git a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.test.tsx b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.test.tsx index 8103e86a040..851f5946e57 100644 --- a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.test.tsx +++ b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.test.tsx @@ -19,9 +19,9 @@ import { import { buildNewTabAgentMenuRows, type HostChatAnswer -} from '../../../../shared/agent-launch-picker-rows' -import type * as picker from '../../../../shared/agent-launch-picker' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +} from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' +import type * as picker from '../../../../shared/agent-launch/picker/agent-launch-picker' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import type { AgentSessionModelCatalogResult } from '../../../../shared/agent-session/agent-session-wire' import type { NewTabAgentMenuModel } from '../tab-bar/new-tab-agent-menu-model' import { diff --git a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts index 740333088ed..174ad256b9b 100644 --- a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts +++ b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts @@ -28,14 +28,16 @@ import { observeAgentPickerAcquisition, type AgentPickerInventorySource } from './agent-launch-picker-acquisition' -import { usableAgentPickerDefaultSettings as usable } from '../../../../shared/agent-launch-picker-defaults' -import { isAgentChatPermissionChoice } from '../../../../shared/agent-chat-permission-mode' +import { + usableAgentPickerDefaultSettings as usable, + agentPickerChoiceSeeds, + type AgentPickerDefaultSettings +} from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' +import { isAgentChatPermissionChoice } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { agentPickerEntriesFromRows, - agentPickerChoiceSeeds, - type AgentPickerDefaultSettings, type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' export { useAgentPickerInventoryEntries, type AgentPickerInventorySource } diff --git a/src/renderer/src/components/automations/AutomationEditorDialog.tsx b/src/renderer/src/components/automations/AutomationEditorDialog.tsx index 1e825734219..0d836cabfb1 100644 --- a/src/renderer/src/components/automations/AutomationEditorDialog.tsx +++ b/src/renderer/src/components/automations/AutomationEditorDialog.tsx @@ -9,7 +9,7 @@ import { } from './automation-launch-surface' import { Dialog, DialogContent } from '@/components/ui/dialog' import { getAgentCatalog } from '@/lib/agent-catalog' -import { filterEnabledTuiAgents } from '../../../../shared/tui-agent-selection' +import { filterEnabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import type { AutomationSchedulePreset, AutomationWorkspaceMode @@ -18,7 +18,7 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { OrcaHooks } from '../../../../shared/orca-yaml-hook-types' import type { ProjectHostSetup } from '../../../../shared/project-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SetupDecision } from '../../../../shared/worktree/create-types' import type { Worktree } from '../../../../shared/worktree/types' import { closeUnfocusedMonacoFindOrPreventDialogDismiss } from '@/components/editor/monaco-find-widget' diff --git a/src/renderer/src/components/automations/AutomationExtraAgentArgsField.tsx b/src/renderer/src/components/automations/AutomationExtraAgentArgsField.tsx index 8d81b50f358..fc7fe62f9cf 100644 --- a/src/renderer/src/components/automations/AutomationExtraAgentArgsField.tsx +++ b/src/renderer/src/components/automations/AutomationExtraAgentArgsField.tsx @@ -6,7 +6,7 @@ import { getExtraAgentArgsPlaceholder, hasExtraAgentArgs, supportsExtraAgentArgs -} from '../../../../shared/automation-extra-agent-args' +} from '../../../../shared/agent-launch/startup/automation-extra-agent-args' import { AUTOMATION_EDITOR_SECTION_LABEL_CLASS } from './automation-page-parts' import { draftExtraAgentArgsNeedFreshSession, diff --git a/src/renderer/src/components/automations/automation-capability-probe.ts b/src/renderer/src/components/automations/automation-capability-probe.ts index e89bcdfdb2e..4184e2491bd 100644 --- a/src/renderer/src/components/automations/automation-capability-probe.ts +++ b/src/renderer/src/components/automations/automation-capability-probe.ts @@ -17,7 +17,7 @@ import { import { EXTRA_AGENT_ARGS_HOST_UPDATE_REQUIRED, hasExtraAgentArgs -} from '../../../../shared/automation-extra-agent-args' +} from '../../../../shared/agent-launch/startup/automation-extra-agent-args' import { automationAuthorityCatalogKey } from './automation-host-catalog-types' import { automationHostDiagnostics } from './automation-host-diagnostics' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/automations/automation-draft-model.ts b/src/renderer/src/components/automations/automation-draft-model.ts index 65ab0cb013f..0ed4a9cc8c8 100644 --- a/src/renderer/src/components/automations/automation-draft-model.ts +++ b/src/renderer/src/components/automations/automation-draft-model.ts @@ -4,7 +4,7 @@ import type { Worktree } from '../../../../shared/worktree/types' import { hasExtraAgentArgs, parseExtraAgentArgs -} from '../../../../shared/automation-extra-agent-args' +} from '../../../../shared/agent-launch/startup/automation-extra-agent-args' import type { AutomationDraft } from './AutomationEditorDialog' import { extraAgentArgsErrorText } from './automation-extra-agent-args-error-copy' diff --git a/src/renderer/src/components/automations/automation-extra-agent-args-error-copy.ts b/src/renderer/src/components/automations/automation-extra-agent-args-error-copy.ts index 21a8f1f5cc7..3badaa76ade 100644 --- a/src/renderer/src/components/automations/automation-extra-agent-args-error-copy.ts +++ b/src/renderer/src/components/automations/automation-extra-agent-args-error-copy.ts @@ -3,7 +3,7 @@ import { EXTRA_AGENT_ARGS_FAILURE_COPY as EN, type ExtraAgentArgsFailure, type ExtraAgentArgsFailureCode -} from '../../../../shared/automation-extra-agent-args' +} from '../../../../shared/agent-launch/startup/automation-extra-agent-args' const COPY: Record) => string> = { unsupportedAgent: () => diff --git a/src/renderer/src/components/automations/automation-launch-surface.ts b/src/renderer/src/components/automations/automation-launch-surface.ts index 94650199b5e..8dd4b5bde1a 100644 --- a/src/renderer/src/components/automations/automation-launch-surface.ts +++ b/src/renderer/src/components/automations/automation-launch-surface.ts @@ -1,5 +1,5 @@ import type { Automation, AutomationUpdateInput } from '../../../../shared/automations-types' -import { hasExtraAgentArgs } from '../../../../shared/automation-extra-agent-args' +import { hasExtraAgentArgs } from '../../../../shared/agent-launch/startup/automation-extra-agent-args' import type { GlobalSettings } from '../../../../shared/global-settings-types' import { AUTOMATION_SURFACE_RUNTIME_CAPABILITY } from '../../../../shared/protocol-version' import { diff --git a/src/renderer/src/components/automations/automation-list-view.ts b/src/renderer/src/components/automations/automation-list-view.ts index b57e2753cd9..cfe5c255bba 100644 --- a/src/renderer/src/components/automations/automation-list-view.ts +++ b/src/renderer/src/components/automations/automation-list-view.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { hostStableKey } from '../../../../shared/automation-owner-key' import type { AutomationListRow } from './automation-list-row-identity' import type { ExternalAutomationListEntry } from './external-automation-list-entries' diff --git a/src/renderer/src/components/automations/automation-run-workspace-action.ts b/src/renderer/src/components/automations/automation-run-workspace-action.ts index f8747dc4505..3591593f6ea 100644 --- a/src/renderer/src/components/automations/automation-run-workspace-action.ts +++ b/src/renderer/src/components/automations/automation-run-workspace-action.ts @@ -1,5 +1,5 @@ import { openExistingStructuredSession } from '@/lib/open-existing-structured-session' -import { ALL_TUI_AGENTS } from '../../../../shared/tui-agent-display-names' +import { ALL_TUI_AGENTS } from '../../../../shared/agent-launch/catalog/tui-agent-display-names' import { isStructuredAgentSessionIdFor } from '../../../../shared/agent-session/structured-agent-session-create' import type { AutomationRun } from '../../../../shared/automations-types' import { toast } from 'sonner' diff --git a/src/renderer/src/components/automations/automation-save-action.ts b/src/renderer/src/components/automations/automation-save-action.ts index 041bdb19f40..df38fd74d21 100644 --- a/src/renderer/src/components/automations/automation-save-action.ts +++ b/src/renderer/src/components/automations/automation-save-action.ts @@ -5,7 +5,7 @@ import { automationLaunchWorkspace } from './automation-launch-surface' import { toast } from 'sonner' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { isValidAutomationSchedule } from '../../../../shared/automation-schedule-parsing' import { translate } from '@/i18n/i18n' import { acceptsAutomationDraftSchedule } from './automation-schedule-input-gate' diff --git a/src/renderer/src/components/automations/automation-templates.ts b/src/renderer/src/components/automations/automation-templates.ts index b4abe3017df..a8bf68fd521 100644 --- a/src/renderer/src/components/automations/automation-templates.ts +++ b/src/renderer/src/components/automations/automation-templates.ts @@ -1,5 +1,5 @@ import type { AutomationSchedulePreset } from '../../../../shared/automations-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' diff --git a/src/renderer/src/components/automations/use-automations-page-store-state.ts b/src/renderer/src/components/automations/use-automations-page-store-state.ts index 7cd051eacba..149752987f3 100644 --- a/src/renderer/src/components/automations/use-automations-page-store-state.ts +++ b/src/renderer/src/components/automations/use-automations-page-store-state.ts @@ -1,5 +1,8 @@ import { useCallback } from 'react' -import { filterEnabledTuiAgents, isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { + filterEnabledTuiAgents, + isTuiAgentEnabled +} from '../../../../shared/agent-launch/catalog/tui-agent-selection' import type { Repo } from '../../../../shared/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import { getAgentCatalog } from '@/lib/agent-catalog' diff --git a/src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts b/src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts index e4cd74bfe3e..c39cf2c0462 100644 --- a/src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts +++ b/src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts @@ -1,6 +1,6 @@ import type { AppState } from '@/store/types' import type { DashboardCardTerminalInput } from '../../../../shared/dashboard-snapshot' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../../../../shared/execution-host' import { parseAppSshPtyId } from '../../../../shared/ssh-pty-id' import { getConnectionIdFromState } from '@/lib/connection-context' diff --git a/src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts b/src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts index 7672ed0270a..56216d7ae35 100644 --- a/src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts +++ b/src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts @@ -5,12 +5,12 @@ import { type DashboardCard, type DashboardWorkspace } from '../../../../shared/dashboard-snapshot' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER -} from '../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../shared/tui-agent' +} from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { parseWorkspaceKey } from '../../../../shared/workspace-scope' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' import { worktreeLaunchWorkspace, type AgentLaunchRouteView } from '@/lib/agent-launch-route-input' diff --git a/src/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsx b/src/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsx index 3bfbfaad858..620fbdebeea 100644 --- a/src/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsx +++ b/src/renderer/src/components/editor/ReviewNotesSendMenuContent.test.tsx @@ -3,7 +3,7 @@ import { toast } from 'sonner' import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { AgentStatusEntry, AgentStatusState } from '../../../../shared/agent-status-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { NotesSendAgentTarget } from '@/lib/notes-send-agent-targets' import { makePaneKey } from '../../../../shared/stable-pane-id' import type { DashboardAgentRow as DashboardAgentRowData } from '@/components/dashboard/useDashboardData' diff --git a/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx b/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx index cd1230d23d6..e7e50f94c58 100644 --- a/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx +++ b/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx @@ -24,7 +24,7 @@ import { import { AgentStep } from '../onboarding/AgentStep' import { NotificationStep } from '../onboarding/NotificationStep' import { useAppStore } from '@/store' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getProviderRuntimeContextKey } from '@/lib/provider-runtime-context' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/feature-wall/ai-commit-pr-settings-helpers.ts b/src/renderer/src/components/feature-wall/ai-commit-pr-settings-helpers.ts index 5dc505a0a10..ee4c5c41ec7 100644 --- a/src/renderer/src/components/feature-wall/ai-commit-pr-settings-helpers.ts +++ b/src/renderer/src/components/feature-wall/ai-commit-pr-settings-helpers.ts @@ -1,6 +1,6 @@ import type { CommitMessageAiSettings } from '../../../../shared/commit-message-ai-types' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getCommitMessageAgentCapability, isCustomAgentId, diff --git a/src/renderer/src/components/feature-wall/useAiCommitPrSettings.ts b/src/renderer/src/components/feature-wall/useAiCommitPrSettings.ts index 82fec9ef878..e0f33fbc160 100644 --- a/src/renderer/src/components/feature-wall/useAiCommitPrSettings.ts +++ b/src/renderer/src/components/feature-wall/useAiCommitPrSettings.ts @@ -10,7 +10,7 @@ import { LOCAL_COMMIT_MESSAGE_HOST_KEY } from '../../../../shared/commit-message import { normalizeSourceControlAiSettings } from '../../../../shared/source-control-ai' import { getTextGenerationModels } from '../../../../shared/source-control-ai-model-selection' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { getAgentCatalog } from '@/lib/agent-catalog' import { useAppStore } from '@/store' import { diff --git a/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx b/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx index 2ea2661a5f3..adf5affc61d 100644 --- a/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx +++ b/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx @@ -12,7 +12,7 @@ import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' import { DEFAULT_DISABLED_TUI_AGENTS, isTuiAgentEnabled -} from '../../../../shared/tui-agent-selection' +} from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { translate } from '@/i18n/i18n' import { useOptionalShortcutLabel } from '@/hooks/useShortcutLabel' diff --git a/src/renderer/src/components/native-chat/NativeChatComposer.resume-command.test.tsx b/src/renderer/src/components/native-chat/NativeChatComposer.resume-command.test.tsx index 44d945292c3..f0ae28cc5e3 100644 --- a/src/renderer/src/components/native-chat/NativeChatComposer.resume-command.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatComposer.resume-command.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment happy-dom // @vitest-environment happy-dom -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-launch/startup/agent-tui-input-clear' import { act, cleanup, render } from '@testing-library/react' import type { RefObject } from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/src/renderer/src/components/native-chat/NativeChatPaneHeader.tsx b/src/renderer/src/components/native-chat/NativeChatPaneHeader.tsx index bd2fe0a8258..5698456de76 100644 --- a/src/renderer/src/components/native-chat/NativeChatPaneHeader.tsx +++ b/src/renderer/src/components/native-chat/NativeChatPaneHeader.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { translate } from '@/i18n/i18n' import { useShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' -import { agentForksConversations } from '../../../../shared/agent-resume-argv' +import { agentForksConversations } from '../../../../shared/agent-launch/startup/agent-resume-argv' import type { NativeChatTabSession } from '../tab-bar/tab-session-history-switch' import { useDocumentDarkTheme } from '@/hooks/use-document-dark-theme' import { useStructuredChatPaneActions } from './use-structured-chat-pane-actions' diff --git a/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.test.tsx b/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.test.tsx index 8882793e8aa..d9db9335751 100644 --- a/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.test.tsx @@ -2,7 +2,7 @@ import { cleanup, fireEvent, render, screen, within } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { AgentChatPermissionChoice } from '../../../../shared/agent-chat-permission-mode' +import type { AgentChatPermissionChoice } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string, values?: Record) => diff --git a/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.tsx b/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.tsx index fc237a9b84b..1f7be9b48b1 100644 --- a/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.tsx +++ b/src/renderer/src/components/native-chat/NativeChatPermissionModePicker.tsx @@ -15,7 +15,7 @@ import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID, isAgentChatPermissionMode, type AgentChatPermissionMode -} from '../../../../shared/agent-chat-permission-mode' +} from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { SessionOptionDescriptor, SessionOptionsSurface diff --git a/src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx b/src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx index 75967911303..ef685de9d4a 100644 --- a/src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx @@ -1,4 +1,4 @@ -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-launch/startup/agent-tui-input-clear' // @vitest-environment happy-dom import '@testing-library/jest-dom/vitest' diff --git a/src/renderer/src/components/native-chat/NativeChatUsageLimitActions.tsx b/src/renderer/src/components/native-chat/NativeChatUsageLimitActions.tsx index d63a5896965..8dce59c0a39 100644 --- a/src/renderer/src/components/native-chat/NativeChatUsageLimitActions.tsx +++ b/src/renderer/src/components/native-chat/NativeChatUsageLimitActions.tsx @@ -21,7 +21,7 @@ import { } from '@/lib/agent-session-continuation' import { ClaudeSwitcherMenu } from '@/components/status-bar/ClaudeSwitcherMenu' import { ProviderAccountChatButton } from '@/components/status-bar/ProviderAccountChatButton' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { callStructuredAgentSession } from '@/runtime/structured-agent-session-client' import type { AgentSessionOptionsResult } from '../../../../shared/agent-session/options/agent-session-options-result' import { executionHostIdForStructuredTarget } from '@/runtime/structured-agent-session-owner' diff --git a/src/renderer/src/components/native-chat/native-chat-composer-draft-memory.ts b/src/renderer/src/components/native-chat/native-chat-composer-draft-memory.ts index 72eb5432433..1ae6101cd02 100644 --- a/src/renderer/src/components/native-chat/native-chat-composer-draft-memory.ts +++ b/src/renderer/src/components/native-chat/native-chat-composer-draft-memory.ts @@ -1,5 +1,5 @@ import type { LoadBookkeeping } from './native-chat-composer-draft-load' -import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch-picker-authority' +import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' import { currentDraftScope, captureLaunchDraftDestination, @@ -7,7 +7,7 @@ import { nativeChatLaunchPromptDraftOwner, retainLaunchDraftSource } from './native-chat-launch-draft-source' -import type { AgentPickerDraft } from '../../../../shared/agent-launch-picker' +import type { AgentPickerDraft } from '../../../../shared/agent-launch/picker/agent-launch-picker' export { nativeChatLaunchPromptDraftOwner, nativeChatLaunchPromptDraftScopeKey, diff --git a/src/renderer/src/components/native-chat/native-chat-input-clear.ts b/src/renderer/src/components/native-chat/native-chat-input-clear.ts index 8271b253fea..3e570543ee0 100644 --- a/src/renderer/src/components/native-chat/native-chat-input-clear.ts +++ b/src/renderer/src/components/native-chat/native-chat-input-clear.ts @@ -1,5 +1,5 @@ import { sendRuntimePtyInput } from '@/runtime/runtime-terminal-inspection' -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-tui-input-clear' +import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../shared/agent-launch/startup/agent-tui-input-clear' export const NATIVE_CHAT_CLEAR_UNSUBMITTED_INPUT = AGENT_TUI_CLEAR_INPUT_MAX diff --git a/src/renderer/src/components/native-chat/native-chat-launch-draft-send.ts b/src/renderer/src/components/native-chat/native-chat-launch-draft-send.ts index c7ed276c259..5c896a4da65 100644 --- a/src/renderer/src/components/native-chat/native-chat-launch-draft-send.ts +++ b/src/renderer/src/components/native-chat/native-chat-launch-draft-send.ts @@ -2,7 +2,7 @@ import { AGENT_TUI_CLEAR_MAX_LINES, countAgentTuiInputLines, buildAgentTuiClearInputForText -} from '../../../../shared/agent-tui-input-clear' +} from '../../../../shared/agent-launch/startup/agent-tui-input-clear' export type NativeChatLaunchDraftSendPlan = /** Input line holds a stale injected draft — replace it, clearing every line. */ diff --git a/src/renderer/src/components/native-chat/native-chat-launch-draft-source.ts b/src/renderer/src/components/native-chat/native-chat-launch-draft-source.ts index ebf5bd51eb2..5bcdc591fdd 100644 --- a/src/renderer/src/components/native-chat/native-chat-launch-draft-source.ts +++ b/src/renderer/src/components/native-chat/native-chat-launch-draft-source.ts @@ -1,4 +1,4 @@ -import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch-picker-authority' +import type { AgentPickerRetainedSetup } from '../../../../shared/agent-launch/picker/agent-launch-picker-authority' import type { SshRepoReadoption } from '../../../../shared/ssh-types' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { @@ -6,7 +6,7 @@ import { toSshExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' -import type { AgentPickerDraft } from '../../../../shared/agent-launch-picker' +import type { AgentPickerDraft } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { NativeChatComposerDraftOwner } from './native-chat-composer-draft-storage' type SetupHandle = { scopeKey: string; active: boolean; readonly initialScope: string } diff --git a/src/renderer/src/components/native-chat/native-chat-layout-actions.ts b/src/renderer/src/components/native-chat/native-chat-layout-actions.ts index 59802b4be1e..a215b3c7064 100644 --- a/src/renderer/src/components/native-chat/native-chat-layout-actions.ts +++ b/src/renderer/src/components/native-chat/native-chat-layout-actions.ts @@ -3,7 +3,7 @@ import { translate } from '@/i18n/i18n' import { getAgentLabel } from '@/lib/agent-catalog' import type { AppState } from '@/store/types' import { useAppStore } from '@/store' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id' import { launchAgentInNewTab } from '@/lib/launch-agent-in-new-tab' import { captureNativeChatComposerFocusIntent } from '@/components/native-chat/use-native-chat-composer-reveal-focus' diff --git a/src/renderer/src/components/native-chat/native-chat-leaf-routing.ts b/src/renderer/src/components/native-chat/native-chat-leaf-routing.ts index 1cf8209bece..f41c7f6e867 100644 --- a/src/renderer/src/components/native-chat/native-chat-leaf-routing.ts +++ b/src/renderer/src/components/native-chat/native-chat-leaf-routing.ts @@ -2,7 +2,7 @@ import type { TerminalLayoutSnapshot, TerminalPaneLayoutNode } from '../../../../shared/terminal-tab-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' function layoutNodeContainsLeaf(node: TerminalPaneLayoutNode | null, leafId: string): boolean { if (!node) { diff --git a/src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts b/src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts index 068d7365b38..5467f5182dd 100644 --- a/src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest' import type { AgentStatusEntry } from '../../../../shared/agent-status-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { resolveNativeChatSession } from './native-chat-pane-resolution' function entry( diff --git a/src/renderer/src/components/native-chat/native-chat-pane-resolution.ts b/src/renderer/src/components/native-chat/native-chat-pane-resolution.ts index 1f4d9512e6f..126bd9ee445 100644 --- a/src/renderer/src/components/native-chat/native-chat-pane-resolution.ts +++ b/src/renderer/src/components/native-chat/native-chat-pane-resolution.ts @@ -1,5 +1,5 @@ import type { AgentStatusEntry, AgentType } from '../../../../shared/agent-status-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { isNativeChatSupportedAgent } from '../../../../shared/native-chat/native-chat-agent-support' import { nativeChatAvailabilityAgent } from '../../../../shared/native-chat/native-chat-availability' diff --git a/src/renderer/src/components/native-chat/native-chat-permission-mode-labels.ts b/src/renderer/src/components/native-chat/native-chat-permission-mode-labels.ts index fdc6c77cde2..ab34b582cdd 100644 --- a/src/renderer/src/components/native-chat/native-chat-permission-mode-labels.ts +++ b/src/renderer/src/components/native-chat/native-chat-permission-mode-labels.ts @@ -5,7 +5,7 @@ import { AGENT_CHAT_PERMISSION_MODE_ICON_NAMES, type AgentChatPermissionMode, type AgentChatPermissionModeIconName -} from '../../../../shared/agent-chat-permission-mode' +} from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' const ICONS_BY_NAME: Record = { Hand, diff --git a/src/renderer/src/components/native-chat/native-chat-quote-focus.test.tsx b/src/renderer/src/components/native-chat/native-chat-quote-focus.test.tsx index 135af46ea81..334e1421582 100644 --- a/src/renderer/src/components/native-chat/native-chat-quote-focus.test.tsx +++ b/src/renderer/src/components/native-chat/native-chat-quote-focus.test.tsx @@ -4,7 +4,7 @@ import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-libra import { afterEach, expect, it, vi } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' import { AgentLaunchPromptComposer } from '../agent/AgentLaunchPromptComposer' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { NativeChatComposerHandle } from './native-chat-composer-types' import { emptyNativeChatContextMenuActions, diff --git a/src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts b/src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts index 740a5886b72..11f739a39ed 100644 --- a/src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts @@ -29,7 +29,7 @@ import { import { AGENT_TUI_CLEAR_INPUT_MAX, buildAgentTuiClearInputForText -} from '../../../../shared/agent-tui-input-clear' +} from '../../../../shared/agent-launch/startup/agent-tui-input-clear' const PTY = 'pty-launch-draft' const DRAFT = 'Linked Linear issue: ABC-123\nhttps://linear.app/x/issue/ABC-123' diff --git a/src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts b/src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts index 17adedca9bb..69accd5f151 100644 --- a/src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts @@ -27,7 +27,7 @@ import { AGENT_TUI_CLEAR_INPUT_MAX, AGENT_TUI_CLEAR_INPUT_LINE, buildAgentTuiClearInputForText -} from '../../../../shared/agent-tui-input-clear' +} from '../../../../shared/agent-launch/startup/agent-tui-input-clear' import { NATIVE_CHAT_IMAGE_ATTACHMENT_SETTLE_MS, sendNativeChatMessageWithImageAttachments diff --git a/src/renderer/src/components/native-chat/native-chat-runtime-send.ts b/src/renderer/src/components/native-chat/native-chat-runtime-send.ts index 5cdd3b7b828..c47a238560b 100644 --- a/src/renderer/src/components/native-chat/native-chat-runtime-send.ts +++ b/src/renderer/src/components/native-chat/native-chat-runtime-send.ts @@ -20,7 +20,7 @@ import { import { AGENT_TUI_COMMAND_KEY_INTERVAL_MS, typeAgentTuiCommand -} from '../../../../shared/agent-tui-command-typing' +} from '../../../../shared/agent-launch/startup/agent-tui-command-typing' import { cancelNativeChatPtySends, enqueueNativeChatPtySend, diff --git a/src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts b/src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts index c4e486dd8fc..f0a96411b1f 100644 --- a/src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts +++ b/src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts @@ -8,7 +8,7 @@ import { LOCAL_COMMIT_MESSAGE_HOST_KEY } from '../../../../shared/commit-message-host-key' import { runtimeTargetForWorkspaceOwner } from '@/lib/resolve-owner' -import { hasExplicitTuiLaunchCommand } from '../../../../shared/tui-agent-launch-command-override' +import { hasExplicitTuiLaunchCommand } from '../../../../shared/agent-launch/startup/tui-agent-launch-command-override' import { getConnectionIdFromState } from '@/lib/connection-context' import { getLocalProjectExecutionRuntimeContext, diff --git a/src/renderer/src/components/native-chat/native-chat-view-types.ts b/src/renderer/src/components/native-chat/native-chat-view-types.ts index 9fc2b3b4ca2..99a98b0fa78 100644 --- a/src/renderer/src/components/native-chat/native-chat-view-types.ts +++ b/src/renderer/src/components/native-chat/native-chat-view-types.ts @@ -1,5 +1,5 @@ import type { AgentType } from '../../../../shared/agent-status-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target' import type { NativeChatSession } from '../../../../shared/native-chat/native-chat-types' import type { NativeChatContextMenuActions } from './use-native-chat-context-menu' diff --git a/src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts b/src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts index b014edb0029..73514981809 100644 --- a/src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts +++ b/src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts @@ -3,7 +3,7 @@ import { i18n } from '@/i18n/i18n' import type { AgentSessionConversationCommandResult } from '../../../../shared/agent-session/agent-session-conversation-command' import type { AgentSessionFailureFact } from '../../../../shared/agent-session/failures/agent-session-failure' import { agentSessionFailureWords } from '../../../../shared/agent-session/failures/agent-session-failure-words' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../../shared/tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../../shared/agent-launch/catalog/tui-agent-display-names' import { structuredAgentLabel } from '@/lib/agent-session/launch/structured-agent-session-launch-label' import { sendStructuredConversationCommand, diff --git a/src/renderer/src/components/native-chat/use-native-chat-hand-off.tsx b/src/renderer/src/components/native-chat/use-native-chat-hand-off.tsx index bf8a5fe1750..b4ad5fe9d51 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-hand-off.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-hand-off.tsx @@ -10,7 +10,7 @@ import { buildAgentSessionContinuationPrompt, type AgentSessionContinuationRequest } from '@/lib/agent-session-continuation' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { callStructuredAgentSession, supportsStructuredAgentSessionContinuationContext diff --git a/src/renderer/src/components/native-chat/use-native-chat-host-permission-gate.ts b/src/renderer/src/components/native-chat/use-native-chat-host-permission-gate.ts index 32c31e1103f..87b0a58014e 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-host-permission-gate.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-host-permission-gate.ts @@ -1,4 +1,4 @@ -import { newChatPermissionModeForSettings } from '../../../../shared/agent-chat-permission-mode' +import { newChatPermissionModeForSettings } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { translate } from '@/i18n/i18n' import { hostPermissionRefusedText } from '@/lib/agent-session/launch/structured-agent-session-launch-permission-notice' import { useStructuredChatHostPermissionVerdict } from '@/runtime/structured-chat-host-permission' diff --git a/src/renderer/src/components/native-chat/use-native-chat-session-context-actions.tsx b/src/renderer/src/components/native-chat/use-native-chat-session-context-actions.tsx index ff1dfb8f53b..278e6556b01 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-session-context-actions.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-session-context-actions.tsx @@ -3,7 +3,7 @@ import { toast } from 'sonner' import { executionHostIdForStructuredTarget } from '@/runtime/structured-agent-session-owner' import { translate } from '@/i18n/i18n' import { buildAgentSessionForkPrompt } from '@/lib/agent-session-fork-context' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import type { AgentType } from '../../../../shared/agent-status-types' import type { PreparedAgentSessionFork } from '../terminal-pane/terminal-agent-session-fork' import { copyAgentSessionContext } from '@/lib/copy-agent-session-context' diff --git a/src/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts b/src/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts index 47b9e3f7f4a..5a5a46e003e 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-structured-composer-send.ts @@ -2,7 +2,7 @@ import { serializeNativeChatAgentReferences } from './native-chat-agent-referenc import { mayHoldAgentReferences } from '../../../../shared/orchestration-agent-reference' import { getAgentLabel } from '@/lib/agent-catalog' import { formatAgentTypeLabel } from '../../../../shared/agent-type-label' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { MAX_SKILL_REFS } from '../../../../shared/rpc-contract/structured-agent-session-message-params' import { SkillRefLimitError } from '../../../../shared/agent-session/requests/structured-agent-session-send-mutation' import { promptSkillRefs } from './native-chat-prompt-document' diff --git a/src/renderer/src/components/native-chat/use-native-chat-terminal-draft-pickup.ts b/src/renderer/src/components/native-chat/use-native-chat-terminal-draft-pickup.ts index a8674c456b5..31e354e1ea5 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-terminal-draft-pickup.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-terminal-draft-pickup.ts @@ -1,10 +1,10 @@ import { useEffect, useRef } from 'react' import { useAppStore } from '../../store' import type { NativeChatLaunchDraft } from '@/lib/native-chat-launch-prompt' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import type { NativeChatLaunchSeed } from './native-chat-composer-types' -import { PASTED_CONTENT_PLACEHOLDER } from '../../../../shared/agent-prompt-injection' +import { PASTED_CONTENT_PLACEHOLDER } from '../../../../shared/agent-launch/startup/agent-prompt-injection' import { IMAGE_PROMPT_MARKER } from '../../../../shared/native-chat/transcript/native-chat-image-transcript-markers' import { canMirrorLaunchDraftToNativeChat } from '../../../../shared/native-chat/input/native-chat-launch-draft-mirrorability' diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts index 98f556a696c..c8490410b44 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts @@ -9,7 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore import type { AgentSessionOptionsResult } from '../../../../shared/agent-session/options/agent-session-options-result' import type { AgentType } from '../../../../shared/agent-status-types' import type { AgentSessionOptionCatalog } from '../../../../shared/agent-session/options/agent-session-option-catalog-types' -import { usesInstalledAgentModelCatalog } from '../../../../shared/agent-model-catalog-ownership' +import { usesInstalledAgentModelCatalog } from '../../../../shared/agent-session/options/agent-model-catalog-ownership' import { AGENT_SESSION_COHERENT_MODEL_CATALOG_CAPABILITY } from '../../../../shared/agent-session/structured-agent-session-surface-capabilities' import { structuredAgentSessionReportsAtFence, diff --git a/src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts b/src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts index ff066304a63..3c8116a07e8 100644 --- a/src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts +++ b/src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts @@ -1,4 +1,7 @@ -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { AgentComboboxSurfaceRows } from '@/components/agent/agent-combobox-surface-items' import type { ComposerAgentRows } from '@/hooks/composer-state/composer-agent-rows-target' import type RepoCombobox from '@/components/repo/RepoCombobox' @@ -20,7 +23,7 @@ import type { OrcaHooks, SetupAgentStartupPolicy } from '../../../../shared/orca import type { SparsePreset } from '../../../../shared/worktree/create-types' import type { SshConnectionStatus } from '../../../../shared/ssh-types' import type { TaskSourceContext } from '../../../../shared/task-source-context' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../../shared/execution-host' export type RepoOption = React.ComponentProps['repos'][number] diff --git a/src/renderer/src/components/onboarding/AgentStep.tsx b/src/renderer/src/components/onboarding/AgentStep.tsx index f31029f0d64..afa885b6174 100644 --- a/src/renderer/src/components/onboarding/AgentStep.tsx +++ b/src/renderer/src/components/onboarding/AgentStep.tsx @@ -6,7 +6,7 @@ import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import { Switch } from '@/components/ui/switch' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { i18n, translate } from '@/i18n/i18n' import { openAppHttpLink } from '@/lib/app-http-link-open' diff --git a/src/renderer/src/components/onboarding/agent-picked-payload.ts b/src/renderer/src/components/onboarding/agent-picked-payload.ts index fe50fc71405..9155646f7b8 100644 --- a/src/renderer/src/components/onboarding/agent-picked-payload.ts +++ b/src/renderer/src/components/onboarding/agent-picked-payload.ts @@ -4,7 +4,7 @@ import type { PathSource, ShellHydrationFailureReason } from '../../../../shared/shell-path-hydration-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type AgentPickedSnapshot = { agent: TuiAgent diff --git a/src/renderer/src/components/onboarding/onboarding-flow-state.ts b/src/renderer/src/components/onboarding/onboarding-flow-state.ts index c2765894ee0..a606192c1f2 100644 --- a/src/renderer/src/components/onboarding/onboarding-flow-state.ts +++ b/src/renderer/src/components/onboarding/onboarding-flow-state.ts @@ -8,7 +8,7 @@ import { import type { EventProps } from '../../../../shared/telemetry-events' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding-state-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { STEPS } from './use-onboarding-flow-types' type TaskSourcesSnapshotProps = EventProps<'onboarding_task_sources_snapshot'> diff --git a/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts b/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts index fc4241d0d1b..f9c36e76fee 100644 --- a/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts +++ b/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts @@ -1,5 +1,5 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type OnboardingSettingsHydrationUpdate = { settingsHydrated: boolean diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts b/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts index c581e6889ee..2ac4404f1a8 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts @@ -6,7 +6,7 @@ import { translate } from '@/i18n/i18n' import { ONBOARDING_FINAL_STEP } from '../../../../shared/onboarding-defaults' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding-state-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { buildWindowsTerminalSnapshotPayload } from './windows-terminal-onboarding-telemetry' import { persistStep, type PersistCurrentStepResult } from './use-onboarding-flow-persistence' import { STEPS, type StepNumber } from './use-onboarding-flow-types' diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts b/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts index 307e4946270..c224cd3adb9 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts @@ -8,9 +8,9 @@ import { import type { EventProps } from '../../../../shared/telemetry-events' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding-state-types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { applyAllAgentsPermission } from '../../../../shared/tui-agent-permission-choice' -import type { AgentChatPermissionMode } from '../../../../shared/agent-chat-permission-mode' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { applyAllAgentsPermission } from '../../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import type { AgentChatPermissionMode } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { StepId, StepNumber } from './use-onboarding-flow-types' export async function persistStep( diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow.ts b/src/renderer/src/components/onboarding/use-onboarding-flow.ts index c14b476d594..ac66fb3bdda 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow.ts @@ -8,7 +8,7 @@ import { track } from '@/lib/telemetry' import { buildAgentPickedPayload } from './agent-picked-payload' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding-state-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { STEPS } from './use-onboarding-flow-types' import { persistStep, useCloseWith, usePersistCurrentStep } from './use-onboarding-flow-persistence' import { resolveOnboardingSettingsHydration } from './onboarding-settings-hydration' diff --git a/src/renderer/src/components/orchestration-crew/CrewAgentIcons.tsx b/src/renderer/src/components/orchestration-crew/CrewAgentIcons.tsx index 0e2c1cd348a..b3004db69a3 100644 --- a/src/renderer/src/components/orchestration-crew/CrewAgentIcons.tsx +++ b/src/renderer/src/components/orchestration-crew/CrewAgentIcons.tsx @@ -11,7 +11,7 @@ import { type AgentMessageSenderInput } from '../native-chat/native-chat-agent-message-sender-view' import { isAgentStatusState } from '../../../../shared/agent-status-types' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { formatAgentTypeLabel } from '../../../../shared/agent-type-label' import { isOrcaSessionId, formatOrcaSessionAddress } from '../../../../shared/orca-session-address' import type { AgentMessageSenderView } from '../../../../shared/agent-session/agent-message-presentation' diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.picker.test.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.picker.test.tsx index e3b625981db..b47da07c25b 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.picker.test.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.picker.test.tsx @@ -9,10 +9,8 @@ import userEvent from '@testing-library/user-event' import { afterEach, expect, it, vi } from 'vitest' import { useAppStore } from '@/store' import { formatAgentTypeLabel } from '../../../../shared/agent-type-label' -import { - agentPickerChoiceSeeds, - type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +import { agentPickerChoiceSeeds } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { NewTabAgentMenuModel } from '../tab-bar/use-new-tab-agent-menu-rows' import { mountSourceDialog, @@ -20,9 +18,9 @@ import { } from './source-control-action-dialog.test-fixture' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { resolveSourceControlActionRecipe } from '../../../../shared/source-control-ai-operation-policy' -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../../../shared/tui-agent-startup' -import { tokenizeStartupCommand } from '../../../../shared/tui-agent-startup-shell' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-startup' +import { tokenizeStartupCommand } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import * as setupOwner from '../agent/agent-launch-picker-drafts' import * as optionRows from '../agent/agent-launch-setup-option-rows' diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.settings.test.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.settings.test.tsx index 1dfc7ea09a4..dd65720c21d 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.settings.test.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.settings.test.tsx @@ -4,10 +4,8 @@ import userEvent from '@testing-library/user-event' import { afterEach, expect, it, vi } from 'vitest' import { useAppStore } from '@/store' import { formatAgentTypeLabel } from '../../../../shared/agent-type-label' -import { - agentPickerChoiceSeeds, - type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +import { agentPickerChoiceSeeds } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { NewTabAgentMenuModel } from '../tab-bar/use-new-tab-agent-menu-rows' import { mountSourceDialog } from './source-control-action-dialog.test-fixture' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx index 39c1c1772ba..5531fc50807 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx @@ -9,7 +9,7 @@ import { getDefaultSettings } from '../../../../shared/constants' import type { SourceControlActionRecipe } from '../../../../shared/source-control-ai-actions' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' const mocks = vi.hoisted(() => ({ ensureDetectedAgents: vi.fn(), diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx index e3dd6a66655..715fdfbcfde 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx @@ -12,7 +12,7 @@ import type { SourceControlActionRecipe, SourceControlLaunchActionId } from '../../../../shared/source-control-ai-actions' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { RunSourceControlAgentActionStartArgs } from './runSourceControlAgentActionStart' import type { LaunchSource } from '../../../../shared/telemetry-events' import type { SourceControlAiWriteTarget } from '../../../../shared/source-control-ai-recipe-save' diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.test.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.test.tsx index 78e8f3bf6d0..233294dbd97 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.test.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.test.tsx @@ -1,4 +1,4 @@ -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { sourceControlActionRecipeEntry } from '../../../../shared/source-control-action-selection' import type { SourceControlActionRecipe } from '../../../../shared/source-control-ai-actions' import React, { type ReactNode } from 'react' diff --git a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx index 75af4464dd1..1006a14ed84 100644 --- a/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx +++ b/src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx @@ -1,4 +1,4 @@ -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react' import { canonicalSourceControlActionSelection, @@ -23,7 +23,7 @@ import type { SourceControlLaunchActionId } from '../../../../shared/source-cont import type { SourceControlAiWriteTarget } from '../../../../shared/source-control-ai-recipe-save' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { SourceControlActionVariableChips } from '../source-control/SourceControlActionVariableChips' import { sourceControlActionRecipeSaveMatchesTarget } from './source-control-action-recipe-match' import type { diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-cli-fork.ts b/src/renderer/src/components/right-sidebar/ai-vault-session-cli-fork.ts index 5d5db0de92f..81db1bbcfbc 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-cli-fork.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-cli-fork.ts @@ -2,7 +2,10 @@ import { compactIpcErrorMessage } from '@/lib/ipc-error' import { isAiVaultOwnershipRefusal } from '@/lib/ai-vault-resume-refusal' import { aiVaultCliForkHostTooOldMessage } from '@/lib/ai-vault-session-resume-preparation' import type { AiVaultSession } from '../../../../shared/ai-vault-types' -import { getAgentForkArgv, agentForksThroughChat } from '../../../../shared/agent-resume-argv' +import { + getAgentForkArgv, + agentForksThroughChat +} from '../../../../shared/agent-launch/startup/agent-resume-argv' import { isResumableTuiAgent } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import { getAiVaultAgentProviderSession } from '@/lib/ai-vault-resume-command' diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts b/src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts index d03dc4285d5..24e19318738 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts @@ -26,7 +26,7 @@ import { cliConversationExitGuidance } from '@/lib/cli-conversation-exit-guidanc import { structuredLaunchFailure } from '@/lib/agent-session/launch/structured-agent-session-launch-failure' import { workspaceHasSleepingAgentSessions } from '@/lib/worktree-agent-activation-gate' import { resolveWebSessionVisibleTabId } from '@/runtime/web-session-focus-intent' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { StructuredAgentLaunchSettlement } from '@/lib/structured-agent-launch-settlement' import type { NativeChatComposerFocusIntent } from '@/components/native-chat/use-native-chat-composer-reveal-focus' diff --git a/src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts b/src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts index fe1ed7ba83e..6c38479e081 100644 --- a/src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts +++ b/src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts @@ -2,7 +2,7 @@ import type { AgentLaunchPreferences } from '@/runtime/agent-launch-settings/hos import { checkSourceControlAgentActionLaunch } from '@/lib/source-control-agent-action-launch-check' import { useAppStore } from '@/store' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SourceControlAgentActionDeliveryPlanState } from './SourceControlAgentActionDialogForm' import { buildSourceControlAgentConnectionErrorPlan } from './source-control-agent-action-dialog-support' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/saved-action-delivery.test.tsx b/src/renderer/src/components/right-sidebar/checks-panel/saved-action-delivery.test.tsx index 76244460574..50913b9c420 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/saved-action-delivery.test.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/saved-action-delivery.test.tsx @@ -1,5 +1,5 @@ import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' -import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch/choices/agent-launch-settings' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { useChecksPanelCommentResolution } from './use-checks-panel-comment-resolution' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' diff --git a/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts b/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts index 630e83607fa..bc23b8c84e7 100644 --- a/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts +++ b/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts @@ -39,7 +39,7 @@ import { sourceControlActionLaunchOptions } from '../../../../shared/source-cont import { resolveAgentLaunchCommand, terminalSessionOptionInputs -} from '../../../../shared/tui-agent-launch-command' +} from '../../../../shared/agent-launch/startup/tui-agent-launch-command' import type { Repo } from '../../../../shared/repo-types' function buildArgs( diff --git a/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts b/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts index 69aa5b64218..205ca57fd6b 100644 --- a/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts +++ b/src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts @@ -10,7 +10,7 @@ import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id' import type { RuntimeGitContext } from '@/runtime/runtime-git-client-context' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchChoice } from '@/lib/agent-menu-selection' import type { LaunchSource } from '../../../../shared/telemetry-events' import { diff --git a/src/renderer/src/components/right-sidebar/source-control-action-dialog.test-fixture.tsx b/src/renderer/src/components/right-sidebar/source-control-action-dialog.test-fixture.tsx index 5f1f872240f..a965ceabbad 100644 --- a/src/renderer/src/components/right-sidebar/source-control-action-dialog.test-fixture.tsx +++ b/src/renderer/src/components/right-sidebar/source-control-action-dialog.test-fixture.tsx @@ -1,6 +1,6 @@ import { EVERY_AGENT_CHAT } from '../../../../shared/native-chat/every-agent-chat.test-fixture' -import { terminalSessionOptionInputs } from '../../../../shared/tui-agent-launch-command' -import { buildAgentStartupPlan } from '../../../../shared/tui-agent-startup' +import { terminalSessionOptionInputs } from '../../../../shared/agent-launch/startup/tui-agent-launch-command' +import { buildAgentStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-startup' import { resolveSourceControlActionRecipe } from '../../../../shared/source-control-ai-operation-policy' import { TooltipProvider } from '@/components/ui/tooltip' import { @@ -15,7 +15,7 @@ import { TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' import { getDefaultSettings } from '../../../../shared/constants' import { useAppStore } from '@/store' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' -import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY as SURFACE } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY as SURFACE } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY as CLIENT, STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY as CHAT diff --git a/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-result.ts b/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-result.ts index 88df442f2ea..c25faea0537 100644 --- a/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-result.ts +++ b/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-result.ts @@ -1,4 +1,7 @@ -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { CurrentActionSelection, SelectedSourceControlActionRecipe @@ -6,7 +9,7 @@ import type { import type { getAgentCatalog } from '@/lib/agent-catalog' import type { useAppStore } from '@/store' import type { useRepoById } from '@/store/selectors' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' import type { AgentComboboxSurfaceRows } from '@/components/agent/agent-combobox-surface-items' import type { SourceControlAgentActionDeliveryPlanState } from './SourceControlAgentActionDialogForm' diff --git a/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.ts b/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.ts index f45dc172642..bdf215d5c50 100644 --- a/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.ts +++ b/src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.ts @@ -1,8 +1,8 @@ import { useAppStore } from '@/store' import { ensureDetectedAgentsForWorktree } from '@/lib/agent-detection-target-inventory' import { getAgentCatalog } from '@/lib/agent-catalog' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../shared/tui-agent' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SourceControlAiWriteTarget } from '../../../../shared/source-control-ai-recipe-save' import { translate } from '@/i18n/i18n' import type { SourceControlAgentActionDeliveryPlanState } from './SourceControlAgentActionDialogForm' diff --git a/src/renderer/src/components/right-sidebar/source-control-fix-split-button.tsx b/src/renderer/src/components/right-sidebar/source-control-fix-split-button.tsx index 9879af5b5f1..3e4d9ef6f38 100644 --- a/src/renderer/src/components/right-sidebar/source-control-fix-split-button.tsx +++ b/src/renderer/src/components/right-sidebar/source-control-fix-split-button.tsx @@ -12,7 +12,7 @@ import type { SourceControlActionRecipe, SourceControlLaunchActionId } from '../../../../shared/source-control-ai-actions' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../shared/telemetry-events' import type { SourceControlAiWriteTarget } from '../../../../shared/source-control-ai-recipe-save' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.ts b/src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.ts index f7c3e896f32..0fb746670d9 100644 --- a/src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.ts +++ b/src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../../shared/execution-host' import { workspaceKindForWorktreeId, diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts index beef418620c..1a6a70c229f 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts @@ -7,7 +7,7 @@ import { import { toast } from 'sonner' import { type AppState, useAppStore } from '@/store' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { focusTerminalTabSurface } from '@/lib/focus-terminal-tab-surface' import { launchAgentInNewTab } from '@/lib/launch-agent-in-new-tab' import { settleAgentTabLaunch } from '@/lib/launch-agent-in-new-tab-host-agents' @@ -21,7 +21,7 @@ import { pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId } from '../../../../../../shared/source-control-launch-agent-selection' -import { isTuiAgentEnabled } from '../../../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../../../shared/agent-launch/catalog/tui-agent-selection' import { projectSelectedSourceControlActionLaunch, resolveSourceControlActionPreferredSurface diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-model-copy.ts b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-model-copy.ts index 048e5558e47..3f33a0569f5 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-model-copy.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-model-copy.ts @@ -3,7 +3,7 @@ import { getAgentSessionOptionCatalog } from '../../../../../../shared/agent-session/options/agent-session-option-catalog' import type { SourceControlActionLaunchPreferences } from '../../../../../../shared/source-control-ai-actions' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { sourceControlActionOptions, sourceControlActionPermissionModeRoute diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-dialog-form.tsx b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-dialog-form.tsx index da773e0c018..4e936f9410a 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-dialog-form.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-dialog-form.tsx @@ -24,7 +24,7 @@ import type { SourceControlTextActionId } from '../../../../../../shared/source- import type { SourceControlAiWriteTarget } from '../../../../../../shared/source-control-ai-recipe-save' import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import type { Repo } from '../../../../../../shared/repo-types' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { toast } from 'sonner' import { SourceControlActionVariableChips } from '../../../source-control/SourceControlActionVariableChips' import { sourceControlTextGenerationDefaultsMatchTarget } from './text-generation-defaults' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.operation-recovery.test.tsx b/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.operation-recovery.test.tsx index 0a3e9df8d10..145833c48ee 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.operation-recovery.test.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.operation-recovery.test.tsx @@ -2,7 +2,7 @@ import { sourceControlActionRecipeEntry } from '../../../../../../shared/source- import { runtimeStatusEntry } from '@/runtime/server-layout-frames.test-fixture' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' -import { projectAgentLaunchSettings } from '../../../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import { makeWorktree, TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { @@ -19,7 +19,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { useAppStore } from '@/store' import { getDefaultSettings } from '../../../../../../shared/constants' import type { GitConflictOperation } from '../../../../../../shared/git-status-types' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { useSourceControlAi } from './use-ai' import type { SourceControlAiControllerParams } from './controller-types' import { deferred } from '../../source-control-hook-test-harness' diff --git a/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts b/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts index aca9e0ca192..133f8897091 100644 --- a/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts +++ b/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts @@ -1,6 +1,6 @@ import { pickSourceControlLaunchAgent } from '../../../../../../shared/source-control-launch-agent-selection' import type { GitConflictOperation } from '../../../../../../shared/git-status-types' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' export function shouldRenderCommitArea( unresolvedConflictCount: number, diff --git a/src/renderer/src/components/right-sidebar/use-saved-source-control-action-start.ts b/src/renderer/src/components/right-sidebar/use-saved-source-control-action-start.ts index 304bc81d377..cdd386eef8d 100644 --- a/src/renderer/src/components/right-sidebar/use-saved-source-control-action-start.ts +++ b/src/renderer/src/components/right-sidebar/use-saved-source-control-action-start.ts @@ -17,7 +17,7 @@ import { useRef, useState } from 'react' import { toast } from 'sonner' import { useAppStore } from '@/store' import { ensureDetectedAgentsForWorktree } from '@/lib/agent-detection-target-inventory' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { projectSelectedSourceControlActionLaunch } from '../../../../shared/source-control-action-launch-preferences' import { sourceControlLaunchAppliesAgentArgs } from './source-control-launch-agent-args-applicability' import { buildSourceControlAgentDeliveryPlan } from './buildSourceControlAgentDeliveryPlan' diff --git a/src/renderer/src/components/right-sidebar/use-source-control-action-agent-choice.ts b/src/renderer/src/components/right-sidebar/use-source-control-action-agent-choice.ts index 2c08c792b57..4b6e5f4ab20 100644 --- a/src/renderer/src/components/right-sidebar/use-source-control-action-agent-choice.ts +++ b/src/renderer/src/components/right-sidebar/use-source-control-action-agent-choice.ts @@ -2,15 +2,15 @@ import { buildAgentLaunchRouteInput, workspaceKindForWorktreeId } from '@/lib/agent-launch-route-input' -import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { useMemo } from 'react' import { useAppStore } from '@/store' import { isCustomAgentId } from '../../../../shared/commit-message-agent-spec' import { pickSourceControlLaunchAgent } from '../../../../shared/source-control-launch-agent-selection' import type { SelectedSourceControlActionRecipe } from '../../../../shared/source-control-action-selection' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getAgentCatalog } from '@/lib/agent-catalog' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' import { useAgentDetectionTargetForWorktree } from '@/hooks/useAgentDetectionTarget' diff --git a/src/renderer/src/components/right-sidebar/use-source-control-launchable-agents.ts b/src/renderer/src/components/right-sidebar/use-source-control-launchable-agents.ts index af0eb7a2ae7..4af1fed0796 100644 --- a/src/renderer/src/components/right-sidebar/use-source-control-launchable-agents.ts +++ b/src/renderer/src/components/right-sidebar/use-source-control-launchable-agents.ts @@ -5,7 +5,7 @@ import { readAgentInventoryForWorktree, readAgentInventoryForTarget } from '@/lib/agent-detection-target-inventory' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { sourceControlLaunchWorkspace } from './source-control-launch-agent-args-applicability' import { acquireAgentLaunchChoices, useChatProgramFacts } from '@/lib/host-chat-program-acquisition' import { agentsOfferedForLaunch } from '@/lib/host-chat-program' diff --git a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.test.tsx b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.test.tsx index cfe37b8ae13..50021a57cd1 100644 --- a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.test.tsx +++ b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.test.tsx @@ -13,7 +13,7 @@ import { projectSourceControlActionLaunch } from '../../../../shared/source-cont import { structuredLaunchRequestedOptions } from '../../../../shared/native-chat/input/native-chat-session-option-defaults' import { liftActionPermissionArgs } from '../../../../shared/source-control-action-permission-lift' import type { Repo } from '../../../../shared/repo-types' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import { makeWorktree, TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' import { clearHostAgentMenuSettingsForTests } from '../../runtime/agent-launch-settings/host-agent-launch-preferences-resource' diff --git a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts index c20dbae0eb2..1cf8dc013c7 100644 --- a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts +++ b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts @@ -1,4 +1,7 @@ -import type { AgentPickerDraft, AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { applySourceControlPickerDraft } from '../../lib/source-control-agent-launch-picker' import { canonicalSourceControlActionSelection, @@ -14,7 +17,7 @@ import { resolveSourceControlLaunchAgentScope } from '../../../../shared/source- import { useAppStore } from '@/store' import { useRepoById } from '@/store/selectors' import { renderSourceControlActionCommandTemplate } from '../../../../shared/source-control-ai-actions' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' import { savedSurfaceForPick } from '@/lib/source-control-agent-picker' import type { SourceControlAgentActionDialogProps } from './SourceControlAgentActionDialog' diff --git a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts index 1b03c5efbaa..b64b6842a5a 100644 --- a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts +++ b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts @@ -11,7 +11,7 @@ import type { import type { SourceControlAiWriteTarget } from '../../../../shared/source-control-ai-recipe-save' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchChoice } from '@/lib/agent-menu-selection' import { buildSourceControlAgentDeliveryPlan } from './buildSourceControlAgentDeliveryPlan' import type { SourceControlAgentActionDeliveryPlanState } from './SourceControlAgentActionDialogForm' diff --git a/src/renderer/src/components/settings/SourceControlTextActionAgentPicker.tsx b/src/renderer/src/components/settings/SourceControlTextActionAgentPicker.tsx index 052e2a7163d..e8c8410a7ad 100644 --- a/src/renderer/src/components/settings/SourceControlTextActionAgentPicker.tsx +++ b/src/renderer/src/components/settings/SourceControlTextActionAgentPicker.tsx @@ -45,12 +45,12 @@ import { agentPickerEffectiveChoices, type AgentPickerEntry, type AgentPickerDraft -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { SourceControlActionAgentPicker } from './source-control/SourceControlActionAgentPicker' import { getAgentCatalogForAction } from './source-control/source-control-action-recipe-options' import { DropdownMenuItem } from '../ui/dropdown-menu' import type { ActionRecipeDraftValue } from './source-control/source-control-ai-action-recipe-draft' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' type TextModelChange = ( choice: SourceControlAiModelChoice | undefined, diff --git a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts index 5e5836a475b..1463f7e2600 100644 --- a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts +++ b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts @@ -11,7 +11,7 @@ import { agentLaunchSettingsMutationUpdates, projectAgentLaunchSettings, type AgentLaunchSettingsMutation -} from '../../../../../shared/agent-launch-settings' +} from '../../../../../shared/agent-launch/choices/agent-launch-settings' const originalState = useAppStore.getState() const originalApi = window.api diff --git a/src/renderer/src/components/settings/agents/AgentsPane.test.tsx b/src/renderer/src/components/settings/agents/AgentsPane.test.tsx index f7735b2e307..9d9033a28c8 100644 --- a/src/renderer/src/components/settings/agents/AgentsPane.test.tsx +++ b/src/renderer/src/components/settings/agents/AgentsPane.test.tsx @@ -3,7 +3,7 @@ import { renderToStaticMarkup } from 'react-dom/server' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { getDefaultSettings } from '../../../../../shared/constants' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { AGENT_CATALOG } from '@/lib/agent-catalog' import { useAppStore } from '../../../store/index' import { getAgentGeneratedTabTitlesTitle } from './behavior/agent-generated-tab-title-copy' @@ -30,7 +30,7 @@ import { AgentsPane } from './AgentsPane' import { getAgentsPaneSearchEntries } from './agents-search' -import { buildAgentAvailabilitySettingsUpdate } from '../../../../../shared/tui-agent-selection' +import { buildAgentAvailabilitySettingsUpdate } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' import { createAgentAvailabilityUpdateQueue } from '../../../lib/agent-session/launch/agent-settings-update-queue' import { matchesSettingsSearch } from '../search/settings-search' import { TooltipProvider } from '../../ui/tooltip' diff --git a/src/renderer/src/components/settings/agents/launch/AgentCatalogRow.tsx b/src/renderer/src/components/settings/agents/launch/AgentCatalogRow.tsx index db44fa4d3ed..6849dfc17f1 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentCatalogRow.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentCatalogRow.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from 'react' import { Check, ChevronDown, ExternalLink } from 'lucide-react' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { AgentIcon } from '@/lib/agent-catalog' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' @@ -11,9 +11,9 @@ import { type AgentSessionSourceHomeControl, AgentSessionSourceHomeInput } from '../../../agent/launch-settings/codex-session-source-home-control' -import { resolveTuiAgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import { resolveTuiAgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { stringifyAgentDefaultEnvDraft } from '../../../agent/launch-settings/agent-default-env-draft' -import { liftAgentPermissionArgs } from '../../../../../../shared/tui-agent-permission-lift' +import { liftAgentPermissionArgs } from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-lift' import { AgentPermissionExceptionBadge, AgentRowPermissionControl, diff --git a/src/renderer/src/components/settings/agents/launch/AgentDefaultSetting.tsx b/src/renderer/src/components/settings/agents/launch/AgentDefaultSetting.tsx index c269e578f6f..00da1e28370 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentDefaultSetting.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentDefaultSetting.tsx @@ -1,5 +1,5 @@ import { Check } from 'lucide-react' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { type AgentCatalogEntry, AgentIcon } from '@/lib/agent-catalog' import { cn } from '@/lib/utils' diff --git a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx index 531e9dca681..8c95e5ec927 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx @@ -1,16 +1,16 @@ import { AgentLaunchChoiceEditor } from '../../../agent/launch-settings/AgentLaunchChoiceEditor' -import { agentChatPermissionModes } from '../../../../../../shared/agent-chat-permission-support' -import { savedChatPermissionMode } from '../../../../../../shared/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../../../../shared/agent-launch/permissions/agent-chat-permission-support' +import { savedChatPermissionMode } from '../../../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { useChatProgramFacts } from '@/lib/host-chat-program-acquisition' import { useMemo } from 'react' import { toast } from 'sonner' import type { AgentLaunchSettings, AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import type { GlobalSettings } from '../../../../../../shared/global-settings-types' -import { AUTO_TUI_AGENT_ARGS } from '../../../../../../shared/tui-agent-permissions' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import { AUTO_TUI_AGENT_ARGS } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { agentPermissionArgs, agentPermissionEnv, @@ -18,9 +18,9 @@ import { PERMISSION_CHOICE_AGENTS, resolveAgentPermission, type AgentPermissionSettings -} from '../../../../../../shared/tui-agent-permission-choice' -import { agentArgsSetPermission } from '../../../../../../shared/agent-permission-args' -import { liftAgentPermissionArgs } from '../../../../../../shared/tui-agent-permission-lift' +} from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import { agentArgsSetPermission } from '../../../../../../shared/agent-launch/permissions/agent-permission-args' +import { liftAgentPermissionArgs } from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-lift' import { agentPermissionChoiceLabel, AllAgentsPermissionSetting, @@ -36,8 +36,8 @@ import { getTuiAgentDefaultEnv, resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../../../../../shared/tui-agent-launch-defaults' -import { isTuiAgentEnabled } from '../../../../../../shared/tui-agent-selection' +} from '../../../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { isTuiAgentEnabled } from '../../../../../../shared/agent-launch/catalog/tui-agent-selection' import { getAgentCatalog } from '@/lib/agent-catalog' import { agentChoiceOpensAsChat, diff --git a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx index 6819abadab2..2332c891074 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx @@ -1,15 +1,15 @@ import { useChatSettingsOwnPermissions } from '@/runtime/structured-agent-session-host-capability' import { toast } from 'sonner' import { getAgentLabel } from '@/lib/agent-catalog' -import type { TuiAgent } from '../../../../../../shared/tui-agent' -import { wholeAgentEnvironmentUpdates } from '../../../../../../shared/agent-launch-permission-updates' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' +import { wholeAgentEnvironmentUpdates } from '../../../../../../shared/agent-launch/choices/agent-launch-permission-updates' import { useRef } from 'react' import { useAppStore } from '@/store/index' import { agentLaunchSettingsMutationUpdates, projectAgentLaunchSettings, type AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { AgentLaunchSettingsCatalog, diff --git a/src/renderer/src/components/settings/agents/launch/HostAgentEnvironmentEditor.tsx b/src/renderer/src/components/settings/agents/launch/HostAgentEnvironmentEditor.tsx index a9414b355fb..115ce6d48d5 100644 --- a/src/renderer/src/components/settings/agents/launch/HostAgentEnvironmentEditor.tsx +++ b/src/renderer/src/components/settings/agents/launch/HostAgentEnvironmentEditor.tsx @@ -2,8 +2,8 @@ import { useState } from 'react' import { Button } from '../../../ui/button' import { Input } from '../../../ui/input' import { translate } from '@/i18n/i18n' -import type { AgentLaunchSettingsMutation } from '../../../../../../shared/agent-launch-settings' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { AgentLaunchSettingsMutation } from '../../../../../../shared/agent-launch/choices/agent-launch-settings' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { useAgentLaunchFieldWrite } from '../../../agent/launch-settings/use-agent-launch-field-write' export function HostAgentEnvironmentEditor({ diff --git a/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.test.tsx b/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.test.tsx index 9281b95b2b5..29f88fcf7ae 100644 --- a/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.test.tsx +++ b/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.test.tsx @@ -10,17 +10,17 @@ import { projectAgentLaunchSettings, type AgentLaunchSettings, type AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import { HostAgentLaunchSettings } from './HostAgentLaunchSettings' import * as permissionControls from '../../../agent/launch-settings/AgentPermissionChoiceControls' import { SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' -import type { AgentPermissionChoice } from '../../../../../../shared/tui-agent-permission-choice' +import type { AgentPermissionChoice } from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { TooltipProvider } from '../../../ui/tooltip' import type { AgentPermissionsRenderer } from './AgentLaunchSettingsCatalog' import { AgentPermissionsSetting } from '../permissions/AgentPermissionsSetting' import { AgentsPane } from '../AgentsPane' import { useAppStore } from '@/store/index' -import { applyAgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import { applyAgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { createGlobalSettingsFixture } from '../../../../../../shared/global-settings-test-fixture' vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn(), dismiss: vi.fn() } })) diff --git a/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.tsx b/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.tsx index 675507dac37..14045aa55d9 100644 --- a/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.tsx +++ b/src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import type { AgentLaunchSettings, AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import { type AgentPermissionsRenderer, AgentLaunchSettingsCatalog diff --git a/src/renderer/src/components/settings/agents/permissions/AgentPermissionModeMenu.tsx b/src/renderer/src/components/settings/agents/permissions/AgentPermissionModeMenu.tsx index 36b3e9f2e71..308456bf15f 100644 --- a/src/renderer/src/components/settings/agents/permissions/AgentPermissionModeMenu.tsx +++ b/src/renderer/src/components/settings/agents/permissions/AgentPermissionModeMenu.tsx @@ -1,5 +1,5 @@ import { ChevronDown } from 'lucide-react' -import type { AgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import type { AgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { translate } from '@/i18n/i18n' import { Button } from '../../../ui/button' import { diff --git a/src/renderer/src/components/settings/agents/permissions/AgentPermissionsSetting.tsx b/src/renderer/src/components/settings/agents/permissions/AgentPermissionsSetting.tsx index 9720eb20778..822ebdd933d 100644 --- a/src/renderer/src/components/settings/agents/permissions/AgentPermissionsSetting.tsx +++ b/src/renderer/src/components/settings/agents/permissions/AgentPermissionsSetting.tsx @@ -1,5 +1,5 @@ import { Trans } from 'react-i18next' -import type { AgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import type { AgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { getIntlLocale, i18n, translate } from '@/i18n/i18n' import { cn } from '@/lib/utils' import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' diff --git a/src/renderer/src/components/settings/agents/permissions/AgentRowPermissions.tsx b/src/renderer/src/components/settings/agents/permissions/AgentRowPermissions.tsx index 92b401c1fd4..959549fe1b4 100644 --- a/src/renderer/src/components/settings/agents/permissions/AgentRowPermissions.tsx +++ b/src/renderer/src/components/settings/agents/permissions/AgentRowPermissions.tsx @@ -1,4 +1,4 @@ -import type { AgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import type { AgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { translate } from '@/i18n/i18n' import { Button } from '../../../ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' diff --git a/src/renderer/src/components/settings/agents/permissions/agent-permission-baseline.ts b/src/renderer/src/components/settings/agents/permissions/agent-permission-baseline.ts index a60cfbd3321..bf02a47b2fe 100644 --- a/src/renderer/src/components/settings/agents/permissions/agent-permission-baseline.ts +++ b/src/renderer/src/components/settings/agents/permissions/agent-permission-baseline.ts @@ -1,8 +1,8 @@ -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { AUTO_TUI_AGENT_ARGS, type AgentPermissionMode -} from '../../../../../../shared/tui-agent-permissions' +} from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' type PresetMode = Exclude diff --git a/src/renderer/src/components/settings/agents/permissions/agent-permission-conversion-persistence.test.tsx b/src/renderer/src/components/settings/agents/permissions/agent-permission-conversion-persistence.test.tsx index 88fcf4de627..db50de98786 100644 --- a/src/renderer/src/components/settings/agents/permissions/agent-permission-conversion-persistence.test.tsx +++ b/src/renderer/src/components/settings/agents/permissions/agent-permission-conversion-persistence.test.tsx @@ -1,5 +1,5 @@ -import * as updatesModule from '../../../../../../shared/agent-launch-permission-updates' -import * as liftModule from '../../../../../../shared/tui-agent-permission-lift' +import * as updatesModule from '../../../../../../shared/agent-launch/choices/agent-launch-permission-updates' +import * as liftModule from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-lift' import * as envDraftModule from '../../../agent/launch-settings/agent-default-env-draft' // @vitest-environment happy-dom import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react' @@ -16,7 +16,7 @@ import { measureSettingsWork, expectSettingsWorkScale } from '../../../../../../shared/global-settings-test-fixture' -import { resolveTuiAgentLaunchArgs } from '../../../../../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchArgs } from '../../../../../../shared/agent-launch/choices/tui-agent-launch-defaults' vi.mock('sonner', () => ({ toast: { error: vi.fn(), success: vi.fn(), info: vi.fn(), dismiss: vi.fn() } diff --git a/src/renderer/src/components/settings/agents/permissions/agent-permission-mode-label.ts b/src/renderer/src/components/settings/agents/permissions/agent-permission-mode-label.ts index 85599089129..ecc5b117dda 100644 --- a/src/renderer/src/components/settings/agents/permissions/agent-permission-mode-label.ts +++ b/src/renderer/src/components/settings/agents/permissions/agent-permission-mode-label.ts @@ -1,4 +1,4 @@ -import type { AgentPermissionMode } from '../../../../../../shared/tui-agent-permissions' +import type { AgentPermissionMode } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { agentPermissionChoiceLabel } from '../../../agent/launch-settings/AgentPermissionChoiceControls' export function agentPermissionModeChoice(mode: Exclude) { diff --git a/src/renderer/src/components/settings/agents/permissions/agent-permission-override-notice.tsx b/src/renderer/src/components/settings/agents/permissions/agent-permission-override-notice.tsx index 957b7c3ac74..87118f2d066 100644 --- a/src/renderer/src/components/settings/agents/permissions/agent-permission-override-notice.tsx +++ b/src/renderer/src/components/settings/agents/permissions/agent-permission-override-notice.tsx @@ -6,13 +6,13 @@ import { useMountedRef } from '@/hooks/useMountedRef' import type { AgentLaunchSettings, AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import { agentPermissionChoices, PERMISSION_CHOICE_AGENTS, type AgentPermissionChoice -} from '../../../../../../shared/tui-agent-permission-choice' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +} from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { nativeChatPermissionModeLabel } from '../../../native-chat/native-chat-permission-mode-labels' type Permissions = diff --git a/src/renderer/src/components/settings/agents/permissions/agent-row-permission-model.ts b/src/renderer/src/components/settings/agents/permissions/agent-row-permission-model.ts index a851e3b1107..06e3549765d 100644 --- a/src/renderer/src/components/settings/agents/permissions/agent-row-permission-model.ts +++ b/src/renderer/src/components/settings/agents/permissions/agent-row-permission-model.ts @@ -1,20 +1,20 @@ -import type { AgentPermissionChoice } from '../../../../../../shared/tui-agent-permission-choice' +import type { AgentPermissionChoice } from '../../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import type { AgentLaunchSettings, AgentLaunchSettingsMutation -} from '../../../../../../shared/agent-launch-settings' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +} from '../../../../../../shared/agent-launch/choices/agent-launch-settings' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../../../../../shared/tui-agent-launch-defaults' +} from '../../../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { AUTO_TUI_AGENT_ARGS, hasConfigurableTuiAgentPermissions, resolveTuiAgentPermissionMode, YOLO_TUI_AGENT_ARGS, type AgentPermissionMode -} from '../../../../../../shared/tui-agent-permissions' +} from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import { buildAgentPermissionBaseline, majorityPermissionMode } from './agent-permission-baseline' import type { AgentRowPermission } from './AgentRowPermissions' diff --git a/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx index 05bf1fa2802..8ce903ca9ef 100644 --- a/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx @@ -11,7 +11,7 @@ import { setSourceControlActionDefault } from '../../../../../shared/source-control-ai-actions' import { CUSTOM_AGENT_ID } from '../../../../../shared/commit-message-agent-spec' -import { isTuiAgent } from '../../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { getAgentLabel } from '@/lib/agent-catalog' import { translate } from '@/i18n/i18n' import { Switch } from '../../ui/switch' diff --git a/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx b/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx index e9e024a91d9..e9247c25c05 100644 --- a/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx @@ -37,7 +37,7 @@ vi.mock('../../../store/index', () => ({ ) => selector({ settingsSearchQuery: '', runtimeEnvironments: mocks.environments }) })) import { mutateHostAgentLaunchSettings } from '../../../runtime/agent-launch-settings/agent-launch-settings-transport' -import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch/choices/agent-launch-settings' beforeEach(() => { mocks.web = false mocks.capability = 'unsupported' diff --git a/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx index b5cc56abcc1..0354784445a 100644 --- a/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx @@ -3,10 +3,10 @@ import type { GlobalSettings } from '../../../../../shared/global-settings-types import { AGENT_CHAT_PERMISSION_MODES, newChatPermissionModeForSettings -} from '../../../../../shared/agent-chat-permission-mode' -import { agentChatPermissionModes } from '../../../../../shared/agent-chat-permission-support' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../../../shared/tui-agent-display-names' -import { PERMISSION_CHOICE_AGENTS } from '../../../../../shared/tui-agent-permission-choice' +} from '../../../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../../../shared/agent-launch/permissions/agent-chat-permission-support' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../../../shared/agent-launch/catalog/tui-agent-display-names' +import { PERMISSION_CHOICE_AGENTS } from '../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { useAppStore } from '@/store/index' import { Button } from '../../ui/button' import { NativeChatPermissionModePicker } from '../../native-chat/NativeChatPermissionModePicker' diff --git a/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts index 25c64453428..bf47fabe1ac 100644 --- a/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts +++ b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { AgentLaunchSettings } from '../../../../../shared/agent-launch-settings' +import type { AgentLaunchSettings } from '../../../../../shared/agent-launch/choices/agent-launch-settings' import { isWebClientLocation } from '@/lib/web-client-location' import { useAppStore } from '@/store/index' import { useStructuredAgentSessionOwnPermissionState } from '@/runtime/structured-agent-session-host-capability' diff --git a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiActionRows.tsx b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiActionRows.tsx index ee813fa1b35..3686a4fb61c 100644 --- a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiActionRows.tsx +++ b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiActionRows.tsx @@ -54,7 +54,7 @@ import { getRepositorySourceControlAiActionRecipeSectionId } from '../repository import { translate } from '@/i18n/i18n' import { SourceControlActionOptionField } from '../../../agent/launch-settings/AgentChoiceOptionField' import { pickSourceControlLaunchAgent } from '../../../../../../shared/source-control-launch-agent-selection' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { captureSourceControlActionSelection } from '../../../../../../shared/source-control-ai-operation-policy' export function RepositorySourceControlAiActionRows( diff --git a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.test.ts b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.test.ts index bd97f9e2c7f..b9add2f296e 100644 --- a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.test.ts +++ b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.test.ts @@ -10,7 +10,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { act, render, cleanup, fireEvent, screen, within, waitFor } from '@testing-library/react' import { pickerLocaleFixture } from '../../__fixtures__/settings-persistence-test-fixture' import React from 'react' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { createRepoActionTextDraftEditors } from './repository-source-control-ai-text-draft' import type { RepoSourceControlAiOverrides } from '../../../../../../shared/source-control-ai-types' import { setSourceControlActionAgentDefault } from '../../../../../../shared/source-control-ai-actions' @@ -31,15 +31,15 @@ import { useAppStore } from '../../../../store/index' import { TooltipProvider } from '../../../ui/tooltip' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { projectSourceControlActionLaunch } from '../../../../../../shared/source-control-action-launch-preferences' -import { projectAgentLaunchSettings } from '../../../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../../../shared/agent-launch/choices/agent-launch-settings' import { TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' import { clearHostAgentMenuSettingsForTests } from '../../../../runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { mutateHostAgentLaunchSettings } from '../../../../runtime/agent-launch-settings/agent-launch-settings-transport' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' import { resetHostStructuredAgentsForTests } from '@/runtime/host-structured-agents' -import { resolveAgentStartupPlanInputs } from '../../../../../../shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../../../../../shared/tui-agent-startup' -import { tokenizeStartupCommand } from '../../../../../../shared/tui-agent-startup-shell' +import { resolveAgentStartupPlanInputs } from '../../../../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../../../../../shared/agent-launch/startup/tui-agent-startup' +import { tokenizeStartupCommand } from '../../../../../../shared/agent-launch/startup/tui-agent-startup-shell' const rpc = vi.hoisted(() => vi.fn()) vi.mock('@/runtime/runtime-rpc-client', () => ({ callRuntimeRpc: rpc, diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-rows-props.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-rows-props.ts index d4f5b29b3aa..55900c793a1 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-rows-props.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-rows-props.ts @@ -1,6 +1,6 @@ import type { SourceControlAiModelEdits } from '../../../../../../shared/source-control-ai-action-model-edits' import type { ActionArgumentChoices } from '../../../../../../shared/source-control-action-argument-choices' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { RepoSourceControlAiOverrides, SourceControlAiModelChoice, diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux.ts index a6f29c2bdc1..faef7cbdf17 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux.ts @@ -1,7 +1,7 @@ import { liftActionPermissionArgs } from '../../../../../../shared/source-control-action-permission-lift' import { useEffect, useMemo, useRef, useState } from 'react' import type { GlobalSettings } from '../../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { CUSTOM_AGENT_ID } from '../../../../../../shared/commit-message-agent-spec' import type { RepoSourceControlAiOverrides, diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-labels.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-labels.ts index d826bea8e2b..c20d04cff73 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-labels.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-labels.ts @@ -6,7 +6,7 @@ import { sourceControlActionSelectedPreferences, sourceControlActionExecutionArgs } from '../../../../../../shared/source-control-action-launch-preferences' -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { readActionModelSelection } from '../../../../../../shared/source-control-action-model-selection' import { DEFAULT_SOURCE_CONTROL_ACTION_COMMAND_TEMPLATES, diff --git a/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts index 6c533e83f94..df43840f64f 100644 --- a/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts @@ -8,7 +8,7 @@ import type { import { ALL_TUI_AGENTS, TUI_AGENT_DISPLAY_NAMES -} from '../../../../../shared/tui-agent-display-names' +} from '../../../../../shared/agent-launch/catalog/tui-agent-display-names' import { translate } from '@/i18n/i18n' import { uniqueKeywords } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts b/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts index 813a3d16c32..e328d6c376f 100644 --- a/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts @@ -11,7 +11,7 @@ import { findMacSystemHotkeyConflicts, type MacCapturedDigitChord } from '../../../../../shared/macos-symbolic-hotkeys' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ActivePluginCommand } from '@/store/plugin-panels' import { buildPluginCommandKeybindingDefinitions } from '@/lib/plugin-command-keybindings' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts b/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts index 68098110e57..ba6479e55d9 100644 --- a/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts @@ -6,8 +6,8 @@ import type { KeybindingActionId, KeybindingDefinition } from '../../../../../shared/keybindings/types' -import { normalizeDisabledTuiAgents } from '../../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import { normalizeDisabledTuiAgents } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { localizeKeybindingDefinition } from './keybinding-title-copy' export type ShortcutGroup = { diff --git a/src/renderer/src/components/settings/source-control-text-action-picker-entries.ts b/src/renderer/src/components/settings/source-control-text-action-picker-entries.ts index 7b39be54ab7..c9ff789f913 100644 --- a/src/renderer/src/components/settings/source-control-text-action-picker-entries.ts +++ b/src/renderer/src/components/settings/source-control-text-action-picker-entries.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { getCommitMessageAgentSpec } from '../../../../shared/commit-message-agent-spec' import { removeSourceControlAiArgumentFlag } from '../../../../shared/source-control-ai-argument-flags' diff --git a/src/renderer/src/components/settings/source-control-text-action-picker-save.ts b/src/renderer/src/components/settings/source-control-text-action-picker-save.ts index 1f5cdb3ea74..4a23c3be903 100644 --- a/src/renderer/src/components/settings/source-control-text-action-picker-save.ts +++ b/src/renderer/src/components/settings/source-control-text-action-picker-save.ts @@ -2,14 +2,14 @@ import { agentPickerEffectiveChoices, type AgentPickerEntry, type AgentPickerDraft -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import { saveSourceControlAiActionModelChoice } from '../../../../shared/source-control-ai-action-model-choice' import { addSourceControlAiModelEdit, type SourceControlAiModelEdit, type SourceControlAiModelEdits } from '../../../../shared/source-control-ai-action-model-edits' -import { textActionArgumentsOwnEffort } from '../../../../shared/source-control-text-action-picker' +import { textActionArgumentsOwnEffort } from '../../../../shared/agent-launch/picker/agent-launch-picker-text-action' import type { AiTextOperation, SourceControlAiSettings, diff --git a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.test.tsx b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.test.tsx index fb350fbcdc9..ec3af72775a 100644 --- a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.test.tsx +++ b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.test.tsx @@ -3,7 +3,7 @@ import React from 'react' import recordings from '../../../../../shared/fixtures/source-control-launch-recordings.json' import { normalizeSourceControlActionLaunchPreferences } from '../../../../../shared/source-control-action-model-selection' import { sourceControlActionLaunchOptions } from '../../../../../shared/source-control-action-launch-preferences' -import { buildAgentStartupPlan } from '../../../../../shared/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../../../shared/agent-launch/startup/tui-agent-startup' import { describeSourceControlActionModel } from '../../right-sidebar/source-control/ai/source-control-action-model-copy' import { renderToStaticMarkup } from 'react-dom/server' import { cleanup, render } from '@testing-library/react' diff --git a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx index 48e35c686e5..6a5c96cfef5 100644 --- a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx +++ b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx @@ -2,7 +2,7 @@ import { useRef } from 'react' import type React from 'react' import type { GlobalSettings } from '../../../../../shared/global-settings-types' import type { RuntimeClientTarget } from '../../../../../shared/runtime-client-target' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { SourceControlAiSettingsPatch, SourceControlAiSettings diff --git a/src/renderer/src/components/settings/source-control/SourceControlActionAgentPicker.tsx b/src/renderer/src/components/settings/source-control/SourceControlActionAgentPicker.tsx index b61fb214670..c24b8d2f539 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlActionAgentPicker.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlActionAgentPicker.tsx @@ -22,9 +22,9 @@ import { type SourceControlAgentRows } from '@/lib/source-control-agent-picker' import { buildAgentLaunchRouteInput } from '@/lib/agent-launch-route-input' -import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY } from '../../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY } from '../../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import type { SourceControlActionRecipe } from '../../../../../shared/source-control-ai-actions' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' /** The shared surface rows configure a recipe here; they never start an agent. */ diff --git a/src/renderer/src/components/settings/source-control/SourceControlActionArguments.tsx b/src/renderer/src/components/settings/source-control/SourceControlActionArguments.tsx index 645266b53b2..3b10f90609d 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlActionArguments.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlActionArguments.tsx @@ -1,4 +1,4 @@ -import { resolveAgentChoiceLayers } from '../../../../../shared/agent-choice-layers' +import { resolveAgentChoiceLayers } from '../../../../../shared/agent-launch/choices/agent-choice-layers' import { findCatalogModel, getAgentSessionOptionLaunchCatalog @@ -13,17 +13,17 @@ import { agentPermissionArgs, agentPermissionChoices, resolveAgentPermission -} from '../../../../../shared/tui-agent-permission-choice' -import { agentArgsSetPermission } from '../../../../../shared/agent-permission-args' +} from '../../../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import { agentArgsSetPermission } from '../../../../../shared/agent-launch/permissions/agent-permission-args' import { editActionArgumentChoices } from '../../../../../shared/source-control-action-argument-choices' import type { ActionArgumentChoices } from '../../../../../shared/source-control-action-argument-document' import type { AgentChoicePatch, AgentLaunchChoices -} from '../../../../../shared/agent-launch-choices' +} from '../../../../../shared/agent-launch/choices/agent-launch-choices' import { SourceControlActionModelPicker } from './SourceControlActionModelPicker' import { AGENT_CATALOG } from '@/lib/agent-catalog' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { useAppStore } from '@/store/index' import { translate } from '@/i18n/i18n' import { AgentDefaultArgsInput } from '../../agent/launch-settings/AgentLaunchDefaultsEditor' diff --git a/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx b/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx index e72c6fe4140..de5146c01de 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx @@ -13,7 +13,7 @@ import { canonicalSourceControlActionSelection } from '../../../../../shared/sou import type { ActionArgumentChoices } from '../../../../../shared/source-control-action-argument-document' import { SourceControlActionAgentPicker } from './SourceControlActionAgentPicker' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { CustomAgentId } from '../../../../../shared/commit-message-agent-spec' import { isCustomAgentId } from '../../../../../shared/commit-message-agent-spec' import { diff --git a/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx b/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx index 6463022e05e..a3d84df3f24 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx @@ -2,7 +2,7 @@ import { useMemo } from 'react' import type React from 'react' import { toast } from 'sonner' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isFolderRepo } from '../../../../../shared/repo-kind' import type { SourceControlAiSettings, diff --git a/src/renderer/src/components/settings/source-control/source-control-action-arguments-visibility.ts b/src/renderer/src/components/settings/source-control/source-control-action-arguments-visibility.ts index 5624bc2e955..734aaadeaa2 100644 --- a/src/renderer/src/components/settings/source-control/source-control-action-arguments-visibility.ts +++ b/src/renderer/src/components/settings/source-control/source-control-action-arguments-visibility.ts @@ -2,7 +2,7 @@ import { nativeChatPreferenceFor, type NativeChatDefaultSettings } from '../../../../../shared/structured-native-chat-launch-route' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' /** Settings knows the default surface; workspace-specific terminal fallback stays a launch decision. */ diff --git a/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx b/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx index 01b85ca5046..7c49d12fd87 100644 --- a/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx +++ b/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx @@ -9,10 +9,10 @@ import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' import { shouldShowSourceControlActionArguments } from './source-control-action-arguments-visibility' import { useState } from 'react' import * as sourceProjection from '../../../lib/source-control-agent-launch-picker' -import * as choiceAnalysis from '../../../../../shared/agent-choice-args' +import * as choiceAnalysis from '../../../../../shared/agent-launch/choices/agent-choice-args' import * as pickerCatalog from '../../../../../shared/agent-session/options/agent-session-option-catalog' -import * as reconciliation from '../../../../../shared/agent-choice-reconciliation' -import * as launchProfile from '../../../../../shared/agent-launch-profile' +import * as reconciliation from '../../../../../shared/agent-launch/choices/agent-choice-reconciliation' +import * as launchProfile from '../../../../../shared/agent-launch/choices/agent-launch-profile' import { SourceControlActionAgentPicker } from './SourceControlActionAgentPicker' import { canonicalSourceControlActionSelection } from '../../../../../shared/source-control-action-selection' import { act, fireEvent, render, screen, within, waitFor } from '@testing-library/react' @@ -20,7 +20,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { pickerLocaleFixture } from '../__fixtures__/settings-persistence-test-fixture' import { useAppStore } from '@/store/index' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AiActionId, SourceControlActionLaunchPreferences @@ -370,8 +370,8 @@ it('labels an own raw Sonnet recipe from the same source as its setup chips', as const { projectSourceControlActionLaunch } = await import('../../../../../shared/source-control-action-launch-preferences') const { resolveAgentStartupPlanInputs } = - await import('../../../../../shared/agent-startup-plan-inputs') - const { buildAgentStartupPlan } = await import('../../../../../shared/tui-agent-startup') + await import('../../../../../shared/agent-launch/startup/agent-startup-plan-inputs') + const startupModule = await import('../../../../../shared/agent-launch/startup/tui-agent-startup') const settings = useAppStore.getState().settings if (!settings) { throw new Error('Missing configured settings') @@ -380,7 +380,7 @@ it('labels an own raw Sonnet recipe from the same source as its setup chips', as basePrompt: 'Do the work', settings }) - const startup = buildAgentStartupPlan({ + const startup = startupModule.buildAgentStartupPlan({ ...resolveAgentStartupPlanInputs({ agent: 'claude', settings, diff --git a/src/renderer/src/components/settings/source-control/source-control-action-permission-draft.test.tsx b/src/renderer/src/components/settings/source-control/source-control-action-permission-draft.test.tsx index d8b3c065ed8..019958d3df0 100644 --- a/src/renderer/src/components/settings/source-control/source-control-action-permission-draft.test.tsx +++ b/src/renderer/src/components/settings/source-control/source-control-action-permission-draft.test.tsx @@ -9,7 +9,7 @@ import { resolveSourceControlActionRecipe } from '../../../../../shared/source-c import { act, fireEvent, render, renderHook, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import * as lifts from '../../../../../shared/source-control-action-permission-lift' -import * as shell from '../../../../../shared/tui-agent-startup-shell' +import * as shell from '../../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { expect, it, vi } from 'vitest' import '../__fixtures__/settings-persistence-test-fixture' import { @@ -25,7 +25,7 @@ import { normalizeSourceControlActionRecipe, type SourceControlActionRecipe } from '../../../../../shared/source-control-ai-actions' -import { agentPermissionArgsForLaunch } from '../../../../../shared/agent-permission-args' +import { agentPermissionArgsForLaunch } from '../../../../../shared/agent-launch/permissions/agent-permission-args' import { SourceControlActionArguments } from './SourceControlActionArguments' import { useRepositorySourceControlAiGlobalUx } from '../repository/source-control/repository-source-control-ai-global-ux' import { useSourceControlActionRecipeDraftState } from './source-control-action-recipe-draft-state' diff --git a/src/renderer/src/components/settings/source-control/source-control-action-recipe-options.ts b/src/renderer/src/components/settings/source-control/source-control-action-recipe-options.ts index dd58d5426f6..05552727bd6 100644 --- a/src/renderer/src/components/settings/source-control/source-control-action-recipe-options.ts +++ b/src/renderer/src/components/settings/source-control/source-control-action-recipe-options.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { AI_TEXT_ACTION_IDS, SOURCE_CONTROL_TEXT_ACTION_IDS, diff --git a/src/renderer/src/components/settings/source-control/source-control-ai-settings-persistence.test.tsx b/src/renderer/src/components/settings/source-control/source-control-ai-settings-persistence.test.tsx index f4623d1ddf3..4ec96cb6089 100644 --- a/src/renderer/src/components/settings/source-control/source-control-ai-settings-persistence.test.tsx +++ b/src/renderer/src/components/settings/source-control/source-control-ai-settings-persistence.test.tsx @@ -14,7 +14,7 @@ import { } from '../__fixtures__/settings-persistence-test-fixture' import * as selection from '../../../../../shared/source-control-launch-agent-selection' import * as lifts from '../../../../../shared/source-control-action-permission-lift' -import * as shell from '../../../../../shared/tui-agent-startup-shell' +import * as shell from '../../../../../shared/agent-launch/startup/tui-agent-startup-shell' import { TooltipProvider } from '../../ui/tooltip' import { RUNTIME_CAPABILITIES } from '../../../../../shared/protocol-version' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' @@ -454,7 +454,7 @@ it('renders current native text-agent facts for a normalized legacy model recipe patch: Partial['settings']>> ) => useAppStore.setState(({ settings }) => ({ settings: settings && { ...settings, ...patch } })) const { agentLaunchSettingsMutationUpdates } = - await import('../../../../../shared/agent-launch-settings') + await import('../../../../../shared/agent-launch/choices/agent-launch-settings') const config = normalizeSourceControlAiSettings({ ...getDefaultSourceControlAiSettings(), actions: { diff --git a/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts b/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts index cc924e4aaf8..7b770f3c946 100644 --- a/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts +++ b/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isCustomAgentId } from '../../../../../shared/commit-message-agent-spec' import { pickSourceControlLaunchAgent } from '../../../../../shared/source-control-launch-agent-selection' import type { SourceControlActionRecipe } from '../../../../../shared/source-control-ai-actions' diff --git a/src/renderer/src/components/settings/use-text-action-model-discovery.ts b/src/renderer/src/components/settings/use-text-action-model-discovery.ts index ae4e7013e0d..1f39ff9f3b9 100644 --- a/src/renderer/src/components/settings/use-text-action-model-discovery.ts +++ b/src/renderer/src/components/settings/use-text-action-model-discovery.ts @@ -12,7 +12,7 @@ import { withDiscoveredModels } from '../../../../shared/source-control-ai-model-selection' import type { SourceControlAiSettingsPatch } from '../../../../shared/source-control-ai-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' // One listing per host and agent at a time, however many cards open their picker. const pending = new Map>() diff --git a/src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts b/src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts index f6b8c647313..303855fd6f4 100644 --- a/src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts +++ b/src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts @@ -1,7 +1,7 @@ import { resolveAgentStartupPlanInputs, type AgentStartupSettings -} from '../../../../shared/agent-startup-plan-inputs' +} from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' import type { LinkedWorkItemSummary } from '@/lib/new-workspace' import { resolveRepoExecutionHostPlatform, @@ -13,11 +13,11 @@ import { buildAgentDraftLaunchPlan, buildAgentStartupPlan, type AgentStartupPlan -} from '@/lib/tui-agent-startup' +} from '../../../../shared/agent-launch/startup/tui-agent-startup' import type { ProjectGroup } from '../../../../shared/project-group-types' import type { SessionOptionValue } from '../../../../shared/native-chat/input/native-chat-session-options' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { AgentStartupShell } from '../../../../shared/tui-agent-startup-shell' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' /** OS of the host that owns a folder group; its agents are quoted for that host's shell. */ export function getFolderWorkspaceAgentLaunchFact( diff --git a/src/renderer/src/components/sidebar/folder-workspace-composer-submit-input.ts b/src/renderer/src/components/sidebar/folder-workspace-composer-submit-input.ts index c97caff95fa..48c15a21a6a 100644 --- a/src/renderer/src/components/sidebar/folder-workspace-composer-submit-input.ts +++ b/src/renderer/src/components/sidebar/folder-workspace-composer-submit-input.ts @@ -1,10 +1,10 @@ import type { AgentLaunchChoice } from '@/lib/agent-menu-selection' import type { LinkedWorkItemSummary } from '@/lib/new-workspace' -import type { AgentStartupSettings } from '../../../../shared/agent-startup-plan-inputs' -import type { AgentLaunchInputViews } from '../../../../shared/agent-launch-choices' +import type { AgentStartupSettings } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import type { AgentLaunchInputViews } from '../../../../shared/agent-launch/choices/agent-launch-choices' import type { FolderWorkspace } from '../../../../shared/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project-group-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../shared/telemetry-events' import type { TaskSourceContext } from '../../../../shared/task-source-context' diff --git a/src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts b/src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts index 30065c72fb0..d8cb474768e 100644 --- a/src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts +++ b/src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts @@ -1,9 +1,9 @@ import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { ensureAgentStartupInTerminal } from '@/lib/new-workspace' import { seedNativeChatLaunchDraftForAgentTab } from '@/lib/agent-launch-prompt-delivery' import { createBrowserUuid } from '@/lib/browser-uuid' -import { buildAgentStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-startup' import { tuiAgentToAgentKind } from '@/lib/telemetry' import { activateAndRevealFolderWorkspace } from '@/lib/worktree-activation' import { shouldApplyWorkspaceSourceAutoName } from '../../../../shared/new-workspace/workspace-source' diff --git a/src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts b/src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts index 3730270d9fc..d7fd665c2a0 100644 --- a/src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts +++ b/src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { applyAgentRowLineage } from '@/components/dashboard/agent-row-lineage' import type { TerminalLayoutSnapshot, TerminalTab } from '../../../../shared/terminal-tab-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { makePaneKey } from '../../../../shared/stable-pane-id' import { buildWorktreeAgentRows } from './worktree-agent-rows' import { createTerminalTitleTracker } from '../../../../shared/terminal-output-side-effects' diff --git a/src/renderer/src/components/status-bar/status-bar-agent-gating.ts b/src/renderer/src/components/status-bar/status-bar-agent-gating.ts index 197f448caaf..d91b5dac49c 100644 --- a/src/renderer/src/components/status-bar/status-bar-agent-gating.ts +++ b/src/renderer/src/components/status-bar/status-bar-agent-gating.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { StatusBarItem } from '../../../../shared/ui-chrome-types' // Hide missing CLI items and toggles after detection; unknown detection preserves them to avoid cold-start flicker. diff --git a/src/renderer/src/components/tab-bar/QuickLaunchButton.tsx b/src/renderer/src/components/tab-bar/QuickLaunchButton.tsx index e1883fc5861..42240be8d2f 100644 --- a/src/renderer/src/components/tab-bar/QuickLaunchButton.tsx +++ b/src/renderer/src/components/tab-bar/QuickLaunchButton.tsx @@ -3,7 +3,7 @@ import { agentPickerLaunchInputs, type AgentPickerEntry, type AgentPickerDraft -} from '../../../../shared/agent-launch-picker' +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import React, { useCallback, useRef } from 'react' import { toast } from 'sonner' import { launchAgentInNewTab } from '@/lib/launch-agent-in-new-tab' @@ -23,12 +23,12 @@ import { useAppStore } from '@/store' import { useOptionalShortcutLabel } from '@/hooks/useShortcutLabel' import { useAgentMenuShortcutLabels } from './agent-menu-shortcut-labels' import type { AgentPickerInventorySource } from '../agent/use-agent-launch-picker-inventory' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../shared/telemetry-events' import { translate } from '@/i18n/i18n' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' import { cn } from '@/lib/utils' -import type { NewTabAgentMenuRow } from '@/lib/new-tab-agent-menu-rows' +import type { NewTabAgentMenuRow } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import { useNewTabAgentMenuRows, type NewTabAgentMenuModel } from './use-new-tab-agent-menu-rows' import { useAgentDetectionTargetForWorktree } from '@/hooks/useAgentDetectionTarget' import { chatUnavailableLabel, rowTitle, rowLabel, rowId } from './tab-agent-row-presentation' diff --git a/src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx b/src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx index 40a29c3ce4e..09adf3c518c 100644 --- a/src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx +++ b/src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx @@ -19,7 +19,7 @@ import { formatBrowserHistoryUrl } from '@/lib/browser-history-match' import type { ActiveOption } from './tab-create-entry-active-option' import { BrowserFavicon } from '@/components/browser-favicon' import { AgentLaunchSetupButton } from '../agent/AgentLaunchSetupButton' -import type { AgentPickerDraft } from '../../../../shared/agent-launch-picker' +import type { AgentPickerDraft } from '../../../../shared/agent-launch/picker/agent-launch-picker' export const RESULT_LISTBOX_ID = 'tab-create-entry-results' diff --git a/src/renderer/src/components/tab-bar/agent-menu-shortcut-labels.ts b/src/renderer/src/components/tab-bar/agent-menu-shortcut-labels.ts index e465209bbd8..6e138ebb48b 100644 --- a/src/renderer/src/components/tab-bar/agent-menu-shortcut-labels.ts +++ b/src/renderer/src/components/tab-bar/agent-menu-shortcut-labels.ts @@ -13,7 +13,7 @@ import { resolveAgentTabShortcutAction } from '../terminal-agent-tab-shortcut' import type { KeybindingOverrides } from '../../../../shared/keybindings' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { NewTabAgentMenuModel } from './new-tab-agent-menu-model' export function useAgentMenuShortcutLabels( diff --git a/src/renderer/src/components/tab-bar/cli-chat-resume-close-admission.ts b/src/renderer/src/components/tab-bar/cli-chat-resume-close-admission.ts index a20e8d87591..d40364f2f66 100644 --- a/src/renderer/src/components/tab-bar/cli-chat-resume-close-admission.ts +++ b/src/renderer/src/components/tab-bar/cli-chat-resume-close-admission.ts @@ -16,7 +16,7 @@ import { namesCliConversation } from '../../../../shared/structured-agent-cli-conversation-adoption' import { recognizeAgentProcess } from '../../../../shared/agent-process-recognition' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { CliChatResumeSource } from './cli-chat-resume-source' import { reportCliChatResumeOwner } from './cli-chat-resume-feedback' import { cliChatResumeClosingPaneKeys } from './cli-chat-resume-close-terminal' diff --git a/src/renderer/src/components/tab-bar/host-agent-launch-preferences-source.test.tsx b/src/renderer/src/components/tab-bar/host-agent-launch-preferences-source.test.tsx index 8222b248122..7c9a19d4396 100644 --- a/src/renderer/src/components/tab-bar/host-agent-launch-preferences-source.test.tsx +++ b/src/renderer/src/components/tab-bar/host-agent-launch-preferences-source.test.tsx @@ -10,13 +10,13 @@ import { expect, it, vi } from 'vitest' import { AGENT_LAUNCH_CHOICES_CAPABILITY, AGENT_LAUNCH_SETTINGS_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { compatibilityEntry, rememberRuntimeEnvironmentCompatibility } from '@/runtime/runtime-compatibility-cache' import { useAppStore } from '@/store' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY as CHAT, STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY as CLIENT @@ -241,7 +241,7 @@ it.each([20, 200])( const route = await import('@/lib/agent-launch-route-input') const builder = vi.spyOn(route, 'buildAgentLaunchRouteInput') const profiles = vi.spyOn( - await import('../../../../shared/agent-launch-profile'), + await import('../../../../shared/agent-launch/choices/agent-launch-profile'), 'projectAgentLaunchProfile' ) try { diff --git a/src/renderer/src/components/tab-bar/native-chat-tab-agent-evidence.ts b/src/renderer/src/components/tab-bar/native-chat-tab-agent-evidence.ts index 846dbb59bcc..4e96d69bb5c 100644 --- a/src/renderer/src/components/tab-bar/native-chat-tab-agent-evidence.ts +++ b/src/renderer/src/components/tab-bar/native-chat-tab-agent-evidence.ts @@ -1,7 +1,7 @@ import type { Tab } from '../../../../shared/tab-types' import type { TerminalTab } from '../../../../shared/terminal-tab-types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveCommittedTitleAgentType } from '@/lib/pane-agent-evidence' /** Resolve durable tab metadata used before a live pane status arrives. */ diff --git a/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts b/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts index 11465d3ec08..18843404b78 100644 --- a/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts +++ b/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts @@ -6,8 +6,8 @@ import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environmen import { clearRuntimeCompatibilityCache } from '@/runtime/runtime-compatibility-cache' import { getDefaultSettings } from '../../../../shared/constants' import { measureSettingsWork } from '../../../../shared/global-settings-test-fixture' -import * as profile from '../../../../shared/tui-agent-launch-defaults' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import * as profile from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import type { RuntimeEnvironmentStatus } from '../../../../shared/runtime-host-status' import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY as CHAT, diff --git a/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts b/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts index 3e17206a797..0d704aeb11b 100644 --- a/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts +++ b/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts @@ -1,8 +1,8 @@ -import type { buildNewTabAgentMenuRows } from '@/lib/new-tab-agent-menu-rows' +import type { buildNewTabAgentMenuRows } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { UseDetectedAgentsResult } from '@/hooks/useDetectedAgents' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { ProspectiveWorkspace } from '@/lib/agent-launch-route-input' -import type { AgentPickerDefaultSettings } from '../../../../shared/agent-launch-picker' +import type { AgentPickerDefaultSettings } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' export type NewTabAgentMenuModel = | { state: 'loading'; placeholderCount: number } diff --git a/src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts b/src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts index 5fb1ffd3c32..73fb80b8335 100644 --- a/src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts +++ b/src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts @@ -6,7 +6,7 @@ import { findMatchingTabAgentLaunchOptions, orderTabLaunchAgents } from './tab-agent-launch-options' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' describe('tab agent launch options', () => { it('orders detected agents by the configured default first', () => { diff --git a/src/renderer/src/components/tab-bar/tab-agent-launch-options.ts b/src/renderer/src/components/tab-bar/tab-agent-launch-options.ts index fad5a233b23..b4c93bb6755 100644 --- a/src/renderer/src/components/tab-bar/tab-agent-launch-options.ts +++ b/src/renderer/src/components/tab-bar/tab-agent-launch-options.ts @@ -1,15 +1,17 @@ -import { - searchAgentPickerSetups, - type AgentPickerDraft, - type AgentPickerEntry -} from '../../../../shared/agent-launch-picker' +import { searchAgentPickerSetups } from '../../../../shared/agent-launch/picker/agent-launch-picker-search' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { AgentPickerSetupIdentity } from '../agent/agent-launch-picker-drafts' import { rowLabel, rowId, chatUnavailableLabel } from './tab-agent-row-presentation' import { getAgentCatalog } from '@/lib/agent-catalog' -import { orderAgentLaunchPickerAgents } from '../../../../shared/agent-launch-picker-rows' +import { + orderAgentLaunchPickerAgents, + type NewTabAgentMenuRow +} from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import { normalizeMatchQuery, tokenizeMatchValue } from './query-token-match' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { NewTabAgentMenuRow } from '@/lib/new-tab-agent-menu-rows' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type TabAgentLaunchOption = { agent: TuiAgent diff --git a/src/renderer/src/components/tab-bar/tab-agent-row-presentation.ts b/src/renderer/src/components/tab-bar/tab-agent-row-presentation.ts index f45e93f53af..428b45e4933 100644 --- a/src/renderer/src/components/tab-bar/tab-agent-row-presentation.ts +++ b/src/renderer/src/components/tab-bar/tab-agent-row-presentation.ts @@ -1,6 +1,9 @@ import { translate } from '@/i18n/i18n' import { getAgentCatalog } from '@/lib/agent-catalog' -import type { ChatUnavailableReason, NewTabAgentMenuRow } from '@/lib/new-tab-agent-menu-rows' +import type { + ChatUnavailableReason, + NewTabAgentMenuRow +} from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' export function chatUnavailableLabel(reason: ChatUnavailableReason): string { switch (reason) { diff --git a/src/renderer/src/components/tab-bar/tab-bar-create-menu-contract.ts b/src/renderer/src/components/tab-bar/tab-bar-create-menu-contract.ts index 58898ae08ae..f64d0ace842 100644 --- a/src/renderer/src/components/tab-bar/tab-bar-create-menu-contract.ts +++ b/src/renderer/src/components/tab-bar/tab-bar-create-menu-contract.ts @@ -1,5 +1,5 @@ import type { NewTabAgentMenuModel } from './use-new-tab-agent-menu-rows' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { AgentPickerInventorySource } from '../agent/use-agent-launch-picker-inventory' import type { TabAgentLaunchOption } from './tab-agent-launch-options' import type { useTabAgentMenuLaunch } from './QuickLaunchButton' diff --git a/src/renderer/src/components/tab-bar/tab-create-entry-props.ts b/src/renderer/src/components/tab-bar/tab-create-entry-props.ts index 87a98eb5f6c..272e6810ac9 100644 --- a/src/renderer/src/components/tab-bar/tab-create-entry-props.ts +++ b/src/renderer/src/components/tab-bar/tab-create-entry-props.ts @@ -1,4 +1,4 @@ -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import type { TabCreateEntryArgs } from './tab-create-entry-action' import type { TabAgentLaunchOption } from './tab-agent-launch-options' import type { TabCreateMenuOption } from './tab-create-menu-options' diff --git a/src/renderer/src/components/tab-bar/tab-session-history-switch.ts b/src/renderer/src/components/tab-bar/tab-session-history-switch.ts index 2c8525e8875..f920a639493 100644 --- a/src/renderer/src/components/tab-bar/tab-session-history-switch.ts +++ b/src/renderer/src/components/tab-bar/tab-session-history-switch.ts @@ -24,7 +24,7 @@ import { cliConversationRowsShareAgent, type CliConversationRowAgent } from '../../../../shared/structured-agent-cli-conversation-adoption' -import { agentForksConversations } from '../../../../shared/agent-resume-argv' +import { agentForksConversations } from '../../../../shared/agent-launch/startup/agent-resume-argv' import type { TerminalTab } from '../../../../shared/terminal-tab-types' import type { AgentType } from '../../../../shared/agent-status-types' import { resolveAiVaultSessionSurfaceSwitchTargets } from '../right-sidebar/ai-vault-session-surface-switch' diff --git a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx index ec41268e7f9..0feb13e2423 100644 --- a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx +++ b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-host-preferences.test.tsx @@ -14,7 +14,7 @@ import { useAppStore } from '@/store' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environment-revision' import { getDefaultSettings } from '../../../../shared/constants' import { expectSettingsWorkScale } from '../../../../shared/global-settings-test-fixture' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import { makeFolderWorkspace, makeWorktree, @@ -669,7 +669,7 @@ it('reprojects a supplied local authored map once without host acquisition', asy } } const profiles = vi.spyOn( - await import('../../../../shared/agent-launch-profile'), + await import('../../../../shared/agent-launch/choices/agent-launch-profile'), 'projectAgentLaunchProfile' ) try { diff --git a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.test.tsx b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.test.tsx index 074854700b2..836c0dcd0b8 100644 --- a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.test.tsx +++ b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.test.tsx @@ -3,7 +3,7 @@ import { act, cleanup, renderHook } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { resolveAgentMenuSelection } from '@/lib/agent-menu-selection' import { useAppStore } from '@/store' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { useAgentDetectionTargetForWorktree } from '@/hooks/useAgentDetectionTarget' import { getDefaultSettings } from '../../../../shared/constants' import { @@ -14,6 +14,7 @@ import { import type * as RouteInput from '@/lib/agent-launch-route-input' import type * as ChatProgram from '@/lib/host-chat-program' import type * as MenuRows from '@/lib/new-tab-agent-menu-rows' +import type * as AgentPickerRowsModule from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type * as ZustandShallow from 'zustand/react/shallow' import type * as HostAgentSettingsTransport from '@/runtime/agent-launch-settings/agent-launch-settings-transport' import type { RuntimeEnvironmentStatus } from '../../../../shared/runtime-host-status' @@ -67,15 +68,24 @@ vi.mock('zustand/react/shallow', async (importOriginal) => { }) } }) +vi.mock( + '../../../../shared/agent-launch/picker/agent-launch-picker-rows', + async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + buildNewTabAgentMenuRows: (...args: Parameters) => { + const rows = actual.buildNewTabAgentMenuRows(...args) + mocks.metadata += rows.length + return rows + } + } + } +) vi.mock('@/lib/new-tab-agent-menu-rows', async (importOriginal) => { const actual = await importOriginal() return { ...actual, - buildNewTabAgentMenuRows: (...args: Parameters) => { - const rows = actual.buildNewTabAgentMenuRows(...args) - mocks.metadata += rows.length - return rows - }, hostChatAnswer: (input: Parameters[0]) => { mocks.answers.push(input) if (mocks.realRoutes) { diff --git a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts index 4d95fcdc489..dacb6d6c222 100644 --- a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts +++ b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts @@ -10,7 +10,7 @@ import { isRuntimeHostContactRevokedVerdict, runtimeHostContactForEntry } from '../../../../shared/runtime-host-contact' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { useAppStore } from '@/store' import { useAgentPickerRefusedWake } from './use-agent-picker-refused-wake' import { @@ -27,9 +27,9 @@ import { getRuntimeEnvironmentRevision } from '@/runtime/runtime-environment-rev import { useHostStructuredAgentAvailability } from '@/runtime/use-host-structured-agent-availability' import { buildNewTabAgentMenuRows, - hostChatAnswer, type HostChatAnswer -} from '@/lib/new-tab-agent-menu-rows' +} from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' +import { hostChatAnswer } from '@/lib/new-tab-agent-menu-rows' import { readLocalRuntimeCapabilityObservation, subscribeLocalRuntimeCapabilityObservation @@ -40,7 +40,7 @@ import { useChatProgramFacts } from '@/lib/host-chat-program-acquisition' import { readChatProgram } from '@/lib/host-chat-program' import { resolveAgentMenuSelection } from '@/lib/agent-menu-selection' import { useHostAgentMenuSettings } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' /** `detectionTarget` is the workspace's agent-inventory host, resolved by the caller. */ diff --git a/src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts b/src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts index febe294c802..85fd57f2b84 100644 --- a/src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts +++ b/src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts @@ -1,7 +1,7 @@ import type { TabBarCreateMenuController } from './tab-bar-create-menu-contract' export type { TabBarCreateMenuController } from './tab-bar-create-menu-contract' import { useAgentLaunchPickerInventorySource } from '../agent/use-agent-launch-picker-inventory' -import type { AgentPickerEntry } from '../../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' import { useEffect, useMemo, useRef, useState } from 'react' import { focusTerminalTabSurface } from '@/lib/focus-terminal-tab-surface' import type { WindowsTerminalCapabilities } from '@/lib/windows-terminal-capabilities' diff --git a/src/renderer/src/components/tab-group/tab-drag-data.ts b/src/renderer/src/components/tab-group/tab-drag-data.ts index eb582af01fc..574d6c5e582 100644 --- a/src/renderer/src/components/tab-group/tab-drag-data.ts +++ b/src/renderer/src/components/tab-group/tab-drag-data.ts @@ -1,5 +1,5 @@ import type { TabGroup } from '../../../../shared/tab-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TabSplitDirection } from '../../store/slices/tabs' export type TabDropZone = 'center' | TabSplitDirection diff --git a/src/renderer/src/components/terminal-agent-tab-shortcut.ts b/src/renderer/src/components/terminal-agent-tab-shortcut.ts index e1a38f9033b..dddae236f8f 100644 --- a/src/renderer/src/components/terminal-agent-tab-shortcut.ts +++ b/src/renderer/src/components/terminal-agent-tab-shortcut.ts @@ -1,5 +1,5 @@ import type { KeybindingActionId, KeybindingOverrides } from '../../../shared/keybindings' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { useAppStore } from '../store' import { readDetectedAgentsForWorktree } from '@/lib/agent-detection-target-inventory' import { readAgentLaunchPreferencesForWorktree } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' diff --git a/src/renderer/src/components/terminal-pane/AgentLaunchPaneNotice.tsx b/src/renderer/src/components/terminal-pane/AgentLaunchPaneNotice.tsx index 7c0578334d5..5b09556d3da 100644 --- a/src/renderer/src/components/terminal-pane/AgentLaunchPaneNotice.tsx +++ b/src/renderer/src/components/terminal-pane/AgentLaunchPaneNotice.tsx @@ -2,7 +2,7 @@ import { translate } from '@/i18n/i18n' import { Button } from '@/components/ui/button' import { agentLaunchPanePrompt } from '@/lib/agent-launch-pane-prompt' import { createPortal } from 'react-dom' -import type { AgentLaunchPaneOutcome } from '../../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneOutcome } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { agentLaunchPaneNoticeText } from './agent-launch-pane-notice-text' /** Show a non-dismissible session state when a laid-out pane’s agent is not running. */ diff --git a/src/renderer/src/components/terminal-pane/agent-launch-pane-notice-text.ts b/src/renderer/src/components/terminal-pane/agent-launch-pane-notice-text.ts index 036fffb34a9..6999a3a4892 100644 --- a/src/renderer/src/components/terminal-pane/agent-launch-pane-notice-text.ts +++ b/src/renderer/src/components/terminal-pane/agent-launch-pane-notice-text.ts @@ -1,8 +1,8 @@ import { translate } from '@/i18n/i18n' -import type { AgentLaunchPaneOutcome } from '../../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneOutcome } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { stripClientEnvironmentFooter } from '../../../../shared/client-environment-info' import type { TerminalTab } from '../../../../shared/terminal-tab-types' -import { tuiAgentDisplayName } from '../../../../shared/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../../shared/agent-launch/catalog/tui-agent-display-names' /** What the pane shows, if its tab keeps a final launch outcome for this leaf. */ export function agentLaunchPaneOutcomeForLeaf( diff --git a/src/renderer/src/components/terminal-pane/antigravity-auto-approved-permission.ts b/src/renderer/src/components/terminal-pane/antigravity-auto-approved-permission.ts index e1faf42ab44..1723a1512d9 100644 --- a/src/renderer/src/components/terminal-pane/antigravity-auto-approved-permission.ts +++ b/src/renderer/src/components/terminal-pane/antigravity-auto-approved-permission.ts @@ -1,5 +1,5 @@ -import { tuiAgentArgsBypassPermissions } from '../../../../shared/tui-agent-launch-defaults' -import type { AgentStartupShell } from '../../../../shared/tui-agent-startup-shell' +import { tuiAgentArgsBypassPermissions } from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' const STARTUP_SHELLS: readonly AgentStartupShell[] = ['posix', 'powershell', 'cmd'] diff --git a/src/renderer/src/components/terminal-pane/ipc-pty-connect-result.ts b/src/renderer/src/components/terminal-pane/ipc-pty-connect-result.ts index 03c9246c724..cc5759481bb 100644 --- a/src/renderer/src/components/terminal-pane/ipc-pty-connect-result.ts +++ b/src/renderer/src/components/terminal-pane/ipc-pty-connect-result.ts @@ -1,5 +1,5 @@ import { terminalLaunchFacts } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import type { PtyConnectResult } from './pty-transport-types' type IpcPtySpawnResult = PtyConnectResult & { isReattach?: boolean } diff --git a/src/renderer/src/components/terminal-pane/issue-12112-agent-pane-startup-color-reply-leak.repro.test.ts b/src/renderer/src/components/terminal-pane/issue-12112-agent-pane-startup-color-reply-leak.repro.test.ts index 075b7d7d914..3a49dc75dc6 100644 --- a/src/renderer/src/components/terminal-pane/issue-12112-agent-pane-startup-color-reply-leak.repro.test.ts +++ b/src/renderer/src/components/terminal-pane/issue-12112-agent-pane-startup-color-reply-leak.repro.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { Terminal } from '@xterm/headless' import { PtyStartupIngress } from '../../../../shared/pty-startup-ingress' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { installTerminalCapabilityReplyHandlers } from './terminal-capability-replies' import { createIpcPtyTransport } from './pty-transport' import type { PtyTransport } from './pty-transport-types' diff --git a/src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts b/src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts index 95c5900e68f..ff35a8d6a14 100644 --- a/src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts +++ b/src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveCommittedTitleAgentType } from '@/lib/pane-agent-evidence' export type NativeChatLeafTitlePane = { diff --git a/src/renderer/src/components/terminal-pane/pty-agent-pane-launch.test.ts b/src/renderer/src/components/terminal-pane/pty-agent-pane-launch.test.ts index 1a6e3490f5a..c7d0e22addd 100644 --- a/src/renderer/src/components/terminal-pane/pty-agent-pane-launch.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-agent-pane-launch.test.ts @@ -1,7 +1,7 @@ import { ptyIncarnationById, ptyOwnership } from '../../../../main/ipc/pty/provider/ownership-state' import { createLaunchRaceRuntime } from '../../../../main/ipc/pty/pty-launch-race-test-fixture' import { afterEach, describe, expect, it, onTestFinished, vi } from 'vitest' -import type { AgentPaneLaunchRequest } from '../../../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../../../shared/agent-launch/contracts/agent-pane-launch-request' import { setupPtyIpcSuite } from '../../../../main/ipc/pty/pty-ipc-test-harness' import { classifyErrorMock, statSyncMock } from '../../../../main/ipc/pty/pty-ipc-mock-registry' import { registerPtyHandlers } from '../../../../main/ipc/pty/register-handlers' @@ -10,7 +10,7 @@ import { markAgentLaunchesClosedByUser, resetAgentLaunchPanesForTests } from '../../../../main/agent-launch/agent-launch-pane-attachment' -import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch-pane-verdict' +import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { makePaneKey } from '../../../../shared/stable-pane-id' import { makePaneSpawnReservationKey, diff --git a/src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts index ba0961f43e2..c0a47300a65 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts @@ -1,7 +1,7 @@ import { bindPtyConnectionTestMocks } from './pty-connection-mocks.spec' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { makePaneKey } from '../../../../shared/stable-pane-id' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { flushAsyncTicks } from './pty-connection-test-async' import { VISIBLE_PTY_SETTLE_MS, diff --git a/src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts index 330dd9deb65..449296dee9d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts @@ -1,7 +1,7 @@ import { bindPtyConnectionTestMocks } from './pty-connection-mocks.spec' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { makePaneKey } from '../../../../shared/stable-pane-id' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { flushAsyncTicks } from './pty-connection-test-async' import { VISIBLE_PTY_SETTLE_MS, diff --git a/src/renderer/src/components/terminal-pane/pty-connection-types.ts b/src/renderer/src/components/terminal-pane/pty-connection-types.ts index fd56004e4d9..6b48af26aac 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-types.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-types.ts @@ -8,8 +8,8 @@ import type { RestoredViewportBlankingPanesRef } from './terminal-restored-viewp import type { AgentCompletionStatusSnapshot } from './agent-completion-coordinator-types' import type { EventProps } from '../../../../shared/telemetry-events' import type { TerminalColorSchemeMode } from '../../../../shared/terminal-color-scheme-protocol' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalPanePlacement } from '../../../../shared/terminal-pane-placement' import type { SavedResumeStartupSource, @@ -19,7 +19,7 @@ import type { import type { TerminalKittyKeyboardModeTracker } from '../../../../shared/terminal-kitty-keyboard-mode-tracker' import type { SessionOptionValue } from '../../../../shared/native-chat/input/native-chat-session-options' import type { PtyPreconnectInputEntry } from './pty-preconnect-input-buffer' -import type { AgentPaneLaunchRequest } from '../../../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../../../shared/agent-launch/contracts/agent-pane-launch-request' export type PtyPaneStartup = { command: string diff --git a/src/renderer/src/components/terminal-pane/pty-connection/agent-pre-ready-typed-draft.ts b/src/renderer/src/components/terminal-pane/pty-connection/agent-pre-ready-typed-draft.ts index 3c71fba38ce..2733e97e3f8 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/agent-pre-ready-typed-draft.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/agent-pre-ready-typed-draft.ts @@ -1,8 +1,8 @@ // Pre-bind keys would prefix the launch command; draft until agent readiness and discard if the user starts driving the live screen. import { useAppStore } from '@/store' -import { TUI_AGENT_CONFIG } from '../../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import { TUI_AGENT_CONFIG } from '../../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { resolveDraftPasteReadyTimeoutMs } from '../../../../../shared/draft-paste-ready-timeout' import { waitForAgentDraftInputReady } from '@/lib/agent-draft-readiness' import { sendAgentDraftPasteContent } from '@/lib/agent-draft-paste-content' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.ts b/src/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.ts index 7623aeefb9a..fdce94a8dcf 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.ts @@ -6,7 +6,7 @@ import { normalizeExecutionHostId } from '../../../../../shared/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace-scope' import { useAppStore } from '@/store' import { createBrowserUuid } from '@/lib/browser-uuid' -import { buildAgentResumeStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../../../../shared/agent-launch/startup/tui-agent-resume-startup' import { resolveRuntimeHostReportedPlatform, resolveRuntimeHostTerminalWindowsShell, @@ -17,7 +17,7 @@ import { agentResumeOriginNamesAnotherExecutionHost, sleepingRecordNamesAnotherExecutionHost } from '@/lib/sleeping-record-execution-host-scope' -import { resolveResumeLaunchRecipe } from '../../../../../shared/tui-agent-launch-defaults' +import { resolveResumeLaunchRecipe } from '../../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { agentProviderSessionsEqual, isResumableTuiAgent, diff --git a/src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts b/src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts index e13d7ed3d8e..aeec5c3a6b9 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts @@ -9,9 +9,9 @@ import { registerAgentHookTerminalLifecycleHandler } from '../agent-hook-termina import type { AgentCompletionStatusSnapshot } from '../agent-completion-coordinator-types' import { resolveCompatibleAgentTypeForOwner } from '../../../../../shared/agent-title-owner' import { resolveCommittedTitleAgentType } from '@/lib/pane-agent-evidence' -import { recognizeAgentLaunchCommand } from '../../../../../shared/agent-command-line-intent' +import { recognizeAgentLaunchCommand } from '../../../../../shared/agent-launch/startup/agent-command-line-intent' import type { TerminalAgent } from '../../../../../shared/terminal-agent' -import { isTuiAgent } from '../../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { MANUAL_AGENT_COMMAND_MAX_CHARS } from './pty-connect-limits' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-types.ts b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-types.ts index 87d7d002cd4..c55a7e01eae 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-types.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-types.ts @@ -4,7 +4,7 @@ import type { SavedResumeStartupSource, SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { buildAgentResumeStartupPlan } from '@/lib/tui-agent-startup' +import type { buildAgentResumeStartupPlan } from '../../../../../shared/agent-launch/startup/tui-agent-resume-startup' export type PendingStartupCommand = { command: string diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts b/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts index d61189e9fad..525286111ff 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts @@ -12,8 +12,11 @@ import { createPaneForegroundAgentTracker } from '../pane-foreground-agent-track import { isRemoteExecutionHostPtyId } from '../../../../../shared/remote-execution-host-pty-id' import { inspectRuntimeTerminalProcess } from '@/runtime/runtime-terminal-inspection' import { dispatchTerminalCommandFinishedEvent } from '@/hooks/terminal-command-finished-event' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { + isTuiAgent, + TUI_AGENT_CONFIG +} from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { paneShouldAnswerOscColorQueries, diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pane-launch-agent-candidate.ts b/src/renderer/src/components/terminal-pane/pty-connection/pane-launch-agent-candidate.ts index f55320450d5..9bdf38110cf 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pane-launch-agent-candidate.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pane-launch-agent-candidate.ts @@ -1,6 +1,6 @@ -import { isTuiAgent } from '../../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { recognizeAgentLaunchCommand } from '../../../../../shared/agent-command-line-intent' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { recognizeAgentLaunchCommand } from '../../../../../shared/agent-launch/startup/agent-command-line-intent' import { COMMAND_TOKEN_SCAN_MAX_CHARS } from '../../../../../shared/command-token-scanner' /** The store slice the launch-agent ladder reads. */ diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts b/src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts index 6956cc1d790..e85b77c6cbd 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts @@ -3,7 +3,7 @@ import { useAppStore } from '@/store' import { ambiguousWorkspaceOwnerMessage } from '@/lib/duplicate-paired-servers' import { createIpcPtyTransport } from '../pty-transport' import { createRemoteRuntimePtyTransport } from '../remote-runtime-pty-transport' -import { toAgentLaunchPreferences } from '../../../../../shared/agent-launch-preferences' +import { toAgentLaunchPreferences } from '../../../../../shared/agent-launch/choices/agent-launch-preferences' import { createUnresolvedOwnerPtyTransport } from '../unresolved-owner-pty-transport' import { recordTerminalTabParkedOnUnresolvedHost } from '@/lib/parked-terminal-host-hydration' import { getFitOverrideForPty, onOverrideChange } from '@/lib/pane-manager/mobile-fit-overrides' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts b/src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts index db0f1f95392..260ebbb9638 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts @@ -10,8 +10,8 @@ import { type SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' import { recognizeAgentProcessFromCommandLine } from '../../../../../shared/agent-process-recognition' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { TUI_AGENT_CONFIG } from '../../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { beginAgentStartupDeliveryAttempt, releaseAgentStartupDeliveryAttempt diff --git a/src/renderer/src/components/terminal-pane/pty-transport-types.ts b/src/renderer/src/components/terminal-pane/pty-transport-types.ts index 309dc90718e..6ce5ad86198 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport-types.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport-types.ts @@ -14,12 +14,12 @@ import type { AgentLaunchPreferences, AgentPromptDelivery } from '../../../../shared/agent-session/agent-session-host-authority' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/project-execution-runtime' import type { EventProps } from '../../../../shared/telemetry-events' import type { TerminalInputKind } from '../../../../shared/terminal-input-kind' import type { TerminalOscColorQueryReplyColors } from '../../../../shared/terminal-osc-color-reply' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalPanePlacement } from '../../../../shared/terminal-pane-placement' import type { ExecutionHostId } from '../../../../shared/execution-host' import type { PtyDataMeta } from './pty-dispatcher' @@ -28,7 +28,7 @@ import type { RemoteRuntimeSnapshotRequestOptions } from '../../runtime/remote-runtime-terminal-multiplexer-types' import type { AcceptedInputOptions, PtyPreconnectInputEntry } from './pty-preconnect-input-buffer' -import type { AgentPaneLaunchRequest } from '../../../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../../../shared/agent-launch/contracts/agent-pane-launch-request' export type PtyBufferSnapshot = { data: string diff --git a/src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.ts b/src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.ts index ad291fe4510..a4cb7af623b 100644 --- a/src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.ts +++ b/src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.ts @@ -1,5 +1,8 @@ import type { AgentStatusEntry } from '../../../../shared/agent-status-types' -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { + isTuiAgent, + TUI_AGENT_CONFIG +} from '../../../../shared/agent-launch/catalog/tui-agent-config' import { makePaneKey } from '../../../../shared/stable-pane-id' import type { PaneForegroundAgentEntry } from '../../store/slices/pane-foreground-agent' import type { TerminalPasteTextOptions } from './terminal-paste-model' diff --git a/src/renderer/src/components/terminal-pane/terminal-agent-session-continuation.ts b/src/renderer/src/components/terminal-pane/terminal-agent-session-continuation.ts index c71c27d9dbd..dbbd0f49800 100644 --- a/src/renderer/src/components/terminal-pane/terminal-agent-session-continuation.ts +++ b/src/renderer/src/components/terminal-pane/terminal-agent-session-continuation.ts @@ -7,8 +7,8 @@ import { } from '@/lib/agent-session-continuation' import { useAppStore } from '@/store' import { makePaneKey } from '../../../../shared/stable-pane-id' -import { isTuiAgent } from '../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../shared/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' type PrepareAgentSessionContinuationFromPaneArgs = { diff --git a/src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts b/src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts index 92c66c96b76..becd2e7771b 100644 --- a/src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts +++ b/src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts @@ -9,11 +9,11 @@ import { resolveOwner } from '@/lib/resolve-owner' import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' import { useAppStore } from '@/store' import { makePaneKey } from '../../../../shared/stable-pane-id' -import { TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { getForkAgentLaunchPlatform } from './terminal-agent-session-fork-launch-platform' import { slugifyForWorkspaceName } from '../../../../shared/workspace-name' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getLocalProjectExecutionRuntimeContext } from '@/lib/local-preflight-context' import { copyAgentSessionContext } from '@/lib/copy-agent-session-context' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.ts b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.ts index 79858e29695..bb906d8fccf 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.ts @@ -1,4 +1,7 @@ -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { + isTuiAgent, + TUI_AGENT_CONFIG +} from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveCommittedTitleAgentType } from '../../lib/pane-agent-evidence' import type { PaneForegroundAgentEntry } from '@/store/slices/pane-foreground-agent' diff --git a/src/renderer/src/components/terminal-pane/terminal-keyboard-protocol-pane-agent.ts b/src/renderer/src/components/terminal-pane/terminal-keyboard-protocol-pane-agent.ts index 674d0620c1b..e0bcdcafc1f 100644 --- a/src/renderer/src/components/terminal-pane/terminal-keyboard-protocol-pane-agent.ts +++ b/src/renderer/src/components/terminal-pane/terminal-keyboard-protocol-pane-agent.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' type PaneKeyboardProtocolStartup = { launchAgent?: TuiAgent diff --git a/src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts b/src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts index a6fedfc93a2..f9447d715bf 100644 --- a/src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts +++ b/src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts @@ -30,7 +30,7 @@ import { makePaneKey } from '../../../../shared/stable-pane-id' import { resolveWindowsShiftEnterEncodingForPane } from './terminal-windows-shift-enter' import { hasCtrlEnterCsiUAuthorityForPane } from './terminal-ctrl-enter' import { titleHasExplicitAgentIdentity } from './title-agent-identity' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveTerminalInputHostPlatform } from './terminal-input-host-platform' import { isTerminalPaneLocalWindowsConpty } from './terminal-pane-local-windows-conpty' import { keyboardEventBelongsToScope } from './terminal-keyboard-scope' diff --git a/src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.ts b/src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.ts index 230b715ca63..40a7da012be 100644 --- a/src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.ts +++ b/src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.ts @@ -1,9 +1,12 @@ -import { getTuiAgentDetectCommands, TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { + getTuiAgentDetectCommands, + TUI_AGENT_CONFIG +} from '../../../../shared/agent-launch/catalog/tui-agent-config' import { COMMAND_TOKEN_SCAN_MAX_CHARS, getCommandTokenPathBasename } from '../../../../shared/command-token-scanner' -import { getAgentLaunchCommandToken } from '../../../../shared/agent-command-line-intent' +import { getAgentLaunchCommandToken } from '../../../../shared/agent-launch/startup/agent-command-line-intent' const TERMINAL_STARTUP_COMMAND_EXTENSION_RE = /\.(?:exe|cmd|bat|ps1)$/i // Why: startup commands can carry pasted scripts; classifier work should stay bounded. diff --git a/src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.ts b/src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.ts index de36ff65f0a..baae032f01d 100644 --- a/src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.ts +++ b/src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.ts @@ -1,5 +1,8 @@ import type { AgentType } from '../../../../shared/agent-status-types' -import { isTuiAgent, TUI_AGENT_CONFIG } from '../../../../shared/tui-agent-config' +import { + isTuiAgent, + TUI_AGENT_CONFIG +} from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveCommittedTitleAgentType } from '../../lib/pane-agent-evidence' import type { PaneForegroundAgentEntry } from '@/store/slices/pane-foreground-agent' diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts index 7b6cce84e49..ae54decdc15 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts @@ -5,7 +5,7 @@ import { type RemotePaneLayoutPusher } from './remote-pane-layout-push' import { isTerminalSessionStateSaveFailure } from '../../../../shared/terminal-session-state-save-failure' -import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch-pane-verdict' +import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { appendPaneTerminalError, clearPaneTerminalError } from './terminal-error-accumulation' import { stripSshReconnectOwnedErrorLines } from './TerminalErrorToast' import { updateTerminalRemoteRuntimeRecoveryUiState } from './terminal-remote-runtime-recovery-ui-state' diff --git a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsx b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsx index bd4378d2d6a..eb95447d034 100644 --- a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsx +++ b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsx @@ -1,6 +1,6 @@ import { useId, type Dispatch, type MutableRefObject, type SetStateAction } from 'react' import type { TerminalQuickCommand } from '../../../../shared/terminal-quick-command-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { isTerminalAgentQuickCommand, supportsTerminalAgentQuickCommand diff --git a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx index b2b9b16ddfb..2e766049617 100644 --- a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx +++ b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx @@ -4,7 +4,7 @@ import type { TerminalQuickCommandScope } from '../../../../shared/terminal-quick-command-types' import type { Repo } from '../../../../shared/repo-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getTerminalQuickCommandAction, getTerminalQuickCommandScope, diff --git a/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts b/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts index 82b44ae990a..d9f6f544e3e 100644 --- a/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts +++ b/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts @@ -1,7 +1,7 @@ import type { AgentCatalogEntry } from '@/lib/agent-catalog' import { getAgentCatalog } from '@/lib/agent-catalog' import { supportsTerminalAgentQuickCommand } from '../../../../shared/terminal-quick-commands' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' const QUICK_COMMAND_AGENT_PRESENTATION_ORDER = [ 'claude', diff --git a/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-dialog-draft.ts b/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-dialog-draft.ts index 7a47cc81f07..4aff3bf5380 100644 --- a/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-dialog-draft.ts +++ b/src/renderer/src/components/terminal-quick-commands/terminal-quick-command-dialog-draft.ts @@ -3,7 +3,7 @@ import { isTerminalAgentQuickCommand } from '../../../../shared/terminal-quick-commands' import type { TerminalQuickCommand } from '../../../../shared/terminal-quick-command-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type TerminalQuickCommandDialogAction = 'terminal-command' | 'agent-prompt' diff --git a/src/renderer/src/components/terminal-workspace-keydown.test.ts b/src/renderer/src/components/terminal-workspace-keydown.test.ts index e417ed353aa..5b7d2e12d2b 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.test.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.test.ts @@ -22,7 +22,7 @@ import { agentMenuShortcutLabels } from './tab-bar/agent-menu-shortcut-labels' import { handleTerminalWorkspaceKeyDown } from './terminal-workspace-keydown' import type { TerminalActivationController } from './use-terminal-activation-actions' import type * as AgentTabShortcuts from './terminal-agent-tab-shortcut' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgentTabShortcut } from './terminal-agent-tab-shortcut' import { useTerminalBulkCloseActions } from './use-terminal-bulk-close-actions' import { makeOpenFile, makeUnifiedTab } from '../store/slices/store-session-test-harness' diff --git a/src/renderer/src/hooks/agent-hook-turn-end-ownership.ts b/src/renderer/src/hooks/agent-hook-turn-end-ownership.ts index ac4d8d86899..b2970fecbba 100644 --- a/src/renderer/src/hooks/agent-hook-turn-end-ownership.ts +++ b/src/renderer/src/hooks/agent-hook-turn-end-ownership.ts @@ -2,7 +2,7 @@ import { useAppStore } from '@/store' import { resolveCommittedTitleAgentType } from '@/lib/pane-agent-evidence' import { resolveCompatibleAgentTypeForOwner } from '../../../shared/agent-title-owner' import { isAgentStatusHooksEnabledForAgent } from '../../../shared/agent-status-hooks-setting' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import type { TerminalAgent } from '../../../shared/terminal-agent' import { hookLaneCanAnnouncePaneTurnEnd } from './agent-hook-completion-notifications' import { hookTurnEndEvidence } from './agent-hook-turn-end-capability' diff --git a/src/renderer/src/hooks/composer-state/composer-submit-model.ts b/src/renderer/src/hooks/composer-state/composer-submit-model.ts index e6afadda3b9..2224524e360 100644 --- a/src/renderer/src/hooks/composer-state/composer-submit-model.ts +++ b/src/renderer/src/hooks/composer-state/composer-submit-model.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { QuickSubmitOptions } from './quick-creation-request' import type { GitPushTarget } from '../../../../shared/worktree/types' import type { SetupDecision } from '../../../../shared/worktree/create-types' diff --git a/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts b/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts index 735d0514bb4..98295ae7978 100644 --- a/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts +++ b/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts @@ -28,9 +28,9 @@ type FolderSubmitOrchestrationInput = Pick< > import { useCallback } from 'react' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { settleComposerSubmit } from '@/lib/composer-submit-cancellation' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { submitFolderWorkspaceCreate } from '@/components/sidebar/folder-workspace-composer-submit' import { translate } from '@/i18n/i18n' import { diff --git a/src/renderer/src/hooks/composer-state/host-runtime-effects.ts b/src/renderer/src/hooks/composer-state/host-runtime-effects.ts index 0083c1290c3..e3a5b09bc45 100644 --- a/src/renderer/src/hooks/composer-state/host-runtime-effects.ts +++ b/src/renderer/src/hooks/composer-state/host-runtime-effects.ts @@ -31,7 +31,10 @@ import { readWorkspaceSetupInspection, getComposerSetupInspectionCommit } from '@/lib/workspace-setup-preparation' -import { filterEnabledTuiAgents, isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { + filterEnabledTuiAgents, + isTuiAgentEnabled +} from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getAgentCatalog } from '@/lib/agent-catalog' import { useAppStore } from '@/store' import { isSshConnectInProgress } from '@/lib/new-workspace-ssh-gate' diff --git a/src/renderer/src/hooks/composer-state/identity-model.ts b/src/renderer/src/hooks/composer-state/identity-model.ts index 7bfe03f2f54..89bd5c3fcad 100644 --- a/src/renderer/src/hooks/composer-state/identity-model.ts +++ b/src/renderer/src/hooks/composer-state/identity-model.ts @@ -1,5 +1,5 @@ import type * as React from 'react' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { GitPushTarget } from '../../../../shared/worktree/types' import type { SmartNameMode } from '../../../../shared/new-workspace/smart-workspace-source-results' import type { CreateWorktreeArgs } from '../../../../shared/worktree/create-types' diff --git a/src/renderer/src/hooks/composer-state/quick-creation-execution.ts b/src/renderer/src/hooks/composer-state/quick-creation-execution.ts index 93fa52b928e..717d883bb06 100644 --- a/src/renderer/src/hooks/composer-state/quick-creation-execution.ts +++ b/src/renderer/src/hooks/composer-state/quick-creation-execution.ts @@ -2,7 +2,7 @@ import type { QuickCreationExecutionInput } from './composer-model' import { resolveQuickCreateLinkedWorkItemPrompt } from '@/lib/linked-work-item-context' import { useCallback } from 'react' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' import { useAppStore } from '@/store' import { isWorkspaceStatusAllowedOnHost } from '@/store/host-workspace-status-columns' diff --git a/src/renderer/src/hooks/composer-state/quick-creation-request.ts b/src/renderer/src/hooks/composer-state/quick-creation-request.ts index e628698fd49..b4a8d39d8c1 100644 --- a/src/renderer/src/hooks/composer-state/quick-creation-request.ts +++ b/src/renderer/src/hooks/composer-state/quick-creation-request.ts @@ -1,9 +1,9 @@ import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { AgentStartupPlan } from '../../../../shared/agent-launch/startup/tui-agent-startup' import type { LinkedWorkItemSummary } from '@/lib/new-workspace' import type { TaskSourceContext } from '../../../../shared/task-source-context' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchChoice } from '@/lib/agent-menu-selection' import type { GitPushTarget } from '../../../../shared/worktree/types' import type { SetupDecision } from '../../../../shared/worktree/create-types' diff --git a/src/renderer/src/hooks/composer-state/quick-startup-plan.ts b/src/renderer/src/hooks/composer-state/quick-startup-plan.ts index d6d8c6cf96a..7ea2bee4696 100644 --- a/src/renderer/src/hooks/composer-state/quick-startup-plan.ts +++ b/src/renderer/src/hooks/composer-state/quick-startup-plan.ts @@ -3,17 +3,17 @@ import { resolveQuickCreateLinkedWorkItemPrompt } from '@/lib/linked-work-item-c import type { ComposerModel } from './composer-model' import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { AgentStartupShell } from '../../../../shared/tui-agent-startup-shell' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' import { type AgentStartupPlan, buildAgentDraftLaunchPlan, buildAgentStartupPlan -} from '@/lib/tui-agent-startup' +} from '../../../../shared/agent-launch/startup/tui-agent-startup' -import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { tuiAgentToAgentKind } from '@/lib/telemetry' import { getAgentLabel } from '@/lib/agent-catalog' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/hooks/composer-state/quick-submit-action.ts b/src/renderer/src/hooks/composer-state/quick-submit-action.ts index fb1b93d9a9e..c2ddeab84aa 100644 --- a/src/renderer/src/hooks/composer-state/quick-submit-action.ts +++ b/src/renderer/src/hooks/composer-state/quick-submit-action.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' import type { QuickSubmitOptions } from './quick-creation-request' import { findPendingLinkedWorkItemCreationId } from '@/lib/pending-worktree-creation' diff --git a/src/renderer/src/hooks/composer-state/quick-submit-preparation.ts b/src/renderer/src/hooks/composer-state/quick-submit-preparation.ts index 9fb507890cf..d96ca7e7a01 100644 --- a/src/renderer/src/hooks/composer-state/quick-submit-preparation.ts +++ b/src/renderer/src/hooks/composer-state/quick-submit-preparation.ts @@ -16,7 +16,7 @@ import type { SetupDecision } from '../../../../shared/worktree/create-types' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' import { resolveComposerBranchNameOverrideForCreate } from '../composer-branch-selection' import { resolveWorktreeCreateBaseBranch } from '@/runtime/worktree-create-base' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { PendingSmartGitHubSubmitResolution } from './source-selection-decisions' export function useQuickSubmitPreparation(input: QuickSubmitPreparationInput) { diff --git a/src/renderer/src/hooks/composer-state/quick-submit-source-preparation.ts b/src/renderer/src/hooks/composer-state/quick-submit-source-preparation.ts index 178b748df25..e04ff1061c8 100644 --- a/src/renderer/src/hooks/composer-state/quick-submit-source-preparation.ts +++ b/src/renderer/src/hooks/composer-state/quick-submit-source-preparation.ts @@ -18,10 +18,10 @@ type QuickSubmitSourcePreparationInput = Pick< > import { useCallback } from 'react' -import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getLinkedWorkItemWorkspaceName } from '@/lib/new-workspace' import { getJiraIssueKeyCasingSeedOptions } from '@/lib/jira-issue-key-casing' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { PendingSmartGitHubSubmitResolution } from './source-selection-decisions' export function useQuickSubmitSourcePreparation(input: QuickSubmitSourcePreparationInput) { diff --git a/src/renderer/src/hooks/composer-state/runtime-target-model.ts b/src/renderer/src/hooks/composer-state/runtime-target-model.ts index 13fb875223b..35cd0f0bea3 100644 --- a/src/renderer/src/hooks/composer-state/runtime-target-model.ts +++ b/src/renderer/src/hooks/composer-state/runtime-target-model.ts @@ -3,9 +3,9 @@ import type { RefObject } from 'react' import type { ExecutionHostId, ParsedExecutionHost } from '../../../../shared/execution-host' import type { Repo } from '../../../../shared/repo-types' import type { SshConnectionState, SshConnectionStatus } from '../../../../shared/ssh-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { OrcaVmRecipe } from '../../../../shared/orca-yaml-hook-types' -import type { AgentStartupShell } from '../../../../shared/tui-agent-startup-shell' +import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { ExecutionHostPlatformFact } from '@/lib/execution-host-facts' import type { NewWorkspaceProjectOption } from '@/lib/new-workspace-project-options' import type { ProjectHostSetupOption } from '@/lib/project-host-setup-options' diff --git a/src/renderer/src/hooks/composer-state/runtime-target-selection.ts b/src/renderer/src/hooks/composer-state/runtime-target-selection.ts index f383b856586..3e051a4ce64 100644 --- a/src/renderer/src/hooks/composer-state/runtime-target-selection.ts +++ b/src/renderer/src/hooks/composer-state/runtime-target-selection.ts @@ -8,7 +8,7 @@ import { getSelectedRepoSshGate } from '@/lib/new-workspace-ssh-gate' import { selectRepoSshGateInput } from '@/lib/repo-ssh-connection' import { useFolderWorkspaceComposerPathStatus } from '@/components/sidebar/folder-workspace-composer-path-status' import { useDetectedAgents } from '@/hooks/useDetectedAgents' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { resolveWorkspaceCreationTarget } from '@/lib/project-host-workspace-target' import { isGitRepoKind } from '../../../../shared/repo-kind' import { CLIENT_PLATFORM } from '@/lib/new-workspace' @@ -19,7 +19,7 @@ import { type ExecutionHostPlatformFact } from '@/lib/execution-host-facts' import { useAppStore } from '@/store' -import { repoIsRemote } from '../../../../shared/agent-launch-remote' +import { repoIsRemote } from '../../../../shared/agent-launch/startup/agent-launch-remote' import { buildProjectHostSetupOptions } from '@/lib/project-host-setup-options' import { buildNewWorkspaceCreateTargetOptions } from '@/lib/new-workspace-project-options' import { getRuntimeEnvironmentIdForRepo } from '@/lib/repo-runtime-owner' diff --git a/src/renderer/src/hooks/composer-state/workspace-identity-state.ts b/src/renderer/src/hooks/composer-state/workspace-identity-state.ts index 50a0ee1e015..c461a52e821 100644 --- a/src/renderer/src/hooks/composer-state/workspace-identity-state.ts +++ b/src/renderer/src/hooks/composer-state/workspace-identity-state.ts @@ -23,8 +23,11 @@ import { isBlockingJiraUrlIntent } from '../../../../shared/new-workspace/smart-workspace-source-results' import type { GitPushTarget } from '../../../../shared/worktree/types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { filterEnabledTuiAgents, isTuiAgentEnabled } from '../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { + filterEnabledTuiAgents, + isTuiAgentEnabled +} from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getAgentCatalog } from '@/lib/agent-catalog' import { useAppStore } from '@/store' diff --git a/src/renderer/src/hooks/ipc-events-terminal-create-scenario-types.ts b/src/renderer/src/hooks/ipc-events-terminal-create-scenario-types.ts index 6fa5e107951..c12b905ed88 100644 --- a/src/renderer/src/hooks/ipc-events-terminal-create-scenario-types.ts +++ b/src/renderer/src/hooks/ipc-events-terminal-create-scenario-types.ts @@ -1,6 +1,6 @@ import type { Mock } from 'vitest' import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' // Annotate scenario spy shapes because inferred types cannot be named across module boundaries. diff --git a/src/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.ts b/src/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.ts index a7a6de4158b..0bff83924f0 100644 --- a/src/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.ts +++ b/src/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.ts @@ -1,6 +1,6 @@ import { vi } from 'vitest' import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' type ListenerRef = { current: unknown } diff --git a/src/renderer/src/hooks/ipc-events/agent-launch-tab-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/agent-launch-tab-ipc-bridge.ts index 528dcb6af24..1b642367695 100644 --- a/src/renderer/src/hooks/ipc-events/agent-launch-tab-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/agent-launch-tab-ipc-bridge.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchTabPublishRequest } from '../../../../shared/agent-launch-tab-publication' +import type { AgentLaunchTabPublishRequest } from '../../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { publishAgentLaunchTab } from '@/lib/agent-launch-tab-publication' import { applyAgentLaunchPaneVerdict } from '@/lib/agent-launch-pane-verdict-application' import { keepAgentLaunchTabMainWrote } from '@/lib/agent-launch-tab-main-written' diff --git a/src/renderer/src/hooks/useComposerState.ts b/src/renderer/src/hooks/useComposerState.ts index e44cfbe1491..1d20a29b030 100644 --- a/src/renderer/src/hooks/useComposerState.ts +++ b/src/renderer/src/hooks/useComposerState.ts @@ -2,7 +2,7 @@ import type { RefObject } from 'react' import '@/lib/new-workspace' import type { LinkedWorkItemSummary } from '@/lib/new-workspace' import type { GitHubWorkItem } from '../../../shared/github/work-item-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { QuickSubmitOptions } from './composer-state/quick-creation-request' import type { TaskSourceContext } from '../../../shared/task-source-context' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../shared/workspace-source' diff --git a/src/renderer/src/hooks/useDetectedAgents.ts b/src/renderer/src/hooks/useDetectedAgents.ts index 4cc2ed2cf4f..82872b5db2e 100644 --- a/src/renderer/src/hooks/useDetectedAgents.ts +++ b/src/renderer/src/hooks/useDetectedAgents.ts @@ -3,7 +3,7 @@ import { useAppStore } from '@/store' import { getLocalAgentPreflightContext } from '@/lib/local-preflight-context' import { localAgentInventoryContextKey } from '@/lib/local-preflight-context-key' import { runtimeHostContactForEntry } from '../../../shared/runtime-host-contact' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' export type UseDetectedAgentsResult = { diff --git a/src/renderer/src/lib/active-agent-note-send-delivery.ts b/src/renderer/src/lib/active-agent-note-send-delivery.ts index 2d9e88ae507..105709a6a9b 100644 --- a/src/renderer/src/lib/active-agent-note-send-delivery.ts +++ b/src/renderer/src/lib/active-agent-note-send-delivery.ts @@ -1,11 +1,8 @@ import type { RuntimeTerminalSend } from '../../../shared/runtime-types' import { sanitizeTerminalPasteText } from '@/components/terminal-pane/terminal-bracketed-paste' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' -import { - BRACKETED_PASTE_BEGIN, - BRACKETED_PASTE_END, - POST_PASTE_SUBMIT_DELAY_MS -} from './agent-paste-draft' +import { BRACKETED_PASTE_BEGIN, BRACKETED_PASTE_END } from './agent-paste-draft' +import { AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS as POST_PASTE_SUBMIT_DELAY_MS } from '../../../shared/agent-launch/startup/agent-prompt-injection' import type { ActiveAgentNotesSendResult } from './active-agent-note-send-result' import { ACTIVE_AGENT_SEND_RPC_TIMEOUT_MS, diff --git a/src/renderer/src/lib/agent-account-restart-startup.test.ts b/src/renderer/src/lib/agent-account-restart-startup.test.ts index b6613c482f0..1bc235f5279 100644 --- a/src/renderer/src/lib/agent-account-restart-startup.test.ts +++ b/src/renderer/src/lib/agent-account-restart-startup.test.ts @@ -3,7 +3,7 @@ import type { AgentStatusEntry } from '../../../shared/agent-status-types' import { useAppStore } from '@/store' import { makePaneKey } from '../../../shared/stable-pane-id' import { getDefaultSettings } from '../../../shared/constants' -import { resolveTuiAgentLaunchArgs } from '../../../shared/tui-agent-launch-defaults' +import { resolveTuiAgentLaunchArgs } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { getWorkspaceRuntimePreference, resolveProjectExecutionRuntime, diff --git a/src/renderer/src/lib/agent-account-restart-startup.ts b/src/renderer/src/lib/agent-account-restart-startup.ts index 7f5c3710d2b..08ee162be33 100644 --- a/src/renderer/src/lib/agent-account-restart-startup.ts +++ b/src/renderer/src/lib/agent-account-restart-startup.ts @@ -1,6 +1,6 @@ import { getConnectionIdFromState } from '@/lib/connection-owner-resolution' import { useAppStore, type AppState } from '@/store' -import { buildAgentResumeStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-resume-startup' import { resolveRuntimeHostReportedPlatform, resolveRuntimeHostTerminalWindowsShell, @@ -22,11 +22,11 @@ import { import { resolveTuiAgentLaunchRawArgs, resolveTuiAgentLaunchEnv -} from '../../../shared/tui-agent-launch-defaults' +} from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import type { AccountRestartAgent } from '@/store/terminals/terminal-contracts' import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime' -import { resolveAgentLaunchCommand } from '../../../shared/tui-agent-launch-command' -import { resolveStartupShell } from '../../../shared/tui-agent-startup-shell' +import { resolveAgentLaunchCommand } from '../../../shared/agent-launch/startup/tui-agent-launch-command' +import { resolveStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' export type AgentAccountRestartStartup = { command: string diff --git a/src/renderer/src/lib/agent-background-draft-delivery.ts b/src/renderer/src/lib/agent-background-draft-delivery.ts index 6976745c30d..c8d1b9d8ce8 100644 --- a/src/renderer/src/lib/agent-background-draft-delivery.ts +++ b/src/renderer/src/lib/agent-background-draft-delivery.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { pasteDraftWhenAgentReady } from '@/lib/agent-paste-draft' import { showAutomationPromptNotSentToast } from '@/lib/agent-background-session-timeout-toast' diff --git a/src/renderer/src/lib/agent-background-session-contract.ts b/src/renderer/src/lib/agent-background-session-contract.ts index 7f407e2e8b1..a6e9a0d7909 100644 --- a/src/renderer/src/lib/agent-background-session-contract.ts +++ b/src/renderer/src/lib/agent-background-session-contract.ts @@ -1,7 +1,7 @@ import type { ParsedAgentStatusPayload } from '../../../shared/agent-status-types' import type { LaunchSource } from '../../../shared/telemetry-events' -import type { TuiAgent } from '../../../shared/tui-agent' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import type { AgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import type { AutomationTerminalOwnership } from '@/lib/automation-terminal-ownership' import type { Repo } from '../../../shared/repo-types' import type { Worktree } from '../../../shared/worktree/types' diff --git a/src/renderer/src/lib/agent-background-session-launch-host.test.ts b/src/renderer/src/lib/agent-background-session-launch-host.test.ts index 77343984a67..4ea1110c175 100644 --- a/src/renderer/src/lib/agent-background-session-launch-host.test.ts +++ b/src/renderer/src/lib/agent-background-session-launch-host.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { buildAgentStartupPlan } from '../../../shared/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import { resolveAgentBackgroundLaunchHost } from './agent-background-session-launch-host' function sshState(remotePlatform: 'linux' | 'win32') { diff --git a/src/renderer/src/lib/agent-background-session-launch-host.ts b/src/renderer/src/lib/agent-background-session-launch-host.ts index f7e5d507800..99eb4aee9a2 100644 --- a/src/renderer/src/lib/agent-background-session-launch-host.ts +++ b/src/renderer/src/lib/agent-background-session-launch-host.ts @@ -13,7 +13,7 @@ import { } from '@/lib/execution-host-facts' import { getFolderWorkspaceConnectionId } from '@/lib/folder-workspace-connection' import { parseWorkspaceKey } from '../../../shared/workspace-scope' -import { launchHostIsRemote } from '../../../shared/agent-launch-remote' +import { launchHostIsRemote } from '../../../shared/agent-launch/startup/agent-launch-remote' import { getRepoExecutionHostId, getRepoSshConnectionId, diff --git a/src/renderer/src/lib/agent-background-session-test-state.ts b/src/renderer/src/lib/agent-background-session-test-state.ts index 44e60c80f7d..2a61307f4d0 100644 --- a/src/renderer/src/lib/agent-background-session-test-state.ts +++ b/src/renderer/src/lib/agent-background-session-test-state.ts @@ -1,5 +1,5 @@ import { expect, vi } from 'vitest' -import { projectAgentLaunchSettings } from '../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../shared/agent-launch/choices/agent-launch-settings' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { createCompatibleRuntimeStatusResponseIfNeeded } from '@/runtime/runtime-compatibility-test-fixture' import { clearRuntimeCompatibilityCacheForTests } from '@/runtime/runtime-rpc-client' diff --git a/src/renderer/src/lib/agent-background-session-timeout-toast.ts b/src/renderer/src/lib/agent-background-session-timeout-toast.ts index 71870958fd7..630760cf3f6 100644 --- a/src/renderer/src/lib/agent-background-session-timeout-toast.ts +++ b/src/renderer/src/lib/agent-background-session-timeout-toast.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { track, tuiAgentToAgentKind } from '@/lib/telemetry' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export function showAutomationPromptNotSentToast(agent: TuiAgent): void { toast.message( diff --git a/src/renderer/src/lib/agent-catalog-entries-primary.ts b/src/renderer/src/lib/agent-catalog-entries-primary.ts index 97d466543a1..99ac9c94ac1 100644 --- a/src/renderer/src/lib/agent-catalog-entries-primary.ts +++ b/src/renderer/src/lib/agent-catalog-entries-primary.ts @@ -1,6 +1,9 @@ import { getCatalogPlatform } from './agent-catalog-platform' import openClaudeLogoUrl from '../../../../resources/openclaude-logo.png?url' -import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { + getTuiAgentLaunchCommand, + TUI_AGENT_CONFIG +} from '../../../shared/agent-launch/catalog/tui-agent-config' import { translate } from '@/i18n/i18n' import type { AgentCatalogEntry } from './agent-catalog' diff --git a/src/renderer/src/lib/agent-catalog-entries.ts b/src/renderer/src/lib/agent-catalog-entries.ts index a3347bfdbc0..b3f5e0576e7 100644 --- a/src/renderer/src/lib/agent-catalog-entries.ts +++ b/src/renderer/src/lib/agent-catalog-entries.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_FAVICON_DOMAINS } from '../../../shared/tui-agent-favicon-domains' +import { TUI_AGENT_FAVICON_DOMAINS } from '../../../shared/agent-launch/catalog/tui-agent-favicon-domains' import { primaryAgentCatalogEntries } from './agent-catalog-entries-primary' import { secondaryAgentCatalogEntries } from './agent-catalog-entries-secondary' import type { AgentCatalogEntry } from './agent-catalog' diff --git a/src/renderer/src/lib/agent-catalog.tsx b/src/renderer/src/lib/agent-catalog.tsx index fee7a07d89c..2a85b2100f9 100644 --- a/src/renderer/src/lib/agent-catalog.tsx +++ b/src/renderer/src/lib/agent-catalog.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { ClaudeIcon, DroidIcon, OpenAIIcon } from '@/components/status-bar/icons' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../../shared/terminal-agent' import { formatAgentTypeLabel } from '../../../shared/agent-type-label' import { diff --git a/src/renderer/src/lib/agent-detection-target-inventory.test.ts b/src/renderer/src/lib/agent-detection-target-inventory.test.ts index 95c5baf9e33..af2a3e29ef0 100644 --- a/src/renderer/src/lib/agent-detection-target-inventory.test.ts +++ b/src/renderer/src/lib/agent-detection-target-inventory.test.ts @@ -3,7 +3,7 @@ import { createTestStore } from '@/store/slices/store-test-helpers' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' import { makeWorktree, TEST_REPO } from '@/store/slices/worktrees-slice-test-fixtures' import type { Repo } from '../../../shared/repo-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { ensureDetectedAgentsForWorktree, readDetectedAgentsForWorktree diff --git a/src/renderer/src/lib/agent-detection-target-inventory.ts b/src/renderer/src/lib/agent-detection-target-inventory.ts index f46882685b2..a9d55c8dfaf 100644 --- a/src/renderer/src/lib/agent-detection-target-inventory.ts +++ b/src/renderer/src/lib/agent-detection-target-inventory.ts @@ -12,7 +12,7 @@ import { } from '@/hooks/useAgentDetectionTarget' import { getRuntimeAgentInventoryKey } from '@/store/slices/runtime-agent-inventory-key' import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' type DetectionReadState = Pick< AppState, diff --git a/src/renderer/src/lib/agent-draft-readiness.ts b/src/renderer/src/lib/agent-draft-readiness.ts index 9ed8f02cd03..17ed2f0c07f 100644 --- a/src/renderer/src/lib/agent-draft-readiness.ts +++ b/src/renderer/src/lib/agent-draft-readiness.ts @@ -1,4 +1,4 @@ -import type { DraftPasteReadySignal } from '../../../shared/tui-agent-config' +import type { DraftPasteReadySignal } from '../../../shared/agent-launch/catalog/tui-agent-config-types' import { subscribeToPtyData } from '@/components/terminal-pane/pty-data-sidecar-subscriptions' import { replayPreHandlerPtyData } from '@/components/terminal-pane/pty-pre-handler-buffer' import { isRemoteRuntimePtyId } from '../../../shared/remote-runtime/remote-runtime-pty-id' diff --git a/src/renderer/src/lib/agent-favicon-assets.ts b/src/renderer/src/lib/agent-favicon-assets.ts index f1d3793a886..718fbbdad6e 100644 --- a/src/renderer/src/lib/agent-favicon-assets.ts +++ b/src/renderer/src/lib/agent-favicon-assets.ts @@ -1,5 +1,5 @@ import qoderUrl from '../../../shared/agent-icons/qoder.png?url' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import grokUrl from '../../../shared/agent-icons/grok.png?url' import mimoCodeUrl from '../../../shared/agent-icons/mimo-code.png?url' import anteUrl from '../../../shared/agent-icons/ante.png?url' diff --git a/src/renderer/src/lib/agent-followup-delivery.test.ts b/src/renderer/src/lib/agent-followup-delivery.test.ts index fae5855e9eb..202176c0f57 100644 --- a/src/renderer/src/lib/agent-followup-delivery.test.ts +++ b/src/renderer/src/lib/agent-followup-delivery.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { sendFollowupPromptWhenAgentReady } from './agent-followup-delivery' import { inspectRuntimeTerminalProcess } from '@/runtime/runtime-terminal-inspection' import { pasteDraftToAgentPtyWhenReady } from '@/lib/agent-paste-draft' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' vi.mock('@/runtime/runtime-terminal-inspection', () => ({ inspectRuntimeTerminalProcess: vi.fn() diff --git a/src/renderer/src/lib/agent-followup-delivery.ts b/src/renderer/src/lib/agent-followup-delivery.ts index 2af1ac89d62..caf24eb577b 100644 --- a/src/renderer/src/lib/agent-followup-delivery.ts +++ b/src/renderer/src/lib/agent-followup-delivery.ts @@ -1,6 +1,6 @@ import { inspectRuntimeTerminalProcess } from '@/runtime/runtime-terminal-inspection' import { pasteDraftToAgentPtyWhenReady } from '@/lib/agent-paste-draft' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { isAgentForegroundWrapperProcess, isExpectedAgentProcess diff --git a/src/renderer/src/lib/agent-hibernation-pane-eligibility.ts b/src/renderer/src/lib/agent-hibernation-pane-eligibility.ts index 9f7602dd9db..a6191636143 100644 --- a/src/renderer/src/lib/agent-hibernation-pane-eligibility.ts +++ b/src/renderer/src/lib/agent-hibernation-pane-eligibility.ts @@ -1,5 +1,5 @@ import type { AgentStatusEntry } from '../../../shared/agent-status-types' -import { getAgentResumeArgv } from '../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../shared/agent-launch/startup/agent-resume-argv' import { isResumableTuiAgent } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { parsePaneKey } from '../../../shared/stable-pane-id' import type { TerminalLayoutSnapshot, TerminalTab } from '../../../shared/terminal-tab-types' diff --git a/src/renderer/src/lib/agent-launch-caller-permissions.test.ts b/src/renderer/src/lib/agent-launch-caller-permissions.test.ts index d37bfe41354..2e81ad29868 100644 --- a/src/renderer/src/lib/agent-launch-caller-permissions.test.ts +++ b/src/renderer/src/lib/agent-launch-caller-permissions.test.ts @@ -1,7 +1,7 @@ // Permission bypass lives only in the arguments string; verify each caller’s final argv so it cannot be silently lost. import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { createLaunchFunnelStore, diff --git a/src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts b/src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts index c36dd951d25..2d597d3e590 100644 --- a/src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts +++ b/src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts @@ -1,7 +1,7 @@ // Cross each caller’s delivery mode with agent injection policy to verify argv, paste or environment transport and submission. import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { createLaunchFunnelStore, diff --git a/src/renderer/src/lib/agent-launch-caller-routing.test.ts b/src/renderer/src/lib/agent-launch-caller-routing.test.ts index 971ff6b35a6..8d375ee93a4 100644 --- a/src/renderer/src/lib/agent-launch-caller-routing.test.ts +++ b/src/renderer/src/lib/agent-launch-caller-routing.test.ts @@ -18,7 +18,7 @@ import { import type * as LaunchAdmissionModule from './agent-session/launch/structured-agent-session-launch-admission' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' const store = createLaunchFunnelStore() const mockIsWebRuntimeSessionActive = vi.fn(() => false) const mockLaunchAgentInWebHostTab = vi.fn() diff --git a/src/renderer/src/lib/agent-launch-pane-verdict-application.test.ts b/src/renderer/src/lib/agent-launch-pane-verdict-application.test.ts index c223bbf80db..8079fe13a04 100644 --- a/src/renderer/src/lib/agent-launch-pane-verdict-application.test.ts +++ b/src/renderer/src/lib/agent-launch-pane-verdict-application.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as AgentStatusModule from '@/lib/agent-status' -import type { AgentLaunchPaneVerdict } from '../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdict } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { createTabsSliceMockApi } from '../store/slices/tabs-slice-test-harness' import { createTestStore } from '../store/slices/store-test-helpers' diff --git a/src/renderer/src/lib/agent-launch-pane-verdict-application.ts b/src/renderer/src/lib/agent-launch-pane-verdict-application.ts index e8d4bbd59f9..9e8c498d4df 100644 --- a/src/renderer/src/lib/agent-launch-pane-verdict-application.ts +++ b/src/renderer/src/lib/agent-launch-pane-verdict-application.ts @@ -1,6 +1,6 @@ /** Apply main’s typed spawn/takeback verdicts, retaining final pane outcomes until session cleanup. */ -import type { AgentLaunchPaneVerdictEvent } from '../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdictEvent } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import { applyClosedTerminalLeafNotice } from '@/components/terminal-pane/closed-terminal-leaf-notice' import { collectLeafIdsInOrder } from '@/components/terminal-pane/terminal-layout-leaf-ids' import { useAppStore } from '@/store' diff --git a/src/renderer/src/lib/agent-launch-prompt-delivery.ts b/src/renderer/src/lib/agent-launch-prompt-delivery.ts index fe85d7d712a..bd4a64cd144 100644 --- a/src/renderer/src/lib/agent-launch-prompt-delivery.ts +++ b/src/renderer/src/lib/agent-launch-prompt-delivery.ts @@ -3,7 +3,7 @@ import { pasteDraftWhenAgentReady } from '@/lib/agent-paste-draft' import { canMirrorLaunchDraftToNativeChat } from '../../../shared/native-chat/input/native-chat-launch-draft-mirrorability' import { isNativeChatSupportedAgent } from '../../../shared/native-chat/native-chat-agent-support' import { useAppStore } from '@/store' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' /** Mirror TUI-only launch context into supported native-chat composers, using the same eligibility predicate as chat opening. */ export function seedNativeChatLaunchDraftForAgentTab(args: { diff --git a/src/renderer/src/lib/agent-launch-route-input.ts b/src/renderer/src/lib/agent-launch-route-input.ts index c44e6d05371..85a568b9fec 100644 --- a/src/renderer/src/lib/agent-launch-route-input.ts +++ b/src/renderer/src/lib/agent-launch-route-input.ts @@ -7,7 +7,7 @@ import { import type { AppState } from '@/store/types' import { findWorktreeById } from '@/store/slices/worktree-helpers' import { requestsCwdOutsideWorkspaceRootForWorkspace } from '../../../shared/terminal-startup-cwd' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { workspaceKindForWorktreeId } from '../../../shared/workspace-launch-kind' import type { AgentLaunchRoutingInput } from '@/lib/agent-launch-routing' // Import the resolver directly: the connection-context facade reaches the store root and creates a launch-graph cycle. diff --git a/src/renderer/src/lib/agent-launch-route-registered-agents.test.ts b/src/renderer/src/lib/agent-launch-route-registered-agents.test.ts index 3233c7f2c02..55f414e3a6d 100644 --- a/src/renderer/src/lib/agent-launch-route-registered-agents.test.ts +++ b/src/renderer/src/lib/agent-launch-route-registered-agents.test.ts @@ -8,7 +8,7 @@ import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '. import type { RuntimeCapability } from '../../../shared/protocol-version' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { RuntimeEnvironmentStatus } from '../../../shared/runtime-host-status' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' const mocks = vi.hoisted(() => ({ readLocalRuntimeCapabilitiesOrUnknown: vi.fn(), diff --git a/src/renderer/src/lib/agent-launch-routing.ts b/src/renderer/src/lib/agent-launch-routing.ts index e3aec3f961d..ce938ad1d3d 100644 --- a/src/renderer/src/lib/agent-launch-routing.ts +++ b/src/renderer/src/lib/agent-launch-routing.ts @@ -5,7 +5,7 @@ import { type NativeChatDefaultSettings, type StructuredNativeChatBlocker } from '../../../shared/structured-native-chat-launch-route' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceLaunchKind } from '../../../shared/workspace-launch-kind' import type { NativeChatLaunchPromptDelivery } from '@/lib/native-chat-launch-prompt-delivery' diff --git a/src/renderer/src/lib/agent-launch-tab-main-written.test.ts b/src/renderer/src/lib/agent-launch-tab-main-written.test.ts index d3aabf178df..e873e604a04 100644 --- a/src/renderer/src/lib/agent-launch-tab-main-written.test.ts +++ b/src/renderer/src/lib/agent-launch-tab-main-written.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as AgentStatusModule from '@/lib/agent-status' -import type { AgentLaunchTabPublishRequest } from '../../../shared/agent-launch-tab-publication' +import type { AgentLaunchTabPublishRequest } from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { createTabsSliceMockApi } from '../store/slices/tabs-slice-test-harness' import { createTestStore } from '../store/slices/store-test-helpers' diff --git a/src/renderer/src/lib/agent-launch-tab-main-written.ts b/src/renderer/src/lib/agent-launch-tab-main-written.ts index 9ce97730d3a..44e2c2df892 100644 --- a/src/renderer/src/lib/agent-launch-tab-main-written.ts +++ b/src/renderer/src/lib/agent-launch-tab-main-written.ts @@ -1,10 +1,10 @@ /** Main owns tab creation/closure; attach this window’s session-only prompt, pane verdict and presentation state when its frame draws, retaining them for undrawn workspaces. */ -import type { AgentLaunchPaneVerdictEvent } from '../../../shared/agent-launch-pane-verdict' +import type { AgentLaunchPaneVerdictEvent } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../../shared/agent-launch-tab-publication' +} from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import type { TerminalTab } from '../../../shared/terminal-tab-types' import { useAppStore } from '../store' import { presentAgentLaunchTab } from './agent-launch-tab-presentation' diff --git a/src/renderer/src/lib/agent-launch-tab-presentation.ts b/src/renderer/src/lib/agent-launch-tab-presentation.ts index 90cfdfd39e3..eb2345bbf34 100644 --- a/src/renderer/src/lib/agent-launch-tab-presentation.ts +++ b/src/renderer/src/lib/agent-launch-tab-presentation.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchTabViewerRule } from '../../../shared/agent-launch-tab-publication' +import type { AgentLaunchTabViewerRule } from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { focusTerminalInitiatedTab } from '../hooks/ipc-events/terminal-command-state' import { useAppStore } from '../store' import { revealWorkspaceSurface } from './workspace-surface-reveal' diff --git a/src/renderer/src/lib/agent-launch-tab-publication.test.ts b/src/renderer/src/lib/agent-launch-tab-publication.test.ts index 892d1e76fd1..d6a90138619 100644 --- a/src/renderer/src/lib/agent-launch-tab-publication.test.ts +++ b/src/renderer/src/lib/agent-launch-tab-publication.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as AgentStatusModule from '@/lib/agent-status' -import type { AgentLaunchTabPublishRequest } from '../../../shared/agent-launch-tab-publication' +import type { AgentLaunchTabPublishRequest } from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { createTabsSliceMockApi } from '../store/slices/tabs-slice-test-harness' import { createTestStore } from '../store/slices/store-test-helpers' diff --git a/src/renderer/src/lib/agent-launch-tab-publication.ts b/src/renderer/src/lib/agent-launch-tab-publication.ts index 05492aacb76..cde6f9289f1 100644 --- a/src/renderer/src/lib/agent-launch-tab-publication.ts +++ b/src/renderer/src/lib/agent-launch-tab-publication.ts @@ -1,10 +1,10 @@ /** Publish under host-reserved IDs before the agent exists so PTY routing names this pane and retries reuse its tab; the pane’s spawn waits in main and attaches to the host’s process. */ -import type { AgentLaunchPlacementReceipt } from '../../../shared/agent-launch-intent' +import type { AgentLaunchPlacementReceipt } from '../../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentLaunchTabPublished, AgentLaunchTabPublishRequest -} from '../../../shared/agent-launch-tab-publication' +} from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import { folderWorkspaceToWorktree } from '../../../shared/folder-workspace-worktree' import { presentAgentLaunchTab } from './agent-launch-tab-presentation' import { useAppStore } from '../store' diff --git a/src/renderer/src/lib/agent-launch-through-host.test.ts b/src/renderer/src/lib/agent-launch-through-host.test.ts index f0ac18f482a..f2d8f215b37 100644 --- a/src/renderer/src/lib/agent-launch-through-host.test.ts +++ b/src/renderer/src/lib/agent-launch-through-host.test.ts @@ -4,8 +4,8 @@ import { createTabsSliceMockApi } from '../store/slices/tabs-slice-test-harness' import { createTestStore } from '../store/slices/store-test-helpers' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { buildAgentStartupPlan } from '../../../shared/tui-agent-startup' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) vi.mock('@/lib/agent-status', async (importOriginal) => ({ diff --git a/src/renderer/src/lib/agent-launch-through-host.ts b/src/renderer/src/lib/agent-launch-through-host.ts index c32b6206410..6c2bdcac07a 100644 --- a/src/renderer/src/lib/agent-launch-through-host.ts +++ b/src/renderer/src/lib/agent-launch-through-host.ts @@ -6,7 +6,7 @@ import { persistAgentLaunchTabOrder } from '@/lib/launch-agent-tab-order' import { rememberAgentLaunchPanePrompt } from '@/lib/agent-launch-pane-prompt' import { awaitAgentLaunchPaneStart } from '@/lib/agent-launch-pane-start' import { seedNativeChatAppliedSessionOptions } from '../../../shared/native-chat/input/native-chat-session-option-cache' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../shared/telemetry-events' import type { Tab } from '../../../shared/tab-types' import type { SessionOptionValue } from '../../../shared/native-chat/input/native-chat-session-options' diff --git a/src/renderer/src/lib/agent-menu-selection.ts b/src/renderer/src/lib/agent-menu-selection.ts index 6b45797a5fc..8a7cdaae5fd 100644 --- a/src/renderer/src/lib/agent-menu-selection.ts +++ b/src/renderer/src/lib/agent-menu-selection.ts @@ -1,9 +1,12 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../shared/execution-host' import { nativeChatPreferenceFor } from '../../../shared/structured-native-chat-launch-route' import type { AgentLaunchSurface } from './agent-session-launch-plan' import type { AgentLaunchRoute } from './agent-launch-routing' -import type { HostChatAnswer, NewTabAgentMenuSettings } from './new-tab-agent-menu-rows' +import type { + HostChatAnswer, + NewTabAgentMenuSettings +} from '../../../shared/agent-launch/picker/agent-launch-picker-rows' /** Accepted renderer intent; route and explicitness remain distinct through admission. */ export type AgentLaunchChoice = { diff --git a/src/renderer/src/lib/agent-native-draft-prefill.ts b/src/renderer/src/lib/agent-native-draft-prefill.ts index 362ce1e7cbb..b45b7c8925d 100644 --- a/src/renderer/src/lib/agent-native-draft-prefill.ts +++ b/src/renderer/src/lib/agent-native-draft-prefill.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from '../../../shared/tui-agent' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' // Native flag/env prefill intentionally skips paste unless forcePaste is set; false then means delivered natively, not paste failure. export function agentDeliversDraftViaNativePrefill( diff --git a/src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts b/src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts index 492538b6f76..cd69d836a69 100644 --- a/src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts +++ b/src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts @@ -2,10 +2,10 @@ import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest' import { AGENT_DRAFT_PASTE_DIRECT_MAX_BYTES, pasteDraftWhenAgentReady, - POST_PASTE_SUBMIT_DELAY_MS, sendAgentDraftPasteContent } from './agent-paste-draft' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS as POST_PASTE_SUBMIT_DELAY_MS } from '../../../shared/agent-launch/startup/agent-prompt-injection' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' import type * as RemoteRuntimePtyIdModule from '../../../shared/remote-runtime/remote-runtime-pty-id' const testState = vi.hoisted(() => ({ diff --git a/src/renderer/src/lib/agent-paste-draft.test.ts b/src/renderer/src/lib/agent-paste-draft.test.ts index 97bf62c417a..15eb1b92afb 100644 --- a/src/renderer/src/lib/agent-paste-draft.test.ts +++ b/src/renderer/src/lib/agent-paste-draft.test.ts @@ -7,12 +7,12 @@ import { iterateAgentDraftPasteContentChunks, pasteDraftToAgentPtyWhenReady, pasteDraftWhenAgentReady, - POST_PASTE_SUBMIT_DELAY_MS, sendAgentDraftPasteContent, sendBracketedPasteToRunningAgent, submitPromptToAgentPty } from './agent-paste-draft' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS as POST_PASTE_SUBMIT_DELAY_MS } from '../../../shared/agent-launch/startup/agent-prompt-injection' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' import type * as RemoteRuntimePtyIdModule from '../../../shared/remote-runtime/remote-runtime-pty-id' const testState = vi.hoisted(() => ({ diff --git a/src/renderer/src/lib/agent-paste-draft.ts b/src/renderer/src/lib/agent-paste-draft.ts index d8e8a1516a3..99e1c842c58 100644 --- a/src/renderer/src/lib/agent-paste-draft.ts +++ b/src/renderer/src/lib/agent-paste-draft.ts @@ -1,7 +1,7 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { TerminalInputKind } from '../../../shared/terminal-input-kind' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' -import { AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS } from '../../../shared/agent-prompt-injection' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' +import { AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS } from '../../../shared/agent-launch/startup/agent-prompt-injection' import { resolveDraftPasteReadyTimeoutMs } from '../../../shared/draft-paste-ready-timeout' import { resolvePasteReadySignal } from '../../../shared/draft-paste-ready-scanner' import { useAppStore } from '@/store' @@ -29,7 +29,7 @@ export { // Bracketed paste keeps prompt insertion atomic; callers separately choose whether to submit with Enter. export const BRACKETED_PASTE_BEGIN = BRACKETED_PASTE_START export { BRACKETED_PASTE_END } -export const POST_PASTE_SUBMIT_DELAY_MS = AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS +const POST_PASTE_SUBMIT_DELAY_MS = AGENT_PROMPT_POST_PASTE_SUBMIT_DELAY_MS // Budget PTY creation and composer readiness separately: slow spawn must neither consume composer grace nor delay failed-launch reporting (STA-3367). const PTY_SPAWN_TIMEOUT_MS = 8000 diff --git a/src/renderer/src/lib/agent-ready-wait.test.ts b/src/renderer/src/lib/agent-ready-wait.test.ts index 2835bd12085..2c413a61349 100644 --- a/src/renderer/src/lib/agent-ready-wait.test.ts +++ b/src/renderer/src/lib/agent-ready-wait.test.ts @@ -13,7 +13,7 @@ vi.mock('@/runtime/runtime-terminal-inspection', () => ({ inspectRuntimeTerminalProcess: vi.fn() })) -vi.mock('./tui-agent-startup', () => ({ +vi.mock('../../../shared/shell-process-detection', () => ({ isShellProcess: vi.fn(() => false) })) diff --git a/src/renderer/src/lib/agent-ready-wait.ts b/src/renderer/src/lib/agent-ready-wait.ts index 859e5ea3b2d..7bc2e6c9a83 100644 --- a/src/renderer/src/lib/agent-ready-wait.ts +++ b/src/renderer/src/lib/agent-ready-wait.ts @@ -1,6 +1,6 @@ import { classifyTitleActivity } from '@/lib/pane-agent-evidence' import { isExpectedAgentProcess } from '../../../shared/agent-process-recognition' -import { isShellProcess } from './tui-agent-startup' +import { isShellProcess } from '../../../shared/shell-process-detection' import { useAppStore } from '@/store' import { inspectRuntimeTerminalProcess } from '@/runtime/runtime-terminal-inspection' diff --git a/src/renderer/src/lib/agent-resume-launch-target.ts b/src/renderer/src/lib/agent-resume-launch-target.ts index 93c4570a272..e78c2baf50a 100644 --- a/src/renderer/src/lib/agent-resume-launch-target.ts +++ b/src/renderer/src/lib/agent-resume-launch-target.ts @@ -7,7 +7,7 @@ import { isWindowsAbsolutePathLike } from '../../../shared/cross-platform-path' import { resolveHostAgentStartupShell } from '../../../shared/windows-terminal-shell' import type { AppState } from '@/store/types' import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' export type AgentResumeLaunchTarget = { platform: NodeJS.Platform diff --git a/src/renderer/src/lib/agent-session-continuation.ts b/src/renderer/src/lib/agent-session-continuation.ts index 171fdabf4ed..6aa59263e40 100644 --- a/src/renderer/src/lib/agent-session-continuation.ts +++ b/src/renderer/src/lib/agent-session-continuation.ts @@ -1,7 +1,7 @@ import { splitOpenCodeSqliteCandidate } from '../../../shared/opencode-sqlite-session-path' import { buildBoundedSessionTranscript } from '@/lib/agent-session-fork-context' import type { LaunchSource } from '../../../shared/telemetry-events' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export type AgentSessionContinuationContextMode = 'focused' | 'full' diff --git a/src/renderer/src/lib/agent-session-launch-plan.ts b/src/renderer/src/lib/agent-session-launch-plan.ts index d3e7d398f8b..2117bc6d3fb 100644 --- a/src/renderer/src/lib/agent-session-launch-plan.ts +++ b/src/renderer/src/lib/agent-session-launch-plan.ts @@ -1,6 +1,6 @@ import type { StructuredLaunchSurfaceAddress } from './agent-session/launch/structured-agent-session-launch-record' import type { StructuredAgentSessionResumeSource } from '../../../shared/agent-session/structured-agent-session-create' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { isLocalExecutionHost, parseExecutionHostId, diff --git a/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts b/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts index 3fc57e3800d..73204358c93 100644 --- a/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts +++ b/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts @@ -1,6 +1,6 @@ import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { buildAgentAvailabilitySettingsUpdate } from '../../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { buildAgentAvailabilitySettingsUpdate } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' export type AgentAvailabilityUpdateQueueOptions = { getSettings: () => GlobalSettings | null | undefined diff --git a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.test.tsx b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.test.tsx index 0b5140657a0..c6ed4f9e076 100644 --- a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.test.tsx +++ b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.test.tsx @@ -2,14 +2,14 @@ import userEvent from '@testing-library/user-event' import { cleanup, fireEvent, render, screen, within } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch/choices/agent-launch-settings' import { createGlobalSettingsFixture } from '../../../../../shared/global-settings-test-fixture' import { normalizeNativeChatProviderChoices } from '../../../../../shared/native-chat/native-chat-providers' import { nativeChatPreferenceFor } from '../../../../../shared/structured-native-chat-launch-route' import { installManagedRuntime } from '@/runtime/managed-runtime-install-status' -import { buildNewTabAgentMenuRows } from '../../../../../shared/agent-launch-picker-rows' +import { buildNewTabAgentMenuRows } from '../../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ManagedRuntimeInstallObservation } from '@/runtime/use-managed-runtime-install' import type * as HostChatProgramModule from '@/lib/host-chat-program' import type * as ManagedRuntimeInstallModule from '@/runtime/managed-runtime-install-status' diff --git a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts index 84c644e5d75..0a3d7dc2351 100644 --- a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts +++ b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts @@ -7,8 +7,8 @@ import { normalizeNativeChatProviderChoices } from '../../../../../shared/native-chat/native-chat-providers' import { nativeChatPreferenceFor } from '../../../../../shared/structured-native-chat-launch-route' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { isTuiAgentEnabled } from '../../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgentEnabled } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' import { chatProviderAgents } from '@/lib/chat-provider-agents' import { useAppStore } from '../../../store/index' import { createAgentSettingsUpdateQueue } from './agent-settings-update-queue' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-host-admission.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-host-admission.ts index a10535c557b..0d8028a9b77 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-host-admission.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-host-admission.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isAgentSessionCreateAdmissionRefusal, isDefinitiveAgentSessionCreateRefusal diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts index bb3e1177999..21820a90ad0 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts @@ -1,7 +1,7 @@ // The toasts a host-admitted launch shows when its host declines or can't be reached. import { toast } from 'sonner' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../../../shared/execution-host' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts index b6f7b62ae6a..326dbf98345 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts @@ -1,5 +1,5 @@ import { terminalLaunchOpened } from '@/lib/launch-agent-in-new-tab-host-agents' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../../../shared/execution-host' import { parseExecutionHostId } from '../../../../../shared/execution-host' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.ts index cc66f29dded..2368ab5afc2 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.ts @@ -4,7 +4,7 @@ import { } from '../../../../../shared/native-chat/input/native-chat-session-option-defaults' import { structuredAgentSessionCreateFingerprint } from '../../../../../shared/agent-session/lifecycle/structured-agent-session-mutation' import type { StructuredAgentSessionCreateParams } from '../../../../../shared/agent-session/structured-agent-session-create' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../../shared/agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { type StructuredLaunchState, notifyStructuredLaunchListeners diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-permission-notice.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-permission-notice.ts index 0e72590adb9..5cda9ba223c 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-permission-notice.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-permission-notice.ts @@ -4,8 +4,8 @@ import { useAppStore } from '@/store/index' import { isAgentChatPermissionMode, newChatPermissionModeForSettings -} from '../../../../../shared/agent-chat-permission-mode' -import type { TuiAgent } from '../../../../../shared/tui-agent' +} from '../../../../../shared/agent-launch/permissions/agent-chat-permission-mode' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { nativeChatPermissionModeLabel } from '@/components/native-chat/native-chat-permission-mode-labels' import { structuredAgentLabel } from '@/lib/agent-session/launch/structured-agent-session-launch-label' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts index 510870cff03..83554547457 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts @@ -1,5 +1,5 @@ -import { isTuiAgent } from '../../../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { StructuredAgentSessionFirstMessage, StructuredAgentSessionResumeSource diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts index 3de1ab000e2..86bb0de3a27 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts @@ -1,7 +1,7 @@ import { launchStateLifecycle } from '../../structured-agent-session-launch-lifecycle' import { forgetStructuredSessionSelection } from '../../structured-agent-session-selection-controller' import { useSyncExternalStore } from 'react' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { StructuredLaunchFailure } from './structured-agent-session-launch-failure' import type { StructuredAgentSessionResumeSource } from '../../../../../shared/agent-session/structured-agent-session-create' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-status.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-status.ts index c205dcf4fac..557f6075455 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-status.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-status.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { structuredLaunchesHoldingIdentity } from './structured-agent-session-launch-holders' import { structuredLaunchIdentity, diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts index bed88e6c6b8..3dfd21b9b92 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts @@ -7,7 +7,7 @@ import { findIndexedRepoOwner } from '../../repo-owner-index' import { folderWorkspaceToWorktree } from '../../../../../shared/folder-workspace-worktree' import type { Tab } from '../../../../../shared/tab-types' import type { ExecutionHostId } from '../../../../../shared/execution-host' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { defaultAgentChatLabel } from '../../../../../shared/agent-session/agent-session-chat-label' import { structuredAgentSessionTabId } from '../../../../../shared/agent-session/view/structured-agent-session-projection' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts index bf0f7e76f84..e69cc4bca9c 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts @@ -1,6 +1,6 @@ import { useAppStore } from '@/store/index' import { reserveStructuredLaunchSlot } from './structured-agent-session-launch-surface' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../../../shared/execution-host' import { abandonStructuredAgentSessionLaunchIntent, diff --git a/src/renderer/src/lib/agent-startup-creation-continuation.test.ts b/src/renderer/src/lib/agent-startup-creation-continuation.test.ts index 6d5a844c493..66108b5b3db 100644 --- a/src/renderer/src/lib/agent-startup-creation-continuation.test.ts +++ b/src/renderer/src/lib/agent-startup-creation-continuation.test.ts @@ -1,8 +1,8 @@ import { expect, it, vi } from 'vitest' import { getDefaultSettings } from '../../../shared/constants' import { buildQuickComposerStartup } from '../hooks/composer-state/quick-startup-plan' -import { buildAgentResumeStartupPlan } from '../../../shared/tui-agent-startup' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { buildAgentResumeStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-resume-startup' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { buildAiVaultLocalResumeStartup, buildAiVaultForkStartup, diff --git a/src/renderer/src/lib/agent-startup-delayed-delivery.ts b/src/renderer/src/lib/agent-startup-delayed-delivery.ts index 01a58f6eaf0..6194ac69e76 100644 --- a/src/renderer/src/lib/agent-startup-delayed-delivery.ts +++ b/src/renderer/src/lib/agent-startup-delayed-delivery.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { AgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import { parsePaneKey } from '../../../shared/stable-pane-id' import { agentStartupDeliveryKey as deliveryKey, diff --git a/src/renderer/src/lib/agent-status.ts b/src/renderer/src/lib/agent-status.ts index 5e3dab676c8..10c08016efd 100644 --- a/src/renderer/src/lib/agent-status.ts +++ b/src/renderer/src/lib/agent-status.ts @@ -1,5 +1,5 @@ import type { TerminalTab } from '../../../shared/terminal-tab-types' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import type { Worktree } from '../../../shared/worktree/types' import type { AgentStatusState, AgentType } from '../../../shared/agent-status-types' import { tabHasLivePty } from '../../../shared/tab-has-live-pty' diff --git a/src/renderer/src/lib/agent-tab-shortcuts.ts b/src/renderer/src/lib/agent-tab-shortcuts.ts index 037850424ef..da1f926ae70 100644 --- a/src/renderer/src/lib/agent-tab-shortcuts.ts +++ b/src/renderer/src/lib/agent-tab-shortcuts.ts @@ -4,9 +4,12 @@ import { type AgentTabActionId, type KeybindingOverrides } from '../../../shared/keybindings' -import { ALL_TUI_AGENTS } from '../../../shared/tui-agent-display-names' -import { normalizeDisabledTuiAgents, pickTuiAgent } from '../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../shared/tui-agent' +import { ALL_TUI_AGENTS } from '../../../shared/agent-launch/catalog/tui-agent-display-names' +import { + normalizeDisabledTuiAgents, + pickTuiAgent +} from '../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AppState } from '@/store/types' import { loadDetectedAgentsForWorktree } from '@/lib/agent-detection-target-inventory' import { diff --git a/src/renderer/src/lib/ai-vault-antigravity-reference-startup.ts b/src/renderer/src/lib/ai-vault-antigravity-reference-startup.ts index 76c4438842c..5aae7b76a1f 100644 --- a/src/renderer/src/lib/ai-vault-antigravity-reference-startup.ts +++ b/src/renderer/src/lib/ai-vault-antigravity-reference-startup.ts @@ -6,10 +6,10 @@ import { } from './ai-vault-resume-target' import { getAiVaultResumeWorkspaceWslDistro } from './ai-vault-resume-shell' import { buildAiVaultResumeCommand } from '../../../shared/ai-vault-resume-command' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../../shared/tui-agent-startup' -import type { AgentLaunchProfileSettings } from '../../../shared/tui-agent-launch-defaults' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' +import type { AgentLaunchProfileSettings } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { AiVaultResumeStartup, diff --git a/src/renderer/src/lib/ai-vault-omp-cold-resume.test.ts b/src/renderer/src/lib/ai-vault-omp-cold-resume.test.ts index 256858d3ad2..eb2164dba70 100644 --- a/src/renderer/src/lib/ai-vault-omp-cold-resume.test.ts +++ b/src/renderer/src/lib/ai-vault-omp-cold-resume.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import type { AppState } from '@/store/types' import { createTestStore, makeTab } from '@/store/slices/store-test-helpers' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-resume-startup' import { buildAiVaultResumeStartupForWorktree } from './ai-vault-resume-command' describe('AI Vault OMP cold resume', () => { diff --git a/src/renderer/src/lib/ai-vault-resume-shell.ts b/src/renderer/src/lib/ai-vault-resume-shell.ts index df4c7c53f8b..e132491c00b 100644 --- a/src/renderer/src/lib/ai-vault-resume-shell.ts +++ b/src/renderer/src/lib/ai-vault-resume-shell.ts @@ -9,7 +9,7 @@ import { resolveWindowsShellStartupFamily } from '../../../shared/windows-termin import { resolveStartupShell, type AgentStartupShell -} from '../../../shared/tui-agent-startup-shell' +} from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { parseWorkspaceKey } from '../../../shared/workspace-scope' import { parseWslUncPath } from '../../../shared/wsl-paths' import { selectFolderWorkspaces, selectWorktreesByRepo } from '@/store/workspace-record-selectors' diff --git a/src/renderer/src/lib/ai-vault-session-resume-preparation.ts b/src/renderer/src/lib/ai-vault-session-resume-preparation.ts index f55be7c5693..cacc24a6389 100644 --- a/src/renderer/src/lib/ai-vault-session-resume-preparation.ts +++ b/src/renderer/src/lib/ai-vault-session-resume-preparation.ts @@ -22,7 +22,7 @@ import type { FilesystemPathFlavor } from '../../../shared/filesystem-entry-type import { isWindowsAbsolutePathLike } from '../../../shared/cross-platform-path' import { readIpcErrorMessage } from './ipc-error' import type { AiVaultResumeCommandSession } from './ai-vault-resume-command' -import { agentForksThroughChat } from '../../../shared/agent-resume-argv' +import { agentForksThroughChat } from '../../../shared/agent-launch/startup/agent-resume-argv' import { translate } from '@/i18n/i18n' export function prepareAiVaultSessionForResume(session: AiVaultSession): Promise { diff --git a/src/renderer/src/lib/automation-session-reuse.ts b/src/renderer/src/lib/automation-session-reuse.ts index fbd160f1342..9de3846c066 100644 --- a/src/renderer/src/lib/automation-session-reuse.ts +++ b/src/renderer/src/lib/automation-session-reuse.ts @@ -5,7 +5,7 @@ import { type AutomationSessionTarget } from '../../../shared/automation-session-reuse' import { getPtyExecutionHost } from '../../../shared/terminal-execution-host' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { parsePaneKey } from '../../../shared/stable-pane-id' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/chat-provider-agents.ts b/src/renderer/src/lib/chat-provider-agents.ts index 4fab3a785f7..43ff11b16e8 100644 --- a/src/renderer/src/lib/chat-provider-agents.ts +++ b/src/renderer/src/lib/chat-provider-agents.ts @@ -1,6 +1,6 @@ import { useSyncExternalStore } from 'react' -import type { TuiAgent } from '../../../shared/tui-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { hostStructuredAgentsVersion, readHostStructuredAgents, diff --git a/src/renderer/src/lib/codex-pane-restart-eligibility.ts b/src/renderer/src/lib/codex-pane-restart-eligibility.ts index de5faf46aa5..44aab734c9d 100644 --- a/src/renderer/src/lib/codex-pane-restart-eligibility.ts +++ b/src/renderer/src/lib/codex-pane-restart-eligibility.ts @@ -3,7 +3,7 @@ import { recognizeAgentProcess } from '../../../shared/agent-process-recognition' import { isShellProcess } from '../../../shared/shell-process-detection' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeTerminalProcessInspection } from '@/runtime/runtime-terminal-inspection' import { isClientOnlyUnverifiableInspection } from '../../../shared/terminal-process-inspection' diff --git a/src/renderer/src/lib/codex-session-restart.test.ts b/src/renderer/src/lib/codex-session-restart.test.ts index d90df5d9435..aa1a1910794 100644 --- a/src/renderer/src/lib/codex-session-restart.test.ts +++ b/src/renderer/src/lib/codex-session-restart.test.ts @@ -10,7 +10,7 @@ const markForFocusedHost = ( owner: defaultScopeHost(useAppStore.getState().settings), ...args }) -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { markLiveCodexSessionsForRestart } from './codex-session-restart' import { createCompatibleRuntimeStatusResponseIfNeeded, diff --git a/src/renderer/src/lib/codex-session-restart.ts b/src/renderer/src/lib/codex-session-restart.ts index 1c180014989..f90208b3c96 100644 --- a/src/renderer/src/lib/codex-session-restart.ts +++ b/src/renderer/src/lib/codex-session-restart.ts @@ -24,7 +24,7 @@ import { } from './codex-pane-selection-lane' import type { CodexAccountSelectionTarget } from '../../../shared/codex-selection-lane' import type { RuntimeClientTarget } from '../../../shared/runtime-client-target' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export type CodexPaneScanResult = { ptyId: string diff --git a/src/renderer/src/lib/direct-work-item-setup-callers.test.tsx b/src/renderer/src/lib/direct-work-item-setup-callers.test.tsx index c49e9b6199c..d314ae73b92 100644 --- a/src/renderer/src/lib/direct-work-item-setup-callers.test.tsx +++ b/src/renderer/src/lib/direct-work-item-setup-callers.test.tsx @@ -15,7 +15,7 @@ import { import * as preflight from './launch-work-item-direct-preflight' import * as preparation from './launch-work-item-direct-route-preparation' import { createCompatibleRuntimeStatusResponse } from '@/runtime/runtime-compatibility-test-fixture' -import { buildAgentDraftLaunchPlan } from './tui-agent-startup' +import { buildAgentDraftLaunchPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import ProjectViewWrapper from '@/components/github-project/ProjectViewWrapper' const links = vi.hoisted(() => ({ open: vi.fn() })) diff --git a/src/renderer/src/lib/empty-workspace-default-agent-chat.ts b/src/renderer/src/lib/empty-workspace-default-agent-chat.ts index 4f3a590b7d4..3be2a5e34f3 100644 --- a/src/renderer/src/lib/empty-workspace-default-agent-chat.ts +++ b/src/renderer/src/lib/empty-workspace-default-agent-chat.ts @@ -1,4 +1,4 @@ -import { pickTuiAgent } from '../../../shared/tui-agent-selection' +import { pickTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { newAgentLaunchesMayOpenChats } from '@/runtime/local-structured-chats' import { acquireAgentLaunchChoices } from './host-chat-program-acquisition' import { useAppStore } from '@/store' diff --git a/src/renderer/src/lib/execution-host-facts.ts b/src/renderer/src/lib/execution-host-facts.ts index 2f0a9b37119..e4ff146b448 100644 --- a/src/renderer/src/lib/execution-host-facts.ts +++ b/src/renderer/src/lib/execution-host-facts.ts @@ -5,7 +5,7 @@ import { } from '../../../shared/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime' import { lastVerifiedRuntimeStatus } from '../../../shared/runtime-host-status' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveHostAgentStartupShell } from '../../../shared/windows-terminal-shell' import { isWslUncPath } from '../../../shared/wsl-paths' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/fix-checks-agent-launch.test.ts b/src/renderer/src/lib/fix-checks-agent-launch.test.ts index 14e91598682..041d013d79c 100644 --- a/src/renderer/src/lib/fix-checks-agent-launch.test.ts +++ b/src/renderer/src/lib/fix-checks-agent-launch.test.ts @@ -1,9 +1,9 @@ -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../../shared/tui-agent-startup' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import type { LaunchAgentInNewTabArgs } from './launch-agent-in-new-tab-args' import { getDefaultSettings } from '../../../shared/constants' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environment-revision' -import { projectAgentLaunchSettings } from '../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../shared/agent-launch/choices/agent-launch-settings' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as ExecutionHostFactsModule from '@/lib/execution-host-facts' diff --git a/src/renderer/src/lib/fix-checks-agent-launch.ts b/src/renderer/src/lib/fix-checks-agent-launch.ts index 85f9086ae42..2419783279f 100644 --- a/src/renderer/src/lib/fix-checks-agent-launch.ts +++ b/src/renderer/src/lib/fix-checks-agent-launch.ts @@ -31,9 +31,9 @@ import { DEFAULT_SOURCE_CONTROL_ACTION_COMMAND_TEMPLATES, renderSourceControlActionCommandTemplate } from '../../../shared/source-control-ai-actions' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' import type { GitHubWorkItem } from '../../../shared/github/work-item-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../shared/workspace-source' import type { LaunchSource } from '../../../shared/telemetry-events' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/lib/host-chat-program-acquisition.ts b/src/renderer/src/lib/host-chat-program-acquisition.ts index 1c1f8b93634..10d383c7f7e 100644 --- a/src/renderer/src/lib/host-chat-program-acquisition.ts +++ b/src/renderer/src/lib/host-chat-program-acquisition.ts @@ -15,8 +15,8 @@ import { } from '@/runtime/host-structured-agent-availability' import { onRuntimeEnvironmentsRetired } from '@/runtime/runtime-environment-revision' import { STRUCTURED_AGENT_SESSION_AVAILABILITY_RUNTIME_CAPABILITY as AVAILABILITY } from '../../../shared/agent-session/structured-agent-session-surface-capabilities' -import type { TuiAgent } from '../../../shared/tui-agent' -import { isTuiAgent } from '../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { getDetectionTargetIdentityForWorktree, readAgentInventoryForWorktree diff --git a/src/renderer/src/lib/host-chat-program.ts b/src/renderer/src/lib/host-chat-program.ts index d57ffd9bab9..26f9be42cf6 100644 --- a/src/renderer/src/lib/host-chat-program.ts +++ b/src/renderer/src/lib/host-chat-program.ts @@ -6,7 +6,7 @@ import { STRUCTURED_AGENT_SESSION_AVAILABILITY_RUNTIME_CAPABILITY as AVAILABILITY } from '../../../shared/agent-session/structured-agent-session-surface-capabilities' import { lastVerifiedRuntimeStatus } from '../../../shared/runtime-host-status' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AgentSessionChatProgram } from '../../../shared/agent-session/agent-session-agent-availability' import { chatProviderAgents } from './chat-provider-agents' import { resolveAgentLaunchRoute, structuredAgentLaunchSupport } from './agent-launch-routing' diff --git a/src/renderer/src/lib/ipc-error.ts b/src/renderer/src/lib/ipc-error.ts index 7143282331b..28ae39e3609 100644 --- a/src/renderer/src/lib/ipc-error.ts +++ b/src/renderer/src/lib/ipc-error.ts @@ -3,7 +3,7 @@ import { OPENCODE_MODEL_CONFIG_REFUSAL, OPENCODE_MODEL_TRANSPORT_REFUSAL, OPENCODE_MODEL_VERSION_REFUSAL -} from '../../../shared/agent-launch-model-preferences' +} from '../../../shared/agent-launch/choices/agent-launch-model-preferences' // Unanchored so caller-owned context around an Electron wrapper survives. const IPC_INVOKE_PREFIX = /Error invoking remote method '[^']*':\s*(?:Error:\s*)?/ diff --git a/src/renderer/src/lib/launch-agent-background-session.ts b/src/renderer/src/lib/launch-agent-background-session.ts index 945b5af415d..060c8a197fc 100644 --- a/src/renderer/src/lib/launch-agent-background-session.ts +++ b/src/renderer/src/lib/launch-agent-background-session.ts @@ -1,6 +1,6 @@ import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import { useAppStore } from '@/store' -import { buildAgentStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import type { LaunchAgentBackgroundSessionArgs, LaunchAgentBackgroundSessionResult @@ -8,7 +8,7 @@ import type { import { tuiAgentToAgentKind } from '@/lib/telemetry' import { scheduleAgentBackgroundDraft } from '@/lib/agent-background-draft-delivery' import { requestBackgroundTerminalWorktreeMount } from '@/components/terminal/background-terminal-worktree-mount' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { requireTuiAgentConfig } from '../../../shared/require-tui-agent-config' import { resolveAgentBackgroundLaunchContext } from '@/lib/agent-background-session-launch-host' import { makePaneKey } from '../../../shared/stable-pane-id' @@ -24,7 +24,7 @@ import { prepareRuntimeAgentBackgroundTerminal } from '@/lib/runtime-agent-backg import { subscribeToRuntimeTerminalData } from '@/runtime/runtime-terminal-stream' import { toRemoteRuntimePtyId } from '../../../shared/remote-runtime/remote-runtime-pty-id' import { isMainTerminalSideEffectAuthorityForPty } from '@/components/terminal-pane/terminal-side-effect-facts-handler' -import { hasExtraAgentArgs } from '../../../shared/automation-extra-agent-args' +import { hasExtraAgentArgs } from '../../../shared/agent-launch/startup/automation-extra-agent-args' import { runBestEffortAgentBackgroundCleanups } from '@/lib/agent-background-session-cleanup' import type { bindAutomationTerminal } from '@/lib/automation-terminal-ownership' import { diff --git a/src/renderer/src/lib/launch-agent-execution-context.ts b/src/renderer/src/lib/launch-agent-execution-context.ts index 232e3466677..8e9f6261a7b 100644 --- a/src/renderer/src/lib/launch-agent-execution-context.ts +++ b/src/renderer/src/lib/launch-agent-execution-context.ts @@ -1,6 +1,6 @@ import { toast } from 'sonner' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' -import { launchHostIsRemote } from '../../../shared/agent-launch-remote' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' +import { launchHostIsRemote } from '../../../shared/agent-launch/startup/agent-launch-remote' import { getConnectionIdFromState } from '@/lib/connection-context' import { refineLocalLaunchPlatform, diff --git a/src/renderer/src/lib/launch-agent-in-new-tab-args.ts b/src/renderer/src/lib/launch-agent-in-new-tab-args.ts index 51c5ffb08c7..cdae0cce41f 100644 --- a/src/renderer/src/lib/launch-agent-in-new-tab-args.ts +++ b/src/renderer/src/lib/launch-agent-in-new-tab-args.ts @@ -1,5 +1,5 @@ import type { AgentSessionLaunchRequest } from '@/lib/agent-session-launch-plan' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../shared/telemetry-events' import type { StructuredLaunchTerminal } from '@/lib/agent-session/launch/structured-agent-session-launch-admission' import type { LaunchAgentInNewTabRequest } from '@/lib/launch-agent-in-new-tab-host-agents' diff --git a/src/renderer/src/lib/launch-agent-in-new-tab-host-agents.ts b/src/renderer/src/lib/launch-agent-in-new-tab-host-agents.ts index 35ec4758c1f..12d32750385 100644 --- a/src/renderer/src/lib/launch-agent-in-new-tab-host-agents.ts +++ b/src/renderer/src/lib/launch-agent-in-new-tab-host-agents.ts @@ -1,5 +1,5 @@ import type { AgentLaunchRequestId } from '@/lib/agent-launch-request-id' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { AgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import { useAppStore } from '@/store' import { awaitStructuredRouteHostAnswer, diff --git a/src/renderer/src/lib/launch-agent-in-new-tab.test.ts b/src/renderer/src/lib/launch-agent-in-new-tab.test.ts index 4e8077cee44..a90f7b4b2c6 100644 --- a/src/renderer/src/lib/launch-agent-in-new-tab.test.ts +++ b/src/renderer/src/lib/launch-agent-in-new-tab.test.ts @@ -15,7 +15,7 @@ import { toAppSshPtyId } from '../../../shared/ssh-pty-id' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' import { planAgentSessionLaunch } from './agent-session-launch-plan' import { openDeclinedTerminal } from './agent-session/launch/structured-agent-session-action-launch' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' afterEach(() => vi.restoreAllMocks()) diff --git a/src/renderer/src/lib/launch-agent-in-new-tab.ts b/src/renderer/src/lib/launch-agent-in-new-tab.ts index ded0326fe1a..1c882799ab4 100644 --- a/src/renderer/src/lib/launch-agent-in-new-tab.ts +++ b/src/renderer/src/lib/launch-agent-in-new-tab.ts @@ -13,9 +13,9 @@ import { pasteAgentLaunchPromptOnceReady } from '@/lib/launch-agent-tab-prompt-p import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/worktree-runtime-owner' import { isWebRuntimeSessionActive } from '@/runtime/web-runtime-session-environment' import { launchAgentInWebHostTab } from '@/lib/launch-agent-web-host-tab' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { readAgentLaunchPreferencesForWorktree } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' import { resolveAgentLaunchExecutionContext } from '@/lib/launch-agent-execution-context' import { launchStructuredAgentFromNewTab } from '@/lib/launch-agent-in-new-tab-structured-route' import { workspaceKindForWorktreeId } from '@/lib/agent-launch-route-input' diff --git a/src/renderer/src/lib/launch-agent-paste-timeout-notice.ts b/src/renderer/src/lib/launch-agent-paste-timeout-notice.ts index ff20844fb57..3db971ab7d3 100644 --- a/src/renderer/src/lib/launch-agent-paste-timeout-notice.ts +++ b/src/renderer/src/lib/launch-agent-paste-timeout-notice.ts @@ -2,7 +2,7 @@ import { toast } from 'sonner' import { useAppStore } from '@/store' import { track, tuiAgentToAgentKind } from '@/lib/telemetry' import { translate } from '@/i18n/i18n' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' /** Report otherwise-silent lost launch text; wasNotified lets deferred callers suppress duplicate toasts. */ export function createPasteReadinessTimeoutNotice(args: { diff --git a/src/renderer/src/lib/launch-agent-picker-contract.test.ts b/src/renderer/src/lib/launch-agent-picker-contract.test.ts index 88e93638b4f..7249fd64299 100644 --- a/src/renderer/src/lib/launch-agent-picker-contract.test.ts +++ b/src/renderer/src/lib/launch-agent-picker-contract.test.ts @@ -20,13 +20,13 @@ import { agentPickerDraft, agentPickerLaunchInputs, agentPickerEntriesFromRows -} from '../../../shared/agent-launch-picker' +} from '../../../shared/agent-launch/picker/agent-launch-picker' import { acceptAgentPickerArguments, applyAgentPickerEdit -} from '../../../shared/agent-launch-picker-edits' -import { agentPickerPanelArguments } from '../../../shared/agent-launch-picker-arguments' +} from '../../../shared/agent-launch/picker/agent-launch-picker-edits' +import { agentPickerPanelArguments } from '../../../shared/agent-launch/picker/agent-launch-picker-arguments' import { mockCreateTab, queuedStartups, @@ -36,7 +36,7 @@ import { mockIsWebRuntimeSessionActive } from './launch-agent-in-new-tab-test-fixture' -import { buildNewTabAgentMenuRows } from '../../../shared/agent-launch-picker-rows' +import { buildNewTabAgentMenuRows } from '../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { ExecutionHostId } from '../../../shared/execution-host' import { fetchCodexModelCatalogListing } from './codex-model-catalog-reader-test-fixture' @@ -66,8 +66,10 @@ describe('picker window launch contract', () => { 'preserves %s permission and model intent through the actual picker-to-terminal compiler', async (agent) => { const { launchAgentInNewTab } = await import('./launch-agent-in-new-tab') - const { agentPickerChoiceSeeds, agentPickerDraft, agentPickerLaunchInputs } = - await import('../../../shared/agent-launch-picker') + const { agentPickerDraft, agentPickerLaunchInputs } = + await import('../../../shared/agent-launch/picker/agent-launch-picker') + const { agentPickerChoiceSeeds } = + await import('../../../shared/agent-launch/picker/agent-launch-picker-defaults') const settings = { agentPermissionDefault: 'ask' as const, agentDefaultArgs: { [agent]: '--add-dir docs' }, @@ -148,8 +150,10 @@ describe('picker window launch contract', () => { const { EntryActionRow } = await import('../components/tab-bar/TabBarCreateEntryRow') const { matchingAgentPickerLaunchOptions, configuredAgentPickerLaunchOption } = await import('../components/tab-bar/tab-agent-launch-options') - const { agentPickerChoiceSeeds, agentPickerLaunchInputs } = - await import('../../../shared/agent-launch-picker') + const { agentPickerLaunchInputs } = + await import('../../../shared/agent-launch/picker/agent-launch-picker') + const { agentPickerChoiceSeeds } = + await import('../../../shared/agent-launch/picker/agent-launch-picker-defaults') Object.assign(store.settings, { agentDefaultArgs: { claude: '--add-dir docs' } }) if (target === 'ssh') { store.repos[0].connectionId = 'ssh-target-1' @@ -321,7 +325,7 @@ it.each(['claude', 'codex'] as const)( async (agent) => { const { launchAgentInNewTab } = await import('./launch-agent-in-new-tab') const { agentPickerDraft, agentPickerLaunchInputs } = - await import('../../../shared/agent-launch-picker') + await import('../../../shared/agent-launch/picker/agent-launch-picker') const options: Record = agent === 'claude' ? { fastMode: 'false' } : { serviceTier: 'default' } const entry = { @@ -406,7 +410,8 @@ it.each(['claude', 'codex'] as const)( it.each(['claude', 'codex'] as const)( 'keeps failed %s defaults unknown through acquisition, controls, projection and actual dispatch, then wakes to a permission-preserving edit', async (agent) => { - const { projectAgentLaunchSettings } = await import('../../../shared/agent-launch-settings') + const { projectAgentLaunchSettings } = + await import('../../../shared/agent-launch/choices/agent-launch-settings') const { launchAgentInNewTab } = await import('./launch-agent-in-new-tab') const settings = { agentPermissionDefault: 'ask' as const, @@ -637,8 +642,10 @@ it('passes the recorded Codex catalog tier and approval/sandbox policy through t it('conserves quoted Codex string sources through common acceptance and the terminal compiler', async () => { const { launchAgentInNewTab } = await import('./launch-agent-in-new-tab') - const { tokenizeStartupCommand } = await import('../../../shared/tui-agent-startup-shell') - const { agentChoiceConfigString } = await import('../../../shared/agent-choice-cli-apply') + const { tokenizeStartupCommand } = + await import('../../../shared/agent-launch/startup/tui-agent-startup-shell') + const { agentChoiceConfigString } = + await import('../../../shared/agent-launch/choices/agent-choice-cli-apply') const own: AgentPickerEntry = { agent: 'codex', label: 'Codex', diff --git a/src/renderer/src/lib/launch-agent-picker-prompt.test.tsx b/src/renderer/src/lib/launch-agent-picker-prompt.test.tsx index a58afb7cf9c..933ad26a1c5 100644 --- a/src/renderer/src/lib/launch-agent-picker-prompt.test.tsx +++ b/src/renderer/src/lib/launch-agent-picker-prompt.test.tsx @@ -31,7 +31,7 @@ import { changePrompt, promptEditor } from '@/components/native-chat/native-chat-prompt-editor.test-support' -import type { AgentPickerEntry } from '../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../shared/agent-launch/picker/agent-launch-picker' import * as launcher from './launch-agent-in-new-tab' import type * as StructuredLaunch from './launch-structured-agent-session' import { resetStructuredAgentLaunchRegistryForTests } from './agent-session/launch/structured-agent-session-launch-registry' diff --git a/src/renderer/src/lib/launch-agent-session-continuation.ts b/src/renderer/src/lib/launch-agent-session-continuation.ts index c227e4b2d18..d04d862c07e 100644 --- a/src/renderer/src/lib/launch-agent-session-continuation.ts +++ b/src/renderer/src/lib/launch-agent-session-continuation.ts @@ -10,9 +10,9 @@ import { } from './host-chat-program-acquisition' import { agentChoicePending } from './host-chat-program' import { worktreeLaunchWorkspace } from './agent-launch-route-input' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' import type { LaunchSource } from '../../../shared/telemetry-events' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { adoptAgentSessionLaunchVerdict, planAgentSessionLaunch diff --git a/src/renderer/src/lib/launch-agent-startup-prompt-plan.ts b/src/renderer/src/lib/launch-agent-startup-prompt-plan.ts index af434a166af..0d630857922 100644 --- a/src/renderer/src/lib/launch-agent-startup-prompt-plan.ts +++ b/src/renderer/src/lib/launch-agent-startup-prompt-plan.ts @@ -2,7 +2,7 @@ import { buildAgentDraftLaunchPlan, buildAgentStartupPlan, type AgentStartupPlan -} from '@/lib/tui-agent-startup' +} from '../../../shared/agent-launch/startup/tui-agent-startup' type StartupPlanBase = Omit< Parameters[0], diff --git a/src/renderer/src/lib/launch-agent-tab-prompt-paste.ts b/src/renderer/src/lib/launch-agent-tab-prompt-paste.ts index e70bc4a201e..c97394cac62 100644 --- a/src/renderer/src/lib/launch-agent-tab-prompt-paste.ts +++ b/src/renderer/src/lib/launch-agent-tab-prompt-paste.ts @@ -1,7 +1,7 @@ import { createPasteReadinessTimeoutNotice } from '@/lib/launch-agent-paste-timeout-notice' import { deliverLaunchPromptToAgentTab } from '@/lib/agent-launch-prompt-delivery' import { seedCommandCodeSubmittedPromptStatus } from '@/lib/command-code-prompt-status-seed' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' /** Share readiness/paste delivery and outcome reporting for both window-spawned and agent.launch-owned tab PTYs. */ export function pasteAgentLaunchPromptOnceReady(args: { diff --git a/src/renderer/src/lib/launch-agent-web-host-tab.ts b/src/renderer/src/lib/launch-agent-web-host-tab.ts index 52ca99e9436..4e5701803ff 100644 --- a/src/renderer/src/lib/launch-agent-web-host-tab.ts +++ b/src/renderer/src/lib/launch-agent-web-host-tab.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchChoices } from '../../../shared/agent-launch-choices' +import type { AgentLaunchChoices } from '../../../shared/agent-launch/choices/agent-launch-choices' import { structuredAgentLabel } from './agent-session/launch/structured-agent-session-launch-label' import type { SessionOptionValue } from '../../../shared/native-chat/input/native-chat-session-options' import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' @@ -14,7 +14,7 @@ import { } from '@/runtime/web-runtime-terminal-creation' import type { LaunchAgentStartupPromptPlan } from '@/lib/launch-agent-startup-prompt-plan' import type { Tab } from '../../../shared/tab-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AgentPromptDelivery } from '../../../shared/agent-session/agent-session-host-authority' import { translate } from '@/i18n/i18n' import { toWebTerminalSurfaceTabId } from '../../../shared/terminal-surface-id' @@ -22,7 +22,7 @@ import type { AgentTerminalLaunchCompletion } from './agent-session/launch/struc import { agentLaunchNeedsPreparedCommand, toAgentLaunchPreferences -} from '../../../shared/agent-launch-preferences' +} from '../../../shared/agent-launch/choices/agent-launch-preferences' /** Paired web tabs are host-owned; never create a local tab, and return tabId:null. */ export async function launchAgentInWebHostTab(args: { diff --git a/src/renderer/src/lib/launch-parity-workspace-start.test-fixture.ts b/src/renderer/src/lib/launch-parity-workspace-start.test-fixture.ts index ba6042679ee..4bada687021 100644 --- a/src/renderer/src/lib/launch-parity-workspace-start.test-fixture.ts +++ b/src/renderer/src/lib/launch-parity-workspace-start.test-fixture.ts @@ -5,7 +5,7 @@ import type * as FolderComposerSubmit from '@/components/sidebar/folder-workspac import { resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../../shared/tui-agent-launch-defaults' +} from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { LAUNCH_FOLDER_ID, type WindowLaunchCase diff --git a/src/renderer/src/lib/launch-structured-agent-session.ts b/src/renderer/src/lib/launch-structured-agent-session.ts index 21d25ae9f49..45a8942591b 100644 --- a/src/renderer/src/lib/launch-structured-agent-session.ts +++ b/src/renderer/src/lib/launch-structured-agent-session.ts @@ -1,5 +1,5 @@ import type { StructuredLaunchSurfaceAddress } from './agent-session/launch/structured-agent-session-launch-record' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { createStructuredAgentSessionId, structuredAgentSessionCreateParams, diff --git a/src/renderer/src/lib/launch-work-item-direct-agent-routing.ts b/src/renderer/src/lib/launch-work-item-direct-agent-routing.ts index 974baeaf41c..4e4cbb36b97 100644 --- a/src/renderer/src/lib/launch-work-item-direct-agent-routing.ts +++ b/src/renderer/src/lib/launch-work-item-direct-agent-routing.ts @@ -12,10 +12,10 @@ import { } from '@/lib/launch-work-item-direct-agent' import { acquireAgentLaunchChoices } from './host-chat-program-acquisition' import { useAppStore } from '@/store' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AppState } from '@/store/types' -import { isTuiAgent } from '../../../shared/tui-agent-config' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { resolveDefaultAgentForWorkspace } from './agent-tab-shortcuts' import { worktreeLaunchWorkspace } from '@/lib/agent-launch-route-input' import { agentChoiceMayOpenAsChat } from '@/lib/host-chat-program' diff --git a/src/renderer/src/lib/launch-work-item-direct-agent.ts b/src/renderer/src/lib/launch-work-item-direct-agent.ts index a4dee343ddf..50e6c411918 100644 --- a/src/renderer/src/lib/launch-work-item-direct-agent.ts +++ b/src/renderer/src/lib/launch-work-item-direct-agent.ts @@ -4,15 +4,15 @@ import { buildAgentDraftLaunchPlan, buildAgentStartupPlan, type AgentStartupPlan -} from '@/lib/tui-agent-startup' +} from '../../../shared/agent-launch/startup/tui-agent-startup' import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session/lifecycle/agent-session-resume' import type { LaunchSource } from '../../../shared/telemetry-events' -import type { StartupCommandDelivery } from '../../../shared/codex-startup-delivery' -import type { TuiAgent } from '../../../shared/tui-agent' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' -import type { AgentLaunchProfileSettings } from '../../../shared/tui-agent-launch-defaults' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' +import type { StartupCommandDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' +import type { AgentLaunchProfileSettings } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' import { translate } from '@/i18n/i18n' export function buildDirectWorkItemAgentStartupPlan(args: { diff --git a/src/renderer/src/lib/launch-work-item-direct-defaults.test.ts b/src/renderer/src/lib/launch-work-item-direct-defaults.test.ts index b16d23250b1..c89b14c2cdf 100644 --- a/src/renderer/src/lib/launch-work-item-direct-defaults.test.ts +++ b/src/renderer/src/lib/launch-work-item-direct-defaults.test.ts @@ -14,7 +14,7 @@ import { useAppStore } from '@/store' import { RUNTIME_CAPABILITIES } from '../../../shared/protocol-version' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { runSourceControlAgentActionStart } from '../components/right-sidebar/runSourceControlAgentActionStart' import { startFixChecksFromDialog } from '../components/pull-request-page/checks/fix-launch' import { sourceControlActionRecipeEntry } from '../../../shared/source-control-action-selection' diff --git a/src/renderer/src/lib/launch-work-item-direct-messages.ts b/src/renderer/src/lib/launch-work-item-direct-messages.ts index 33d568ee16e..82be722f4aa 100644 --- a/src/renderer/src/lib/launch-work-item-direct-messages.ts +++ b/src/renderer/src/lib/launch-work-item-direct-messages.ts @@ -1,8 +1,11 @@ import { toast } from 'sonner' -import { planAgentCliArgsSuffix } from './tui-agent-startup' +import { + planAgentCliArgsSuffix, + type AgentStartupShell +} from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { getAgentLabel } from './agent-catalog' -import type { TuiAgent } from '../../../shared/tui-agent' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' + import { isGitLabIssueUrl } from '@/lib/new-workspace' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/lib/launch-work-item-direct-preflight.ts b/src/renderer/src/lib/launch-work-item-direct-preflight.ts index 4512d6faa44..e1833ff974a 100644 --- a/src/renderer/src/lib/launch-work-item-direct-preflight.ts +++ b/src/renderer/src/lib/launch-work-item-direct-preflight.ts @@ -1,5 +1,8 @@ -import { planAgentCliArgsSuffix } from './tui-agent-startup' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' +import { + planAgentCliArgsSuffix, + type AgentStartupShell +} from '../../../shared/agent-launch/startup/tui-agent-startup-shell' + import { readAgentLaunchPreferencesForWorkspace } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import { useAppStore, type AppState } from '@/store' import { @@ -10,10 +13,10 @@ import { toast } from 'sonner' import { CLIENT_PLATFORM } from './new-workspace' import { getLocalRepoProjectExecutionRuntimeContext } from './local-preflight-context' import { refineLocalLaunchPlatform, resolveRepoExecutionHostPlatform } from './execution-host-facts' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { resolveDefaultAgentForWorkspace } from './agent-tab-shortcuts' -import { isTuiAgent } from '../../../shared/tui-agent-config' -import type { TuiAgent } from '../../../shared/tui-agent' +import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { ProjectLaunchContext } from '../../../shared/rpc-contract/preflight-params' import type { AgentLaunchRequestId } from './agent-launch-request-id' import { diff --git a/src/renderer/src/lib/launch-work-item-direct-route-preparation.ts b/src/renderer/src/lib/launch-work-item-direct-route-preparation.ts index c363186d02e..30af5bd4539 100644 --- a/src/renderer/src/lib/launch-work-item-direct-route-preparation.ts +++ b/src/renderer/src/lib/launch-work-item-direct-route-preparation.ts @@ -1,5 +1,5 @@ import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AppState } from '@/store/types' import { getConnectionIdFromState } from '@/lib/connection-owner-resolution' import type { RepoHostFields } from '@/lib/agent-detection-target-inventory' diff --git a/src/renderer/src/lib/launch-work-item-direct-test-fixture.ts b/src/renderer/src/lib/launch-work-item-direct-test-fixture.ts index 5a6449130d5..e4208fadda8 100644 --- a/src/renderer/src/lib/launch-work-item-direct-test-fixture.ts +++ b/src/renderer/src/lib/launch-work-item-direct-test-fixture.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, vi } from 'vitest' import type { Mock } from 'vitest' -import type * as TuiAgentSelectionModule from '../../../shared/tui-agent-selection' -import type * as TuiAgentStartupModule from '@/lib/tui-agent-startup' +import type * as TuiAgentSelectionModule from '../../../shared/agent-launch/catalog/tui-agent-selection' +import type * as TuiAgentStartupModule from '../../../shared/agent-launch/startup/tui-agent-startup' import type * as DirectAgentRoutingModule from '@/lib/launch-work-item-direct-agent-routing' import type * as RuntimeRpcSubscribeModule from '@/runtime/runtime-rpc-subscribe' @@ -133,8 +133,10 @@ vi.mock('@/lib/telemetry', () => ({ tuiAgentToAgentKind: (agent: string) => agent })) -vi.mock('@/lib/tui-agent-startup', async () => { - const actual = await vi.importActual('@/lib/tui-agent-startup') +vi.mock('../../../shared/agent-launch/startup/tui-agent-startup', async () => { + const actual = await vi.importActual( + '../../../shared/agent-launch/startup/tui-agent-startup' + ) return { ...actual, buildAgentDraftLaunchPlan: vi.fn(actual.buildAgentDraftLaunchPlan), @@ -142,9 +144,9 @@ vi.mock('@/lib/tui-agent-startup', async () => { } }) -vi.mock('../../../shared/tui-agent-selection', async () => { +vi.mock('../../../shared/agent-launch/catalog/tui-agent-selection', async () => { const actual = await vi.importActual( - '../../../shared/tui-agent-selection' + '../../../shared/agent-launch/catalog/tui-agent-selection' ) return { ...actual, diff --git a/src/renderer/src/lib/launch-work-item-direct-types.ts b/src/renderer/src/lib/launch-work-item-direct-types.ts index f87f1d385ca..fa0efe31a55 100644 --- a/src/renderer/src/lib/launch-work-item-direct-types.ts +++ b/src/renderer/src/lib/launch-work-item-direct-types.ts @@ -1,8 +1,8 @@ -import type { AgentLaunchInputViews } from '../../../shared/agent-launch-choices' +import type { AgentLaunchInputViews } from '../../../shared/agent-launch/choices/agent-launch-choices' import type { AgentLaunchPreferences } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import type { LinkedWorkItemContext } from '@/lib/linked-work-item-context' import type { TaskProvider } from '../../../shared/task-providers' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../shared/workspace-source' import type { LaunchSource } from '../../../shared/telemetry-events' import type { AgentLaunchChoice } from '@/lib/agent-menu-selection' diff --git a/src/renderer/src/lib/native-chat-launch-prompt.ts b/src/renderer/src/lib/native-chat-launch-prompt.ts index 41aacf66ea6..bc7697eede6 100644 --- a/src/renderer/src/lib/native-chat-launch-prompt.ts +++ b/src/renderer/src/lib/native-chat-launch-prompt.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export type NativeChatLaunchPrompt = { tabId: string diff --git a/src/renderer/src/lib/native-chat-telemetry.ts b/src/renderer/src/lib/native-chat-telemetry.ts index c3eb346292f..16517448323 100644 --- a/src/renderer/src/lib/native-chat-telemetry.ts +++ b/src/renderer/src/lib/native-chat-telemetry.ts @@ -2,7 +2,7 @@ import { track, tuiAgentToAgentKind } from './telemetry' import type { NativeChatRuntime } from '../../../shared/telemetry-events' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' /** Accept broad chat identities and narrow unknowns to telemetry other; callers need no unsafe TuiAgent cast. */ export type NativeChatTelemetryAgent = TuiAgent | (string & {}) | null | undefined diff --git a/src/renderer/src/lib/new-tab-agent-menu-rows.ts b/src/renderer/src/lib/new-tab-agent-menu-rows.ts index 26371150f8d..4c491c7b04b 100644 --- a/src/renderer/src/lib/new-tab-agent-menu-rows.ts +++ b/src/renderer/src/lib/new-tab-agent-menu-rows.ts @@ -3,14 +3,7 @@ import { type AgentLaunchRoutingInput } from '@/lib/agent-launch-routing' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY as CATALOG } from '../../../shared/agent-session/structured-agent-session-surface-capabilities' -import type { HostChatAnswer } from '../../../shared/agent-launch-picker-rows' -export { buildNewTabAgentMenuRows } from '../../../shared/agent-launch-picker-rows' -export type { - HostChatAnswer, - ChatUnavailableReason, - NewTabAgentMenuRow, - NewTabAgentMenuSettings -} from '../../../shared/agent-launch-picker-rows' +import type { HostChatAnswer } from '../../../shared/agent-launch/picker/agent-launch-picker-rows' export function hostChatAnswer(input: AgentLaunchRoutingInput): HostChatAnswer { const support = structuredAgentLaunchSupport(input) diff --git a/src/renderer/src/lib/new-workspace.ts b/src/renderer/src/lib/new-workspace.ts index 8ab74c824f0..c8be56ea2ba 100644 --- a/src/renderer/src/lib/new-workspace.ts +++ b/src/renderer/src/lib/new-workspace.ts @@ -2,7 +2,7 @@ import { useAppStore } from '@/store' import { pasteDraftToAgentPtyWhenReady } from '@/lib/agent-paste-draft' import { sendFollowupPromptWhenAgentReady } from '@/lib/agent-followup-delivery' import { showAutomationPromptNotSentToast } from '@/lib/agent-background-session-timeout-toast' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { AgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import type { LinkedWorkItemContext } from '@/lib/linked-work-item-context' import { beginAgentStartupDeliveryAttempt, diff --git a/src/renderer/src/lib/onboarding-folder-agent-launch.ts b/src/renderer/src/lib/onboarding-folder-agent-launch.ts index c4b9ffc621f..296b147ffc3 100644 --- a/src/renderer/src/lib/onboarding-folder-agent-launch.ts +++ b/src/renderer/src/lib/onboarding-folder-agent-launch.ts @@ -2,7 +2,7 @@ import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/us import type { AgentLaunchPreferences } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import type { ExecutionHostId } from '../../../shared/execution-host' import type { OnboardingState } from '../../../shared/onboarding-state-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { useAppStore } from '@/store' import { resolveAgentLaunchExecutionContext } from '@/lib/launch-agent-execution-context' import { diff --git a/src/renderer/src/lib/onboarding-folder-agent-startup.ts b/src/renderer/src/lib/onboarding-folder-agent-startup.ts index c5282521fec..180a5c39be7 100644 --- a/src/renderer/src/lib/onboarding-folder-agent-startup.ts +++ b/src/renderer/src/lib/onboarding-folder-agent-startup.ts @@ -1,14 +1,14 @@ -import { buildAgentStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import { tuiAgentToAgentKind } from '@/lib/telemetry' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' -import { resolveAgentStartupPlanInputs } from '../../../shared/agent-startup-plan-inputs' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' +import { resolveAgentStartupPlanInputs } from '../../../shared/agent-launch/startup/agent-startup-plan-inputs' import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' -import type { StartupCommandDelivery } from '../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session/lifecycle/agent-session-resume' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { OnboardingState } from '../../../shared/onboarding-state-types' -import type { AgentStartupShell } from '../../../shared/tui-agent-startup-shell' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { AgentStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export type OnboardingFolderAgentStartup = { command: string diff --git a/src/renderer/src/lib/onboarding-folder-cancellation.test.ts b/src/renderer/src/lib/onboarding-folder-cancellation.test.ts index 4ee0cec51c1..fddfd272343 100644 --- a/src/renderer/src/lib/onboarding-folder-cancellation.test.ts +++ b/src/renderer/src/lib/onboarding-folder-cancellation.test.ts @@ -8,7 +8,7 @@ import { makeDetectedResult } from '@/store/slices/worktrees-detected-listing-fi import { getDefaultSettings } from '../../../shared/constants' import { getDefaultOnboardingState } from '../../../shared/onboarding-defaults' import type { PublicKnownRuntimeEnvironment } from '../../../shared/runtime-environments' -import { projectAgentLaunchSettings } from '../../../shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../../shared/agent-launch/choices/agent-launch-settings' import { clearHostAgentMenuSettingsForTests } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { stubRuntimeEnvironmentBridge } from '@/runtime/runtime-environment-bridge-fixture' import { rememberEmptyHostAnswerForTests } from '@/runtime/web-session-tabs-sync/host-terminal-count-fixture' diff --git a/src/renderer/src/lib/open-tab-occupant-agent.ts b/src/renderer/src/lib/open-tab-occupant-agent.ts index f251061610f..e2e91d92005 100644 --- a/src/renderer/src/lib/open-tab-occupant-agent.ts +++ b/src/renderer/src/lib/open-tab-occupant-agent.ts @@ -5,7 +5,7 @@ import type { AgentStatusEntry } from '../../../shared/agent-status-types' import { isTerminalLeafId, makePaneKey } from '../../../shared/stable-pane-id' import type { TerminalLayoutSnapshot } from '../../../shared/terminal-tab-types' import type { TerminalAgent } from '../../../shared/terminal-agent' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { resolveFocusedCompletedTabAgent, resolveFocusedRetainedTabAgent, diff --git a/src/renderer/src/lib/orchestration-skill-coverage.ts b/src/renderer/src/lib/orchestration-skill-coverage.ts index 3f9af2ffd89..5b10ee135f2 100644 --- a/src/renderer/src/lib/orchestration-skill-coverage.ts +++ b/src/renderer/src/lib/orchestration-skill-coverage.ts @@ -1,6 +1,6 @@ import type { AgentType } from '../../../shared/agent-status-types' import type { DiscoveredSkill, SkillDiscoverySource } from '../../../shared/skills' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { getNativeChatAgentProfile, readsSkillSource, @@ -8,7 +8,7 @@ import { } from '../../../shared/native-chat/native-chat-agent-profiles' import { ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names' import { getAgentLabel } from '@/lib/agent-catalog' -import { TUI_AGENT_AUTO_PICK_ORDER } from '../../../shared/tui-agent-selection' +import { TUI_AGENT_AUTO_PICK_ORDER } from '../../../shared/agent-launch/catalog/tui-agent-selection' export type OrchestrationSkillAgentStatus = { agent: TuiAgent diff --git a/src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts b/src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts index b4a2918ccc0..4524612c9ba 100644 --- a/src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts +++ b/src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts @@ -1,6 +1,6 @@ import type { ITerminalOptions } from '@xterm/xterm' import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { isLocalNativeWindowsConpty, type WindowsPtyCompatibilityContext diff --git a/src/renderer/src/lib/pending-worktree-creation.ts b/src/renderer/src/lib/pending-worktree-creation.ts index 199ceddca9b..6d02bd52cb0 100644 --- a/src/renderer/src/lib/pending-worktree-creation.ts +++ b/src/renderer/src/lib/pending-worktree-creation.ts @@ -1,8 +1,8 @@ -import type { agentPickerLaunchInputs } from '../../../shared/agent-launch-picker' +import type { agentPickerLaunchInputs } from '../../../shared/agent-launch/picker/agent-launch-picker' import type { ExecutionHostId } from '../../../shared/execution-host' import { worktreeIdsEqual } from '../../../shared/worktree/id' import type { FolderWorkspaceLinkedTask } from '../../../shared/folder-workspace-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../shared/workspace-source' import type { CreateSparseCheckoutRequest, @@ -16,7 +16,7 @@ import type { WorkspaceLinkedItem, WorkspaceStatus } from '../../../shared/worktree/types' -import type { AgentStartupPlan } from '@/lib/tui-agent-startup' +import type { AgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' import type { TaskSourceContext, WorkspaceRunContext } from '../../../shared/task-source-context' import type { AgentLaunchRoute } from '@/lib/agent-launch-routing' diff --git a/src/renderer/src/lib/quick-workspace-agent-selection.ts b/src/renderer/src/lib/quick-workspace-agent-selection.ts index 96be4a1f996..c3d183f7309 100644 --- a/src/renderer/src/lib/quick-workspace-agent-selection.ts +++ b/src/renderer/src/lib/quick-workspace-agent-selection.ts @@ -1,10 +1,10 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { ProspectiveWorkspace } from '@/lib/agent-launch-route-input' import { isTuiAgentEnabled, pickTuiAgent, TUI_AGENT_AUTO_PICK_ORDER -} from '../../../shared/tui-agent-selection' +} from '../../../shared/agent-launch/catalog/tui-agent-selection' /** `offeredAgentIds`: chosen agents that open as a chat without a CLI; auto-picks stay detected. */ export function pickQuickWorkspaceAgent( diff --git a/src/renderer/src/lib/runtime-agent-background-create.ts b/src/renderer/src/lib/runtime-agent-background-create.ts index 60bf74f2d69..cff13fd5256 100644 --- a/src/renderer/src/lib/runtime-agent-background-create.ts +++ b/src/renderer/src/lib/runtime-agent-background-create.ts @@ -2,14 +2,14 @@ import { hostSupportsLaunchChoices } from '@/runtime/agent-launch-settings/agent import { buildDefaultTerminalOptions } from '@/lib/pane-manager/pane-terminal-options' import { createAgentSessionKeyboardOptions } from '@/runtime/agent-session-keyboard-capability' import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import type { StartupCommandDelivery } from '../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' import type { SessionOptionValue } from '../../../shared/native-chat/input/native-chat-session-options' import type { RuntimeTerminalCreate } from '../../../shared/runtime-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { agentLaunchNeedsPreparedCommand, toAgentLaunchPreferences -} from '../../../shared/agent-launch-preferences' +} from '../../../shared/agent-launch/choices/agent-launch-preferences' import { createAgentSessionCreateOperation, withAgentSessionCreateOperationId diff --git a/src/renderer/src/lib/sleeping-agent-session-launch.ts b/src/renderer/src/lib/sleeping-agent-session-launch.ts index db32864c270..31dafda48d2 100644 --- a/src/renderer/src/lib/sleeping-agent-session-launch.ts +++ b/src/renderer/src/lib/sleeping-agent-session-launch.ts @@ -1,7 +1,7 @@ import { getConnectionIdFromState } from '@/lib/connection-owner-resolution' import { toast } from 'sonner' import { useAppStore } from '@/store' -import { buildAgentResumeStartupPlan } from '@/lib/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-resume-startup' import { tuiAgentToAgentKind } from '@/lib/telemetry' import { persistAgentLaunchTabOrder } from '@/lib/launch-agent-tab-order' import { @@ -14,7 +14,7 @@ import { import { getExecutionHostIdForWorktree } from '@/lib/worktree-runtime-owner' import { runtimeEnvironmentIdUnlessTwin } from '@/lib/resolve-owner' import { getLocalProjectExecutionRuntimeContext } from '@/lib/local-preflight-context' -import { resolveResumeLaunchRecipe } from '../../../shared/tui-agent-launch-defaults' +import { resolveResumeLaunchRecipe } from '../../../shared/agent-launch/choices/tui-agent-launch-defaults' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/lib/source-control-agent-action-launch-check.ts b/src/renderer/src/lib/source-control-agent-action-launch-check.ts index cdf92f3aa2a..4a276e2a10e 100644 --- a/src/renderer/src/lib/source-control-agent-action-launch-check.ts +++ b/src/renderer/src/lib/source-control-agent-action-launch-check.ts @@ -1,7 +1,8 @@ -import { buildAgentStartupPlan, planAgentCliArgsSuffix } from '@/lib/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../shared/agent-launch/startup/tui-agent-startup' +import { planAgentCliArgsSuffix } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { CLIENT_PLATFORM } from '@/lib/new-workspace' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../shared/tui-agent' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { translate } from '@/i18n/i18n' import { resolveLocalWindowsAgentStartupShell } from '../../../shared/windows-terminal-shell' diff --git a/src/renderer/src/lib/source-control-agent-launch-picker.source.test.ts b/src/renderer/src/lib/source-control-agent-launch-picker.source.test.ts index c61e37afbd7..af1c2d556c3 100644 --- a/src/renderer/src/lib/source-control-agent-launch-picker.source.test.ts +++ b/src/renderer/src/lib/source-control-agent-launch-picker.source.test.ts @@ -3,10 +3,13 @@ import { entry } from './source-control-agent-picker-test-fixture' import { agentModelChoiceChips } from '../components/agent/launch-settings/agent-model-choice-chips' import { expect, it } from 'vitest' -import { agentPickerLaunchInputs, type AgentPickerEntry } from '../../../shared/agent-launch-picker' +import { + agentPickerLaunchInputs, + type AgentPickerEntry +} from '../../../shared/agent-launch/picker/agent-launch-picker' import { getDefaultSettings } from '../../../shared/constants' -import { applyAgentPickerEdit } from '../../../shared/agent-launch-picker-edits' +import { applyAgentPickerEdit } from '../../../shared/agent-launch/picker/agent-launch-picker-edits' import { captureSourceControlActionSelection } from '../../../shared/source-control-ai-operation-policy' import { canonicalSourceControlActionSelection, @@ -14,9 +17,9 @@ import { } from '../../../shared/source-control-action-selection' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { agentPickerPanelArguments } from '../../../shared/agent-launch-picker-arguments' +import { agentPickerPanelArguments } from '../../../shared/agent-launch/picker/agent-launch-picker-arguments' import { saveSourceControlActionRecipe } from '../../../shared/source-control-ai-recipe-save' -import { resolveAgentLaunchCommand } from '../../../shared/tui-agent-launch-command' +import { resolveAgentLaunchCommand } from '../../../shared/agent-launch/startup/tui-agent-launch-command' import { applySourceControlPickerDraft, sourceControlPickerDraft @@ -360,7 +363,8 @@ it.each([ ] as const)( 'compiles current %s model context and deliberate dependent options without losing initial/resume intent', async (agent, raw, options, expected, baseOptions) => { - const { tokenizeStartupCommand } = await import('../../../shared/tui-agent-startup-shell') + const { tokenizeStartupCommand } = + await import('../../../shared/agent-launch/startup/tui-agent-startup-shell') const inventory: AgentPickerEntry = { ...entry, agent, @@ -397,7 +401,8 @@ it.each([ ok: true, tokens: expected }) - const { buildAgentResumeStartupPlan } = await import('../../../shared/tui-agent-resume-startup') + const { buildAgentResumeStartupPlan } = + await import('../../../shared/agent-launch/startup/tui-agent-resume-startup') const resumed = buildAgentResumeStartupPlan({ agent, cmdOverrides: {}, diff --git a/src/renderer/src/lib/source-control-agent-launch-picker.test.ts b/src/renderer/src/lib/source-control-agent-launch-picker.test.ts index ae82c3799d3..ee9296d1ca9 100644 --- a/src/renderer/src/lib/source-control-agent-launch-picker.test.ts +++ b/src/renderer/src/lib/source-control-agent-launch-picker.test.ts @@ -1,30 +1,30 @@ -import * as profile from '../../../shared/agent-launch-profile' +import * as profile from '../../../shared/agent-launch/choices/agent-launch-profile' import { entry } from './source-control-agent-picker-test-fixture' import { readFileSync } from 'node:fs' import { z } from 'zod' import { describe, expect, it, vi } from 'vitest' -import * as reconciliation from '../../../shared/agent-choice-reconciliation' +import * as reconciliation from '../../../shared/agent-launch/choices/agent-choice-reconciliation' import { agentPickerEffectiveChoices, agentPickerLaunchInputs, type AgentPickerEntry -} from '../../../shared/agent-launch-picker' +} from '../../../shared/agent-launch/picker/agent-launch-picker' import { getDefaultSettings } from '../../../shared/constants' import { acceptAgentPickerArguments, applyAgentPickerEdit, type AgentPickerEdit -} from '../../../shared/agent-launch-picker-edits' +} from '../../../shared/agent-launch/picker/agent-launch-picker-edits' import { captureSourceControlActionSelection } from '../../../shared/source-control-ai-operation-policy' import { canonicalSourceControlActionSelection, selectSourceControlActionRecipe } from '../../../shared/source-control-action-selection' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' -import { agentPickerPanelArguments } from '../../../shared/agent-launch-picker-arguments' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' +import { agentPickerPanelArguments } from '../../../shared/agent-launch/picker/agent-launch-picker-arguments' import { applySourceControlPickerDraft, diff --git a/src/renderer/src/lib/source-control-agent-launch-picker.ts b/src/renderer/src/lib/source-control-agent-launch-picker.ts index 001ea4ed58a..98da873e74b 100644 --- a/src/renderer/src/lib/source-control-agent-launch-picker.ts +++ b/src/renderer/src/lib/source-control-agent-launch-picker.ts @@ -1,6 +1,9 @@ import { shallow } from 'zustand/shallow' -import { acceptAgentPickerArguments } from '../../../shared/agent-launch-picker-edits' -import type { AgentPickerDraft, AgentPickerEntry } from '../../../shared/agent-launch-picker' +import { acceptAgentPickerArguments } from '../../../shared/agent-launch/picker/agent-launch-picker-edits' +import type { + AgentPickerDraft, + AgentPickerEntry +} from '../../../shared/agent-launch/picker/agent-launch-picker' import { selectSourceControlActionRecipe, pickSourceControlActionAgent, diff --git a/src/renderer/src/lib/source-control-agent-picker-test-fixture.ts b/src/renderer/src/lib/source-control-agent-picker-test-fixture.ts index bb2e7c807c0..82a43e0d9df 100644 --- a/src/renderer/src/lib/source-control-agent-picker-test-fixture.ts +++ b/src/renderer/src/lib/source-control-agent-picker-test-fixture.ts @@ -1,4 +1,4 @@ -import type { AgentPickerEntry } from '../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../shared/agent-launch/picker/agent-launch-picker' export const entry: AgentPickerEntry = { agent: 'claude', diff --git a/src/renderer/src/lib/source-control-agent-picker.ts b/src/renderer/src/lib/source-control-agent-picker.ts index 1d571b2fff6..60d3b5ae403 100644 --- a/src/renderer/src/lib/source-control-agent-picker.ts +++ b/src/renderer/src/lib/source-control-agent-picker.ts @@ -11,18 +11,18 @@ import { pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId } from '../../../shared/source-control-launch-agent-selection' -import { isTuiAgentEnabled } from '../../../shared/tui-agent-selection' +import { isTuiAgentEnabled } from '../../../shared/agent-launch/catalog/tui-agent-selection' import type { Repo } from '../../../shared/repo-types' import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' import { isFolderRepo } from '../../../shared/repo-kind' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AgentDetectionTarget } from '@/hooks/useDetectedAgents' import type { AgentMenuRowsTarget, NewTabAgentMenuModel } from '@/components/tab-bar/use-new-tab-agent-menu-rows' import type { resolveAgentMenuSelection } from '@/lib/agent-menu-selection' -import type { AgentPickerEntry } from '../../../shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../../shared/agent-launch/picker/agent-launch-picker' import type { AgentLaunchSurface } from '@/lib/agent-session-launch-plan' import { resolveSourceControlActionPreferredSurface } from '../../../shared/source-control-action-launch-preferences' diff --git a/src/renderer/src/lib/startup-draft-input-kind.test.ts b/src/renderer/src/lib/startup-draft-input-kind.test.ts index 92a1ca2bf5a..371dfeab8d0 100644 --- a/src/renderer/src/lib/startup-draft-input-kind.test.ts +++ b/src/renderer/src/lib/startup-draft-input-kind.test.ts @@ -3,7 +3,7 @@ // startup paste, or the draft helper that waits for the agent. Both must write it as launch input. import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { TerminalInputKind } from '../../../shared/terminal-input-kind' -import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' +import { TUI_AGENT_CONFIG } from '../../../shared/agent-launch/catalog/tui-agent-config' import { resolveDraftPasteReadyTimeoutMs } from '../../../shared/draft-paste-ready-timeout' import { bindSettlePaneSerializer } from '@/components/terminal-pane/pty-connection/pane-serializer-settle' import type { ConnectPanePtySession } from '@/components/terminal-pane/pty-connection/connect-pane-pty-session' diff --git a/src/renderer/src/lib/structured-agent-launch-settlement.ts b/src/renderer/src/lib/structured-agent-launch-settlement.ts index 5d774c528c7..80fee66cc8c 100644 --- a/src/renderer/src/lib/structured-agent-launch-settlement.ts +++ b/src/renderer/src/lib/structured-agent-launch-settlement.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { ExecutionHostId } from '../../../shared/execution-host' import { StructuredAgentSessionCreateRefusalError } from '@/lib/launch-structured-agent-session' import { diff --git a/src/renderer/src/lib/structured-agent-session-tab-open-through-layout-owner.ts b/src/renderer/src/lib/structured-agent-session-tab-open-through-layout-owner.ts index baccc0e8135..e3b9c25603f 100644 --- a/src/renderer/src/lib/structured-agent-session-tab-open-through-layout-owner.ts +++ b/src/renderer/src/lib/structured-agent-session-tab-open-through-layout-owner.ts @@ -2,7 +2,7 @@ import type { ExecutionHostId } from '../../../shared/execution-host' import type { Tab } from '../../../shared/tab-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { defaultAgentChatLabel } from '../../../shared/agent-session/agent-session-chat-label' import { structuredAgentSessionTabId } from '../../../shared/agent-session/view/structured-agent-session-projection' import { useAppStore } from '@/store' diff --git a/src/renderer/src/lib/tui-agent-startup.ts b/src/renderer/src/lib/tui-agent-startup.ts deleted file mode 100644 index a61e9003d60..00000000000 --- a/src/renderer/src/lib/tui-agent-startup.ts +++ /dev/null @@ -1,14 +0,0 @@ -export { - buildAgentResumeStartupPlan, - buildAgentDraftLaunchPlan, - buildAgentStartupPlan, - planAgentCliArgsSuffix, - isShellProcess, - quoteStartupArg, - resolveStartupShell -} from '../../../shared/tui-agent-startup' -export type { - AgentCliArgsPlan, - AgentDraftLaunchPlan, - AgentStartupPlan -} from '../../../shared/tui-agent-startup' diff --git a/src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts b/src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts index e86c6403c25..b65c0d474da 100644 --- a/src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts +++ b/src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts @@ -10,7 +10,7 @@ import { } from '@/runtime/web-runtime-wake-terminal-respawn' import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/worktree-runtime-owner' import type { WorktreeStartupPayload } from '@/lib/worktree-startup-payload' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { toast } from 'sonner' import { shouldAutoCreateInitialTerminal } from '@/components/terminal/initial-terminal' import { runtimeEnvironmentSupportsCapability } from '@/runtime/runtime-rpc-client' diff --git a/src/renderer/src/lib/workspace-session.ts b/src/renderer/src/lib/workspace-session.ts index c97d74b51af..870e72e5b24 100644 --- a/src/renderer/src/lib/workspace-session.ts +++ b/src/renderer/src/lib/workspace-session.ts @@ -1,4 +1,4 @@ -import { pendingAgentLaunchPane } from '../../../shared/agent-launch-pane-verdict' +import { pendingAgentLaunchPane } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' import type { WorkspaceVisibleTabType } from '../../../shared/tab-types' import type { PersistedOpenFile, diff --git a/src/renderer/src/lib/worktree-activation-store-contract.ts b/src/renderer/src/lib/worktree-activation-store-contract.ts index 07360011cf7..96640041527 100644 --- a/src/renderer/src/lib/worktree-activation-store-contract.ts +++ b/src/renderer/src/lib/worktree-activation-store-contract.ts @@ -1,6 +1,6 @@ import type { ExecutionHostId } from '../../../shared/execution-host' import type { Tab } from '../../../shared/tab-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig diff --git a/src/renderer/src/lib/worktree-activation-surface-selection.ts b/src/renderer/src/lib/worktree-activation-surface-selection.ts index 75c7d5f651e..24f279cd756 100644 --- a/src/renderer/src/lib/worktree-activation-surface-selection.ts +++ b/src/renderer/src/lib/worktree-activation-surface-selection.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { WorktreeDefaultTabsLaunch, WorktreeSetupLaunch diff --git a/src/renderer/src/lib/worktree-creation-agent-seeds.ts b/src/renderer/src/lib/worktree-creation-agent-seeds.ts index d31273fa08a..7abb659fd6d 100644 --- a/src/renderer/src/lib/worktree-creation-agent-seeds.ts +++ b/src/renderer/src/lib/worktree-creation-agent-seeds.ts @@ -5,7 +5,7 @@ import { queueHookCommandsForFirstWorktreeTab } from '@/lib/hook-command-delayed import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/worktree-runtime-owner' import { toWebTerminalSurfaceTabId } from '../../../shared/terminal-surface-id' import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' type AppStoreSnapshot = ReturnType diff --git a/src/renderer/src/lib/worktree-creation-host-agent-launch.ts b/src/renderer/src/lib/worktree-creation-host-agent-launch.ts index 6e4654446e2..fd7f10aa19e 100644 --- a/src/renderer/src/lib/worktree-creation-host-agent-launch.ts +++ b/src/renderer/src/lib/worktree-creation-host-agent-launch.ts @@ -4,7 +4,7 @@ import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation' import type { WorktreeStartupPayload } from '@/lib/worktree-startup-payload' import { buildWorktreeCreationStartupOpt } from '@/lib/worktree-creation-flow-startup' import { agentLaunchPaneNoticeText } from '@/components/terminal-pane/agent-launch-pane-notice-text' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { InitialTerminalOptions } from '@/lib/worktree-activation-store-contract' import type { CreatedWorktreeResult, diff --git a/src/renderer/src/lib/worktree-creation-structured-session-host-decline.test.ts b/src/renderer/src/lib/worktree-creation-structured-session-host-decline.test.ts index 1286c35f8ef..b574d34ad9b 100644 --- a/src/renderer/src/lib/worktree-creation-structured-session-host-decline.test.ts +++ b/src/renderer/src/lib/worktree-creation-structured-session-host-decline.test.ts @@ -35,7 +35,7 @@ vi.mock('@/lib/agent-session/structured-agent-session-provisional-tab', async (i import { useAppStore } from '@/store' import { projectSourceControlActionLaunch } from '../../../shared/source-control-action-launch-preferences' -import { tokenizeStartupCommand } from '../../../shared/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { submitFolderWorkspaceCreate } from '@/components/sidebar/folder-workspace-composer-submit' import { makeFolderWorkspace, diff --git a/src/renderer/src/lib/worktree-startup-payload.ts b/src/renderer/src/lib/worktree-startup-payload.ts index 99c4a753372..d12866f8f65 100644 --- a/src/renderer/src/lib/worktree-startup-payload.ts +++ b/src/renderer/src/lib/worktree-startup-payload.ts @@ -1,6 +1,6 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { EventProps } from '../../../shared/telemetry-events' -import type { StartupCommandDelivery } from '../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig diff --git a/src/renderer/src/lib/worktree-status.ts b/src/renderer/src/lib/worktree-status.ts index a378f714060..1da7c7f32f7 100644 --- a/src/renderer/src/lib/worktree-status.ts +++ b/src/renderer/src/lib/worktree-status.ts @@ -14,7 +14,7 @@ import type { TerminalPaneLayoutNode, TerminalTab } from '../../../shared/terminal-tab-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { LiveAgentWorktreeStatus } from './worktree-activity-state' import { rankWorktreeStatus, type WorktreeStatus } from '../../../shared/worktree-status-rollup' diff --git a/src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport.ts b/src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport.ts index ecba78533d0..712b5479e95 100644 --- a/src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport.ts +++ b/src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport.ts @@ -2,14 +2,14 @@ import { AGENT_SESSION_PERMISSION_OWN_RUNTIME_CAPABILITY } from '../../../../sha import type { AgentLaunchSettings, AgentLaunchSettingsMutation -} from '../../../../shared/agent-launch-settings' +} from '../../../../shared/agent-launch/choices/agent-launch-settings' import { AGENT_LAUNCH_AUTO_PERMISSIONS_CAPABILITY, AGENT_LAUNCH_NATIVE_CHAT_PERMISSIONS_CAPABILITY, AGENT_LAUNCH_PERMISSION_CHOICE_CAPABILITY, AGENT_LAUNCH_SETTINGS_CAPABILITY, AGENT_LAUNCH_CHOICES_CAPABILITY -} from '../../../../shared/agent-launch-runtime-capability' +} from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { callRuntimeRpc, runtimeEnvironmentSupportsCapability } from '@/runtime/runtime-rpc-client' export type AgentLaunchSettingsOwner = { diff --git a/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts b/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts index 5ff53c1f819..94fbd1e68db 100644 --- a/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts +++ b/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts @@ -1,4 +1,4 @@ -import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { peekRuntimeEnvironmentCapability } from '@/runtime/runtime-compatibility-cache' import type { GlobalSettings } from '../../../../shared/global-settings-types' import { diff --git a/src/renderer/src/runtime/agent-resume-host-authority-capability.ts b/src/renderer/src/runtime/agent-resume-host-authority-capability.ts index f48cb676778..a0d677141b7 100644 --- a/src/renderer/src/runtime/agent-resume-host-authority-capability.ts +++ b/src/renderer/src/runtime/agent-resume-host-authority-capability.ts @@ -1,5 +1,5 @@ import type { ResumableTuiAgent } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { AGENT_SESSION_KIMI_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_CURSOR_RESUME_RUNTIME_CAPABILITY, diff --git a/src/renderer/src/runtime/antigravity-generation-compatibility.ts b/src/renderer/src/runtime/antigravity-generation-compatibility.ts index 62d3d84e212..29e66130428 100644 --- a/src/renderer/src/runtime/antigravity-generation-compatibility.ts +++ b/src/renderer/src/runtime/antigravity-generation-compatibility.ts @@ -1,5 +1,5 @@ import { ANTIGRAVITY_CONFIGURED_MODEL_RUNTIME_CAPABILITY } from '../../../shared/protocol-version' -import { hasFlag } from '../../../shared/agent-cli-flag-detection' +import { hasFlag } from '../../../shared/agent-session/options/agent-cli-flag-detection' import { planCommitMessageGeneration } from '../../../shared/commit-message-plan' import { resolveSourceControlAiForOperation } from '../../../shared/source-control-ai' import { diff --git a/src/renderer/src/runtime/structured-chat-host-permission.ts b/src/renderer/src/runtime/structured-chat-host-permission.ts index a003392cf08..76e93c15c8c 100644 --- a/src/renderer/src/runtime/structured-chat-host-permission.ts +++ b/src/renderer/src/runtime/structured-chat-host-permission.ts @@ -1,14 +1,12 @@ import { useCallback, useEffect, useState } from 'react' -import { - agentChatPermissionModes, - newChatPermissionModeForSettings -} from '../../../shared/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../shared/agent-launch/permissions/agent-chat-permission-support' +import { newChatPermissionModeForSettings } from '../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { chatPermissionHostVerdict, hostSettingsApplyChatPermissionModes, legacyHostChatPermissionMode, type ChatPermissionHostVerdict -} from '../../../shared/agent-chat-permission-host-support' +} from '../../../shared/agent-launch/permissions/agent-chat-permission-host-support' import { AGENT_SESSION_PERMISSION_MODES_RUNTIME_CAPABILITY } from '../../../shared/agent-session/agent-session-permission-modes-capability' import type { RuntimeClientTarget } from '../../../shared/runtime-client-target' import { useAppStore } from '@/store' diff --git a/src/renderer/src/runtime/web-runtime-agent-launch-options.test.ts b/src/renderer/src/runtime/web-runtime-agent-launch-options.test.ts index 69edf137bda..7ab0ecd5650 100644 --- a/src/renderer/src/runtime/web-runtime-agent-launch-options.test.ts +++ b/src/renderer/src/runtime/web-runtime-agent-launch-options.test.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { SessionOptionValue } from '../../../shared/native-chat/input/native-chat-session-options' import { afterEach, expect, it, vi } from 'vitest' import { resetWebSessionCloseIntentForTests } from './web-session-close-intent' @@ -225,9 +225,11 @@ it.each(fixtures)('conserves $name through the actual web create adapter', async await import('@/runtime/agent-launch-settings/use-host-agent-launch-preferences') const { RUNTIME_CAPABILITIES } = await import('../../../shared/protocol-version') const { resolveAgentStartupPlanInputs } = - await import('../../../shared/agent-startup-plan-inputs') - const { buildAgentStartupPlan } = await import('../../../shared/tui-agent-startup') - const { tokenizeStartupCommand } = await import('../../../shared/tui-agent-startup-shell') + await import('../../../shared/agent-launch/startup/agent-startup-plan-inputs') + const { buildAgentStartupPlan } = + await import('../../../shared/agent-launch/startup/tui-agent-startup') + const { tokenizeStartupCommand } = + await import('../../../shared/agent-launch/startup/tui-agent-startup-shell') const { launchAgentInWebHostTab } = await import('@/lib/launch-agent-web-host-tab') vi.spyOn(capabilities, 'hostSupportsLaunchChoices').mockResolvedValue(fixture.capable) vi.spyOn(preferences, 'ensureAgentLaunchPreferences').mockResolvedValue({ diff --git a/src/renderer/src/runtime/web-runtime-session-types.ts b/src/renderer/src/runtime/web-runtime-session-types.ts index 841ff9fb028..d25f3a89d5d 100644 --- a/src/renderer/src/runtime/web-runtime-session-types.ts +++ b/src/renderer/src/runtime/web-runtime-session-types.ts @@ -6,9 +6,9 @@ import type { AgentLaunchPreferences, AgentPromptDelivery } from '../../../shared/agent-session/agent-session-host-authority' -import type { StartupCommandDelivery } from '../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../shared/agent-launch/startup/codex-startup-delivery' import type { RuntimeTerminalCreate } from '../../../shared/runtime-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' export type WebRuntimeTerminalCreateOutcome = | { status: 'created' } diff --git a/src/renderer/src/runtime/web-runtime-terminal-creation.ts b/src/renderer/src/runtime/web-runtime-terminal-creation.ts index beef08dba21..d99300e2529 100644 --- a/src/renderer/src/runtime/web-runtime-terminal-creation.ts +++ b/src/renderer/src/runtime/web-runtime-terminal-creation.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../shared/tui-agent' +import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { deliverLaunchPromptToAgentTab, seedNativeChatLaunchDraftForAgentTab diff --git a/src/renderer/src/store/slices/agent-status/agent-status-nested-resume.spec.ts b/src/renderer/src/store/slices/agent-status/agent-status-nested-resume.spec.ts index 5f09e33bce6..1ebdf55744c 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-nested-resume.spec.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-nested-resume.spec.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { createTestStore } from '../store-test-helpers' import { sleepingRecordFromEntry } from './agent-status-sleeping-records' -import { getAgentResumeArgv } from '../../../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../../../shared/agent-launch/startup/agent-resume-argv' export function registerAgentStatusNestedResumeTests(): void { const PANE = 'tab-1:11111111-1111-4111-8111-111111111111' diff --git a/src/renderer/src/store/slices/agent-status/agent-status-provider-session-actions.ts b/src/renderer/src/store/slices/agent-status/agent-status-provider-session-actions.ts index be0eb471ef5..ca04dd50fa3 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-provider-session-actions.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-provider-session-actions.ts @@ -11,7 +11,7 @@ import { type AgentProviderSessionMetadata, type SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from '../../../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../../../shared/agent-launch/startup/agent-resume-argv' import { resolveAgentPaneAuthorityKey } from '../agent-pane-authority' import { findAgentPaneWorktreeId, diff --git a/src/renderer/src/store/slices/agent-status/agent-status-recovery-collection.ts b/src/renderer/src/store/slices/agent-status/agent-status-recovery-collection.ts index 6628dd0f099..eb4ad2f074d 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-recovery-collection.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-recovery-collection.ts @@ -1,6 +1,6 @@ import type { AppState } from '../../types' import '../../../../../shared/agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from '../../../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../../../shared/agent-launch/startup/agent-resume-argv' import type { SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' import type { RetainedAgentEntry } from './agent-status-contract' import { diff --git a/src/renderer/src/store/slices/agent-status/hook-session-binding-renderer.test-fixture.ts b/src/renderer/src/store/slices/agent-status/hook-session-binding-renderer.test-fixture.ts index f8bce814a74..fb7c1e98207 100644 --- a/src/renderer/src/store/slices/agent-status/hook-session-binding-renderer.test-fixture.ts +++ b/src/renderer/src/store/slices/agent-status/hook-session-binding-renderer.test-fixture.ts @@ -1,6 +1,6 @@ import { expect } from 'vitest' import type { HookSessionBindingRendererFixture } from '../../../../../shared/agent-hook-session-binding.test-fixture' -import { getAgentResumeArgv } from '../../../../../shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../../../../shared/agent-launch/startup/agent-resume-argv' import { resumeRecordFromStatus } from '../../../../../shared/agent-resume-record-from-status' import { createTestStore, makeTab } from '../store-test-helpers' import { isInheritedFromActivePane } from '../../../hooks/ipc-events/agent-status-routing' diff --git a/src/renderer/src/store/slices/detected-agents.ts b/src/renderer/src/store/slices/detected-agents.ts index dbcc9111054..96e137da150 100644 --- a/src/renderer/src/store/slices/detected-agents.ts +++ b/src/renderer/src/store/slices/detected-agents.ts @@ -1,6 +1,6 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { createLocalDetectedAgentState } from './local-detected-agent-state' import type { LocalDetectedAgentState } from './local-detected-agent-store-state' diff --git a/src/renderer/src/store/slices/local-agent-inventory-outcome.ts b/src/renderer/src/store/slices/local-agent-inventory-outcome.ts index 3e28ffeadac..187e25b55c4 100644 --- a/src/renderer/src/store/slices/local-agent-inventory-outcome.ts +++ b/src/renderer/src/store/slices/local-agent-inventory-outcome.ts @@ -1,5 +1,5 @@ import type { AppState } from '../types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { getLocalAgentPreflightContext } from '@/lib/local-preflight-context' import { localAgentInventoryContextKey } from '@/lib/local-preflight-context-key' diff --git a/src/renderer/src/store/slices/local-agent-inventory-refresh.ts b/src/renderer/src/store/slices/local-agent-inventory-refresh.ts index 21274533bff..1774b51d40e 100644 --- a/src/renderer/src/store/slices/local-agent-inventory-refresh.ts +++ b/src/renderer/src/store/slices/local-agent-inventory-refresh.ts @@ -1,9 +1,9 @@ import type { StoreApi } from 'zustand' import type { AppState } from '../types' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import { filterEnabledTuiAgents } from '../../../../shared/tui-agent-selection' +import { filterEnabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { getLocalAgentPreflightContext } from '@/lib/local-preflight-context' import { localAgentInventoryContextKey } from '@/lib/local-preflight-context-key' import * as contextEviction from './local-agent-context-eviction' diff --git a/src/renderer/src/store/slices/local-detected-agent-state.ts b/src/renderer/src/store/slices/local-detected-agent-state.ts index b203e2f9d55..09d7f4e87bc 100644 --- a/src/renderer/src/store/slices/local-detected-agent-state.ts +++ b/src/renderer/src/store/slices/local-detected-agent-state.ts @@ -1,8 +1,8 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../types' -import { haveSameDisabledTuiAgents } from '../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +import { haveSameDisabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' import { getLocalAgentPreflightContext } from '@/lib/local-preflight-context' import { localAgentInventoryContextKey } from '@/lib/local-preflight-context-key' diff --git a/src/renderer/src/store/slices/local-detected-agent-store-state.ts b/src/renderer/src/store/slices/local-detected-agent-store-state.ts index 5451d024e00..4ecf5a8e8d5 100644 --- a/src/renderer/src/store/slices/local-detected-agent-store-state.ts +++ b/src/renderer/src/store/slices/local-detected-agent-store-state.ts @@ -3,7 +3,7 @@ import type { PathSource, ShellHydrationFailureReason } from '../../../../shared/shell-path-hydration-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' /** `wakeWslDistro`: a user act (a click, a runtime choice) that may start a stopped WSL distro. */ export type LocalAgentRefreshOptions = { wakeWslDistro?: boolean } diff --git a/src/renderer/src/store/slices/runtime-detected-agents-pairing.test.ts b/src/renderer/src/store/slices/runtime-detected-agents-pairing.test.ts index d509cbf5f86..68565622e91 100644 --- a/src/renderer/src/store/slices/runtime-detected-agents-pairing.test.ts +++ b/src/renderer/src/store/slices/runtime-detected-agents-pairing.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { PublicKnownRuntimeEnvironment } from '../../../../shared/runtime-environments' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type * as RuntimeRpcClientModule from '@/runtime/runtime-rpc-client' import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-result' diff --git a/src/renderer/src/store/slices/runtime-detected-agents.ts b/src/renderer/src/store/slices/runtime-detected-agents.ts index 34a1e61ffde..4e3149cda6d 100644 --- a/src/renderer/src/store/slices/runtime-detected-agents.ts +++ b/src/renderer/src/store/slices/runtime-detected-agents.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { callRuntimeRpc, getRuntimeEnvironmentStatus, diff --git a/src/renderer/src/store/slices/settings.ts b/src/renderer/src/store/slices/settings.ts index 9fb4e6a5c37..a6f7e32ac0d 100644 --- a/src/renderer/src/store/slices/settings.ts +++ b/src/renderer/src/store/slices/settings.ts @@ -17,8 +17,8 @@ import { normalizeTaskProviderSettings } from '../../../../shared/task-providers import { normalizeOpenInApplications } from '../../../../shared/open-in-applications' import { createSettingsSearchState, type SettingsSearchState } from './settings-search-state' import { isRuntimeCatalogListingStale } from './runtime-status-hydration' -import { normalizeDisabledTuiAgents } from '../../../../shared/tui-agent-selection' -import { sanitizeAgentLaunchProfileUpdates } from '../../../../shared/tui-agent-launch-defaults' +import { normalizeDisabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' +import { sanitizeAgentLaunchProfileUpdates } from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { bumpProviderRuntimeSessionGeneration } from '@/lib/provider-runtime-context' import { normalizeUiLanguage } from '../../../../shared/ui-language' import { normalizeDesktopTerminalScrollbackRows } from '../../../../shared/terminal-scrollback-policy' diff --git a/src/renderer/src/store/slices/tabs/tabs-close-actions.ts b/src/renderer/src/store/slices/tabs/tabs-close-actions.ts index 77913c70dca..3d8f2f4dbfd 100644 --- a/src/renderer/src/store/slices/tabs/tabs-close-actions.ts +++ b/src/renderer/src/store/slices/tabs/tabs-close-actions.ts @@ -28,8 +28,8 @@ import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/layout-owner-sw import { closeContentTabThroughLayoutOwner } from './content-tab-close-through-layout-owner' import { isEditorTabContentType } from '../editor/tabs/editor-tab-content-type' import type { AppState } from '../../types' -import type { TuiAgent } from '../../../../../shared/tui-agent' -import { isTuiAgent } from '../../../../../shared/tui-agent-config' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' import { forgetDesktopCreatedServerTab } from '@/lib/desktop-created-server-tabs' diff --git a/src/renderer/src/store/slices/tabs/tabs-label-actions.ts b/src/renderer/src/store/slices/tabs/tabs-label-actions.ts index d91ec04ed77..aac47405106 100644 --- a/src/renderer/src/store/slices/tabs/tabs-label-actions.ts +++ b/src/renderer/src/store/slices/tabs/tabs-label-actions.ts @@ -1,5 +1,5 @@ import { emitNativeChatToggled } from '@/lib/native-chat-telemetry' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AppState } from '../../types' import type { TabsSlice, TabsSliceGet, TabsSliceSet } from './tabs-slice-contract' import { findTabAndWorktree, patchTab, updateGroup } from '../tab-group-state' diff --git a/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts b/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts index 241b3571c63..99c34c53894 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts @@ -9,7 +9,7 @@ import type { GitLabWorkItem } from '../../../../../shared/gitlab-types' import type { JiraIssue } from '../../../../../shared/jira/jira-types' import type { LinearIssue } from '../../../../../shared/linear/issue-types' import type { TaskProvider } from '../../../../../shared/task-providers' -import type { TuiAgent } from '../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../../shared/telemetry-events' import type { TaskSourceContext } from '../../../../../shared/task-source-context' import type { ExecutionHostId } from '../../../../../shared/execution-host' diff --git a/src/renderer/src/store/slices/worktree-helpers.ts b/src/renderer/src/store/slices/worktree-helpers.ts index bef583025fc..7f8ddec0a3e 100644 --- a/src/renderer/src/store/slices/worktree-helpers.ts +++ b/src/renderer/src/store/slices/worktree-helpers.ts @@ -7,7 +7,7 @@ import type { } from './worktrees/create/worktree-create-payload' import type { WorktreeCatalogVersion } from '../../../../shared/worktree/catalog-version' import type { WorkspaceKey } from '../../../../shared/folder-workspace-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../../shared/workspace-source' import type { WorktreeBaseStatusEvent, diff --git a/src/renderer/src/store/slices/worktrees/create/host-planned-agent-launch.ts b/src/renderer/src/store/slices/worktrees/create/host-planned-agent-launch.ts index 3ad8968311d..ce3cd6de248 100644 --- a/src/renderer/src/store/slices/worktrees/create/host-planned-agent-launch.ts +++ b/src/renderer/src/store/slices/worktrees/create/host-planned-agent-launch.ts @@ -1,7 +1,7 @@ import { isRuntimeCompatBlockError } from '@/runtime/runtime-protocol-compat' import { callRuntimeRpc, runtimeEnvironmentSupportsCapability } from '@/runtime/runtime-rpc-client' import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-result' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../../../shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' import { WORKTREE_CLIENT_AUTOMATION_PROVENANCE_RUNTIME_CAPABILITY } from '../../../../../../shared/worktree-runtime-capabilities' import type { CreateWorktreeResult } from '../../../../../../shared/worktree/create-types' import type { ClientWorktreeCreateSettings } from './client-worktree-create-settings' diff --git a/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts b/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts index fdbdba561c8..f4104843a58 100644 --- a/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts +++ b/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../../../shared/sidebar-inputs-switch' import type { CreateWorktreeArgs, diff --git a/src/renderer/src/store/terminals/terminal-actions.ts b/src/renderer/src/store/terminals/terminal-actions.ts index de3ee08451f..92e8bfef3c7 100644 --- a/src/renderer/src/store/terminals/terminal-actions.ts +++ b/src/renderer/src/store/terminals/terminal-actions.ts @@ -2,14 +2,14 @@ import type { TerminalState } from './terminal-state' import type { Tab } from '../../../../shared/tab-types' import type { TabSplitTarget } from '../slices/tabs/tabs-slice-contract' import type { TerminalLayoutSnapshot, TerminalTab } from '../../../../shared/terminal-tab-types' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { WorkspaceSessionState } from '../../../../shared/workspace-session-state-types' import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig, SleepingAgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { SessionOptionValue } from '../../../../shared/native-chat/input/native-chat-session-options' import type { AgentStartedTelemetry } from '../../lib/worktree-startup-payload' import type { AiVaultSessionTitle } from '../../../../shared/ai-vault-session-title' diff --git a/src/renderer/src/store/terminals/terminal-contracts.ts b/src/renderer/src/store/terminals/terminal-contracts.ts index 65062622cff..3f0764ddbea 100644 --- a/src/renderer/src/store/terminals/terminal-contracts.ts +++ b/src/renderer/src/store/terminals/terminal-contracts.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { ExecutionHostId } from '../../../../shared/execution-host' import type { WorkspaceSessionHydrationOptions } from '@/lib/workspace-session-hydration-keys' diff --git a/src/renderer/src/store/terminals/terminal-state.ts b/src/renderer/src/store/terminals/terminal-state.ts index e7d3dfeaeda..02257b03889 100644 --- a/src/renderer/src/store/terminals/terminal-state.ts +++ b/src/renderer/src/store/terminals/terminal-state.ts @@ -4,14 +4,14 @@ import type { PaneResumeOutcome, PaneStartStatus } from '../../../../shared/workspace-layout/workspace-layout-published' -import type { TuiAgent } from '../../../../shared/tui-agent' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { SavedResumeStartupSource, AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' +import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { SessionOptionValue } from '../../../../shared/native-chat/input/native-chat-session-options' import type { AgentStartedTelemetry } from '../../lib/worktree-startup-payload' import type { NativeChatLaunchDraft, NativeChatLaunchPrompt } from '@/lib/native-chat-launch-prompt' @@ -24,7 +24,7 @@ import type { import type { StateCreator } from 'zustand' import type { AppState } from '../types' import type { TerminalActions } from './terminal-actions' -import type { AgentPaneLaunchRequest } from '../../../../shared/agent-pane-launch-request' +import type { AgentPaneLaunchRequest } from '../../../../shared/agent-launch/contracts/agent-pane-launch-request' import type { PairedTerminalTabCloseIntentSlice } from './paired-terminal-tab-close-intent-actions' export type TerminalState = { diff --git a/src/renderer/src/web/preload-api/web-chat-permission-normalization.test.ts b/src/renderer/src/web/preload-api/web-chat-permission-normalization.test.ts index a27bb7cb994..4384a48855c 100644 --- a/src/renderer/src/web/preload-api/web-chat-permission-normalization.test.ts +++ b/src/renderer/src/web/preload-api/web-chat-permission-normalization.test.ts @@ -1,11 +1,11 @@ import { expect, it } from 'vitest' import { migrateStoredWebSettings } from './web-preference-normalization' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { resolveAgentPermission } from '../../../../shared/tui-agent-permission-choice' +import { resolveAgentPermission } from '../../../../shared/agent-launch/permissions/tui-agent-permission-choice' import { resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from '../../../../shared/tui-agent-launch-defaults' +} from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' it.each([ ['mixed', '--dangerously-skip-permissions --model sonnet', '--model sonnet', 'full-access'], diff --git a/src/renderer/src/web/preload-api/web-preference-normalization.ts b/src/renderer/src/web/preload-api/web-preference-normalization.ts index 2a8daaa15d7..7b65fba2421 100644 --- a/src/renderer/src/web/preload-api/web-preference-normalization.ts +++ b/src/renderer/src/web/preload-api/web-preference-normalization.ts @@ -1,9 +1,9 @@ -import { normalizeAgentLaunchChoices } from '../../../../shared/agent-launch-choices' +import { normalizeAgentLaunchChoices } from '../../../../shared/agent-launch/choices/agent-launch-choices' import { hasLegacyMatchTerminalSidebar, syncLegacyMatchTerminalSidebar } from '../../../../shared/plugin-theme-settings' -import { isAgentChatPermissionMode } from '../../../../shared/agent-chat-permission-mode' +import { isAgentChatPermissionMode } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import { normalizeNativeChatAppearanceSettings } from '../../../../shared/native-chat/native-chat-appearance-settings' import { normalizeAgentDefaultSurface, @@ -33,12 +33,12 @@ import { DEFAULT_TUI_AGENT_ENV, normalizeTuiAgentArgsRecord, normalizeTuiAgentEnvRecord -} from '../../../../shared/tui-agent-launch-defaults' -import { hasTypedAgentPermission } from '../../../../shared/tui-agent-permission-choice' -import { migrateAgentPermissionChoice } from '../../../../shared/tui-agent-permission-lift' +} from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' +import { hasTypedAgentPermission } from '../../../../shared/agent-launch/permissions/tui-agent-permission-choice' +import { migrateAgentPermissionChoice } from '../../../../shared/agent-launch/permissions/tui-agent-permission-lift' import { normalizeOsc52ClipboardDefaultOn } from '../../../../shared/osc52-clipboard-settings' import { normalizeTerminalCursorStyleDefault } from '../../../../shared/terminal-cursor-style-settings' -import { normalizeDisabledTuiAgents } from '../../../../shared/tui-agent-selection' +import { normalizeDisabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { normalizeUiLanguage } from '../../../../shared/ui-language' import { migratePortugueseUiLanguageOnLoad } from '../../../../shared/portuguese-ui-language-migration' import { normalizeUsagePercentageDisplay } from '../../../../shared/usage-percentage-display' diff --git a/src/shared/agent-hook-listener/pane-provider-session.ts b/src/shared/agent-hook-listener/pane-provider-session.ts index bcd15d816eb..fbedd1ea8e8 100644 --- a/src/shared/agent-hook-listener/pane-provider-session.ts +++ b/src/shared/agent-hook-listener/pane-provider-session.ts @@ -1,5 +1,5 @@ import type { AgentHookSource } from '../agent-hook-relay' -import { readAgentEffortLevel } from '../agent-effort-level' +import { readAgentEffortLevel } from '../agent-launch/choices/agent-effort-level' import { extractAgentProviderSession, readPathFromKeys, diff --git a/src/shared/agent-kind.ts b/src/shared/agent-kind.ts index e8151da9797..af9544ac5ad 100644 --- a/src/shared/agent-kind.ts +++ b/src/shared/agent-kind.ts @@ -1,7 +1,7 @@ // Share exhaustive launch-to-telemetry mapping between renderer and main so new agents retain distinct attribution. import type { AgentKind } from './telemetry-events' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' type ConcreteAgentKind = Exclude diff --git a/src/shared/agent-cli-installation-problem.ts b/src/shared/agent-launch/catalog/agent-cli-installation-problem.ts similarity index 91% rename from src/shared/agent-cli-installation-problem.ts rename to src/shared/agent-launch/catalog/agent-cli-installation-problem.ts index 942cae35509..42ef8854c9a 100644 --- a/src/shared/agent-cli-installation-problem.ts +++ b/src/shared/agent-launch/catalog/agent-cli-installation-problem.ts @@ -1,5 +1,5 @@ -import { isValidAppVersion } from './app-version' -import type { CodexInstallationProblem } from './codex-cli-installation' +import { isValidAppVersion } from '../../app-version' +import type { CodexInstallationProblem } from '../../codex-cli-installation' import type { TuiAgent } from './tui-agent' import { isTuiAgent } from './tui-agent-config' diff --git a/src/shared/tui-agent-config-types.ts b/src/shared/agent-launch/catalog/tui-agent-config-types.ts similarity index 100% rename from src/shared/tui-agent-config-types.ts rename to src/shared/agent-launch/catalog/tui-agent-config-types.ts diff --git a/src/shared/tui-agent-config.ts b/src/shared/agent-launch/catalog/tui-agent-config.ts similarity index 98% rename from src/shared/tui-agent-config.ts rename to src/shared/agent-launch/catalog/tui-agent-config.ts index 501dc89f4c8..d69f51afe9c 100644 --- a/src/shared/tui-agent-config.ts +++ b/src/shared/agent-launch/catalog/tui-agent-config.ts @@ -1,15 +1,10 @@ import type { TuiAgent } from './tui-agent' -import { getOrcaCliCommandNameForPlatform, skipsLinuxOrcaCliRename } from './orca-cli-command-name' +import { + getOrcaCliCommandNameForPlatform, + skipsLinuxOrcaCliRename +} from '../../orca-cli-command-name' import type { TuiAgentConfig, TuiAgentConfigSource } from './tui-agent-config-types' -export type { - AgentPromptInjectionMode, - DraftPasteMarkerSignal, - DraftPasteReadySignal, - TuiAgentConfig, - TuiAgentDetectionRuntime -} from './tui-agent-config-types' - function resolveTuiAgentConfig(source: TuiAgentConfigSource): TuiAgentConfig { return { ...source, diff --git a/src/shared/tui-agent-detection-commands.ts b/src/shared/agent-launch/catalog/tui-agent-detection-commands.ts similarity index 92% rename from src/shared/tui-agent-detection-commands.ts rename to src/shared/agent-launch/catalog/tui-agent-detection-commands.ts index dbce135b4c7..c9a62fe0013 100644 --- a/src/shared/tui-agent-detection-commands.ts +++ b/src/shared/agent-launch/catalog/tui-agent-detection-commands.ts @@ -1,10 +1,6 @@ import type { TuiAgent } from './tui-agent' -import { - getTuiAgentDetectCommands, - TUI_AGENT_CONFIG, - type TuiAgentConfig, - type TuiAgentDetectionRuntime -} from './tui-agent-config' +import { getTuiAgentDetectCommands, TUI_AGENT_CONFIG } from './tui-agent-config' +import type { TuiAgentConfig, TuiAgentDetectionRuntime } from './tui-agent-config-types' export type TuiAgentDetectionCommand = { id: TuiAgent diff --git a/src/shared/tui-agent-display-names.ts b/src/shared/agent-launch/catalog/tui-agent-display-names.ts similarity index 100% rename from src/shared/tui-agent-display-names.ts rename to src/shared/agent-launch/catalog/tui-agent-display-names.ts diff --git a/src/shared/tui-agent-favicon-domains.ts b/src/shared/agent-launch/catalog/tui-agent-favicon-domains.ts similarity index 100% rename from src/shared/tui-agent-favicon-domains.ts rename to src/shared/agent-launch/catalog/tui-agent-favicon-domains.ts diff --git a/src/shared/tui-agent-selection.test.ts b/src/shared/agent-launch/catalog/tui-agent-selection.test.ts similarity index 100% rename from src/shared/tui-agent-selection.test.ts rename to src/shared/agent-launch/catalog/tui-agent-selection.test.ts diff --git a/src/shared/tui-agent-selection.ts b/src/shared/agent-launch/catalog/tui-agent-selection.ts similarity index 98% rename from src/shared/tui-agent-selection.ts rename to src/shared/agent-launch/catalog/tui-agent-selection.ts index ab2189c2288..07c67b50806 100644 --- a/src/shared/tui-agent-selection.ts +++ b/src/shared/agent-launch/catalog/tui-agent-selection.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from './tui-agent' -import type { GlobalSettings } from './global-settings-types' +import type { GlobalSettings } from '../../global-settings-types' import { isTuiAgent } from './tui-agent-config' // Match desktop catalog order: this determines fallback priority without a selected default. diff --git a/src/shared/tui-agent.ts b/src/shared/agent-launch/catalog/tui-agent.ts similarity index 100% rename from src/shared/tui-agent.ts rename to src/shared/agent-launch/catalog/tui-agent.ts diff --git a/src/shared/agent-choice-args-analysis.ts b/src/shared/agent-launch/choices/agent-choice-args-analysis.ts similarity index 98% rename from src/shared/agent-choice-args-analysis.ts rename to src/shared/agent-launch/choices/agent-choice-args-analysis.ts index 18ea92afccd..1fa1a11df5d 100644 --- a/src/shared/agent-choice-args-analysis.ts +++ b/src/shared/agent-launch/choices/agent-choice-args-analysis.ts @@ -3,15 +3,15 @@ import { permissionOptionInventory, analyzeAgentChoiceWords, optionName -} from './agent-permission-args' -import { agentPermissionArgs } from './tui-agent-permission-choice' +} from '../permissions/agent-permission-args' +import { agentPermissionArgs } from '../permissions/tui-agent-permission-choice' import { readAgentChoiceSettings, agentChoiceSettingsOccurrences } from './agent-choice-settings' import { quoteStartupArg, tokenizeStartupCommand, type AgentStartupShell -} from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +} from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' import { agentChoiceConfigString, agentChoiceConfigValue } from './agent-choice-cli-apply' export type ChoiceOccurrence = { diff --git a/src/shared/agent-choice-args.ts b/src/shared/agent-launch/choices/agent-choice-args.ts similarity index 86% rename from src/shared/agent-choice-args.ts rename to src/shared/agent-launch/choices/agent-choice-args.ts index 440042f1ad3..8e413dd3c29 100644 --- a/src/shared/agent-choice-args.ts +++ b/src/shared/agent-launch/choices/agent-choice-args.ts @@ -1,12 +1,12 @@ -import { PERMISSION_LAUNCH_GRAMMARS } from './agent-permission-args' -import type { AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import { PERMISSION_LAUNCH_GRAMMARS } from '../permissions/agent-permission-args' +import type { AgentStartupShell } from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' import { analyzeChoiceArgs, type ChoiceOccurrence } from './agent-choice-args-analysis' import { composeAgentLaunchModel, type ResolvedSessionOptionLaunch -} from './agent-session/options/agent-session-option-launch' -import type { AgentPermissionChoice } from './tui-agent-permission-choice' +} from '../../agent-session/options/agent-session-option-launch' +import type { AgentPermissionChoice } from '../permissions/tui-agent-permission-choice' export type AgentChoicePublicationContext = { shell: AgentStartupShell @@ -73,5 +73,3 @@ export function analyzeAgentChoiceArgs( publishedKeys: new Set(emitted.map((entry) => entry.key)) } } - -export type { ChoiceOccurrence } from './agent-choice-args-analysis' diff --git a/src/shared/agent-choice-cli-apply.test.ts b/src/shared/agent-launch/choices/agent-choice-cli-apply.test.ts similarity index 97% rename from src/shared/agent-choice-cli-apply.test.ts rename to src/shared/agent-launch/choices/agent-choice-cli-apply.test.ts index c95f2534917..cb4437434a3 100644 --- a/src/shared/agent-choice-cli-apply.test.ts +++ b/src/shared/agent-launch/choices/agent-choice-cli-apply.test.ts @@ -1,5 +1,5 @@ import { expect, it } from 'vitest' -import * as startupShell from './tui-agent-startup-shell' +import * as startupShell from '../startup/tui-agent-startup-shell' import { reconcileAgentChoiceArgs, reconcileAgentChoiceArgsDetailed diff --git a/src/shared/agent-choice-cli-apply.ts b/src/shared/agent-launch/choices/agent-choice-cli-apply.ts similarity index 90% rename from src/shared/agent-choice-cli-apply.ts rename to src/shared/agent-launch/choices/agent-choice-cli-apply.ts index 07f24fe9a62..1cde433f682 100644 --- a/src/shared/agent-choice-cli-apply.ts +++ b/src/shared/agent-launch/choices/agent-choice-cli-apply.ts @@ -1,9 +1,9 @@ import { parse as parseToml } from 'smol-toml' -import type { AgentType } from './agent-status-types' +import type { AgentType } from '../../agent-status-types' import type { AgentChoiceCliForm } from './agent-launch-choices' -import type { CatalogOptionApply } from './agent-session/options/agent-session-option-catalog-types' +import type { CatalogOptionApply } from '../../agent-session/options/agent-session-option-catalog-types' import { mergeAgentChoiceSettings, withoutInlineAgentChoiceSettings } from './agent-choice-settings' -import { removeAgentArgOption } from './agent-session/options/agent-session-option-agent-args' +import { removeAgentArgOption } from '../../agent-session/options/agent-session-option-agent-args' type ChoiceCliArgumentForm = Exclude diff --git a/src/shared/agent-choice-layers.ts b/src/shared/agent-launch/choices/agent-choice-layers.ts similarity index 92% rename from src/shared/agent-choice-layers.ts rename to src/shared/agent-launch/choices/agent-choice-layers.ts index 11f325a2bd6..d6141f5ba11 100644 --- a/src/shared/agent-choice-layers.ts +++ b/src/shared/agent-launch/choices/agent-choice-layers.ts @@ -1,11 +1,11 @@ import { agentChoiceSettingsOccurrences } from './agent-choice-settings' -import type { AgentType } from './agent-status-types' -import type { CatalogOptionApply } from './agent-session/options/agent-session-option-catalog-types' +import type { AgentType } from '../../agent-status-types' +import type { CatalogOptionApply } from '../../agent-session/options/agent-session-option-catalog-types' import type { AgentDedicatedChoices } from './agent-launch-choices' import { normalizeAgentModelOptionChoices } from './agent-launch-choices' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' -import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' +import { tokenizeStartupCommand, type AgentStartupShell } from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' export type AgentChoiceLayersInput = { agent: TuiAgent diff --git a/src/shared/agent-choice-reconciliation.ts b/src/shared/agent-launch/choices/agent-choice-reconciliation.ts similarity index 95% rename from src/shared/agent-choice-reconciliation.ts rename to src/shared/agent-launch/choices/agent-choice-reconciliation.ts index b57f5b8b9bf..e1c035f8107 100644 --- a/src/shared/agent-choice-reconciliation.ts +++ b/src/shared/agent-launch/choices/agent-choice-reconciliation.ts @@ -1,20 +1,17 @@ -import { composeAgentLaunchModel } from './agent-session/options/agent-session-option-launch' -import { - analyzeAgentChoiceArgs, - type ChoiceOccurrence, - type AgentChoicePublicationContext -} from './agent-choice-args' +import { composeAgentLaunchModel } from '../../agent-session/options/agent-session-option-launch' +import { analyzeAgentChoiceArgs, type AgentChoicePublicationContext } from './agent-choice-args' +import type { ChoiceOccurrence } from './agent-choice-args-analysis' import { findCatalogModel, getAgentSessionOptionLaunchCatalog -} from './agent-session/options/agent-session-option-catalog' +} from '../../agent-session/options/agent-session-option-catalog' import { normalizeAgentModelOptionChoices, type AgentChoicePatch, type AgentDedicatedChoices } from './agent-launch-choices' -import { agentPermissionChoices } from './tui-agent-permission-choice' -import type { TuiAgent } from './tui-agent' +import { agentPermissionChoices } from '../permissions/tui-agent-permission-choice' +import type { TuiAgent } from '../catalog/tui-agent' export type AgentChoiceArgsInput = { agent: TuiAgent diff --git a/src/shared/agent-choice-settings.ts b/src/shared/agent-launch/choices/agent-choice-settings.ts similarity index 93% rename from src/shared/agent-choice-settings.ts rename to src/shared/agent-launch/choices/agent-choice-settings.ts index 560d11dee84..210fc5464db 100644 --- a/src/shared/agent-choice-settings.ts +++ b/src/shared/agent-launch/choices/agent-choice-settings.ts @@ -1,9 +1,9 @@ -import { findOptionOccurrence } from './command-option-occurrence' +import { findOptionOccurrence } from '../../command-option-occurrence' import { agentRequiredValueOptions, removeAgentArgOption -} from './agent-session/options/agent-session-option-agent-args' -import type { AgentType } from './agent-status-types' +} from '../../agent-session/options/agent-session-option-agent-args' +import type { AgentType } from '../../agent-status-types' export function readAgentChoiceSettings( value: string | undefined diff --git a/src/shared/agent-effort-level.ts b/src/shared/agent-launch/choices/agent-effort-level.ts similarity index 100% rename from src/shared/agent-effort-level.ts rename to src/shared/agent-launch/choices/agent-effort-level.ts diff --git a/src/shared/agent-launch-choice-updates.ts b/src/shared/agent-launch/choices/agent-launch-choice-updates.ts similarity index 94% rename from src/shared/agent-launch-choice-updates.ts rename to src/shared/agent-launch/choices/agent-launch-choice-updates.ts index b6a105cab8d..1176ced117e 100644 --- a/src/shared/agent-launch-choice-updates.ts +++ b/src/shared/agent-launch/choices/agent-launch-choice-updates.ts @@ -1,4 +1,4 @@ -import type { AgentStartupShell } from './tui-agent-startup-shell' +import type { AgentStartupShell } from '../startup/tui-agent-startup-shell' import { reconcileAgentChoiceArgs } from './agent-choice-reconciliation' import { AGENT_LAUNCH_CHOICE_KEYS, @@ -12,8 +12,8 @@ import { applyAgentPermissionOverrides, agentPermissionArgs, resolveAgentPermission -} from './tui-agent-permission-choice' -import type { TuiAgent } from './tui-agent' +} from '../permissions/tui-agent-permission-choice' +import type { TuiAgent } from '../catalog/tui-agent' /** Representation adapters share one reconciler and commit the complete agent tuple. */ export function agentLaunchChoiceUpdates( diff --git a/src/shared/agent-launch-choices.test.ts b/src/shared/agent-launch/choices/agent-launch-choices.test.ts similarity index 98% rename from src/shared/agent-launch-choices.test.ts rename to src/shared/agent-launch/choices/agent-launch-choices.test.ts index b14564fb8c3..445b4766bb3 100644 --- a/src/shared/agent-launch-choices.test.ts +++ b/src/shared/agent-launch/choices/agent-launch-choices.test.ts @@ -2,16 +2,16 @@ import { normalizeSourceControlActionRecipe, readSourceControlActionDefault, type SourceControlActionRecipe -} from './source-control-ai-actions' -import { liftActionPermissionArgs } from './source-control-action-permission-lift' +} from '../../source-control-ai-actions' +import { liftActionPermissionArgs } from '../../source-control-action-permission-lift' import { lowerActionArgumentChoices, readActionArgumentNode, - transportActionArgumentChoices, - editActionArgumentChoices -} from './source-control-action-argument-choices' -import * as startupShell from './tui-agent-startup-shell' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' + transportActionArgumentChoices +} from '../../source-control-action-argument-document' +import { editActionArgumentChoices } from '../../source-control-action-argument-choices' +import * as startupShell from '../startup/tui-agent-startup-shell' +import { tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' import { describe, expect, it, vi } from 'vitest' import * as choiceArgs from './agent-choice-args' import { diff --git a/src/shared/agent-launch-choices.ts b/src/shared/agent-launch/choices/agent-launch-choices.ts similarity index 89% rename from src/shared/agent-launch-choices.ts rename to src/shared/agent-launch/choices/agent-launch-choices.ts index b27f614e2e8..dcab48b1da6 100644 --- a/src/shared/agent-launch-choices.ts +++ b/src/shared/agent-launch/choices/agent-launch-choices.ts @@ -1,7 +1,7 @@ -import { isTuiAgent } from './tui-agent-config' -import { isAgentSessionOptions } from './agent-session/lifecycle/agent-session-record' -import type { TuiAgent } from './tui-agent' -import type { AgentPermissionChoice } from './tui-agent-permission-choice' +import { isTuiAgent } from '../catalog/tui-agent-config' +import { isAgentSessionOptions } from '../../agent-session/lifecycle/agent-session-record' +import type { TuiAgent } from '../catalog/tui-agent' +import type { AgentPermissionChoice } from '../permissions/tui-agent-permission-choice' export type AgentModelOptionChoices = { model?: string; options?: Record } export type AgentDedicatedChoices = AgentModelOptionChoices & { diff --git a/src/shared/agent-launch-default-choices.test.ts b/src/shared/agent-launch/choices/agent-launch-default-choices.test.ts similarity index 93% rename from src/shared/agent-launch-default-choices.test.ts rename to src/shared/agent-launch/choices/agent-launch-default-choices.test.ts index f0268a65fa2..8c37ce944df 100644 --- a/src/shared/agent-launch-default-choices.test.ts +++ b/src/shared/agent-launch/choices/agent-launch-default-choices.test.ts @@ -1,13 +1,16 @@ import { resolveAgentChoiceLayers } from './agent-choice-layers' -import { terminalSessionOptionInputs, resolveAgentLaunchCommand } from './tui-agent-launch-command' -import { quoteStartupArg, tokenizeStartupCommand } from './tui-agent-startup-shell' +import { + terminalSessionOptionInputs, + resolveAgentLaunchCommand +} from '../startup/tui-agent-launch-command' +import { quoteStartupArg, tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' import { describe, expect, it } from 'vitest' import { agentLaunchSettingsMutationUpdates, type AgentLaunchSettingsSource } from './agent-launch-settings' -import { migrateAgentPermissionChoice } from './tui-agent-permission-lift' -import './native-chat/input/native-chat-session-option-defaults' +import { migrateAgentPermissionChoice } from '../permissions/tui-agent-permission-lift' +import '../../native-chat/input/native-chat-session-option-defaults' const baseline: AgentLaunchSettingsSource = { agentPermissionDefault: 'ask', diff --git a/src/shared/agent-launch-environment-updates.ts b/src/shared/agent-launch/choices/agent-launch-environment-updates.ts similarity index 91% rename from src/shared/agent-launch-environment-updates.ts rename to src/shared/agent-launch/choices/agent-launch-environment-updates.ts index ec667416b6d..55709e3fc01 100644 --- a/src/shared/agent-launch-environment-updates.ts +++ b/src/shared/agent-launch/choices/agent-launch-environment-updates.ts @@ -1,4 +1,7 @@ -import { agentPermissionHostPlatform, permissionEnvNameMatches } from './agent-permission-env' +import { + agentPermissionHostPlatform, + permissionEnvNameMatches +} from '../permissions/agent-permission-env' import type { AgentLaunchSettingsMutation, AgentLaunchSettingsSource @@ -10,9 +13,9 @@ import { hasTypedAgentPermission, resolveAgentPermission, type AgentPermissionChoice -} from './tui-agent-permission-choice' -import { liftAgentPermissionEnv } from './tui-agent-permission-lift' -import type { TuiAgent } from './tui-agent' +} from '../permissions/tui-agent-permission-choice' +import { liftAgentPermissionEnv } from '../permissions/tui-agent-permission-lift' +import type { TuiAgent } from '../catalog/tui-agent' /** An agent's choice changed only when it differs from what it resolves to now. */ export function choiceUpdate( diff --git a/src/shared/agent-launch-legacy-publication.test.ts b/src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts similarity index 97% rename from src/shared/agent-launch-legacy-publication.test.ts rename to src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts index 1cc08f4de5e..4122a1504c8 100644 --- a/src/shared/agent-launch-legacy-publication.test.ts +++ b/src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts @@ -6,9 +6,9 @@ import { } from './agent-launch-settings' import { legacyLaunchTextUpdates } from './agent-launch-permission-updates' import { composeAgentLaunchProfile } from './tui-agent-launch-defaults' -import { structuredLaunchSeedOptions } from './native-chat/input/native-chat-session-option-defaults' -import { createGlobalSettingsFixture } from './global-settings-test-fixture' -import { quoteStartupArg, tokenizeStartupCommand } from './tui-agent-startup-shell' +import { structuredLaunchSeedOptions } from '../../native-chat/input/native-chat-session-option-defaults' +import { createGlobalSettingsFixture } from '../../global-settings-test-fixture' +import { quoteStartupArg, tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' it('conserves canonical identity across both host-shell publications, edits and removals', () => { for (const [terminalWindowsShell, shell] of [ diff --git a/src/shared/agent-launch-model-preferences.ts b/src/shared/agent-launch/choices/agent-launch-model-preferences.ts similarity index 91% rename from src/shared/agent-launch-model-preferences.ts rename to src/shared/agent-launch/choices/agent-launch-model-preferences.ts index c6c98cbc7e0..b87ca16eb87 100644 --- a/src/shared/agent-launch-model-preferences.ts +++ b/src/shared/agent-launch/choices/agent-launch-model-preferences.ts @@ -1,13 +1,13 @@ /** Use the launch catalog for every caller's model/effort validation so CLI and orchestration refusals agree. */ -import type { AgentLaunchPreferences } from './agent-session/agent-session-host-authority' +import type { AgentLaunchPreferences } from '../../agent-session/agent-session-host-authority' import { findCatalogModel, findCatalogOption, getAgentSessionOptionLaunchCatalog -} from './agent-session/options/agent-session-option-catalog' -import { resolveAgentSessionOptionLaunch } from './agent-session/options/agent-session-option-launch' -import type { TuiAgent } from './tui-agent' +} from '../../agent-session/options/agent-session-option-catalog' +import { resolveAgentSessionOptionLaunch } from '../../agent-session/options/agent-session-option-launch' +import type { TuiAgent } from '../catalog/tui-agent' export const OPENCODE_MODEL_VERSION_REFUSAL = 'OpenCode cannot safely start with a chosen model on this version. Update OpenCode to a supported release, or omit the model choice.' diff --git a/src/shared/agent-launch-permission-updates.ts b/src/shared/agent-launch/choices/agent-launch-permission-updates.ts similarity index 95% rename from src/shared/agent-launch-permission-updates.ts rename to src/shared/agent-launch/choices/agent-launch-permission-updates.ts index de379b06268..c1a144c6438 100644 --- a/src/shared/agent-launch-permission-updates.ts +++ b/src/shared/agent-launch/choices/agent-launch-permission-updates.ts @@ -1,7 +1,10 @@ -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' -import { resolveStartupShell } from './tui-agent-startup-shell' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' +import { resolveStartupShell } from '../startup/tui-agent-startup-shell' import { agentLaunchChoiceUpdates } from './agent-launch-choice-updates' -import { agentPermissionHostPlatform, permissionEnvNameMatches } from './agent-permission-env' +import { + agentPermissionHostPlatform, + permissionEnvNameMatches +} from '../permissions/agent-permission-env' import { agentEnvironmentMutationUpdates, choiceUpdate, @@ -27,10 +30,10 @@ import { PERMISSION_CHOICE_AGENTS, resolveAgentPermission, type AgentPermissionChoice -} from './tui-agent-permission-choice' -import { liftAgentPermissionArgs } from './tui-agent-permission-lift' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +} from '../permissions/tui-agent-permission-choice' +import { liftAgentPermissionArgs } from '../permissions/tui-agent-permission-lift' +import { isTuiAgent } from '../catalog/tui-agent-config' +import type { TuiAgent } from '../catalog/tui-agent' // Agent launch settings writes against the stored permission, including the shapes older clients // send, which treat the permission flag as part of the Arguments text. diff --git a/src/shared/agent-launch-preferences.ts b/src/shared/agent-launch/choices/agent-launch-preferences.ts similarity index 80% rename from src/shared/agent-launch-preferences.ts rename to src/shared/agent-launch/choices/agent-launch-preferences.ts index 54ba896023a..919d980c23d 100644 --- a/src/shared/agent-launch-preferences.ts +++ b/src/shared/agent-launch/choices/agent-launch-preferences.ts @@ -1,15 +1,15 @@ -import { YOLO_TUI_AGENT_ENV } from './tui-agent-permissions' -import type { AgentLaunchPreferences } from './agent-session/agent-session-host-authority' -import type { AgentType } from './agent-status-types' +import { YOLO_TUI_AGENT_ENV } from '../permissions/tui-agent-permissions' +import type { AgentLaunchPreferences } from '../../agent-session/agent-session-host-authority' +import type { AgentType } from '../../agent-status-types' import { readLaunchPermissionChoice, agentPermissionHasTerminalChoice -} from './tui-agent-permission-choice' -import { isTuiAgent } from './tui-agent-config' +} from '../permissions/tui-agent-permission-choice' +import { isTuiAgent } from '../catalog/tui-agent-config' import { composeAgentLaunchModel, hasIndependentAgentLaunchOptions -} from './agent-session/options/agent-session-option-launch' +} from '../../agent-session/options/agent-session-option-launch' /** Compose model/effort for this terminal; send permission mode only where the agent has a flag. */ export function toAgentLaunchPreferences( diff --git a/src/shared/agent-launch-profile.ts b/src/shared/agent-launch/choices/agent-launch-profile.ts similarity index 92% rename from src/shared/agent-launch-profile.ts rename to src/shared/agent-launch/choices/agent-launch-profile.ts index afc57bc7b85..3299412c173 100644 --- a/src/shared/agent-launch-profile.ts +++ b/src/shared/agent-launch/choices/agent-launch-profile.ts @@ -1,22 +1,25 @@ import type { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import { agentPermissionArgsForLaunch } from './agent-permission-args' +import { agentPermissionArgsForLaunch } from '../permissions/agent-permission-args' import type { AgentLaunchInputViews, AgentDedicatedChoices } from './agent-launch-choices' import { resolveAgentChoiceLayers } from './agent-choice-layers' import { removeOverriddenAgentSessionArgs, resolveAgentSessionOptionLaunch, type ResolvedSessionOptionLaunch -} from './agent-session/options/agent-session-option-launch' +} from '../../agent-session/options/agent-session-option-launch' import type { AgentLaunchProfileSettings } from './tui-agent-launch-defaults' -import { YOLO_TUI_AGENT_ARGS } from './tui-agent-permissions' -import { hasTypedAgentPermission, resolveAgentPermission } from './tui-agent-permission-choice' -import type { AgentPermissionChoice } from './tui-agent-permission-choice' +import { YOLO_TUI_AGENT_ARGS } from '../permissions/tui-agent-permissions' +import { + hasTypedAgentPermission, + resolveAgentPermission +} from '../permissions/tui-agent-permission-choice' +import type { AgentPermissionChoice } from '../permissions/tui-agent-permission-choice' import { quoteStartupArg, tokenizeStartupCommand, type AgentStartupShell -} from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +} from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' export type AgentLaunchProfileProjection = { target: 'terminal' | 'structured' | 'legacy-permission' diff --git a/src/shared/agent-launch-settings-auto-projection.test.ts b/src/shared/agent-launch/choices/agent-launch-settings-auto-projection.test.ts similarity index 96% rename from src/shared/agent-launch-settings-auto-projection.test.ts rename to src/shared/agent-launch/choices/agent-launch-settings-auto-projection.test.ts index 0dd9e49e521..e4224ed5d5c 100644 --- a/src/shared/agent-launch-settings-auto-projection.test.ts +++ b/src/shared/agent-launch/choices/agent-launch-settings-auto-projection.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { agentLaunchSettingsMutationUpdates } from './agent-launch-settings' -import { applyAgentPermissionMode, AUTO_TUI_AGENT_ARGS } from './tui-agent-permissions' +import { applyAgentPermissionMode, AUTO_TUI_AGENT_ARGS } from '../permissions/tui-agent-permissions' describe('agent launch permission projection compatibility', () => { it('changes only agents Auto does not cover', () => { diff --git a/src/shared/agent-launch-settings-permissions.test.ts b/src/shared/agent-launch/choices/agent-launch-settings-permissions.test.ts similarity index 89% rename from src/shared/agent-launch-settings-permissions.test.ts rename to src/shared/agent-launch/choices/agent-launch-settings-permissions.test.ts index 226a6af62c9..0b21935c0c8 100644 --- a/src/shared/agent-launch-settings-permissions.test.ts +++ b/src/shared/agent-launch/choices/agent-launch-settings-permissions.test.ts @@ -1,6 +1,6 @@ import { expect, it } from 'vitest' import { agentLaunchSettingsMutationUpdates } from './agent-launch-settings' -import { structuredLaunchSeedOptions } from './native-chat/input/native-chat-session-option-defaults' +import { structuredLaunchSeedOptions } from '../../native-chat/input/native-chat-session-option-defaults' it.each([ ['yolo', 'full-access'], diff --git a/src/shared/agent-launch-settings.ts b/src/shared/agent-launch/choices/agent-launch-settings.ts similarity index 93% rename from src/shared/agent-launch-settings.ts rename to src/shared/agent-launch/choices/agent-launch-settings.ts index 304063bcf22..ef4ee924750 100644 --- a/src/shared/agent-launch-settings.ts +++ b/src/shared/agent-launch/choices/agent-launch-settings.ts @@ -1,26 +1,29 @@ -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' -import { resolveStartupShell } from './tui-agent-startup-shell' -import { agentPermissionHostPlatform } from './agent-permission-env' -import { isTuiAgent } from './tui-agent-config' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' +import { resolveStartupShell } from '../startup/tui-agent-startup-shell' +import { agentPermissionHostPlatform } from '../permissions/agent-permission-env' +import { isTuiAgent } from '../catalog/tui-agent-config' import { agentLaunchChoiceUpdates } from './agent-launch-choice-updates' import { projectAgentLaunchProfile } from './agent-launch-profile' import type { AgentLaunchChoices, AgentChoicePatch } from './agent-launch-choices' import { agentEnvironmentMutationUpdates, choiceUpdate } from './agent-launch-environment-updates' -import type { GlobalSettings } from './global-settings-types' -import type { TuiAgent } from './tui-agent' +import type { GlobalSettings } from '../../global-settings-types' +import type { TuiAgent } from '../catalog/tui-agent' import { buildDefaultAgentSettingsUpdate } from './default-agent-settings' import { buildAgentAvailabilitySettingsUpdate, normalizeDisabledTuiAgents -} from './tui-agent-selection' +} from '../catalog/tui-agent-selection' import { composeAgentLaunchProfile, normalizeTuiAgentArgsRecord, resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv } from './tui-agent-launch-defaults' -import { hasTypedAgentPermission, type AgentPermissionChoice } from './tui-agent-permission-choice' -import { liftAgentPermissionArgs } from './tui-agent-permission-lift' +import { + hasTypedAgentPermission, + type AgentPermissionChoice +} from '../permissions/tui-agent-permission-choice' +import { liftAgentPermissionArgs } from '../permissions/tui-agent-permission-lift' import { legacyArgumentsUpdates, legacyPermissionsUpdates, @@ -35,7 +38,7 @@ import { resolveAgentPermissionModeSummary, resolveNonAutoAgentPermissionMode, type AgentPermissionMode -} from './tui-agent-permissions' +} from '../permissions/tui-agent-permissions' export type AgentLaunchSettingsSource = Partial< Pick< diff --git a/src/shared/default-agent-settings.test.ts b/src/shared/agent-launch/choices/default-agent-settings.test.ts similarity index 100% rename from src/shared/default-agent-settings.test.ts rename to src/shared/agent-launch/choices/default-agent-settings.test.ts diff --git a/src/shared/default-agent-settings.ts b/src/shared/agent-launch/choices/default-agent-settings.ts similarity index 75% rename from src/shared/default-agent-settings.ts rename to src/shared/agent-launch/choices/default-agent-settings.ts index 08e74114e69..7e297e7ca5a 100644 --- a/src/shared/default-agent-settings.ts +++ b/src/shared/agent-launch/choices/default-agent-settings.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from './global-settings-types' -import type { TuiAgent } from './tui-agent' +import type { GlobalSettings } from '../../global-settings-types' +import type { TuiAgent } from '../catalog/tui-agent' type DefaultAgentSettings = Pick diff --git a/src/shared/tui-agent-launch-defaults.spec.ts b/src/shared/agent-launch/choices/tui-agent-launch-defaults.spec.ts similarity index 97% rename from src/shared/tui-agent-launch-defaults.spec.ts rename to src/shared/agent-launch/choices/tui-agent-launch-defaults.spec.ts index 97012b1d282..2bd3640c642 100644 --- a/src/shared/tui-agent-launch-defaults.spec.ts +++ b/src/shared/agent-launch/choices/tui-agent-launch-defaults.spec.ts @@ -4,8 +4,8 @@ import { resolveTuiAgentLaunchArgs, tuiAgentArgsBypassPermissions } from './tui-agent-launch-defaults' -import { applyAgentPermissionMode, YOLO_TUI_AGENT_ARGS } from './tui-agent-permissions' -import { isTuiAgent } from './tui-agent-config' +import { applyAgentPermissionMode, YOLO_TUI_AGENT_ARGS } from '../permissions/tui-agent-permissions' +import { isTuiAgent } from '../catalog/tui-agent-config' describe('tuiAgentArgsBypassPermissions', () => { // Legacy Yolo intent lives in Arguments, not separate storage; recognize its token sequence anywhere before --. diff --git a/src/shared/tui-agent-launch-defaults.ts b/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts similarity index 94% rename from src/shared/tui-agent-launch-defaults.ts rename to src/shared/agent-launch/choices/tui-agent-launch-defaults.ts index 00dbb1ed7af..6573b4106bf 100644 --- a/src/shared/tui-agent-launch-defaults.ts +++ b/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts @@ -1,9 +1,12 @@ import { normalizeAgentLaunchChoices } from './agent-launch-choices' -import { agentPermissionHostPlatform, permissionEnvNameMatches } from './agent-permission-env' -import type { SleepingAgentLaunchConfig } from './agent-session/lifecycle/agent-session-resume' -import type { GlobalSettings } from './global-settings-types' -import { isTuiAgent } from './tui-agent-config' -import { YOLO_TUI_AGENT_ARGS, YOLO_TUI_AGENT_ENV } from './tui-agent-permissions' +import { + agentPermissionHostPlatform, + permissionEnvNameMatches +} from '../permissions/agent-permission-env' +import type { SleepingAgentLaunchConfig } from '../../agent-session/lifecycle/agent-session-resume' +import type { GlobalSettings } from '../../global-settings-types' +import { isTuiAgent } from '../catalog/tui-agent-config' +import { YOLO_TUI_AGENT_ARGS, YOLO_TUI_AGENT_ENV } from '../permissions/tui-agent-permissions' import { readLaunchPermissionChoice, type AgentPermissionChoice, @@ -12,15 +15,15 @@ import { PERMISSION_CHOICE_AGENTS, resolveAgentPermission, sanitizeAgentPermissionUpdates -} from './tui-agent-permission-choice' +} from '../permissions/tui-agent-permission-choice' import { projectAgentLaunchProfile } from './agent-launch-profile' import { resolveStartupShell, tokenizeStartupCommand, type AgentStartupShell -} from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' +} from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' const UNSUPPORTED_TUI_AGENT_ARGS: Partial> = { opencode: ['--dangerously-skip-permissions'], @@ -177,7 +180,6 @@ function ownArgs(agent: string, settings: AgentLaunchProfileSettings | null | un return typeof value === 'string' ? value : undefined } -export { agentPermissionArgsForLaunch } from './agent-permission-args' /** Compose stored permission flags with user arguments, letting explicit user permission text win. Older host text already includes its flags. */ export function resolveTuiAgentLaunchArgs( agent: string, diff --git a/src/shared/agent-launch-intent.ts b/src/shared/agent-launch/contracts/agent-launch-intent.ts similarity index 99% rename from src/shared/agent-launch-intent.ts rename to src/shared/agent-launch/contracts/agent-launch-intent.ts index 20a15af56c5..ad926997c58 100644 --- a/src/shared/agent-launch-intent.ts +++ b/src/shared/agent-launch/contracts/agent-launch-intent.ts @@ -1,6 +1,6 @@ /** One launch intent for desktop/mobile/CLI/orchestration; the host resolves settings and per-launch feasibility once and reports the created surface. */ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' import type { AgentLaunchSurface } from './agent-launch-surface' /** How a launch's initial text reaches the agent. */ diff --git a/src/shared/agent-launch-operation.test.ts b/src/shared/agent-launch/contracts/agent-launch-operation.test.ts similarity index 96% rename from src/shared/agent-launch-operation.test.ts rename to src/shared/agent-launch/contracts/agent-launch-operation.test.ts index c8d60e43378..a1fc6727c5d 100644 --- a/src/shared/agent-launch-operation.test.ts +++ b/src/shared/agent-launch/contracts/agent-launch-operation.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest' import { computeAgentLaunchFingerprint } from './agent-launch-operation' -import { canonicalAgentSessionDigest } from './agent-session/lifecycle/agent-session-mutation-envelope' +import { canonicalAgentSessionDigest } from '../../agent-session/lifecycle/agent-session-mutation-envelope' describe('transient cwd observation is not launch intent', () => { const create = { diff --git a/src/shared/agent-launch-operation.ts b/src/shared/agent-launch/contracts/agent-launch-operation.ts similarity index 93% rename from src/shared/agent-launch-operation.ts rename to src/shared/agent-launch/contracts/agent-launch-operation.ts index f5647649ba0..32762ccc604 100644 --- a/src/shared/agent-launch-operation.ts +++ b/src/shared/agent-launch/contracts/agent-launch-operation.ts @@ -1,7 +1,7 @@ /** Lost replies are retried, including mobile workspace creation: claim an operation ID durably before side effects, then replay its recorded answer. Unknown outcomes stay refused; this ledger neither adopts nor recovers orphaned surfaces. */ -import { canonicalAgentSessionDigest } from './agent-session/lifecycle/agent-session-mutation-envelope' -import { parseAgentSessionOperationTimestamp } from './agent-session/agent-session-host-authority' +import { canonicalAgentSessionDigest } from '../../agent-session/lifecycle/agent-session-mutation-envelope' +import { parseAgentSessionOperationTimestamp } from '../../agent-session/agent-session-host-authority' /** Digest launch behavior, excluding its operation ID and mutable host settings; changed defaults must not conflict with an honest retry. */ export type AgentLaunchFingerprintInput = { diff --git a/src/shared/agent-launch-pane-already-live.ts b/src/shared/agent-launch/contracts/agent-launch-pane-already-live.ts similarity index 100% rename from src/shared/agent-launch-pane-already-live.ts rename to src/shared/agent-launch/contracts/agent-launch-pane-already-live.ts diff --git a/src/shared/agent-launch-pane-verdict.ts b/src/shared/agent-launch/contracts/agent-launch-pane-verdict.ts similarity index 100% rename from src/shared/agent-launch-pane-verdict.ts rename to src/shared/agent-launch/contracts/agent-launch-pane-verdict.ts diff --git a/src/shared/agent-launch-replay-refusal.ts b/src/shared/agent-launch/contracts/agent-launch-replay-refusal.ts similarity index 100% rename from src/shared/agent-launch-replay-refusal.ts rename to src/shared/agent-launch/contracts/agent-launch-replay-refusal.ts diff --git a/src/shared/agent-launch-runtime-capability.ts b/src/shared/agent-launch/contracts/agent-launch-runtime-capability.ts similarity index 100% rename from src/shared/agent-launch-runtime-capability.ts rename to src/shared/agent-launch/contracts/agent-launch-runtime-capability.ts diff --git a/src/shared/agent-launch-session-already-exists.ts b/src/shared/agent-launch/contracts/agent-launch-session-already-exists.ts similarity index 100% rename from src/shared/agent-launch-session-already-exists.ts rename to src/shared/agent-launch/contracts/agent-launch-session-already-exists.ts diff --git a/src/shared/agent-launch-surface.ts b/src/shared/agent-launch/contracts/agent-launch-surface.ts similarity index 100% rename from src/shared/agent-launch-surface.ts rename to src/shared/agent-launch/contracts/agent-launch-surface.ts diff --git a/src/shared/agent-launch-tab-closed.ts b/src/shared/agent-launch/contracts/agent-launch-tab-closed.ts similarity index 100% rename from src/shared/agent-launch-tab-closed.ts rename to src/shared/agent-launch/contracts/agent-launch-tab-closed.ts diff --git a/src/shared/agent-launch-tab-publication.ts b/src/shared/agent-launch/contracts/agent-launch-tab-publication.ts similarity index 97% rename from src/shared/agent-launch-tab-publication.ts rename to src/shared/agent-launch/contracts/agent-launch-tab-publication.ts index d6212560435..3c855b2615f 100644 --- a/src/shared/agent-launch-tab-publication.ts +++ b/src/shared/agent-launch/contracts/agent-launch-tab-publication.ts @@ -1,7 +1,7 @@ /** The host publishes/resolves a launch tab under its IDs before spawning; the window places its pending pane and returns placement. */ import type { AgentLaunchPlacement, AgentLaunchPlacementReceipt } from './agent-launch-intent' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' /** * Whose screen moves, decided on the host from who called. Mirrors the browser-tab split between diff --git a/src/shared/agent-launch-target-forbidden.ts b/src/shared/agent-launch/contracts/agent-launch-target-forbidden.ts similarity index 100% rename from src/shared/agent-launch-target-forbidden.ts rename to src/shared/agent-launch/contracts/agent-launch-target-forbidden.ts diff --git a/src/shared/agent-pane-launch-request.ts b/src/shared/agent-launch/contracts/agent-pane-launch-request.ts similarity index 83% rename from src/shared/agent-pane-launch-request.ts rename to src/shared/agent-launch/contracts/agent-pane-launch-request.ts index 9b1d159ff42..d6457fcff1b 100644 --- a/src/shared/agent-pane-launch-request.ts +++ b/src/shared/agent-launch/contracts/agent-pane-launch-request.ts @@ -1,5 +1,5 @@ import type { z } from 'zod' -import type { AgentLaunch } from './rpc-contract/agent-launch-params' +import type { AgentLaunch } from '../../rpc-contract/agent-launch-params' /** `agent.launch` params a pane hands its own spawn; main names the pane, and nothing is recorded. */ export type AgentPaneLaunchRequest = { diff --git a/src/shared/agent-chat-permission-host-support.test.ts b/src/shared/agent-launch/permissions/agent-chat-permission-host-support.test.ts similarity index 100% rename from src/shared/agent-chat-permission-host-support.test.ts rename to src/shared/agent-launch/permissions/agent-chat-permission-host-support.test.ts diff --git a/src/shared/agent-chat-permission-host-support.ts b/src/shared/agent-launch/permissions/agent-chat-permission-host-support.ts similarity index 92% rename from src/shared/agent-chat-permission-host-support.ts rename to src/shared/agent-launch/permissions/agent-chat-permission-host-support.ts index 837b256b939..9552248aa86 100644 --- a/src/shared/agent-chat-permission-host-support.ts +++ b/src/shared/agent-launch/permissions/agent-chat-permission-host-support.ts @@ -1,15 +1,15 @@ import { AGENT_CHAT_PERMISSION_MODES, - agentChatPermissionModes, isAgentChatPermissionMode, type AgentChatPermissionMode } from './agent-chat-permission-mode' +import { agentChatPermissionModes } from './agent-chat-permission-support' import { resolveTuiAgentLaunchArgs, tuiAgentArgsBypassPermissions -} from './tui-agent-launch-defaults' -import type { AgentStartupShell } from './tui-agent-startup-shell' -import { isTuiAgent } from './tui-agent-config' +} from '../choices/tui-agent-launch-defaults' +import type { AgentStartupShell } from '../startup/tui-agent-startup-shell' +import { isTuiAgent } from '../catalog/tui-agent-config' /** Every shell a host could parse its arguments with: any one granting bypass counts. */ const HOST_STARTUP_SHELLS: readonly AgentStartupShell[] = ['posix', 'powershell', 'cmd'] diff --git a/src/shared/agent-chat-permission-mode.test.ts b/src/shared/agent-launch/permissions/agent-chat-permission-mode.test.ts similarity index 89% rename from src/shared/agent-chat-permission-mode.test.ts rename to src/shared/agent-launch/permissions/agent-chat-permission-mode.test.ts index 5bfa46ab13a..1d68c1d39c9 100644 --- a/src/shared/agent-chat-permission-mode.test.ts +++ b/src/shared/agent-launch/permissions/agent-chat-permission-mode.test.ts @@ -1,9 +1,6 @@ import { describe, expect, it } from 'vitest' -import { - agentChatPermissionModes, - newChatPermissionMode, - savedChatPermissionMode -} from './agent-chat-permission-mode' +import { agentChatPermissionModes } from './agent-chat-permission-support' +import { newChatPermissionMode, savedChatPermissionMode } from './agent-chat-permission-mode' const CLAUDE_CHAT_PERMISSION_MODES = agentChatPermissionModes('claude')! const CODEX_CHAT_PERMISSION_MODES = agentChatPermissionModes('codex')! diff --git a/src/shared/agent-chat-permission-mode.ts b/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts similarity index 91% rename from src/shared/agent-chat-permission-mode.ts rename to src/shared/agent-launch/permissions/agent-chat-permission-mode.ts index a686490b563..0786cfbeb68 100644 --- a/src/shared/agent-chat-permission-mode.ts +++ b/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts @@ -1,13 +1,13 @@ -import type { GlobalSettings } from './global-settings-types' -import { resolvedTuiAgentArgsBypassPermissions } from './tui-agent-launch-defaults' +import type { GlobalSettings } from '../../global-settings-types' +import { resolvedTuiAgentArgsBypassPermissions } from '../choices/tui-agent-launch-defaults' import { YOLO_TUI_AGENT_ARGS } from './tui-agent-permissions' import { hasTypedAgentPermission, resolveAgentPermission, type AgentPermissionSettings } from './tui-agent-permission-choice' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { isTuiAgent } from '../catalog/tui-agent-config' +import type { TuiAgent } from '../catalog/tui-agent' /** A chat's own permission choice. Saved in chat records and settings: never rename a value. */ export type AgentChatPermissionChoice = 'own' | AgentChatPermissionMode @@ -47,10 +47,6 @@ import { agentChatPermissionModes, type AgentChatPermissionModeSupport } from './agent-chat-permission-support' -export { - agentChatPermissionModes, - type AgentChatPermissionModeSupport -} from './agent-chat-permission-support' /** The saved choice if this agent offers it; anything else asks, never grants more access. */ export function savedChatPermissionMode( diff --git a/src/shared/agent-chat-permission-support.ts b/src/shared/agent-launch/permissions/agent-chat-permission-support.ts similarity index 100% rename from src/shared/agent-chat-permission-support.ts rename to src/shared/agent-launch/permissions/agent-chat-permission-support.ts diff --git a/src/shared/agent-permission-args.ts b/src/shared/agent-launch/permissions/agent-permission-args.ts similarity index 95% rename from src/shared/agent-permission-args.ts rename to src/shared/agent-launch/permissions/agent-permission-args.ts index a8b3b4253c3..5919b231623 100644 --- a/src/shared/agent-permission-args.ts +++ b/src/shared/agent-launch/permissions/agent-permission-args.ts @@ -1,10 +1,10 @@ -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' -import type { AgentChoiceCliForm } from './agent-launch-choices' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' +import type { AgentChoiceCliForm } from '../choices/agent-launch-choices' import type { AgentPermissionChoice } from './tui-agent-permission-choice' -import { agentRequiredValueOptions } from './agent-session/options/agent-session-option-agent-args' +import { agentRequiredValueOptions } from '../../agent-session/options/agent-session-option-agent-args' import { agentPermissionArgs, agentPermissionChoices } from './tui-agent-permission-choice' -import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import { tokenizeStartupCommand, type AgentStartupShell } from '../startup/tui-agent-startup-shell' +import type { TuiAgent } from '../catalog/tui-agent' export const CODEX_PERMISSION_CONFIG_ROOTS = [ 'approval_policy', diff --git a/src/shared/agent-permission-env.ts b/src/shared/agent-launch/permissions/agent-permission-env.ts similarity index 100% rename from src/shared/agent-permission-env.ts rename to src/shared/agent-launch/permissions/agent-permission-env.ts diff --git a/src/shared/agent-scoped-permission-defaults.test.ts b/src/shared/agent-launch/permissions/agent-scoped-permission-defaults.test.ts similarity index 81% rename from src/shared/agent-scoped-permission-defaults.test.ts rename to src/shared/agent-launch/permissions/agent-scoped-permission-defaults.test.ts index 2bcaacfc76c..4ecb1cadcda 100644 --- a/src/shared/agent-scoped-permission-defaults.test.ts +++ b/src/shared/agent-launch/permissions/agent-scoped-permission-defaults.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { agentLaunchSettingsMutationUpdates } from './agent-launch-settings' -import { structuredLaunchSeedOptions } from './native-chat/input/native-chat-session-option-defaults' -import { resolveTuiAgentLaunchArgs } from './tui-agent-launch-defaults' -import { AgentLaunchSettingsMutation } from './rpc-contract/agent-launch-settings-params' +import { agentLaunchSettingsMutationUpdates } from '../choices/agent-launch-settings' +import { structuredLaunchSeedOptions } from '../../native-chat/input/native-chat-session-option-defaults' +import { resolveTuiAgentLaunchArgs } from '../choices/tui-agent-launch-defaults' +import { AgentLaunchSettingsMutation } from '../../rpc-contract/agent-launch-settings-params' const settings = { agentPermissionDefault: 'full-access' as const, diff --git a/src/shared/tui-agent-auto-permissions.test.ts b/src/shared/agent-launch/permissions/tui-agent-auto-permissions.test.ts similarity index 89% rename from src/shared/tui-agent-auto-permissions.test.ts rename to src/shared/agent-launch/permissions/tui-agent-auto-permissions.test.ts index 0bd3c11fb43..93d5736e110 100644 --- a/src/shared/tui-agent-auto-permissions.test.ts +++ b/src/shared/agent-launch/permissions/tui-agent-auto-permissions.test.ts @@ -1,12 +1,13 @@ import { describe, expect, it } from 'vitest' -import { agentLaunchSettingsMutationUpdates } from './agent-launch-settings' -import { AgentLaunchSettingsMutation } from './rpc-contract/agent-launch-settings-params' -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from './tui-agent-startup' +import { agentLaunchSettingsMutationUpdates } from '../choices/agent-launch-settings' +import { AgentLaunchSettingsMutation } from '../../rpc-contract/agent-launch-settings-params' +import { buildAgentStartupPlan } from '../startup/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../startup/tui-agent-resume-startup' import { resolveTuiAgentLaunchArgs, tuiAgentArgsBypassPermissions -} from './tui-agent-launch-defaults' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' +} from '../choices/tui-agent-launch-defaults' +import { tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' describe('automatic terminal permissions', () => { it.each(['posix', 'powershell', 'cmd'] as const)( diff --git a/src/shared/tui-agent-permission-choice.test.ts b/src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts similarity index 96% rename from src/shared/tui-agent-permission-choice.test.ts rename to src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts index 73c6e7e0d90..7b2e599e16c 100644 --- a/src/shared/tui-agent-permission-choice.test.ts +++ b/src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts @@ -1,39 +1,37 @@ -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from './tui-agent-startup' -import * as startupShell from './tui-agent-startup-shell' -import * as launchCompiler from './agent-session/options/agent-session-option-launch' -import * as reconciliation from './agent-choice-reconciliation' -import { projectAgentLaunchProfile } from './agent-launch-profile' -import { getDefaultSettings } from './constants' -import { legacyChatPermissionWrite } from '../main/persistence/applying-settings/legacy-chat-permission-write' -import { measureSettingsWork, expectSettingsWorkScale } from './global-settings-test-fixture' +import { buildAgentStartupPlan } from '../startup/tui-agent-startup' +import { buildAgentResumeStartupPlan } from '../startup/tui-agent-resume-startup' +import * as startupShell from '../startup/tui-agent-startup-shell' +import * as launchCompiler from '../../agent-session/options/agent-session-option-launch' +import * as reconciliation from '../choices/agent-choice-reconciliation' +import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' +import { getDefaultSettings } from '../../constants' +import { legacyChatPermissionWrite } from '../../../main/persistence/applying-settings/legacy-chat-permission-write' +import { measureSettingsWork, expectSettingsWorkScale } from '../../global-settings-test-fixture' import { wholeAgentEnvironmentUpdates, legacyLaunchTextUpdates -} from './agent-launch-permission-updates' +} from '../choices/agent-launch-permission-updates' import { describe, expect, it, vi } from 'vitest' import { agentLaunchSettingsMutationUpdates, projectAgentLaunchSettings, type AgentLaunchSettingsSource -} from './agent-launch-settings' +} from '../choices/agent-launch-settings' import { newChatPermissionModeForSettings } from './agent-chat-permission-mode' import { DEFAULT_TUI_AGENT_ARGS, DEFAULT_TUI_AGENT_ENV, resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv -} from './tui-agent-launch-defaults' +} from '../choices/tui-agent-launch-defaults' import { agentPermissionArgs, applyAllAgentsPermission, resolveAgentPermission } from './tui-agent-permission-choice' -import { - agentArgsSetPermission, - liftAgentPermissionArgs, - migrateAgentPermissionChoice -} from './tui-agent-permission-lift' +import { agentArgsSetPermission } from './agent-permission-args' +import { liftAgentPermissionArgs, migrateAgentPermissionChoice } from './tui-agent-permission-lift' const legacy = ( args: Record, diff --git a/src/shared/tui-agent-permission-choice.ts b/src/shared/agent-launch/permissions/tui-agent-permission-choice.ts similarity index 98% rename from src/shared/tui-agent-permission-choice.ts rename to src/shared/agent-launch/permissions/tui-agent-permission-choice.ts index 7c97e7ab5aa..7eccdfa6a94 100644 --- a/src/shared/tui-agent-permission-choice.ts +++ b/src/shared/agent-launch/permissions/tui-agent-permission-choice.ts @@ -1,12 +1,12 @@ import { agentChatPermissionModes } from './agent-chat-permission-support' import type { AgentChatPermissionMode } from './agent-chat-permission-mode' -import { isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +import { isTuiAgent, TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' import { AUTO_TUI_AGENT_ARGS, YOLO_TUI_AGENT_ARGS, YOLO_TUI_AGENT_ENV } from './tui-agent-permissions' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' /** Persisted values must remain stable; own adds no permission flag and uses the agent’s config, while other choices share chat modes. */ export type AgentPermissionChoice = 'own' | AgentChatPermissionMode diff --git a/src/shared/tui-agent-permission-lift.ts b/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts similarity index 95% rename from src/shared/tui-agent-permission-lift.ts rename to src/shared/agent-launch/permissions/tui-agent-permission-lift.ts index d48b0457598..323c863d75e 100644 --- a/src/shared/tui-agent-permission-lift.ts +++ b/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts @@ -2,9 +2,9 @@ import { AGENT_LAUNCH_CHOICE_KEYS, normalizeAgentLaunchChoices, normalizeAgentModelOptionChoices -} from './agent-launch-choices' +} from '../choices/agent-launch-choices' import { agentPermissionHostPlatform, permissionEnvNameMatches } from './agent-permission-env' -import type { GlobalSettings } from './global-settings-types' +import type { GlobalSettings } from '../../global-settings-types' import { agentPermissionEnv, hasTypedAgentPermission, @@ -13,10 +13,10 @@ import { resolveAgentPermission, type AgentPermissionChoice } from './tui-agent-permission-choice' -import { reconcileAgentChoiceArgs } from './agent-choice-reconciliation' -import { planAgentCliArgsSuffix, type AgentStartupShell } from './tui-agent-startup-shell' -export { agentArgsSetPermission } from './agent-permission-args' -import type { TuiAgent } from './tui-agent' +import { reconcileAgentChoiceArgs } from '../choices/agent-choice-reconciliation' +import { planAgentCliArgsSuffix, type AgentStartupShell } from '../startup/tui-agent-startup-shell' + +import type { TuiAgent } from '../catalog/tui-agent' /** Only exact recipes with preserved shell words and CLI ownership become stored intent. */ export function liftAgentPermissionArgs( diff --git a/src/shared/tui-agent-permissions.test.ts b/src/shared/agent-launch/permissions/tui-agent-permissions.test.ts similarity index 100% rename from src/shared/tui-agent-permissions.test.ts rename to src/shared/agent-launch/permissions/tui-agent-permissions.test.ts diff --git a/src/shared/tui-agent-permissions.ts b/src/shared/agent-launch/permissions/tui-agent-permissions.ts similarity index 98% rename from src/shared/tui-agent-permissions.ts rename to src/shared/agent-launch/permissions/tui-agent-permissions.ts index ceb356c168c..23b0d4ec8a5 100644 --- a/src/shared/tui-agent-permissions.ts +++ b/src/shared/agent-launch/permissions/tui-agent-permissions.ts @@ -1,5 +1,5 @@ -import { TUI_AGENT_CONFIG } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' +import type { TuiAgent } from '../catalog/tui-agent' export type AgentPermissionMode = 'yolo' | 'manual' | 'auto' | 'mixed' diff --git a/src/shared/agent-launch-picker-arguments.ts b/src/shared/agent-launch/picker/agent-launch-picker-arguments.ts similarity index 90% rename from src/shared/agent-launch-picker-arguments.ts rename to src/shared/agent-launch/picker/agent-launch-picker-arguments.ts index 9672c7c8128..615b0efe6c9 100644 --- a/src/shared/agent-launch-picker-arguments.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-arguments.ts @@ -1,13 +1,13 @@ -import type { TuiAgent } from './tui-agent' -import type { analyzeAgentChoiceArgs } from './agent-choice-args' -import { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' +import type { TuiAgent } from '../catalog/tui-agent' +import type { analyzeAgentChoiceArgs } from '../choices/agent-choice-args' +import { reconcileAgentChoiceArgsDetailed } from '../choices/agent-choice-reconciliation' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' import { agentPickerArgumentPermission, agentPickerPermissionValue } from './agent-launch-picker-permission' +import { agentPickerArgumentsText } from './agent-launch-picker-authority' import { - agentPickerArgumentsText, agentPickerEffectiveChoices, type AgentPickerDraft, type AgentPickerEntry diff --git a/src/shared/agent-launch-picker-authority.ts b/src/shared/agent-launch/picker/agent-launch-picker-authority.ts similarity index 100% rename from src/shared/agent-launch-picker-authority.ts rename to src/shared/agent-launch/picker/agent-launch-picker-authority.ts diff --git a/src/shared/agent-launch-picker-catalog.ts b/src/shared/agent-launch/picker/agent-launch-picker-catalog.ts similarity index 85% rename from src/shared/agent-launch-picker-catalog.ts rename to src/shared/agent-launch/picker/agent-launch-picker-catalog.ts index 910b51acc1d..6702fe2276a 100644 --- a/src/shared/agent-launch-picker-catalog.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-catalog.ts @@ -1,13 +1,13 @@ -import { discoveredModel } from './agent-session/options/structured-agent-session-discovered-model' -import { createClaudeCatalogOptions } from './agent-session/options/agent-session-option-catalog-claude-codex' -import type { CatalogOption } from './agent-session/options/agent-session-option-catalog-types' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' -import { sourceControlActionOptions } from './source-control-action-launch-preferences' +import { discoveredModel } from '../../agent-session/options/structured-agent-session-discovered-model' +import { createClaudeCatalogOptions } from '../../agent-session/options/agent-session-option-catalog-claude-codex' +import type { CatalogOption } from '../../agent-session/options/agent-session-option-catalog-types' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' +import { sourceControlActionOptions } from '../../source-control-action-options' import { agentPermissionChoices, agentPermissionHasTerminalChoice -} from './tui-agent-permission-choice' -import type { TuiAgent } from './tui-agent' +} from '../permissions/tui-agent-permission-choice' +import type { TuiAgent } from '../catalog/tui-agent' import type { AgentPickerEntry, AgentPickerModel, AgentPickerSurface } from './agent-launch-picker' export function agentPickerOptions( diff --git a/src/shared/agent-launch-picker-defaults.ts b/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts similarity index 80% rename from src/shared/agent-launch-picker-defaults.ts rename to src/shared/agent-launch/picker/agent-launch-picker-defaults.ts index 1c14843dde0..5cda7b84854 100644 --- a/src/shared/agent-launch-picker-defaults.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts @@ -1,9 +1,9 @@ -import { isAgentPermissionChoice } from './tui-agent-permission-choice' -import { projectAgentLaunchProfile } from './agent-launch-profile' -import { structuredLaunchSeedOptions } from './native-chat/input/native-chat-session-option-defaults' -import { isAgentChatPermissionChoice } from './agent-chat-permission-mode' -import type { GlobalSettings } from './global-settings-types' -import type { TuiAgent } from './tui-agent' +import { isAgentPermissionChoice } from '../permissions/tui-agent-permission-choice' +import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' +import { structuredLaunchSeedOptions } from '../../native-chat/input/native-chat-session-option-defaults' +import { isAgentChatPermissionChoice } from '../permissions/agent-chat-permission-mode' +import type { GlobalSettings } from '../../global-settings-types' +import type { TuiAgent } from '../catalog/tui-agent' import type { AgentPickerEntry } from './agent-launch-picker' export type AgentPickerDefaultSettings = Partial< diff --git a/src/shared/agent-launch-picker-edits.ts b/src/shared/agent-launch/picker/agent-launch-picker-edits.ts similarity index 93% rename from src/shared/agent-launch-picker-edits.ts rename to src/shared/agent-launch/picker/agent-launch-picker-edits.ts index 381c8e47688..b115d26991f 100644 --- a/src/shared/agent-launch-picker-edits.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-edits.ts @@ -1,16 +1,16 @@ -import { analyzeAgentChoiceArgs } from './agent-choice-args' -import { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import { projectAgentLaunchProfile } from './agent-launch-profile' +import { analyzeAgentChoiceArgs } from '../choices/agent-choice-args' +import { reconcileAgentChoiceArgsDetailed } from '../choices/agent-choice-reconciliation' +import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' import { agentPickerPanelArguments } from './agent-launch-picker-arguments' -import { TEXT_ACTION_DEFAULT_MODEL } from './source-control-text-action-picker' +import { TEXT_ACTION_DEFAULT_MODEL } from './agent-launch-picker-text-action' +import { agentPickerArgumentsText } from './agent-launch-picker-authority' import { - agentPickerArgumentsText, agentPickerEffectiveChoices, type AgentPickerDraft, type AgentPickerEntry } from './agent-launch-picker' -import type { AgentChoicePatch } from './agent-launch-choices' -import type { AgentPermissionChoice } from './tui-agent-permission-choice' +import type { AgentChoicePatch } from '../choices/agent-launch-choices' +import type { AgentPermissionChoice } from '../permissions/tui-agent-permission-choice' import { patchKeys, publishAccepted } from './agent-launch-picker-receipt' import { agentPickerArgumentPermission, @@ -20,7 +20,7 @@ import { editAgentPickerSpeed, removeAgentPickerSpeed } from './agent-launch-pic import { findCatalogModel, getAgentSessionOptionLaunchCatalog -} from './agent-session/options/agent-session-option-catalog' +} from '../../agent-session/options/agent-session-option-catalog' export type AgentPickerEdit = | { kind: 'choice'; patch: AgentChoicePatch } diff --git a/src/shared/agent-launch-picker-legacy-permission.test.ts b/src/shared/agent-launch/picker/agent-launch-picker-legacy-permission.test.ts similarity index 91% rename from src/shared/agent-launch-picker-legacy-permission.test.ts rename to src/shared/agent-launch/picker/agent-launch-picker-legacy-permission.test.ts index 347b30b979e..e72fc44fe89 100644 --- a/src/shared/agent-launch-picker-legacy-permission.test.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-legacy-permission.test.ts @@ -1,16 +1,16 @@ import { expect, it } from 'vitest' import { agentPickerDraft, - agentPickerChoiceSeeds, editAgentPickerArguments, editAgentPickerDraft, type AgentPickerEntry } from './agent-launch-picker' +import { agentPickerChoiceSeeds } from './agent-launch-picker-defaults' import { agentPickerArgumentPermission } from './agent-launch-picker-permission' -import { projectAgentLaunchProfile } from './agent-launch-profile' -import '../main/native-chat/structured-agent-configured-args' -import '../main/claude/structured/launch/claude-structured-launch-args' -import '../main/codex/codex-structured-launch-args' +import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' +import '../../../main/native-chat/structured-agent-configured-args' +import '../../../main/claude/structured/launch/claude-structured-launch-args' +import '../../../main/codex/codex-structured-launch-args' const settings = Object.freeze({ agentPermissionDefault: 'ask' as const, diff --git a/src/shared/agent-launch-picker-permission.ts b/src/shared/agent-launch/picker/agent-launch-picker-permission.ts similarity index 89% rename from src/shared/agent-launch-picker-permission.ts rename to src/shared/agent-launch/picker/agent-launch-picker-permission.ts index dcabb68c8bd..fe58d8c59af 100644 --- a/src/shared/agent-launch-picker-permission.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-permission.ts @@ -1,16 +1,16 @@ -import { analyzeAgentChoiceArgs } from './agent-choice-args' -import { agentArgsSetPermission, analyzeAgentChoiceWords } from './agent-permission-args' +import { analyzeAgentChoiceArgs } from '../choices/agent-choice-args' +import { + agentArgsSetPermission, + analyzeAgentChoiceWords +} from '../permissions/agent-permission-args' import { agentPermissionArgs, agentPermissionChoices, type AgentPermissionChoice -} from './tui-agent-permission-choice' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' -import { - agentPickerArgumentsText, - type AgentPickerDraft, - type AgentPickerEntry -} from './agent-launch-picker' +} from '../permissions/tui-agent-permission-choice' +import { tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' +import { agentPickerArgumentsText } from './agent-launch-picker-authority' +import type { AgentPickerDraft, AgentPickerEntry } from './agent-launch-picker' /** Keep opaque Arguments literal; only separate spans the common analyzer can cut safely. */ export function agentPickerArgumentPermission(entry: AgentPickerEntry, draft: AgentPickerDraft) { diff --git a/src/shared/agent-launch-picker-receipt.ts b/src/shared/agent-launch/picker/agent-launch-picker-receipt.ts similarity index 93% rename from src/shared/agent-launch-picker-receipt.ts rename to src/shared/agent-launch/picker/agent-launch-picker-receipt.ts index bde62cada28..dbcd9117f80 100644 --- a/src/shared/agent-launch-picker-receipt.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-receipt.ts @@ -1,22 +1,22 @@ -import type { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' +import type { reconcileAgentChoiceArgsDetailed } from '../choices/agent-choice-reconciliation' import type { AgentPickerDraft, AgentPickerEntry } from './agent-launch-picker' -import type { AgentChoicePatch } from './agent-launch-choices' +import type { AgentChoicePatch } from '../choices/agent-launch-choices' import { editSourceControlActionArguments, selectSourceControlActionRecipe, type CurrentActionSelection -} from './source-control-action-selection' +} from '../../source-control-action-selection' import { selectedSourceControlActionPreferences, sourceControlActionExecutionArgs, demoteDisplacedActionArgumentChoices -} from './source-control-action-launch-preferences' +} from '../../source-control-action-launch-preferences' import { editActionArgumentChoices, - editActionArgumentChoicePreferences, - trimActionArgumentDocument, reconcileActionArgumentDocumentTransaction -} from './source-control-action-argument-choices' +} from '../../source-control-action-argument-choices' +import { editActionArgumentChoicePreferences } from '../../source-control-action-choice-preferences' +import { trimActionArgumentDocument } from '../../source-control-action-argument-document' type AcceptedChoices = ReturnType diff --git a/src/shared/agent-launch-picker-rows.ts b/src/shared/agent-launch/picker/agent-launch-picker-rows.ts similarity index 92% rename from src/shared/agent-launch-picker-rows.ts rename to src/shared/agent-launch/picker/agent-launch-picker-rows.ts index 0aaf9aaf2cd..7005a021871 100644 --- a/src/shared/agent-launch-picker-rows.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-rows.ts @@ -1,12 +1,12 @@ -import type { GlobalSettings } from './global-settings-types' +import type { GlobalSettings } from '../../global-settings-types' import { nativeChatPreferenceFor, type NativeChatDefaultSettings -} from './structured-native-chat-launch-route' -import type { ExecutionHostId } from './execution-host' -import type { TuiAgent } from './tui-agent' -import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from './tui-agent-selection' -import type { AgentSessionChatProgram } from './agent-session/agent-session-agent-availability' +} from '../../structured-native-chat-launch-route' +import type { ExecutionHostId } from '../../execution-host' +import type { TuiAgent } from '../catalog/tui-agent' +import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from '../catalog/tui-agent-selection' +import type { AgentSessionChatProgram } from '../../agent-session/agent-session-agent-availability' export type HostChatAnswer = | 'yes' diff --git a/src/shared/agent-launch-picker-search.ts b/src/shared/agent-launch/picker/agent-launch-picker-search.ts similarity index 94% rename from src/shared/agent-launch-picker-search.ts rename to src/shared/agent-launch/picker/agent-launch-picker-search.ts index 8628f1fd2ab..2b6b22dc4d3 100644 --- a/src/shared/agent-launch-picker-search.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-search.ts @@ -1,7 +1,7 @@ import { agentPickerModels } from './agent-launch-picker-catalog' -import { resolveAgentChoiceLayers } from './agent-choice-layers' +import { resolveAgentChoiceLayers } from '../choices/agent-choice-layers' import type { AgentPickerEntry, AgentPickerModel } from './agent-launch-picker' -import type { AgentDedicatedChoices } from './agent-launch-choices' +import type { AgentDedicatedChoices } from '../choices/agent-launch-choices' export type AgentPickerSetup = { entry: AgentPickerEntry diff --git a/src/shared/agent-launch-picker-speed.ts b/src/shared/agent-launch/picker/agent-launch-picker-speed.ts similarity index 91% rename from src/shared/agent-launch-picker-speed.ts rename to src/shared/agent-launch/picker/agent-launch-picker-speed.ts index 213b4500bce..412bdde4f3f 100644 --- a/src/shared/agent-launch-picker-speed.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-speed.ts @@ -1,15 +1,12 @@ -import { analyzeAgentChoiceArgs } from './agent-choice-args' -import { reconcileAgentChoiceArgs } from './agent-choice-reconciliation' -import { projectAgentLaunchProfile } from './agent-launch-profile' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' -import { agentPermissionArgs } from './tui-agent-permission-choice' +import { analyzeAgentChoiceArgs } from '../choices/agent-choice-args' +import { reconcileAgentChoiceArgs } from '../choices/agent-choice-reconciliation' +import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' +import { agentPermissionArgs } from '../permissions/tui-agent-permission-choice' import { agentPickerEntryOptions } from './agent-launch-picker-catalog' import { agentPickerArgumentPermission } from './agent-launch-picker-permission' -import { - agentPickerArgumentsText, - type AgentPickerEntry, - type AgentPickerDraft -} from './agent-launch-picker' +import { agentPickerArgumentsText } from './agent-launch-picker-authority' +import type { AgentPickerEntry, AgentPickerDraft } from './agent-launch-picker' const textOf = agentPickerArgumentsText export function cutAgentPickerComposedSpeed( entry: AgentPickerEntry, diff --git a/src/shared/source-control-text-action-picker.ts b/src/shared/agent-launch/picker/agent-launch-picker-text-action.ts similarity index 95% rename from src/shared/source-control-text-action-picker.ts rename to src/shared/agent-launch/picker/agent-launch-picker-text-action.ts index 26aa378969c..a4bf25bf5ca 100644 --- a/src/shared/source-control-text-action-picker.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-text-action.ts @@ -1,5 +1,5 @@ import type { AgentPickerEntry, AgentPickerDraft } from './agent-launch-picker' -import type { AgentDedicatedChoices } from './agent-launch-choices' +import type { AgentDedicatedChoices } from '../choices/agent-launch-choices' export const TEXT_ACTION_DEFAULT_MODEL = '__text_action_default__' export type TextActionPickerCatalog = { diff --git a/src/shared/agent-launch-picker.test.ts b/src/shared/agent-launch/picker/agent-launch-picker.test.ts similarity index 99% rename from src/shared/agent-launch-picker.test.ts rename to src/shared/agent-launch/picker/agent-launch-picker.test.ts index bef30d97dcc..33944fef3b1 100644 --- a/src/shared/agent-launch-picker.test.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker.test.ts @@ -5,13 +5,13 @@ import { describe, expect, it } from 'vitest' import { agentPickerLaunchInputs, agentPickerEntriesFromRows, - agentPickerChoiceSeeds, agentPickerDraft, agentPickerEffectiveChoices, editAgentPickerDraft, editAgentPickerArguments, type AgentPickerEntry } from './agent-launch-picker' +import { agentPickerChoiceSeeds } from './agent-launch-picker-defaults' const entry: AgentPickerEntry = { agent: 'codex', diff --git a/src/shared/agent-launch-picker.ts b/src/shared/agent-launch/picker/agent-launch-picker.ts similarity index 91% rename from src/shared/agent-launch-picker.ts rename to src/shared/agent-launch/picker/agent-launch-picker.ts index a8c6e4f86ff..bdf3141d786 100644 --- a/src/shared/agent-launch-picker.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker.ts @@ -1,38 +1,26 @@ import { textActionPickerEffectiveChoices, type TextActionPickerCatalog -} from './source-control-text-action-picker' +} from './agent-launch-picker-text-action' import { agentPickerPanelArguments } from './agent-launch-picker-arguments' import { agentPickerArgumentsKnown } from './agent-launch-picker-authority' -export { - agentPickerArgumentsKnown, - agentPickerArgumentsText -} from './agent-launch-picker-authority' -export { - agentPickerChoiceSeeds, - type AgentPickerDefaultSettings -} from './agent-launch-picker-defaults' + import { agentPickerOptions } from './agent-launch-picker-catalog' -export { - agentPickerOptions, - agentPickerModels, - agentPickerEntryOptions, - agentPickerPermissions -} from './agent-launch-picker-catalog' -import { projectAgentLaunchInputViews } from './agent-launch-profile' -import type { AgentChoicePatch, AgentDedicatedChoices } from './agent-launch-choices' + +import { projectAgentLaunchInputViews } from '../choices/agent-launch-profile' +import type { AgentChoicePatch, AgentDedicatedChoices } from '../choices/agent-launch-choices' import { reconcileAgentChoiceArgs, reconcileAgentChoiceArgsDetailed -} from './agent-choice-reconciliation' -import { resolveAgentChoiceLayers } from './agent-choice-layers' +} from '../choices/agent-choice-reconciliation' +import { resolveAgentChoiceLayers } from '../choices/agent-choice-layers' import type { AgentSessionModelCatalogResult, AgentSessionModelOption -} from './agent-session/agent-session-wire' +} from '../../agent-session/agent-session-wire' import { orderAgentLaunchPickerAgents, type NewTabAgentMenuRow } from './agent-launch-picker-rows' -import type { TuiAgent } from './tui-agent' -import type { CurrentActionSelection } from './source-control-action-selection' +import type { TuiAgent } from '../catalog/tui-agent' +import type { CurrentActionSelection } from '../../source-control-action-selection' export type AgentPickerSurface = 'chat' | 'terminal' export type AgentPickerDraftOwner = object @@ -263,7 +251,7 @@ export function agentPickerButtonOrder(entry: AgentPickerEntry): AgentPickerSurf ] } -export { searchAgentPickerSetups, type AgentPickerSetup } from './agent-launch-picker-search' +export { type AgentPickerSetup } from './agent-launch-picker-search' export function agentPickerSessionOptions(choices: AgentDedicatedChoices): Record { return { diff --git a/src/shared/agent-command-line-intent.test.ts b/src/shared/agent-launch/startup/agent-command-line-intent.test.ts similarity index 92% rename from src/shared/agent-command-line-intent.test.ts rename to src/shared/agent-launch/startup/agent-command-line-intent.test.ts index 3fc4ce41add..4fcb10a707e 100644 --- a/src/shared/agent-command-line-intent.test.ts +++ b/src/shared/agent-launch/startup/agent-command-line-intent.test.ts @@ -1,7 +1,7 @@ import { expect, it } from 'vitest' import { extractAgentLaunchCommand, recognizeAgentLaunchCommand } from './agent-command-line-intent' -import { recognizeAgentProcessFromCommandLine } from './agent-process-recognition' -import { COMMAND_TOKEN_SCAN_MAX_CHARS } from './command-token-scanner' +import { recognizeAgentProcessFromCommandLine } from '../../agent-process-recognition' +import { COMMAND_TOKEN_SCAN_MAX_CHARS } from '../../command-token-scanner' it.each([ ['sleep 30 && claude', 'claude'], diff --git a/src/shared/agent-command-line-intent.ts b/src/shared/agent-launch/startup/agent-command-line-intent.ts similarity index 95% rename from src/shared/agent-command-line-intent.ts rename to src/shared/agent-launch/startup/agent-command-line-intent.ts index 6aac4cbd9cd..6294495cb63 100644 --- a/src/shared/agent-command-line-intent.ts +++ b/src/shared/agent-launch/startup/agent-command-line-intent.ts @@ -2,11 +2,11 @@ import { COMMAND_TOKEN_SCAN_MAX_CHARS, getCommandTokenPathBasename, getFirstCommandToken -} from './command-token-scanner' +} from '../../command-token-scanner' import { recognizeAgentProcessFromCommandLine, type RecognizedAgentProcess -} from './agent-process-recognition' +} from '../../agent-process-recognition' const SLEEP_PREFIX = /^[ \t]*(?:sleep|\/bin\/sleep|\/usr\/bin\/sleep)[ \t]+(?:\d+(?:\.\d+)?|\.\d+)[smhd]?[ \t]*&&[ \t]*/ diff --git a/src/shared/agent-command-plan.ts b/src/shared/agent-launch/startup/agent-command-plan.ts similarity index 92% rename from src/shared/agent-command-plan.ts rename to src/shared/agent-launch/startup/agent-command-plan.ts index fd745d005a7..4c398e0fc13 100644 --- a/src/shared/agent-command-plan.ts +++ b/src/shared/agent-launch/startup/agent-command-plan.ts @@ -1,8 +1,8 @@ -import { extractLeadingEnvAssignments } from './command-environment' +import { extractLeadingEnvAssignments } from '../../command-environment' import { tokenizeCustomCommandTemplate, type CommandTemplateBackslash -} from './commit-message-prompt' +} from '../../commit-message-prompt' export function parseAgentCommand( defaultBinary: string, diff --git a/src/shared/agent-draft-platform-limit.ts b/src/shared/agent-launch/startup/agent-draft-platform-limit.ts similarity index 100% rename from src/shared/agent-draft-platform-limit.ts rename to src/shared/agent-launch/startup/agent-draft-platform-limit.ts diff --git a/src/shared/agent-launch-account-env.ts b/src/shared/agent-launch/startup/agent-launch-account-env.ts similarity index 98% rename from src/shared/agent-launch-account-env.ts rename to src/shared/agent-launch/startup/agent-launch-account-env.ts index 7f8344649f6..69b00513408 100644 --- a/src/shared/agent-launch-account-env.ts +++ b/src/shared/agent-launch/startup/agent-launch-account-env.ts @@ -4,7 +4,7 @@ import { z } from 'zod' import { CLAUDE_INJECTED_CONFIG_DIR_ENV, CLAUDE_PROFILE_POINTER_ENV -} from './claude-profile-routing' +} from '../../claude-profile-routing' export const AGENT_LAUNCH_ACCOUNT_ENV_KEYS = [ 'CLAUDE_CONFIG_DIR', diff --git a/src/shared/agent-launch-remote.ts b/src/shared/agent-launch/startup/agent-launch-remote.ts similarity index 84% rename from src/shared/agent-launch-remote.ts rename to src/shared/agent-launch/startup/agent-launch-remote.ts index 15ad8aff7dd..ee65d68aa40 100644 --- a/src/shared/agent-launch-remote.ts +++ b/src/shared/agent-launch/startup/agent-launch-remote.ts @@ -1,10 +1,10 @@ -import type { Repo } from './repo-types' +import type { Repo } from '../../repo-types' import { getRepoExecutionHostId, parseExecutionHostId, type ParsedExecutionHost -} from './execution-host' -import { isWslUncPath } from './wsl-paths' +} from '../../execution-host' +import { isWslUncPath } from '../../wsl-paths' /** SSH relays and Orca servers put plain `orca` on PATH; the Linux `orca-ide` rename is for local desktops and WSL. */ export function launchHostIsRemote( diff --git a/src/shared/agent-launch-runtime.ts b/src/shared/agent-launch/startup/agent-launch-runtime.ts similarity index 81% rename from src/shared/agent-launch-runtime.ts rename to src/shared/agent-launch/startup/agent-launch-runtime.ts index 82d020e05a9..5ace97abe9b 100644 --- a/src/shared/agent-launch-runtime.ts +++ b/src/shared/agent-launch/startup/agent-launch-runtime.ts @@ -1,9 +1,9 @@ -import type { ProjectExecutionRuntimeResolution } from './project-execution-runtime' -import { isWindowsAbsolutePathLike } from './cross-platform-path' -import type { LocalWindowsTerminalRuntimeOptions } from './local-windows-terminal-runtime' +import type { ProjectExecutionRuntimeResolution } from '../../project-execution-runtime' +import { isWindowsAbsolutePathLike } from '../../cross-platform-path' +import type { LocalWindowsTerminalRuntimeOptions } from '../../local-windows-terminal-runtime' import { resolveStartupShell, type AgentStartupShell } from './tui-agent-startup-shell' -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' -import { isWslUncPath } from './wsl-paths' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' +import { isWslUncPath } from '../../wsl-paths' /** Resolve command platform and actual PTY shell once on the execution host; in-memory only. */ export type AgentLaunchRuntime = { diff --git a/src/shared/agent-overlay-env.ts b/src/shared/agent-launch/startup/agent-overlay-env.ts similarity index 100% rename from src/shared/agent-overlay-env.ts rename to src/shared/agent-launch/startup/agent-overlay-env.ts diff --git a/src/shared/agent-prompt-injection.test.ts b/src/shared/agent-launch/startup/agent-prompt-injection.test.ts similarity index 100% rename from src/shared/agent-prompt-injection.test.ts rename to src/shared/agent-launch/startup/agent-prompt-injection.test.ts diff --git a/src/shared/agent-prompt-injection.ts b/src/shared/agent-launch/startup/agent-prompt-injection.ts similarity index 97% rename from src/shared/agent-prompt-injection.ts rename to src/shared/agent-launch/startup/agent-prompt-injection.ts index f029407fabc..221485cde26 100644 --- a/src/shared/agent-prompt-injection.ts +++ b/src/shared/agent-launch/startup/agent-prompt-injection.ts @@ -1,8 +1,8 @@ import { countAgentTuiInputLines } from './agent-tui-input-clear' -import { AGENT_PROMPT_EFFECT_TIMEOUT_MS } from './orchestration-timing-budgets' -import { iterateTerminalInputChunks, TERMINAL_INPUT_CHUNK_MAX_BYTES } from './terminal-input' -import type { TerminalAgent } from './terminal-agent' -import { isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +import { AGENT_PROMPT_EFFECT_TIMEOUT_MS } from '../../orchestration-timing-budgets' +import { iterateTerminalInputChunks, TERMINAL_INPUT_CHUNK_MAX_BYTES } from '../../terminal-input' +import type { TerminalAgent } from '../../terminal-agent' +import { isTuiAgent, TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' export const AGENT_PROMPT_BRACKETED_PASTE_START = '\x1b[200~' export const AGENT_PROMPT_BRACKETED_PASTE_END = '\x1b[201~' diff --git a/src/shared/agent-resume-argv-drop.spec.ts b/src/shared/agent-launch/startup/agent-resume-argv-drop.spec.ts similarity index 98% rename from src/shared/agent-resume-argv-drop.spec.ts rename to src/shared/agent-launch/startup/agent-resume-argv-drop.spec.ts index b8357e6c6b1..51b71169b29 100644 --- a/src/shared/agent-resume-argv-drop.spec.ts +++ b/src/shared/agent-launch/startup/agent-resume-argv-drop.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { dropAgentResumeArgvFromCommand } from './agent-resume-argv-drop' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' const CODEX_SESSION = { key: 'session_id' as const, diff --git a/src/shared/agent-resume-argv-drop.ts b/src/shared/agent-launch/startup/agent-resume-argv-drop.ts similarity index 97% rename from src/shared/agent-resume-argv-drop.ts rename to src/shared/agent-launch/startup/agent-resume-argv-drop.ts index 59c9feb8c28..e2f462db193 100644 --- a/src/shared/agent-resume-argv-drop.ts +++ b/src/shared/agent-launch/startup/agent-resume-argv-drop.ts @@ -2,7 +2,7 @@ import { getAgentResumeArgv } from './agent-resume-argv' import type { AgentProviderSessionMetadata, ResumableTuiAgent -} from './agent-session/lifecycle/agent-session-resume' +} from '../../agent-session/lifecycle/agent-session-resume' import { quoteStartupArg, type AgentStartupShell } from './tui-agent-startup-shell' /** Unrecognized locators require refusal: the caller cannot safely launch a resume it could not cancel. Dropped returns the plain launch command. */ diff --git a/src/shared/agent-resume-argv.ts b/src/shared/agent-launch/startup/agent-resume-argv.ts similarity index 98% rename from src/shared/agent-resume-argv.ts rename to src/shared/agent-launch/startup/agent-resume-argv.ts index 86325e7a02f..e788807129f 100644 --- a/src/shared/agent-resume-argv.ts +++ b/src/shared/agent-launch/startup/agent-resume-argv.ts @@ -1,7 +1,7 @@ import type { AgentProviderSessionMetadata, ResumableTuiAgent -} from './agent-session/lifecycle/agent-session-resume' +} from '../../agent-session/lifecycle/agent-session-resume' /** Keep per-agent resume argv separate from session metadata; type-only imports avoid runtime cycles. */ export function getAgentResumeArgv( diff --git a/src/shared/agent-resume-launch-command.spec.ts b/src/shared/agent-launch/startup/agent-resume-launch-command.spec.ts similarity index 98% rename from src/shared/agent-resume-launch-command.spec.ts rename to src/shared/agent-launch/startup/agent-resume-launch-command.spec.ts index bd4ed88aeba..0df25868a81 100644 --- a/src/shared/agent-resume-launch-command.spec.ts +++ b/src/shared/agent-launch/startup/agent-resume-launch-command.spec.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest' import { buildClaudeResumeLaunchCommand } from './agent-resume-launch-command' -import { buildAgentResumeStartupPlan, buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' +import { buildAgentStartupPlan } from './tui-agent-startup' import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' const SESSION_ID = 'claude-session-1' diff --git a/src/shared/agent-resume-launch-command.ts b/src/shared/agent-launch/startup/agent-resume-launch-command.ts similarity index 98% rename from src/shared/agent-resume-launch-command.ts rename to src/shared/agent-launch/startup/agent-resume-launch-command.ts index e941759bda2..225f6ea90fe 100644 --- a/src/shared/agent-resume-launch-command.ts +++ b/src/shared/agent-launch/startup/agent-resume-launch-command.ts @@ -1,4 +1,4 @@ -import type { ResumableTuiAgent } from './agent-session/lifecycle/agent-session-resume' +import type { ResumableTuiAgent } from '../../agent-session/lifecycle/agent-session-resume' import { isPosixStartupShell, quoteStartupArg, diff --git a/src/shared/agent-startup-default-lifetime.test.ts b/src/shared/agent-launch/startup/agent-startup-default-lifetime.test.ts similarity index 95% rename from src/shared/agent-startup-default-lifetime.test.ts rename to src/shared/agent-launch/startup/agent-startup-default-lifetime.test.ts index 5add91ad9f8..04aaf23ebe9 100644 --- a/src/shared/agent-startup-default-lifetime.test.ts +++ b/src/shared/agent-launch/startup/agent-startup-default-lifetime.test.ts @@ -1,13 +1,14 @@ -import * as optionCatalog from './agent-session/options/agent-session-option-catalog' +import * as optionCatalog from '../../agent-session/options/agent-session-option-catalog' import { describe, expect, it, vi } from 'vitest' import { resolveAgentStartupPlanInputs, type AgentStartupSettings } from './agent-startup-plan-inputs' -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' import { resolveAgentLaunchCommand } from './tui-agent-launch-command' -import { resolveAgentChoiceLayers } from './agent-choice-layers' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' +import { resolveAgentChoiceLayers } from '../choices/agent-choice-layers' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' function words(command: string, shell: AgentStartupShell = 'posix') { diff --git a/src/shared/agent-startup-plan-inputs-baseline-test-fixture.ts b/src/shared/agent-launch/startup/agent-startup-plan-inputs-baseline-test-fixture.ts similarity index 88% rename from src/shared/agent-startup-plan-inputs-baseline-test-fixture.ts rename to src/shared/agent-launch/startup/agent-startup-plan-inputs-baseline-test-fixture.ts index 7eff2e03852..cf9a43e3974 100644 --- a/src/shared/agent-startup-plan-inputs-baseline-test-fixture.ts +++ b/src/shared/agent-launch/startup/agent-startup-plan-inputs-baseline-test-fixture.ts @@ -1,12 +1,15 @@ // Exact function from660243e61ff:agent-startup-plan-inputs.ts; only export/import paths differ. // Full-source SHA256573ec1fd98d1859f983e625cd593a1e636a53eb67e43871168e0bfc14e84130c. import type { AgentStartupSettings, AgentStartupPlanInputs } from './agent-startup-plan-inputs' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' -import type { TuiAgent } from './tui-agent' -import { resolveTuiAgentLaunchArgs, resolveTuiAgentLaunchEnv } from './tui-agent-launch-defaults' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' +import type { TuiAgent } from '../catalog/tui-agent' +import { + resolveTuiAgentLaunchArgs, + resolveTuiAgentLaunchEnv +} from '../choices/tui-agent-launch-defaults' import { resolveStartupShell, type AgentStartupShell } from './tui-agent-startup-shell' import { hasExtraAgentArgs, mergeExtraAgentArgs } from './automation-extra-agent-args' -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' export function resolveBaselineAgentStartupPlanInputs(args: { agent: TuiAgent diff --git a/src/shared/agent-startup-plan-inputs-extra-agent-args.spec.ts b/src/shared/agent-launch/startup/agent-startup-plan-inputs-extra-agent-args.spec.ts similarity index 97% rename from src/shared/agent-startup-plan-inputs-extra-agent-args.spec.ts rename to src/shared/agent-launch/startup/agent-startup-plan-inputs-extra-agent-args.spec.ts index 08a2ed6d52c..4b658e01e26 100644 --- a/src/shared/agent-startup-plan-inputs-extra-agent-args.spec.ts +++ b/src/shared/agent-launch/startup/agent-startup-plan-inputs-extra-agent-args.spec.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest' import { resolveAgentStartupPlanInputs } from './agent-startup-plan-inputs' import './automation-extra-agent-args' import { buildAgentStartupPlan } from './tui-agent-startup' -import './tui-agent-launch-defaults' +import '../choices/tui-agent-launch-defaults' const SETTINGS = { agentDefaultArgs: { claude: '--dangerously-skip-permissions --model sonnet' }, diff --git a/src/shared/agent-startup-plan-inputs.spec.ts b/src/shared/agent-launch/startup/agent-startup-plan-inputs.spec.ts similarity index 100% rename from src/shared/agent-startup-plan-inputs.spec.ts rename to src/shared/agent-launch/startup/agent-startup-plan-inputs.spec.ts diff --git a/src/shared/agent-startup-plan-inputs.ts b/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts similarity index 90% rename from src/shared/agent-startup-plan-inputs.ts rename to src/shared/agent-launch/startup/agent-startup-plan-inputs.ts index 6d4931737fe..87fb5354277 100644 --- a/src/shared/agent-startup-plan-inputs.ts +++ b/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts @@ -1,13 +1,13 @@ -import type { GlobalSettings } from './global-settings-types' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' -import type { TuiAgent } from './tui-agent' +import type { GlobalSettings } from '../../global-settings-types' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' +import type { TuiAgent } from '../catalog/tui-agent' import { agentLaunchPermissionSettings, resolveTuiAgentLaunchEnv -} from './tui-agent-launch-defaults' +} from '../choices/tui-agent-launch-defaults' import { resolveStartupShell, type AgentStartupShell } from './tui-agent-startup-shell' import { terminalSessionOptionInputs } from './tui-agent-launch-command' -import { resolveLocalWindowsAgentStartupShell } from './windows-terminal-shell' +import { resolveLocalWindowsAgentStartupShell } from '../../windows-terminal-shell' /** The settings slice a launch reads; hosts pass their whole `GlobalSettings` row. */ export type AgentStartupSettings = Partial< diff --git a/src/shared/agent-startup-update-suppression.test.ts b/src/shared/agent-launch/startup/agent-startup-update-suppression.test.ts similarity index 100% rename from src/shared/agent-startup-update-suppression.test.ts rename to src/shared/agent-launch/startup/agent-startup-update-suppression.test.ts diff --git a/src/shared/agent-tui-command-typing.ts b/src/shared/agent-launch/startup/agent-tui-command-typing.ts similarity index 100% rename from src/shared/agent-tui-command-typing.ts rename to src/shared/agent-launch/startup/agent-tui-command-typing.ts diff --git a/src/shared/agent-tui-input-clear.test.ts b/src/shared/agent-launch/startup/agent-tui-input-clear.test.ts similarity index 100% rename from src/shared/agent-tui-input-clear.test.ts rename to src/shared/agent-launch/startup/agent-tui-input-clear.test.ts diff --git a/src/shared/agent-tui-input-clear.ts b/src/shared/agent-launch/startup/agent-tui-input-clear.ts similarity index 100% rename from src/shared/agent-tui-input-clear.ts rename to src/shared/agent-launch/startup/agent-tui-input-clear.ts diff --git a/src/shared/automation-extra-agent-args.spec.ts b/src/shared/agent-launch/startup/automation-extra-agent-args.spec.ts similarity index 99% rename from src/shared/automation-extra-agent-args.spec.ts rename to src/shared/agent-launch/startup/automation-extra-agent-args.spec.ts index 07cc16fbc83..eee2910e6ba 100644 --- a/src/shared/automation-extra-agent-args.spec.ts +++ b/src/shared/agent-launch/startup/automation-extra-agent-args.spec.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest' import { mergeExtraAgentArgs, parseExtraAgentArgs } from './automation-extra-agent-args' import { buildAgentStartupPlan } from './tui-agent-startup' import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' function merged( agent: TuiAgent, diff --git a/src/shared/automation-extra-agent-args.ts b/src/shared/agent-launch/startup/automation-extra-agent-args.ts similarity index 96% rename from src/shared/automation-extra-agent-args.ts rename to src/shared/agent-launch/startup/automation-extra-agent-args.ts index 8b731edaca0..0a7df3e8914 100644 --- a/src/shared/automation-extra-agent-args.ts +++ b/src/shared/agent-launch/startup/automation-extra-agent-args.ts @@ -1,13 +1,13 @@ -import { agentArgTerminatorIndex } from './agent-session/options/agent-session-option-agent-args' -import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' -import { findOptionOccurrence } from './command-option-occurrence' +import { agentArgTerminatorIndex } from '../../agent-session/options/agent-session-option-agent-args' +import { getAgentSessionOptionLaunchCatalog } from '../../agent-session/options/agent-session-option-catalog' +import { findOptionOccurrence } from '../../command-option-occurrence' import { quoteStartupArg, tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' -import { TUI_AGENT_DISPLAY_NAMES } from './tui-agent-display-names' +import type { TuiAgent } from '../catalog/tui-agent' +import { TUI_AGENT_DISPLAY_NAMES } from '../catalog/tui-agent-display-names' export const EXTRA_AGENT_ARGS_MAX_BYTES = 4096 export const EXTRA_AGENT_ARGS_HOST_UPDATE_REQUIRED = diff --git a/src/shared/codex-startup-delivery.test.ts b/src/shared/agent-launch/startup/codex-startup-delivery.test.ts similarity index 100% rename from src/shared/codex-startup-delivery.test.ts rename to src/shared/agent-launch/startup/codex-startup-delivery.test.ts diff --git a/src/shared/codex-startup-delivery.ts b/src/shared/agent-launch/startup/codex-startup-delivery.ts similarity index 93% rename from src/shared/codex-startup-delivery.ts rename to src/shared/agent-launch/startup/codex-startup-delivery.ts index b447247bf6b..fcbe5d2367e 100644 --- a/src/shared/codex-startup-delivery.ts +++ b/src/shared/agent-launch/startup/codex-startup-delivery.ts @@ -1,5 +1,5 @@ -import { recognizeAgentProcessFromCommandLine } from './agent-process-recognition' -import { shellReadyMarkerComesFromLineEditor } from './shell-ready-marker-timing' +import { recognizeAgentProcessFromCommandLine } from '../../agent-process-recognition' +import { shellReadyMarkerComesFromLineEditor } from '../../shell-ready-marker-timing' export type StartupCommandDelivery = 'fast' | 'shell-ready' diff --git a/src/shared/dsh-startup.spec.ts b/src/shared/agent-launch/startup/dsh-startup.spec.ts similarity index 92% rename from src/shared/dsh-startup.spec.ts rename to src/shared/agent-launch/startup/dsh-startup.spec.ts index 604fcc54671..c25a66c259f 100644 --- a/src/shared/dsh-startup.spec.ts +++ b/src/shared/agent-launch/startup/dsh-startup.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { buildAgentStartupPlan } from './tui-agent-startup' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' describe('DSH first launch', () => { it.each(['darwin', 'linux', 'win32'] as const)( diff --git a/src/shared/flag-prompt-startup.ts b/src/shared/agent-launch/startup/flag-prompt-startup.ts similarity index 81% rename from src/shared/flag-prompt-startup.ts rename to src/shared/agent-launch/startup/flag-prompt-startup.ts index 1efbb4e446b..e48bff85f38 100644 --- a/src/shared/flag-prompt-startup.ts +++ b/src/shared/agent-launch/startup/flag-prompt-startup.ts @@ -1,10 +1,10 @@ import type { AgentStartupPlan } from './tui-agent-startup' -import type { SleepingAgentLaunchConfig } from './agent-session/lifecycle/agent-session-resume' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' -import type { TuiAgent } from './tui-agent' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import type { SleepingAgentLaunchConfig } from '../../agent-session/lifecycle/agent-session-resume' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' +import type { TuiAgent } from '../catalog/tui-agent' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import { findOpenCodeRunCommand } from './opencode-headless-command' +import { findOpenCodeRunCommand } from '../../opencode-headless-command' import { openCodeStartupPromptEnv } from './opencode-startup-prompt' export function appliedSessionOptionProps(values: Record) { diff --git a/src/shared/freebuff-launch.spec.ts b/src/shared/agent-launch/startup/freebuff-launch.spec.ts similarity index 95% rename from src/shared/freebuff-launch.spec.ts rename to src/shared/agent-launch/startup/freebuff-launch.spec.ts index a9c7163d089..558e5e596de 100644 --- a/src/shared/freebuff-launch.spec.ts +++ b/src/shared/agent-launch/startup/freebuff-launch.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { buildAgentDraftLaunchPlan, buildAgentStartupPlan } from './tui-agent-startup' -import { isExpectedAgentProcess, recognizeAgentProcess } from './agent-process-recognition' -import { pickTuiAgent } from './tui-agent-selection' +import { isExpectedAgentProcess, recognizeAgentProcess } from '../../agent-process-recognition' +import { pickTuiAgent } from '../catalog/tui-agent-selection' describe('Freebuff terminal launches', () => { it.each(['darwin', 'linux', 'win32'] as const)( diff --git a/src/shared/freebuff-startup.spec.ts b/src/shared/agent-launch/startup/freebuff-startup.spec.ts similarity index 100% rename from src/shared/freebuff-startup.spec.ts rename to src/shared/agent-launch/startup/freebuff-startup.spec.ts diff --git a/src/shared/hermes-startup-query.ts b/src/shared/agent-launch/startup/hermes-startup-query.ts similarity index 98% rename from src/shared/hermes-startup-query.ts rename to src/shared/agent-launch/startup/hermes-startup-query.ts index 4958f4d3d54..8d3b975aca3 100644 --- a/src/shared/hermes-startup-query.ts +++ b/src/shared/agent-launch/startup/hermes-startup-query.ts @@ -1,4 +1,4 @@ -import { encodePowerShellCommand } from './powershell-command-encoding' +import { encodePowerShellCommand } from '../../powershell-command-encoding' import { buildShellCommandFromArgv, isPosixStartupShell, diff --git a/src/shared/hermes-startup-query.windows.test.ts b/src/shared/agent-launch/startup/hermes-startup-query.windows.test.ts similarity index 100% rename from src/shared/hermes-startup-query.windows.test.ts rename to src/shared/agent-launch/startup/hermes-startup-query.windows.test.ts diff --git a/src/shared/omp-draft-launch-shell.test.ts b/src/shared/agent-launch/startup/omp-draft-launch-shell.test.ts similarity index 100% rename from src/shared/omp-draft-launch-shell.test.ts rename to src/shared/agent-launch/startup/omp-draft-launch-shell.test.ts diff --git a/src/shared/omp-draft-launch-windows.test.ts b/src/shared/agent-launch/startup/omp-draft-launch-windows.test.ts similarity index 100% rename from src/shared/omp-draft-launch-windows.test.ts rename to src/shared/agent-launch/startup/omp-draft-launch-windows.test.ts diff --git a/src/shared/omp-draft-launch.ts b/src/shared/agent-launch/startup/omp-draft-launch.ts similarity index 100% rename from src/shared/omp-draft-launch.ts rename to src/shared/agent-launch/startup/omp-draft-launch.ts diff --git a/src/shared/omp-fresh-config.ts b/src/shared/agent-launch/startup/omp-fresh-config.ts similarity index 100% rename from src/shared/omp-fresh-config.ts rename to src/shared/agent-launch/startup/omp-fresh-config.ts diff --git a/src/shared/omp-fresh-launch-cmd.win32.test.ts b/src/shared/agent-launch/startup/omp-fresh-launch-cmd.win32.test.ts similarity index 100% rename from src/shared/omp-fresh-launch-cmd.win32.test.ts rename to src/shared/agent-launch/startup/omp-fresh-launch-cmd.win32.test.ts diff --git a/src/shared/omp-fresh-launch-shell.test.ts b/src/shared/agent-launch/startup/omp-fresh-launch-shell.test.ts similarity index 100% rename from src/shared/omp-fresh-launch-shell.test.ts rename to src/shared/agent-launch/startup/omp-fresh-launch-shell.test.ts diff --git a/src/shared/omp-fresh-launch.spec.ts b/src/shared/agent-launch/startup/omp-fresh-launch.spec.ts similarity index 100% rename from src/shared/omp-fresh-launch.spec.ts rename to src/shared/agent-launch/startup/omp-fresh-launch.spec.ts diff --git a/src/shared/omp-fresh-launch.ts b/src/shared/agent-launch/startup/omp-fresh-launch.ts similarity index 100% rename from src/shared/omp-fresh-launch.ts rename to src/shared/agent-launch/startup/omp-fresh-launch.ts diff --git a/src/shared/opencode-startup-prompt.spec.ts b/src/shared/agent-launch/startup/opencode-startup-prompt.spec.ts similarity index 100% rename from src/shared/opencode-startup-prompt.spec.ts rename to src/shared/agent-launch/startup/opencode-startup-prompt.spec.ts diff --git a/src/shared/opencode-startup-prompt.ts b/src/shared/agent-launch/startup/opencode-startup-prompt.ts similarity index 89% rename from src/shared/opencode-startup-prompt.ts rename to src/shared/agent-launch/startup/opencode-startup-prompt.ts index e3b1c462ffa..a4e8c416a10 100644 --- a/src/shared/opencode-startup-prompt.ts +++ b/src/shared/agent-launch/startup/opencode-startup-prompt.ts @@ -1,7 +1,7 @@ -import { isOpenCodeRunCommand } from './opencode-headless-command' -import { sha256 } from './sha256' +import { isOpenCodeRunCommand } from '../../opencode-headless-command' +import { sha256 } from '../../sha256' import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' export const OPENCODE_STARTUP_PROMPT_SHA256_ENV = 'ORCA_OPENCODE_STARTUP_PROMPT_SHA256' export const OPENCODE_STARTUP_PROMPT_NONCE_ENV = 'ORCA_OPENCODE_STARTUP_PROMPT_NONCE' diff --git a/src/shared/opencode2-resume-launch-mode.spec.ts b/src/shared/agent-launch/startup/opencode2-resume-launch-mode.spec.ts similarity index 96% rename from src/shared/opencode2-resume-launch-mode.spec.ts rename to src/shared/agent-launch/startup/opencode2-resume-launch-mode.spec.ts index 513bd76eb51..7a438d31351 100644 --- a/src/shared/opencode2-resume-launch-mode.spec.ts +++ b/src/shared/agent-launch/startup/opencode2-resume-launch-mode.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { buildAiVaultResumeCommand } from './ai-vault-resume-command' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAiVaultResumeCommand } from '../../ai-vault-resume-command' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' import type { AgentStartupShell } from './tui-agent-startup-shell' const providerSession = { key: 'session_id', id: 'ses_resume' } as const diff --git a/src/shared/qoder-cn-launch-recipe.spec.ts b/src/shared/agent-launch/startup/qoder-cn-launch-recipe.spec.ts similarity index 92% rename from src/shared/qoder-cn-launch-recipe.spec.ts rename to src/shared/agent-launch/startup/qoder-cn-launch-recipe.spec.ts index 510d2d94077..7b2202ec376 100644 --- a/src/shared/qoder-cn-launch-recipe.spec.ts +++ b/src/shared/agent-launch/startup/qoder-cn-launch-recipe.spec.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' describe('Qoder China launch recipe identity', () => { it.each(['darwin', 'linux', 'win32'] as const)( diff --git a/src/shared/tui-agent-fork-startup.spec.ts b/src/shared/agent-launch/startup/tui-agent-fork-startup.spec.ts similarity index 94% rename from src/shared/tui-agent-fork-startup.spec.ts rename to src/shared/agent-launch/startup/tui-agent-fork-startup.spec.ts index be1452f11d7..e1c3d1dd3a7 100644 --- a/src/shared/tui-agent-fork-startup.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-fork-startup.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' const SESSION = { key: 'session_id', id: 's1' } as const diff --git a/src/shared/tui-agent-launch-command-argument-values.test.ts b/src/shared/agent-launch/startup/tui-agent-launch-command-argument-values.test.ts similarity index 93% rename from src/shared/tui-agent-launch-command-argument-values.test.ts rename to src/shared/agent-launch/startup/tui-agent-launch-command-argument-values.test.ts index e3312a30eb5..0dd0b995e65 100644 --- a/src/shared/tui-agent-launch-command-argument-values.test.ts +++ b/src/shared/agent-launch/startup/tui-agent-launch-command-argument-values.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest' -import recordings from './fixtures/source-control-launch-recordings.json' -import { normalizeSourceControlActionLaunchPreferences } from './source-control-ai-actions' -import { sourceControlActionLaunchOptions } from './source-control-action-launch-preferences' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' +import recordings from '../../fixtures/source-control-launch-recordings.json' +import { normalizeSourceControlActionLaunchPreferences } from '../../source-control-action-model-selection' +import { sourceControlActionLaunchOptions } from '../../source-control-action-launch-preferences' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' import { resolveAgentLaunchCommand, terminalSessionOptionInputs } from './tui-agent-launch-command' import { tokenizeStartupCommand } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' describe.each(['posix', 'powershell', 'cmd'] as const)('argument values on %s', (shell) => { function launchAgent( diff --git a/src/shared/tui-agent-launch-command-override.test.ts b/src/shared/agent-launch/startup/tui-agent-launch-command-override.test.ts similarity index 100% rename from src/shared/tui-agent-launch-command-override.test.ts rename to src/shared/agent-launch/startup/tui-agent-launch-command-override.test.ts diff --git a/src/shared/tui-agent-launch-command-override.ts b/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts similarity index 90% rename from src/shared/tui-agent-launch-command-override.ts rename to src/shared/agent-launch/startup/tui-agent-launch-command-override.ts index 45afc7957d6..dcf1fb023d8 100644 --- a/src/shared/tui-agent-launch-command-override.ts +++ b/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from './global-settings-types' -import type { TuiAgent } from './tui-agent' +import type { GlobalSettings } from '../../global-settings-types' +import type { TuiAgent } from '../catalog/tui-agent' import { parseAgentCommand } from './agent-command-plan' /** Literal program and prefix; chat never evaluates shell syntax. */ diff --git a/src/shared/tui-agent-launch-command-pick-flags.test.ts b/src/shared/agent-launch/startup/tui-agent-launch-command-pick-flags.test.ts similarity index 100% rename from src/shared/tui-agent-launch-command-pick-flags.test.ts rename to src/shared/agent-launch/startup/tui-agent-launch-command-pick-flags.test.ts diff --git a/src/shared/tui-agent-launch-command.ts b/src/shared/agent-launch/startup/tui-agent-launch-command.ts similarity index 93% rename from src/shared/tui-agent-launch-command.ts rename to src/shared/agent-launch/startup/tui-agent-launch-command.ts index 75cb6d1d453..341ff11b19c 100644 --- a/src/shared/tui-agent-launch-command.ts +++ b/src/shared/agent-launch/startup/tui-agent-launch-command.ts @@ -1,26 +1,26 @@ -import { analyzeAgentChoiceArgs } from './agent-choice-args' +import { analyzeAgentChoiceArgs } from '../choices/agent-choice-args' import { removeOverriddenAgentSessionArgs, resolveAgentSessionOptionLaunch -} from './agent-session/options/agent-session-option-launch' -import { resolveAgentChoiceLayers, yieldAgentChoicesToArgs } from './agent-choice-layers' -import { resolveTuiAgentLaunchRawArgs } from './tui-agent-launch-defaults' +} from '../../agent-session/options/agent-session-option-launch' +import { resolveAgentChoiceLayers, yieldAgentChoicesToArgs } from '../choices/agent-choice-layers' +import { resolveTuiAgentLaunchRawArgs } from '../choices/tui-agent-launch-defaults' import { hasExtraAgentArgs, parseExtraAgentArgs, mergeParsedExtraAgentArgs } from './automation-extra-agent-args' -import type { AgentLaunchProfileSettings } from './tui-agent-launch-defaults' -import { readLaunchPermissionChoice } from './tui-agent-permission-choice' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' -import { agentArgTerminatorIndex } from './agent-session/options/agent-session-option-agent-args' -import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from './tui-agent-config' +import type { AgentLaunchProfileSettings } from '../choices/tui-agent-launch-defaults' +import { readLaunchPermissionChoice } from '../permissions/tui-agent-permission-choice' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' +import { agentArgTerminatorIndex } from '../../agent-session/options/agent-session-option-agent-args' +import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' import { quoteStartupArg, tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' // Why: Enter on Codex's "Update available" screen picks "Update now", which installs and exits. const STARTUP_UPDATE_PROMPT_SUPPRESSION_ARGS: Partial> = { diff --git a/src/shared/tui-agent-prompt-transport.spec.ts b/src/shared/agent-launch/startup/tui-agent-prompt-transport.spec.ts similarity index 93% rename from src/shared/tui-agent-prompt-transport.spec.ts rename to src/shared/agent-launch/startup/tui-agent-prompt-transport.spec.ts index 736b05d1ea3..afbd5c26891 100644 --- a/src/shared/tui-agent-prompt-transport.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-prompt-transport.spec.ts @@ -1,9 +1,9 @@ /** Pin the pre-launch transport predicate to buildAgentStartupPlan’s followupPrompt verdict for every agent so table drift cannot lose prompts. */ import { describe, expect, it } from 'vitest' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' import { agentPromptRidesLaunchCommand, buildAgentStartupPlan } from './tui-agent-startup' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from '../catalog/tui-agent' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the config is declared as a total record over TuiAgent, so its own keys are that union. const ALL_AGENTS = Object.keys(TUI_AGENT_CONFIG) as TuiAgent[] diff --git a/src/shared/tui-agent-resume-startup.ts b/src/shared/agent-launch/startup/tui-agent-resume-startup.ts similarity index 87% rename from src/shared/tui-agent-resume-startup.ts rename to src/shared/agent-launch/startup/tui-agent-resume-startup.ts index 869d94e0a0b..e8af164c4ba 100644 --- a/src/shared/tui-agent-resume-startup.ts +++ b/src/shared/agent-launch/startup/tui-agent-resume-startup.ts @@ -2,19 +2,19 @@ import { getAgentForkArgv, getAgentResumeArgv } from './agent-resume-argv' import type { AgentProviderSessionMetadata, ResumableTuiAgent -} from './agent-session/lifecycle/agent-session-resume' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' -import { buildSleepingAgentLaunchConfig } from './sleeping-agent-launch-config' +} from '../../agent-session/lifecycle/agent-session-resume' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' +import { buildSleepingAgentLaunchConfig } from '../../sleeping-agent-launch-config' import { resolveAgentLaunchCommand, withAgentTerminalInputArgs } from './tui-agent-launch-command' import type { AgentStartupPlan } from './tui-agent-startup' import { resolveStartupShell, type AgentStartupShell } from './tui-agent-startup-shell' -import { TUI_AGENT_CONFIG } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' +import type { TuiAgent } from '../catalog/tui-agent' import { buildAgentResumeLaunchCommand } from './agent-resume-launch-command' -import { buildAiVaultResumeShellCommand } from './ai-vault-resume-command' -import { normalizeRuntimePathForComparison } from './cross-platform-path' -import { parseWslUncPath } from './wsl-paths' -import { dropRecordedAgentPermissionArgs } from './tui-agent-permission-lift' +import { buildAiVaultResumeShellCommand } from '../../ai-vault-resume-command' +import { normalizeRuntimePathForComparison } from '../../cross-platform-path' +import { parseWslUncPath } from '../../wsl-paths' +import { dropRecordedAgentPermissionArgs } from '../permissions/tui-agent-permission-lift' export function buildAgentResumeStartupPlan(args: { agent: ResumableTuiAgent diff --git a/src/shared/tui-agent-startup-copilot-resume.spec.ts b/src/shared/agent-launch/startup/tui-agent-startup-copilot-resume.spec.ts similarity index 94% rename from src/shared/tui-agent-startup-copilot-resume.spec.ts rename to src/shared/agent-launch/startup/tui-agent-startup-copilot-resume.spec.ts index d62bdb9293c..11e3139c9c9 100644 --- a/src/shared/tui-agent-startup-copilot-resume.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup-copilot-resume.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' const SESSION = { key: 'session_id' as const, id: '940237d9-c712-48e8-bca1-fd75fc4a8d4b' } diff --git a/src/shared/tui-agent-startup-hermes.spec.ts b/src/shared/agent-launch/startup/tui-agent-startup-hermes.spec.ts similarity index 97% rename from src/shared/tui-agent-startup-hermes.spec.ts rename to src/shared/agent-launch/startup/tui-agent-startup-hermes.spec.ts index 3ba054aba9a..6798b389fd7 100644 --- a/src/shared/tui-agent-startup-hermes.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup-hermes.spec.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { buildAgentResumeStartupPlan, buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' +import { buildAgentStartupPlan } from './tui-agent-startup' import { unwrapPosixShellScript, unwrapPowerShellScript diff --git a/src/shared/tui-agent-startup-kiro-resume.test.ts b/src/shared/agent-launch/startup/tui-agent-startup-kiro-resume.test.ts similarity index 100% rename from src/shared/tui-agent-startup-kiro-resume.test.ts rename to src/shared/agent-launch/startup/tui-agent-startup-kiro-resume.test.ts diff --git a/src/shared/tui-agent-startup-script.test-fixture.ts b/src/shared/agent-launch/startup/tui-agent-startup-script.test-fixture.ts similarity index 100% rename from src/shared/tui-agent-startup-script.test-fixture.ts rename to src/shared/agent-launch/startup/tui-agent-startup-script.test-fixture.ts diff --git a/src/shared/tui-agent-startup-session-options.spec.ts b/src/shared/agent-launch/startup/tui-agent-startup-session-options.spec.ts similarity index 96% rename from src/shared/tui-agent-startup-session-options.spec.ts rename to src/shared/agent-launch/startup/tui-agent-startup-session-options.spec.ts index 006decc7fb0..e1d133f8d1b 100644 --- a/src/shared/tui-agent-startup-session-options.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup-session-options.spec.ts @@ -1,9 +1,6 @@ import { describe, expect, it } from 'vitest' -import { - buildAgentDraftLaunchPlan, - buildAgentResumeStartupPlan, - buildAgentStartupPlan -} from './tui-agent-startup' +import { buildAgentDraftLaunchPlan, buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' import { resolveAgentLaunchCommand } from './tui-agent-launch-command' describe('tui agent startup session options', () => { diff --git a/src/shared/tui-agent-startup-shell.spec.ts b/src/shared/agent-launch/startup/tui-agent-startup-shell.spec.ts similarity index 100% rename from src/shared/tui-agent-startup-shell.spec.ts rename to src/shared/agent-launch/startup/tui-agent-startup-shell.spec.ts diff --git a/src/shared/tui-agent-startup-shell.ts b/src/shared/agent-launch/startup/tui-agent-startup-shell.ts similarity index 98% rename from src/shared/tui-agent-startup-shell.ts rename to src/shared/agent-launch/startup/tui-agent-startup-shell.ts index 7909faea68e..7377742adf0 100644 --- a/src/shared/tui-agent-startup-shell.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup-shell.ts @@ -1,5 +1,5 @@ -import { tokenizeCustomCommandTemplate, type CommandTokenSpan } from './commit-message-prompt' -import { quotePowerShellLiteral } from './powershell-native-argument' +import { tokenizeCustomCommandTemplate, type CommandTokenSpan } from '../../commit-message-prompt' +import { quotePowerShellLiteral } from '../../powershell-native-argument' /** posix output must parse identically across Unix shells including fish; remote/WSL shell detection is not reliable enough to choose a separate dialect. */ export type AgentStartupShell = 'posix' | 'powershell' | 'cmd' diff --git a/src/shared/tui-agent-startup.spec.ts b/src/shared/agent-launch/startup/tui-agent-startup.spec.ts similarity index 97% rename from src/shared/tui-agent-startup.spec.ts rename to src/shared/agent-launch/startup/tui-agent-startup.spec.ts index 4734f685e8d..cab982042a6 100644 --- a/src/shared/tui-agent-startup.spec.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup.spec.ts @@ -1,13 +1,16 @@ import { describe, expect, it } from 'vitest' +import { buildAgentDraftLaunchPlan, buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' import { - buildAgentDraftLaunchPlan, - buildAgentResumeStartupPlan, - buildAgentStartupPlan, buildShellCommandFromArgv, - planAgentCliArgsSuffix -} from './tui-agent-startup' -import { normalizeTuiAgentArgsRecord, resolveTuiAgentLaunchArgs } from './tui-agent-launch-defaults' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' + planAgentCliArgsSuffix, + tokenizeStartupCommand +} from './tui-agent-startup-shell' +import { + normalizeTuiAgentArgsRecord, + resolveTuiAgentLaunchArgs +} from '../choices/tui-agent-launch-defaults' + import { unwrapPosixShellScript, unwrapPowerShellScript diff --git a/src/shared/tui-agent-startup.test.ts b/src/shared/agent-launch/startup/tui-agent-startup.test.ts similarity index 93% rename from src/shared/tui-agent-startup.test.ts rename to src/shared/agent-launch/startup/tui-agent-startup.test.ts index 299464c765e..f7d16841011 100644 --- a/src/shared/tui-agent-startup.test.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup.test.ts @@ -12,7 +12,7 @@ import './opencode-startup-prompt.spec' import './opencode2-resume-launch-mode.spec' import './qoder-cn-launch-recipe.spec' import './tui-agent-fork-startup.spec' -import './tui-agent-launch-defaults.spec' +import '../choices/tui-agent-launch-defaults.spec' import './tui-agent-prompt-transport.spec' import './tui-agent-startup-copilot-resume.spec' import './tui-agent-startup-hermes.spec' diff --git a/src/shared/tui-agent-startup.ts b/src/shared/agent-launch/startup/tui-agent-startup.ts similarity index 93% rename from src/shared/tui-agent-startup.ts rename to src/shared/agent-launch/startup/tui-agent-startup.ts index b6d7d1948ac..3ff1603b944 100644 --- a/src/shared/tui-agent-startup.ts +++ b/src/shared/agent-launch/startup/tui-agent-startup.ts @@ -1,7 +1,7 @@ import { withFreshOmpLaunch, isFreshOmpLaunchCommand } from './omp-fresh-launch' import { withOmpDraftCleanup } from './omp-draft-launch' -import { isShellProcess } from './agent-detection' -import type { SleepingAgentLaunchConfig } from './agent-session/lifecycle/agent-session-resume' +import '../../shell-process-detection' +import type { SleepingAgentLaunchConfig } from '../../agent-session/lifecycle/agent-session-resume' import { clearEnvCommand, commandSeparator, @@ -9,18 +9,16 @@ import { resolveStartupShell, type AgentStartupShell } from './tui-agent-startup-shell' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from '../catalog/tui-agent-config' import type { StartupCommandDelivery } from './codex-startup-delivery' -import { buildSleepingAgentLaunchConfig } from './sleeping-agent-launch-config' +import { buildSleepingAgentLaunchConfig } from '../../sleeping-agent-launch-config' import { planHermesStartupQuery } from './hermes-startup-query' import { inlineAgentDraftFitsPlatform } from './agent-draft-platform-limit' -import type { TuiAgent } from './tui-agent' -import type { SessionOptionValue } from './native-chat/input/native-chat-session-options' +import type { TuiAgent } from '../catalog/tui-agent' +import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' import { resolveAgentLaunchCommand } from './tui-agent-launch-command' import { appliedSessionOptionProps, buildFlagPromptStartupPlan } from './flag-prompt-startup' -export { buildAgentResumeStartupPlan } from './tui-agent-resume-startup' - export type AgentStartupPlan = { agent: TuiAgent launchCommand: string @@ -292,12 +290,3 @@ export function buildAgentDraftLaunchPlan(args: { } return plan } - -export { isShellProcess } -export { - buildShellCommandFromArgv, - planAgentCliArgsSuffix, - quoteStartupArg, - resolveStartupShell -} from './tui-agent-startup-shell' -export type { AgentCliArgsPlan, AgentStartupShell } from './tui-agent-startup-shell' diff --git a/src/shared/agent-model-probe-spec.ts b/src/shared/agent-model-probe-spec.ts index f84a5fff731..0df658fc1df 100644 --- a/src/shared/agent-model-probe-spec.ts +++ b/src/shared/agent-model-probe-spec.ts @@ -1,7 +1,7 @@ import { getCommitMessageAgentSpec, type CommitMessageAgentSpec } from './commit-message-agent-spec' import { GROK_MODEL_LIST_ARGS, parseGrokModelList } from './grok-model-list-probe' import { OMP_MODEL_LIST_ARGS, parseOmpModelList } from './omp-model-list-probe' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Exclude generation inputs so discovery-only agents stay outside the commit-message registry. */ export type AgentModelProbeSpec = Omit< diff --git a/src/shared/agent-node-entrypoint-identities.ts b/src/shared/agent-node-entrypoint-identities.ts index 849b27f7788..f0bbbe193ca 100644 --- a/src/shared/agent-node-entrypoint-identities.ts +++ b/src/shared/agent-node-entrypoint-identities.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' // Node CLIs whose shims launch a generic script (cli.js, versioned index.js), so // only the exact install path is an authoritative identity signal. diff --git a/src/shared/agent-process-recognition.test.ts b/src/shared/agent-process-recognition.test.ts index 871e825bcd0..cb3443d44ca 100644 --- a/src/shared/agent-process-recognition.test.ts +++ b/src/shared/agent-process-recognition.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { withFreshOmpLaunch } from './omp-fresh-launch' -import { buildAgentDraftLaunchPlan } from './tui-agent-startup' +import { withFreshOmpLaunch } from './agent-launch/startup/omp-fresh-launch' +import { buildAgentDraftLaunchPlan } from './agent-launch/startup/tui-agent-startup' import { detectExplicitPiAgentKindFromCommand } from './pi-agent-kind' import { recognizeAgentProcessFromCommandLine } from './agent-process-recognition' diff --git a/src/shared/agent-process-recognition.ts b/src/shared/agent-process-recognition.ts index d28d0d27bef..a878762b045 100644 --- a/src/shared/agent-process-recognition.ts +++ b/src/shared/agent-process-recognition.ts @@ -1,4 +1,8 @@ -import { getTuiAgentDetectCommands, isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +import { + getTuiAgentDetectCommands, + isTuiAgent, + TUI_AGENT_CONFIG +} from './agent-launch/catalog/tui-agent-config' import { EXACT_NODE_ENTRYPOINT_IDENTITIES } from './agent-node-entrypoint-identities' import { NODE_PACKAGE_SCRIPT_ENTRYPOINTS } from './agent-node-package-entrypoints' import type { AgentType } from './agent-status-types' @@ -11,7 +15,7 @@ import { PYTHON_PROCESS_RE, tokenizeCommandLine } from './agent-command-line-entrypoint' -import { isFreshOmpLaunchCommand } from './omp-fresh-launch' +import { isFreshOmpLaunchCommand } from './agent-launch/startup/omp-fresh-launch' export type RecognizedAgentProcess = { agent: TerminalAgent; processName: string } diff --git a/src/shared/agent-resume-record-from-status.ts b/src/shared/agent-resume-record-from-status.ts index c2e034ebcbb..9433f352edf 100644 --- a/src/shared/agent-resume-record-from-status.ts +++ b/src/shared/agent-resume-record-from-status.ts @@ -8,7 +8,7 @@ import { type SleepingAgentLaunchConfig, type SleepingAgentSessionRecord } from './agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from './agent-resume-argv' +import { getAgentResumeArgv } from './agent-launch/startup/agent-resume-argv' import type { AgentStatusEntry } from './agent-status-types' import { recoveryRecordMatches, diff --git a/src/shared/agent-session/agent-session-host-authority.ts b/src/shared/agent-session/agent-session-host-authority.ts index 2e695eef0d6..7e07716bc47 100644 --- a/src/shared/agent-session/agent-session-host-authority.ts +++ b/src/shared/agent-session/agent-session-host-authority.ts @@ -8,7 +8,7 @@ import type { RuntimeTerminalCreate } from '../runtime-terminal-create-contract' import type { RuntimeTerminalPresentation } from '../runtime-terminal-contracts' import { isTerminalLeafId } from '../stable-pane-id' import { isValidTerminalTabId } from '../terminal-tab-id' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { SpawnIntent } from '../host-spawn-admission' export const AGENT_SESSION_RPC_ERROR_CODES = [ diff --git a/src/shared/agent-session/failures/agent-session-failure-copy.ts b/src/shared/agent-session/failures/agent-session-failure-copy.ts index c1bdf7d37b7..18fb37231b6 100644 --- a/src/shared/agent-session/failures/agent-session-failure-copy.ts +++ b/src/shared/agent-session/failures/agent-session-failure-copy.ts @@ -5,8 +5,8 @@ import { CLAUDE_PROFILE_SETUP_FAILED_MESSAGE } from '../../claude-profile-routing' import type { AgentSessionRefusalReference } from './agent-session-wire-refusals' -import type { AgentCliInstallationProblem } from '../../agent-cli-installation-problem' -import { tuiAgentDisplayName } from '../../tui-agent-display-names' +import type { AgentCliInstallationProblem } from '../../agent-launch/catalog/agent-cli-installation-problem' +import { tuiAgentDisplayName } from '../../agent-launch/catalog/tui-agent-display-names' /** Sentences a refusal notice shows too, so a chat says them one way. */ export const TERMINAL_AGENT_HOLDS_CHAT = 'This chat is still open in a terminal agent.' diff --git a/src/shared/agent-session/failures/agent-session-refusal-details.ts b/src/shared/agent-session/failures/agent-session-refusal-details.ts index cb775861ff2..24e6c50f3e8 100644 --- a/src/shared/agent-session/failures/agent-session-refusal-details.ts +++ b/src/shared/agent-session/failures/agent-session-refusal-details.ts @@ -5,7 +5,7 @@ import type { AgentJournalResolution } from '../journal/agent-session-journal-ty import { readAgentCliInstallationProblem, type AgentCliInstallationProblem -} from '../../agent-cli-installation-problem' +} from '../../agent-launch/catalog/agent-cli-installation-problem' import { readCodexInstallationProblem, type CodexInstallationProblem @@ -20,8 +20,8 @@ import { readAgentSessionExpiredAttachments, type AgentSessionExpiredAttachment } from './agent-session-expired-attachments' -import type { TuiAgent } from '../../tui-agent' -import { TUI_AGENT_DISPLAY_NAMES } from '../../tui-agent-display-names' +import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' +import { TUI_AGENT_DISPLAY_NAMES } from '../../agent-launch/catalog/tui-agent-display-names' import type { AgentSessionOwnerVerdict, AgentSessionWireRefusalCode diff --git a/src/shared/agent-session/failures/agent-session-refusal-notice.ts b/src/shared/agent-session/failures/agent-session-refusal-notice.ts index 1289a5b338f..5c56c57d3f0 100644 --- a/src/shared/agent-session/failures/agent-session-refusal-notice.ts +++ b/src/shared/agent-session/failures/agent-session-refusal-notice.ts @@ -23,7 +23,7 @@ import { agentSessionRefusalReasonWords, type AgentSessionRefusalHolder } from './agent-session-refusal-reason-words' -import { TUI_AGENT_DISPLAY_NAMES } from '../../tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../agent-launch/catalog/tui-agent-display-names' import { expiredAttachmentsSentence } from './agent-session-attachment-failure-words' import { agentSessionExpiredAttachmentNames } from './agent-session-expired-attachments' diff --git a/src/shared/agent-session/failures/agent-session-write-failure.ts b/src/shared/agent-session/failures/agent-session-write-failure.ts index dfd0c5c3dc0..fdcdb0ce558 100644 --- a/src/shared/agent-session/failures/agent-session-write-failure.ts +++ b/src/shared/agent-session/failures/agent-session-write-failure.ts @@ -7,9 +7,9 @@ import { } from './agent-session-refusal-details' import type { AgentSessionRewindReason } from '../lifecycle/agent-session-rewind' import type { AgentSessionArgumentProblem } from '../agent-session-argument-problem' -import type { TuiAgent } from '../../tui-agent' +import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' import type { CodexInstallationProblem } from '../../codex-cli-installation' -import type { AgentCliInstallationProblem } from '../../agent-cli-installation-problem' +import type { AgentCliInstallationProblem } from '../../agent-launch/catalog/agent-cli-installation-problem' import type { AgentSessionExpiredAttachment } from './agent-session-expired-attachments' import { isAgentSessionWireRefusalCode, diff --git a/src/shared/agent-session/lifecycle/agent-session-resume.ts b/src/shared/agent-session/lifecycle/agent-session-resume.ts index 2a53ad7535b..8ef043e0913 100644 --- a/src/shared/agent-session/lifecycle/agent-session-resume.ts +++ b/src/shared/agent-session/lifecycle/agent-session-resume.ts @@ -1,9 +1,9 @@ -import { readAgentEffortLevel } from '../../agent-effort-level' +import { readAgentEffortLevel } from '../../agent-launch/choices/agent-effort-level' import type { AgentHookSource } from '../../agent-hook-relay' import type { AgentStatusCacheIdentity, RefusedPaneResume } from '../../agent-status-ipc-payload' import type { AgentStatusState } from '../../agent-status-types' import type { AgentMainAgentStatus } from '../../main-agent-status' -import type { TuiAgent } from '../../tui-agent' +import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' export const RESUMABLE_TUI_AGENTS = [ 'claude', diff --git a/src/shared/agent-session/lifecycle/agent-session-sign-in.ts b/src/shared/agent-session/lifecycle/agent-session-sign-in.ts index 77c2c0ac4fe..48645c3f928 100644 --- a/src/shared/agent-session/lifecycle/agent-session-sign-in.ts +++ b/src/shared/agent-session/lifecycle/agent-session-sign-in.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_DISPLAY_NAMES } from '../../tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from '../../agent-launch/catalog/tui-agent-display-names' export const AGENT_SESSION_SIGN_IN = [ { agent: 'claude', loginCommand: ['claude', 'auth', 'login'] }, diff --git a/src/shared/agent-session/lifecycle/agent-session-turn-record.ts b/src/shared/agent-session/lifecycle/agent-session-turn-record.ts index 8a3ab855169..6fd6eb763e9 100644 --- a/src/shared/agent-session/lifecycle/agent-session-turn-record.ts +++ b/src/shared/agent-session/lifecycle/agent-session-turn-record.ts @@ -9,7 +9,7 @@ import type { } from '../journal/agent-session-journal-types' import { isAdmissibleAgentSessionContextUsage } from '../agent-session-context-usage-schema' import { agentTurnLifecycleText } from '../../agent-turn-lifecycle-text' -import { tuiAgentDisplayName } from '../../tui-agent-display-names' +import { tuiAgentDisplayName } from '../../agent-launch/catalog/tui-agent-display-names' export function readAgentJournalTurn( body: AgentJournalItemBody | undefined diff --git a/src/shared/agent-cli-flag-detection.test.ts b/src/shared/agent-session/options/agent-cli-flag-detection.test.ts similarity index 100% rename from src/shared/agent-cli-flag-detection.test.ts rename to src/shared/agent-session/options/agent-cli-flag-detection.test.ts diff --git a/src/shared/agent-cli-flag-detection.ts b/src/shared/agent-session/options/agent-cli-flag-detection.ts similarity index 82% rename from src/shared/agent-cli-flag-detection.ts rename to src/shared/agent-session/options/agent-cli-flag-detection.ts index b604160518a..60d0a94e4fd 100644 --- a/src/shared/agent-cli-flag-detection.ts +++ b/src/shared/agent-session/options/agent-cli-flag-detection.ts @@ -1,4 +1,4 @@ -import { agentArgOptionTokens } from './agent-session/options/agent-session-option-agent-args' +import { agentArgOptionTokens } from './agent-session-option-agent-args' /** Matches an exact token, the `flag=value` form, and clustered single-dash flags (`-mopus`). */ export function hasFlag(tokens: readonly string[], flags: readonly string[]): boolean { diff --git a/src/shared/agent-model-catalog-ownership.ts b/src/shared/agent-session/options/agent-model-catalog-ownership.ts similarity index 100% rename from src/shared/agent-model-catalog-ownership.ts rename to src/shared/agent-session/options/agent-model-catalog-ownership.ts diff --git a/src/shared/agent-session/options/agent-session-option-catalog-antigravity.ts b/src/shared/agent-session/options/agent-session-option-catalog-antigravity.ts index 1003f51a014..87707ae38b6 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-antigravity.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-antigravity.ts @@ -1,4 +1,4 @@ -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import type { AgentSessionOptionCatalog, CatalogOption } from './agent-session-option-catalog-types' const ANTIGRAVITY_EFFORT: CatalogOption = { diff --git a/src/shared/agent-session/options/agent-session-option-catalog-claude-codex.ts b/src/shared/agent-session/options/agent-session-option-catalog-claude-codex.ts index 49465525692..fee36b6846f 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-claude-codex.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-claude-codex.ts @@ -3,7 +3,7 @@ import type { CatalogModel, CatalogOption } from './agent-session-option-catalog-types' -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import { CLAUDE_MODEL_LIST_ARGS, CLAUDE_MODEL_LIST_STDIN, diff --git a/src/shared/agent-session/options/agent-session-option-catalog-codebuddy.ts b/src/shared/agent-session/options/agent-session-option-catalog-codebuddy.ts index 07974e3cb0f..84c53c01f9c 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-codebuddy.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-codebuddy.ts @@ -1,4 +1,4 @@ -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import type { AgentSessionOptionCatalog, CatalogOption } from './agent-session-option-catalog-types' const CODEBUDDY_EFFORT: CatalogOption = { diff --git a/src/shared/agent-session/options/agent-session-option-catalog-gemini-cursor.ts b/src/shared/agent-session/options/agent-session-option-catalog-gemini-cursor.ts index cb5f0c06c77..e12d68fa781 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-gemini-cursor.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-gemini-cursor.ts @@ -3,7 +3,7 @@ import type { CatalogModel, CatalogOption } from './agent-session-option-catalog-types' -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' export const GEMINI_SESSION_OPTION_CATALOG: AgentSessionOptionCatalog = { models: [ diff --git a/src/shared/agent-session/options/agent-session-option-catalog-grok.ts b/src/shared/agent-session/options/agent-session-option-catalog-grok.ts index 7f55db8f0b6..c2e54ea47aa 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-grok.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-grok.ts @@ -3,7 +3,7 @@ import type { CatalogModel, CatalogOption } from './agent-session-option-catalog-types' -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import { parseGrokModelList } from '../../grok-model-list-probe' // Omit none (untranslated), minimal and max (never advertised by a grok menu) from the canonical effort ladder. diff --git a/src/shared/agent-session/options/agent-session-option-catalog-muse.ts b/src/shared/agent-session/options/agent-session-option-catalog-muse.ts index 93413e29511..241dcbaa479 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-muse.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-muse.ts @@ -1,4 +1,4 @@ -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import type { AgentSessionOptionCatalog, CatalogOption } from './agent-session-option-catalog-types' // `none` is omitted: native-chat-session-option-labels.ts has no translation for it. diff --git a/src/shared/agent-session/options/agent-session-option-catalog-omp.ts b/src/shared/agent-session/options/agent-session-option-catalog-omp.ts index b546da28098..2a297073f4d 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-omp.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-omp.ts @@ -1,4 +1,4 @@ -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import type { AgentSessionOptionCatalog, CatalogModel } from './agent-session-option-catalog-types' import { parseOmpModelList } from '../../omp-model-list-probe' diff --git a/src/shared/agent-session/options/agent-session-option-catalog-opencode.ts b/src/shared/agent-session/options/agent-session-option-catalog-opencode.ts index e6a1af5dabf..fec999c2116 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-opencode.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-opencode.ts @@ -1,4 +1,4 @@ -import { agentChoiceCliApply } from '../../agent-choice-cli-apply' +import { agentChoiceCliApply } from '../../agent-launch/choices/agent-choice-cli-apply' import type { AgentSessionOptionCatalog } from './agent-session-option-catalog-types' // Why: worker-start needs launch serialization without exposing a new Native Chat option surface. diff --git a/src/shared/agent-session/options/agent-session-option-catalog-types.ts b/src/shared/agent-session/options/agent-session-option-catalog-types.ts index cadb708da3f..94cd64e686d 100644 --- a/src/shared/agent-session/options/agent-session-option-catalog-types.ts +++ b/src/shared/agent-session/options/agent-session-option-catalog-types.ts @@ -1,4 +1,4 @@ -import type { AgentChoiceCliForm } from '../../agent-launch-choices' +import type { AgentChoiceCliForm } from '../../agent-launch/choices/agent-launch-choices' import type { AgentType } from '../../agent-status-types' import type { SessionOptionDescriptor, diff --git a/src/shared/agent-session/options/agent-session-option-launch.ts b/src/shared/agent-session/options/agent-session-option-launch.ts index 8bb9b4b0a13..8b2cabe5aff 100644 --- a/src/shared/agent-session/options/agent-session-option-launch.ts +++ b/src/shared/agent-session/options/agent-session-option-launch.ts @@ -2,8 +2,11 @@ import { agentChoiceSettingsOccurrences, rewriteAgentChoiceSettings, readAgentChoiceSettings -} from '../../agent-choice-settings' -import { hasAgentModelOptionValues, yieldAgentChoicesToArgs } from '../../agent-choice-layers' +} from '../../agent-launch/choices/agent-choice-settings' +import { + hasAgentModelOptionValues, + yieldAgentChoicesToArgs +} from '../../agent-launch/choices/agent-choice-layers' import type { AgentType } from '../../agent-status-types' import { findCatalogModel, @@ -15,14 +18,17 @@ import type { CatalogOption } from './agent-session-option-catalog-types' import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-chat-permission-mode' -import { agentPermissionArgsForLaunch } from '../../agent-permission-args' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-launch/permissions/agent-chat-permission-mode' +import { agentPermissionArgsForLaunch } from '../../agent-launch/permissions/agent-permission-args' import { readLaunchPermissionChoice, agentPermissionHasTerminalChoice -} from '../../tui-agent-permission-choice' -import { isTuiAgent } from '../../tui-agent-config' -import { quoteStartupArg, tokenizeStartupCommand } from '../../tui-agent-startup-shell' +} from '../../agent-launch/permissions/tui-agent-permission-choice' +import { isTuiAgent } from '../../agent-launch/catalog/tui-agent-config' +import { + quoteStartupArg, + tokenizeStartupCommand +} from '../../agent-launch/startup/tui-agent-startup-shell' import { decodeCatalogOptionValue } from './structured-agent-session-option-codec' export type ResolvedSessionOptionLaunch = { diff --git a/src/shared/agent-session/options/structured-agent-session-option-view.ts b/src/shared/agent-session/options/structured-agent-session-option-view.ts index c6606aeb711..615acfd4479 100644 --- a/src/shared/agent-session/options/structured-agent-session-option-view.ts +++ b/src/shared/agent-session/options/structured-agent-session-option-view.ts @@ -14,7 +14,7 @@ import { structuredAgentSessionModelId, structuredAgentSessionOwnValue } from './structured-agent-session-option-state' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-launch/permissions/agent-chat-permission-mode' /** Query base or immutable launch seed, with finite controller operations above it. * Display provenance stays separate from accepted input while catalog labels load. */ diff --git a/src/shared/agent-session/options/structured-agent-session-options-write-owner.ts b/src/shared/agent-session/options/structured-agent-session-options-write-owner.ts index cc2427fe5fa..c98d869d87a 100644 --- a/src/shared/agent-session/options/structured-agent-session-options-write-owner.ts +++ b/src/shared/agent-session/options/structured-agent-session-options-write-owner.ts @@ -1,4 +1,4 @@ -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionWriteFailure } from '../failures/agent-session-write-failure' import type { SessionOptionDescriptor, diff --git a/src/shared/agent-session/options/structured-agent-session-options.ts b/src/shared/agent-session/options/structured-agent-session-options.ts index 56827b950b8..cf5bdb6554e 100644 --- a/src/shared/agent-session/options/structured-agent-session-options.ts +++ b/src/shared/agent-session/options/structured-agent-session-options.ts @@ -9,8 +9,8 @@ import { STRUCTURED_LAUNCH_OPTION_IDS, STRUCTURED_LAUNCH_SEED_OPTION_IDS } from '../../native-chat/input/native-chat-session-option-defaults' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-chat-permission-mode' -import { usesInstalledAgentModelCatalog } from '../../agent-model-catalog-ownership' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-launch/permissions/agent-chat-permission-mode' +import { usesInstalledAgentModelCatalog } from './agent-model-catalog-ownership' import { structuredAgentSessionShownModel } from './structured-agent-session-option-snapshot' import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' import type { diff --git a/src/shared/agent-session/options/structured-agent-session-permission-option.ts b/src/shared/agent-session/options/structured-agent-session-permission-option.ts index 5976733d7d2..d152326bba8 100644 --- a/src/shared/agent-session/options/structured-agent-session-permission-option.ts +++ b/src/shared/agent-session/options/structured-agent-session-permission-option.ts @@ -3,8 +3,8 @@ import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID, type AgentChatPermissionMode -} from '../../agent-chat-permission-mode' -import { agentChatPermissionModes } from '../../agent-chat-permission-support' +} from '../../agent-launch/permissions/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../agent-launch/permissions/agent-chat-permission-support' import type { StructuredAgentSessionOptionRecord } from './structured-agent-session-option-state' import type { SessionOptionDescriptor } from '../../native-chat/input/native-chat-session-options' diff --git a/src/shared/agent-status-hooks-setting.ts b/src/shared/agent-status-hooks-setting.ts index 1c2c49feb0c..69236010185 100644 --- a/src/shared/agent-status-hooks-setting.ts +++ b/src/shared/agent-status-hooks-setting.ts @@ -1,6 +1,6 @@ import type { GlobalSettings } from './global-settings-types' -import type { TuiAgent } from './tui-agent' -import { isTuiAgentEnabled } from './tui-agent-selection' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { isTuiAgentEnabled } from './agent-launch/catalog/tui-agent-selection' export type AgentStatusHooksSettings = | Partial> diff --git a/src/shared/agent-status-identity.ts b/src/shared/agent-status-identity.ts index 56a935c901b..6be1543044f 100644 --- a/src/shared/agent-status-identity.ts +++ b/src/shared/agent-status-identity.ts @@ -10,7 +10,7 @@ import { type AgentProcessPresence } from './agent-process-presence' import { resolveCanonicalPaneAgentIdentity } from './pane-agent-identity-adapter' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' type ExistingAgentIdentity = { agentType?: AgentType diff --git a/src/shared/agent-title-name-anchoring.ts b/src/shared/agent-title-name-anchoring.ts index 2711c42cd04..3a81e8fefe7 100644 --- a/src/shared/agent-title-name-anchoring.ts +++ b/src/shared/agent-title-name-anchoring.ts @@ -7,7 +7,7 @@ import { } from './agent-title-core' import { stripLeadingAgentTitleDecorationOrEmpty } from './agent-title-decoration' import type { TerminalAgent } from './terminal-agent' -import { TUI_AGENT_DISPLAY_NAMES } from './tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from './agent-launch/catalog/tui-agent-display-names' /** Names matched as whole tokens, paired with the agent each identifies. */ const NAME_TOKENS: readonly (readonly [string, TerminalAgent])[] = [ diff --git a/src/shared/agent-type-icon-agent.ts b/src/shared/agent-type-icon-agent.ts index 10c07cba1ee..9d8b5dd6738 100644 --- a/src/shared/agent-type-icon-agent.ts +++ b/src/shared/agent-type-icon-agent.ts @@ -1,6 +1,6 @@ import type { AgentType } from './agent-status-types' import type { TerminalAgent } from './terminal-agent' -import { isTuiAgent } from './tui-agent-config' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' const ICONABLE_AGENT_TYPES: Record = { claude: true, diff --git a/src/shared/ai-vault-resume-command.ts b/src/shared/ai-vault-resume-command.ts index d248f70b122..ba6422f8d85 100644 --- a/src/shared/ai-vault-resume-command.ts +++ b/src/shared/ai-vault-resume-command.ts @@ -5,7 +5,7 @@ import { antigravityTranscriptReferencePrompt } from './antigravity-session-origin' import { normalizeAiVaultResumeFilePath } from './ai-vault-resume-path' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' import { clearEnvCommand, commandSeparator, @@ -13,7 +13,7 @@ import { quoteStartupArg, type AgentStartupShell, withoutEnvCommand -} from './tui-agent-startup-shell' +} from './agent-launch/startup/tui-agent-startup-shell' import type { AiVaultAgent, AiVaultSession } from './ai-vault-types' export function buildAiVaultResumeCommand(args: { diff --git a/src/shared/ai-vault-resume-host-startup.ts b/src/shared/ai-vault-resume-host-startup.ts index 29e4d298571..9de2aa50165 100644 --- a/src/shared/ai-vault-resume-host-startup.ts +++ b/src/shared/ai-vault-resume-host-startup.ts @@ -11,7 +11,7 @@ import { } from './ai-vault-resume-startup' import { LOCAL_EXECUTION_HOST_ID } from './execution-host' import { managedDataAccountResumeEnv } from './managed-data-account-resume' -import type { AgentStartupShell } from './tui-agent-startup-shell' +import type { AgentStartupShell } from './agent-launch/startup/tui-agent-startup-shell' /** A remote session resumes on its own host's platform; a local one on the target workspace's. * Local shell settings cannot describe remote Windows hosts, so those keep PowerShell-default quoting. */ diff --git a/src/shared/ai-vault-resume-startup.ts b/src/shared/ai-vault-resume-startup.ts index 7bf3defd728..91d76e24d98 100644 --- a/src/shared/ai-vault-resume-startup.ts +++ b/src/shared/ai-vault-resume-startup.ts @@ -17,15 +17,19 @@ import { resolveTuiAgentLaunchRawArgs, resolveTuiAgentLaunchEnv, type AgentLaunchProfileSettings -} from './tui-agent-launch-defaults' -import { buildAgentResumeStartupPlan } from './tui-agent-startup' +} from './agent-launch/choices/tui-agent-launch-defaults' +import { buildAgentResumeStartupPlan } from './agent-launch/startup/tui-agent-resume-startup' import { quoteStartupArg, resolveStartupShell, tokenizeStartupCommand, type AgentStartupShell -} from './tui-agent-startup-shell' -import { getTuiAgentLaunchCommand, isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +} from './agent-launch/startup/tui-agent-startup-shell' +import { + getTuiAgentLaunchCommand, + isTuiAgent, + TUI_AGENT_CONFIG +} from './agent-launch/catalog/tui-agent-config' import { findOptionOccurrence } from './command-option-occurrence' import { assertOpenCodeCopyUsesLocalStore } from './opencode-launch-command' import { CLI_CONVERSATION_ADOPTING_AGENTS } from './structured-agent-cli-conversation-adoption' diff --git a/src/shared/ai-vault-types.ts b/src/shared/ai-vault-types.ts index 8b073a5f86e..8e86e4dded3 100644 --- a/src/shared/ai-vault-types.ts +++ b/src/shared/ai-vault-types.ts @@ -1,5 +1,5 @@ import type { AiVaultScanIssueText } from './ai-vault-scan-issue-copy' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { AgentSessionAccountHome } from './agent-session/lifecycle/agent-session-account-home' import type { ExecutionHostId, ExecutionHostScope } from './execution-host' diff --git a/src/shared/automation-extra-agent-args-record.ts b/src/shared/automation-extra-agent-args-record.ts index 66f6a39f130..c34814aa5f6 100644 --- a/src/shared/automation-extra-agent-args-record.ts +++ b/src/shared/automation-extra-agent-args-record.ts @@ -3,7 +3,7 @@ import { EXTRA_AGENT_ARGS_REQUIRE_FRESH_SESSION, hasExtraAgentArgs, parseExtraAgentArgs -} from './automation-extra-agent-args' +} from './agent-launch/startup/automation-extra-agent-args' /** Stored form of an extras input: the text unchanged, or `undefined` when it holds no extras. */ export function storedExtraAgentArgs(value: unknown): string | undefined { diff --git a/src/shared/automation-session-reuse.ts b/src/shared/automation-session-reuse.ts index 4b8bd376a63..58661882e61 100644 --- a/src/shared/automation-session-reuse.ts +++ b/src/shared/automation-session-reuse.ts @@ -1,7 +1,7 @@ /** Share previous-agent reuse policy across desktop/headless hosts; callers supply pane status/liveness. */ import type { AgentType } from './agent-status-types' import type { AutomationRun } from './automations-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { WorkspaceRunContext } from './task-source-context' import { parseExecutionHostId } from './execution-host' import { normalizeRuntimePathForComparison } from './cross-platform-path' diff --git a/src/shared/automations-types.ts b/src/shared/automations-types.ts index e830aa482eb..ad87665c9bb 100644 --- a/src/shared/automations-types.ts +++ b/src/shared/automations-types.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { SetupDecision } from './worktree/create-types' import type { TaskSourceContext, WorkspaceRunContext } from './task-source-context' diff --git a/src/shared/claude-agent-view-launch.test.ts b/src/shared/claude-agent-view-launch.test.ts index 5d7f221487d..161389531b7 100644 --- a/src/shared/claude-agent-view-launch.test.ts +++ b/src/shared/claude-agent-view-launch.test.ts @@ -1,6 +1,9 @@ import { expect, it } from 'vitest' import { withClaudeAgentViewPlugin } from './claude-agent-view-launch' -import { tokenizeStartupCommand, type AgentStartupShell } from './tui-agent-startup-shell' +import { + tokenizeStartupCommand, + type AgentStartupShell +} from './agent-launch/startup/tui-agent-startup-shell' it.each(['posix', 'powershell', 'cmd'] as const)( 'preserves existing plugin arguments and prompts in %s', diff --git a/src/shared/claude-agent-view-launch.ts b/src/shared/claude-agent-view-launch.ts index 155e4f10dab..9f543f85073 100644 --- a/src/shared/claude-agent-view-launch.ts +++ b/src/shared/claude-agent-view-launch.ts @@ -1,9 +1,9 @@ -import { findClaudeExecutableIndex } from './agent-resume-launch-command' +import { findClaudeExecutableIndex } from './agent-launch/startup/agent-resume-launch-command' import { quoteStartupArg, tokenizeStartupCommand, type AgentStartupShell -} from './tui-agent-startup-shell' +} from './agent-launch/startup/tui-agent-startup-shell' export function withClaudeAgentViewPlugin( command: string, diff --git a/src/shared/cli-workspace-provenance.ts b/src/shared/cli-workspace-provenance.ts index b9fbaba2b3a..24b072d8e80 100644 --- a/src/shared/cli-workspace-provenance.ts +++ b/src/shared/cli-workspace-provenance.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { CliWorkspaceProvenance } from './worktree/types' /** CLI create context is descriptive; host-stamped createdAt prevents skewed client clocks changing sort order. */ diff --git a/src/shared/codebuddy-agent.test.ts b/src/shared/codebuddy-agent.test.ts index bf2a25bda51..802bb799685 100644 --- a/src/shared/codebuddy-agent.test.ts +++ b/src/shared/codebuddy-agent.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest' import { createHookListenerState } from './agent-hook-listener/listener-state' import { normalizeAndAccept } from './agent-hook-listener-test-harness' import { recognizeAgentProcessFromCommandLine } from './agent-process-recognition' -import { getAgentResumeArgv } from './agent-resume-argv' +import { getAgentResumeArgv } from './agent-launch/startup/agent-resume-argv' describe('CodeBuddy harness', () => { it('replays the live question lifecycle without settling at late SessionStart', () => { diff --git a/src/shared/codex-permission-policy.ts b/src/shared/codex-permission-policy.ts index 977c60016dc..41a9c97f19d 100644 --- a/src/shared/codex-permission-policy.ts +++ b/src/shared/codex-permission-policy.ts @@ -1,4 +1,4 @@ -import type { AgentChatPermissionMode } from './agent-chat-permission-mode' +import type { AgentChatPermissionMode } from './agent-launch/permissions/agent-chat-permission-mode' import type { CodexApprovalsReviewer } from './codex-subagent-reviewer' export type CodexStructuredPermissionPolicy = diff --git a/src/shared/command-environment.test.ts b/src/shared/command-environment.test.ts index 91241a36c0f..5ddb70e46f4 100644 --- a/src/shared/command-environment.test.ts +++ b/src/shared/command-environment.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest' import { extractLeadingEnvAssignments, mergeCommandEnvironment } from './command-environment' -import { planAgentBinary, planCommitMessageGeneration } from './commit-message-plan' +import { planAgentBinary } from './agent-launch/startup/agent-command-plan' +import { planCommitMessageGeneration } from './commit-message-plan' import { planCustomCommand } from './commit-message-prompt' describe('command environment assignments', () => { diff --git a/src/shared/commit-message-agent-spec.ts b/src/shared/commit-message-agent-spec.ts index 65fb2082c0f..371e6cf6f5d 100644 --- a/src/shared/commit-message-agent-spec.ts +++ b/src/shared/commit-message-agent-spec.ts @@ -1,6 +1,6 @@ import { OMP_MODEL_LIST_ARGS, parseOmpModelList } from './omp-model-list-probe' -import type { TuiAgent } from './tui-agent' -import { isTuiAgentEnabled } from './tui-agent-selection' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { isTuiAgentEnabled } from './agent-launch/catalog/tui-agent-selection' import { labelFromModelId } from './model-id-label' import { buildPrimaryCommitMessageAgentSpecs } from './commit-message-agent-specs-primary' import { buildSecondaryCommitMessageAgentSpecs } from './commit-message-agent-specs-secondary' diff --git a/src/shared/commit-message-agent-specs-primary.ts b/src/shared/commit-message-agent-specs-primary.ts index 62e89d02044..d547794df0d 100644 --- a/src/shared/commit-message-agent-specs-primary.ts +++ b/src/shared/commit-message-agent-specs-primary.ts @@ -2,7 +2,7 @@ import { claudeBackgroundArgs, claudeTextGenerationToolArgs } from './claude-background-run-isolation' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { CommitMessageAgentSpec, CommitMessageModel, diff --git a/src/shared/commit-message-agent-specs-secondary.ts b/src/shared/commit-message-agent-specs-secondary.ts index b78f8ab1d45..90ec3cfde5a 100644 --- a/src/shared/commit-message-agent-specs-secondary.ts +++ b/src/shared/commit-message-agent-specs-secondary.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { CommitMessageAgentSpec, CommitMessageModel, diff --git a/src/shared/commit-message-ai-types.ts b/src/shared/commit-message-ai-types.ts index 7a398e1eab5..457cc68dd7d 100644 --- a/src/shared/commit-message-ai-types.ts +++ b/src/shared/commit-message-ai-types.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type CommitMessageAiModelCapability = { id: string diff --git a/src/shared/commit-message-generation.ts b/src/shared/commit-message-generation.ts index fc71a84096d..3531f4ea4f2 100644 --- a/src/shared/commit-message-generation.ts +++ b/src/shared/commit-message-generation.ts @@ -1,5 +1,5 @@ import { cleanGeneratedCommitMessage, truncateDiffForPrompt } from './commit-message-prompt' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type CommitMessageDraftAgent = TuiAgent | 'custom' diff --git a/src/shared/commit-message-plan.test.ts b/src/shared/commit-message-plan.test.ts index a07dab07086..f77d079756d 100644 --- a/src/shared/commit-message-plan.test.ts +++ b/src/shared/commit-message-plan.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { planCommitMessageGeneration, planAgentBinary } from './commit-message-plan' +import { planCommitMessageGeneration } from './commit-message-plan' +import { planAgentBinary } from './agent-launch/startup/agent-command-plan' describe('planCommitMessageGeneration', () => { it('keeps extension-provided Pi models available in generated Git text plans', () => { diff --git a/src/shared/commit-message-plan.ts b/src/shared/commit-message-plan.ts index dcc2775778e..da8c23810c4 100644 --- a/src/shared/commit-message-plan.ts +++ b/src/shared/commit-message-plan.ts @@ -3,8 +3,8 @@ import { type TextGenerationFailureFields } from './text-generation-failure-copy' import { findOptionOccurrence } from './command-option-occurrence' -import { planAgentBinary } from './agent-command-plan' -export { planAgentBinary } from './agent-command-plan' +import { planAgentBinary } from './agent-launch/startup/agent-command-plan' + import type { CommandTemplateBackslash } from './commit-message-prompt' import { getCommitMessageAgentSpec, @@ -18,7 +18,7 @@ import { planAdditionalAgentArgs, compactRecipeOptions } from './commit-message-generation-options' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { mergeOpenCodeGenerationArgs } from './opencode-generation-command' import { buildAntigravityGenerationInput } from './antigravity-generation-stream' diff --git a/src/shared/dashboard-snapshot.ts b/src/shared/dashboard-snapshot.ts index 78d2fd0f85c..b220965c8f3 100644 --- a/src/shared/dashboard-snapshot.ts +++ b/src/shared/dashboard-snapshot.ts @@ -2,7 +2,7 @@ import type { agentVerdictDisplayMark } from './agent-main-agent-verdict' import type { AgentType, AgentWorkingMode } from './agent-status-types' import type { ExecutionHostId } from './execution-host' import type { RepoIcon } from './repo-icon' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Main renderer owns live state and relays structured-clone-safe snapshots through main to the presentation-only pop-out; no functions/class instances. */ diff --git a/src/shared/default-global-settings.ts b/src/shared/default-global-settings.ts index 43d867d4dd9..a06b717b373 100644 --- a/src/shared/default-global-settings.ts +++ b/src/shared/default-global-settings.ts @@ -7,7 +7,7 @@ import { TASK_PROVIDERS } from './task-providers' import { getDefaultSourceControlAiSettings } from './source-control-ai-settings' import { DEFAULT_APP_ICON_ID } from './app-icon' import { DEFAULT_OPEN_IN_APPLICATIONS } from './open-in-applications' -import { DEFAULT_DISABLED_TUI_AGENTS } from './tui-agent-selection' +import { DEFAULT_DISABLED_TUI_AGENTS } from './agent-launch/catalog/tui-agent-selection' import { UI_LANGUAGE_SYSTEM } from './ui-language' import { DEFAULT_LEFT_SIDEBAR_TINT_COLOR, diff --git a/src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts b/src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts index b7a267fd20e..0f2370ca411 100644 --- a/src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts +++ b/src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts @@ -1,7 +1,7 @@ // Replay alt-screen and inline grok startup captures: ~12Hz logo shimmer defeats the 1.5s quiet window, causing 8s timeout delays/dropped drafts. Preserve both marker and quiet-floor paths. import { describe, expect, it } from 'vitest' import { createDraftPasteReadyScanner } from './draft-paste-ready-scanner' -import type { DraftPasteReadySignal } from './tui-agent-config' +import type { DraftPasteReadySignal } from './agent-launch/catalog/tui-agent-config-types' import { GROK_STARTUP_PTY_TRACE, type GrokStartupTraceChunk diff --git a/src/shared/draft-paste-ready-scanner.test.ts b/src/shared/draft-paste-ready-scanner.test.ts index 198e392b1f6..ed3d394cd87 100644 --- a/src/shared/draft-paste-ready-scanner.test.ts +++ b/src/shared/draft-paste-ready-scanner.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { createDraftPasteReadyScanner, resolvePasteReadySignal } from './draft-paste-ready-scanner' import { OPENCODE_AGENT_ROW_GRACE_MS } from './opencode-agent-row-scanner' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' const DECSET_BRACKETED_PASTE = '\x1b[?2004h' const DECRST_BRACKETED_PASTE = '\x1b[?2004l' diff --git a/src/shared/draft-paste-ready-scanner.ts b/src/shared/draft-paste-ready-scanner.ts index e232f4ff915..3161ddaf38d 100644 --- a/src/shared/draft-paste-ready-scanner.ts +++ b/src/shared/draft-paste-ready-scanner.ts @@ -1,4 +1,7 @@ -import type { DraftPasteReadySignal, TuiAgentConfig } from './tui-agent-config' +import type { + DraftPasteReadySignal, + TuiAgentConfig +} from './agent-launch/catalog/tui-agent-config-types' import { createOpenCodeAgentRowScanner } from './opencode-agent-row-scanner' import { createCodexComposerReadyScanner } from './codex-composer-ready-scanner' diff --git a/src/shared/draft-paste-ready-timeout.ts b/src/shared/draft-paste-ready-timeout.ts index 9e964b07c3e..0167f6bdc01 100644 --- a/src/shared/draft-paste-ready-timeout.ts +++ b/src/shared/draft-paste-ready-timeout.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from './tui-agent' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' const DEFAULT_DRAFT_PASTE_READY_TIMEOUT_MS = 8000 diff --git a/src/shared/folder-workspace-types.ts b/src/shared/folder-workspace-types.ts index cd1beca7df9..57002de3337 100644 --- a/src/shared/folder-workspace-types.ts +++ b/src/shared/folder-workspace-types.ts @@ -1,6 +1,6 @@ import type { ExecutionHostId } from './execution-host' import type { TaskSourceContext } from './task-source-context' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { DiffComment } from './diff-comment-types' import type { SmartTier } from './sidebar-list/sort-stamps' import type { OrcadRetainedMarker } from './orcad-retained-marker' diff --git a/src/shared/folder-workspaces.ts b/src/shared/folder-workspaces.ts index 3df1a1de224..9ba8763047f 100644 --- a/src/shared/folder-workspaces.ts +++ b/src/shared/folder-workspaces.ts @@ -1,6 +1,6 @@ import type { FolderWorkspace } from './folder-workspace-types' import type { ProjectGroup } from './project-group-types' -import { isTuiAgent } from './tui-agent-config' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' import { normalizeStoredTaskSourceContext } from './task-source-context' import { normalizeWorkspaceLinkedItem } from './workspace-linked-item' import { isWorkspaceLinkedItemSourceContextMatch } from './workspace-linked-item-source-context' diff --git a/src/shared/global-settings-base.ts b/src/shared/global-settings-base.ts index 6f4cb22d480..9c6c77de79a 100644 --- a/src/shared/global-settings-base.ts +++ b/src/shared/global-settings-base.ts @@ -11,7 +11,7 @@ import type { PluginUpdatePolicySettings } from './plugins/catalog/plugin-update import type { PluginSystemSettings } from './plugins/plugin-system-settings' import type { TerminalScrollSettings } from './terminal-scroll-settings' import type { WorktreeDeletionPreferences } from './worktree-deletion-preferences' -import type { AgentPermissionGlobalSettings } from './tui-agent-permission-choice' +import type { AgentPermissionGlobalSettings } from './agent-launch/permissions/tui-agent-permission-choice' import type { TerminalColorOverrideGlobalSettings } from './terminal-color-overrides' import type { WindowMaterialSettings } from './window-material' import type { EditorSaveSettings } from './editor-save-settings' diff --git a/src/shared/global-settings-test-fixture.ts b/src/shared/global-settings-test-fixture.ts index 01de76b215b..662f4cc6f9d 100644 --- a/src/shared/global-settings-test-fixture.ts +++ b/src/shared/global-settings-test-fixture.ts @@ -1,5 +1,5 @@ import { expect, vi } from 'vitest' -import * as shell from './tui-agent-startup-shell' +import * as shell from './agent-launch/startup/tui-agent-startup-shell' import type { GlobalSettings } from './global-settings-types' import { getDefaultVoiceSettings } from './constants' import { getDefaultNotificationSettings } from './notification-settings-defaults' diff --git a/src/shared/global-settings-types.ts b/src/shared/global-settings-types.ts index 6d1c16c6752..7f4e06ef8e1 100644 --- a/src/shared/global-settings-types.ts +++ b/src/shared/global-settings-types.ts @@ -1,4 +1,4 @@ -import type { AgentLaunchChoices } from './agent-launch-choices' +import type { AgentLaunchChoices } from './agent-launch/choices/agent-launch-choices' import type { TelemetrySettings } from './telemetry-settings-types' import type { BrowserProfileScope } from './browser-profile-scope' import type { GlobalSettingsBase } from './global-settings-base' @@ -17,7 +17,7 @@ import type { TerminalCustomTheme } from './terminal-custom-themes' import type { UiLanguage } from './ui-language' import type { GlobalWindowsRuntimeDefault } from './project-execution-runtime' import type { PersistedNativeChatSessionOptions } from './native-chat/input/native-chat-session-options' -import type { AgentChatPermissionMode } from './agent-chat-permission-mode' +import type { AgentChatPermissionMode } from './agent-launch/permissions/agent-chat-permission-mode' import type { ComputerAwakeMode } from './computer-awake-mode' import type { CommitMessageAiSettings } from './commit-message-ai-types' import type { HostSettingOverrides } from './host-setting-overrides' @@ -30,7 +30,7 @@ import type { import type { NotificationSettings } from './notification-settings-types' import type { CtrlTabOrderMode } from './tab-types' import type { TerminalQuickCommand } from './terminal-quick-command-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { ZcodePlanSite } from './zcode-plan-sites' import type { AgentDashboardMode, diff --git a/src/shared/host-account-launch-env.ts b/src/shared/host-account-launch-env.ts index 8f8fdb4f905..10160b37bc7 100644 --- a/src/shared/host-account-launch-env.ts +++ b/src/shared/host-account-launch-env.ts @@ -1,7 +1,7 @@ /** Desktop-selected accounts are pushed to owned WSL orcad hosts without account services (D10). * Host-originated CLI/orchestration/automation/chat/generation/bare launches use the same per-distro account environment as desktop-originated launches. */ import { z } from 'zod' -import { AgentLaunchAccountEnv } from './agent-launch-account-env' +import { AgentLaunchAccountEnv } from './agent-launch/startup/agent-launch-account-env' export const HostAccountLaunchEnvParams = z .object({ diff --git a/src/shared/keybindings-default-bindings.test.ts b/src/shared/keybindings-default-bindings.test.ts index 1ac780d9741..e6414d34033 100644 --- a/src/shared/keybindings-default-bindings.test.ts +++ b/src/shared/keybindings-default-bindings.test.ts @@ -10,7 +10,7 @@ import { keybindingMatchesAction } from './keybindings' import type { KeybindingActionId } from './keybindings' -import { ALL_TUI_AGENTS } from './tui-agent-display-names' +import { ALL_TUI_AGENTS } from './agent-launch/catalog/tui-agent-display-names' describe('keybindings', () => { it.each([ diff --git a/src/shared/keybindings/definitions.ts b/src/shared/keybindings/definitions.ts index 64198507a8e..cf828eaa29e 100644 --- a/src/shared/keybindings/definitions.ts +++ b/src/shared/keybindings/definitions.ts @@ -1,11 +1,14 @@ -import { ALL_TUI_AGENTS, TUI_AGENT_DISPLAY_NAMES } from '../tui-agent-display-names' +import { + ALL_TUI_AGENTS, + TUI_AGENT_DISPLAY_NAMES +} from '../agent-launch/catalog/tui-agent-display-names' import type { AgentTabActionId, KeybindingActionId, KeybindingDefinition, PluginKeybindingActionId } from './types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { KEYBINDING_DEFINITION_CORE_1 } from './definitions-core-1' import { KEYBINDING_DEFINITION_CORE_2 } from './definitions-core-2' import { KEYBINDING_DEFINITION_CORE_3 } from './definitions-core-3' diff --git a/src/shared/keybindings/types.ts b/src/shared/keybindings/types.ts index dcbac43b096..737bc8284a4 100644 --- a/src/shared/keybindings/types.ts +++ b/src/shared/keybindings/types.ts @@ -1,5 +1,5 @@ import type { KeybindingReasonCode } from './keybinding-diagnostic-copy' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' export type KeybindingScope = | 'global' diff --git a/src/shared/live-resume-anchor-record.ts b/src/shared/live-resume-anchor-record.ts index d6658a4034d..20838ebf31d 100644 --- a/src/shared/live-resume-anchor-record.ts +++ b/src/shared/live-resume-anchor-record.ts @@ -6,7 +6,7 @@ import { isResumableTuiAgent, type SleepingAgentSessionRecord } from './agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from './agent-resume-argv' +import { getAgentResumeArgv } from './agent-launch/startup/agent-resume-argv' import { isPiCompatibleAgentType } from './pi-agent-kind' /** Identify a completed pane’s own live resume anchor written at turn end, not a sleep capture. diff --git a/src/shared/managed-agent-hook-targets.ts b/src/shared/managed-agent-hook-targets.ts index fd339c52eaa..30b49e4a6e0 100644 --- a/src/shared/managed-agent-hook-targets.ts +++ b/src/shared/managed-agent-hook-targets.ts @@ -1,6 +1,9 @@ import { AGENT_HOOK_TARGETS, type AgentHookTarget } from './agent-hook-types' -import { getTuiAgentDetectCommands, TUI_AGENT_CONFIG } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { + getTuiAgentDetectCommands, + TUI_AGENT_CONFIG +} from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type ManagedAgentHookTarget = { agent: AgentHookTarget diff --git a/src/shared/native-chat/every-agent-chat.test-fixture.ts b/src/shared/native-chat/every-agent-chat.test-fixture.ts index 86f76cc16ea..52441b36a0a 100644 --- a/src/shared/native-chat/every-agent-chat.test-fixture.ts +++ b/src/shared/native-chat/every-agent-chat.test-fixture.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_CONFIG } from '../tui-agent-config' +import { TUI_AGENT_CONFIG } from '../agent-launch/catalog/tui-agent-config' /** Every known agent saved to open as a chat, since an agent without a saved choice opens its CLI. */ export const EVERY_AGENT_CHAT: Readonly> = Object.fromEntries( diff --git a/src/shared/native-chat/input/native-chat-launch-draft-mirrorability.ts b/src/shared/native-chat/input/native-chat-launch-draft-mirrorability.ts index 39d693e00d4..d6b74cb492c 100644 --- a/src/shared/native-chat/input/native-chat-launch-draft-mirrorability.ts +++ b/src/shared/native-chat/input/native-chat-launch-draft-mirrorability.ts @@ -1,4 +1,4 @@ -import { countAgentTuiInputLines } from '../../agent-tui-input-clear' +import { countAgentTuiInputLines } from '../../agent-launch/startup/agent-tui-input-clear' /** Longest draft mirrored into chat; a send past the 15-line clear burst relies on the desktop's confirmed second burst. */ const LAUNCH_DRAFT_MIRROR_MAX_LINES = 40 diff --git a/src/shared/native-chat/input/native-chat-session-option-defaults.ts b/src/shared/native-chat/input/native-chat-session-option-defaults.ts index 45fe26b5701..616072ba3ad 100644 --- a/src/shared/native-chat/input/native-chat-session-option-defaults.ts +++ b/src/shared/native-chat/input/native-chat-session-option-defaults.ts @@ -1,12 +1,12 @@ -import { resolveAgentChoiceLayers } from '../../agent-choice-layers' -import { isTuiAgent } from '../../tui-agent-config' +import { resolveAgentChoiceLayers } from '../../agent-launch/choices/agent-choice-layers' +import { isTuiAgent } from '../../agent-launch/catalog/tui-agent-config' import type { AgentType } from '../../agent-status-types' import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID, isAgentChatPermissionChoice, newChatPermissionModeForSettings, type NewChatPermissionSettings -} from '../../agent-chat-permission-mode' +} from '../../agent-launch/permissions/agent-chat-permission-mode' import type { GlobalSettings } from '../../global-settings-types' import { findCatalogModel, diff --git a/src/shared/native-chat/input/native-chat-session-option-snapshot.ts b/src/shared/native-chat/input/native-chat-session-option-snapshot.ts index a3a119efcce..14583553824 100644 --- a/src/shared/native-chat/input/native-chat-session-option-snapshot.ts +++ b/src/shared/native-chat/input/native-chat-session-option-snapshot.ts @@ -1,4 +1,4 @@ -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../agent-launch/permissions/agent-chat-permission-mode' import { labelFromModelId } from '../../model-id-label' import type { AgentSessionOptionCatalog, diff --git a/src/shared/native-chat/native-chat-agent-support.ts b/src/shared/native-chat/native-chat-agent-support.ts index 4220a883a31..3bb274dc148 100644 --- a/src/shared/native-chat/native-chat-agent-support.ts +++ b/src/shared/native-chat/native-chat-agent-support.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' export type NativeChatTranscriptAgent = 'claude' | 'codex' | 'grok' | 'omp' | 'opencode' diff --git a/src/shared/native-chat/native-chat-availability.ts b/src/shared/native-chat/native-chat-availability.ts index 43e38304443..bd7b5f1e5f7 100644 --- a/src/shared/native-chat/native-chat-availability.ts +++ b/src/shared/native-chat/native-chat-availability.ts @@ -1,5 +1,5 @@ import type { Tab } from '../tab-types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { AgentType } from '../agent-status-types' import { isNativeChatSupportedAgent, diff --git a/src/shared/native-chat/native-chat-providers.ts b/src/shared/native-chat/native-chat-providers.ts index 5928779c016..884c8dd0e31 100644 --- a/src/shared/native-chat/native-chat-providers.ts +++ b/src/shared/native-chat/native-chat-providers.ts @@ -1,7 +1,7 @@ // Persist the default surface independently from per-agent overrides. import type { GlobalSettings } from '../global-settings-types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { isStructuredAgentId } from '../agent-session/lifecycle/agent-session-provider-handle-encoding' import type { AgentDefaultSurface } from './native-chat-appearance-settings' diff --git a/src/shared/opencode-headless-command.test.ts b/src/shared/opencode-headless-command.test.ts index 09d243a4bcf..27008fb3db9 100644 --- a/src/shared/opencode-headless-command.test.ts +++ b/src/shared/opencode-headless-command.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' +import { tokenizeStartupCommand } from './agent-launch/startup/tui-agent-startup-shell' import { tokenizeCommandLine } from './agent-command-line-entrypoint' import { isOpenCodeRunCommand } from './opencode-headless-command' diff --git a/src/shared/opencode-headless-command.ts b/src/shared/opencode-headless-command.ts index 766d70642fa..5242a8e2081 100644 --- a/src/shared/opencode-headless-command.ts +++ b/src/shared/opencode-headless-command.ts @@ -1,6 +1,6 @@ import { extractLeadingEnvAssignments } from './command-environment' import { getCommandTokenPathBasename } from './command-token-scanner' -import type { AgentStartupShell } from './tui-agent-startup-shell' +import type { AgentStartupShell } from './agent-launch/startup/tui-agent-startup-shell' const RUN_VALUE_FLAGS = new Set([ '--log-level', diff --git a/src/shared/opencode-launch-command.ts b/src/shared/opencode-launch-command.ts index 0480f677afd..410289c35b0 100644 --- a/src/shared/opencode-launch-command.ts +++ b/src/shared/opencode-launch-command.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from './tui-agent' -import { getAgentLaunchExecutableName } from './agent-command-line-intent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { getAgentLaunchExecutableName } from './agent-launch/startup/agent-command-line-intent' import { findOptionOccurrence } from './command-option-occurrence' export class OpenCodeCopyServerRouteError extends Error { diff --git a/src/shared/orca-cli-command-name.test.ts b/src/shared/orca-cli-command-name.test.ts index 8e9f87e0fae..047997175a8 100644 --- a/src/shared/orca-cli-command-name.test.ts +++ b/src/shared/orca-cli-command-name.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { installFakeAppEnvironment } from '../../config/scripts/vitest-host-ports-setup' -import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from './tui-agent-config' +import { getTuiAgentLaunchCommand, TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' const agentTeams = TUI_AGENT_CONFIG['claude-agent-teams'] diff --git a/src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts b/src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts index 9b689528ed0..be3ea9a63d9 100644 --- a/src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts +++ b/src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts @@ -1,5 +1,5 @@ import { assertAutomationExtraAgentArgs } from '../automation-extra-agent-args-record' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import type { Automation, AutomationRun } from '../automations-types' import { getAutomationRunRepoId } from '../automation-run-identity' import { diff --git a/src/shared/orchestration-dispatch-refusal-contract.ts b/src/shared/orchestration-dispatch-refusal-contract.ts index 0c171a018cf..2bfd1825422 100644 --- a/src/shared/orchestration-dispatch-refusal-contract.ts +++ b/src/shared/orchestration-dispatch-refusal-contract.ts @@ -1,4 +1,4 @@ -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' // Share refusal envelopes across runtime/CLI; retain call-site messages because older consumers may match published strings. diff --git a/src/shared/orchestration-worker-start-prompt-budget.ts b/src/shared/orchestration-worker-start-prompt-budget.ts index 2a7e566f088..17963d87bb2 100644 --- a/src/shared/orchestration-worker-start-prompt-budget.ts +++ b/src/shared/orchestration-worker-start-prompt-budget.ts @@ -1,4 +1,4 @@ -import { getMaxTerminalPasteBytesForIngestMs } from './agent-prompt-injection' +import { getMaxTerminalPasteBytesForIngestMs } from './agent-launch/startup/agent-prompt-injection' import { AGENT_PROMPT_EFFECT_TIMEOUT_MS, ORCHESTRATION_WORKER_START_CLIENT_GRACE_MS diff --git a/src/shared/pane-agent-identity-adapter.ts b/src/shared/pane-agent-identity-adapter.ts index d465092cdd8..3839d2b26ab 100644 --- a/src/shared/pane-agent-identity-adapter.ts +++ b/src/shared/pane-agent-identity-adapter.ts @@ -8,7 +8,7 @@ import type { } from './pane-agent-identity-resolver' import type { PaneAgentEvidenceSource } from './pane-agent-evidence-sources' import type { TerminalAgent } from './terminal-agent' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** All adapters delegate here so ranking, ambiguity and run eligibility cannot drift. */ diff --git a/src/shared/pi-agent-kind.ts b/src/shared/pi-agent-kind.ts index 22e3d260abf..a75823229c9 100644 --- a/src/shared/pi-agent-kind.ts +++ b/src/shared/pi-agent-kind.ts @@ -1,7 +1,7 @@ -import { isFreshOmpLaunchCommand } from './omp-fresh-launch' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import { isFreshOmpLaunchCommand } from './agent-launch/startup/omp-fresh-launch' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' import { getCommandTokenPathBasename, getFirstCommandToken } from './command-token-scanner' -import { extractAgentLaunchCommand } from './agent-command-line-intent' +import { extractAgentLaunchCommand } from './agent-launch/startup/agent-command-line-intent' /** Pi-compatible agents share PI_CODING_AGENT_DIR and extension APIs but have separate user directories. * Never cross-fallback: switching agents must not shadow the other agent’s extensions. */ diff --git a/src/shared/plugins/workers/plugin-host-api-workspace-methods.ts b/src/shared/plugins/workers/plugin-host-api-workspace-methods.ts index 24c73363fce..eb4b62a9ea1 100644 --- a/src/shared/plugins/workers/plugin-host-api-workspace-methods.ts +++ b/src/shared/plugins/workers/plugin-host-api-workspace-methods.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { isTuiAgent } from '../../tui-agent-config' +import { isTuiAgent } from '../../agent-launch/catalog/tui-agent-config' import { PLUGIN_COMMAND_ALIAS_ACTION_IDS } from '../contributions/plugin-command-actions' import { spec, WORKER_ONLY } from './plugin-host-method-spec' diff --git a/src/shared/powershell-native-argument.windows.test.ts b/src/shared/powershell-native-argument.windows.test.ts index cdd5ec306ae..fbd4cdb6d86 100644 --- a/src/shared/powershell-native-argument.windows.test.ts +++ b/src/shared/powershell-native-argument.windows.test.ts @@ -3,8 +3,8 @@ import { getDefaultSettings } from './constants' import { saveSourceControlActionRecipe } from './source-control-ai-recipe-save' import { resolveSourceControlActionRecipe } from './source-control-ai-operation-policy' import { projectSourceControlActionLaunch } from './source-control-action-launch-preferences' -import { resolveAgentStartupPlanInputs } from './agent-startup-plan-inputs' -import { buildAgentStartupPlan } from './tui-agent-startup' +import { resolveAgentStartupPlanInputs } from './agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from './agent-launch/startup/tui-agent-startup' import { spawnSync } from 'node:child_process' import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' diff --git a/src/shared/protocol-version.ts b/src/shared/protocol-version.ts index 17639c78166..a07e2e65eb3 100644 --- a/src/shared/protocol-version.ts +++ b/src/shared/protocol-version.ts @@ -1,5 +1,5 @@ import { ACCOUNT_RUNTIME_CAPABILITIES } from './account-runtime-capabilities' -import * as agentLaunchCapabilities from './agent-launch-runtime-capability' +import * as agentLaunchCapabilities from './agent-launch/contracts/agent-launch-runtime-capability' import { AGENT_SESSION_BOUNDARY_RUNTIME_CAPABILITY, AGENT_SESSION_RUNTIME_CAPABILITIES diff --git a/src/shared/published-pane-agent-identity.ts b/src/shared/published-pane-agent-identity.ts index 1f6bb35a8e8..abb1f12ed18 100644 --- a/src/shared/published-pane-agent-identity.ts +++ b/src/shared/published-pane-agent-identity.ts @@ -1,7 +1,7 @@ import { collectAgentTitleEvidence } from './agent-title-evidence' import { resolvePaneAgentIdentity } from './pane-agent-identity-resolver' import type { TerminalAgent } from './terminal-agent' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Publish one host identity decision for routing/delivery/UI. Live hooks identify launcher-, shell- and resume-started agents. * Strict parsed titles remain the final fallback for hand-started WSL panes lacking launch/process/hooks (Windows sees wsl.exe); diff --git a/src/shared/qoder-agent.test.ts b/src/shared/qoder-agent.test.ts index 169ded8199c..bf5389959f7 100644 --- a/src/shared/qoder-agent.test.ts +++ b/src/shared/qoder-agent.test.ts @@ -11,8 +11,9 @@ import { normalizeTerminalTitle, detectAgentStatusFromTitle } from './agent-detection' -import { buildAgentStartupPlan, buildAgentResumeStartupPlan } from './tui-agent-startup' -import { getAgentResumeArgv } from './agent-resume-argv' +import { buildAgentStartupPlan } from './agent-launch/startup/tui-agent-startup' +import { buildAgentResumeStartupPlan } from './agent-launch/startup/tui-agent-resume-startup' +import { getAgentResumeArgv } from './agent-launch/startup/agent-resume-argv' import { createHookListenerState } from './agent-hook-listener/listener-state' import { normalizeAndAccept } from './agent-hook-listener-test-harness' diff --git a/src/shared/require-tui-agent-config.test.ts b/src/shared/require-tui-agent-config.test.ts index a399fffd954..5b2a2aa4752 100644 --- a/src/shared/require-tui-agent-config.test.ts +++ b/src/shared/require-tui-agent-config.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { requireTuiAgentConfig } from './require-tui-agent-config' describe('requireTuiAgentConfig', () => { diff --git a/src/shared/require-tui-agent-config.ts b/src/shared/require-tui-agent-config.ts index 329484e19b8..8e65edb8026 100644 --- a/src/shared/require-tui-agent-config.ts +++ b/src/shared/require-tui-agent-config.ts @@ -1,5 +1,6 @@ -import type { TuiAgent } from './tui-agent' -import { isTuiAgent, TUI_AGENT_CONFIG, type TuiAgentConfig } from './tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { isTuiAgent, TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgentConfig } from './agent-launch/catalog/tui-agent-config-types' /** Persisted agent IDs can outlive branch builds; name unknown IDs instead of throwing an unreadable property-access error. */ export function requireTuiAgentConfig(agent: TuiAgent): TuiAgentConfig { diff --git a/src/shared/rpc-contract/agent-launch-params-account-env.test.ts b/src/shared/rpc-contract/agent-launch-params-account-env.test.ts index 3c9093b385e..078c89c680d 100644 --- a/src/shared/rpc-contract/agent-launch-params-account-env.test.ts +++ b/src/shared/rpc-contract/agent-launch-params-account-env.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { AgentLaunch } from './agent-launch-params' -import { computeAgentLaunchFingerprint } from '../agent-launch-operation' +import { computeAgentLaunchFingerprint } from '../agent-launch/contracts/agent-launch-operation' const BASE = { agent: 'claude', target: { kind: 'existing', worktree: 'id:wt-1' } } const ACCOUNT_ENV = { diff --git a/src/shared/rpc-contract/agent-launch-params-native-chat-default.test.ts b/src/shared/rpc-contract/agent-launch-params-native-chat-default.test.ts index c1664bab17f..cb1852be476 100644 --- a/src/shared/rpc-contract/agent-launch-params-native-chat-default.test.ts +++ b/src/shared/rpc-contract/agent-launch-params-native-chat-default.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { AgentLaunch, AgentLaunchReplay } from './agent-launch-params' -import { computeAgentLaunchFingerprint } from '../agent-launch-operation' +import { computeAgentLaunchFingerprint } from '../agent-launch/contracts/agent-launch-operation' const BASE = { agent: 'claude', target: { kind: 'existing', worktree: 'id:wt-1' } } const OPERATION_ID = '1760000000000-0123456789abcdef0123456789abcdef' diff --git a/src/shared/rpc-contract/agent-launch-params.pre-observation.test-fixture.ts b/src/shared/rpc-contract/agent-launch-params.pre-observation.test-fixture.ts index e5db5af3372..0ffa20e5ff7 100644 --- a/src/shared/rpc-contract/agent-launch-params.pre-observation.test-fixture.ts +++ b/src/shared/rpc-contract/agent-launch-params.pre-observation.test-fixture.ts @@ -2,21 +2,21 @@ /** Shared agent.launch schema lets remote clients use typed RpcSendParams. * The host honors an explicit surface or refuses it; migrated worktree.create startup-agent fields are stripped. */ -import { AGENT_LAUNCH_SURFACES } from '../agent-launch-surface' +import { AGENT_LAUNCH_SURFACES } from '../agent-launch/contracts/agent-launch-surface' import { z } from 'zod' import { isAgentSessionOptions } from '../agent-session/lifecycle/agent-session-record' import { parseAgentSessionOperationTimestamp } from '../agent-session/agent-session-host-authority' import { parsePaneKey } from '../stable-pane-id' import { isValidHostTerminalTabId } from '../terminal-tab-id' -import { isTuiAgent } from '../tui-agent-config' -import type { TuiAgent } from '../tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { WorktreeCreate } from './worktree-create-params.pre-observation.test-fixture' import { FolderWorkspaceCreate } from './folder-workspace-params' import { LaunchSourceParam } from './launch-source-param' import { TerminalTabIdParam } from './agent-session-params' import { SessionId } from './structured-agent-session-params' import { isStructuredAgentSessionIdFor } from '../agent-session/structured-agent-session-create' -import { AgentLaunchAccountEnv } from '../agent-launch-account-env' +import { AgentLaunchAccountEnv } from '../agent-launch/startup/agent-launch-account-env' const LaunchAgent = z.custom(isTuiAgent, { message: 'Unknown TUI agent' }) diff --git a/src/shared/rpc-contract/agent-launch-params.ts b/src/shared/rpc-contract/agent-launch-params.ts index 535c456b705..1d5d11e0def 100644 --- a/src/shared/rpc-contract/agent-launch-params.ts +++ b/src/shared/rpc-contract/agent-launch-params.ts @@ -1,21 +1,21 @@ /** Shared agent.launch schema lets remote clients use typed RpcSendParams. * The host honors an explicit surface or refuses it; migrated worktree.create startup-agent fields are stripped. */ -import { AGENT_LAUNCH_SURFACES } from '../agent-launch-surface' +import { AGENT_LAUNCH_SURFACES } from '../agent-launch/contracts/agent-launch-surface' import { z } from 'zod' import { isAgentSessionOptions } from '../agent-session/lifecycle/agent-session-record' import { parseAgentSessionOperationTimestamp } from '../agent-session/agent-session-host-authority' import { parsePaneKey } from '../stable-pane-id' import { isValidHostTerminalTabId } from '../terminal-tab-id' -import { isTuiAgent } from '../tui-agent-config' -import type { TuiAgent } from '../tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { WorktreeCreate } from './worktree-create-params' import { FolderWorkspaceCreate } from './folder-workspace-params' import { LaunchSourceParam } from './launch-source-param' import { TerminalTabIdParam } from './agent-session-params' import { SessionId } from './structured-agent-session-params' import { isStructuredAgentSessionIdFor } from '../agent-session/structured-agent-session-create' -import { AgentLaunchAccountEnv } from '../agent-launch-account-env' +import { AgentLaunchAccountEnv } from '../agent-launch/startup/agent-launch-account-env' const LaunchAgent = z.custom(isTuiAgent, { message: 'Unknown TUI agent' }) diff --git a/src/shared/rpc-contract/agent-launch-settings-params.ts b/src/shared/rpc-contract/agent-launch-settings-params.ts index 95786fa1ed1..954fa8cf2d9 100644 --- a/src/shared/rpc-contract/agent-launch-settings-params.ts +++ b/src/shared/rpc-contract/agent-launch-settings-params.ts @@ -1,7 +1,7 @@ import { z } from 'zod' -import { isTuiAgent } from '../tui-agent-config' -import { AGENT_PERMISSION_CHOICES } from '../tui-agent-permission-choice' -import type { TuiAgent } from '../tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' +import { AGENT_PERMISSION_CHOICES } from '../agent-launch/permissions/tui-agent-permission-choice' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' const Agent = z.custom((value) => typeof value === 'string' && isTuiAgent(value)) const Value = z diff --git a/src/shared/rpc-contract/agent-session-params.ts b/src/shared/rpc-contract/agent-session-params.ts index 2482a9c040b..4f3e6058901 100644 --- a/src/shared/rpc-contract/agent-session-params.ts +++ b/src/shared/rpc-contract/agent-session-params.ts @@ -4,16 +4,16 @@ import { RESUMABLE_TUI_AGENTS, hasUnsafeProviderSessionIdChars } from '../agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from '../agent-resume-argv' -import { AGENT_EFFORT_LEVEL } from '../agent-effort-level' +import { getAgentResumeArgv } from '../agent-launch/startup/agent-resume-argv' +import { AGENT_EFFORT_LEVEL } from '../agent-launch/choices/agent-effort-level' import { parseAgentSessionOperationTimestamp, type RuntimeCreateAgentSessionRequest, type RuntimeEnsureAgentSessionRequest } from '../agent-session/agent-session-host-authority' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { RESTORE_SPAWN_INTENTS } from '../host-spawn-admission' -import { AgentLaunchAccountEnv } from '../agent-launch-account-env' +import { AgentLaunchAccountEnv } from '../agent-launch/startup/agent-launch-account-env' export const MAX_WORKTREE_SELECTOR_LENGTH = 32_768 diff --git a/src/shared/rpc-contract/automation-params.ts b/src/shared/rpc-contract/automation-params.ts index 0b5aa104f4e..e077dc85cec 100644 --- a/src/shared/rpc-contract/automation-params.ts +++ b/src/shared/rpc-contract/automation-params.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { OptionalBoolean, OptionalPlainString, diff --git a/src/shared/rpc-contract/client-settings-params.ts b/src/shared/rpc-contract/client-settings-params.ts index da220bc24d1..e1d51e0ba40 100644 --- a/src/shared/rpc-contract/client-settings-params.ts +++ b/src/shared/rpc-contract/client-settings-params.ts @@ -1,16 +1,16 @@ import { z } from 'zod' import { isTaskProvider } from '../task-providers' import type { TaskProvider } from '../task-providers' -import { isTuiAgent } from '../tui-agent-config' -import { normalizeDisabledTuiAgents } from '../tui-agent-selection' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' +import { normalizeDisabledTuiAgents } from '../agent-launch/catalog/tui-agent-selection' import { normalizeTuiAgentArgsRecord, normalizeTuiAgentEnvRecord -} from '../tui-agent-launch-defaults' +} from '../agent-launch/choices/tui-agent-launch-defaults' import { MACHINE_NAME_MAX_LENGTH } from '../machine-name' import { normalizePRBotAuthorOverrides } from '../pr-bot-author-overrides' import { WorktreeVisibilityDefaultsUpdate } from './worktree-visibility-defaults-params' -import { AGENT_CHAT_PERMISSION_MODES } from '../agent-chat-permission-mode' +import { AGENT_CHAT_PERMISSION_MODES } from '../agent-launch/permissions/agent-chat-permission-mode' export const TaskProviderParam = z.custom(isTaskProvider, { message: 'Unknown task provider' diff --git a/src/shared/rpc-contract/folder-workspace-params.ts b/src/shared/rpc-contract/folder-workspace-params.ts index 57128672c6e..b4314c302ce 100644 --- a/src/shared/rpc-contract/folder-workspace-params.ts +++ b/src/shared/rpc-contract/folder-workspace-params.ts @@ -3,7 +3,7 @@ import { WorkspaceLinkedItemSchema } from '../workspace-linked-item-schema' import { WorkspaceAttachmentsSchema } from '../workspace-attachment-schema' import { TaskSourceContextSchema } from '../task-source-context-schema' import { isWorkspaceLinkedItemSourceContextMatch } from '../workspace-linked-item-source-context' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { OptionalFiniteNumber, OptionalString, requiredString } from './rpc-param-primitives' import { DiffCommentSchema } from '../diff-comment-schema' diff --git a/src/shared/rpc-contract/preflight-params.ts b/src/shared/rpc-contract/preflight-params.ts index 57ac1c0fef0..c624b06d574 100644 --- a/src/shared/rpc-contract/preflight-params.ts +++ b/src/shared/rpc-contract/preflight-params.ts @@ -3,7 +3,7 @@ import { FLOATING_TERMINAL_WORKTREE_ID } from '../constants' import { parseRoutableExecutionHostId } from '../execution-host' import { OptionalExecutionHostId } from './worktree-params' import { RepoSelector } from './github-repo-target-params' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { WorkspaceLaunchKind } from '../workspace-launch-kind' import type { ProjectExecutionRuntimeResolution } from '../project-execution-runtime' diff --git a/src/shared/rpc-contract/session-tabs-schemas-params.ts b/src/shared/rpc-contract/session-tabs-schemas-params.ts index 0cbf8598fba..4523c31cb77 100644 --- a/src/shared/rpc-contract/session-tabs-schemas-params.ts +++ b/src/shared/rpc-contract/session-tabs-schemas-params.ts @@ -3,8 +3,8 @@ import { RUNTIME_NAVIGATION_TARGETS } from '../runtime-navigation' import { TAB_ACTIVATION_INTENTS } from '../tab-activation-intent' import { OptionalBoolean } from './rpc-param-primitives' import { sleepingAgentLaunchConfigSchema } from '../workspace-session-sleeping-agents' -import type { TuiAgent } from '../tui-agent' -import { isTuiAgent } from '../tui-agent-config' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { LEGACY_MAX_QUICK_COMMAND_AGENT_PROMPT_LENGTH } from '../terminal-quick-command-prompt-limit' import { ResumeProviderSessionParam, WindowsShellOverrideParam } from './terminal-unary-params' diff --git a/src/shared/rpc-contract/terminal-unary-params.ts b/src/shared/rpc-contract/terminal-unary-params.ts index 9e2facba83a..dacbbc16a9e 100644 --- a/src/shared/rpc-contract/terminal-unary-params.ts +++ b/src/shared/rpc-contract/terminal-unary-params.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import { TERMINAL_KITTY_FILE_MAX_BYTES } from '../terminal-kitty-file' import { OptionalFiniteNumber, OptionalString, requiredString } from './rpc-param-primitives' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { SpawnIntentParam } from './agent-session-params' import { canonicalizeWindowsShellOverride, diff --git a/src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts b/src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts index 8555fdd336c..5784b52ec75 100644 --- a/src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts +++ b/src/shared/rpc-contract/workspace-layout-terminal-tab-params.ts @@ -1,8 +1,8 @@ import { z } from 'zod' import { isTerminalLeafId } from '../stable-pane-id' import { isValidHostTerminalTabId } from '../terminal-tab-id' -import type { TuiAgent } from '../tui-agent' -import { isTuiAgent } from '../tui-agent-config' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' const workspace = z.string().min(1) diff --git a/src/shared/rpc-contract/worktree-create-params.pre-observation.test-fixture.ts b/src/shared/rpc-contract/worktree-create-params.pre-observation.test-fixture.ts index 1a3e1601a39..78b9823705b 100644 --- a/src/shared/rpc-contract/worktree-create-params.pre-observation.test-fixture.ts +++ b/src/shared/rpc-contract/worktree-create-params.pre-observation.test-fixture.ts @@ -6,7 +6,7 @@ import { TaskSourceContextSchema } from '../task-source-context-schema' import { workspaceSourceSchema } from '../telemetry-events' import { RUNTIME_NAVIGATION_TARGETS } from '../runtime-navigation' import { sleepingAgentLaunchConfigSchema } from '../workspace-session-sleeping-agents' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { LaunchSourceParam } from './launch-source-param' import { OptionalBoolean, diff --git a/src/shared/rpc-contract/worktree-create-params.ts b/src/shared/rpc-contract/worktree-create-params.ts index cfdaea9b60e..ac9e21bc880 100644 --- a/src/shared/rpc-contract/worktree-create-params.ts +++ b/src/shared/rpc-contract/worktree-create-params.ts @@ -5,7 +5,7 @@ import { TaskSourceContextSchema } from '../task-source-context-schema' import { workspaceSourceSchema } from '../telemetry-events' import { RUNTIME_NAVIGATION_TARGETS } from '../runtime-navigation' import { sleepingAgentLaunchConfigSchema } from '../workspace-session-sleeping-agents' -import { isTuiAgent } from '../tui-agent-config' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { LaunchSourceParam } from './launch-source-param' import { OptionalBoolean, diff --git a/src/shared/rpc-contract/worktree-params.ts b/src/shared/rpc-contract/worktree-params.ts index f85e3a4ea24..9603a5b0103 100644 --- a/src/shared/rpc-contract/worktree-params.ts +++ b/src/shared/rpc-contract/worktree-params.ts @@ -1,8 +1,8 @@ import { z } from 'zod' import { normalizeExecutionHostId } from '../execution-host' import { CLIENT_PROVENANCE_SNAPSHOT_MAX } from '../automation-workspace-provenance' -import { isTuiAgent } from '../tui-agent-config' -import type { TuiAgent } from '../tui-agent' +import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { OptionalBoolean, OptionalFiniteNumber, diff --git a/src/shared/runtime-mobile-session-tab-contracts.ts b/src/shared/runtime-mobile-session-tab-contracts.ts index 462d4008f43..38916061032 100644 --- a/src/shared/runtime-mobile-session-tab-contracts.ts +++ b/src/shared/runtime-mobile-session-tab-contracts.ts @@ -3,7 +3,7 @@ import type { BrowserCertificateFailure, BrowserLoadError } from './browser-work import type { RuntimeBrowserPlacement } from './runtime-browser-placement' import type { TerminalColorOverrides } from './terminal-color-overrides' import type { TerminalLayoutSnapshot, TerminalTab } from './terminal-tab-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { StructuredAgentId } from './agent-session/lifecycle/agent-session-provider-handle' export type RuntimeMobileSessionTerminalTab = { diff --git a/src/shared/runtime-session-contracts.ts b/src/shared/runtime-session-contracts.ts index 7335d1ec83a..94ef9392e7a 100644 --- a/src/shared/runtime-session-contracts.ts +++ b/src/shared/runtime-session-contracts.ts @@ -18,7 +18,7 @@ import type { } from './runtime-mobile-session-tab-contracts' import type { CliStatusCaller } from './orchestration-caller-status' import type { RuntimeHostDescriptor } from './runtime-host-descriptor' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type * from './runtime-mobile-session-tab-contracts' diff --git a/src/shared/runtime-terminal-contracts.ts b/src/shared/runtime-terminal-contracts.ts index 2a4c3e647c5..699373e9536 100644 --- a/src/shared/runtime-terminal-contracts.ts +++ b/src/shared/runtime-terminal-contracts.ts @@ -1,6 +1,6 @@ import type { TerminalLaunchResult } from './agent-session/lifecycle/agent-session-resume' import type * as AgentSessionResume from './agent-session/lifecycle/agent-session-resume' -import type { StartupCommandDelivery } from './codex-startup-delivery' +import type { StartupCommandDelivery } from './agent-launch/startup/codex-startup-delivery' import type { ExecutionHostId } from './execution-host' import type { PtyIncarnationId } from './pty-incarnation' import type { PtyLivenessVerdict } from './pty-liveness-verdict' @@ -9,7 +9,8 @@ import type { RuntimeMobileSessionTabsResult } from './runtime-session-contracts import type { TabGroupLayoutNode } from './tab-types' import type { TerminalExitCause } from './terminal-exit-cause' import type { TerminalPaneLayoutNode } from './terminal-tab-types' -import type { TerminalAgent, TuiAgent } from './terminal-agent' +import type { TerminalAgent } from './terminal-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type { RuntimeTerminalSend, RuntimeTerminalPromptStage, diff --git a/src/shared/skill-install-providers.ts b/src/shared/skill-install-providers.ts index 56bbed1d676..653e207f7ed 100644 --- a/src/shared/skill-install-providers.ts +++ b/src/shared/skill-install-providers.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Null segments use canonical .agents/skills without a separate placement; IDs match detected Orca agents. */ type SkillInstallProviderEntry = { diff --git a/src/shared/skills-cli-agent-keys.ts b/src/shared/skills-cli-agent-keys.ts index 0b548a7756d..f86cbbb7a9c 100644 --- a/src/shared/skills-cli-agent-keys.ts +++ b/src/shared/skills-cli-agent-keys.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Community skills --agent keys differ from Orca IDs (claude-code, rovodev, augment). * Unknown mappings are null because guessed keys abort installation; aider-desk and openclaw are different products. */ diff --git a/src/shared/source-control-action-argument-choices.ts b/src/shared/source-control-action-argument-choices.ts index 86610405c0d..db41cc79ae9 100644 --- a/src/shared/source-control-action-argument-choices.ts +++ b/src/shared/source-control-action-argument-choices.ts @@ -1,14 +1,17 @@ import { editActionArgumentChoicePreferences } from './source-control-action-choice-preferences' export { editActionArgumentChoicePreferences } from './source-control-action-choice-preferences' -import { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import type { AgentChoicePatch, AgentDedicatedChoices } from './agent-launch-choices' +import { reconcileAgentChoiceArgsDetailed } from './agent-launch/choices/agent-choice-reconciliation' +import type { + AgentChoicePatch, + AgentDedicatedChoices +} from './agent-launch/choices/agent-launch-choices' import { actionModelSelectionChoices, normalizeActionModelSelection, readActionModelSelection } from './source-control-action-model-selection' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { ActionModelSelection, SourceControlActionRecipe } from './source-control-ai-actions' import { diff --git a/src/shared/source-control-action-argument-document.ts b/src/shared/source-control-action-argument-document.ts index 362058f5657..c1ad711e4b8 100644 --- a/src/shared/source-control-action-argument-document.ts +++ b/src/shared/source-control-action-argument-document.ts @@ -1,10 +1,10 @@ -import { analyzeAgentChoiceArgs } from './agent-choice-args' -import { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import type { AgentDedicatedChoices } from './agent-launch-choices' -import { PERMISSION_LAUNCH_GRAMMARS } from './agent-permission-args' -import { tokenizeStartupCommand } from './tui-agent-startup-shell' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { analyzeAgentChoiceArgs } from './agent-launch/choices/agent-choice-args' +import { reconcileAgentChoiceArgsDetailed } from './agent-launch/choices/agent-choice-reconciliation' +import type { AgentDedicatedChoices } from './agent-launch/choices/agent-launch-choices' +import { PERMISSION_LAUNCH_GRAMMARS } from './agent-launch/permissions/agent-permission-args' +import { tokenizeStartupCommand } from './agent-launch/startup/tui-agent-startup-shell' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { SourceControlActionRecipe } from './source-control-ai-actions' export type ActionArgumentChoices = { diff --git a/src/shared/source-control-action-choice-preferences.ts b/src/shared/source-control-action-choice-preferences.ts index 52a1e855d3e..4a18732a21c 100644 --- a/src/shared/source-control-action-choice-preferences.ts +++ b/src/shared/source-control-action-choice-preferences.ts @@ -1,9 +1,12 @@ -import type { AgentChoicePatch, AgentDedicatedChoices } from './agent-launch-choices' +import type { + AgentChoicePatch, + AgentDedicatedChoices +} from './agent-launch/choices/agent-launch-choices' import { normalizeActionModelSelection, readActionModelSelection } from './source-control-action-model-selection' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { ActionModelSelection, SourceControlActionRecipe } from './source-control-ai-actions' /** Fold accepted choice effects into this recipe owner without rewriting another source. */ diff --git a/src/shared/source-control-action-launch-preferences.ts b/src/shared/source-control-action-launch-preferences.ts index 60f699278c1..277e7d50e79 100644 --- a/src/shared/source-control-action-launch-preferences.ts +++ b/src/shared/source-control-action-launch-preferences.ts @@ -1,6 +1,9 @@ -import { projectAgentLaunchInputViews } from './agent-launch-profile' -import { reconcileAgentChoiceArgsDetailed } from './agent-choice-reconciliation' -import type { AgentDedicatedChoices, AgentLaunchInputViews } from './agent-launch-choices' +import { projectAgentLaunchInputViews } from './agent-launch/choices/agent-launch-profile' +import { reconcileAgentChoiceArgsDetailed } from './agent-launch/choices/agent-choice-reconciliation' +import type { + AgentDedicatedChoices, + AgentLaunchInputViews +} from './agent-launch/choices/agent-launch-choices' import { sourceControlActionRecipeEntry, type SelectedSourceControlActionRecipe @@ -11,21 +14,21 @@ import { lowerActionArgumentChoices } from './source-control-action-argument-choices' import { actionModelSelectionChoices } from './source-control-action-model-selection' -import { normalizeAgentModelOptionChoices } from './agent-launch-choices' +import { normalizeAgentModelOptionChoices } from './agent-launch/choices/agent-launch-choices' import type { ExecutionHostId } from './execution-host' import { resolveTuiAgentLaunchRawArgs, type AgentLaunchProfileSettings -} from './tui-agent-launch-defaults' +} from './agent-launch/choices/tui-agent-launch-defaults' import { getAgentSessionOptionLaunchCatalog } from './agent-session/options/agent-session-option-catalog' import { renderSourceControlActionCommandTemplate, type SourceControlActionRecipe } from './source-control-ai-actions' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' -import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from './agent-chat-permission-mode' -import { agentPermissionChoices } from './tui-agent-permission-choice' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from './agent-launch/permissions/agent-chat-permission-mode' +import { agentPermissionChoices } from './agent-launch/permissions/tui-agent-permission-choice' export { sourceControlActionAgentPicksModel, diff --git a/src/shared/source-control-action-model-selection.ts b/src/shared/source-control-action-model-selection.ts index 710e35e8929..8e4f88ae30d 100644 --- a/src/shared/source-control-action-model-selection.ts +++ b/src/shared/source-control-action-model-selection.ts @@ -1,10 +1,10 @@ import { normalizeAgentModelOptionChoices, type AgentDedicatedChoices -} from './agent-launch-choices' -import { agentPermissionChoices } from './tui-agent-permission-choice' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +} from './agent-launch/choices/agent-launch-choices' +import { agentPermissionChoices } from './agent-launch/permissions/tui-agent-permission-choice' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { ActionChoiceValue, ActionModelSelection, diff --git a/src/shared/source-control-action-options.ts b/src/shared/source-control-action-options.ts index c3eb1255d53..0344d97a218 100644 --- a/src/shared/source-control-action-options.ts +++ b/src/shared/source-control-action-options.ts @@ -1,5 +1,5 @@ -import type { TuiAgent } from './tui-agent' -import { isTuiAgent } from './tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' import { isAgentSessionHandleProvider } from './agent-session/lifecycle/agent-session-provider-handle' import { STRUCTURED_LAUNCH_SEED_OPTION_IDS } from './native-chat/input/native-chat-session-option-defaults' import { @@ -11,7 +11,7 @@ import type { CatalogOption } from './agent-session/options/agent-session-option import { agentPermissionHasTerminalChoice, type AgentPermissionChoice -} from './tui-agent-permission-choice' +} from './agent-launch/permissions/tui-agent-permission-choice' /** Agents whose model an action can pick: the ones whose session catalog lists models. */ export function sourceControlActionAgentPicksModel( diff --git a/src/shared/source-control-action-permission-lift.ts b/src/shared/source-control-action-permission-lift.ts index a8bfd829a31..6ea65314fd9 100644 --- a/src/shared/source-control-action-permission-lift.ts +++ b/src/shared/source-control-action-permission-lift.ts @@ -1,4 +1,4 @@ -import { isTuiAgent } from './tui-agent-config' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' import { normalizeActionArgumentDocument, reconcileActionArgumentDocument diff --git a/src/shared/source-control-action-selection.ts b/src/shared/source-control-action-selection.ts index cb26133c11d..bf076df0a97 100644 --- a/src/shared/source-control-action-selection.ts +++ b/src/shared/source-control-action-selection.ts @@ -14,8 +14,8 @@ import { actionModelSelectionChoices, readActionModelSelection } from './source-control-action-model-selection' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' type CurrentActionSource = { authoredAgentId: SourceControlActionRecipe['agentId'] diff --git a/src/shared/source-control-ai-action-model-choice.ts b/src/shared/source-control-ai-action-model-choice.ts index da8af8b5e77..85da4d87909 100644 --- a/src/shared/source-control-ai-action-model-choice.ts +++ b/src/shared/source-control-ai-action-model-choice.ts @@ -10,7 +10,7 @@ import { toSourceControlAiRepoUpdate } from './source-control-ai-recipe-save' import type { GlobalSettings } from './global-settings-types' import type { Repo } from './repo-types' import type { AiTextOperation, SourceControlAiModelChoice } from './source-control-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { CommandTemplateBackslash } from './commit-message-prompt' type ActionModelChoiceInput = { diff --git a/src/shared/source-control-ai-action-model-edits.test.ts b/src/shared/source-control-ai-action-model-edits.test.ts index 48a62d76d3a..02e46cc2a0b 100644 --- a/src/shared/source-control-ai-action-model-edits.test.ts +++ b/src/shared/source-control-ai-action-model-edits.test.ts @@ -9,7 +9,7 @@ import { import type { GlobalSettings } from './global-settings-types' import { getDefaultSourceControlAiSettings } from './source-control-ai-settings' import type { SourceControlAiModelChoice } from './source-control-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' type Edit = { agentId: TuiAgent; change: SourceControlAiModelEdit } diff --git a/src/shared/source-control-ai-action-model-edits.ts b/src/shared/source-control-ai-action-model-edits.ts index 06c169d2bbd..d467f090a51 100644 --- a/src/shared/source-control-ai-action-model-edits.ts +++ b/src/shared/source-control-ai-action-model-edits.ts @@ -6,7 +6,7 @@ import type { SourceControlAiWriteTarget } from './source-control-ai-recipe-save import type { GlobalSettings } from './global-settings-types' import type { Repo } from './repo-types' import type { AiTextOperation, SourceControlAiModelChoice } from './source-control-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type SourceControlAiModelEdit = | { field: 'model'; value: string | undefined } diff --git a/src/shared/source-control-ai-actions.ts b/src/shared/source-control-ai-actions.ts index 1c6596b545f..962137af15e 100644 --- a/src/shared/source-control-ai-actions.ts +++ b/src/shared/source-control-ai-actions.ts @@ -5,9 +5,9 @@ import { type ActionArgumentChoices } from './source-control-action-argument-choices' import { isCustomAgentId, type CustomAgentId } from './commit-message-agent-spec' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' -import type { AgentPermissionChoice } from './tui-agent-permission-choice' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import type { AgentPermissionChoice } from './agent-launch/permissions/tui-agent-permission-choice' import { isRecord, normalizeSourceControlActionLaunchPreferences, diff --git a/src/shared/source-control-ai-command-template.ts b/src/shared/source-control-ai-command-template.ts index 9eeea239e67..8597cc1d4a9 100644 --- a/src/shared/source-control-ai-command-template.ts +++ b/src/shared/source-control-ai-command-template.ts @@ -6,7 +6,7 @@ import { type SourceControlActionRecipe } from './source-control-ai-actions' import type { AiTextOperation, SourceControlAiSettings } from './source-control-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export function commandTemplateFromInstruction(instruction: string | null | undefined): string { const trimmed = instruction?.trim() diff --git a/src/shared/source-control-ai-legacy-reconciliation.ts b/src/shared/source-control-ai-legacy-reconciliation.ts index 1da4fd43619..20aad78126c 100644 --- a/src/shared/source-control-ai-legacy-reconciliation.ts +++ b/src/shared/source-control-ai-legacy-reconciliation.ts @@ -9,7 +9,7 @@ import { import { projectSourceControlAiToLegacyCommitMessageAi } from './source-control-ai-legacy-projection' import { normalizeSourceControlAiSettings } from './source-control-ai-settings' import type { SourceControlAiModelChoice, SourceControlAiSettings } from './source-control-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' type LegacyCoreChanges = Record< 'enabled' | 'agentId' | 'customPrompt' | 'customAgentCommand', diff --git a/src/shared/source-control-ai-model-selection.ts b/src/shared/source-control-ai-model-selection.ts index c0815ecf7a5..d347fca7063 100644 --- a/src/shared/source-control-ai-model-selection.ts +++ b/src/shared/source-control-ai-model-selection.ts @@ -3,7 +3,7 @@ import type { CommitMessageAiModelCapability } from './commit-message-ai-types' import { LOCAL_COMMIT_MESSAGE_HOST_KEY } from './commit-message-host-key' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { RepoSourceControlAiOverrides, SourceControlAiModelChoice, diff --git a/src/shared/source-control-ai-operation-policy.ts b/src/shared/source-control-ai-operation-policy.ts index 3895ff11b19..ae84151ab69 100644 --- a/src/shared/source-control-ai-operation-policy.ts +++ b/src/shared/source-control-ai-operation-policy.ts @@ -25,7 +25,7 @@ import type { SourceControlAiSettings } from './source-control-ai-types' import type { CustomAgentId } from './commit-message-agent-spec' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' function readRepoInstructionOverride( instructions: RepoSourceControlAiOverrides['instructionsByOperation'], diff --git a/src/shared/source-control-ai-repo-settings.ts b/src/shared/source-control-ai-repo-settings.ts index c8c4130c713..df93ce96201 100644 --- a/src/shared/source-control-ai-repo-settings.ts +++ b/src/shared/source-control-ai-repo-settings.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { SOURCE_CONTROL_ACTION_IDS, SOURCE_CONTROL_LAUNCH_ACTION_IDS, diff --git a/src/shared/source-control-ai-types.ts b/src/shared/source-control-ai-types.ts index 87265c8d360..7353d6d7892 100644 --- a/src/shared/source-control-ai-types.ts +++ b/src/shared/source-control-ai-types.ts @@ -1,5 +1,5 @@ import type { CommitMessageAiModelCapability } from './commit-message-ai-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { CustomAgentId } from './commit-message-agent-spec' import type { SourceControlAiActionDefaults, diff --git a/src/shared/source-control-ai.ts b/src/shared/source-control-ai.ts index 90c0e14d180..90220f39113 100644 --- a/src/shared/source-control-ai.ts +++ b/src/shared/source-control-ai.ts @@ -14,7 +14,7 @@ import { } from './text-generation-failure-copy' import type { GlobalSettings } from './global-settings-types' import type { Repo } from './repo-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { mergeLegacyCommitMessageAiIntoSourceControlAi as mergeLegacySettings } from './source-control-ai-legacy-reconciliation' import { projectSourceControlAiToLegacyCommitMessageAi as projectLegacySettings } from './source-control-ai-legacy-projection' import { diff --git a/src/shared/source-control-launch-agent-selection.ts b/src/shared/source-control-launch-agent-selection.ts index 7c298bcfd6a..bf1f53074b1 100644 --- a/src/shared/source-control-launch-agent-selection.ts +++ b/src/shared/source-control-launch-agent-selection.ts @@ -4,10 +4,13 @@ import { resolveSourceControlActionRecipe } from './source-control-ai' import type { SourceControlActionId, SourceControlActionRecipe } from './source-control-ai-actions' -import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from './tui-agent-selection' +import { + filterEnabledTuiAgents, + TUI_AGENT_AUTO_PICK_ORDER +} from './agent-launch/catalog/tui-agent-selection' import type { GlobalSettings } from './global-settings-types' import type { Repo } from './repo-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export function readSourceControlLaunchRecipeAgentId( recipe: Pick | null | undefined diff --git a/src/shared/startup-command-staging.node-pty.test.ts b/src/shared/startup-command-staging.node-pty.test.ts index d0a5434be9e..6f7be7571c5 100644 --- a/src/shared/startup-command-staging.node-pty.test.ts +++ b/src/shared/startup-command-staging.node-pty.test.ts @@ -16,7 +16,7 @@ import { afterAll, describe, expect, it } from 'vitest' import { resolveFishBinary } from './fish-binary-requirement' import { stageStartupCommand } from './startup-command-staging' import { buildStartupCommandSubmission } from './startup-command-submission' -import { quoteStartupArg } from './tui-agent-startup-shell' +import { quoteStartupArg } from './agent-launch/startup/tui-agent-startup-shell' type LiveShell = { name: string; path: string; args: string[] } diff --git a/src/shared/startup-command-staging.ts b/src/shared/startup-command-staging.ts index f5040696339..d81de06e02c 100644 --- a/src/shared/startup-command-staging.ts +++ b/src/shared/startup-command-staging.ts @@ -5,7 +5,7 @@ import { readdirSync, rmSync, statSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { hasControlByte, TYPED_STARTUP_LINE_PROMPT_BUDGET_BYTES } from './startup-line-prompt-carry' -import { quoteStartupArg } from './tui-agent-startup-shell' +import { quoteStartupArg } from './agent-launch/startup/tui-agent-startup-shell' export const STAGED_STARTUP_COMMAND_PREFIX = 'orca-launch-' diff --git a/src/shared/startup-line-prompt-carry.test.ts b/src/shared/startup-line-prompt-carry.test.ts index 7426267a9b3..ebe823dcf4a 100644 --- a/src/shared/startup-line-prompt-carry.test.ts +++ b/src/shared/startup-line-prompt-carry.test.ts @@ -5,7 +5,7 @@ import { TYPED_STARTUP_LINE_PROMPT_BUDGET_BYTES, ZSH_MULTI_LINE_STARTUP_LINE_BUDGET_BYTES } from './startup-line-prompt-carry' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' function offer( agent: TuiAgent, diff --git a/src/shared/startup-line-prompt-carry.ts b/src/shared/startup-line-prompt-carry.ts index b5612e8b39d..e920e8087b3 100644 --- a/src/shared/startup-line-prompt-carry.ts +++ b/src/shared/startup-line-prompt-carry.ts @@ -3,9 +3,12 @@ * startup-line-typed-length.live-shell.test.ts measures real shells through the ready barrier, including config beyond its 1.5s cap; * only zsh preserved multiline input in both timings, with short individual lines. Long zsh lines still failed. */ -import { TUI_AGENT_CONFIG } from './tui-agent-config' -import { buildAgentStartupPlan, type AgentStartupPlan } from './tui-agent-startup' -import type { TuiAgent } from './tui-agent' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' +import { + buildAgentStartupPlan, + type AgentStartupPlan +} from './agent-launch/startup/tui-agent-startup' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' /** Half of macOS MAX_CANON: a single typed line this long survived every canonical-mode write * measured, and 1 KiB did not. Also the cap on each line of a multi-line one. */ diff --git a/src/shared/startup-shell-portability.live-shell.test.ts b/src/shared/startup-shell-portability.live-shell.test.ts index aece9712fda..51d27d32f25 100644 --- a/src/shared/startup-shell-portability.live-shell.test.ts +++ b/src/shared/startup-shell-portability.live-shell.test.ts @@ -6,7 +6,11 @@ import { tmpdir } from 'node:os' import path from 'node:path' import { afterAll, describe, expect, it } from 'vitest' import { fishRequirementViolation, resolveFishBinary } from './fish-binary-requirement' -import { clearEnvCommand, quoteStartupArg, withoutEnvCommand } from './tui-agent-startup-shell' +import { + clearEnvCommand, + quoteStartupArg, + withoutEnvCommand +} from './agent-launch/startup/tui-agent-startup-shell' const FISH = resolveFishBinary(4) diff --git a/src/shared/structured-native-chat-launch-route.ts b/src/shared/structured-native-chat-launch-route.ts index 85666ddcd17..11c03ff8f3c 100644 --- a/src/shared/structured-native-chat-launch-route.ts +++ b/src/shared/structured-native-chat-launch-route.ts @@ -9,7 +9,7 @@ import { } from './agent-session/agent-session-runtime-capabilities' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from './agent-session/structured-agent-session-surface-capabilities' import type { AgentDefaultSurface } from './native-chat/native-chat-appearance-settings' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { WorkspaceLaunchKind } from './workspace-launch-kind' /** Keyed by agent id so host-registered agents outside `TuiAgent` read the same preference. */ diff --git a/src/shared/synthetic-agent-title.ts b/src/shared/synthetic-agent-title.ts index ed3ef9741ec..5f9232177b2 100644 --- a/src/shared/synthetic-agent-title.ts +++ b/src/shared/synthetic-agent-title.ts @@ -1,5 +1,5 @@ import type { AgentStatusState, AgentType } from './agent-status-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { getPiCompatibleSyntheticAgentStatus } from './pi-compatible-synthetic-title' export type SyntheticAgentTitleProfile = { diff --git a/src/shared/tab-agent-from-signals.ts b/src/shared/tab-agent-from-signals.ts index 3661d358f25..75bdd3931c8 100644 --- a/src/shared/tab-agent-from-signals.ts +++ b/src/shared/tab-agent-from-signals.ts @@ -7,7 +7,7 @@ import { import { isOpenCodeNativeTitle } from './opencode-terminal-title' import { resolvePaneAgentOwnerRecord } from './pane-agent-owner' import type { TerminalAgent } from './terminal-agent' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { agentTypeToIconAgent } from './agent-type-icon-agent' /** diff --git a/src/shared/terminal-agent.ts b/src/shared/terminal-agent.ts index ede9549e18b..f1e9c33cbf8 100644 --- a/src/shared/terminal-agent.ts +++ b/src/shared/terminal-agent.ts @@ -1,5 +1,4 @@ -import type { TuiAgent } from './tui-agent' -export type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' // Why: recognizing a manually started agent must not register an Orca launcher. export type TerminalAgent = TuiAgent | 'dsb' diff --git a/src/shared/terminal-attachment-launch-result.ts b/src/shared/terminal-attachment-launch-result.ts index 9992ddaed9e..c68e5562411 100644 --- a/src/shared/terminal-attachment-launch-result.ts +++ b/src/shared/terminal-attachment-launch-result.ts @@ -3,8 +3,8 @@ import type { SleepingAgentLaunchConfig, TerminalLaunchResult } from './agent-session/lifecycle/agent-session-resume' -import { isTuiAgent } from './tui-agent-config' -import type { TuiAgent } from './tui-agent' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import { ResumeProviderSessionParam } from './rpc-contract/terminal-unary-params' import { sleepingAgentLaunchConfigBaseSchema } from './workspace-session-sleeping-agents' diff --git a/src/shared/terminal-git-credential-guard.ts b/src/shared/terminal-git-credential-guard.ts index 50d5c3a3201..001b17eb2a4 100644 --- a/src/shared/terminal-git-credential-guard.ts +++ b/src/shared/terminal-git-credential-guard.ts @@ -1,4 +1,4 @@ -import { recognizeAgentLaunchCommand } from './agent-command-line-intent' +import { recognizeAgentLaunchCommand } from './agent-launch/startup/agent-command-line-intent' import { gitCredentialPromptGuardEnv } from './git-credential-prompt-env' const GIT_CONFIG_PROTOCOL_KEY_RE = /^GIT_CONFIG_(?:COUNT|KEY_\d+|VALUE_\d+)$/ diff --git a/src/shared/terminal-quick-command-types.ts b/src/shared/terminal-quick-command-types.ts index a887f47b84d..2ae6fb38b29 100644 --- a/src/shared/terminal-quick-command-types.ts +++ b/src/shared/terminal-quick-command-types.ts @@ -1,4 +1,4 @@ -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' export type TerminalQuickCommandScope = | { diff --git a/src/shared/terminal-quick-commands.ts b/src/shared/terminal-quick-commands.ts index a121e224ffc..ee6f2f505e1 100644 --- a/src/shared/terminal-quick-commands.ts +++ b/src/shared/terminal-quick-commands.ts @@ -1,4 +1,4 @@ -import { isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +import { isTuiAgent, TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' import type { TerminalAgentQuickCommand, TerminalCommandQuickCommand, diff --git a/src/shared/terminal-tab-types.ts b/src/shared/terminal-tab-types.ts index 411c5f56782..89c61388fa5 100644 --- a/src/shared/terminal-tab-types.ts +++ b/src/shared/terminal-tab-types.ts @@ -1,6 +1,6 @@ import type { AiVaultSessionTitle } from './ai-vault-session-title' -import type { TuiAgent } from './tui-agent' -import type { AgentLaunchPaneOutcome } from './agent-launch-pane-verdict' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import type { AgentLaunchPaneOutcome } from './agent-launch/contracts/agent-launch-pane-verdict' /** The tab row owns the recovery ledger, including the last reason it acted on. */ export type TerminalPaneRecoveryReason = diff --git a/src/shared/tui-agent-rest-signal.ts b/src/shared/tui-agent-rest-signal.ts index a5a784aa49e..236fbb848ec 100644 --- a/src/shared/tui-agent-rest-signal.ts +++ b/src/shared/tui-agent-rest-signal.ts @@ -1,7 +1,7 @@ import { detectAgentStatusFromTitle } from './agent-title-status' import { getSyntheticAgentTerminalTitle } from './synthetic-agent-title' -import type { TuiAgent } from './tui-agent' -import { TUI_AGENT_CONFIG } from './tui-agent-config' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' +import { TUI_AGENT_CONFIG } from './agent-launch/catalog/tui-agent-config' /** Strongest trusted rest evidence: profile-authorized hook-done (DSH), hook-driven synthetic title, classified identity title, or ready-body (Muse/Qoder). * none falls back to quiet foreground. Hook working vetoes rest, but hook done proves it only when profile.hooks permits; Qoder idle titles alone can hide a trust menu. */ diff --git a/src/shared/windows-terminal-shell.ts b/src/shared/windows-terminal-shell.ts index d27d850e45e..9a462c14633 100644 --- a/src/shared/windows-terminal-shell.ts +++ b/src/shared/windows-terminal-shell.ts @@ -1,4 +1,4 @@ -import type { AgentStartupShell } from './tui-agent-startup-shell' +import type { AgentStartupShell } from './agent-launch/startup/tui-agent-startup-shell' export const WINDOWS_GIT_BASH_SHELL = 'git-bash' diff --git a/src/shared/workspace-launch-kind.ts b/src/shared/workspace-launch-kind.ts index 4df63cb5c91..70baa54ec24 100644 --- a/src/shared/workspace-launch-kind.ts +++ b/src/shared/workspace-launch-kind.ts @@ -1,6 +1,6 @@ /** Derive launch kind from the resolved workspace ID on renderer and host. Floating has no backing row, uses its own directory setting and stays local; never trust caller-supplied kind. */ -import type { AgentLaunchTarget } from './agent-launch-intent' +import type { AgentLaunchTarget } from './agent-launch/contracts/agent-launch-intent' import { FLOATING_TERMINAL_WORKTREE_ID } from './constants' import { parseWorkspaceKey } from './workspace-scope' diff --git a/src/shared/workspace-session-schema.ts b/src/shared/workspace-session-schema.ts index 481114bb0f3..3a5b007dde9 100644 --- a/src/shared/workspace-session-schema.ts +++ b/src/shared/workspace-session-schema.ts @@ -9,12 +9,12 @@ import { closedTerminalPaneSchema } from './closed-terminal-panes' import { closedTerminalTabTombstoneSchema } from './closed-terminal-tab-tombstones' import type { WorkspaceKey } from './folder-workspace-types' import type { TabGroupLayoutNode } from './tab-types' -import type { TuiAgent } from './tui-agent' +import type { TuiAgent } from './agent-launch/catalog/tui-agent' import type { WorkspaceSessionState } from './workspace-session-state-types' import { terminalTabIdSchema } from './terminal-tab-id-schema' import { terminalSurfaceTombstoneSchema } from './terminal-surface-tombstone-schema' import { parseExecutionHostId, type ExecutionHostId } from './execution-host' -import { isTuiAgent } from './tui-agent-config' +import { isTuiAgent } from './agent-launch/catalog/tui-agent-config' import { isWorkspaceKey } from './workspace-scope' import { browserHistoryEntriesSchema, diff --git a/src/shared/workspace-session-sleeping-agents.ts b/src/shared/workspace-session-sleeping-agents.ts index 57ac3689473..4874ef6597f 100644 --- a/src/shared/workspace-session-sleeping-agents.ts +++ b/src/shared/workspace-session-sleeping-agents.ts @@ -1,10 +1,10 @@ import { z } from 'zod' -import { getAgentResumeArgv } from './agent-resume-argv' +import { getAgentResumeArgv } from './agent-launch/startup/agent-resume-argv' import { normalizeAgentProviderSession, RESUMABLE_TUI_AGENTS } from './agent-session/lifecycle/agent-session-resume' -import { AGENT_EFFORT_LEVEL } from './agent-effort-level' +import { AGENT_EFFORT_LEVEL } from './agent-launch/choices/agent-effort-level' import { isValidTerminalTabId } from './terminal-tab-id' import { normalizeMainAgentStatusField } from './agent-status-types' import { salvagingRecord } from './zod-salvage' diff --git a/src/shared/worktree/create-types.ts b/src/shared/worktree/create-types.ts index 4ca22c02629..0d34abd43d1 100644 --- a/src/shared/worktree/create-types.ts +++ b/src/shared/worktree/create-types.ts @@ -4,7 +4,7 @@ import type { ArchiveHookOverride } from './archive-hook-removal-gate' import type { WorkspaceSource } from '../workspace-source' import type { TaskSourceContext } from '../task-source-context' import type { WorkspaceKey } from '../folder-workspace-types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { AutomationWorkspaceProvenanceRequest, GitPushTarget, diff --git a/src/shared/worktree/launch-types.ts b/src/shared/worktree/launch-types.ts index 6b7e3403bff..ca7ce130435 100644 --- a/src/shared/worktree/launch-types.ts +++ b/src/shared/worktree/launch-types.ts @@ -1,9 +1,9 @@ -import type { StartupCommandDelivery } from '../codex-startup-delivery' +import type { StartupCommandDelivery } from '../agent-launch/startup/codex-startup-delivery' import type { AgentKind, LaunchSource, RequestKind } from '../telemetry-events' import type { SleepingAgentLaunchConfig } from '../agent-session/lifecycle/agent-session-resume' import type { SetupRunnerShell } from '../setup-runner-command' import type { OrcaDefaultTabTemplate } from '../orca-yaml-hook-types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' export type WorktreeSetupLaunch = { runnerScriptPath: string diff --git a/src/shared/worktree/meta-types.ts b/src/shared/worktree/meta-types.ts index 8a13ef54724..ac39b80af69 100644 --- a/src/shared/worktree/meta-types.ts +++ b/src/shared/worktree/meta-types.ts @@ -10,7 +10,7 @@ import type { WorkspaceAttachment, WorkspaceStatus } from './types' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { OrcaWorkspaceLayout } from '../global-settings-types' import type { DiffComment, MobileDiffReviewState } from '../diff-comment-types' import type { SmartTier } from '../sidebar-list/sort-stamps' diff --git a/src/shared/worktree/types.ts b/src/shared/worktree/types.ts index fcdd03397e5..da94dc89053 100644 --- a/src/shared/worktree/types.ts +++ b/src/shared/worktree/types.ts @@ -2,7 +2,7 @@ import type { ExecutionHostId } from '../execution-host' import type { WorktreeCatalogVersion } from './catalog-version' import type { AutomationExecutionTargetType } from '../automations-types' import type { TaskSourceContext } from '../task-source-context' -import type { TuiAgent } from '../tui-agent' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { DiffComment, MobileDiffReviewState } from '../diff-comment-types' import type { EphemeralVmCheckoutMode } from '../orca-yaml-hook-types' import type { BuiltInWorktreeVisibilitySourceId } from '../repo-types' diff --git a/src/shared/zcode-orchestration-contract.test.ts b/src/shared/zcode-orchestration-contract.test.ts index daa05e1a181..aad91b41730 100644 --- a/src/shared/zcode-orchestration-contract.test.ts +++ b/src/shared/zcode-orchestration-contract.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { buildAgentStartupPlan } from './tui-agent-startup' +import { buildAgentStartupPlan } from './agent-launch/startup/tui-agent-startup' describe('ZCode orchestration and send-to-agent contract', () => { it('keeps the prompt out of the launch command and hands it back as a follow-up', () => { diff --git a/src/wsl-guest/plugin-overlay.ts b/src/wsl-guest/plugin-overlay.ts index 29d134e902f..819c009d347 100644 --- a/src/wsl-guest/plugin-overlay.ts +++ b/src/wsl-guest/plugin-overlay.ts @@ -7,7 +7,7 @@ import { OPENCODE_STARTUP_PROMPT_PLUGIN_DIRECTORY } from '../shared/opencode-startup-prompt-install' import { resolveOpenCodeConfigDirectory } from '../shared/opencode-config-directory' -import { materializeOmpFreshConfig } from '../shared/omp-fresh-config' +import { materializeOmpFreshConfig } from '../shared/agent-launch/startup/omp-fresh-config' // Install remotely because host paths and Electron services are unavailable to the relay. // Receive plugin source at session-ready: relay and desktop update independently, so bundled copies could stay stale. import { createHash } from 'node:crypto' diff --git a/tests/e2e/agent-launch-cli.unit.test.ts b/tests/e2e/agent-launch-cli.unit.test.ts index 3ee215ae553..5a4f742ec40 100644 --- a/tests/e2e/agent-launch-cli.unit.test.ts +++ b/tests/e2e/agent-launch-cli.unit.test.ts @@ -2,7 +2,7 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import type { StructuredAgentSessionFirstMessage } from '../../src/shared/agent-session/structured-agent-session-create' import { openTestAgentSessionRecordStore } from '../../src/main/runtime/agent-session/records/agent-session-record-store-test-harness' import { closeTestJournalHostDatabase } from '../../src/main/native-chat/agent-session-journal/journal-host-database-test-support' diff --git a/tests/e2e/agent-launch-setup-choice.unit.test.ts b/tests/e2e/agent-launch-setup-choice.unit.test.ts index dc8b9af8787..108ef978b61 100644 --- a/tests/e2e/agent-launch-setup-choice.unit.test.ts +++ b/tests/e2e/agent-launch-setup-choice.unit.test.ts @@ -9,7 +9,7 @@ import { } from '../../src/cli/runtime-client' import { createWorktreeWithAgent } from '../../src/cli/handlers/worktree-create-agent-launch' import { formatCliError } from '../../src/cli/cli-error' -import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { WorktreeCreateSetupChoiceRefusedError } from '../../src/main/runtime/worktree-create-setup-choice-refusal' import { openTestAgentSessionRecordStore } from '../../src/main/runtime/agent-session/records/agent-session-record-store-test-harness' import { closeTestJournalHostDatabase } from '../../src/main/native-chat/agent-session-journal/journal-host-database-test-support' diff --git a/tests/e2e/codex-ctrl-c-status.spec.ts b/tests/e2e/codex-ctrl-c-status.spec.ts index 40ed4542d3c..b7f6e7c1530 100644 --- a/tests/e2e/codex-ctrl-c-status.spec.ts +++ b/tests/e2e/codex-ctrl-c-status.spec.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { buildShellCommandFromArgv, resolveStartupShell -} from '../../src/shared/tui-agent-startup-shell' +} from '../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../src/shared/windows-terminal-shell' import { test, expect } from './helpers/orca-app' import { emitCodexHookStatus, readHookEndpoint } from './helpers/agent-hook-endpoint' diff --git a/tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts b/tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts index 899b0d78f29..f1bffc10bce 100644 --- a/tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts +++ b/tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts @@ -1,6 +1,6 @@ -import { tokenizeStartupCommand } from '../../../src/shared/tui-agent-startup-shell' -import * as startupInputs from '../../../src/shared/agent-startup-plan-inputs' -import { resolveBaselineAgentStartupPlanInputs } from '../../../src/shared/agent-startup-plan-inputs-baseline-test-fixture' +import { tokenizeStartupCommand } from '../../../src/shared/agent-launch/startup/tui-agent-startup-shell' +import * as startupInputs from '../../../src/shared/agent-launch/startup/agent-startup-plan-inputs' +import { resolveBaselineAgentStartupPlanInputs } from '../../../src/shared/agent-launch/startup/agent-startup-plan-inputs-baseline-test-fixture' import { OrcaRuntimeService, getDefaultWorkspaceSession @@ -17,11 +17,11 @@ import { RpcDispatcher } from '../../../src/main/runtime/rpc/dispatcher' import { SESSION_TAB_METHODS } from '../../../src/main/runtime/rpc/methods/session-tabs' import { TERMINAL_LIFECYCLE_METHODS } from '../../../src/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods' import { AGENT_SESSION_METHODS } from '../../../src/main/runtime/rpc/methods/agent-session' -import { YOLO_TUI_AGENT_ENV } from '../../../src/shared/tui-agent-permissions' +import { YOLO_TUI_AGENT_ENV } from '../../../src/shared/agent-launch/permissions/tui-agent-permissions' import { createRuntimeAgentBackgroundTerminal } from '../../../src/renderer/src/lib/runtime-agent-background-create' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { launchAgentInWebHostTab } from '../../../src/renderer/src/lib/launch-agent-web-host-tab' -import { buildAgentStartupPlan } from '../../../src/shared/tui-agent-startup' +import { buildAgentStartupPlan } from '../../../src/shared/agent-launch/startup/tui-agent-startup' import { createWebRuntimeSessionTerminal } from '../../../src/renderer/src/runtime/web-runtime-terminal-creation' import { resetWebSessionCloseIntentForTests } from '../../../src/renderer/src/runtime/web-session-close-intent' import { diff --git a/tests/e2e/headless-automation-agent-launch.unit.test.ts b/tests/e2e/headless-automation-agent-launch.unit.test.ts index a40568d515b..9945e8e9011 100644 --- a/tests/e2e/headless-automation-agent-launch.unit.test.ts +++ b/tests/e2e/headless-automation-agent-launch.unit.test.ts @@ -18,7 +18,7 @@ import type { StructuredAgentSessionHost } from '../../src/main/native-chat/agen import { createQueuedMessageTestRig } from '../../src/main/native-chat/agent-session-wire/structured-agent-session-queued-message-rig.test-fixture' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' -import type { AgentLaunchResult } from '../../src/shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../src/shared/agent-launch/contracts/agent-launch-intent' import { buildProfileStateCutoverFixture } from '../../src/main/persistence/profile-state-cutover-fixture' import { launchAutomationChatAgent } from '../../src/main/automations/automation-chat-agent-launch' diff --git a/tests/e2e/helpers/fake-agent-command-override.ts b/tests/e2e/helpers/fake-agent-command-override.ts index f257d36e609..b307a693789 100644 --- a/tests/e2e/helpers/fake-agent-command-override.ts +++ b/tests/e2e/helpers/fake-agent-command-override.ts @@ -1,4 +1,7 @@ -import { quoteStartupArg, resolveStartupShell } from '../../../src/shared/tui-agent-startup-shell' +import { + quoteStartupArg, + resolveStartupShell +} from '../../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../../src/shared/windows-terminal-shell' /** Specs must apply this through `updateSettings`; the override below is quoted for it. */ diff --git a/tests/e2e/host-agent-launch-preferences-work.unit.test.ts b/tests/e2e/host-agent-launch-preferences-work.unit.test.ts index ff57d6c473c..3feecef3a06 100644 --- a/tests/e2e/host-agent-launch-preferences-work.unit.test.ts +++ b/tests/e2e/host-agent-launch-preferences-work.unit.test.ts @@ -13,16 +13,16 @@ import { useAgentPickerInventoryEntries, type AgentPickerInventorySource } from '../../src/renderer/src/components/agent/use-agent-launch-picker-inventory' -import type { AgentPickerEntry } from '../../src/shared/agent-launch-picker' +import type { AgentPickerEntry } from '../../src/shared/agent-launch/picker/agent-launch-picker' import * as acquisitions from '../../src/renderer/src/components/agent/agent-launch-picker-acquisition' import * as routes from '@/lib/agent-launch-route-input' -import * as profile from '../../src/shared/agent-launch-profile' -import * as composition from '../../src/shared/tui-agent-launch-defaults' +import * as profile from '../../src/shared/agent-launch/choices/agent-launch-profile' +import * as composition from '../../src/shared/agent-launch/choices/tui-agent-launch-defaults' import { createGlobalSettingsFixture } from '../../src/shared/global-settings-test-fixture' import type { RuntimeStore } from '../../src/main/runtime/runtime-store-contract' import { RuntimeClientSettingsController } from '../../src/main/runtime/runtime-client-settings' import { mutateHostAgentLaunchSettings } from '../../src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport' -import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { structuredLaunchSeedOptions } from '../../src/shared/native-chat/input/native-chat-session-option-defaults' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environment-revision' diff --git a/tests/e2e/launch-agent-background-session-remote.unit.test.ts b/tests/e2e/launch-agent-background-session-remote.unit.test.ts index 910c67b4814..4fc06fc48cb 100644 --- a/tests/e2e/launch-agent-background-session-remote.unit.test.ts +++ b/tests/e2e/launch-agent-background-session-remote.unit.test.ts @@ -1,4 +1,4 @@ -import { projectAgentLaunchSettings } from '../../src/shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../src/shared/agent-launch/choices/agent-launch-settings' import './prepared-action-launch.test-fixture' import '../../src/renderer/src/lib/runtime-agent-background-create' import { createCompatibleRuntimeStatusResponseIfNeeded } from '@/runtime/runtime-compatibility-test-fixture' diff --git a/tests/e2e/launch-agent-in-new-tab-web-runtime.unit.test.ts b/tests/e2e/launch-agent-in-new-tab-web-runtime.unit.test.ts index 0510cbce6cf..525cc984a20 100644 --- a/tests/e2e/launch-agent-in-new-tab-web-runtime.unit.test.ts +++ b/tests/e2e/launch-agent-in-new-tab-web-runtime.unit.test.ts @@ -11,11 +11,11 @@ import { pasteDraftWhenAgentReady } from '@/lib/agent-paste-draft' import { newAgentPromptOutcome } from '@/lib/new-agent-prompt-outcome' import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id' import { stubRuntimeEnvironmentBridge } from '@/runtime/runtime-environment-bridge-fixture' -import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' import { consumeOldHostPreparedCommand } from './prepared-action-launch.test-fixture' import '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' -import { projectAgentLaunchSettings } from '../../src/shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../src/shared/agent-launch/choices/agent-launch-settings' import { describe, expect, it, vi } from 'vitest' describe('launchAgentInNewTab paired web runtime', () => { diff --git a/tests/e2e/launch-agent-web-terminal.test-fixture.ts b/tests/e2e/launch-agent-web-terminal.test-fixture.ts index a6921b2d1f3..6b39142aafe 100644 --- a/tests/e2e/launch-agent-web-terminal.test-fixture.ts +++ b/tests/e2e/launch-agent-web-terminal.test-fixture.ts @@ -7,7 +7,7 @@ import { isWebRuntimeSessionActive } from '@/runtime/web-runtime-session-environ import type * as TerminalOperation from '@/runtime/web-runtime-terminal-create-operation' import type * as WebEnvironment from '@/runtime/web-runtime-session-environment' import type * as RuntimeRpcClient from '@/runtime/runtime-rpc-client' -import type { AgentLaunchChoices } from '../../src/shared/agent-launch-choices' +import type { AgentLaunchChoices } from '../../src/shared/agent-launch/choices/agent-launch-choices' import type { FolderWorkspace } from '../../src/shared/folder-workspace-types' import type { ProjectGroup } from '../../src/shared/project-group-types' diff --git a/tests/e2e/nested-agent-idle-owner.unit.test.ts b/tests/e2e/nested-agent-idle-owner.unit.test.ts index fa0c8f48371..2e054c79e19 100644 --- a/tests/e2e/nested-agent-idle-owner.unit.test.ts +++ b/tests/e2e/nested-agent-idle-owner.unit.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it, vi } from 'vitest' import { createTestStore } from '../../src/renderer/src/store/slices/store-test-helpers' import { sleepingRecordFromEntry } from '../../src/renderer/src/store/slices/agent-status/agent-status-sleeping-records' -import { getAgentResumeArgv } from '../../src/shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../src/shared/agent-launch/startup/agent-resume-argv' import { readAgentProcess } from '../../src/shared/agent-process-presence-probe' import { AgentHookServer } from '../../src/main/agent-hooks/server' import { buildBody, PANE, postHookEvent } from '../../src/main/agent-hooks/server.test-fixtures' diff --git a/tests/e2e/omp-child-session-recovery.unit.test.ts b/tests/e2e/omp-child-session-recovery.unit.test.ts index f6c667aa957..1ee7b068888 100644 --- a/tests/e2e/omp-child-session-recovery.unit.test.ts +++ b/tests/e2e/omp-child-session-recovery.unit.test.ts @@ -2,8 +2,8 @@ import { describe, expect, it } from 'vitest' import { createAgentStatusExtensionHarness } from '../../src/main/pi/agent-status-extension-test-harness' import { normalizeHookPayload } from '../../src/shared/agent-hook-listener' import { createHookListenerState } from '../../src/shared/agent-hook-listener/listener-state' -import { getAgentResumeArgv } from '../../src/shared/agent-resume-argv' -import { buildAgentResumeStartupPlan } from '../../src/shared/tui-agent-resume-startup' +import { getAgentResumeArgv } from '../../src/shared/agent-launch/startup/agent-resume-argv' +import { buildAgentResumeStartupPlan } from '../../src/shared/agent-launch/startup/tui-agent-resume-startup' import { sleepingAgentSessionsByPaneKeySchema } from '../../src/shared/workspace-session-sleeping-agents' import { createTestStore, makeTab } from '../../src/renderer/src/store/slices/store-test-helpers' diff --git a/tests/e2e/omp-launch-environment.spec.ts b/tests/e2e/omp-launch-environment.spec.ts index 45b5d989d79..802695da11d 100644 --- a/tests/e2e/omp-launch-environment.spec.ts +++ b/tests/e2e/omp-launch-environment.spec.ts @@ -1,7 +1,7 @@ import { chmod, mkdir, readFile, readdir, writeFile } from 'node:fs/promises' import { dirname, delimiter, join } from 'node:path' import { test as base, expect } from './helpers/orca-app' -import { buildShellCommandFromArgv } from '../../src/shared/tui-agent-startup-shell' +import { buildShellCommandFromArgv } from '../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store' import { execInTerminal, diff --git a/tests/e2e/omp-model-picker.spec.ts b/tests/e2e/omp-model-picker.spec.ts index 0a8e4cca06e..e12fcb49df6 100644 --- a/tests/e2e/omp-model-picker.spec.ts +++ b/tests/e2e/omp-model-picker.spec.ts @@ -1,5 +1,5 @@ import { readFile, writeFile } from 'node:fs/promises' -import { buildShellCommandFromArgv } from '../../src/shared/tui-agent-startup-shell' +import { buildShellCommandFromArgv } from '../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { test, expect } from './helpers/orca-app' import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store' import { diff --git a/tests/e2e/omp-prefill-runtime.spec.ts b/tests/e2e/omp-prefill-runtime.spec.ts index 1a275c8ddfc..3afcfb2a5f7 100644 --- a/tests/e2e/omp-prefill-runtime.spec.ts +++ b/tests/e2e/omp-prefill-runtime.spec.ts @@ -1,5 +1,5 @@ import { readFile, writeFile } from 'node:fs/promises' -import { buildShellCommandFromArgv } from '../../src/shared/tui-agent-startup-shell' +import { buildShellCommandFromArgv } from '../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { test, expect } from './helpers/orca-app' import { getPiAgentStatusExtensionSource } from '../../src/main/pi/agent-status-extension-source' import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store' diff --git a/tests/e2e/omp-title-marker.spec.ts b/tests/e2e/omp-title-marker.spec.ts index 4f2db0ddbd9..03a3bdc6303 100644 --- a/tests/e2e/omp-title-marker.spec.ts +++ b/tests/e2e/omp-title-marker.spec.ts @@ -1,5 +1,5 @@ import { writeFile } from 'node:fs/promises' -import { buildShellCommandFromArgv } from '../../src/shared/tui-agent-startup-shell' +import { buildShellCommandFromArgv } from '../../src/shared/agent-launch/startup/tui-agent-startup-shell' import { test, expect } from './helpers/orca-app' import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store' import { diff --git a/tests/e2e/onboarding.spec.ts b/tests/e2e/onboarding.spec.ts index cf6c524f4ab..c39c2259e6f 100644 --- a/tests/e2e/onboarding.spec.ts +++ b/tests/e2e/onboarding.spec.ts @@ -4,7 +4,7 @@ import { test, expect } from './helpers/orca-app' import { waitForSessionReady } from './helpers/store' import type { Page } from '@stablyai/playwright-test' import type { GlobalSettings } from '../../src/shared/global-settings-types' -import type { TuiAgent } from '../../src/shared/tui-agent' +import type { TuiAgent } from '../../src/shared/agent-launch/catalog/tui-agent' import { ONBOARDING_FINAL_STEP } from '../../src/shared/onboarding-defaults' import { encodePairingOffer, PAIRING_OFFER_VERSION } from '../../src/shared/pairing' diff --git a/tests/e2e/paired-cli-agent-launch.unit.test.ts b/tests/e2e/paired-cli-agent-launch.unit.test.ts index 9fce74cf50b..00fde7df0f1 100644 --- a/tests/e2e/paired-cli-agent-launch.unit.test.ts +++ b/tests/e2e/paired-cli-agent-launch.unit.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { RuntimeClient } from '../../src/cli/runtime/client' -import type { AgentLaunchResult } from '../../src/shared/agent-launch-intent' +import type { AgentLaunchResult } from '../../src/shared/agent-launch/contracts/agent-launch-intent' import { openTestAgentSessionRecordStore } from '../../src/main/runtime/agent-session/records/agent-session-record-store-test-harness' import { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' import { OrcaRuntimeRpcServer } from '../../src/main/runtime/runtime-rpc' diff --git a/tests/e2e/prepared-action-launch.test-fixture.ts b/tests/e2e/prepared-action-launch.test-fixture.ts index 84e29dd1077..a566440adec 100644 --- a/tests/e2e/prepared-action-launch.test-fixture.ts +++ b/tests/e2e/prepared-action-launch.test-fixture.ts @@ -3,9 +3,9 @@ import { TERMINAL_LIFECYCLE_METHODS } from '../../src/main/runtime/rpc/methods/t import { expect, vi } from 'vitest' import { normalizeSourceControlAiActionDefaults } from '../../src/shared/source-control-ai-actions' import { sourceControlActionLaunchOptions } from '../../src/shared/source-control-action-launch-preferences' -import { agentLaunchNeedsPreparedCommand } from '../../src/shared/agent-launch-preferences' -import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../src/shared/tui-agent-startup' +import { agentLaunchNeedsPreparedCommand } from '../../src/shared/agent-launch/choices/agent-launch-preferences' +import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../src/shared/agent-launch/startup/tui-agent-startup' import { resolveAgentSessionOptionLaunch } from '../../src/shared/agent-session/options/agent-session-option-launch-legacy.test-fixture' import { OrcaRuntimeWithResolveMobileSessionTerminalCommand, diff --git a/tests/e2e/runtime-agent-background-create-owner.unit.test.ts b/tests/e2e/runtime-agent-background-create-owner.unit.test.ts index b56189cc22c..0fc4941b748 100644 --- a/tests/e2e/runtime-agent-background-create-owner.unit.test.ts +++ b/tests/e2e/runtime-agent-background-create-owner.unit.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' -import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../src/shared/tui-agent-startup' +import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-launch/startup/agent-startup-plan-inputs' +import { buildAgentStartupPlan } from '../../src/shared/agent-launch/startup/tui-agent-startup' import { createRuntimeAgentBackgroundTerminal } from '../../src/renderer/src/lib/runtime-agent-background-create' import { createCompatibleRuntimeStatusResponseIfNeeded } from '@/runtime/runtime-compatibility-test-fixture' import { stubRuntimeEnvironmentBridge } from '@/runtime/runtime-environment-bridge-fixture' diff --git a/tests/e2e/source-control-action-phone-launch.unit.test.ts b/tests/e2e/source-control-action-phone-launch.unit.test.ts index ef1ff9d9751..a5fc39cbfb7 100644 --- a/tests/e2e/source-control-action-phone-launch.unit.test.ts +++ b/tests/e2e/source-control-action-phone-launch.unit.test.ts @@ -5,11 +5,11 @@ import type { RpcResponse } from '../../mobile/src/transport/types' import { launchAgentWithPrompt } from '../../mobile/src/session/pr-ai-triage-launch' import type { SourceControlActionRecipe } from '../../src/shared/source-control-ai-actions' import type { RepoSourceControlAiOverrides } from '../../src/shared/source-control-ai-types' -import type { TuiAgent } from '../../src/shared/tui-agent' +import type { TuiAgent } from '../../src/shared/agent-launch/catalog/tui-agent' import { liftActionPermissionArgs } from '../../src/shared/source-control-action-permission-lift' import { AgentLaunchReplay } from '../../src/shared/rpc-contract/agent-launch-params' -import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-startup-plan-inputs' -import { resolveAgentLaunchCommand } from '../../src/shared/tui-agent-launch-command' +import { resolveAgentStartupPlanInputs } from '../../src/shared/agent-launch/startup/agent-startup-plan-inputs' +import { resolveAgentLaunchCommand } from '../../src/shared/agent-launch/startup/tui-agent-launch-command' vi.mock('../../mobile/src/platform/random-v4-uuid', () => ({ randomV4Uuid: () => randomUUID() diff --git a/tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts b/tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts index 48609464247..d21a0f6d4a4 100644 --- a/tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts +++ b/tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts @@ -5,10 +5,10 @@ import { buildAgentSessionForkPrompt } from '@/lib/agent-session-fork-context' import { isWebRuntimeSessionActive } from '@/runtime/web-runtime-session-environment' import { pasteDraftWhenAgentReady } from '@/lib/agent-paste-draft' import { newAgentPromptOutcome } from '@/lib/new-agent-prompt-outcome' -import { projectAgentLaunchSettings } from '../../src/shared/agent-launch-settings' +import { projectAgentLaunchSettings } from '../../src/shared/agent-launch/choices/agent-launch-settings' import { retainedPrefillHost } from './terminal-agent-fork-retained-prefill.test-fixture' import { AGENT_SESSION_HOST_AUTHORITY_RUNTIME_CAPABILITY } from '../../src/shared/agent-session/agent-session-runtime-capabilities' -import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch-runtime-capability' +import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' import type * as SessionSnapshot from '@/runtime/web-runtime-session-snapshot' const actualSnapshots = await vi.importActual( diff --git a/tests/tools/omp-child-session-resume-smoke.mjs b/tests/tools/omp-child-session-resume-smoke.mjs index baa7c7d4f19..68d40f6dba5 100644 --- a/tests/tools/omp-child-session-resume-smoke.mjs +++ b/tests/tools/omp-child-session-resume-smoke.mjs @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' import { buildAiVaultResumeCommand } from '../../src/shared/ai-vault-resume-command.ts' -import { tokenizeStartupCommand } from '../../src/shared/tui-agent-startup-shell.ts' +import { tokenizeStartupCommand } from '../../src/shared/agent-launch/startup/tui-agent-startup-shell.ts' assert.ok(process.argv[2], 'Pass a read-only OMP checkout path') const scratch = await mkdtemp(join(tmpdir(), 'orca-omp-child-resume-')) diff --git a/tests/tools/omp-fresh-launch-windows-smoke.ts b/tests/tools/omp-fresh-launch-windows-smoke.ts index 6aecf98b8a9..d3dd0d15af3 100644 --- a/tests/tools/omp-fresh-launch-windows-smoke.ts +++ b/tests/tools/omp-fresh-launch-windows-smoke.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import assert from 'node:assert/strict' import { runProcess } from '@orca/process-host' -import { withFreshOmpLaunch } from '../../src/shared/omp-fresh-launch' +import { withFreshOmpLaunch } from '../../src/shared/agent-launch/startup/omp-fresh-launch' if (process.platform !== 'win32') { throw new Error('Run this smoke on a Windows host') } diff --git a/tests/tools/omp-fresh-session-runtime-smoke.mjs b/tests/tools/omp-fresh-session-runtime-smoke.mjs index 84ca8f58d68..24488bcf4ca 100644 --- a/tests/tools/omp-fresh-session-runtime-smoke.mjs +++ b/tests/tools/omp-fresh-session-runtime-smoke.mjs @@ -4,7 +4,7 @@ import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' -import { OMP_FRESH_CONFIG_SOURCE } from '../../src/shared/omp-fresh-launch.ts' +import { OMP_FRESH_CONFIG_SOURCE } from '../../src/shared/agent-launch/startup/omp-fresh-launch.ts' assert.ok(process.argv[2], 'Pass a read-only OMP checkout path') const scratch = await mkdtemp(join(tmpdir(), 'orca-omp-fresh-proof-')) diff --git a/tests/tools/omp-picker-search-rendered/fixture.tsx b/tests/tools/omp-picker-search-rendered/fixture.tsx index b318cdee827..6fbb57f339a 100644 --- a/tests/tools/omp-picker-search-rendered/fixture.tsx +++ b/tests/tools/omp-picker-search-rendered/fixture.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react' import { createRoot } from 'react-dom/client' import AgentCombobox from '../../../src/renderer/src/components/agent/AgentCombobox' import { getAgentCatalog } from '../../../src/renderer/src/lib/agent-catalog' -import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import './fixture.css' const baseline = new URLSearchParams(window.location.search).get('baseline') === '1' const agents = getAgentCatalog().map((agent) => diff --git a/tests/tools/omp-resume-transcript-locator-smoke.mjs b/tests/tools/omp-resume-transcript-locator-smoke.mjs index 1e42cbdb0a7..3341db99eb1 100644 --- a/tests/tools/omp-resume-transcript-locator-smoke.mjs +++ b/tests/tools/omp-resume-transcript-locator-smoke.mjs @@ -4,7 +4,7 @@ import { mkdtemp, mkdir, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' -import { getAgentResumeArgv } from '../../src/shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../src/shared/agent-launch/startup/agent-resume-argv' assert.ok(process.argv[2], 'Pass a read-only OMP checkout path') const scratch = await mkdtemp(join(tmpdir(), 'orca-omp-resume-locator-')) diff --git a/tests/tools/omp-transcript-runtime-smoke.mjs b/tests/tools/omp-transcript-runtime-smoke.mjs index a50a247ac24..06c5f927538 100644 --- a/tests/tools/omp-transcript-runtime-smoke.mjs +++ b/tests/tools/omp-transcript-runtime-smoke.mjs @@ -7,7 +7,7 @@ import { join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' import { getPiAgentStatusExtensionSource } from '../../src/main/pi/agent-status-extension-source.ts' import { extractAgentProviderSession } from '../../src/shared/agent-session/lifecycle/agent-session-resume' -import { getAgentResumeArgv } from '../../src/shared/agent-resume-argv' +import { getAgentResumeArgv } from '../../src/shared/agent-launch/startup/agent-resume-argv' import { readNativeChatTranscript } from '../../src/main/native-chat/transcript-reader.ts' const reference = process.argv[2]