Files
t3code/packages/provider-muse/src/settings.ts
T

37 lines
1.2 KiB
TypeScript

/**
* Muse Code instance settings. Shared by the server driver and the client
* settings form, so it holds only browser-safe schema code.
*
* @module provider-muse/settings
*/
import {
CustomModelSetting,
makeBinaryPathSetting,
makeProviderSettingsSchema,
} from "@t3tools/contracts";
import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";
export const MuseSettings = makeProviderSettingsSchema(
{
enabled: Schema.Boolean.pipe(
Schema.withDecodingDefault(Effect.succeed(false)),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
binaryPath: makeBinaryPathSetting("muse").pipe(
Schema.annotateKey({
title: "Binary path",
description:
"Path to the Muse Code binary on this environment. Sign in with muse login on that host.",
providerSettingsForm: { placeholder: "muse", clearWhenEmpty: "omit" },
}),
),
customModels: Schema.Array(CustomModelSetting).pipe(
Schema.withDecodingDefault(Effect.succeed([])),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
},
{ order: ["binaryPath"] },
);
export type MuseSettings = typeof MuseSettings.Type;