src / index.ts
import type { PluginContext } from "@lmstudio/sdk";
import { configSchematics, globalConfigSchematics } from "./config";
import { generate } from "./generator";
import { preprocess } from "./preprocess";
import { startVisionPrimer } from "./visionPrimer";
export async function main(context: PluginContext): Promise<void> {
context.withConfigSchematics(configSchematics);
context.withGlobalConfigSchematics(globalConfigSchematics);
context.withPromptPreprocessor(preprocess);
context.withGenerator(generate);
// Give the small SDK load time to finish before the host tears down a short
// discovery process, while bounding the delay during plugin registration.
let timeout: ReturnType<typeof setTimeout> | undefined;
const ready = startVisionPrimer(undefined, true).catch(error => console.warn("[Strata] Vision primer:", error.message));
await Promise.race([ready, new Promise<void>(resolve => { timeout = setTimeout(resolve, 5000); })]);
if (timeout) clearTimeout(timeout);
}
src / index.ts
import type { PluginContext } from "@lmstudio/sdk";
import { configSchematics, globalConfigSchematics } from "./config";
import { generate } from "./generator";
import { preprocess } from "./preprocess";
import { startVisionPrimer } from "./visionPrimer";
export async function main(context: PluginContext): Promise<void> {
context.withConfigSchematics(configSchematics);
context.withGlobalConfigSchematics(globalConfigSchematics);
context.withPromptPreprocessor(preprocess);
context.withGenerator(generate);
// Give the small SDK load time to finish before the host tears down a short
// discovery process, while bounding the delay during plugin registration.
let timeout: ReturnType<typeof setTimeout> | undefined;
const ready = startVisionPrimer(undefined, true).catch(error => console.warn("[Strata] Vision primer:", error.message));
await Promise.race([ready, new Promise<void>(resolve => { timeout = setTimeout(resolve, 5000); })]);
if (timeout) clearTimeout(timeout);
}