src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
// -------------------------------------------------------------------------
// PII detection model
// -------------------------------------------------------------------------
.field(
"piiModel",
"string",
{
displayName: "PII Detection Model",
subtitle:
"Model identifier used to detect PII. Leave blank to use the currently loaded model. " +
"Example: qwen2.5-7b-instruct",
placeholder: "e.g. qwen2.5-7b-instruct",
},
"",
)
// -------------------------------------------------------------------------
// Confirmation gate
// -------------------------------------------------------------------------
.field(
"requireConfirmation",
"boolean",
{
displayName: "Require Confirmation",
subtitle:
"When enabled, the plugin shows the redacted prompt and aborts. " +
"Send another message containing '--c' to confirm and proceed.",
},
true,
)
// -------------------------------------------------------------------------
// Fallback behaviour when detection fails after one retry
// -------------------------------------------------------------------------
.field(
"fallbackBehavior",
"select",
{
displayName: "Fallback Behavior",
subtitle:
"What to do if PII detection fails after one retry. " +
"'passthrough' forwards the original unredacted prompt; 'abort' cancels the request.",
options: [
{ value: "passthrough", displayName: "Passthrough (forward original prompt)" },
{ value: "abort", displayName: "Abort (cancel the request)" },
],
},
"abort",
)
.build();