src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"allowedFolders",
"string",
{
displayName: "Allowed Folders",
subtitle:
"One absolute folder path per line. Only these folders (and their subfolders) are ever " +
"read — nothing else on disk is touched, and no path outside this list is followed even " +
"if a file inside tries to reference one.",
isParagraph: true,
},
"",
)
.field(
"fileExtensions",
"string",
{
displayName: "File Extensions",
subtitle: "Comma-separated list of extensions to index, e.g. .md,.txt,.cpp,.h,.cs,.json",
},
".md,.txt,.cpp,.h,.hpp,.cs,.json,.py,.js,.ts",
)
.field(
"chunkSize",
"numeric",
{
int: true,
min: 200,
displayName: "Chunk Size (characters)",
subtitle: "How large each indexed chunk of a file is.",
slider: { min: 200, max: 4000, step: 100 },
},
1200,
)
.field(
"chunkOverlap",
"numeric",
{
int: true,
min: 0,
displayName: "Chunk Overlap (characters)",
subtitle: "How much consecutive chunks overlap, so a fact split across a chunk boundary isn't lost.",
slider: { min: 0, max: 500, step: 25 },
},
150,
)
.field(
"maxFileSizeBytes",
"numeric",
{
int: true,
min: 1024,
displayName: "Max File Size (bytes)",
subtitle: "Files larger than this are skipped during indexing, to avoid accidentally indexing huge binaries or logs.",
},
2_000_000,
)
.build();