@sxl-studio/bridge 1.7.2 → 1.8.0
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 +342 -16
- package/dist/agent-recipes.d.ts +781 -11
- package/dist/agent-recipes.js +886 -13
- package/dist/agent-recipes.js.map +1 -1
- package/dist/agent-runbook.d.ts +50 -0
- package/dist/agent-runbook.js +243 -0
- package/dist/agent-runbook.js.map +1 -0
- package/dist/asset-upload.d.ts +63 -0
- package/dist/asset-upload.js +225 -0
- package/dist/asset-upload.js.map +1 -0
- package/dist/audit-store.d.ts +15 -0
- package/dist/audit-store.js +100 -0
- package/dist/audit-store.js.map +1 -0
- package/dist/audit.d.ts +4 -3
- package/dist/audit.js +37 -4
- package/dist/audit.js.map +1 -1
- package/dist/auth.d.ts +8 -1
- package/dist/auth.js +41 -1
- package/dist/auth.js.map +1 -1
- package/dist/bridge-agent-workflow-validation-cli.d.ts +2 -0
- package/dist/bridge-agent-workflow-validation-cli.js +68 -0
- package/dist/bridge-agent-workflow-validation-cli.js.map +1 -0
- package/dist/bridge-agent-workflow-validation.d.ts +42 -0
- package/dist/bridge-agent-workflow-validation.js +170 -0
- package/dist/bridge-agent-workflow-validation.js.map +1 -0
- package/dist/bridge-contract-audit.d.ts +45 -0
- package/dist/bridge-contract-audit.js +345 -0
- package/dist/bridge-contract-audit.js.map +1 -0
- package/dist/bridge-health-cli.d.ts +2 -0
- package/dist/bridge-health-cli.js +115 -0
- package/dist/bridge-health-cli.js.map +1 -0
- package/dist/bridge-health.d.ts +33 -0
- package/dist/bridge-health.js +594 -0
- package/dist/bridge-health.js.map +1 -0
- package/dist/bridge-live-validation-cli.d.ts +2 -0
- package/dist/bridge-live-validation-cli.js +114 -0
- package/dist/bridge-live-validation-cli.js.map +1 -0
- package/dist/bridge-live-validation.d.ts +39 -0
- package/dist/bridge-live-validation.js +1141 -0
- package/dist/bridge-live-validation.js.map +1 -0
- package/dist/bridge-performance-profile.d.ts +81 -0
- package/dist/bridge-performance-profile.js +227 -0
- package/dist/bridge-performance-profile.js.map +1 -0
- package/dist/bridge-readiness-cli.d.ts +30 -0
- package/dist/bridge-readiness-cli.js +242 -0
- package/dist/bridge-readiness-cli.js.map +1 -0
- package/dist/bridge-runtime-summary.d.ts +50 -0
- package/dist/bridge-runtime-summary.js +112 -0
- package/dist/bridge-runtime-summary.js.map +1 -0
- package/dist/bridge-workflow-smoke-cli.d.ts +2 -0
- package/dist/bridge-workflow-smoke-cli.js +126 -0
- package/dist/bridge-workflow-smoke-cli.js.map +1 -0
- package/dist/bridge-workflow-smoke.d.ts +39 -0
- package/dist/bridge-workflow-smoke.js +431 -0
- package/dist/bridge-workflow-smoke.js.map +1 -0
- package/dist/codeconnect-suggestions.d.ts +74 -0
- package/dist/codeconnect-suggestions.js +398 -0
- package/dist/codeconnect-suggestions.js.map +1 -0
- package/dist/codeconnect-template.d.ts +98 -0
- package/dist/codeconnect-template.js +280 -0
- package/dist/codeconnect-template.js.map +1 -0
- package/dist/command-queue.d.ts +11 -1
- package/dist/command-queue.js +200 -1
- package/dist/command-queue.js.map +1 -1
- package/dist/command-safety.d.ts +13 -0
- package/dist/command-safety.js +59 -0
- package/dist/command-safety.js.map +1 -0
- package/dist/enabled-library-search.d.ts +49 -0
- package/dist/enabled-library-search.js +151 -0
- package/dist/enabled-library-search.js.map +1 -0
- package/dist/figma-mcp-parity.d.ts +49 -0
- package/dist/figma-mcp-parity.js +368 -0
- package/dist/figma-mcp-parity.js.map +1 -0
- package/dist/figma-mcp-skills-parity.d.ts +61 -0
- package/dist/figma-mcp-skills-parity.js +434 -0
- package/dist/figma-mcp-skills-parity.js.map +1 -0
- package/dist/figma-rest-diagnostics.d.ts +50 -0
- package/dist/figma-rest-diagnostics.js +314 -0
- package/dist/figma-rest-diagnostics.js.map +1 -0
- package/dist/figma-rest.d.ts +27 -0
- package/dist/figma-rest.js +116 -0
- package/dist/figma-rest.js.map +1 -0
- package/dist/http-api.d.ts +16 -2
- package/dist/http-api.js +329 -17
- package/dist/http-api.js.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-factory.d.ts +6 -1
- package/dist/mcp-factory.js +23 -4
- package/dist/mcp-factory.js.map +1 -1
- package/dist/mcp-runtime-probe.d.ts +22 -0
- package/dist/mcp-runtime-probe.js +777 -0
- package/dist/mcp-runtime-probe.js.map +1 -0
- package/dist/mcp-server.d.ts +2 -1
- package/dist/mcp-server.js +2 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/sxl-mcp-instructions.js +99 -26
- package/dist/sxl-mcp-instructions.js.map +1 -1
- package/dist/tools/audit.d.ts +22 -6
- package/dist/tools/audit.js +49 -7
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/capability-matrix.d.ts +22 -0
- package/dist/tools/capability-matrix.js +38 -0
- package/dist/tools/capability-matrix.js.map +1 -0
- package/dist/tools/catalogue-bootstrap.d.ts +1 -0
- package/dist/tools/catalogue-bootstrap.js +665 -30
- package/dist/tools/catalogue-bootstrap.js.map +1 -1
- package/dist/tools/code-connect-context.d.ts +3 -0
- package/dist/tools/code-connect-context.js +319 -0
- package/dist/tools/code-connect-context.js.map +1 -0
- package/dist/tools/code-connect-template.d.ts +3 -0
- package/dist/tools/code-connect-template.js +111 -0
- package/dist/tools/code-connect-template.js.map +1 -0
- package/dist/tools/composition.js +15 -30
- package/dist/tools/composition.js.map +1 -1
- package/dist/tools/compositions-orchestration.d.ts +14 -14
- package/dist/tools/compositions-orchestration.js +2 -2
- package/dist/tools/compositions-orchestration.js.map +1 -1
- package/dist/tools/data.js +839 -27
- package/dist/tools/data.js.map +1 -1
- package/dist/tools/design-context.d.ts +3 -0
- package/dist/tools/design-context.js +197 -0
- package/dist/tools/design-context.js.map +1 -0
- package/dist/tools/destructive-confirmation.d.ts +10 -0
- package/dist/tools/destructive-confirmation.js +25 -0
- package/dist/tools/destructive-confirmation.js.map +1 -0
- package/dist/tools/diagnostics.js +76 -51
- package/dist/tools/diagnostics.js.map +1 -1
- package/dist/tools/figma-mcp-design.d.ts +3 -0
- package/dist/tools/figma-mcp-design.js +377 -0
- package/dist/tools/figma-mcp-design.js.map +1 -0
- package/dist/tools/figma-nodes.js +57 -43
- package/dist/tools/figma-nodes.js.map +1 -1
- package/dist/tools/figma-rc-extended.js +23 -6
- package/dist/tools/figma-rc-extended.js.map +1 -1
- package/dist/tools/figma-rest.d.ts +39 -0
- package/dist/tools/figma-rest.js +279 -0
- package/dist/tools/figma-rest.js.map +1 -0
- package/dist/tools/git.js +11 -7
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/large-data.d.ts +14 -0
- package/dist/tools/large-data.js +189 -0
- package/dist/tools/large-data.js.map +1 -0
- package/dist/tools/meta.d.ts +6 -1
- package/dist/tools/meta.js +89 -11
- package/dist/tools/meta.js.map +1 -1
- package/dist/tools/metadata.d.ts +3 -0
- package/dist/tools/metadata.js +140 -0
- package/dist/tools/metadata.js.map +1 -0
- package/dist/tools/mockup.d.ts +15 -156
- package/dist/tools/mockup.js +54 -121
- package/dist/tools/mockup.js.map +1 -1
- package/dist/tools/orchestration.js +75 -47
- package/dist/tools/orchestration.js.map +1 -1
- package/dist/tools/prompts.d.ts +3 -0
- package/dist/tools/prompts.js +219 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/registry.d.ts +19 -1
- package/dist/tools/registry.js +4 -4
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/resources.d.ts +19 -2
- package/dist/tools/resources.js +149 -5
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/schema-contracts.d.ts +4763 -0
- package/dist/tools/schema-contracts.js +814 -0
- package/dist/tools/schema-contracts.js.map +1 -0
- package/dist/tools/screenshot.d.ts +3 -0
- package/dist/tools/screenshot.js +144 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/shared.d.ts +11 -1
- package/dist/tools/shared.js +55 -2
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/styles-orchestration.d.ts +2 -2
- package/dist/tools/styles-orchestration.js +13 -5
- package/dist/tools/styles-orchestration.js.map +1 -1
- package/dist/tools/styles.js +22 -8
- package/dist/tools/styles.js.map +1 -1
- package/dist/tools/tokens.d.ts +31 -692
- package/dist/tools/tokens.js +175 -135
- package/dist/tools/tokens.js.map +1 -1
- package/dist/tools/variable-defs.d.ts +3 -0
- package/dist/tools/variable-defs.js +338 -0
- package/dist/tools/variable-defs.js.map +1 -0
- package/dist/tools/variables-orchestration.js +13 -5
- package/dist/tools/variables-orchestration.js.map +1 -1
- package/dist/tools/variables.js +18 -15
- package/dist/tools/variables.js.map +1 -1
- package/dist/types.d.ts +53 -0
- package/dist/ultimate-readiness-audit.d.ts +37 -0
- package/dist/ultimate-readiness-audit.js +431 -0
- package/dist/ultimate-readiness-audit.js.map +1 -0
- package/dist/workflow-planner.d.ts +57 -0
- package/dist/workflow-planner.js +464 -0
- package/dist/workflow-planner.js.map +1 -0
- package/dist/workspace-blob-store.d.ts +6 -0
- package/dist/workspace-blob-store.js +9 -0
- package/dist/workspace-blob-store.js.map +1 -1
- package/dist/workspace-path-http.d.ts +24 -0
- package/dist/workspace-path-http.js +146 -0
- package/dist/workspace-path-http.js.map +1 -0
- package/dist/ws-server.js +16 -3
- package/dist/ws-server.js.map +1 -1
- package/package.json +21 -2
|
@@ -2,35 +2,25 @@
|
|
|
2
2
|
* MCP tools for Composition operations.
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
import { callPluginCommand, callPluginWriteCommand } from "./shared.js";
|
|
5
6
|
export function registerCompositionTools(server, queue) {
|
|
6
7
|
server.tool("generate_composition", "Generate a Figma component (or ComponentSet) from a composition JSON file. Creates the component structure, applies styles, binds variables. When the JSON has \"component\": false, creates plain nodes (Frame/Instance) instead of a Component. The fileId can be an internal file ID or a file path like 'compositions/MyButton/MyButton.json'.", {
|
|
7
8
|
fileId: z.string().describe("File path (e.g. 'compositions/MyButton/MyButton.json') or internal file ID"),
|
|
8
9
|
compositionName: z.string().optional().describe("Component name from JSON (e.g. 'MyButton') — used as fallback if fileId doesn't resolve"),
|
|
9
|
-
}, async ({ fileId, compositionName }) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
10
|
+
}, async ({ fileId, compositionName }) => callPluginWriteCommand(queue, "generate_composition", { fileId, compositionName }, {
|
|
11
|
+
okFalseErrorCode: "SXL_COMPOSITION_WRITE_FAILED",
|
|
12
|
+
}));
|
|
13
13
|
server.tool("apply_composition", "Apply a composition JSON to an existing Figma component. Updates structure, styles, and bindings without re-creating. The fileId can be an internal file ID or a file path.", {
|
|
14
14
|
fileId: z.string().describe("File path (e.g. 'compositions/MyButton/MyButton.json') or internal file ID"),
|
|
15
15
|
compositionName: z.string().optional().describe("Component name from JSON — used as fallback"),
|
|
16
|
-
}, async ({ fileId, compositionName }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
16
|
+
}, async ({ fileId, compositionName }) => callPluginWriteCommand(queue, "apply_composition", { fileId, compositionName }, {
|
|
17
|
+
okFalseErrorCode: "SXL_COMPOSITION_WRITE_FAILED",
|
|
18
|
+
}));
|
|
20
19
|
server.tool("preview_composition", "Preview a composition JSON without applying it. Returns parsed structure and any validation errors. The fileId can be an internal file ID or a file path.", {
|
|
21
20
|
fileId: z.string().describe("File path (e.g. 'compositions/MyButton/MyButton.json') or internal file ID"),
|
|
22
|
-
}, async ({ fileId }) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
server.tool("check_composition_linked", "Check if a composition is linked to an existing component in the Figma file.", { compositionName: z.string().describe("Name of the composition to check") }, async ({ compositionName }) => {
|
|
27
|
-
const result = await queue.execute("check_composition_linked", { compositionName });
|
|
28
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
29
|
-
});
|
|
30
|
-
server.tool("inspect_selection", "Inspect the currently selected nodes in Figma. Returns token bindings, composition status, drift status, and node hierarchy.", {}, async () => {
|
|
31
|
-
const result = await queue.execute("inspect_selection");
|
|
32
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
33
|
-
});
|
|
21
|
+
}, async ({ fileId }) => callPluginCommand(queue, "preview_composition", { fileId }));
|
|
22
|
+
server.tool("check_composition_linked", "Check if a composition is linked to an existing component in the Figma file.", { compositionName: z.string().describe("Name of the composition to check") }, async ({ compositionName }) => callPluginCommand(queue, "check_composition_linked", { compositionName }));
|
|
23
|
+
server.tool("inspect_selection", "Inspect the currently selected nodes in Figma. Returns token bindings, composition status, drift status, and node hierarchy.", {}, async () => callPluginCommand(queue, "inspect_selection"));
|
|
34
24
|
server.tool("export_composition_json", "Export the selected node (or a node by ID) as composition JSON string — the SINGLE SOURCE OF TRUTH for composition JSON. Produces the exact same output as Dev Mode → Get Code → Designer JSON tab. For non-component nodes (Frame, Group, etc.) the output includes \"component\": false so the JSON can be used to regenerate plain nodes. NEVER hand-craft this JSON from get_node_tree / get_selection — always use this tool.", {
|
|
35
25
|
nodeId: z
|
|
36
26
|
.string()
|
|
@@ -40,16 +30,15 @@ export function registerCompositionTools(server, queue) {
|
|
|
40
30
|
const payload = {};
|
|
41
31
|
if (nodeId)
|
|
42
32
|
payload.nodeId = nodeId;
|
|
43
|
-
|
|
44
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
33
|
+
return callPluginCommand(queue, "export_composition_json", payload);
|
|
45
34
|
});
|
|
46
|
-
server.tool("get_codegen", "Run Figma Dev Mode codegen for the selected node (or by nodeId) and return all generated tabs. This exposes the exact same output the user sees in Dev Mode → Inspect → Code panel, for any language: designer-json (default, includes Props/Structure/Styles/Variables/Transitions/Theme/Code Connect tabs), vue3 (SFC + CSS vars + Code Connect), swiftui (Swift file + Variables), kotlin (Compose file + Variables). Use viewMode to switch between 'styled' (default, tokens preserved), 'decomposed' (composite styles expanded) or 'raw' (all literals).", {
|
|
35
|
+
server.tool("get_codegen", "Run Figma Dev Mode codegen for the selected node (or by nodeId) and return all generated tabs. This exposes the exact same output the user sees in Dev Mode → Inspect → Code panel, for any language: designer-json (default, includes Props/Structure/Styles/Variables/Transitions/Theme/Code Connect tabs), vue3 (SFC + CSS vars + Code Connect), swiftui (Swift file + Variables), kotlin (Compose file + Variables), divkit (DivKit JSON card). Use viewMode to switch between 'styled' (default, tokens preserved), 'decomposed' (composite styles expanded) or 'raw' (all literals).", {
|
|
47
36
|
nodeId: z
|
|
48
37
|
.string()
|
|
49
38
|
.optional()
|
|
50
39
|
.describe("Figma node id. Omit to use current selection (first selected node)."),
|
|
51
40
|
language: z
|
|
52
|
-
.enum(["designer-json", "vue3", "swiftui", "kotlin"])
|
|
41
|
+
.enum(["designer-json", "vue3", "swiftui", "kotlin", "divkit"])
|
|
53
42
|
.optional()
|
|
54
43
|
.describe("Target language for codegen. Defaults to 'designer-json'."),
|
|
55
44
|
viewMode: z
|
|
@@ -64,12 +53,8 @@ export function registerCompositionTools(server, queue) {
|
|
|
64
53
|
payload.language = language;
|
|
65
54
|
if (viewMode)
|
|
66
55
|
payload.viewMode = viewMode;
|
|
67
|
-
|
|
68
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
69
|
-
});
|
|
70
|
-
server.tool("list_compositions", "List every composition JSON file in the plugin workspace (entries with $type:composition). Returns fileId, fileName, folder, gitPath, compositionName, and whether it represents a Component (component:true) or plain Frames (component:false). Use this to discover targets for generate_composition / apply_composition.", {}, async () => {
|
|
71
|
-
const result = await queue.execute("list_compositions", {});
|
|
72
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
56
|
+
return callPluginCommand(queue, "get_codegen", payload);
|
|
73
57
|
});
|
|
58
|
+
server.tool("list_compositions", "List every composition JSON file in the plugin workspace (entries with $type:composition). Returns fileId, fileName, folder, gitPath, compositionName, and whether it represents a Component (component:true) or plain Frames (component:false). Use this to discover targets for generate_composition / apply_composition.", {}, async () => callPluginCommand(queue, "list_compositions", {}));
|
|
74
59
|
}
|
|
75
60
|
//# sourceMappingURL=composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../src/tools/composition.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../src/tools/composition.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,UAAU,wBAAwB,CAAC,MAAiB,EAAE,KAAmB;IAC7E,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,oVAAoV,EACpV;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4EAA4E,CAAC;QACzG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;KAC3I,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE,CACpC,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE;QACjF,gBAAgB,EAAE,8BAA8B;KACjD,CAAC,CACL,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,6KAA6K,EAC7K;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4EAA4E,CAAC;QACzG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;KAC/F,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE,CACpC,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,MAAM,E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EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,QAAQ,EAAE,CAAC;aACR,IAAI,CAAC,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;aAC9D,QAAQ,EAAE;aACV,QAAQ,CAAC,2DAA2D,CAAC;QACxE,QAAQ,EAAE,CAAC;aACR,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;aACrC,QAAQ,EAAE;aACV,QAAQ,CAAC,2IAA2I,CAAC;KACzJ,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACvC,MAAM,OAAO,GAA4B,EAAE,CAAC;QAC5C,IAAI,MAAM;YAAE,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACpC,IAAI,QAAQ;YAAE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1C,IAAI,QAAQ;YAAE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1C,OAAO,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,6TAA6T,EAC7T,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -36,37 +36,37 @@ export declare const compositionsOrchestrationSchemas: {
|
|
|
36
36
|
anchorNodeId: z.ZodOptional<z.ZodString>;
|
|
37
37
|
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
dryRun?: boolean | undefined;
|
|
40
|
+
operation?: "auto" | "apply" | "generate" | undefined;
|
|
41
|
+
prefix?: string | undefined;
|
|
39
42
|
fileIds?: string[] | undefined;
|
|
40
43
|
names?: string[] | undefined;
|
|
41
|
-
prefix?: string | undefined;
|
|
42
|
-
operation?: "auto" | "generate" | "apply" | undefined;
|
|
43
44
|
continueOnError?: boolean | undefined;
|
|
44
45
|
anchorNodeId?: string | undefined;
|
|
45
|
-
dryRun?: boolean | undefined;
|
|
46
46
|
}, {
|
|
47
|
+
dryRun?: boolean | undefined;
|
|
48
|
+
operation?: "auto" | "apply" | "generate" | undefined;
|
|
49
|
+
prefix?: string | undefined;
|
|
47
50
|
fileIds?: string[] | undefined;
|
|
48
51
|
names?: string[] | undefined;
|
|
49
|
-
prefix?: string | undefined;
|
|
50
|
-
operation?: "auto" | "generate" | "apply" | undefined;
|
|
51
52
|
continueOnError?: boolean | undefined;
|
|
52
53
|
anchorNodeId?: string | undefined;
|
|
53
|
-
dryRun?: boolean | undefined;
|
|
54
54
|
}>, {
|
|
55
|
+
dryRun?: boolean | undefined;
|
|
56
|
+
operation?: "auto" | "apply" | "generate" | undefined;
|
|
57
|
+
prefix?: string | undefined;
|
|
55
58
|
fileIds?: string[] | undefined;
|
|
56
59
|
names?: string[] | undefined;
|
|
57
|
-
prefix?: string | undefined;
|
|
58
|
-
operation?: "auto" | "generate" | "apply" | undefined;
|
|
59
60
|
continueOnError?: boolean | undefined;
|
|
60
61
|
anchorNodeId?: string | undefined;
|
|
61
|
-
dryRun?: boolean | undefined;
|
|
62
62
|
}, {
|
|
63
|
+
dryRun?: boolean | undefined;
|
|
64
|
+
operation?: "auto" | "apply" | "generate" | undefined;
|
|
65
|
+
prefix?: string | undefined;
|
|
63
66
|
fileIds?: string[] | undefined;
|
|
64
67
|
names?: string[] | undefined;
|
|
65
|
-
prefix?: string | undefined;
|
|
66
|
-
operation?: "auto" | "generate" | "apply" | undefined;
|
|
67
68
|
continueOnError?: boolean | undefined;
|
|
68
69
|
anchorNodeId?: string | undefined;
|
|
69
|
-
dryRun?: boolean | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
auditDriftRequestZod: z.ZodObject<{
|
|
72
72
|
fileIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -75,15 +75,15 @@ export declare const compositionsOrchestrationSchemas: {
|
|
|
75
75
|
includeUnlinked: z.ZodOptional<z.ZodBoolean>;
|
|
76
76
|
includeLinked: z.ZodOptional<z.ZodBoolean>;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
prefix?: string | undefined;
|
|
78
79
|
fileIds?: string[] | undefined;
|
|
79
80
|
names?: string[] | undefined;
|
|
80
|
-
prefix?: string | undefined;
|
|
81
81
|
includeUnlinked?: boolean | undefined;
|
|
82
82
|
includeLinked?: boolean | undefined;
|
|
83
83
|
}, {
|
|
84
|
+
prefix?: string | undefined;
|
|
84
85
|
fileIds?: string[] | undefined;
|
|
85
86
|
names?: string[] | undefined;
|
|
86
|
-
prefix?: string | undefined;
|
|
87
87
|
includeUnlinked?: boolean | undefined;
|
|
88
88
|
includeLinked?: boolean | undefined;
|
|
89
89
|
}>;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* for design systems with hundreds of components.
|
|
25
25
|
*/
|
|
26
26
|
import { z } from "zod";
|
|
27
|
-
import { callPluginCommand } from "./shared.js";
|
|
27
|
+
import { callPluginCommand, callPluginWriteCommand } from "./shared.js";
|
|
28
28
|
// ─── Shared building blocks ───────────────────────────────────────────────────
|
|
29
29
|
const stringArrayZod = z
|
|
30
30
|
.array(z.string().min(1))
|
|
@@ -92,7 +92,7 @@ export function registerCompositionsOrchestrationTools(server, queue) {
|
|
|
92
92
|
// — bulk_generate_compositions ---------------------------------------------
|
|
93
93
|
server.tool("bulk_generate_compositions", "Bulk generate / apply MANY composition files in a single MCP call. Discovers every composition in the plugin workspace (same source as `list_compositions`), filters by `fileIds | names | prefix`, then runs the per-file generate/apply pipeline. Per-item errors are isolated — one bad composition does NOT abort the run (set `continueOnError: false` to opt out). `operation` controls the effective branch: `auto` (default) keeps the manual UX (apply when tracking exists, otherwise generate), `generate` forces a fresh ComponentSet rebuild, `apply` forces apply onto the existing component. `dryRun: true` returns the resolved plan WITHOUT touching the canvas — Dev Mode safe. Use it after `audit_composition_drift` to selectively re-generate only drifted components. CANVAS WRITE in apply / generate mode (Dev Mode blocks unless `dryRun: true`). Recipe: `sxl://agent/recipes/bulk-compositions`.", {
|
|
94
94
|
request: bulkGenerateRequestZod.describe("Filter set + operation + execution mode. All filters are AND-ed (a composition must satisfy every provided filter). Omit all three filters to operate on every composition in the workspace."),
|
|
95
|
-
}, async ({ request }) =>
|
|
95
|
+
}, async ({ request }) => callPluginWriteCommand(queue, "bulk_generate_compositions", request, { okFalseErrorCode: "SXL_COMPOSITION_WRITE_FAILED" }));
|
|
96
96
|
// — audit_composition_drift -------------------------------------------------
|
|
97
97
|
server.tool("audit_composition_drift", "READ-ONLY drift detector between workspace composition files and the Figma components they tracked in `diff-id.compositions`. Reports per-composition status: `linked` (tracking valid + Figma node matches), `unlinked` (composition was never generated — no tracking entry), `drift` (Figma node renamed or variant count mismatch vs the JSON), `missing` (tracking points to a deleted node). Returns `findings[]` with human-readable `reason`. Fully Dev-Mode-compatible — never touches the canvas. Pair with `bulk_generate_compositions { fileIds: drifted }` to fix drift in one round-trip. Recipe: `sxl://agent/recipes/composition-drift`.", {
|
|
98
98
|
request: auditDriftRequestZod.describe("Filter set + report flags. Default returns every composition + every status."),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compositions-orchestration.js","sourceRoot":"","sources":["../../src/tools/compositions-orchestration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"compositions-orchestration.js","sourceRoot":"","sources":["../../src/tools/compositions-orchestration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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