figma-mcp-stdio 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/build/index.js +18 -3
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -42,12 +42,27 @@ const taskList = [
42
42
  "【清理】:",
43
43
  "9. 使用terminal命令删除页面截图(保存在images下的),只保留用户指定下载的图片资源文件",
44
44
  ];
45
- // 自动生成页面工具
45
+ // 自动生成页面工具-印尼专用
46
46
  server.addTool({
47
- name: "figma_generate_page_tasks",
47
+ name: "figma_generate_page_tasks_new",
48
48
  description: "获取Figma生成页面所需要的任务列表",
49
+ parameters: z.object({
50
+ pluginToolNames: z.array(z.string()).optional().describe("插件名称,如果不提供从环境变量 PLUGIN_TOOL_NAMES 里取"),
51
+ environment: z.string().optional().describe("环境变量,读取配置中环境变量的值"),
52
+ }),
49
53
  execute: async (args) => {
50
- return taskList.join("\n");
54
+ const pluginToolNames = args.pluginToolNames || process.env.PLUGIN_TOOL_NAMES?.split(",") || [];
55
+ if (!pluginToolNames || pluginToolNames.length === 0) {
56
+ return taskList.join("\n");
57
+ }
58
+ const tasks = [...taskList];
59
+ const insertIndex = tasks.findIndex(t => t.includes("【生成页面】"));
60
+ if (insertIndex !== -1) {
61
+ tasks.splice(insertIndex, 0, `【转换规则】:\n${pluginToolNames.map((pluginToolName, index) => {
62
+ return `规则${index + 1}: 使用${pluginToolName}进行代码转换`;
63
+ }).join("\n")}`);
64
+ }
65
+ return tasks.join("\n");
51
66
  },
52
67
  });
53
68
  server.addTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figma-mcp-stdio",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A Model Context Protocol server",
5
5
  "private": false,
6
6
  "type": "module",