src / index.ts
import { type PluginContext, type ToolsProvider } from "@lmstudio/sdk";
import {
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python
} from "./tools/fileTools.js";
import {
plan_manager,
audit_plan,
subagent_task
} from "./tools/planTools.js";
import { promptPreprocessor } from "./promptPreprocessor.js";
import { getWorkspaceDir, resolvePath } from "./utils.js";
export {
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python,
plan_manager,
audit_plan,
subagent_task,
promptPreprocessor,
getWorkspaceDir,
resolvePath
};
const allTools = [
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python,
plan_manager,
audit_plan,
subagent_task
];
const toolsProvider: ToolsProvider = async () => {
return allTools;
};
export async function main(context: PluginContext) {
// 1. Registra las herramientas (archivos, plan, auditoría, subagentes)
context.withToolsProvider(toolsProvider);
// 2. Registra el preprocesador para comandos slash (/plan, /goal, /review, /audit)
context.withPromptPreprocessor(promptPreprocessor);
}
src / index.ts
import { type PluginContext, type ToolsProvider } from "@lmstudio/sdk";
import {
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python
} from "./tools/fileTools.js";
import {
plan_manager,
audit_plan,
subagent_task
} from "./tools/planTools.js";
import { promptPreprocessor } from "./promptPreprocessor.js";
import { getWorkspaceDir, resolvePath } from "./utils.js";
export {
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python,
plan_manager,
audit_plan,
subagent_task,
promptPreprocessor,
getWorkspaceDir,
resolvePath
};
const allTools = [
read_file,
write_file,
edit_file,
list_dir,
make_dir,
delete_path,
run_bash,
run_python,
plan_manager,
audit_plan,
subagent_task
];
const toolsProvider: ToolsProvider = async () => {
return allTools;
};
export async function main(context: PluginContext) {
// 1. Registra las herramientas (archivos, plan, auditoría, subagentes)
context.withToolsProvider(toolsProvider);
// 2. Registra el preprocesador para comandos slash (/plan, /goal, /review, /audit)
context.withPromptPreprocessor(promptPreprocessor);
}