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

40 lines
1.3 KiB
TypeScript

/**
* Grok instance settings. Shared by the server driver and the client
* settings form, so it holds only browser-safe schema code.
*
* @module provider-grok/settings
*/
import {
CustomModelSetting,
makeBinaryPathSetting,
makeProviderSettingsSchema,
} from "@t3tools/contracts";
import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";
export const GrokSettings = makeProviderSettingsSchema(
{
// Off by default (like Cursor and OpenCode): the binding is not yet
// stable enough to probe on every install. Users opt in from Settings.
enabled: Schema.Boolean.pipe(
Schema.withDecodingDefault(Effect.succeed(false)),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
binaryPath: makeBinaryPathSetting("grok").pipe(
Schema.annotateKey({
title: "Binary path",
description: "Path to the Grok CLI binary.",
providerSettingsForm: { placeholder: "grok", clearWhenEmpty: "omit" },
}),
),
customModels: Schema.Array(CustomModelSetting).pipe(
Schema.withDecodingDefault(Effect.succeed([])),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
},
{
order: ["binaryPath"],
},
);
export type GrokSettings = typeof GrokSettings.Type;