Open History to see the last commit
1/**
2 * Shared by the server driver and the client settings form, so it holds only
3 * browser-safe schema code.
4 */
5import {
6 CustomModelSetting,
7 makeBinaryPathSetting,
8 makeProviderSettingsSchema,
9 TrimmedString,
10} from "@t3tools/contracts";
11import * as Effect from "effect/Effect";
12import * as Schema from "effect/Schema";
13
14export const PiSettings = makeProviderSettingsSchema(
15 {
16 enabled: Schema.Boolean.pipe(
17 Schema.withDecodingDefault(Effect.succeed(false)),
18 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
19 ),
20 binaryPath: makeBinaryPathSetting("pi").pipe(
21 Schema.annotateKey({
22 title: "Binary path",
23 description: "Path to the Pi coding agent binary.",
24 providerSettingsForm: { placeholder: "pi", clearWhenEmpty: "omit" },
25 }),
26 ),
27 launchArgs: TrimmedString.pipe(
28 Schema.withDecodingDefault(Effect.succeed("")),
29 Schema.annotateKey({
30 title: "Launch arguments",
31 description: "Additional CLI arguments passed to pi --mode rpc on session start.",
32 providerSettingsForm: { clearWhenEmpty: "omit" },
33 }),
34 ),
35 customModels: Schema.Array(CustomModelSetting).pipe(
36 Schema.withDecodingDefault(Effect.succeed([])),
37 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
38 ),
39 },
40 {
41 order: ["binaryPath", "launchArgs"],
42 },
43);
44export type PiSettings = typeof PiSettings.Type;