The best way to control Claude Code, Codex and more from any computer or phone

main
ts 37 lines 1.15 KB
Raw
1 /**
2 * fx 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-fx/settings
6 */
7 import {
8 CustomModelSetting,
9 makeBinaryPathSetting,
10 makeProviderSettingsSchema,
11 } from "@t3tools/contracts";
12 import * as Effect from "effect/Effect";
13 import * as Schema from "effect/Schema";
14
15 export const FxSettings = makeProviderSettingsSchema(
16 {
17 enabled: Schema.Boolean.pipe(
18 Schema.withDecodingDefault(Effect.succeed(false)),
19 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
20 ),
21 binaryPath: makeBinaryPathSetting("fx").pipe(
22 Schema.annotateKey({
23 title: "Binary path",
24 description: "Path to the fx binary. All fx instances on this machine share its fx login.",
25 providerSettingsForm: { placeholder: "fx", clearWhenEmpty: "omit" },
26 }),
27 ),
28 customModels: Schema.Array(CustomModelSetting).pipe(
29 Schema.withDecodingDefault(Effect.succeed([])),
30 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
31 ),
32 },
33 {
34 order: ["binaryPath"],
35 },
36 );
37 export type FxSettings = typeof FxSettings.Type;