src / configSchematics.ts
src / configSchematics.ts
import { createConfigSchematics } from "@lmstudio/sdk";
/**
* User-facing settings for the plugin. Shown in LM Studio under the plugin's
* settings panel, per-chat.
*/
export const configSchematics = createConfigSchematics()
.field(
"rootDirectory",
"string",
{
displayName: "Workspace root",
subtitle:
"Absolute path the model is allowed to touch. Leave empty to use the chat's working directory.",
},
"",
)
.field(
"allowWrite",
"boolean",
{
displayName: "Allow writing files",
subtitle: "Lets the model create and overwrite files inside the workspace root.",
},
false,
)
.field(
"allowShell",
"boolean",
{
displayName: "Allow running shell commands",
subtitle:
"Danger: the model can execute arbitrary commands inside the workspace root. Off by default.",
},
false,
)
.field(
"maxFileSizeKb",
"numeric",
{
displayName: "Max file read size (KB)",
subtitle: "Files larger than this are truncated so they do not blow up the context window.",
slider: { min: 4, max: 1024, step: 4 },
},
128,
)
.field(
"commandTimeoutSec",
"numeric",
{
displayName: "Command timeout (seconds)",
subtitle: "Shell commands are killed after this long.",
slider: { min: 5, max: 300, step: 5 },
},
30,
)
.field(
"maxRetryAttempts",
"numeric",
{
displayName: "Max retry attempts",
subtitle:
"Ceiling for run_until_success. The model can ask for fewer attempts but never more.",
slider: { min: 1, max: 25, step: 1 },
},
5,
)
.field(
"allowBackgroundLoops",
"boolean",
{
displayName: "Allow background interval loops",
subtitle:
"Lets the model start a command that re-runs on a timer and keeps going between messages. Requires shell access.",
},
false,
)
.field(
"allowNetwork",
"boolean",
{
displayName: "Allow web access",
subtitle:
"Lets the model fetch URLs and run web searches so it can read real docs instead of guessing.",
},
false,
)
.field(
"allowGitWrite",
"boolean",
{
displayName: "Allow git writes (add, commit, branch)",
subtitle:
"Read-only git is always available with shell access. This adds staging and committing. Push and history rewriting are never available.",
},
false,
)
.field(
"focusedToolset",
"boolean",
{
displayName: "Focused tool set",
subtitle:
"Show the model only the core coding tools instead of everything you have enabled. Fewer choices means a small model picks the right tool far more often. Turn off only if you need the long tail (loops, processes, patches, backups).",
},
true,
)
.field(
"allowSubagents",
"boolean",
{
displayName: "Allow subagents",
subtitle:
"Lets the model delegate a job to a second agent with its own fresh context, which reports back a summary. Each subagent runs more predictions on the same loaded model, so it is slower but keeps the main conversation clean.",
},
true,
)
.field(
"subagentModel",
"string",
{
displayName: "Subagent model",
subtitle:
"Model key subagents run on, e.g. google/gemma-4-e4b. Leave empty to use a loaded model. Set this if you keep more than one model loaded, so subagents cannot pick the wrong one.",
},
"",
)
.field(
"subagentMaxSteps",
"numeric",
{
displayName: "Subagent step limit",
subtitle:
"Most tool-calling rounds a subagent may take before it must answer. Each round is a full prediction.",
slider: { min: 3, max: 25, step: 1 },
},
12,
)
.field(
"autoCompact",
"boolean",
{
displayName: "Auto-compact long conversations",
subtitle:
"When the chat approaches the model's context limit, summarise the earlier turns and attach that summary to each new message, so work is not forgotten as old turns fall out of the window. Costs one extra generation each time it refreshes.",
},
true,
)
.field(
"compactAtPercent",
"numeric",
{
displayName: "Compact at (% of context)",
subtitle: "How full the context must get before the summary is built and kept up to date.",
slider: { min: 40, max: 95, step: 5 },
},
75,
)
.field(
"injectContext",
"boolean",
{
displayName: "Inject workspace context into every message",
subtitle:
"Prepends a short operating brief plus live facts (root, git branch, project type, open checklist, AGENTS.md) to each message. Small models need this to stay on task.",
},
true,
)
.field(
"minLoopIntervalSec",
"numeric",
{
displayName: "Minimum loop interval (seconds)",
subtitle: "Floor on how often a background loop may re-run, so it cannot busy-spin.",
slider: { min: 10, max: 3600, step: 10 },
},
60,
)
.build();
import { createConfigSchematics } from "@lmstudio/sdk";
/**
* User-facing settings for the plugin. Shown in LM Studio under the plugin's
* settings panel, per-chat.
*/
export const configSchematics = createConfigSchematics()
.field(
"rootDirectory",
"string",
{
displayName: "Workspace root",
subtitle:
"Absolute path the model is allowed to touch. Leave empty to use the chat's working directory.",
},
"",
)
.field(
"allowWrite",
"boolean",
{
displayName: "Allow writing files",
subtitle: "Lets the model create and overwrite files inside the workspace root.",
},
false,
)
.field(
"allowShell",
"boolean",
{
displayName: "Allow running shell commands",
subtitle:
"Danger: the model can execute arbitrary commands inside the workspace root. Off by default.",
},
false,
)
.field(
"maxFileSizeKb",
"numeric",
{
displayName: "Max file read size (KB)",
subtitle: "Files larger than this are truncated so they do not blow up the context window.",
slider: { min: 4, max: 1024, step: 4 },
},
128,
)
.field(
"commandTimeoutSec",
"numeric",
{
displayName: "Command timeout (seconds)",
subtitle: "Shell commands are killed after this long.",
slider: { min: 5, max: 300, step: 5 },
},
30,
)
.field(
"maxRetryAttempts",
"numeric",
{
displayName: "Max retry attempts",
subtitle:
"Ceiling for run_until_success. The model can ask for fewer attempts but never more.",
slider: { min: 1, max: 25, step: 1 },
},
5,
)
.field(
"allowBackgroundLoops",
"boolean",
{
displayName: "Allow background interval loops",
subtitle:
"Lets the model start a command that re-runs on a timer and keeps going between messages. Requires shell access.",
},
false,
)
.field(
"allowNetwork",
"boolean",
{
displayName: "Allow web access",
subtitle:
"Lets the model fetch URLs and run web searches so it can read real docs instead of guessing.",
},
false,
)
.field(
"allowGitWrite",
"boolean",
{
displayName: "Allow git writes (add, commit, branch)",
subtitle:
"Read-only git is always available with shell access. This adds staging and committing. Push and history rewriting are never available.",
},
false,
)
.field(
"focusedToolset",
"boolean",
{
displayName: "Focused tool set",
subtitle:
"Show the model only the core coding tools instead of everything you have enabled. Fewer choices means a small model picks the right tool far more often. Turn off only if you need the long tail (loops, processes, patches, backups).",
},
true,
)
.field(
"allowSubagents",
"boolean",
{
displayName: "Allow subagents",
subtitle:
"Lets the model delegate a job to a second agent with its own fresh context, which reports back a summary. Each subagent runs more predictions on the same loaded model, so it is slower but keeps the main conversation clean.",
},
true,
)
.field(
"subagentModel",
"string",
{
displayName: "Subagent model",
subtitle:
"Model key subagents run on, e.g. google/gemma-4-e4b. Leave empty to use a loaded model. Set this if you keep more than one model loaded, so subagents cannot pick the wrong one.",
},
"",
)
.field(
"subagentMaxSteps",
"numeric",
{
displayName: "Subagent step limit",
subtitle:
"Most tool-calling rounds a subagent may take before it must answer. Each round is a full prediction.",
slider: { min: 3, max: 25, step: 1 },
},
12,
)
.field(
"autoCompact",
"boolean",
{
displayName: "Auto-compact long conversations",
subtitle:
"When the chat approaches the model's context limit, summarise the earlier turns and attach that summary to each new message, so work is not forgotten as old turns fall out of the window. Costs one extra generation each time it refreshes.",
},
true,
)
.field(
"compactAtPercent",
"numeric",
{
displayName: "Compact at (% of context)",
subtitle: "How full the context must get before the summary is built and kept up to date.",
slider: { min: 40, max: 95, step: 5 },
},
75,
)
.field(
"injectContext",
"boolean",
{
displayName: "Inject workspace context into every message",
subtitle:
"Prepends a short operating brief plus live facts (root, git branch, project type, open checklist, AGENTS.md) to each message. Small models need this to stay on task.",
},
true,
)
.field(
"minLoopIntervalSec",
"numeric",
{
displayName: "Minimum loop interval (seconds)",
subtitle: "Floor on how often a background loop may re-run, so it cannot busy-spin.",
slider: { min: 10, max: 3600, step: 10 },
},
60,
)
.build();