@iborymagic/aseprite-mcp 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +4 -19
- package/build/lua/template.js +8 -8
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -10,21 +10,12 @@ let version;
|
|
|
10
10
|
try {
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = path.dirname(__filename);
|
|
13
|
-
// Try to find package.json relative to the build directory
|
|
14
13
|
const packageJsonPath = path.join(__dirname, "..", "package.json");
|
|
15
14
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
16
|
-
version = packageJson.version
|
|
15
|
+
version = packageJson.version;
|
|
17
16
|
}
|
|
18
17
|
catch (error) {
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
const fallbackPath = path.join(process.cwd(), "package.json");
|
|
22
|
-
const packageJson = JSON.parse(readFileSync(fallbackPath, "utf8"));
|
|
23
|
-
version = packageJson.version || "unknown";
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
version = "unknown";
|
|
27
|
-
}
|
|
18
|
+
version = "unknown";
|
|
28
19
|
}
|
|
29
20
|
const server = new McpServer({
|
|
30
21
|
name: "aseprite-mcp",
|
|
@@ -113,14 +104,8 @@ server.registerTool("aseprite_run_lua_script", {
|
|
|
113
104
|
inputSchema: luaToolSchemas.aseprite_run_lua_script,
|
|
114
105
|
}, luaToolHandlers.aseprite_run_lua_script);
|
|
115
106
|
async function main() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
await server.connect(transport);
|
|
119
|
-
}
|
|
120
|
-
catch (err) {
|
|
121
|
-
console.error("Failed to connect MCP server:", err);
|
|
122
|
-
process.exit(1);
|
|
123
|
-
}
|
|
107
|
+
const transport = new StdioServerTransport();
|
|
108
|
+
await server.connect(transport);
|
|
124
109
|
}
|
|
125
110
|
main().catch(err => {
|
|
126
111
|
console.error("MCP Error:", err);
|
package/build/lua/template.js
CHANGED
|
@@ -57,49 +57,49 @@ export const LUA_TEMPLATES = [
|
|
|
57
57
|
{
|
|
58
58
|
id: "get_is_layer_exists",
|
|
59
59
|
description: "Checks if a layer exists in the active sprite",
|
|
60
|
-
params: ["layerName"],
|
|
60
|
+
params: ["inputFile", "layerName"],
|
|
61
61
|
scriptPath: path.join(__dirname, "templates", "get_is_layer_exists.lua")
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
id: "get_is_tag_exists",
|
|
65
65
|
description: "Checks if a tag exists in the active sprite",
|
|
66
|
-
params: ["tagName"],
|
|
66
|
+
params: ["inputFile", "tagName"],
|
|
67
67
|
scriptPath: path.join(__dirname, "templates", "get_is_tag_exists.lua")
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
id: "get_palette_info",
|
|
71
71
|
description: "Gets information about the palette of the active sprite",
|
|
72
|
-
params: [],
|
|
72
|
+
params: ["inputFile"],
|
|
73
73
|
scriptPath: path.join(__dirname, "templates", "get_palette_info.lua")
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
id: "get_selection_bounds",
|
|
77
77
|
description: "Gets the bounds of the selection in the active sprite",
|
|
78
|
-
params: [],
|
|
78
|
+
params: ["inputFile"],
|
|
79
79
|
scriptPath: path.join(__dirname, "templates", "get_selection_bounds.lua")
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
id: "get_tag_list",
|
|
83
83
|
description: "Gets a list of all tags in the active sprite",
|
|
84
|
-
params: [],
|
|
84
|
+
params: ["inputFile"],
|
|
85
85
|
scriptPath: path.join(__dirname, "templates", "get_tag_list.lua")
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: "get_layer_list",
|
|
89
89
|
description: "Gets a list of all layers in the active sprite",
|
|
90
|
-
params: [],
|
|
90
|
+
params: ["inputFile"],
|
|
91
91
|
scriptPath: path.join(__dirname, "templates", "get_layer_list.lua")
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
id: "get_frame_info",
|
|
95
95
|
description: "Gets information about the current frame",
|
|
96
|
-
params: [],
|
|
96
|
+
params: ["inputFile"],
|
|
97
97
|
scriptPath: path.join(__dirname, "templates", "get_frame_info.lua")
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
id: "get_active_sprite_info",
|
|
101
101
|
description: "Gets information about the active sprite",
|
|
102
|
-
params: [],
|
|
102
|
+
params: ["inputFile"],
|
|
103
103
|
scriptPath: path.join(__dirname, "templates", "get_active_sprite_info.lua")
|
|
104
104
|
}
|
|
105
105
|
];
|