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