@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.
Files changed (203) hide show
  1. package/README.md +342 -16
  2. package/dist/agent-recipes.d.ts +781 -11
  3. package/dist/agent-recipes.js +886 -13
  4. package/dist/agent-recipes.js.map +1 -1
  5. package/dist/agent-runbook.d.ts +50 -0
  6. package/dist/agent-runbook.js +243 -0
  7. package/dist/agent-runbook.js.map +1 -0
  8. package/dist/asset-upload.d.ts +63 -0
  9. package/dist/asset-upload.js +225 -0
  10. package/dist/asset-upload.js.map +1 -0
  11. package/dist/audit-store.d.ts +15 -0
  12. package/dist/audit-store.js +100 -0
  13. package/dist/audit-store.js.map +1 -0
  14. package/dist/audit.d.ts +4 -3
  15. package/dist/audit.js +37 -4
  16. package/dist/audit.js.map +1 -1
  17. package/dist/auth.d.ts +8 -1
  18. package/dist/auth.js +41 -1
  19. package/dist/auth.js.map +1 -1
  20. package/dist/bridge-agent-workflow-validation-cli.d.ts +2 -0
  21. package/dist/bridge-agent-workflow-validation-cli.js +68 -0
  22. package/dist/bridge-agent-workflow-validation-cli.js.map +1 -0
  23. package/dist/bridge-agent-workflow-validation.d.ts +42 -0
  24. package/dist/bridge-agent-workflow-validation.js +170 -0
  25. package/dist/bridge-agent-workflow-validation.js.map +1 -0
  26. package/dist/bridge-contract-audit.d.ts +45 -0
  27. package/dist/bridge-contract-audit.js +345 -0
  28. package/dist/bridge-contract-audit.js.map +1 -0
  29. package/dist/bridge-health-cli.d.ts +2 -0
  30. package/dist/bridge-health-cli.js +115 -0
  31. package/dist/bridge-health-cli.js.map +1 -0
  32. package/dist/bridge-health.d.ts +33 -0
  33. package/dist/bridge-health.js +594 -0
  34. package/dist/bridge-health.js.map +1 -0
  35. package/dist/bridge-live-validation-cli.d.ts +2 -0
  36. package/dist/bridge-live-validation-cli.js +114 -0
  37. package/dist/bridge-live-validation-cli.js.map +1 -0
  38. package/dist/bridge-live-validation.d.ts +39 -0
  39. package/dist/bridge-live-validation.js +1141 -0
  40. package/dist/bridge-live-validation.js.map +1 -0
  41. package/dist/bridge-performance-profile.d.ts +81 -0
  42. package/dist/bridge-performance-profile.js +227 -0
  43. package/dist/bridge-performance-profile.js.map +1 -0
  44. package/dist/bridge-readiness-cli.d.ts +30 -0
  45. package/dist/bridge-readiness-cli.js +242 -0
  46. package/dist/bridge-readiness-cli.js.map +1 -0
  47. package/dist/bridge-runtime-summary.d.ts +50 -0
  48. package/dist/bridge-runtime-summary.js +112 -0
  49. package/dist/bridge-runtime-summary.js.map +1 -0
  50. package/dist/bridge-workflow-smoke-cli.d.ts +2 -0
  51. package/dist/bridge-workflow-smoke-cli.js +126 -0
  52. package/dist/bridge-workflow-smoke-cli.js.map +1 -0
  53. package/dist/bridge-workflow-smoke.d.ts +39 -0
  54. package/dist/bridge-workflow-smoke.js +431 -0
  55. package/dist/bridge-workflow-smoke.js.map +1 -0
  56. package/dist/codeconnect-suggestions.d.ts +74 -0
  57. package/dist/codeconnect-suggestions.js +398 -0
  58. package/dist/codeconnect-suggestions.js.map +1 -0
  59. package/dist/codeconnect-template.d.ts +98 -0
  60. package/dist/codeconnect-template.js +280 -0
  61. package/dist/codeconnect-template.js.map +1 -0
  62. package/dist/command-queue.d.ts +11 -1
  63. package/dist/command-queue.js +200 -1
  64. package/dist/command-queue.js.map +1 -1
  65. package/dist/command-safety.d.ts +13 -0
  66. package/dist/command-safety.js +59 -0
  67. package/dist/command-safety.js.map +1 -0
  68. package/dist/enabled-library-search.d.ts +49 -0
  69. package/dist/enabled-library-search.js +151 -0
  70. package/dist/enabled-library-search.js.map +1 -0
  71. package/dist/figma-mcp-parity.d.ts +49 -0
  72. package/dist/figma-mcp-parity.js +368 -0
  73. package/dist/figma-mcp-parity.js.map +1 -0
  74. package/dist/figma-mcp-skills-parity.d.ts +61 -0
  75. package/dist/figma-mcp-skills-parity.js +434 -0
  76. package/dist/figma-mcp-skills-parity.js.map +1 -0
  77. package/dist/figma-rest-diagnostics.d.ts +50 -0
  78. package/dist/figma-rest-diagnostics.js +314 -0
  79. package/dist/figma-rest-diagnostics.js.map +1 -0
  80. package/dist/figma-rest.d.ts +27 -0
  81. package/dist/figma-rest.js +116 -0
  82. package/dist/figma-rest.js.map +1 -0
  83. package/dist/http-api.d.ts +16 -2
  84. package/dist/http-api.js +329 -17
  85. package/dist/http-api.js.map +1 -1
  86. package/dist/index.js +25 -1
  87. package/dist/index.js.map +1 -1
  88. package/dist/mcp-factory.d.ts +6 -1
  89. package/dist/mcp-factory.js +23 -4
  90. package/dist/mcp-factory.js.map +1 -1
  91. package/dist/mcp-runtime-probe.d.ts +22 -0
  92. package/dist/mcp-runtime-probe.js +777 -0
  93. package/dist/mcp-runtime-probe.js.map +1 -0
  94. package/dist/mcp-server.d.ts +2 -1
  95. package/dist/mcp-server.js +2 -2
  96. package/dist/mcp-server.js.map +1 -1
  97. package/dist/sxl-mcp-instructions.js +99 -26
  98. package/dist/sxl-mcp-instructions.js.map +1 -1
  99. package/dist/tools/audit.d.ts +22 -6
  100. package/dist/tools/audit.js +49 -7
  101. package/dist/tools/audit.js.map +1 -1
  102. package/dist/tools/capability-matrix.d.ts +22 -0
  103. package/dist/tools/capability-matrix.js +38 -0
  104. package/dist/tools/capability-matrix.js.map +1 -0
  105. package/dist/tools/catalogue-bootstrap.d.ts +1 -0
  106. package/dist/tools/catalogue-bootstrap.js +665 -30
  107. package/dist/tools/catalogue-bootstrap.js.map +1 -1
  108. package/dist/tools/code-connect-context.d.ts +3 -0
  109. package/dist/tools/code-connect-context.js +319 -0
  110. package/dist/tools/code-connect-context.js.map +1 -0
  111. package/dist/tools/code-connect-template.d.ts +3 -0
  112. package/dist/tools/code-connect-template.js +111 -0
  113. package/dist/tools/code-connect-template.js.map +1 -0
  114. package/dist/tools/composition.js +15 -30
  115. package/dist/tools/composition.js.map +1 -1
  116. package/dist/tools/compositions-orchestration.d.ts +14 -14
  117. package/dist/tools/compositions-orchestration.js +2 -2
  118. package/dist/tools/compositions-orchestration.js.map +1 -1
  119. package/dist/tools/data.js +839 -27
  120. package/dist/tools/data.js.map +1 -1
  121. package/dist/tools/design-context.d.ts +3 -0
  122. package/dist/tools/design-context.js +197 -0
  123. package/dist/tools/design-context.js.map +1 -0
  124. package/dist/tools/destructive-confirmation.d.ts +10 -0
  125. package/dist/tools/destructive-confirmation.js +25 -0
  126. package/dist/tools/destructive-confirmation.js.map +1 -0
  127. package/dist/tools/diagnostics.js +76 -51
  128. package/dist/tools/diagnostics.js.map +1 -1
  129. package/dist/tools/figma-mcp-design.d.ts +3 -0
  130. package/dist/tools/figma-mcp-design.js +377 -0
  131. package/dist/tools/figma-mcp-design.js.map +1 -0
  132. package/dist/tools/figma-nodes.js +57 -43
  133. package/dist/tools/figma-nodes.js.map +1 -1
  134. package/dist/tools/figma-rc-extended.js +23 -6
  135. package/dist/tools/figma-rc-extended.js.map +1 -1
  136. package/dist/tools/figma-rest.d.ts +39 -0
  137. package/dist/tools/figma-rest.js +279 -0
  138. package/dist/tools/figma-rest.js.map +1 -0
  139. package/dist/tools/git.js +11 -7
  140. package/dist/tools/git.js.map +1 -1
  141. package/dist/tools/large-data.d.ts +14 -0
  142. package/dist/tools/large-data.js +189 -0
  143. package/dist/tools/large-data.js.map +1 -0
  144. package/dist/tools/meta.d.ts +6 -1
  145. package/dist/tools/meta.js +89 -11
  146. package/dist/tools/meta.js.map +1 -1
  147. package/dist/tools/metadata.d.ts +3 -0
  148. package/dist/tools/metadata.js +140 -0
  149. package/dist/tools/metadata.js.map +1 -0
  150. package/dist/tools/mockup.d.ts +15 -156
  151. package/dist/tools/mockup.js +54 -121
  152. package/dist/tools/mockup.js.map +1 -1
  153. package/dist/tools/orchestration.js +75 -47
  154. package/dist/tools/orchestration.js.map +1 -1
  155. package/dist/tools/prompts.d.ts +3 -0
  156. package/dist/tools/prompts.js +219 -0
  157. package/dist/tools/prompts.js.map +1 -0
  158. package/dist/tools/registry.d.ts +19 -1
  159. package/dist/tools/registry.js +4 -4
  160. package/dist/tools/registry.js.map +1 -1
  161. package/dist/tools/resources.d.ts +19 -2
  162. package/dist/tools/resources.js +149 -5
  163. package/dist/tools/resources.js.map +1 -1
  164. package/dist/tools/schema-contracts.d.ts +4763 -0
  165. package/dist/tools/schema-contracts.js +814 -0
  166. package/dist/tools/schema-contracts.js.map +1 -0
  167. package/dist/tools/screenshot.d.ts +3 -0
  168. package/dist/tools/screenshot.js +144 -0
  169. package/dist/tools/screenshot.js.map +1 -0
  170. package/dist/tools/shared.d.ts +11 -1
  171. package/dist/tools/shared.js +55 -2
  172. package/dist/tools/shared.js.map +1 -1
  173. package/dist/tools/styles-orchestration.d.ts +2 -2
  174. package/dist/tools/styles-orchestration.js +13 -5
  175. package/dist/tools/styles-orchestration.js.map +1 -1
  176. package/dist/tools/styles.js +22 -8
  177. package/dist/tools/styles.js.map +1 -1
  178. package/dist/tools/tokens.d.ts +31 -692
  179. package/dist/tools/tokens.js +175 -135
  180. package/dist/tools/tokens.js.map +1 -1
  181. package/dist/tools/variable-defs.d.ts +3 -0
  182. package/dist/tools/variable-defs.js +338 -0
  183. package/dist/tools/variable-defs.js.map +1 -0
  184. package/dist/tools/variables-orchestration.js +13 -5
  185. package/dist/tools/variables-orchestration.js.map +1 -1
  186. package/dist/tools/variables.js +18 -15
  187. package/dist/tools/variables.js.map +1 -1
  188. package/dist/types.d.ts +53 -0
  189. package/dist/ultimate-readiness-audit.d.ts +37 -0
  190. package/dist/ultimate-readiness-audit.js +431 -0
  191. package/dist/ultimate-readiness-audit.js.map +1 -0
  192. package/dist/workflow-planner.d.ts +57 -0
  193. package/dist/workflow-planner.js +464 -0
  194. package/dist/workflow-planner.js.map +1 -0
  195. package/dist/workspace-blob-store.d.ts +6 -0
  196. package/dist/workspace-blob-store.js +9 -0
  197. package/dist/workspace-blob-store.js.map +1 -1
  198. package/dist/workspace-path-http.d.ts +24 -0
  199. package/dist/workspace-path-http.js +146 -0
  200. package/dist/workspace-path-http.js.map +1 -0
  201. package/dist/ws-server.js +16 -3
  202. package/dist/ws-server.js.map +1 -1
  203. package/package.json +21 -2
@@ -0,0 +1,37 @@
1
+ export type UltimateReadinessStatus = "pass" | "warn" | "fail";
2
+ export type UltimateReadinessRequirement = {
3
+ id: string;
4
+ title: string;
5
+ status: UltimateReadinessStatus;
6
+ summary: string;
7
+ evidence: string[];
8
+ missing: string[];
9
+ };
10
+ export type UltimateReadinessAudit = {
11
+ ok: boolean;
12
+ status: UltimateReadinessStatus;
13
+ version: 1;
14
+ generatedAt: string;
15
+ scope: {
16
+ primary: string;
17
+ companion: string[];
18
+ future: string[];
19
+ };
20
+ summary: {
21
+ requirementCount: number;
22
+ pass: number;
23
+ warn: number;
24
+ fail: number;
25
+ toolCount: number;
26
+ recipeCount: number;
27
+ schemaCount: number;
28
+ promptCount: number;
29
+ officialFigmaMcpTools: number;
30
+ officialFigmaMcpSkills: number;
31
+ companionFigmaMcpTools: number;
32
+ companionFigmaMcpSkills: number;
33
+ futureOrUnsupportedTools: number;
34
+ };
35
+ requirements: UltimateReadinessRequirement[];
36
+ };
37
+ export declare function buildUltimateReadinessAudit(): UltimateReadinessAudit;
@@ -0,0 +1,431 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { ALL_AGENT_RECIPES } from "./agent-recipes.js";
5
+ import { buildBridgeContractAudit } from "./bridge-contract-audit.js";
6
+ import { buildBridgePerformanceProfile } from "./bridge-performance-profile.js";
7
+ import { buildFigmaMcpParityMatrix } from "./figma-mcp-parity.js";
8
+ import { buildFigmaMcpSkillsParityMatrix } from "./figma-mcp-skills-parity.js";
9
+ import { buildCapabilityMatrix } from "./tools/capability-matrix.js";
10
+ import { SXL_PROMPT_NAMES } from "./tools/prompts.js";
11
+ import { BRIDGE_SCHEMA_INDEX } from "./tools/schema-contracts.js";
12
+ function makeLookup() {
13
+ const matrix = buildCapabilityMatrix();
14
+ return {
15
+ tools: matrix.tools,
16
+ names: new Set(matrix.tools.map((tool) => tool.name)),
17
+ byName: new Map(matrix.tools.map((tool) => [tool.name, tool])),
18
+ };
19
+ }
20
+ function missingTools(lookup, names) {
21
+ return names.filter((name) => !lookup.names.has(name));
22
+ }
23
+ function missingRecipes(ids) {
24
+ const recipeIds = new Set(ALL_AGENT_RECIPES.map((recipe) => recipe.id));
25
+ return ids.filter((id) => !recipeIds.has(id));
26
+ }
27
+ function missingSchemas(ids) {
28
+ const schemaIds = new Set(BRIDGE_SCHEMA_INDEX.schemas.map((schema) => schema.id));
29
+ return ids.filter((id) => !schemaIds.has(id));
30
+ }
31
+ function requirement(args) {
32
+ const missing = args.missing ?? [];
33
+ return {
34
+ id: args.id,
35
+ title: args.title,
36
+ status: missing.length > 0 ? "fail" : args.warnWhen ? "warn" : "pass",
37
+ summary: args.summary,
38
+ evidence: args.evidence,
39
+ missing,
40
+ };
41
+ }
42
+ function countByStatus(requirements, status) {
43
+ return requirements.filter((item) => item.status === status).length;
44
+ }
45
+ function readFirstExistingSource(candidates) {
46
+ for (const candidate of Array.from(new Set(candidates))) {
47
+ if (!existsSync(candidate))
48
+ continue;
49
+ return readFileSync(candidate, "utf8");
50
+ }
51
+ return null;
52
+ }
53
+ function bridgeSource(fileName) {
54
+ const here = path.dirname(fileURLToPath(import.meta.url));
55
+ const jsName = fileName.replace(/\.ts$/, ".js");
56
+ return readFirstExistingSource([
57
+ path.resolve(here, fileName),
58
+ path.resolve(here, jsName),
59
+ path.resolve(process.cwd(), "src", fileName),
60
+ path.resolve(process.cwd(), "src", jsName),
61
+ path.resolve(process.cwd(), "Utils/bridge/src", fileName),
62
+ ]);
63
+ }
64
+ function pluginSource(relativePath) {
65
+ const here = path.dirname(fileURLToPath(import.meta.url));
66
+ return readFirstExistingSource([
67
+ path.resolve(here, "../../../Plugin/src", relativePath),
68
+ path.resolve(process.cwd(), "Plugin/src", relativePath),
69
+ path.resolve(process.cwd(), "../../Plugin/src", relativePath),
70
+ ]);
71
+ }
72
+ function sourceHas(source, patterns) {
73
+ return source !== null && patterns.every((pattern) => source.includes(pattern));
74
+ }
75
+ function websocketAuthEvidence() {
76
+ const authSource = bridgeSource("auth.ts");
77
+ const wsSource = bridgeSource("ws-server.ts");
78
+ const remoteBridgeSource = pluginSource("ui/services/remoteBridge.ts");
79
+ const overlaySource = pluginSource("ui/components/RemoteOverlay.tsx");
80
+ const checks = [
81
+ {
82
+ label: "bridge.checkWebSocketAuth",
83
+ ok: sourceHas(authSource, ["checkWebSocketAuth", "bridgeAuthToken"]),
84
+ },
85
+ {
86
+ label: "bridge.ws.verifyClient",
87
+ ok: sourceHas(wsSource, ["verifyClient", "checkWebSocketAuth"]),
88
+ },
89
+ {
90
+ label: "bridge.ws.authLogRedaction",
91
+ ok: sourceHas(authSource, ["sanitizeWebSocketAuthLogPath", "REDACTED"]) &&
92
+ sourceHas(wsSource, ["sanitizeWebSocketAuthLogPath"]),
93
+ },
94
+ {
95
+ label: "plugin.remoteBridge.authToken",
96
+ ok: sourceHas(remoteBridgeSource, [
97
+ "REMOTE_BRIDGE_AUTH_TOKEN_STORAGE_KEY",
98
+ "bridgeAuthToken",
99
+ "normalizeRemoteBridgeAuthToken",
100
+ ]),
101
+ },
102
+ {
103
+ label: "plugin.remoteOverlay.authToken",
104
+ ok: sourceHas(overlaySource, ["remoteBridgeAuthToken", "Token"]),
105
+ },
106
+ ];
107
+ return {
108
+ evidence: checks.filter((check) => check.ok).map((check) => check.label),
109
+ missing: checks.filter((check) => !check.ok).map((check) => check.label),
110
+ };
111
+ }
112
+ function operatorRunbookEvidence() {
113
+ const runbookSource = bridgeSource("agent-runbook.ts");
114
+ const resourcesSource = bridgeSource("tools/resources.ts");
115
+ const promptsSource = bridgeSource("tools/prompts.ts");
116
+ const checks = [
117
+ {
118
+ label: "agent.operatorRunbook",
119
+ ok: sourceHas(runbookSource, ["SXL_OPERATOR_RUNBOOK", "draw-or-update-screen", "export-variables-styles"]),
120
+ },
121
+ {
122
+ label: "agent.operatorRunbookResource",
123
+ ok: sourceHas(resourcesSource, ["sxl://agent/operator-runbook", "SXL_OPERATOR_RUNBOOK"]),
124
+ },
125
+ {
126
+ label: "agent.operatorRunbookPrompt",
127
+ ok: sourceHas(promptsSource, ["sxl-operator", "SXL_OPERATOR_RUNBOOK"]),
128
+ },
129
+ ];
130
+ return {
131
+ evidence: checks.filter((check) => check.ok).map((check) => check.label),
132
+ missing: checks.filter((check) => !check.ok).map((check) => check.label),
133
+ };
134
+ }
135
+ export function buildUltimateReadinessAudit() {
136
+ const lookup = makeLookup();
137
+ const contract = buildBridgeContractAudit();
138
+ const parity = buildFigmaMcpParityMatrix();
139
+ const skillsParity = buildFigmaMcpSkillsParityMatrix();
140
+ const performance = buildBridgePerformanceProfile({ auditLimit: 20 });
141
+ const wsAuth = websocketAuthEvidence();
142
+ const operatorRunbook = operatorRunbookEvidence();
143
+ const requiredSkills = [
144
+ "sxl-use",
145
+ "sxl-generate-design",
146
+ "sxl-generate-library",
147
+ "sxl-code-connect",
148
+ "sxl-audit",
149
+ "sxl-doc-builder",
150
+ ];
151
+ const requirements = [
152
+ requirement({
153
+ id: "phase1.contract-surface",
154
+ title: "Phase 1 contract stabilization",
155
+ summary: "Catalogue, MCP tools, schema entrypoints, workflow gates, command mapping, Remote Connect whitelist/handler coverage, and timeout metadata are release-audited.",
156
+ evidence: [
157
+ "get_contract_audit",
158
+ "get_capability_matrix",
159
+ "list_tools",
160
+ `contract.status=${contract.status}`,
161
+ `pluginCommandTypes=${contract.requiredSurface.remoteConnect.pluginCommandTypeCount}`,
162
+ `remoteWhitelist=${contract.requiredSurface.remoteConnect.pluginCommandTypesWhitelisted}`,
163
+ `remoteHandlers=${contract.requiredSurface.remoteConnect.pluginCommandTypesHandled}`,
164
+ ],
165
+ missing: contract.ok ? [] : contract.findings.map((finding) => `${finding.code}:${finding.subject ?? "global"}`),
166
+ }),
167
+ requirement({
168
+ id: "phase1.meta-tooling",
169
+ title: "Authoritative meta tools",
170
+ summary: "Agents can discover capabilities, route natural language, plan workflows, preview tool sequences, inspect performance, and read audit logs.",
171
+ evidence: ["catalogue", "tools/meta.ts"],
172
+ missing: missingTools(lookup, [
173
+ "route_intent",
174
+ "plan_workflow",
175
+ "preview_workflow",
176
+ "list_tools",
177
+ "get_capability_matrix",
178
+ "get_contract_audit",
179
+ "get_figma_mcp_parity",
180
+ "get_performance_profile",
181
+ "get_bridge_audit_log",
182
+ "get_bridge_runtime_summary",
183
+ "get_operator_runbook",
184
+ ]),
185
+ }),
186
+ requirement({
187
+ id: "phase2.sxl-skills",
188
+ title: "SXL agent skills and recipes",
189
+ summary: "Bridge exposes SXL skills for canvas use, design generation, library generation, Code Connect, audit, and documentation.",
190
+ evidence: [
191
+ "sxl://agent/recipes/sxl-use",
192
+ "sxl://agent/operator-runbook",
193
+ "prompts/get sxl-operator",
194
+ "sxl://agent/recipes/sxl-generate-design",
195
+ "sxl://agent/recipes/sxl-generate-library",
196
+ "sxl://agent/recipes/sxl-code-connect",
197
+ "sxl://agent/recipes/sxl-audit",
198
+ "sxl://agent/recipes/sxl-doc-builder",
199
+ "prompts/list",
200
+ "prompts/get sxl-generate-design",
201
+ ...operatorRunbook.evidence,
202
+ ],
203
+ missing: [
204
+ ...missingRecipes(requiredSkills),
205
+ ...operatorRunbook.missing,
206
+ ],
207
+ }),
208
+ requirement({
209
+ id: "phase3.design-dsl",
210
+ title: "Thick screen-building commands",
211
+ summary: "Design DSL v1 supports design-system inspection, preflight validation, screen creation, and screen update.",
212
+ evidence: ["sxl://agent/schemas/design-dsl-v1", "mockup-builder recipe"],
213
+ missing: [
214
+ ...missingTools(lookup, ["inspect_design_system", "validate_screen_spec", "build_screen", "update_screen"]),
215
+ ...missingSchemas(["design-dsl-v1"]),
216
+ ],
217
+ }),
218
+ requirement({
219
+ id: "phase3.component-analytics",
220
+ title: "Component usage and prop analytics",
221
+ summary: "Agents can summarize and page through component instance usage and component prop values.",
222
+ evidence: ["analyze_component_usage", "find_component_usages", "analyze_component_prop_usage", "find_component_prop_usages"],
223
+ missing: missingTools(lookup, [
224
+ "analyze_component_usage",
225
+ "find_component_usages",
226
+ "analyze_component_prop_usage",
227
+ "find_component_prop_usages",
228
+ ]),
229
+ }),
230
+ requirement({
231
+ id: "phase3.database-tools",
232
+ title: "Database datasets, assets, and mappings",
233
+ summary: "Bridge exposes dataset/asset/mapping list/get/save/delete, portable payload export/import, plus apply/generate workflows with dry-run where destructive.",
234
+ evidence: ["data tools", "export_database_payload", "import_database_payload", "dryRunSupported catalogue flags"],
235
+ missing: missingTools(lookup, [
236
+ "list_datasets",
237
+ "get_dataset",
238
+ "save_dataset",
239
+ "delete_dataset",
240
+ "list_assets",
241
+ "get_asset",
242
+ "save_asset",
243
+ "delete_asset",
244
+ "list_mappings",
245
+ "get_mapping",
246
+ "save_mapping",
247
+ "delete_mapping",
248
+ "export_database_payload",
249
+ "import_database_payload",
250
+ "apply_mapping",
251
+ "apply_all_mappings",
252
+ "generate_instances",
253
+ ]),
254
+ }),
255
+ requirement({
256
+ id: "phase4.variables-styles",
257
+ title: "Variables/styles export and refactor workflows",
258
+ summary: "Bridge exposes safe export_variables defaults and preflight, variable/style CRUD, enabled-library search/reads, bulk specs, coverage, dedupe, rebind, drift, and apply-suggestions flows.",
259
+ evidence: ["preview_export_variables", "export_variables", "get_variable_defs", "search_enabled_library_assets", "inspect_enabled_libraries", "list_enabled_library_variables", "bulk variables/styles recipes", "sxl-export docs"],
260
+ missing: missingTools(lookup, [
261
+ "preview_export_variables",
262
+ "export_variables",
263
+ "get_variable_defs",
264
+ "get_variables",
265
+ "get_local_styles",
266
+ "search_enabled_library_assets",
267
+ "inspect_enabled_libraries",
268
+ "list_enabled_library_variables",
269
+ "import_variable_spec",
270
+ "import_style_spec",
271
+ "audit_variable_coverage",
272
+ "find_variable_coverage_misses",
273
+ "audit_style_coverage",
274
+ "find_style_coverage_misses",
275
+ "apply_coverage_suggestions",
276
+ "apply_style_coverage_suggestions",
277
+ "dedupe_variables",
278
+ "dedupe_styles",
279
+ "rebind_variable_aliases",
280
+ "rebind_style_consumers",
281
+ "audit_style_drift",
282
+ ]),
283
+ }),
284
+ requirement({
285
+ id: "phase4.compositions",
286
+ title: "Composition workflow coverage",
287
+ summary: "Bridge can list/export/codegen/save/generate/apply/preview composition data and audit/bulk-regenerate drift.",
288
+ evidence: ["compose_from_url", "bulk_generate_compositions", "audit_composition_drift"],
289
+ missing: missingTools(lookup, [
290
+ "compose_from_url",
291
+ "generate_code_from_url",
292
+ "list_compositions",
293
+ "export_composition_json",
294
+ "get_codegen",
295
+ "generate_composition",
296
+ "apply_composition",
297
+ "preview_composition",
298
+ "check_composition_linked",
299
+ "bulk_generate_compositions",
300
+ "audit_composition_drift",
301
+ ]),
302
+ }),
303
+ requirement({
304
+ id: "phase4.documentation",
305
+ title: "Figma documentation builder workflows",
306
+ summary: "Bridge covers token docs, doc spec sections, component docs, doc flows, variable palettes, and markdown scenarios.",
307
+ evidence: ["doc-spec-v2 schema", "sxl-doc-builder recipe"],
308
+ missing: [
309
+ ...missingTools(lookup, [
310
+ "apply_doc_spec",
311
+ "build_component_doc",
312
+ "build_doc_flow",
313
+ "bind_variable_palette",
314
+ "build_scenario_from_md",
315
+ "apply_token_doc_spec",
316
+ "build_token_documentation",
317
+ ]),
318
+ ...missingSchemas(["doc-spec-v2", "token-doc-v1"]),
319
+ ...missingRecipes(["sxl-doc-builder", "doc-tokens", "doc-component", "doc-flow", "scenario-from-markdown"]),
320
+ ],
321
+ }),
322
+ requirement({
323
+ id: "phase4.code-connect",
324
+ title: "Code Connect registry and full binding metadata",
325
+ summary: "Bridge exposes active-file/local-codebase Code Connect context, dry-run-first .figma.ts template generation, local binding suggestions, binding read/write, selection/node UI status, registry snapshot, and global settings for SXL Code Connect.",
326
+ evidence: ["sxl-code-connect recipe", "get_context_for_code_connect", "generate_code_connect_template", "get_code_connect_suggestions", "codeconnect_* tools"],
327
+ missing: missingTools(lookup, [
328
+ "get_context_for_code_connect",
329
+ "generate_code_connect_template",
330
+ "get_code_connect_suggestions",
331
+ "codeconnect_get_binding",
332
+ "codeconnect_save_binding",
333
+ "codeconnect_get_selection_status",
334
+ "codeconnect_get_registry",
335
+ "codeconnect_get_global_settings",
336
+ "codeconnect_save_global_settings",
337
+ "codeconnect_get_node_ui_status",
338
+ ]).concat(missingSchemas(["code-connect-context-v1", "code-connect-template-v1"])),
339
+ }),
340
+ requirement({
341
+ id: "production.safety",
342
+ title: "Production safety gates",
343
+ summary: "Bridge has dry-run metadata, destructive confirmation, large-data response control, performance profile, persisted audit, runtime queue/events, and health gates.",
344
+ evidence: [
345
+ "get_performance_profile",
346
+ "get_bridge_audit_log",
347
+ "get_bridge_runtime_summary",
348
+ "/api/queue",
349
+ "/api/events",
350
+ "/api/log?source=disk",
351
+ "runtime.mcpStreamableHttp health probe",
352
+ `dryRunTools=${contract.summary.dryRunTools}`,
353
+ `largeDataTools=${performance.summary.largeDataTools}`,
354
+ ...wsAuth.evidence,
355
+ ],
356
+ missing: [
357
+ ...missingTools(lookup, ["get_performance_profile", "get_bridge_audit_log"]),
358
+ ...wsAuth.missing,
359
+ ],
360
+ warnWhen: performance.status === "warn",
361
+ }),
362
+ requirement({
363
+ id: "figma-mcp.design-parity",
364
+ title: "Figma MCP Design parity operating model",
365
+ summary: "Official Figma MCP Design tools are either covered by Bridge/SXL or explicitly routed to official Figma MCP as companion when plugin API cannot honestly cover them.",
366
+ evidence: [
367
+ "get_figma_mcp_parity",
368
+ "sxl://agent/recipes/figma-mcp-companion",
369
+ `officialToolCount=${parity.summary.officialToolCount}`,
370
+ `companionRequired=${parity.summary.companionRequired}`,
371
+ `futureScope=${parity.summary.futureScope}`,
372
+ `notSupportedByPluginApi=${parity.summary.notSupportedByPluginApi}`,
373
+ ],
374
+ missing: parity.summary.staleBridgeToolReferences.concat(missingRecipes(["figma-mcp-companion"])),
375
+ warnWhen: false,
376
+ }),
377
+ requirement({
378
+ id: "figma-mcp.skills-parity",
379
+ title: "Figma MCP skills parity operating model",
380
+ summary: "Official Figma MCP skills are mapped to SXL Bridge recipes/resources, explicit companion scope, or agent-side codebase work.",
381
+ evidence: [
382
+ "get_figma_mcp_skills_parity",
383
+ "sxl://agent/figma-mcp-skills-parity",
384
+ `officialSkillCount=${skillsParity.summary.officialSkillCount}`,
385
+ `officialSkills=${skillsParity.summary.officialSkills}`,
386
+ `exampleSkills=${skillsParity.summary.exampleSkills}`,
387
+ `companionRequired=${skillsParity.summary.companionRequired}`,
388
+ `agentImplementationRequired=${skillsParity.summary.bridgePrimaryWithAgentWork}`,
389
+ `compatibilityAliases=${skillsParity.summary.compatibilityAliases}`,
390
+ ],
391
+ missing: [
392
+ ...skillsParity.summary.staleBridgeToolReferences,
393
+ ...skillsParity.summary.staleBridgeResourceReferences,
394
+ ...skillsParity.summary.staleRecipeReferences,
395
+ ...missingTools(lookup, ["get_figma_mcp_skills_parity"]),
396
+ ],
397
+ warnWhen: false,
398
+ }),
399
+ ];
400
+ const fails = countByStatus(requirements, "fail");
401
+ const warns = countByStatus(requirements, "warn");
402
+ const status = fails > 0 ? "fail" : warns > 0 ? "warn" : "pass";
403
+ return {
404
+ ok: fails === 0,
405
+ status,
406
+ version: 1,
407
+ generatedAt: new Date().toISOString(),
408
+ scope: {
409
+ primary: "Figma Design + SXL Studio Bridge workflows, including REST whoami and known file/team reads",
410
+ companion: parity.operatingModel.companionFigmaMcp,
411
+ future: parity.operatingModel.futureOrUnsupported,
412
+ },
413
+ summary: {
414
+ requirementCount: requirements.length,
415
+ pass: countByStatus(requirements, "pass"),
416
+ warn: warns,
417
+ fail: fails,
418
+ toolCount: lookup.tools.length,
419
+ recipeCount: ALL_AGENT_RECIPES.length,
420
+ schemaCount: BRIDGE_SCHEMA_INDEX.schemas.length,
421
+ promptCount: SXL_PROMPT_NAMES.length,
422
+ officialFigmaMcpTools: parity.summary.officialToolCount,
423
+ officialFigmaMcpSkills: skillsParity.summary.officialSkillCount,
424
+ companionFigmaMcpTools: parity.summary.companionRequired,
425
+ companionFigmaMcpSkills: skillsParity.summary.companionRequired,
426
+ futureOrUnsupportedTools: parity.summary.futureScope + parity.summary.notSupportedByPluginApi,
427
+ },
428
+ requirements,
429
+ };
430
+ }
431
+ //# sourceMappingURL=ultimate-readiness-audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ultimate-readiness-audit.js","sourceRoot":"","sources":["../src/ultimate-readiness-audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAA6B,MAAM,8BAA8B,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA+ClE,SAAS,UAAU;IACjB,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;IACvC,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,MAAM,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,C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Kind = "resource" | "tool" | "gate";
3
+ export type WorkflowStepPhase = "route" | "context" | "discover" | "preview" | "approval" | "commit" | "verify";
4
+ export type WorkflowFindingSeverity = "error" | "warning" | "info";
5
+ export type WorkflowPlanStep = {
6
+ id: string;
7
+ kind: WorkflowStepKind;
8
+ phase: WorkflowStepPhase;
9
+ title: string;
10
+ toolName?: string;
11
+ resourceUri?: string;
12
+ dryRun?: boolean;
13
+ required: boolean;
14
+ requiresApproval?: boolean;
15
+ requiresDesignMode?: boolean;
16
+ execution?: string;
17
+ pluginCommandTypes?: string[];
18
+ schemaResources?: readonly string[];
19
+ reason: string;
20
+ };
21
+ export type WorkflowFinding = {
22
+ severity: WorkflowFindingSeverity;
23
+ code: string;
24
+ message: string;
25
+ toolName?: string;
26
+ };
27
+ export type WorkflowPlan = {
28
+ ok: true;
29
+ request: string;
30
+ route: AgentIntentRoute;
31
+ recipeUri: string;
32
+ schemaResources: readonly string[];
33
+ dryRunFirst: boolean;
34
+ steps: WorkflowPlanStep[];
35
+ findings: WorkflowFinding[];
36
+ doneCriteria: string;
37
+ };
38
+ export type WorkflowPreview = {
39
+ ok: true;
40
+ plan: WorkflowPlan;
41
+ proposedTools: string[];
42
+ acceptable: boolean;
43
+ findings: WorkflowFinding[];
44
+ };
45
+ export declare function planWorkflow(args: {
46
+ request: string;
47
+ recipeId?: string;
48
+ }): WorkflowPlan;
49
+ export declare function previewWorkflow(args: {
50
+ request: string;
51
+ recipeId?: string;
52
+ proposedTools?: string[];
53
+ proposedSteps?: Array<{
54
+ toolName: string;
55
+ dryRun?: boolean;
56
+ }>;
57
+ }): WorkflowPreview;