Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

desktopBootstrap.ts

31 lines1.3 KB

1import * as Schema from "effect/Schema";
2​
3import { PortSchema, PositiveInt, TrimmedNonEmptyString } from "./baseSchemas.ts";
4​
5export const DesktopBackendBootstrap = Schema.Struct({
6 mode: Schema.Literal("desktop"),
7 noBrowser: Schema.Boolean,
8 port: PortSchema,
9 // Omitted when the desktop launches the backend inside WSL, since the
10 // Windows-side baseDir maps to /mnt/c/... and the Linux side should use its
11 // own home directory instead.
12 t3Home: Schema.optional(Schema.String),
13 host: Schema.String,
14 desktopBootstrapToken: Schema.String,
15 tailscaleServeEnabled: Schema.Boolean,
16 tailscaleServePort: PortSchema,
17 otlpTracesUrl: Schema.optional(Schema.String),
18 otlpMetricsUrl: Schema.optional(Schema.String),
19 otlpLogsUrl: Schema.optional(Schema.String),
20 desktopTelemetryFd: Schema.optionalKey(PositiveInt),
21 desktopTelemetryControlFd: Schema.optionalKey(PositiveInt),
22 resourceMonitorPath: Schema.optionalKey(TrimmedNonEmptyString),
23});
24​
25export type DesktopBackendBootstrap = typeof DesktopBackendBootstrap.Type;
26​
27/** Written to `<t3Home>/runtime` just before the desktop app stops its
28 backend to install an update. The updated app starts a new backend right
29 away, so a backend that sees a fresh marker at shutdown keeps its managed
30 tunnel. */
31export const DESKTOP_UPDATE_RESTART_MARKER_FILE = "desktop-update-restart";