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

desktopBootstrap.ts

40 lines1.5 KB

1import * as Schema from "effect/Schema";
2​
3import { PortSchema, PositiveInt, TrimmedNonEmptyString } from "./baseSchemas.ts";
4​
5export const CuaDriverMcpConfiguration = Schema.Struct({
6 command: TrimmedNonEmptyString,
7 args: Schema.Array(Schema.String),
8 environment: Schema.Array(
9 Schema.Struct({
10 name: TrimmedNonEmptyString,
11 value: Schema.String,
12 }),
13 ),
14});
15​
16export type CuaDriverMcpConfiguration = typeof CuaDriverMcpConfiguration.Type;
17​
18export const DesktopBackendBootstrap = Schema.Struct({
19 mode: Schema.Literal("desktop"),
20 noBrowser: Schema.Boolean,
21 port: PortSchema,
22 // Omitted when the desktop launches the backend inside WSL, since the
23 // Windows-side baseDir maps to /mnt/c/... and the Linux side should use its
24 // own home directory instead.
25 t3Home: Schema.optional(Schema.String),
26 host: Schema.String,
27 desktopBootstrapToken: Schema.String,
28 tailscaleServeEnabled: Schema.Boolean,
29 tailscaleServePort: PortSchema,
30 otlpTracesUrl: Schema.optional(Schema.String),
31 otlpMetricsUrl: Schema.optional(Schema.String),
32 desktopTelemetryFd: Schema.optionalKey(PositiveInt),
33 desktopTelemetryControlFd: Schema.optionalKey(PositiveInt),
34 resourceMonitorPath: Schema.optionalKey(TrimmedNonEmptyString),
35 // Present only for the local backend hosted by Electron. The descriptor is
36 // returned by Electron's permission-owning embedded Cua Driver host.
37 cuaDriverMcp: Schema.optionalKey(CuaDriverMcpConfiguration),
38});
39​
40export type DesktopBackendBootstrap = typeof DesktopBackendBootstrap.Type;