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

settings.ts

1,403 lines60.6 KB

1import { SshDeviceHostConfigs } from "./device.ts";
2import * as Effect from "effect/Effect";
3import * as Duration from "effect/Duration";
4import * as Schema from "effect/Schema";
5import * as SchemaTransformation from "effect/SchemaTransformation";
6import {
7 ForwardCompatibleNullable,
8 ProjectId,
9 TrimmedNonEmptyString,
10 TrimmedString,
11} from "./baseSchemas.ts";
12import { UsageLimitSourceId } from "./usageLimitSourceId.ts";
13import { EnvironmentMachineKind, ThreadEnvMode } from "./environment.ts";
14import { KeybindingShortcut } from "./keybindings.ts";
15import {
16 CustomModelSetting,
17 DEFAULT_TEXT_GENERATION_MODEL,
18 DEFAULT_TEXT_GENERATION_REASONING_EFFORT,
19 ProviderOptionSelections,
20} from "./model.ts";
21import { ModelSelection, ProjectScript } from "./orchestration.ts";
22import { BrowserProfile, BrowserProfileId, DEFAULT_BROWSER_PROFILE_ID } from "./browserProfile.ts";
23import {
24 DEFAULT_PREVIEW_APPEARANCE,
25 DEFAULT_PREVIEW_ZOOM_FACTOR,
26 FILL_PREVIEW_VIEWPORT,
27 PreviewAppearancePreference,
28 PreviewViewportSetting,
29 PreviewZoomFactor,
30} from "./preview.ts";
31import {
32 ProviderInstanceConfig,
33 ProviderInstanceId,
34 type ProviderDriverKind,
35} from "./providerInstance.ts";
36import { PullRequestMergeMethod } from "./pullRequest.ts";
37​
38// ── Client Settings (local-only) ───────────────────────────────
39​
40export const TimestampFormat = Schema.Literals(["locale", "12-hour", "24-hour"]);
41export type TimestampFormat = typeof TimestampFormat.Type;
42const DEFAULT_TIMESTAMP_FORMAT: TimestampFormat = "locale";
43​
44export const DiffLayout = Schema.Literals(["stacked", "split"]);
45export type DiffLayout = typeof DiffLayout.Type;
46const DEFAULT_DIFF_LAYOUT: DiffLayout = "stacked";
47​
48export const SidebarProjectSortOrder = Schema.Literals(["updated_at", "created_at", "manual"]);
49export type SidebarProjectSortOrder = typeof SidebarProjectSortOrder.Type;
50export const DEFAULT_SIDEBAR_PROJECT_SORT_ORDER: SidebarProjectSortOrder = "updated_at";
51​
52export const SidebarThreadSortOrder = Schema.Literals(["updated_at", "created_at"]);
53export type SidebarThreadSortOrder = typeof SidebarThreadSortOrder.Type;
54export const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at";
55​
56export const SidebarProjectGroupingMode = Schema.Literals([
57 "repository",
58 "repository_path",
59 "separate",
60]);
61export type SidebarProjectGroupingMode = typeof SidebarProjectGroupingMode.Type;
62const DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE: SidebarProjectGroupingMode = "repository";
63export const MIN_SIDEBAR_THREAD_PREVIEW_COUNT = 1;
64export const MAX_SIDEBAR_THREAD_PREVIEW_COUNT = 15;
65export const SidebarThreadPreviewCount = Schema.Int.check(
66 Schema.isBetween({
67 minimum: MIN_SIDEBAR_THREAD_PREVIEW_COUNT,
68 maximum: MAX_SIDEBAR_THREAD_PREVIEW_COUNT,
69 }),
70);
71export type SidebarThreadPreviewCount = typeof SidebarThreadPreviewCount.Type;
72const DEFAULT_SIDEBAR_THREAD_PREVIEW_COUNT: SidebarThreadPreviewCount = 6;
73export const MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS = 1;
74export const MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS = 90;
75export const SidebarAutoSettleAfterDays = Schema.Number.check(
76 Schema.isBetween({
77 minimum: MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
78 maximum: MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
79 }),
80);
81export type SidebarAutoSettleAfterDays = typeof SidebarAutoSettleAfterDays.Type;
82const DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS: SidebarAutoSettleAfterDays = 3;
83export const MIN_GLASS_OPACITY = 40;
84export const MAX_GLASS_OPACITY = 100;
85export const GlassOpacity = Schema.Int.check(
86 Schema.isBetween({
87 minimum: MIN_GLASS_OPACITY,
88 maximum: MAX_GLASS_OPACITY,
89 }),
90);
91export type GlassOpacity = typeof GlassOpacity.Type;
92const DEFAULT_GLASS_OPACITY: GlassOpacity = 80;
93​
94export const MIN_APPEARANCE_CONTRAST = 50;
95export const MAX_APPEARANCE_CONTRAST = 200;
96export const AppearanceContrast = Schema.Int.check(
97 Schema.isBetween({ minimum: MIN_APPEARANCE_CONTRAST, maximum: MAX_APPEARANCE_CONTRAST }),
98);
99export type AppearanceContrast = typeof AppearanceContrast.Type;
100const DEFAULT_APPEARANCE_CONTRAST: AppearanceContrast = 100;
101export const MIN_PANEL_ANIMATION_DURATION_MS = 0;
102export const MAX_PANEL_ANIMATION_DURATION_MS = 400;
103export const PanelAnimationDurationMs = Schema.Int.check(
104 Schema.isBetween({
105 minimum: MIN_PANEL_ANIMATION_DURATION_MS,
106 maximum: MAX_PANEL_ANIMATION_DURATION_MS,
107 }),
108);
109export type PanelAnimationDurationMs = typeof PanelAnimationDurationMs.Type;
110const DEFAULT_PANEL_ANIMATION_DURATION_MS: PanelAnimationDurationMs = 0;
111/**
112 * Font size preferences, in CSS pixels. The ranges are deliberately narrow:
113 * the interface size scales every rem-based dimension in the app, so the
114 * bounds keep layouts intact rather than offering unusable extremes.
115 */
116export const MIN_INTERFACE_FONT_SIZE = 12;
117export const MAX_INTERFACE_FONT_SIZE = 20;
118export const InterfaceFontSize = Schema.Int.check(
119 Schema.isBetween({ minimum: MIN_INTERFACE_FONT_SIZE, maximum: MAX_INTERFACE_FONT_SIZE }),
120);
121export type InterfaceFontSize = typeof InterfaceFontSize.Type;
122export const DEFAULT_INTERFACE_FONT_SIZE: InterfaceFontSize = 16;
123​
124export const MIN_PROMPT_FONT_SIZE = 12;
125export const MAX_PROMPT_FONT_SIZE = 20;
126export const PromptFontSize = Schema.Int.check(
127 Schema.isBetween({ minimum: MIN_PROMPT_FONT_SIZE, maximum: MAX_PROMPT_FONT_SIZE }),
128);
129export type PromptFontSize = typeof PromptFontSize.Type;
130export const DEFAULT_PROMPT_FONT_SIZE: PromptFontSize = 14;
131​
132export const MIN_CODE_FONT_SIZE = 10;
133export const MAX_CODE_FONT_SIZE = 18;
134export const CodeFontSize = Schema.Int.check(
135 Schema.isBetween({ minimum: MIN_CODE_FONT_SIZE, maximum: MAX_CODE_FONT_SIZE }),
136);
137export type CodeFontSize = typeof CodeFontSize.Type;
138export const DEFAULT_CODE_FONT_SIZE: CodeFontSize = 13;
139​
140export const MIN_TERMINAL_FONT_SIZE = 8;
141export const MAX_TERMINAL_FONT_SIZE = 20;
142export const TerminalFontSize = Schema.Int.check(
143 Schema.isBetween({ minimum: MIN_TERMINAL_FONT_SIZE, maximum: MAX_TERMINAL_FONT_SIZE }),
144);
145export type TerminalFontSize = typeof TerminalFontSize.Type;
146const DEFAULT_TERMINAL_FONT_SIZE: TerminalFontSize = 12;
147​
148export const EnvironmentIdentificationMode = Schema.Literals(["artwork", "pill", "none"]);
149export type EnvironmentIdentificationMode = typeof EnvironmentIdentificationMode.Type;
150export const DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE: EnvironmentIdentificationMode = "artwork";
151​
152export const SnapShotKeyChord = KeybindingShortcut.check(
153 Schema.makeFilter(
154 (shortcut) =>
155 shortcut.metaKey ||
156 shortcut.ctrlKey ||
157 shortcut.shiftKey ||
158 shortcut.altKey ||
159 shortcut.modKey ||
160 "Snapshot shortcut requires a modifier.",
161 ),
162);
163export type SnapShotKeyChord = typeof SnapShotKeyChord.Type;
164export const SNAP_SHOT_MODIFIERS = ["shift", "meta", "control", "alt"] as const;
165export const SnapShotModifier = Schema.Literals(SNAP_SHOT_MODIFIERS);
166export type SnapShotModifier = typeof SnapShotModifier.Type;
167export const SnapShotShortcut = Schema.Union([
168 Schema.Struct({ kind: Schema.Literal("both-shift-keys") }),
169 Schema.Struct({ kind: Schema.Literal("modifier-pair"), modifier: SnapShotModifier }),
170 SnapShotKeyChord,
171]);
172export type SnapShotShortcut = typeof SnapShotShortcut.Type;
173export const SnapShotSound = Schema.Literals(["soft-pop", "camera-shutter"]);
174export type SnapShotSound = typeof SnapShotSound.Type;
175const DEFAULT_SNAP_SHOT_SOUND: SnapShotSound = "soft-pop";
176​
177export type SnapShotModifierPairShortcut = Extract<SnapShotShortcut, { readonly kind: string }>;
178​
179export function isModifierPairShortcut(
180 shortcut: SnapShotShortcut,
181): shortcut is SnapShotModifierPairShortcut {
182 return "kind" in shortcut;
184​
185export function snapShotShortcutModifierPair(
186 shortcut: SnapShotModifierPairShortcut,
187): SnapShotModifier {
188 return shortcut.kind === "both-shift-keys" ? "shift" : shortcut.modifier;
190​
191const APPLE_MODIFIER_LABELS: Record<SnapShotModifier, string> = {
192 shift: "Shift",
193 meta: "Command",
194 control: "Control",
195 alt: "Option",
196};
197const OTHER_MODIFIER_LABELS: Record<SnapShotModifier, string> = {
198 shift: "Shift",
199 meta: "Super",
200 control: "Ctrl",
201 alt: "Alt",
202};
203​
204export function snapShotModifierPairLabel(modifier: SnapShotModifier, apple: boolean): string {
205 const label = (apple ? APPLE_MODIFIER_LABELS : OTHER_MODIFIER_LABELS)[modifier];
206 return `${label} + ${label}`;
208const DEFAULT_SNAP_SHOT_SHORTCUT: SnapShotShortcut = {
209 kind: "both-shift-keys",
210};
211​
212export const QuitConfirmationMode = Schema.Literals(["direct", "hold", "double-click"]);
213export type QuitConfirmationMode = typeof QuitConfirmationMode.Type;
214const DEFAULT_QUIT_CONFIRMATION_MODE: QuitConfirmationMode = "hold";
215​
216const LegacyConfirmQuit = Schema.Boolean.pipe(
217 Schema.decodeTo(
218 QuitConfirmationMode,
219 SchemaTransformation.transform({
220 decode: (confirmQuit): QuitConfirmationMode => (confirmQuit ? "hold" : "direct"),
221 encode: (mode) => mode === "hold",
222 }),
223 ),
224);
225​
226const QuitConfirmationModeSetting = Schema.Union([QuitConfirmationMode, LegacyConfirmQuit]);
227​
228/**
229 * A user-chosen font family (a single name or a comma-separated list). Empty
230 * means "use the app default"; clients compose their own fallback stacks.
231 */
232export const FontFamilyPreference = Schema.String.check(Schema.isMaxLength(200));
233export type FontFamilyPreference = typeof FontFamilyPreference.Type;
234​
235/**
236 * The environment's theme, set with `t3 theme set <id>`. Each client applies
237 * it once per value — live when connected, on its next connect otherwise — so
238 * setting it switches every client, while a theme a user picks in Settings
239 * afterwards sticks until the next set. Empty means "no environment theme",
240 * which is also how it is cleared.
241 */
242export const DefaultThemePreference = Schema.String.check(Schema.isMaxLength(64));
243// Deliberately absent from ServerSettingsPatch: `t3 theme set` checks that an
244// id is syntactically valid and actually resolvable, and a generic RPC patch
245// would let a client write a theme no client can resolve, bypassing both.
246export type DefaultThemePreference = typeof DefaultThemePreference.Type;
247​
248/**
249 * Defaults for the in-app preview browser, applied whenever a tab is opened
250 * without an explicit viewport/zoom/appearance — by the user opening a browser
251 * tab, or by an agent calling `preview_open` with no size. Recording quality is
252 * client-local for the same reason: the Chromium guest being captured belongs
253 * to the desktop app.
254 */
255export const DEFAULT_BROWSER_VIEWPORT: PreviewViewportSetting = FILL_PREVIEW_VIEWPORT;
256export const DEFAULT_BROWSER_AUTO_SHOW_FLOATING_PREVIEW = true;
257export const BROWSER_RECORDING_FRAME_RATES = [30, 60] as const;
258export const BrowserRecordingFrameRate = Schema.Literals(BROWSER_RECORDING_FRAME_RATES);
259export type BrowserRecordingFrameRate = typeof BrowserRecordingFrameRate.Type;
260export const DEFAULT_BROWSER_RECORDING_FRAME_RATE: BrowserRecordingFrameRate = 30;
261/**
262 * Where a clicked link goes: the OS default browser, or a tab in the in-app
263 * browser beside the thread. "system" is the default because that is what
264 * every link did before the setting existed.
265 */
266export const BrowserLinkTarget = Schema.Literals(["system", "app"]);
267export type BrowserLinkTarget = typeof BrowserLinkTarget.Type;
268export const DEFAULT_BROWSER_LINK_TARGET: BrowserLinkTarget = "system";
269​
270export const LoadBalancingWeights = Schema.Record(
271 TrimmedNonEmptyString,
272 Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 100 })),
273);
274​
275export const DiffColorScheme = Schema.Literals(["red-green", "blue-orange"]);
276​
277export const ClientSettingsSchema = Schema.Struct({
278 diffColorScheme: DiffColorScheme.pipe(
279 Schema.withDecodingDefault(Effect.succeed("red-green" as const)),
280 ),
281 loadBalancingEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
282 loadBalancingWeights: LoadBalancingWeights.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
283 appearanceContrast: AppearanceContrast.pipe(
284 Schema.withDecodingDefault(Effect.succeed(DEFAULT_APPEARANCE_CONTRAST)),
285 ),
286 // Panel motion defaults to zero because width and height transitions cause
287 // layout work on every frame, which is noticeable on lower-power clients.
288 panelAnimationDurationMs: PanelAnimationDurationMs.pipe(
289 Schema.withDecodingDefault(Effect.succeed(DEFAULT_PANEL_ANIMATION_DURATION_MS)),
290 ),
291 browserDefaultViewport: PreviewViewportSetting.pipe(
292 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BROWSER_VIEWPORT)),
293 ),
294 browserDefaultZoomFactor: PreviewZoomFactor.pipe(
295 Schema.withDecodingDefault(Effect.succeed(DEFAULT_PREVIEW_ZOOM_FACTOR)),
296 ),
297 browserDefaultAppearance: PreviewAppearancePreference.pipe(
298 Schema.withDecodingDefault(Effect.succeed(DEFAULT_PREVIEW_APPEARANCE)),
299 ),
300 browserRecordingFrameRate: BrowserRecordingFrameRate.pipe(
301 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BROWSER_RECORDING_FRAME_RATE)),
302 ),
303 /**
304 * Where links clicked in a thread (chat markdown, terminal output) open.
305 * Only the desktop app has an in-app browser, so other clients ignore "app".
306 */
307 browserLinkTarget: BrowserLinkTarget.pipe(
308 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BROWSER_LINK_TARGET)),
309 ),
310 /**
311 * Whether an agent using a preview pops the floating mini player into
312 * view. Only applies when the agent didn't ask either way — an explicit
313 * `open`/`show` on `preview_open` still wins, since that is the agent
314 * deliberately showing or hiding its work.
315 */
316 browserAutoShowFloatingPreview: Schema.Boolean.pipe(
317 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BROWSER_AUTO_SHOW_FLOATING_PREVIEW)),
318 ),
319 /**
320 * User-created browser profiles. The built-in Default and Incognito profiles
321 * are synthesized by `resolveBrowserProfiles`, not stored here, so they
322 * cannot be renamed away or deleted.
323 */
324 browserProfiles: Schema.Array(BrowserProfile).pipe(
325 Schema.withDecodingDefault(Effect.succeed([])),
326 ),
327 /** Profile new tabs open under. Falls back to Default if it no longer exists. */
328 browserDefaultProfileId: BrowserProfileId.pipe(
329 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BROWSER_PROFILE_ID)),
330 ),
331 // Desktop-only. Boolean values from older settings files decode to their
332 // equivalent mode and encode back as the canonical string value.
333 confirmQuit: QuitConfirmationModeSetting.pipe(
334 Schema.withDecodingDefault(Effect.succeed(DEFAULT_QUIT_CONFIRMATION_MODE)),
335 ),
336 confirmThreadArchive: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
337 confirmThreadDelete: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
338 confirmThreadUnpin: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
339 dismissedProviderUpdateNotificationKeys: Schema.Array(TrimmedNonEmptyString).pipe(
340 Schema.withDecodingDefault(Effect.succeed([])),
341 ),
342 diffIgnoreWhitespace: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
343 diffLayout: DiffLayout.pipe(Schema.withDecodingDefault(Effect.succeed(DEFAULT_DIFF_LAYOUT))),
344 environmentIdentificationMode: EnvironmentIdentificationMode.pipe(
345 Schema.withDecodingDefault(Effect.succeed(DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE)),
346 ),
347 glassOpacity: GlassOpacity.pipe(
348 Schema.withDecodingDefault(Effect.succeed(DEFAULT_GLASS_OPACITY)),
349 ),
350 fontSizeInterface: InterfaceFontSize.pipe(
351 Schema.withDecodingDefault(Effect.succeed(DEFAULT_INTERFACE_FONT_SIZE)),
352 ),
353 fontSizePrompt: PromptFontSize.pipe(
354 Schema.withDecodingDefault(Effect.succeed(DEFAULT_PROMPT_FONT_SIZE)),
355 ),
356 fontSizeCode: CodeFontSize.pipe(
357 Schema.withDecodingDefault(Effect.succeed(DEFAULT_CODE_FONT_SIZE)),
358 ),
359 fontSizeTerminal: TerminalFontSize.pipe(
360 Schema.withDecodingDefault(Effect.succeed(DEFAULT_TERMINAL_FONT_SIZE)),
361 ),
362 fontFamilyCode: FontFamilyPreference.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
363 fontFamilyComposer: FontFamilyPreference.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
364 fontFamilySans: FontFamilyPreference.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
365 fontFamilyTerminal: FontFamilyPreference.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
366 // Grayscale `-webkit-font-smoothing: antialiased` (thinner strokes);
367 // disabling restores the platform's heavier default. No effect off macOS.
368 fontSmoothing: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
369 // When the first-run welcome wizard finished (or was skipped), as an ISO
370 // timestamp. `null` alone does not mean "show the wizard" — every install
371 // that predates this field decodes to `null` — so the gate also requires an
372 // empty workspace before it treats the client as a fresh install.
373 onboardingCompletedAt: Schema.NullOr(Schema.String).pipe(
374 Schema.withDecodingDefault(Effect.succeed(null)),
375 ),
376 // Model favorites. Historically keyed by provider kind, now
377 // widened to `ProviderInstanceId` so users can favorite a specific model
378 // on a custom provider instance (e.g. "Codex Personal · gpt-5") without
379 // the UI collapsing it into the same bucket as the default Codex. The
380 // widening is backward-compatible by construction: prior provider-kind
381 // strings satisfy the `ProviderInstanceId` slug schema, so previously
382 // persisted favorites decode unchanged and continue to point at the
383 // default instance for their kind (because `defaultInstanceIdForDriver(kind)`
384 // uses the same slug). The field name is kept as `provider` for storage
385 // stability; new call sites should treat the value as an instance id.
386 favorites: Schema.Array(
387 Schema.Struct({
388 provider: ProviderInstanceId,
389 model: TrimmedNonEmptyString,
390 }),
391 ).pipe(Schema.withDecodingDefault(Effect.succeed([]))),
392 providerModelPreferences: Schema.Record(
393 ProviderInstanceId,
394 Schema.Struct({
395 hiddenModels: Schema.Array(Schema.String).pipe(
396 Schema.withDecodingDefault(Effect.succeed([])),
397 ),
398 modelOrder: Schema.Array(Schema.String).pipe(Schema.withDecodingDefault(Effect.succeed([]))),
399 }),
400 ).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
401 pullRequestMergeMethodOverrides: Schema.Record(
402 TrimmedNonEmptyString,
403 PullRequestMergeMethod,
404 ).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
405 // Legacy plan mode. The composer's Build/Plan toggle was removed from the
406 // default UI; this beta flag restores it (plus the /plan and /default slash
407 // commands) for users who still rely on the old workflow.
408 planModeEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
409 // Legacy context window meter. The composer hides it by default; users who
410 // still want the old usage indicator can restore it from Settings.
411 contextWindowMeterEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
412 // Desktop resting composer: scrolling an existing thread's conversation
413 // settles the composer into its single-line layout. Losing focus never does.
414 composerCollapseOnScroll: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
415 proactivePanelsEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
416 showSkillsInSlashMenu: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
417 // Legacy sidebar (the original per-project tree). Deliberately a fresh key
418 // (was `sidebarV2Enabled` + `sidebarV2ConfiguredByUser`): decoding drops the
419 // old keys, so everyone, including prior beta opt-outs, resets to the new
420 // default sidebar.
421 legacySidebarEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
422 sidebarProjectGroupingMode: SidebarProjectGroupingMode.pipe(
423 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE)),
424 ),
425 sidebarProjectGroupingOverrides: Schema.Record(
426 TrimmedNonEmptyString,
427 SidebarProjectGroupingMode,
428 ).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
429 sidebarProjectSortOrder: SidebarProjectSortOrder.pipe(
430 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_PROJECT_SORT_ORDER)),
431 ),
432 sidebarThreadSortOrder: SidebarThreadSortOrder.pipe(
433 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_THREAD_SORT_ORDER)),
434 ),
435 sidebarThreadPreviewCount: SidebarThreadPreviewCount.pipe(
436 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_THREAD_PREVIEW_COUNT)),
437 ),
438 timestampFormat: TimestampFormat.pipe(
439 Schema.withDecodingDefault(Effect.succeed(DEFAULT_TIMESTAMP_FORMAT)),
440 ),
441 snapShotEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
442 snapShotIncludeAccessibility: Schema.Boolean.pipe(
443 Schema.withDecodingDefault(Effect.succeed(true)),
444 ),
445 snapShotShortcut: SnapShotShortcut.pipe(
446 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SNAP_SHOT_SHORTCUT)),
447 ),
448 snapShotPlaySound: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
449 snapShotSound: SnapShotSound.pipe(
450 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SNAP_SHOT_SOUND)),
451 ),
452 snapShotFlash: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
453 snapShotAnimations: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
454 wordWrap: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
455});
456export type ClientSettings = typeof ClientSettingsSchema.Type;
457​
458export const DEFAULT_CLIENT_SETTINGS: ClientSettings = Schema.decodeSync(ClientSettingsSchema)({});
459​
460// ── Server Settings (server-authoritative) ────────────────────
461​
462const UsageModelTokenPrice = Schema.Number.check(
463 Schema.isFinite(),
464 Schema.isGreaterThanOrEqualTo(0),
465);
466​
467/** USD per million tokens. Omitted cache rates use the input rate. */
468export const UsageModelPriceOverride = Schema.Struct({
469 inputCostPerMillionTokens: UsageModelTokenPrice,
470 outputCostPerMillionTokens: UsageModelTokenPrice,
471 cacheReadCostPerMillionTokens: Schema.optionalKey(UsageModelTokenPrice),
472 cacheWriteCostPerMillionTokens: Schema.optionalKey(UsageModelTokenPrice),
473});
474export type UsageModelPriceOverride = typeof UsageModelPriceOverride.Type;
475​
476const makeBinaryPathSetting = (fallback: string) =>
477 TrimmedString.pipe(
478 Schema.decodeTo(
479 Schema.String,
480 SchemaTransformation.transformOrFail({
481 decode: (value) => Effect.succeed(value || fallback),
482 encode: (value) => Effect.succeed(value),
483 }),
484 ),
485 Schema.withDecodingDefault(Effect.succeed(fallback)),
486 );
487​
488export type ProviderSettingsFormControl = "text" | "password" | "textarea" | "switch" | "select";
489​
490export interface ProviderSettingsFormOption {
491 readonly value: string;
492 readonly label: string;
494​
495export interface ProviderSettingsFormAnnotation {
496 readonly control?: ProviderSettingsFormControl | undefined;
497 readonly placeholder?: string | undefined;
498 readonly hidden?: boolean | undefined;
499 readonly clearWhenEmpty?: "omit" | "persist" | undefined;
500 /** Choices for a `select` control. The first entry is the default. */
501 readonly options?: ReadonlyArray<ProviderSettingsFormOption> | undefined;
503​
504export interface ProviderSettingsFormSchemaAnnotation {
505 readonly order?: readonly string[] | undefined;
507​
508declare module "effect/Schema" {
509 namespace Annotations {
510 interface Annotations {
511 readonly providerSettingsForm?: ProviderSettingsFormAnnotation | undefined;
512 readonly providerSettingsFormSchema?: ProviderSettingsFormSchemaAnnotation | undefined;
513 }
514 }
516​
517export type ProviderSettingsOrder<Fields extends Schema.Struct.Fields> = readonly Extract<
518 keyof Fields,
519 string
520>[];
521​
522function makeProviderSettingsSchema<const Fields extends Schema.Struct.Fields>(
523 fields: Fields,
524 options?: {
525 readonly order?: ProviderSettingsOrder<Fields> | undefined;
526 },
527): Schema.Struct<Fields> {
528 return Schema.Struct(fields).pipe(
529 Schema.annotate({
530 providerSettingsFormSchema:
531 options?.order === undefined ? undefined : { order: options.order },
532 }),
533 );
535​
536export const CodexSettings = makeProviderSettingsSchema(
537 {
538 enabled: Schema.Boolean.pipe(
539 Schema.withDecodingDefault(Effect.succeed(true)),
540 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
541 ),
542 binaryPath: makeBinaryPathSetting("codex").pipe(
543 Schema.annotateKey({
544 title: "Binary path",
545 description: "Path to the Codex binary used by this instance.",
546 providerSettingsForm: { placeholder: "codex", clearWhenEmpty: "omit" },
547 }),
548 ),
549 homePath: TrimmedString.pipe(
550 Schema.withDecodingDefault(Effect.succeed("")),
551 Schema.annotateKey({
552 title: "CODEX_HOME path",
553 description: "Custom Codex home and config directory.",
554 providerSettingsForm: {
555 placeholder: "~/.codex",
556 clearWhenEmpty: "omit",
557 },
558 }),
559 ),
560 shadowHomePath: TrimmedString.pipe(
561 Schema.withDecodingDefault(Effect.succeed("")),
562 Schema.annotateKey({
563 title: "Shadow home path",
564 description:
565 "Account-specific Codex home. Keeps auth.json separate while sharing state from CODEX_HOME.",
566 providerSettingsForm: {
567 placeholder: "~/.codex-t3/personal",
568 clearWhenEmpty: "omit",
569 },
570 }),
571 ),
572 launchArgs: TrimmedString.pipe(
573 Schema.withDecodingDefault(Effect.succeed("")),
574 Schema.annotateKey({
575 title: "Launch arguments",
576 description: "Additional CLI arguments passed to codex app-server on session start.",
577 }),
578 ),
579 customModels: Schema.Array(CustomModelSetting).pipe(
580 Schema.withDecodingDefault(Effect.succeed([])),
581 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
582 ),
583 },
584 {
585 order: ["binaryPath", "homePath", "shadowHomePath", "launchArgs"],
586 },
587);
588export type CodexSettings = typeof CodexSettings.Type;
589​
590// Empty, or an integer from 100,000 to 1,000,000. Shared by the full
591// Claude settings schema and its patch so an out-of-range value fails at
592// the update that introduced it.
593const CLAUDE_AUTO_COMPACT_WINDOW_PATTERN = /^(?:|[1-9]\d{5}|1000000)$/;
594​
595export const ClaudeSettings = makeProviderSettingsSchema(
596 {
597 enabled: Schema.Boolean.pipe(
598 Schema.withDecodingDefault(Effect.succeed(true)),
599 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
600 ),
601 binaryPath: makeBinaryPathSetting("claude").pipe(
602 Schema.annotateKey({
603 title: "Binary path",
604 description: "Path to the Claude binary used by this instance.",
605 providerSettingsForm: { placeholder: "claude", clearWhenEmpty: "omit" },
606 }),
607 ),
608 homePath: TrimmedString.pipe(
609 Schema.withDecodingDefault(Effect.succeed("")),
610 Schema.annotateKey({
611 title: "CLAUDE_CONFIG_DIR path",
612 description:
613 "Custom Claude home and config directory. Keeps .claude.json and .claude separate.",
614 providerSettingsForm: { placeholder: "~/.claude", clearWhenEmpty: "omit" },
615 }),
616 ),
617 customModels: Schema.Array(CustomModelSetting).pipe(
618 Schema.withDecodingDefault(Effect.succeed([])),
619 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
620 ),
621 launchArgs: Schema.String.pipe(
622 Schema.withDecodingDefault(Effect.succeed("")),
623 Schema.annotateKey({
624 title: "Launch arguments",
625 description: "Additional CLI arguments passed on session start.",
626 providerSettingsForm: {
627 placeholder: "e.g. --chrome",
628 clearWhenEmpty: "omit",
629 },
630 }),
631 ),
632 autoCompactWindow: TrimmedString.check(
633 Schema.isPattern(CLAUDE_AUTO_COMPACT_WINDOW_PATTERN),
634 ).pipe(
635 Schema.withDecodingDefault(Effect.succeed("")),
636 Schema.annotateKey({
637 title: "Auto-compact after",
638 description:
639 "Compact after 100,000 to 1,000,000 tokens. Leave empty to use Claude's default.",
640 providerSettingsForm: {
641 placeholder: "e.g. 300000",
642 clearWhenEmpty: "omit",
643 },
644 }),
645 ),
646 },
647 {
648 order: ["binaryPath", "homePath", "autoCompactWindow", "launchArgs"],
649 },
650);
651export type ClaudeSettings = typeof ClaudeSettings.Type;
652​
653export const CursorSettings = makeProviderSettingsSchema(
654 {
655 // Off by default like Grok and OpenCode. Users opt in from Settings.
656 enabled: Schema.Boolean.pipe(
657 Schema.withDecodingDefault(Effect.succeed(false)),
658 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
659 ),
660 binaryPath: makeBinaryPathSetting("cursor-agent").pipe(
661 Schema.annotateKey({
662 title: "Binary path",
663 description: "Path to the Cursor agent binary.",
664 providerSettingsForm: { placeholder: "cursor-agent", clearWhenEmpty: "omit" },
665 }),
666 ),
667 apiEndpoint: TrimmedString.pipe(
668 Schema.withDecodingDefault(Effect.succeed("")),
669 Schema.annotateKey({
670 title: "API endpoint",
671 description: "Override the Cursor API endpoint for this instance.",
672 providerSettingsForm: {
673 placeholder: "https://...",
674 clearWhenEmpty: "omit",
675 },
676 }),
677 ),
678 customModels: Schema.Array(CustomModelSetting).pipe(
679 Schema.withDecodingDefault(Effect.succeed([])),
680 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
681 ),
682 },
683 {
684 order: ["binaryPath", "apiEndpoint"],
685 },
686);
687export type CursorSettings = typeof CursorSettings.Type;
688​
689export const GrokSettings = makeProviderSettingsSchema(
690 {
691 // Off by default (like Cursor and OpenCode): the binding is not yet
692 // stable enough to probe on every install. Users opt in from Settings.
693 enabled: Schema.Boolean.pipe(
694 Schema.withDecodingDefault(Effect.succeed(false)),
695 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
696 ),
697 binaryPath: makeBinaryPathSetting("grok").pipe(
698 Schema.annotateKey({
699 title: "Binary path",
700 description: "Path to the Grok CLI binary.",
701 providerSettingsForm: { placeholder: "grok", clearWhenEmpty: "omit" },
702 }),
703 ),
704 customModels: Schema.Array(CustomModelSetting).pipe(
705 Schema.withDecodingDefault(Effect.succeed([])),
706 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
707 ),
708 },
709 {
710 order: ["binaryPath"],
711 },
712);
713export type GrokSettings = typeof GrokSettings.Type;
714​
715/**
716 * Antigravity ACP auth methods. Personal and Enterprise open a Google sign-in
717 * in the browser. The API key and Agent Platform methods take credentials from
718 * the instance config and never open a browser.
719 */
720export const ANTIGRAVITY_AUTH_METHODS = [
721 { value: "oauth-personal", label: "Google account" },
722 { value: "oauth-business", label: "Gemini Enterprise" },
723 { value: "gemini-api-key", label: "Gemini API key" },
724 { value: "agent-platform", label: "Agent Platform (Vertex AI)" },
725] as const satisfies ReadonlyArray<ProviderSettingsFormOption>;
726export const AntigravityAuthMethod = Schema.Literals(
727 ANTIGRAVITY_AUTH_METHODS.map((method) => method.value),
728);
729export type AntigravityAuthMethod = typeof AntigravityAuthMethod.Type;
730​
731export const AntigravitySettings = makeProviderSettingsSchema(
732 {
733 enabled: Schema.Boolean.pipe(
734 Schema.withDecodingDefault(Effect.succeed(false)),
735 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
736 ),
737 authMethod: AntigravityAuthMethod.pipe(
738 Schema.withDecodingDefault(Effect.succeed("oauth-personal" as const)),
739 Schema.annotateKey({
740 title: "Sign-in method",
741 description:
742 "Google account uses your Antigravity subscription. Gemini Enterprise needs a GCP project and location. API key and Agent Platform bill the credential you enter.",
743 providerSettingsForm: {
744 control: "select",
745 options: ANTIGRAVITY_AUTH_METHODS,
746 clearWhenEmpty: "omit",
747 },
748 }),
749 ),
750 apiKey: TrimmedString.pipe(
751 Schema.withDecodingDefault(Effect.succeed("")),
752 Schema.annotateKey({
753 title: "API key",
754 description:
755 "Gemini API key, or a Vertex AI express key for Agent Platform. Stored in plain text on this environment.",
756 providerSettingsForm: {
757 control: "password",
758 placeholder: "Optional",
759 clearWhenEmpty: "omit",
760 },
761 }),
762 ),
763 gcpProject: TrimmedString.pipe(
764 Schema.withDecodingDefault(Effect.succeed("")),
765 Schema.annotateKey({
766 title: "GCP project",
767 description:
768 "Required for Gemini Enterprise. Agent Platform uses it when no API key is set.",
769 providerSettingsForm: { placeholder: "my-project-id", clearWhenEmpty: "omit" },
770 }),
771 ),
772 gcpLocation: TrimmedString.pipe(
773 Schema.withDecodingDefault(Effect.succeed("")),
774 Schema.annotateKey({
775 title: "GCP location",
776 description: "Region for Gemini Enterprise or Agent Platform, such as us-central1.",
777 providerSettingsForm: { placeholder: "us-central1", clearWhenEmpty: "omit" },
778 }),
779 ),
780 binaryPath: TrimmedString.pipe(
781 Schema.withDecodingDefault(Effect.succeed("")),
782 Schema.annotateKey({
783 title: "Binary path",
784 description:
785 "Optional path to the official Antigravity ACP executable. Leave empty for automatic selection.",
786 providerSettingsForm: { placeholder: "Automatic", clearWhenEmpty: "persist" },
787 }),
788 ),
789 customModels: Schema.Array(CustomModelSetting).pipe(
790 Schema.withDecodingDefault(Effect.succeed([])),
791 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
792 ),
793 },
794 { order: ["authMethod", "apiKey", "gcpProject", "gcpLocation", "binaryPath"] },
795);
796export type AntigravitySettings = typeof AntigravitySettings.Type;
797​
798export const OpenCodeSettings = makeProviderSettingsSchema(
799 {
800 // Off by default (like Cursor and Grok): the binding is not yet stable
801 // enough to probe on every install. Users opt in from Settings.
802 enabled: Schema.Boolean.pipe(
803 Schema.withDecodingDefault(Effect.succeed(false)),
804 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
805 ),
806 binaryPath: makeBinaryPathSetting("opencode").pipe(
807 Schema.annotateKey({
808 title: "Binary path",
809 description: "Path to the OpenCode binary.",
810 providerSettingsForm: {
811 placeholder: "opencode",
812 clearWhenEmpty: "omit",
813 },
814 }),
815 ),
816 serverUrl: TrimmedString.pipe(
817 Schema.withDecodingDefault(Effect.succeed("")),
818 Schema.annotateKey({
819 title: "Server URL",
820 description: "Leave blank to let T3 Code spawn the server when needed.",
821 providerSettingsForm: {
822 placeholder: "http://127.0.0.1:4096",
823 clearWhenEmpty: "omit",
824 },
825 }),
826 ),
827 serverPassword: TrimmedString.pipe(
828 Schema.withDecodingDefault(Effect.succeed("")),
829 Schema.annotateKey({
830 title: "Server password",
831 description: "Stored in plain text on disk.",
832 providerSettingsForm: {
833 control: "password",
834 placeholder: "Optional",
835 clearWhenEmpty: "omit",
836 },
837 }),
838 ),
839 customModels: Schema.Array(CustomModelSetting).pipe(
840 Schema.withDecodingDefault(Effect.succeed([])),
841 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
842 ),
843 },
844 {
845 order: ["binaryPath", "serverUrl", "serverPassword"],
846 },
847);
848export type OpenCodeSettings = typeof OpenCodeSettings.Type;
849​
850/**
851 * A read-only quota source outside this environment's provider CLIs. The
852 * only kind today is a CLIProxyAPI hub, whose management API reports the
853 * windows of every pooled account. The key travels in settings for now, like
854 * provider environment secrets; it is redacted before reaching a client.
855 */
856export const UsageLimitSourceConfig = Schema.Struct({
857 kind: Schema.Literal("cliproxy"),
858 label: Schema.optional(TrimmedNonEmptyString),
859 url: TrimmedNonEmptyString,
860 managementKey: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
861 enabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
862});
863export type UsageLimitSourceConfig = typeof UsageLimitSourceConfig.Type;
864​
865export const ObservabilitySettings = Schema.Struct({
866 otlpTracesUrl: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
867 otlpMetricsUrl: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
868});
869export type ObservabilitySettings = typeof ObservabilitySettings.Type;
870​
871export const SourceControlWritingStyleMode = Schema.Literals([
872 "repo_conventions",
873 "conventional_commits",
874 "custom",
875]);
876export type SourceControlWritingStyleMode = typeof SourceControlWritingStyleMode.Type;
877​
878export const SourceControlWritingStyleSettings = Schema.Struct({
879 mode: SourceControlWritingStyleMode.pipe(
880 Schema.withDecodingDefault(Effect.succeed("repo_conventions" as const)),
881 ),
882 customInstructions: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
883 followChangeRequestTemplates: Schema.Boolean.pipe(
884 Schema.withDecodingDefault(Effect.succeed(true)),
885 ),
886});
887export type SourceControlWritingStyleSettings = typeof SourceControlWritingStyleSettings.Type;
888​
889export const DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL = Duration.seconds(30);
890export const DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL = Duration.minutes(5);
891​
892export const BackgroundActivityProfile = Schema.Literals([
893 "balanced",
894 "performance",
895 "battery-saver",
896]);
897export type BackgroundActivityProfile = typeof BackgroundActivityProfile.Type;
898export const DEFAULT_BACKGROUND_ACTIVITY_PROFILE: BackgroundActivityProfile = "balanced";
899​
900export const BackgroundActivityProfileSelection = Schema.Literals([
901 "balanced",
902 "performance",
903 "battery-saver",
904 "custom",
905]);
906export type BackgroundActivityProfileSelection = typeof BackgroundActivityProfileSelection.Type;
907​
908export const BackgroundActivityOverrides = Schema.Struct({
909 automaticGitFetchInterval: Schema.optionalKey(Schema.DurationFromMillis),
910 providerHealthRefreshInterval: Schema.optionalKey(Schema.DurationFromMillis),
911 hostPowerMonitorActiveInterval: Schema.optionalKey(Schema.DurationFromMillis),
912 hostPowerMonitorIdleInterval: Schema.optionalKey(Schema.DurationFromMillis),
913 idleClientTtl: Schema.optionalKey(Schema.DurationFromMillis),
914 pauseWhenHostLocked: Schema.optionalKey(Schema.Boolean),
915 pauseWhenHostLowPower: Schema.optionalKey(Schema.Boolean),
916 pauseWhenClientLowPower: Schema.optionalKey(Schema.Boolean),
917 pauseWhenOnBattery: Schema.optionalKey(Schema.Boolean),
918});
919export type BackgroundActivityOverrides = typeof BackgroundActivityOverrides.Type;
920​
921export const BackgroundActivitySettings = Schema.Struct({
922 schemaVersion: Schema.Literal(1).pipe(Schema.withDecodingDefault(Effect.succeed(1 as const))),
923 profile: BackgroundActivityProfileSelection.pipe(
924 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BACKGROUND_ACTIVITY_PROFILE)),
925 ),
926 baseProfile: Schema.optionalKey(BackgroundActivityProfile),
927 overrides: BackgroundActivityOverrides.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
928}).pipe(Schema.withDecodingDefault(Effect.succeed({})));
929export type BackgroundActivitySettings = typeof BackgroundActivitySettings.Type;
930​
931export const ServerSettings = Schema.Struct({
932 // Legacy token-by-token assistant output. Deliberately a fresh key (was
933 // `enableAssistantStreaming`): decoding drops the old key, so everyone,
934 // including prior opt-ins, resets to the buffered default.
935 enableLegacyTokenStreaming: Schema.Boolean.pipe(
936 Schema.withDecodingDefault(Effect.succeed(false)),
937 ),
938 enableProviderUpdateChecks: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
939 // Retain the update-era key; recovery now needs an environment-owned opt-in.
940 continueThreadsAfterServerUpdate: Schema.Boolean.pipe(
941 Schema.withDecodingDefault(Effect.succeed(false)),
942 ),
943 /**
944 * Whether agents may drive the in-app preview browser. Turning this off
945 * withholds the MCP credential, so the `t3-code` server (and with it every
946 * `preview_*` tool) is never attached to a provider session, and the prompt
947 * text describing those tools is dropped along with them. The user's own
948 * browser panel is unaffected — this gates agent access only.
949 *
950 * Server-authoritative rather than client-local: tool injection and prompt
951 * construction both happen on the server, and the answer must not differ
952 * between a desktop window and a phone attached to the same server.
953 */
954 enableAgentBrowserAccess: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
955 projectAgentBrowserAccessOverrides: Schema.Record(ProjectId, Schema.Boolean).pipe(
956 Schema.withDecodingDefault(Effect.succeed({})),
957 ),
958 defaultAutoPull: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
959 defaultProjectScripts: Schema.Array(ProjectScript).pipe(
960 Schema.withDecodingDefault(Effect.succeed([])),
961 ),
962 projectScriptOverrides: Schema.Record(ProjectId, Schema.NullOr(Schema.Array(ProjectScript))).pipe(
963 Schema.withDecodingDefault(Effect.succeed({})),
964 ),
965 projectAutoPullOverrides: Schema.Record(ProjectId, Schema.Boolean).pipe(
966 Schema.withDecodingDefault(Effect.succeed({})),
967 ),
968 defaultModelSelection: Schema.NullOr(ModelSelection).pipe(
969 Schema.withDecodingDefault(Effect.succeed(null)),
970 ),
971 /**
972 * Whether agents may drive simulators and emulators. Gates the `device_*`
973 * MCP tools and the preconfigured `agent-device` CLI the same way
974 * `enableAgentBrowserAccess` gates the browser: server-authoritative, applied
975 * when the provider session is prepared. The user's own Device panel is
976 * unaffected.
977 */
978 enableAgentDeviceAccess: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
979 /**
980 * Whether this server may install and run T3's device helper processes.
981 * Kept separate from agent access so enabling the user's Device panel does
982 * not also grant providers control of simulators and emulators.
983 */
984 enableDeviceSupport: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
985 /** Whether the server-local Device panel setup flow has been completed. */
986 deviceOnboardingCompleted: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
987 deviceHosts: SshDeviceHostConfigs.pipe(Schema.withDecodingDefault(Effect.succeed([]))),
988 sidebarAutoSettleAfterDays: Schema.NullOr(SidebarAutoSettleAfterDays).pipe(
989 Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS)),
990 ),
991 sidebarAutoSettleOnMerge: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
992 backgroundActivity: BackgroundActivitySettings,
993 // Legacy flat fields retained for old settings files and old clients. New
994 // consumers should resolve `backgroundActivity` instead.
995 automaticGitFetchInterval: Schema.DurationFromMillis.pipe(
996 Schema.withDecodingDefault(
997 Effect.succeed(Duration.toMillis(DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL)),
998 ),
999 ),
1000 providerHealthRefreshInterval: Schema.DurationFromMillis.pipe(
1001 Schema.withDecodingDefault(
1002 Effect.succeed(Duration.toMillis(DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL)),
1003 ),
1004 ),
1005 backgroundActivityProfile: BackgroundActivityProfile.pipe(
1006 Schema.withDecodingDefault(Effect.succeed(DEFAULT_BACKGROUND_ACTIVITY_PROFILE)),
1007 ),
1008 defaultTheme: DefaultThemePreference.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
1009 /**
1010 * When the environment's theme was last set, so clients can tell a re-set
1011 * of the same value from one they already applied: `t3 theme set` must act
1012 * even when it names the theme it named before. Empty on environments
1013 * provisioned by builds that predate it, where clients fall back to
1014 * applying once per value.
1015 */
1016 defaultThemeSetAt: Schema.String.check(Schema.isMaxLength(64)).pipe(
1017 Schema.withDecodingDefault(Effect.succeed("")),
1018 ),
1019 /**
1020 * The icon clients draw for this environment. Null means "use what the
1021 * server detected" (`environment.platform.machine`), falling back to a
1022 * generic server. Lives on the server, not the client, so every device
1023 * sees the same machine. A kind picked on a newer server decodes as null
1024 * here rather than failing the whole settings snapshot for an older client.
1025 */
1026 environmentIcon: ForwardCompatibleNullable(EnvironmentMachineKind).pipe(
1027 Schema.withDecodingDefault(Effect.succeed(null)),
1028 ),
1029 defaultThreadEnvMode: ThreadEnvMode.pipe(
1030 Schema.withDecodingDefault(Effect.succeed("local" as const satisfies ThreadEnvMode)),
1031 ),
1032 newWorktreesStartFromOrigin: Schema.Boolean.pipe(
1033 Schema.withDecodingDefault(Effect.succeed(true)),
1034 ),
1035 addProjectBaseDirectory: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
1036 textGenerationModelSelection: ModelSelection.pipe(
1037 Schema.withDecodingDefault(
1038 Effect.succeed({
1039 instanceId: ProviderInstanceId.make("codex"),
1040 model: DEFAULT_TEXT_GENERATION_MODEL,
1041 options: [
1043 id: "reasoningEffort",
1044 value: DEFAULT_TEXT_GENERATION_REASONING_EFFORT,
1045 },
1046 ],
1047 }),
1048 ),
1049 ),
1050 sourceControlWritingStyle: SourceControlWritingStyleSettings.pipe(
1051 Schema.withDecodingDefault(Effect.succeed({})),
1052 ),
1053 sourceControlWriterModelSelection: Schema.NullOr(ModelSelection).pipe(
1054 Schema.withDecodingDefault(Effect.succeed(null)),
1055 ),
1056​
1057 // Legacy single-instance-per-driver settings. Continues to be the source
1058 // of truth until `providerInstances` (below) lands per-driver migration
1059 // shims and the server starts hydrating instances from it. Driver-specific
1060 // schemas live here for the duration of the migration; once each driver
1061 // owns its config in its own package, this struct shrinks to nothing and
1062 // is removed entirely.
1063 providers: Schema.Struct({
1064 codex: CodexSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1065 claudeAgent: ClaudeSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1066 cursor: CursorSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1067 grok: GrokSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1068 opencode: OpenCodeSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1069 antigravity: AntigravitySettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1070 }).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1071 // New driver-agnostic instance map. Keyed by `ProviderInstanceId`; values
1072 // are `ProviderInstanceConfig` envelopes. The driver-specific config blob
1073 // is `Schema.Unknown` at this layer so envelopes with unknown drivers
1074 // (forks, downgrades, in-flight PR branches) round-trip without loss.
1075 // See providerInstance.ts for the forward/backward compatibility invariant.
1076 providerInstances: Schema.Record(ProviderInstanceId, ProviderInstanceConfig).pipe(
1077 Schema.withDecodingDefault(Effect.succeed({})),
1078 ),
1079 observability: ObservabilitySettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
1080 // Keyed by a user-chosen id so a source keeps its rows across edits. Entries
1081 // this build cannot decode round-trip untouched, as provider instances do.
1082 usageLimitSources: Schema.Record(UsageLimitSourceId, UsageLimitSourceConfig).pipe(
1083 Schema.withDecodingDefault(Effect.succeed({})),
1084 ),
1085 /** Exact model IDs, applied to past and future usage on this environment. */
1086 usagePriceOverrides: Schema.Record(TrimmedNonEmptyString, UsageModelPriceOverride).pipe(
1087 Schema.withDecodingDefault(Effect.succeed({})),
1088 ),
1089});
1090export type ServerSettings = typeof ServerSettings.Type;
1091​
1092export const DEFAULT_SERVER_SETTINGS: ServerSettings = Schema.decodeSync(ServerSettings)({});
1093​
1094/**
1095 * Read the legacy `enabled` flag embedded in a provider instance config
1096 * blob. The envelope-level `ProviderInstanceConfig.enabled` is the single
1097 * flag going forward; this reader exists for legacy `providers.<kind>`
1098 * blobs and old settings files that still carry the flag in-config.
1099 */
1100export const providerInstanceConfigEnabledFlag = (config: unknown): boolean | undefined => {
1101 if (config === null || typeof config !== "object" || Array.isArray(config)) {
1102 return undefined;
1104 const enabled = (config as { readonly enabled?: unknown }).enabled;
1105 return typeof enabled === "boolean" ? enabled : undefined;
1107​
1108/**
1109 * Default enabled state for a built-in driver when neither the envelope nor
1110 * the config blob carries a flag. Derived from the driver's settings schema
1111 * through `DEFAULT_SERVER_SETTINGS`, so the schema's decoding default stays
1112 * the single source of truth. Unknown (fork) drivers default to enabled.
1113 */
1114const defaultEnabledForDriver = (driver: ProviderDriverKind): boolean => {
1115 const legacyDefaults = DEFAULT_SERVER_SETTINGS.providers as Record<
1116 string,
1117 { readonly enabled?: boolean } | undefined
1118 >;
1119 return legacyDefaults[driver]?.enabled ?? true;
1121​
1122/**
1123 * Resolve whether a configured provider instance is enabled. An explicit
1124 * false on either the envelope or the in-config flag wins (most
1125 * restrictive), so a user's disable is never silently undone by the other
1126 * flag. Otherwise: envelope, then config, then the driver's default.
1127 */
1128export const resolveProviderInstanceEnabled = (
1129 instance: Pick<ProviderInstanceConfig, "driver" | "enabled" | "config">,
1130): boolean => {
1131 const configEnabled = providerInstanceConfigEnabledFlag(instance.config);
1132 if (instance.enabled === false || configEnabled === false) {
1133 return false;
1135 return instance.enabled ?? configEnabled ?? defaultEnabledForDriver(instance.driver);
1137​
1138export const ServerSettingsOperation = Schema.Literals([
1139 "normalize",
1140 "check-exists",
1141 "read-file",
1142 "read-provider-history",
1143 "read-secret",
1144 "remove-secret",
1145 "remove-stale-secret",
1146 "write-secret",
1147 "write-file",
1148 "prepare-directory",
1149]);
1150export type ServerSettingsOperation = typeof ServerSettingsOperation.Type;
1151​
1152export class ServerSettingsError extends Schema.TaggedError<ServerSettingsError>()(
1153 "ServerSettingsError",
1155 settingsPath: Schema.String,
1156 operation: ServerSettingsOperation,
1157 providerInstanceId: Schema.optional(Schema.String),
1158 environmentVariable: Schema.optional(Schema.String),
1159 cause: Schema.Defect(),
1160 },
1161) {
1162 override get message(): string {
1163 const provider =
1164 this.providerInstanceId === undefined ? "" : ` for provider ${this.providerInstanceId}`;
1165 const variable =
1166 this.environmentVariable === undefined
1167 ? ""
1168 : ` and environment variable ${this.environmentVariable}`;
1169 return `Server settings ${this.operation} failed${provider}${variable} at ${this.settingsPath}.`;
1172​
1173// ── Unified type ─────────────────────────────────────────────────────
1174​
1175export type UnifiedSettings = ServerSettings & ClientSettings;
1176export const DEFAULT_UNIFIED_SETTINGS: UnifiedSettings = {
1177 ...DEFAULT_SERVER_SETTINGS,
1178 ...DEFAULT_CLIENT_SETTINGS,
1180​
1181// ── Server Settings Patch (replace with a Schema.deepPartial if available) ──────────────────────────────────────────
1182​
1183const ModelSelectionPatch = Schema.Struct({
1184 instanceId: Schema.optionalKey(ProviderInstanceId),
1185 model: Schema.optionalKey(TrimmedNonEmptyString),
1186 options: Schema.optionalKey(ProviderOptionSelections),
1187});
1188​
1189const CodexSettingsPatch = Schema.Struct({
1190 enabled: Schema.optionalKey(Schema.Boolean),
1191 binaryPath: Schema.optionalKey(TrimmedString),
1192 homePath: Schema.optionalKey(TrimmedString),
1193 shadowHomePath: Schema.optionalKey(TrimmedString),
1194 launchArgs: Schema.optionalKey(TrimmedString),
1195 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1196});
1197​
1198const ClaudeSettingsPatch = Schema.Struct({
1199 enabled: Schema.optionalKey(Schema.Boolean),
1200 binaryPath: Schema.optionalKey(TrimmedString),
1201 homePath: Schema.optionalKey(TrimmedString),
1202 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1203 launchArgs: Schema.optionalKey(TrimmedString),
1204 // Validated at the patch boundary so a typo fails the one update with a
1205 // schema error instead of a generic whole-settings failure.
1206 autoCompactWindow: Schema.optionalKey(
1207 TrimmedString.check(Schema.isPattern(CLAUDE_AUTO_COMPACT_WINDOW_PATTERN)),
1208 ),
1209});
1210​
1211const CursorSettingsPatch = Schema.Struct({
1212 enabled: Schema.optionalKey(Schema.Boolean),
1213 binaryPath: Schema.optionalKey(TrimmedString),
1214 apiEndpoint: Schema.optionalKey(TrimmedString),
1215 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1216});
1217​
1218const GrokSettingsPatch = Schema.Struct({
1219 enabled: Schema.optionalKey(Schema.Boolean),
1220 binaryPath: Schema.optionalKey(TrimmedString),
1221 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1222});
1223​
1224const AntigravitySettingsPatch = Schema.Struct({
1225 enabled: Schema.optionalKey(Schema.Boolean),
1226 authMethod: Schema.optionalKey(AntigravityAuthMethod),
1227 apiKey: Schema.optionalKey(TrimmedString),
1228 gcpProject: Schema.optionalKey(TrimmedString),
1229 gcpLocation: Schema.optionalKey(TrimmedString),
1230 binaryPath: Schema.optionalKey(TrimmedString),
1231 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1232});
1233​
1234const OpenCodeSettingsPatch = Schema.Struct({
1235 enabled: Schema.optionalKey(Schema.Boolean),
1236 binaryPath: Schema.optionalKey(TrimmedString),
1237 serverUrl: Schema.optionalKey(TrimmedString),
1238 serverPassword: Schema.optionalKey(TrimmedString),
1239 customModels: Schema.optionalKey(Schema.Array(CustomModelSetting)),
1240});
1241​
1242export const ServerSettingsPatch = Schema.Struct({
1243 // Server settings
1244 enableLegacyTokenStreaming: Schema.optionalKey(Schema.Boolean),
1245 enableProviderUpdateChecks: Schema.optionalKey(Schema.Boolean),
1246 continueThreadsAfterServerUpdate: Schema.optionalKey(Schema.Boolean),
1247 enableAgentBrowserAccess: Schema.optionalKey(Schema.Boolean),
1248 projectAgentBrowserAccessOverrides: Schema.optionalKey(
1249 Schema.Record(ProjectId, Schema.NullOr(Schema.Boolean)),
1250 ),
1251 defaultAutoPull: Schema.optionalKey(Schema.Boolean),
1252 defaultProjectScripts: Schema.optionalKey(Schema.Array(ProjectScript)),
1253 projectScriptOverrides: Schema.optionalKey(
1254 Schema.Record(ProjectId, Schema.NullOr(Schema.Array(ProjectScript))),
1255 ),
1256 projectAutoPullOverrides: Schema.optionalKey(
1257 Schema.Record(ProjectId, Schema.NullOr(Schema.Boolean)),
1258 ),
1259 defaultModelSelection: Schema.optionalKey(Schema.NullOr(ModelSelection)),
1260 enableAgentDeviceAccess: Schema.optionalKey(Schema.Boolean),
1261 enableDeviceSupport: Schema.optionalKey(Schema.Boolean),
1262 deviceOnboardingCompleted: Schema.optionalKey(Schema.Boolean),
1263 deviceHosts: Schema.optionalKey(SshDeviceHostConfigs),
1264 sidebarAutoSettleAfterDays: Schema.optionalKey(Schema.NullOr(SidebarAutoSettleAfterDays)),
1265 sidebarAutoSettleOnMerge: Schema.optionalKey(Schema.Boolean),
1266 backgroundActivity: Schema.optionalKey(
1267 Schema.Struct({
1268 schemaVersion: Schema.optionalKey(Schema.Literal(1)),
1269 profile: Schema.optionalKey(BackgroundActivityProfileSelection),
1270 baseProfile: Schema.optionalKey(BackgroundActivityProfile),
1271 overrides: Schema.optionalKey(BackgroundActivityOverrides),
1272 }),
1273 ),
1274 automaticGitFetchInterval: Schema.optionalKey(Schema.DurationFromMillis),
1275 providerHealthRefreshInterval: Schema.optionalKey(Schema.DurationFromMillis),
1276 backgroundActivityProfile: Schema.optionalKey(BackgroundActivityProfile),
1277 environmentIcon: Schema.optionalKey(Schema.NullOr(EnvironmentMachineKind)),
1278 defaultThreadEnvMode: Schema.optionalKey(ThreadEnvMode),
1279 newWorktreesStartFromOrigin: Schema.optionalKey(Schema.Boolean),
1280 addProjectBaseDirectory: Schema.optionalKey(TrimmedString),
1281 textGenerationModelSelection: Schema.optionalKey(ModelSelectionPatch),
1282 sourceControlWritingStyle: Schema.optionalKey(
1283 Schema.Struct({
1284 mode: Schema.optionalKey(SourceControlWritingStyleMode),
1285 customInstructions: Schema.optionalKey(TrimmedString),
1286 followChangeRequestTemplates: Schema.optionalKey(Schema.Boolean),
1287 }),
1288 ),
1289 sourceControlWriterModelSelection: Schema.optionalKey(Schema.NullOr(ModelSelection)),
1290 observability: Schema.optionalKey(
1291 Schema.Struct({
1292 otlpTracesUrl: Schema.optionalKey(TrimmedString),
1293 otlpMetricsUrl: Schema.optionalKey(TrimmedString),
1294 }),
1295 ),
1296 providers: Schema.optionalKey(
1297 Schema.Struct({
1298 codex: Schema.optionalKey(CodexSettingsPatch),
1299 claudeAgent: Schema.optionalKey(ClaudeSettingsPatch),
1300 cursor: Schema.optionalKey(CursorSettingsPatch),
1301 grok: Schema.optionalKey(GrokSettingsPatch),
1302 opencode: Schema.optionalKey(OpenCodeSettingsPatch),
1303 antigravity: Schema.optionalKey(AntigravitySettingsPatch),
1304 }),
1305 ),
1306 // Whole-map replacement for the new instance config. Patching individual
1307 // entries is intentionally out of scope: the map is small, and partial
1308 // patches risk leaving driver-specific config in a half-merged state.
1309 // The web UI sends a fully-formed map every time it edits this field.
1310 providerInstances: Schema.optionalKey(Schema.Record(ProviderInstanceId, ProviderInstanceConfig)),
1311 // Per-entry, unlike `providerInstances`: a client only ever adds or removes
1312 // one source, and sending the whole map races another edit that has not
1313 // echoed back yet. `null` removes; the server merges into its current map.
1314 usageLimitSources: Schema.optionalKey(
1315 Schema.Record(UsageLimitSourceId, Schema.NullOr(UsageLimitSourceConfig)),
1316 ),
1317 /** Each entry replaces one model's rates; `null` restores automatic pricing. */
1318 usagePriceOverrides: Schema.optionalKey(
1319 Schema.Record(TrimmedNonEmptyString, Schema.NullOr(UsageModelPriceOverride)),
1320 ),
1321});
1322export type ServerSettingsPatch = typeof ServerSettingsPatch.Type;
1323​
1324export const ClientSettingsPatch = Schema.Struct({
1325 diffColorScheme: Schema.optionalKey(DiffColorScheme),
1326 loadBalancingEnabled: Schema.optionalKey(Schema.Boolean),
1327 loadBalancingWeights: Schema.optionalKey(LoadBalancingWeights),
1328 appearanceContrast: Schema.optionalKey(AppearanceContrast),
1329 panelAnimationDurationMs: Schema.optionalKey(PanelAnimationDurationMs),
1330 browserDefaultViewport: Schema.optionalKey(PreviewViewportSetting),
1331 browserDefaultZoomFactor: Schema.optionalKey(PreviewZoomFactor),
1332 browserDefaultAppearance: Schema.optionalKey(PreviewAppearancePreference),
1333 browserRecordingFrameRate: Schema.optionalKey(BrowserRecordingFrameRate),
1334 browserLinkTarget: Schema.optionalKey(BrowserLinkTarget),
1335 browserAutoShowFloatingPreview: Schema.optionalKey(Schema.Boolean),
1336 browserProfiles: Schema.optionalKey(Schema.Array(BrowserProfile)),
1337 browserDefaultProfileId: Schema.optionalKey(BrowserProfileId),
1338 confirmQuit: Schema.optionalKey(QuitConfirmationMode),
1339 confirmThreadArchive: Schema.optionalKey(Schema.Boolean),
1340 confirmThreadDelete: Schema.optionalKey(Schema.Boolean),
1341 confirmThreadUnpin: Schema.optionalKey(Schema.Boolean),
1342 diffIgnoreWhitespace: Schema.optionalKey(Schema.Boolean),
1343 diffLayout: Schema.optionalKey(DiffLayout),
1344 environmentIdentificationMode: Schema.optionalKey(EnvironmentIdentificationMode),
1345 glassOpacity: Schema.optionalKey(GlassOpacity),
1346 onboardingCompletedAt: Schema.optionalKey(Schema.NullOr(Schema.String)),
1347 fontSizeInterface: Schema.optionalKey(InterfaceFontSize),
1348 fontSizePrompt: Schema.optionalKey(PromptFontSize),
1349 fontSizeCode: Schema.optionalKey(CodeFontSize),
1350 fontSizeTerminal: Schema.optionalKey(TerminalFontSize),
1351 fontFamilyCode: Schema.optionalKey(FontFamilyPreference),
1352 fontFamilyComposer: Schema.optionalKey(FontFamilyPreference),
1353 fontFamilySans: Schema.optionalKey(FontFamilyPreference),
1354 fontFamilyTerminal: Schema.optionalKey(FontFamilyPreference),
1355 fontSmoothing: Schema.optionalKey(Schema.Boolean),
1356 favorites: Schema.optionalKey(
1357 Schema.Array(
1358 Schema.Struct({
1359 provider: ProviderInstanceId,
1360 model: TrimmedNonEmptyString,
1361 }),
1362 ),
1363 ),
1364 providerModelPreferences: Schema.optionalKey(
1365 Schema.Record(
1366 ProviderInstanceId,
1367 Schema.Struct({
1368 hiddenModels: Schema.Array(Schema.String).pipe(
1369 Schema.withDecodingDefault(Effect.succeed([])),
1370 ),
1371 modelOrder: Schema.Array(Schema.String).pipe(
1372 Schema.withDecodingDefault(Effect.succeed([])),
1373 ),
1374 }),
1375 ),
1376 ),
1377 pullRequestMergeMethodOverrides: Schema.optionalKey(
1378 Schema.Record(TrimmedNonEmptyString, PullRequestMergeMethod),
1379 ),
1380 planModeEnabled: Schema.optionalKey(Schema.Boolean),
1381 contextWindowMeterEnabled: Schema.optionalKey(Schema.Boolean),
1382 composerCollapseOnScroll: Schema.optionalKey(Schema.Boolean),
1383 proactivePanelsEnabled: Schema.optionalKey(Schema.Boolean),
1384 showSkillsInSlashMenu: Schema.optionalKey(Schema.Boolean),
1385 legacySidebarEnabled: Schema.optionalKey(Schema.Boolean),
1386 sidebarProjectGroupingMode: Schema.optionalKey(SidebarProjectGroupingMode),
1387 sidebarProjectGroupingOverrides: Schema.optionalKey(
1388 Schema.Record(TrimmedNonEmptyString, SidebarProjectGroupingMode),
1389 ),
1390 sidebarProjectSortOrder: Schema.optionalKey(SidebarProjectSortOrder),
1391 sidebarThreadSortOrder: Schema.optionalKey(SidebarThreadSortOrder),
1392 sidebarThreadPreviewCount: Schema.optionalKey(SidebarThreadPreviewCount),
1393 timestampFormat: Schema.optionalKey(TimestampFormat),
1394 snapShotEnabled: Schema.optionalKey(Schema.Boolean),
1395 snapShotIncludeAccessibility: Schema.optionalKey(Schema.Boolean),
1396 snapShotShortcut: Schema.optionalKey(SnapShotShortcut),
1397 snapShotPlaySound: Schema.optionalKey(Schema.Boolean),
1398 snapShotSound: Schema.optionalKey(SnapShotSound),
1399 snapShotFlash: Schema.optionalKey(Schema.Boolean),
1400 snapShotAnimations: Schema.optionalKey(Schema.Boolean),
1401 wordWrap: Schema.optionalKey(Schema.Boolean),
1402});
1403export type ClientSettingsPatch = typeof ClientSettingsPatch.Type;