@codify-ai/mcp-client 1.0.31 → 1.0.33
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/README.md +29 -11
- package/dist/component-generate.md +32 -6
- package/dist/component-import.md +32 -48
- package/dist/en.template.json +124 -0
- package/dist/index.js +1 -1
- package/dist/page-generate.md +10 -16
- package/dist/variable-generate.md +178 -0
- package/dist/variable-import.md +79 -0
- package/dist/zh.template.json +123 -0
- package/package.json +1 -1
- package/dist/en.json +0 -95
- package/dist/zh.json +0 -94
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"getGuidelines": {
|
|
3
|
+
"description": "会话入口:当用户要使用 {{displayName}} / MasterGo 能力时先调用本工具。scope 为字符串数组,不传时默认 [\"page-generate\"]。可选值:page-generate / component-import / component-generate / variable-import / variable-generate。component-generate 仅用于 agent_create_component 创建母版组件/组件集,团队库页面生成请用 [\"page-generate\",\"component-import\",\"variable-import\"]。",
|
|
4
|
+
"inputSchema": "可选参数:scope,字符串数组,元素取值 page-generate / component-import / component-generate / variable-import / variable-generate。不传默认 [\"page-generate\"]。多个 scope 同传会附加 Final Hard Gate。"
|
|
5
|
+
},
|
|
6
|
+
"design": {
|
|
7
|
+
"description": "设计页面:根据需求生成符合 {{displayName}} 规范的 HTML+CSS 代码。固定流程:先让用户在「自由绘制 / 使用当前文件设计系统 / 使用组件库」三者中选一;选『当前文件设计系统』会强制 get_variables 落盘并按 variable-import.md 引用变量;选『组件库』会要求选择团队库 + 构建策略;最后才生成页面。",
|
|
8
|
+
"requirement": "界面需求描述,例如:\"一个美观的登录页面\"、\"现代化的仪表盘界面\"等。",
|
|
9
|
+
"code": "【可选】若已生成完整代码(可含 Markdown + <main>),传入后将自动提取 <main> 并直接提交到画布。",
|
|
10
|
+
"projectDir": "【选填】用户当前工作区的根目录绝对路径。变量场景与组件库场景下用于读取/写入 {{docDir}} 落盘数据。",
|
|
11
|
+
"designSource": "【必填(流程)】设计来源三选一:free-draw(自由绘制)/ current-file-variables(使用当前文件设计系统)/ component-library(使用组件库)。每次调用 design 都应先让用户明确选择。",
|
|
12
|
+
"userConfirmedDesignSource": "【必填(流程)】是否已完成本次「设计来源三选一」的用户确认。每次新页面流程都应传 true 才可继续。",
|
|
13
|
+
"teamLibraryName": "【组件库模式必填】用户确认选择的团队库名称。每次都需要重新确认,不允许助手自动选库。",
|
|
14
|
+
"teamLibraryId": "【组件库模式推荐】用户确认选择的团队库 ID。若已通过 get_library_list 拿到 ID,建议同时传入;用于精确判定是否仍是同一个团队库,避免名字归一化撞车的不同库被误复用。",
|
|
15
|
+
"buildStrategy": "【组件库模式必填】构建策略:full-components / hybrid。full-components 优先使用组件库组件;hybrid 仅关键功能区使用组件。两种策略都必须遵守 component-import.md + variable-import.md 中的组件、变量、图标规则。未指定时必须先询问用户二选一。"
|
|
16
|
+
},
|
|
17
|
+
"createPage": {
|
|
18
|
+
"description": "创建页面:将代码发送到 {{pluginName}}转换为设计稿。\n 【极致性能要求】若纯 HTML 已保存为本地文件,强烈建议通过 filePath 传入该文件的绝对路径以节省 Token。如果是直接生成的临时代码,可以通过 code 参数直接传入。",
|
|
19
|
+
"code": "【可选】要发送的 HTML 代码内容。仅当代码是临时生成且未保存为文件时使用。",
|
|
20
|
+
"filePath": "【可选】本地 HTML 文件的绝对路径。若文件已存在本地,必须传此参数,工具会自动读取并执行落盘。",
|
|
21
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
22
|
+
"saveCodeToLocal": "是否将 MasterGo 返回的渲染结果保存到本地 {{docDir}} 目录(落盘机制)"
|
|
23
|
+
},
|
|
24
|
+
"updateNode": {
|
|
25
|
+
"description": "局部修改:处理现有节点的默认工具。文本、样式、图标、图片及大多数局部结构调整,都优先使用 agent_update_node。注意:如果是修改父容器的样式或内部内容,传递的 HTML 代码中必须包含所有需要保留的子元素结构,以防丢失数据。",
|
|
26
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
27
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
28
|
+
"targetNodeId": "【选填】目标图层 ID (例如 123:456)。如果不传,则默认更新 MasterGo 中当前选中的图层。",
|
|
29
|
+
"code": "【必填】修改后的 HTML 代码片段。必须包含 data-node-id。"
|
|
30
|
+
},
|
|
31
|
+
"replaceNode": {
|
|
32
|
+
"description": "节点替换:仅在用户明确要求“替换某个节点 / 图标 / 图片”时使用本工具。其中图标遵循 FontAwesome,图片换图遵循 <img src=\"{{keyword}}\" /> 语义规范。",
|
|
33
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
34
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
35
|
+
"targetNodeId": "【选填】目标图层 ID (例如 123:456)。如果不传,则默认替换 MasterGo 中当前选中的图层。",
|
|
36
|
+
"code": "【必填】新的 HTML 代码内容。将完整替换目标节点内部。"
|
|
37
|
+
},
|
|
38
|
+
"removeNode": {
|
|
39
|
+
"description": "移除节点:在 MasterGo 画布中执行删除节点操作。支持通过 targetNodeId 指定 ID,或在不传 ID 时默认删除当前选中图层。",
|
|
40
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
41
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
42
|
+
"targetNodeId": "【选填】要删除的目标图层 ID (例如 123:456)。如果不传,则默认删除 MasterGo 中当前选中的图层。"
|
|
43
|
+
},
|
|
44
|
+
"syncToDesign": {
|
|
45
|
+
"description": "全量同步:将本地完整的静态 HTML 文件内容同步覆盖到 MasterGo 画布进行【全量同步】(如保存整个页面、复杂的模块同步)。仅当用户明确提出“同步到画布”时才允许调用,禁止自动触发。必须传入根节点 ID (rootId) 以确保层级正确。",
|
|
46
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
47
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
48
|
+
"targetNodeId": "【推荐】页面的根节点 ID (rootId)。不传则默认同步到当前选中图层。",
|
|
49
|
+
"filePath": "【必填】本地静态 HTML 文件的绝对路径(通常位于 {{docDir}}/... 目录下)。工具会自动读取内容。严禁传入 .vue/.tsx 业务代码路径!",
|
|
50
|
+
"userConfirmed": "【必填】用户是否已明确确认“同步到画布”。仅在用户主动要求同步时传 true。"
|
|
51
|
+
},
|
|
52
|
+
"getSelectionCode": {
|
|
53
|
+
"description": "获取节点代码:拉取 MasterGo 当前选中图层(或指定图层)的最新代码。本工具仅做\"读取/同步上下文\",不要在没有用户具体修改诉求的情况下,紧接着自动调用 agent_update_node / agent_replace_node / sync_to_design。执行任何修改前应先调用本工具,避免基于旧代码操作。拉取子节点时仅返回代码文本;拉取根节点时会同步完整页面到 {{docDir}} 基准文件。当用户表达需要视觉参考时(详见 referenceDesign),可附加返回该图层的渲染预览图(WebP)。",
|
|
54
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
55
|
+
"targetNodeId": "【选填】MasterGo图层ID (例如 123:456)。如果提供,将直接拉取该ID的代码;如果不提供,将拉取当前选中图层的代码。",
|
|
56
|
+
"syncToBase": "【选填】是否将获取到的子图层代码同步回本地 {{docDir}} 目录下的基准 HTML 文件(合并更新)。默认为 true。",
|
|
57
|
+
"referenceDesign": "【选填】是否返回设计稿的渲染预览图(WebP)。默认 false。仅在用户明确表达需要视觉参考时设为 true,例如:\"参考设计稿还原\"、\"按图重新写一下\"、\"对照视觉调整\"、\"复刻这个设计\"、\"match the design\" 等。关闭时整条预览链路(导出 + 传输 + 落盘)完全短路,零开销;开启后会同时给你返回 image content 用于多模态判断,并在本地 {{docDir}}/.preview/ 落盘一份便于用户核对。日常代码同步/小修请保持默认 false。"
|
|
58
|
+
},
|
|
59
|
+
"createComponent": {
|
|
60
|
+
"description": "创建组件:创建一个 MasterGo 母版组件或组件集(变体)。仅在创建母版组件/组件集时,先调用 get_guidelines(scope=[\"component-generate\"]) 加载组件生成规则;团队库页面生成不要使用 component-generate。本工具仅负责发送到 MasterGo,不做规范兜底校验。",
|
|
61
|
+
"code": "组件的纯 HTML 字符串。根节点必须包含 data-type=\"component\" 或 \"component-set\";若为 component-set,变体节点必须是其直接子节点,并使用 data-variant-* 扁平声明变体属性。",
|
|
62
|
+
"projectDir": "【选填】用户当前工作区的根目录绝对路径。若传入,工具会探测 {{docDir}}/variable/ 是否已落盘当前文件变量;存在则自动追加 variable-import 规则,让母版组件优先 var(...) 引用变量,保持设计系统的视觉语言一致。"
|
|
63
|
+
},
|
|
64
|
+
"getDesignDiff": {
|
|
65
|
+
"description": "比较差异:获取本地基准文件与 MasterGo 画布设计现状的差异。调用后返回 JSON 形式的 Diff 结果,用于协助判断有哪些图层或样式发生了改变。",
|
|
66
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
67
|
+
"targetNodeId": "【选填】MasterGo图层ID (例如 123:456)。如果不传,则默认获取当前选中图层的代码进行对比。",
|
|
68
|
+
"filePath": "【选填】本地基准 HTML 文件的绝对路径。如果已通过 write_to_file 更新了基准文件,请直接传此路径。"
|
|
69
|
+
},
|
|
70
|
+
"getCodeList": {
|
|
71
|
+
"description": "代码列表:获取所有可用的代码列表",
|
|
72
|
+
"inputSchema": "无需参数获取代码列表"
|
|
73
|
+
},
|
|
74
|
+
"getUserInfo": {
|
|
75
|
+
"description": "用户信息:获取当前登录用户的信息,包括配额、团队等",
|
|
76
|
+
"inputSchema": "获取当前用户信息"
|
|
77
|
+
},
|
|
78
|
+
"getCode": {
|
|
79
|
+
"description": "获取代码:通过 {{uriScheme}}://getCode/{contentId} 从 {{pluginName}}获取代码。常规的\"获取选中代码\"请优先使用 get_selection_code 工具。",
|
|
80
|
+
"contentId": "从{{pluginName}}复制图层的指令 (contentId)",
|
|
81
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
82
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
83
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
84
|
+
"outDir": "【必填】保存代码和资源的绝对路径"
|
|
85
|
+
},
|
|
86
|
+
"getLibraryList": {
|
|
87
|
+
"description": "团队库列表:获取当前文件已订阅/已加载的团队库列表(名称、ID、组件数、样式数)。仅在用户明确说“使用 xxx 团队库/组件库的组件生成页面”时才允许调用;普通 design 场景禁止调用。",
|
|
88
|
+
"inputSchema": "无需参数"
|
|
89
|
+
},
|
|
90
|
+
"getComponentInfo": {
|
|
91
|
+
"description": "组件信息:获取指定团队库组件数据并落盘为本地快照,用于组件库模式生成页面。每次指定团队库后都从远端重新拉取并覆盖落盘。仅当用户明确要求“使用某团队库/组件库生成页面”时调用;普通 design 场景禁止调用。未传 teamLibraryId 时会先返回团队库列表供选择,用户确认后可用 teamLibraryName 自动匹配 ID。生成页面规则见 component-import.md。",
|
|
92
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径(用于落盘)",
|
|
93
|
+
"teamLibraryId": "【选填】团队库 ID。若提供则直接获取该库组件信息。",
|
|
94
|
+
"teamLibraryName": "【选填】团队库名称。若未提供 teamLibraryId,可用名称自动匹配团队库 ID。",
|
|
95
|
+
"includePropertyDetails": "【选填】是否包含组件属性详情。默认 true。"
|
|
96
|
+
},
|
|
97
|
+
"getVariables": {
|
|
98
|
+
"description": "变量列表:获取当前 MasterGo 文件中的全部本地变量。只读取当前文件,不读取远程团队库。返回 documentName、documentId、variables(updateVariables 同款批量数组);兼容接口仅返回数组时的形态。每次成功后将 variables 字段写入 {{docDir}}/variable/{documentId}.json。",
|
|
99
|
+
"inputSchema": "必填:projectDir(工作区根目录绝对路径,用于落盘)。",
|
|
100
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径;变量数组写入该目录下的 {{docDir}}/variable/{documentId}.json。"
|
|
101
|
+
},
|
|
102
|
+
"updateVariables": {
|
|
103
|
+
"description": "变量更新:创建、修改、排序当前 MasterGo 文件变量;删除变量必须使用 agent_remove_variable。固定流程:先调用 get_variables 落盘;创建一套变量时先提交基础变量,重新 get_variables,再提交语义/引用变量,最后再次 get_variables。本工具首次调用会自动加载 variable-generate 规则。",
|
|
104
|
+
"inputSchema": "必填:projectDir。提交数据三选一:filePath、variables、operations;若只传 documentId,则读取 {{docDir}}/variable/{documentId}.json。",
|
|
105
|
+
"projectDir": "【必填】用户当前工作区的根目录绝对路径。",
|
|
106
|
+
"documentId": "【选填】当前 MasterGo 文档 ID;未传 filePath/variables/operations 时,用于定位 {{docDir}}/variable/{documentId}.json。",
|
|
107
|
+
"documentPageId": "【选填】当前 MasterGo 页面 ID。",
|
|
108
|
+
"filePath": "【选填】变量 JSON 文件绝对路径。通常是 get_variables 落盘后的 {{docDir}}/variable/{documentId}.json。",
|
|
109
|
+
"variables": "【选填】变量数组,格式与 get_variables 落盘文件一致;也可传 { variables: [...] }。",
|
|
110
|
+
"operations": "【选填】操作数组;用于 createVariable/updateVariable/moveVariable 等非完整快照式操作。删除请使用 agent_remove_variable。"
|
|
111
|
+
},
|
|
112
|
+
"removeVariable": {
|
|
113
|
+
"description": "删除变量:危险操作专用工具。删除当前 MasterGo 文件变量,不走 update_variables;工具名为 agent_remove_variable。优先传 id;无 id 时必须传 collection/collectionId + name + type 以避免误删。本工具首次调用会自动加载 variable-generate 规则。",
|
|
114
|
+
"documentId": "当前 MasterGo 文档 ID。",
|
|
115
|
+
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
116
|
+
"id": "【推荐】要删除的变量 ID。",
|
|
117
|
+
"collection": "【无 id 时必填】变量所在集合名称。",
|
|
118
|
+
"collectionId": "【选填】变量所在集合 ID;可替代 collection。",
|
|
119
|
+
"name": "【无 id 时必填】变量名称。",
|
|
120
|
+
"type": "【无 id 时必填】变量类型,例如 COLOR、PAINT、NUMBER。",
|
|
121
|
+
"variables": "【选填】批量删除数组;每项优先传 id,或传 collection/collectionId + name + type。"
|
|
122
|
+
}
|
|
123
|
+
}
|
package/package.json
CHANGED
package/dist/en.json
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"getCodifyGuidelines": {
|
|
3
|
-
"description": "[Session entry] When the user wants to use Codify / MasterGo workflows (e.g. \"use codify mcp\", \"design with Codify\"), call this tool first. The system provides three rule sets: page-generate, component-import, and component-generate. It supports scoped rules or all aggregated rules.",
|
|
4
|
-
"inputSchema": "Optional: scope (all/page-generate/component-import/component-generate), default all. all returns page-generate + component-import + final hard gate."
|
|
5
|
-
},
|
|
6
|
-
"createPage": {
|
|
7
|
-
"description": "Send code to the Codify plugin to convert it into a design.\n\n[Performance Tip] If pure HTML is already saved as a local file, it is highly recommended to pass the absolute path via filePath. If generating code temporarily, use the code parameter directly.\n\nReverse Transpilation Warning: Strictly forbidden to directly send Vue/React business code containing dynamic bindings ({{}}) or framework directives! If you want to convert business code to a design, you MUST first perform \"Reverse Transpilation\" (refer to codify://rule) to convert it into pure HTML with static mock data before sending.",
|
|
8
|
-
"code": "[Optional] The HTML code content to send. Use ONLY if the code is temporarily generated and not saved as a file.",
|
|
9
|
-
"filePath": "[Optional] The absolute path of the local HTML file. If the file exists locally, you MUST pass this parameter; the tool will automatically read and persist it.",
|
|
10
|
-
"projectDir": "[Required] The absolute path of the user's current workspace root directory.",
|
|
11
|
-
"saveCodeToLocal": "Whether to save the rendering results returned by the plugin to the local .codify directory (persistence mechanism)."
|
|
12
|
-
},
|
|
13
|
-
"updateNode": {
|
|
14
|
-
"description": "Send back locally modified code. [Tool Selection Rule]: By default this is for non-structural property tweaks (text, size, color, border, shadow, effects). Hard exception: if the target is a non-library icon/image (`<i>`/`<img>`), DO NOT use agent_update_node; you MUST use agent_replace_node. Note: If modifying styles on a parent container, the returned HTML must include all original child elements to prevent data loss.",
|
|
15
|
-
"documentId": "Current MasterGo document ID.",
|
|
16
|
-
"documentPageId": "Current MasterGo page ID.",
|
|
17
|
-
"targetNodeId": "[Optional] Target layer ID (e.g., 123:456). Defaults to the current selection.",
|
|
18
|
-
"code": "[Required] Modified HTML fragment. MUST include data-node-id."
|
|
19
|
-
},
|
|
20
|
-
"replaceNode": {
|
|
21
|
-
"description": "Perform [Structural Replacement] on a target node. Call this when you need to significantly change the internal structure (e.g., adding, removing, or reordering child elements). This tool is also required for non-library icon/image edits (`<i>`/`<img>`). Even with major changes, the tool intelligently attempts to preserve the root ID to maintain agent context.",
|
|
22
|
-
"documentId": "Current MasterGo document ID.",
|
|
23
|
-
"documentPageId": "Current MasterGo page ID.",
|
|
24
|
-
"targetNodeId": "[Optional] Target layer ID (e.g., 123:456). Defaults to the current selection.",
|
|
25
|
-
"code": "[Required] New HTML code. Will fully replace the target node content."
|
|
26
|
-
},
|
|
27
|
-
"syncToDesign": {
|
|
28
|
-
"description": "Perform a [Full Sync]: overwrite the MasterGo design with your full static HTML file. Only call this when the user explicitly asks to sync to canvas; never auto-sync after local edits.",
|
|
29
|
-
"documentId": "Current MasterGo document ID.",
|
|
30
|
-
"documentPageId": "Current MasterGo page ID.",
|
|
31
|
-
"targetNodeId": "[Recommended] Root Node ID (rootId). Defaults to current selection if omitted.",
|
|
32
|
-
"filePath": "[Required] Absolute path of local static HTML file (found in .codify/...). Tool auto-reads the file. NEVER pass .vue/.tsx paths!",
|
|
33
|
-
"userConfirmed": "[Required] Whether the user explicitly confirmed syncing to canvas. Only pass true after explicit user request."
|
|
34
|
-
},
|
|
35
|
-
"getSelectionCode": {
|
|
36
|
-
"description": "Get HTML/CSS code for the currently selected layer (or a specified layer) in MasterGo and intelligently persist it to the local project directory. The generated code is typically used for partial modifications or syncing local base files.",
|
|
37
|
-
"projectDir": "[Required] The absolute path of the user's current workspace root directory.",
|
|
38
|
-
"targetNodeId": "[Optional] MasterGo layer ID (e.g., 123:456). If provided, the code for that ID will be pulled directly; if not, the code for the currently selected layer will be pulled.",
|
|
39
|
-
"syncToBase": "[Optional] Whether to sync the obtained child layer code back to the base HTML file in the local .codify directory (merge update). Defaults to true."
|
|
40
|
-
},
|
|
41
|
-
"createComponent": {
|
|
42
|
-
"description": "Create a MasterGo master component or component set (variant). It is recommended to load get_codify_guidelines(scope=\"component-generate\") first, then call this tool. This tool only sends code to plugin and does not perform fallback rule validation.",
|
|
43
|
-
"code": "Pure HTML string of the component. Root node must include data-type=\"component\" or \"component-set\". For component-set, variant nodes must be direct children and variant attributes must be declared with flat data-variant-* fields."
|
|
44
|
-
},
|
|
45
|
-
"getDesignDiff": {
|
|
46
|
-
"description": "Get the difference between the local base file and the current MasterGo canvas design. Returns a JSON Diff result to help determine what layers or styles have changed.",
|
|
47
|
-
"projectDir": "[Required] The absolute path of the user's current workspace root directory.",
|
|
48
|
-
"targetNodeId": "[Optional] MasterGo layer ID (e.g., 123:456). If not provided, the code of the currently selected layer will be fetched for comparison by default.",
|
|
49
|
-
"filePath": "[Optional] The absolute path of the local base HTML file. If you have updated the base file via write_to_file, pass this path directly.",
|
|
50
|
-
"syncType": "[Optional] Sync direction, must be codeSyncDesign (code syncs to design) or designSyncCode (design syncs to code)."
|
|
51
|
-
},
|
|
52
|
-
"getCodeList": {
|
|
53
|
-
"description": "Get a list of all available code items",
|
|
54
|
-
"inputSchema": "Get code list without parameters"
|
|
55
|
-
},
|
|
56
|
-
"design": {
|
|
57
|
-
"description": "Generate HTML+CSS code that complies with Codify specifications. Fixed flow: ask whether to use component library first; if yes, ask the user to pick a team library every time, then ask build strategy (full-components/hybrid), and only then generate. In component mode, read local .codify/library snapshots first; if missing, call get_library_list + get_component_info.",
|
|
58
|
-
"requirement": "Interface requirement description, e.g., \"a beautiful login page\", \"a modern dashboard interface\", etc.",
|
|
59
|
-
"code": "[Optional] If full code is already generated (can include Markdown + <main>), it will auto-extract <main> and submit directly to canvas.",
|
|
60
|
-
"projectDir": "[Optional] Absolute path of the user workspace root. Recommended for component-library generation so local .codify/library data can be matched first.",
|
|
61
|
-
"useComponentLibrary": "[Required by workflow] Whether to use component library. For each design call, the user must explicitly choose true/false first.",
|
|
62
|
-
"userConfirmedUseComponentLibrary": "[Required by workflow] Whether the user confirmation step for \"use component library or not\" has been explicitly completed in this page-generation flow.",
|
|
63
|
-
"teamLibraryName": "[Required in component mode] User-confirmed team library name. Must be reconfirmed each time; assistant must not auto-pick.",
|
|
64
|
-
"buildStrategy": "[Required in component mode] Build strategy: full-components (all-component mode: componentizable blocks must use components; <ui-component> layout should be declared only when needed, e.g., flex-1/self-stretch for fill or w-[...] for fixed column width, while fixed height h-[...] is avoided by default; styles should prioritize variable.json var(...), and var(...) must reference variable name/ukey instead of raw value; HTML fallback is allowed only when no matching library component exists, and the reason must be stated) or hybrid (mixed mode: only necessary components while fully using component-library styles/variables and icon system; used <ui-component> follows the same on-demand layout rule; var(...) preferred with variable name/ukey required). If omitted, ask the user to choose first."
|
|
65
|
-
},
|
|
66
|
-
"getUserInfo": {
|
|
67
|
-
"description": "Get current logged-in user information, including quotas, teams, etc.",
|
|
68
|
-
"inputSchema": "Get current user information"
|
|
69
|
-
},
|
|
70
|
-
"getCode": {
|
|
71
|
-
"description": "[Specific Scenario] Get code from the Codify plugin via contentId. For regular \"get selected code\" tasks, please prioritize using the get_selection_code tool.",
|
|
72
|
-
"contentId": "Instruction to copy layers from the Codify plugin (contentId)",
|
|
73
|
-
"documentId": "Current MasterGo document ID.",
|
|
74
|
-
"documentPageId": "Current MasterGo page ID.",
|
|
75
|
-
"projectDir": "[Required] The absolute path of the user's current workspace root directory.",
|
|
76
|
-
"outDir": "[Required] The absolute path to save code and resources"
|
|
77
|
-
},
|
|
78
|
-
"getLibraryList": {
|
|
79
|
-
"description": "Get team library list subscribed/loaded in current file (name, id, componentCount, styleCount). When user says \"generate page with xxx component library\", call this tool first.",
|
|
80
|
-
"inputSchema": "No parameters"
|
|
81
|
-
},
|
|
82
|
-
"getComponentInfo": {
|
|
83
|
-
"description": "Get component data of a specified team library and persist it as a \"catalog + library index + component details\" snapshot:\n- .codify/library/catalog.json\n- .codify/library/<teamLibraryId>/meta.json\n- .codify/library/<teamLibraryId>/<teamLibraryName>/index.json\n- .codify/library/<teamLibraryId>/<teamLibraryName>/components/<componentKey>.json\n- .codify/library/<teamLibraryId>/<teamLibraryName>/icons.json\n- .codify/library/<teamLibraryId>/<teamLibraryName>/variable.json\n\nIf teamLibraryId is missing, it first returns library choices; after you reply \"use xxx library\", call again with teamLibraryName to auto-match the id.\n\nSchema quick map: components[].{id,name,size,props,slots,instance_swap} + icons[].{id,name} + variables{}. Generation is strict: <ui-component>.name/props come from component detail files, instance_swap should prefer component name (name), and may also use ukey or library component id (do not use canvas data-node-id), and <ui-icon>.name comes from icons[].name. If a component has non-empty slots, you must follow the slot structure (prefer <ui-slot name=\"...\">). Before page generation, you must read index.json first (name/description), then load required component details via fixed path components/${key}.json and read variable.json for var(...) token references.",
|
|
84
|
-
"projectDir": "[Required] Absolute path of the user's workspace root (for persistence).",
|
|
85
|
-
"teamLibraryId": "[Optional] Team library ID. If provided, fetch directly.",
|
|
86
|
-
"teamLibraryName": "[Optional] Team library name. Used to auto-match ID when teamLibraryId is not provided.",
|
|
87
|
-
"includePropertyDetails": "[Optional] Include component property details. Default true."
|
|
88
|
-
},
|
|
89
|
-
"removeNode": {
|
|
90
|
-
"description": "Delete nodes in the MasterGo canvas. Supports specifying an ID via targetNodeId, or defaults to the currently selected layer if no ID is provided.",
|
|
91
|
-
"documentId": "Current MasterGo document ID.",
|
|
92
|
-
"documentPageId": "Current MasterGo page ID.",
|
|
93
|
-
"targetNodeId": "[Optional] The target layer ID to delete (e.g., 123:456). If not provided, the currently selected layer in MasterGo will be deleted by default."
|
|
94
|
-
}
|
|
95
|
-
}
|
package/dist/zh.json
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"getCodifyGuidelines": {
|
|
3
|
-
"description": "会话入口:当用户要使用 Codify / MasterGo 能力时先调用本工具。内置规则:page-generate、component-import、component-generate。支持按 scope 返回单条规则或 all 聚合规则。",
|
|
4
|
-
"inputSchema": "可选参数:scope(all/page-generate/component-import/component-generate),默认 all。all 返回 page-generate + component-import + 最终硬闸门。"
|
|
5
|
-
},
|
|
6
|
-
"createPage": {
|
|
7
|
-
"description": "创建页面:将代码发送到 Codify 插件转换为设计稿。\n 【极致性能要求】若纯 HTML 已保存为本地文件,强烈建议通过 filePath 传入该文件的绝对路径以节省 Token。如果是直接生成的临时代码,可以通过 code 参数直接传入。",
|
|
8
|
-
"code": "【可选】要发送的 HTML 代码内容。仅当代码是临时生成且未保存为文件时使用。",
|
|
9
|
-
"filePath": "【可选】本地 HTML 文件的绝对路径。若文件已存在本地,必须传此参数,工具会自动读取并执行落盘。",
|
|
10
|
-
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
11
|
-
"saveCodeToLocal": "是否将插件返回的渲染结果保存到本地 .codify 目录(落盘机制)"
|
|
12
|
-
},
|
|
13
|
-
"updateNode": {
|
|
14
|
-
"description": "局部修改:发回局部修改的代码。【工具选择规则】:默认用于不涉及结构变化的属性微调(如文字内容、尺寸、颜色、边框、阴影、特效等)。注意:如果是修改父容器的样式,传递的 HTML 代码中必须包含其原本所有的子元素结构以防丢失数据。",
|
|
15
|
-
"documentId": "当前 MasterGo 文档 ID。",
|
|
16
|
-
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
17
|
-
"targetNodeId": "【选填】目标图层 ID (例如 123:456)。如果不传,则默认更新 MasterGo 中当前选中的图层。",
|
|
18
|
-
"code": "【必填】修改后的 HTML 代码片段。必须包含 data-node-id。"
|
|
19
|
-
},
|
|
20
|
-
"replaceNode": {
|
|
21
|
-
"description": "节点替换:对指定节点进行【结构/图标/图片替换】。当你需要大规模改变一个组件的内部 HTML 结构(如增加、删除或重新排列子元素)时调用。",
|
|
22
|
-
"documentId": "当前 MasterGo 文档 ID。",
|
|
23
|
-
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
24
|
-
"targetNodeId": "【选填】目标图层 ID (例如 123:456)。如果不传,则默认替换 MasterGo 中当前选中的图层。",
|
|
25
|
-
"code": "【必填】新的 HTML 代码内容。将完整替换目标节点内部。"
|
|
26
|
-
},
|
|
27
|
-
"syncToDesign": {
|
|
28
|
-
"description": "全量同步:将本地完整的静态 HTML 文件内容同步覆盖到 MasterGo 画布进行【全量同步】(如保存整个页面、复杂的模块同步)。仅当用户明确提出“同步到画布”时才允许调用,禁止自动触发。必须传入根节点 ID (rootId) 以确保层级正确。",
|
|
29
|
-
"documentId": "当前 MasterGo 文档 ID。",
|
|
30
|
-
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
31
|
-
"targetNodeId": "【必填】页面的根节点 ID (rootId)。",
|
|
32
|
-
"filePath": "【必填】本地静态 HTML 文件的绝对路径(通常位于 .codify/... 目录下)。工具会自动读取内容。严禁传入 .vue/.tsx 业务代码路径!",
|
|
33
|
-
"userConfirmed": "【必填】用户是否已明确确认“同步到画布”。仅在用户主动要求同步时传 true。"
|
|
34
|
-
},
|
|
35
|
-
"getSelectionCode": {
|
|
36
|
-
"description": "获取节点代码:拉取 MasterGo 当前选中图层(或指定图层)的最新代码。执行任何修改前应先调用本工具,避免基于旧代码操作。拉取子节点时仅返回代码文本;拉取根节点时会同步完整页面到 .codify 基准文件。",
|
|
37
|
-
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
38
|
-
"targetNodeId": "【选填】MasterGo图层ID (例如 123:456)。如果提供,将直接拉取该ID的代码;如果不提供,将拉取当前选中图层的代码。",
|
|
39
|
-
"syncToBase": "【选填】是否将获取到的子图层代码同步回本地 .codify 目录下的基准 HTML 文件(合并更新)。默认为 true。"
|
|
40
|
-
},
|
|
41
|
-
"createComponent": {
|
|
42
|
-
"description": "创建组件:创建一个 MasterGo 母版组件或组件集(变体)。建议先调用 get_codify_guidelines(scope=\"component-generate\") 加载组件生成规则,再调用本工具发送代码。本工具仅负责发送到插件,不做规范兜底校验。",
|
|
43
|
-
"code": "组件的纯 HTML 字符串。根节点必须包含 data-type=\"component\" 或 \"component-set\";若为 component-set,变体节点必须是其直接子节点,并使用 data-variant-* 扁平声明变体属性。"
|
|
44
|
-
},
|
|
45
|
-
"getDesignDiff": {
|
|
46
|
-
"description": "比较差异:获取本地基准文件与 MasterGo 画布设计现状的差异。调用后返回 JSON 形式的 Diff 结果,用于协助判断有哪些图层或样式发生了改变。",
|
|
47
|
-
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
48
|
-
"targetNodeId": "【选填】MasterGo图层ID (例如 123:456)。如果不传,则默认获取当前选中图层的代码进行对比。",
|
|
49
|
-
"filePath": "【选填】本地基准 HTML 文件的绝对路径。如果已通过 write_to_file 更新了基准文件,请直接传此路径。"
|
|
50
|
-
},
|
|
51
|
-
"getCodeList": {
|
|
52
|
-
"description": "代码列表:获取所有可用的代码列表",
|
|
53
|
-
"inputSchema": "无需参数获取代码列表"
|
|
54
|
-
},
|
|
55
|
-
"design": {
|
|
56
|
-
"description": "设计页面:根据需求生成符合 Codify 规范的 HTML+CSS 代码。固定流程:先询问是否使用组件库;若使用,则每次都要让用户选择团队库,再让用户选择构建策略(full-components/hybrid);最后才生成页面。组件库模式需先读本地 .codify/library,无本地快照时再走 get_library_list + get_component_info。",
|
|
57
|
-
"requirement": "界面需求描述,例如:\"一个美观的登录页面\"、\"现代化的仪表盘界面\"等。",
|
|
58
|
-
"code": "【可选】若已生成完整代码(可含 Markdown + <main>),传入后将自动提取 <main> 并直接提交到画布。",
|
|
59
|
-
"projectDir": "【选填】用户当前工作区的根目录绝对路径。组件库生成场景建议传入,用于优先匹配 .codify/library 本地落盘数据。",
|
|
60
|
-
"useComponentLibrary": "【必填(流程)】是否使用组件库生成页面。每次调用 design 都应先让用户明确选择 true/false。",
|
|
61
|
-
"userConfirmedUseComponentLibrary": "【必填(流程)】是否已完成本次“是否使用组件库”的用户确认。每次新页面流程都应传 true 才可继续。",
|
|
62
|
-
"teamLibraryName": "【组件库模式必填】用户确认选择的团队库名称。每次都需要重新确认,不允许助手自动选库。",
|
|
63
|
-
"buildStrategy": "【组件库模式必填】构建策略:full-components / hybrid。full-components:可组件化区块必须优先使用组件;样式优先使用 variable.json 的 var(...),且 var(...) 必须写变量名(name/ukey);仅组件缺失时允许局部自绘并说明原因。hybrid:仅关键功能区使用必要组件,其余可自由绘制,但必须使用组件库样式变量与图标系统;样式同样优先使用 var(...) 变量名。未指定时必须先询问用户二选一。"
|
|
64
|
-
},
|
|
65
|
-
"getUserInfo": {
|
|
66
|
-
"description": "用户信息:获取当前登录用户的信息,包括配额、团队等",
|
|
67
|
-
"inputSchema": "获取当前用户信息"
|
|
68
|
-
},
|
|
69
|
-
"getCode": {
|
|
70
|
-
"description": "获取代码:通过 codify://getCode/{contentId} 从 Codify 插件获取代码。常规的\"获取选中代码\"请优先使用 get_selection_code 工具。",
|
|
71
|
-
"contentId": "从Codify插件复制图层的指令 (contentId)",
|
|
72
|
-
"documentId": "当前 MasterGo 文档 ID。",
|
|
73
|
-
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
74
|
-
"projectDir": "【必填】用户当前工作区的根目录绝对路径",
|
|
75
|
-
"outDir": "【必填】保存代码和资源的绝对路径"
|
|
76
|
-
},
|
|
77
|
-
"getLibraryList": {
|
|
78
|
-
"description": "团队库列表:获取当前文件已订阅/已加载的团队库列表(名称、ID、组件数、样式数)。仅在用户明确说“使用 xxx 团队库/组件库的组件生成页面”时才允许调用;普通 design 场景禁止调用。",
|
|
79
|
-
"inputSchema": "无需参数"
|
|
80
|
-
},
|
|
81
|
-
"getComponentInfo": {
|
|
82
|
-
"description": "组件信息:获取指定团队库组件数据并落盘到本地,用于后续页面生成。落盘结构:catalog.json、<teamLibraryId>/meta.json、<teamLibraryId>/<teamLibraryName>/index.json、components/*.json、icons.json、variable.json。仅当用户明确要求“使用某团队库/组件库生成页面”时调用;普通 design 场景禁止调用。未传 teamLibraryId 时会先返回团队库列表供选择,用户确认后可用 teamLibraryName 自动匹配 ID。生成页面前必须先读 index.json,再按 components/${key}.json 读取组件详情,并读取 variable.json 作为 var(...) 来源;<ui-component>/<ui-icon> 只能引用落盘数据。",
|
|
83
|
-
"projectDir": "【必填】用户当前工作区的根目录绝对路径(用于落盘)",
|
|
84
|
-
"teamLibraryId": "【选填】团队库 ID。若提供则直接获取该库组件信息。",
|
|
85
|
-
"teamLibraryName": "【选填】团队库名称。若未提供 teamLibraryId,可用名称自动匹配团队库 ID。",
|
|
86
|
-
"includePropertyDetails": "【选填】是否包含组件属性详情。默认 true。"
|
|
87
|
-
},
|
|
88
|
-
"removeNode": {
|
|
89
|
-
"description": "移除节点:在 MasterGo 画布中执行删除节点操作。支持通过 targetNodeId 指定 ID,或在不传 ID 时默认删除当前选中图层。",
|
|
90
|
-
"documentId": "当前 MasterGo 文档 ID。",
|
|
91
|
-
"documentPageId": "当前 MasterGo 页面 ID。",
|
|
92
|
-
"targetNodeId": "【选填】要删除的目标图层 ID (例如 123:456)。如果不传,则默认删除 MasterGo 中当前选中的图层。"
|
|
93
|
-
}
|
|
94
|
-
}
|