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

main
ts 35 lines 1.41 KB
Raw
1 import type { DesktopAppBranding } from "@t3tools/contracts";
2 import {
3 formatAppDisplayName,
4 resolveHostedAppChannelLabel,
5 resolveWebAppStageLabel,
6 } from "./branding.logic";
7
8 function readInjectedDesktopAppBranding(): DesktopAppBranding | null {
9 if (typeof window === "undefined") {
10 return null;
11 }
12
13 return window.desktopBridge?.getAppBranding() ?? null;
14 }
15
16 const injectedDesktopAppBranding = readInjectedDesktopAppBranding();
17 const hostedAppChannel = import.meta.env.VITE_HOSTED_APP_CHANNEL?.trim().toLowerCase();
18
19 export const HOSTED_APP_CHANNEL =
20 hostedAppChannel === "latest" || hostedAppChannel === "nightly" ? hostedAppChannel : null;
21 export const HOSTED_APP_CHANNEL_LABEL = resolveHostedAppChannelLabel(HOSTED_APP_CHANNEL);
22 export const APP_BASE_NAME = injectedDesktopAppBranding?.baseName ?? "T3 Code";
23 export const APP_STAGE_LABEL =
24 injectedDesktopAppBranding?.stageLabel ??
25 resolveWebAppStageLabel({
26 hostedAppChannel: HOSTED_APP_CHANNEL,
27 development: import.meta.env.DEV,
28 });
29 export const APP_DISPLAY_NAME =
30 injectedDesktopAppBranding?.displayName ??
31 formatAppDisplayName({ baseName: APP_BASE_NAME, stageLabel: APP_STAGE_LABEL });
32 export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0";
33 export const DESKTOP_DOWNLOAD_URL = "https://t3.codes/download";
34 // Redirects to the App Store or Google Play to match the phone that opens it.
35 export const MOBILE_APP_URL = "https://t3.codes/mobile";