| 1 | import { EnvironmentId } from "@t3tools/contracts"; |
| 2 | |
| 3 | import type { RelayEnvironmentView } from "../connection/useConnectionController"; |
| 4 | import type { ConnectedEnvironmentSummary } from "../../state/remote-runtime-types"; |
| 5 | |
| 6 | const SHOWCASE_LOCAL_ENVIRONMENT_DISPLAY_URLS: Readonly<Record<string, string>> = { |
| 7 | "Moonbase Terminal": "https://moonbase.tail9f3a.ts.net/", |
| 8 | "Suspense Station": "https://suspense-vps.hel1.t3.sh/", |
| 9 | "Kernel Cabin": "http://100.82.16.5:3773/", |
| 10 | }; |
| 11 | |
| 12 | export function applyShowcaseLocalEnvironmentDisplayUrls( |
| 13 | environments: ReadonlyArray<ConnectedEnvironmentSummary>, |
| 14 | ): ReadonlyArray<ConnectedEnvironmentSummary> { |
| 15 | return environments.map((environment) => ({ |
| 16 | ...environment, |
| 17 | displayUrl: |
| 18 | SHOWCASE_LOCAL_ENVIRONMENT_DISPLAY_URLS[environment.environmentLabel] ?? |
| 19 | environment.displayUrl, |
| 20 | })); |
| 21 | } |
| 22 | |
| 23 | export function resolveShowcaseEnvironmentUpdateDisplayUrl(input: { |
| 24 | readonly actualDisplayUrl: string; |
| 25 | readonly presentedDisplayUrl: string; |
| 26 | readonly submittedDisplayUrl: string; |
| 27 | }): string { |
| 28 | return input.submittedDisplayUrl === input.presentedDisplayUrl |
| 29 | ? input.actualDisplayUrl |
| 30 | : input.submittedDisplayUrl; |
| 31 | } |
| 32 | |
| 33 | const pocketPiId = EnvironmentId.make("showcase-pocket-pi"); |
| 34 | const pocketPiEndpoint = { |
| 35 | httpBaseUrl: "https://pocket-pi.t3.sh", |
| 36 | wsBaseUrl: "wss://pocket-pi.t3.sh", |
| 37 | providerKind: "t3_relay" as const, |
| 38 | }; |
| 39 | |
| 40 | export const SHOWCASE_CONNECTED_CLOUD_ENVIRONMENTS: ReadonlyArray<ConnectedEnvironmentSummary> = [ |
| 41 | { |
| 42 | environmentId: EnvironmentId.make("showcase-aurora-gpu"), |
| 43 | environmentLabel: "Aurora GPU Pod", |
| 44 | displayUrl: "https://aurora-gpu.t3.sh", |
| 45 | isRelayManaged: true, |
| 46 | isEnabled: true, |
| 47 | connectionState: "connected", |
| 48 | connectionError: null, |
| 49 | connectionErrorTraceId: null, |
| 50 | }, |
| 51 | ]; |
| 52 | |
| 53 | export const SHOWCASE_AVAILABLE_CLOUD_ENVIRONMENTS: ReadonlyArray<RelayEnvironmentView> = [ |
| 54 | { |
| 55 | environment: { |
| 56 | environmentId: pocketPiId, |
| 57 | label: "Pocket Pi", |
| 58 | endpoint: pocketPiEndpoint, |
| 59 | linkedAt: "2026-07-16T08:00:00.000Z", |
| 60 | }, |
| 61 | availability: "online", |
| 62 | status: { |
| 63 | environmentId: pocketPiId, |
| 64 | endpoint: pocketPiEndpoint, |
| 65 | status: "online", |
| 66 | checkedAt: "2026-07-16T08:41:00.000Z", |
| 67 | }, |
| 68 | error: null, |
| 69 | traceId: null, |
| 70 | }, |
| 71 | ]; |