figma-mcp-stdio 1.1.3 → 1.1.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 +2 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -103,8 +103,7 @@ server.addTool({
|
|
|
103
103
|
// 自动生成页面工具-印尼专用
|
|
104
104
|
server.addTool({
|
|
105
105
|
name: "figma_generate_page_tasks",
|
|
106
|
-
description: "
|
|
107
|
-
parameters: z.object({
|
|
106
|
+
description: "用于从 Figma 设计稿生成【完整页面】,对应独立路由、完整布局结构。 【必须调用本工具的条件】: - 用户明确要求生成“完整页面”或“页面路由” - 生成结果作为独立页面存在,而非被其他页面引用 - 用户未提及“模块 / 组件 / 可复用” - **用户描述了“某操作后进入的新页面 / 跳转到新页面 / 新页面展示结果”,且提供页面级 Figma 设计稿用户以业务或产品语言描述页面结果,但未显式说明“生成页面代码”(需自动补全为页面生成意图)**【禁止调用本工具的条件】: - 用户明确提到“模块”、“组件”、“AI 组件” - 用户说明“页面仅作为参考” - 用户目标是生成可被嵌入的结构单元 当存在模块或组件语义时,不得调用本工具。", parameters: z.object({
|
|
108
107
|
pluginToolNames: z.array(z.string()).optional().describe("插件名称,如果不提供从环境变量 PLUGIN_TOOL_NAMES 里取"),
|
|
109
108
|
}),
|
|
110
109
|
execute: async (args) => {
|
|
@@ -125,7 +124,7 @@ server.addTool({
|
|
|
125
124
|
// 自动生成模块工具
|
|
126
125
|
server.addTool({
|
|
127
126
|
name: "figma_generate_module_tasks",
|
|
128
|
-
description: "
|
|
127
|
+
description: "用于从 Figma 设计稿生成【可复用模块 / 组件】,而非完整页面。 【必须调用本工具的条件(满足任意一条即可)】: - 用户明确提到“模块生成”、“组件生成”、“AI 组件”、“可复用组件” - 用户描述中包含“生成模块任务”、“获取模块生成任务”等明确模块语义 - 用户要求:生成内容将被嵌入到页面中,而不是作为完整页面路由存在 【禁止调用页面生成任务的条件】(⚠️ 强约束): - 即使用户提到“页面”或“参考页面” - 即使输出文件是 .tsx - 即使位于 src/pages 目录下 只要核心目标是“模块 / 组件”,必须使用模块生成任务。 【典型用户示例】: - “获取 figma 模块生成任务” - “从 Figma 生成 AI 组件” - “生成一个可复用模块,页面仅作为参考”",
|
|
129
128
|
execute: async (args) => {
|
|
130
129
|
return taskModuleList.join("\n");
|
|
131
130
|
},
|
|
@@ -139,7 +138,6 @@ server.addTool({
|
|
|
139
138
|
useComponentFilePath: z.string().describe("使用组件库的figma nodeId").optional(),
|
|
140
139
|
}),
|
|
141
140
|
execute: async (args) => {
|
|
142
|
-
console.log(args);
|
|
143
141
|
if (!args.libraryName || !args.componentsName) {
|
|
144
142
|
return String(`
|
|
145
143
|
无组件库不查询
|