The best way to control Claude Code, Codex and more from any computer or phone

main
ts 11 lines 451 Bytes
Raw
1 /**
2 * The machine triage runs on: the one on screen, else the first connected
3 * machine whose server supports triage. The palette row names the pick.
4 */
5 export function pickTriageEnvironment<Id extends string>(input: {
6 readonly onScreen: Id | null;
7 readonly connected: ReadonlyArray<Id>;
8 readonly supportsTriage: (environmentId: Id) => boolean;
9 }): Id | null {
10 return input.onScreen ?? input.connected.find(input.supportsTriage) ?? null;
11 }