1/**
2 * Cursor instance settings. Shared by the server driver and the client
3 * settings form, so it holds only browser-safe schema code.
4 *
5 * @module provider-cursor/settings
6 */
7import { CustomModelSetting, makeProviderSettingsSchema, TrimmedString } from "@t3tools/contracts";
8import * as Effect from "effect/Effect";
9import * as Schema from "effect/Schema";
10
11export const CursorSettings = makeProviderSettingsSchema(
12 {
13 // Off by default like Grok and OpenCode. Users opt in from Settings.
14 enabled: Schema.Boolean.pipe(
15 Schema.withDecodingDefault(Effect.succeed(false)),
16 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
17 ),
18 // Keep V1's CLI configuration when V2 rewrites the shared settings file.
19 // V2's Cursor SDK does not use these fields.
20 binaryPath: Schema.optionalKey(TrimmedString).pipe(
21 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
22 ),
23 apiEndpoint: Schema.optionalKey(TrimmedString).pipe(
24 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
25 ),
26 customModels: Schema.Array(CustomModelSetting).pipe(
27 Schema.withDecodingDefault(Effect.succeed([])),
28 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
29 ),
30 },
31 {
32 order: [],
33 },
34);
35export type CursorSettings = typeof CursorSettings.Type;