dist-mcp / config.js
dist-mcp / config.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.globalConfigSchematics = exports.defaultPluginSettings = void 0;
const sdk_1 = require("@lmstudio/sdk");
const os_1 = __importDefault(require("os"));
const path_1 = __importDefault(require("path"));
exports.defaultPluginSettings = {
PREVIEW_IN_CHAT: true,
HTTP_SERVER_PORT: 54760,
embeddingBaseUrl: "http://127.0.0.1:1234/v1",
embeddingApiKey: "",
qwen3VlModelPath: "qwen/qwen3-vl-8b",
visionPrompt: "",
embedPngMetadata: true,
serverMaxTokens: 768,
serverTemperature: 0.7,
qwen3VlOdPrompt: [
"Detect objects in the image with strict hierarchical prioritization.",
"",
"PRIORITY 1 (CRITICAL - MUST DETECT FIRST):",
'- You MUST detect "human face" (highest priority if a person is present)',
'- You MUST detect "person" (if no face is clearly visible or if the person is the main subject)',
"",
"PRIORITY 2 (MAIN SUBJECT / HERO ELEMENT):",
"- The most visually prominent object or subject that is NOT part of the background.",
"- Use specific, concrete labels (e.g., 'red car', 'fluffy owl toy').",
"- Avoid generic terms like 'object' or 'thing'.",
"",
"PRIORITY 3 (CONTEXTUAL BACKGROUND ELEMENTS):",
"- Only detect background elements if they are significant to the scene composition OR if the main subject is interacting with them.",
"- Do not detect minor or redundant background details.",
"",
"PRIORITY 4 (FOCUSSED MAIN SUBJECT / HERO ELEMENT):",
"- All visible body parts (hands, feet, arms, legs).",
"- Elements of the face, as far as clearly detectable and focussed on close-ups: nose, mouth, left and right eyes, eyebrows and ears",
"- anatomical details, as far as recognizable as \\\"focussed\\\" or \\\"prominent\\\" (e.g., 'iris', 'pupil', 'eyelid')",
"",
"RULES:",
"- Maximum 16 objects total.",
"- Each bounding box must be unique and non-redundant.",
"- For clothing, name the specific garment (e.g., 'tank top', 'jeans').",
"- For body parts, qualify by position (e.g., 'left hand').",
"- NEVER prioritize background elements over the main subject or human face.",
"- NEVER prioritize anatomical details over general concepts unless they are solely focussed (e.g. only detect 'eyes' unless 'human face' is the dominant part of the image)",
"- If the main subject is a person, focus on the person and their immediate interactions. Ignore background elements unless they are directly involved in the interaction.",
"- If NO person or face is visible, ALWAYS detect Priority 2 and Priority 3 subjects regardless.",
].join("\n"),
detectMaxTokens: 2048,
detectTemperature: 0.3,
includeGenerationMetadata: true,
// VISION_API="llama-server" strand only (see LlamaServerRouterManager.ts) -- the plugin path has
// no preset concept, so this always defaults to the LM Studio-bundled llama-server binary.
llamaServerBinary: path_1.default.join(os_1.default.homedir(), ".lmstudio", "extensions", "backends", "llama.cpp-mac-arm64-apple-metal-advsimd-2.48.0", "llama-server"),
// Port our own standalone router listens on -- entirely independent of embeddingBaseUrl (that's
// the REAL Vision API's own fixed address; this is only where WE spawn our managed process).
// 8099 is free of any other known default in this ecosystem (LM Studio: 1234, Unsloth Studio: 8888).
llamaServerPort: 8099,
llamaServerCtxSize: 8192,
// analyse-image only ever requests 1 model through the router at a time -- kept adjustable for reuse elsewhere.
llamaServerModelsMax: 1,
llamaServerIdleTtlMinutes: 10,
};
exports.globalConfigSchematics = (0, sdk_1.createConfigSchematics)()
.field("PREVIEW_IN_CHAT", "boolean", {
displayName: "Previews in Chat",
subtitle: "When enabled, tool responses include inline image previews. Recommended for local models without vision capability.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.PREVIEW_IN_CHAT)
.field("HTTP_SERVER_PORT", "numeric", {
displayName: "Local HTTP Server Port",
subtitle: "Port for serving generated images over localhost (default: 54760).",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.HTTP_SERVER_PORT)
.field("embeddingBaseUrl", "string", {
displayName: "Vision API Base URL",
subtitle: "OpenAI-compatible /v1 URL. Vision tools use the same server root and call LM Studio's internal /api/v1 vision endpoints. Separate from the agent API.",
placeholder: "http://127.0.0.1:1234/v1",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embeddingBaseUrl)
.field("embeddingApiKey", "string", {
displayName: "Vision API Key",
subtitle: "Optional key for the Qwen3-VL vision backend. Separate from the agent API key.",
isProtected: true,
placeholder: "sk-...",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embeddingApiKey)
.field("qwen3VlModelPath", "string", {
displayName: "Qwen3-VL Model",
subtitle: "LM Studio model key for the Qwen3-VL Vision API backend, for example qwen/qwen3-vl-8b. This is not a filesystem path.",
placeholder: "qwen/qwen3-vl-8b",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.qwen3VlModelPath)
.field("visionPrompt", "string", {
displayName: "Vision Prompt",
subtitle: "Default prompt sent to the vision model when the agent does not supply one. Leave empty to disable automatic visual description.",
placeholder: "Analyze this image based strictly on what is directly visible. Do not infer, assume, or complete information that is not present.",
isParagraph: true,
}, exports.defaultPluginSettings.visionPrompt)
.field("embedPngMetadata", "boolean", {
displayName: "Embed Metadata in PNGs",
subtitle: "Write analysis provenance, detected objects, and bounding boxes into saved PNGs as Draw Things-compatible XMP metadata.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embedPngMetadata)
.field("includeGenerationMetadata", "boolean", {
displayName: "Include Generation Metadata",
subtitle: "When enabled, Draw Things generation parameters (prompt, model, sampler, seed, ...) embedded in PNG files are appended to each analysis result.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.includeGenerationMetadata)
.field("serverMaxTokens", "numeric", {
displayName: "Vision API: Max Tokens",
subtitle: "Maximum response length in tokens (1-4096). Default: 768.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.serverMaxTokens)
.field("serverTemperature", "numeric", {
displayName: "Vision API: Temperature",
subtitle: "Sampling temperature (0.0-2.0). Default: 0.7.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.serverTemperature)
.field("qwen3VlOdPrompt", "string", {
displayName: "Qwen3-VL: Object Detection Prompt",
subtitle: "Instruction sent to Qwen3-VL for default object detection. Leave empty to use the built-in default.",
placeholder: "",
isParagraph: true,
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.qwen3VlOdPrompt)
.field("detectMaxTokens", "numeric", {
displayName: "Vision API Detect: Max Tokens",
subtitle: "Maximum response length in tokens for object detection (1-4096). Default: 2048.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.detectMaxTokens)
.field("detectTemperature", "numeric", {
displayName: "Vision API Detect: Temperature",
subtitle: "Sampling temperature for object detection (0.0-2.0). Default: 0.3.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.detectTemperature)
.field("llamaServerBinary", "string", {
displayName: "llama-server Strand: Binary Path",
subtitle: "Absolute path to the llama-server binary used only by VISION_API=llama-server, which spawns and manages its own standalone router-mode llama-server process, independent of LM Studio's own model loading.",
placeholder: exports.defaultPluginSettings.llamaServerBinary,
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerBinary)
.field("llamaServerPort", "numeric", {
displayName: "llama-server Strand: Port",
subtitle: "Local port the standalone router-mode llama-server this plugin spawns listens on. Independent of the Vision API Base URL above (that one is the real Vision API's own fixed address). Default: 8099.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerPort)
.field("llamaServerCtxSize", "numeric", {
displayName: "llama-server Strand: Context Size",
subtitle: "Context size (--ctx-size) applied to every model the standalone router-mode llama-server auto-loads. Without a cap, router mode defaults to a model's full native context, which can use excessive VRAM. Default: 8192.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerCtxSize)
.field("llamaServerModelsMax", "numeric", {
displayName: "llama-server Strand: Max Simultaneous Models",
subtitle: "--models-max passed to the standalone router-mode llama-server -- maximum number of models it keeps loaded simultaneously. analyse-image only ever requests 1 model, so 1 is the default here. Default: 1.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerModelsMax)
.field("llamaServerIdleTtlMinutes", "numeric", {
displayName: "llama-server Strand: Idle Shutdown (minutes)",
subtitle: "Minutes of inactivity before the standalone router-mode llama-server process this plugin spawned is stopped again. 0 disables idle shutdown. Default: 10.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerIdleTtlMinutes)
.build();
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.globalConfigSchematics = exports.defaultPluginSettings = void 0;
const sdk_1 = require("@lmstudio/sdk");
const os_1 = __importDefault(require("os"));
const path_1 = __importDefault(require("path"));
exports.defaultPluginSettings = {
PREVIEW_IN_CHAT: true,
HTTP_SERVER_PORT: 54760,
embeddingBaseUrl: "http://127.0.0.1:1234/v1",
embeddingApiKey: "",
qwen3VlModelPath: "qwen/qwen3-vl-8b",
visionPrompt: "",
embedPngMetadata: true,
serverMaxTokens: 768,
serverTemperature: 0.7,
qwen3VlOdPrompt: [
"Detect objects in the image with strict hierarchical prioritization.",
"",
"PRIORITY 1 (CRITICAL - MUST DETECT FIRST):",
'- You MUST detect "human face" (highest priority if a person is present)',
'- You MUST detect "person" (if no face is clearly visible or if the person is the main subject)',
"",
"PRIORITY 2 (MAIN SUBJECT / HERO ELEMENT):",
"- The most visually prominent object or subject that is NOT part of the background.",
"- Use specific, concrete labels (e.g., 'red car', 'fluffy owl toy').",
"- Avoid generic terms like 'object' or 'thing'.",
"",
"PRIORITY 3 (CONTEXTUAL BACKGROUND ELEMENTS):",
"- Only detect background elements if they are significant to the scene composition OR if the main subject is interacting with them.",
"- Do not detect minor or redundant background details.",
"",
"PRIORITY 4 (FOCUSSED MAIN SUBJECT / HERO ELEMENT):",
"- All visible body parts (hands, feet, arms, legs).",
"- Elements of the face, as far as clearly detectable and focussed on close-ups: nose, mouth, left and right eyes, eyebrows and ears",
"- anatomical details, as far as recognizable as \\\"focussed\\\" or \\\"prominent\\\" (e.g., 'iris', 'pupil', 'eyelid')",
"",
"RULES:",
"- Maximum 16 objects total.",
"- Each bounding box must be unique and non-redundant.",
"- For clothing, name the specific garment (e.g., 'tank top', 'jeans').",
"- For body parts, qualify by position (e.g., 'left hand').",
"- NEVER prioritize background elements over the main subject or human face.",
"- NEVER prioritize anatomical details over general concepts unless they are solely focussed (e.g. only detect 'eyes' unless 'human face' is the dominant part of the image)",
"- If the main subject is a person, focus on the person and their immediate interactions. Ignore background elements unless they are directly involved in the interaction.",
"- If NO person or face is visible, ALWAYS detect Priority 2 and Priority 3 subjects regardless.",
].join("\n"),
detectMaxTokens: 2048,
detectTemperature: 0.3,
includeGenerationMetadata: true,
// VISION_API="llama-server" strand only (see LlamaServerRouterManager.ts) -- the plugin path has
// no preset concept, so this always defaults to the LM Studio-bundled llama-server binary.
llamaServerBinary: path_1.default.join(os_1.default.homedir(), ".lmstudio", "extensions", "backends", "llama.cpp-mac-arm64-apple-metal-advsimd-2.48.0", "llama-server"),
// Port our own standalone router listens on -- entirely independent of embeddingBaseUrl (that's
// the REAL Vision API's own fixed address; this is only where WE spawn our managed process).
// 8099 is free of any other known default in this ecosystem (LM Studio: 1234, Unsloth Studio: 8888).
llamaServerPort: 8099,
llamaServerCtxSize: 8192,
// analyse-image only ever requests 1 model through the router at a time -- kept adjustable for reuse elsewhere.
llamaServerModelsMax: 1,
llamaServerIdleTtlMinutes: 10,
};
exports.globalConfigSchematics = (0, sdk_1.createConfigSchematics)()
.field("PREVIEW_IN_CHAT", "boolean", {
displayName: "Previews in Chat",
subtitle: "When enabled, tool responses include inline image previews. Recommended for local models without vision capability.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.PREVIEW_IN_CHAT)
.field("HTTP_SERVER_PORT", "numeric", {
displayName: "Local HTTP Server Port",
subtitle: "Port for serving generated images over localhost (default: 54760).",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.HTTP_SERVER_PORT)
.field("embeddingBaseUrl", "string", {
displayName: "Vision API Base URL",
subtitle: "OpenAI-compatible /v1 URL. Vision tools use the same server root and call LM Studio's internal /api/v1 vision endpoints. Separate from the agent API.",
placeholder: "http://127.0.0.1:1234/v1",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embeddingBaseUrl)
.field("embeddingApiKey", "string", {
displayName: "Vision API Key",
subtitle: "Optional key for the Qwen3-VL vision backend. Separate from the agent API key.",
isProtected: true,
placeholder: "sk-...",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embeddingApiKey)
.field("qwen3VlModelPath", "string", {
displayName: "Qwen3-VL Model",
subtitle: "LM Studio model key for the Qwen3-VL Vision API backend, for example qwen/qwen3-vl-8b. This is not a filesystem path.",
placeholder: "qwen/qwen3-vl-8b",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.qwen3VlModelPath)
.field("visionPrompt", "string", {
displayName: "Vision Prompt",
subtitle: "Default prompt sent to the vision model when the agent does not supply one. Leave empty to disable automatic visual description.",
placeholder: "Analyze this image based strictly on what is directly visible. Do not infer, assume, or complete information that is not present.",
isParagraph: true,
}, exports.defaultPluginSettings.visionPrompt)
.field("embedPngMetadata", "boolean", {
displayName: "Embed Metadata in PNGs",
subtitle: "Write analysis provenance, detected objects, and bounding boxes into saved PNGs as Draw Things-compatible XMP metadata.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.embedPngMetadata)
.field("includeGenerationMetadata", "boolean", {
displayName: "Include Generation Metadata",
subtitle: "When enabled, Draw Things generation parameters (prompt, model, sampler, seed, ...) embedded in PNG files are appended to each analysis result.",
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.includeGenerationMetadata)
.field("serverMaxTokens", "numeric", {
displayName: "Vision API: Max Tokens",
subtitle: "Maximum response length in tokens (1-4096). Default: 768.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.serverMaxTokens)
.field("serverTemperature", "numeric", {
displayName: "Vision API: Temperature",
subtitle: "Sampling temperature (0.0-2.0). Default: 0.7.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.serverTemperature)
.field("qwen3VlOdPrompt", "string", {
displayName: "Qwen3-VL: Object Detection Prompt",
subtitle: "Instruction sent to Qwen3-VL for default object detection. Leave empty to use the built-in default.",
placeholder: "",
isParagraph: true,
engineDoesNotSupport: false,
}, exports.defaultPluginSettings.qwen3VlOdPrompt)
.field("detectMaxTokens", "numeric", {
displayName: "Vision API Detect: Max Tokens",
subtitle: "Maximum response length in tokens for object detection (1-4096). Default: 2048.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.detectMaxTokens)
.field("detectTemperature", "numeric", {
displayName: "Vision API Detect: Temperature",
subtitle: "Sampling temperature for object detection (0.0-2.0). Default: 0.3.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.detectTemperature)
.field("llamaServerBinary", "string", {
displayName: "llama-server Strand: Binary Path",
subtitle: "Absolute path to the llama-server binary used only by VISION_API=llama-server, which spawns and manages its own standalone router-mode llama-server process, independent of LM Studio's own model loading.",
placeholder: exports.defaultPluginSettings.llamaServerBinary,
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerBinary)
.field("llamaServerPort", "numeric", {
displayName: "llama-server Strand: Port",
subtitle: "Local port the standalone router-mode llama-server this plugin spawns listens on. Independent of the Vision API Base URL above (that one is the real Vision API's own fixed address). Default: 8099.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerPort)
.field("llamaServerCtxSize", "numeric", {
displayName: "llama-server Strand: Context Size",
subtitle: "Context size (--ctx-size) applied to every model the standalone router-mode llama-server auto-loads. Without a cap, router mode defaults to a model's full native context, which can use excessive VRAM. Default: 8192.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerCtxSize)
.field("llamaServerModelsMax", "numeric", {
displayName: "llama-server Strand: Max Simultaneous Models",
subtitle: "--models-max passed to the standalone router-mode llama-server -- maximum number of models it keeps loaded simultaneously. analyse-image only ever requests 1 model, so 1 is the default here. Default: 1.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerModelsMax)
.field("llamaServerIdleTtlMinutes", "numeric", {
displayName: "llama-server Strand: Idle Shutdown (minutes)",
subtitle: "Minutes of inactivity before the standalone router-mode llama-server process this plugin spawned is stopped again. 0 disables idle shutdown. Default: 10.",
engineDoesNotSupport: true,
}, exports.defaultPluginSettings.llamaServerIdleTtlMinutes)
.build();