1import type { EnvironmentId } from "@t3tools/contracts";
2
3import type { RemoteOpenMode } from "../../remoteOpen";
4
5export function shouldShowOpenInPicker(input: {
6 readonly activeProjectName: string | undefined;
7 readonly activeThreadEnvironmentId: EnvironmentId;
8 readonly primaryEnvironmentId: EnvironmentId | null;
9 readonly remoteOpenMode: RemoteOpenMode;
10}): boolean {
11 if (!input.activeProjectName) return false;
12 if (
13 input.primaryEnvironmentId !== null &&
14 input.activeThreadEnvironmentId === input.primaryEnvironmentId
15 ) {
16 return true;
17 }
18 // Remote environments get the picker in deep-link mode (or its explicit
19 // "no SSH route" state). Non-primary local backends (e.g. WSL) keep it
20 // hidden, matching pre-remote behavior.
21 return input.remoteOpenMode !== "local-exec";
22}