Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
/** Per-chat plugin configuration (LM Studio UI). Mirrors exif-sniffer env + Base Directory pattern. */
export const configSchematics = createConfigSchematics()
.field(
"folderName",
"string",
{
displayName: "Base Directory",
subtitle: "The directory path where files will be stored.",
placeholder: "/path/to/directory",
isParagraph: false,
},
"",
)
.field(
"maxDownloadBytes",
"numeric",
{
displayName: "Max download bytes",
subtitle: "Hard cap for fetch_remote_media (bytes).",
int: true,
min: 1024,
max: 2_000_000_000,
},
100_000_000,
)
.field(
"fetchConnectTimeoutSeconds",
"numeric",
{
displayName: "Fetch connect timeout (s)",
int: true,
min: 1,
max: 300,
},
10,
)
.field(
"fetchReadTimeoutSeconds",
"numeric",
{
displayName: "Fetch read timeout (s)",
int: true,
min: 1,
max: 600,
},
120,
)
.field(
"fetchMaxRedirects",
"numeric",
{
displayName: "Max HTTP redirects",
int: true,
min: 0,
max: 32,
},
8,
)
.field(
"fetchAllowPrivateHosts",
"boolean",
{
displayName: "Allow private/reserved hosts",
subtitle: "Unsafe: permits RFC1918/link-local targets when resolving DNS.",
},
false,
)
.field(
"fetchAllowedHostSuffixes",
"string",
{
displayName: "Allowed host suffixes (optional)",
subtitle: "Comma-separated; if non-empty, host must match one suffix (e.g. example.com,.cdn.example).",
isParagraph: false,
},
"",
)
.field(
"fetchBlockedHostSuffixes",
"string",
{
displayName: "Blocked host suffixes (optional)",
subtitle: "Comma-separated suffix blocklist applied before allowlist.",
isParagraph: false,
},
"",
)
.build();