将原 claude-dev-stack 目录拆分为独立的 Windows 和 WSL 部署栈,便于分别维护和使用。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
36 lines
1.8 KiB
JavaScript
36 lines
1.8 KiB
JavaScript
import { z } from "zod";
|
|
import { formatErrorForMcp } from "../utils/errors.js";
|
|
export function registerExportTools(server, godot) {
|
|
server.tool("list_export_presets", "List all export presets configured in export_presets.cfg", {}, async () => {
|
|
try {
|
|
const result = await godot.sendCommand("list_export_presets");
|
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
}
|
|
catch (e) {
|
|
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
|
|
}
|
|
});
|
|
server.tool("export_project", "Get the export command for a preset (direct export from editor is not supported in Godot 4)", {
|
|
preset_name: z.string().optional().describe("Export preset name"),
|
|
preset_index: z.number().optional().describe("Export preset index (alternative to name)"),
|
|
debug: z.boolean().optional().describe("Debug export (default: true)"),
|
|
}, async (params) => {
|
|
try {
|
|
const result = await godot.sendCommand("export_project", params);
|
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
}
|
|
catch (e) {
|
|
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
|
|
}
|
|
});
|
|
server.tool("get_export_info", "Get export-related project info (executable path, templates, project path)", {}, async () => {
|
|
try {
|
|
const result = await godot.sendCommand("get_export_info");
|
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
}
|
|
catch (e) {
|
|
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
|
|
}
|
|
});
|
|
}
|
|
//# sourceMappingURL=export-tools.js.map
|