Project Files
src / configSchematics.ts
import * as path from "node:path";
import * as os from "node:os";
import { createConfigSchematics } from "@lmstudio/sdk";
const DEFAULT_ROOT = path.join(os.homedir(), "Documents");
export const configSchematics = createConfigSchematics()
.field(
"useDefaultRoot",
"boolean",
{
displayName: `Enable default root (${DEFAULT_ROOT})`,
hint: `When ON, ${DEFAULT_ROOT} is always an allowed root (auto-created if missing). Turn OFF to restrict access to the paths listed below only.`,
},
true,
)
.field(
"allowedPaths",
"stringArray",
{
displayName: "Additional allowed root paths",
hint: "Extra absolute paths (~ allowed) under which .docx files can be read or written. These add to the default root above.",
},
[],
)
.field(
"defaultFontFamily",
"string",
{
displayName: "Default font family",
hint: "Font used for body text in generated .docx. 'Calibri' is Word's modern default; 'Times New Roman' for a classic look.",
},
"Calibri",
)
.field(
"defaultFontSizePt",
"numeric",
{
displayName: "Default font size (pt)",
hint: "Body text size in points for generated .docx.",
slider: { min: 8, max: 18, step: 1 },
int: true,
},
11,
)
.field(
"pageMargin",
"select",
{
displayName: "Page margin",
hint: "Margin preset applied to generated .docx. normal ≈ 2.54cm, narrow ≈ 1.27cm, wide ≈ 5.08cm.",
options: [
{ value: "normal", displayName: "normal (2.54cm)" },
{ value: "narrow", displayName: "narrow (1.27cm)" },
{ value: "wide", displayName: "wide (5.08cm)" },
],
},
"normal",
)
.field(
"preserveListStyles",
"boolean",
{
displayName: "Preserve list styles",
hint: "Keep bullet/numbered list formatting from the markdown source. Disable to render every list as bulleted.",
},
true,
)
.field(
"maxFileSizeMb",
"numeric",
{
displayName: "Max file size (MB)",
hint: ".docx larger than this are refused on read. Generated files are not capped.",
slider: { min: 1, max: 500, step: 1 },
int: true,
},
50,
)
.field(
"verboseLogging",
"boolean",
{
displayName: "Verbose logging",
hint: "Log each conversion to the plugin console.",
},
false,
)
.build();