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

main
ts 20 lines 619 Bytes
Raw
1 import { buildHostedPairingUrl } from "../../hostedPairing";
2 import { setPairingTokenOnUrl } from "@t3tools/shared/remote";
3
4 export function resolveDesktopPairingUrl(endpointUrl: string, credential: string): string {
5 const url = new URL(endpointUrl);
6 url.pathname = "/pair";
7 return setPairingTokenOnUrl(url, credential).toString();
8 }
9
10 export function resolveHostedPairingUrl(endpointUrl: string, credential: string): string | null {
11 const url = new URL(endpointUrl);
12 if (url.protocol !== "https:") {
13 return null;
14 }
15
16 return buildHostedPairingUrl({
17 host: endpointUrl,
18 token: credential,
19 });
20 }