@muloka/figma-console-mcp 0.1.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 (443) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +898 -0
  3. package/dist/apps/design-system-dashboard/scoring/accessibility.d.ts +14 -0
  4. package/dist/apps/design-system-dashboard/scoring/accessibility.d.ts.map +1 -0
  5. package/dist/apps/design-system-dashboard/scoring/accessibility.js +278 -0
  6. package/dist/apps/design-system-dashboard/scoring/accessibility.js.map +1 -0
  7. package/dist/apps/design-system-dashboard/scoring/component-metadata.d.ts +29 -0
  8. package/dist/apps/design-system-dashboard/scoring/component-metadata.d.ts.map +1 -0
  9. package/dist/apps/design-system-dashboard/scoring/component-metadata.js +358 -0
  10. package/dist/apps/design-system-dashboard/scoring/component-metadata.js.map +1 -0
  11. package/dist/apps/design-system-dashboard/scoring/consistency.d.ts +14 -0
  12. package/dist/apps/design-system-dashboard/scoring/consistency.d.ts.map +1 -0
  13. package/dist/apps/design-system-dashboard/scoring/consistency.js +342 -0
  14. package/dist/apps/design-system-dashboard/scoring/consistency.js.map +1 -0
  15. package/dist/apps/design-system-dashboard/scoring/coverage.d.ts +14 -0
  16. package/dist/apps/design-system-dashboard/scoring/coverage.d.ts.map +1 -0
  17. package/dist/apps/design-system-dashboard/scoring/coverage.js +231 -0
  18. package/dist/apps/design-system-dashboard/scoring/coverage.js.map +1 -0
  19. package/dist/apps/design-system-dashboard/scoring/engine.d.ts +27 -0
  20. package/dist/apps/design-system-dashboard/scoring/engine.d.ts.map +1 -0
  21. package/dist/apps/design-system-dashboard/scoring/engine.js +93 -0
  22. package/dist/apps/design-system-dashboard/scoring/engine.js.map +1 -0
  23. package/dist/apps/design-system-dashboard/scoring/naming-semantics.d.ts +14 -0
  24. package/dist/apps/design-system-dashboard/scoring/naming-semantics.d.ts.map +1 -0
  25. package/dist/apps/design-system-dashboard/scoring/naming-semantics.js +309 -0
  26. package/dist/apps/design-system-dashboard/scoring/naming-semantics.js.map +1 -0
  27. package/dist/apps/design-system-dashboard/scoring/token-architecture.d.ts +14 -0
  28. package/dist/apps/design-system-dashboard/scoring/token-architecture.d.ts.map +1 -0
  29. package/dist/apps/design-system-dashboard/scoring/token-architecture.js +350 -0
  30. package/dist/apps/design-system-dashboard/scoring/token-architecture.js.map +1 -0
  31. package/dist/apps/design-system-dashboard/scoring/types.d.ts +89 -0
  32. package/dist/apps/design-system-dashboard/scoring/types.d.ts.map +1 -0
  33. package/dist/apps/design-system-dashboard/scoring/types.js +41 -0
  34. package/dist/apps/design-system-dashboard/scoring/types.js.map +1 -0
  35. package/dist/apps/design-system-dashboard/server.d.ts +24 -0
  36. package/dist/apps/design-system-dashboard/server.d.ts.map +1 -0
  37. package/dist/apps/design-system-dashboard/server.js +160 -0
  38. package/dist/apps/design-system-dashboard/server.js.map +1 -0
  39. package/dist/apps/token-browser/server.d.ts +26 -0
  40. package/dist/apps/token-browser/server.d.ts.map +1 -0
  41. package/dist/apps/token-browser/server.js +137 -0
  42. package/dist/apps/token-browser/server.js.map +1 -0
  43. package/dist/browser/base.d.ts +58 -0
  44. package/dist/browser/base.d.ts.map +1 -0
  45. package/dist/browser/base.js +6 -0
  46. package/dist/browser/base.js.map +1 -0
  47. package/dist/browser/local.d.ts +87 -0
  48. package/dist/browser/local.d.ts.map +1 -0
  49. package/dist/browser/local.js +318 -0
  50. package/dist/browser/local.js.map +1 -0
  51. package/dist/cloudflare/apps/design-system-dashboard/scoring/accessibility.js +277 -0
  52. package/dist/cloudflare/apps/design-system-dashboard/scoring/component-metadata.js +357 -0
  53. package/dist/cloudflare/apps/design-system-dashboard/scoring/consistency.js +341 -0
  54. package/dist/cloudflare/apps/design-system-dashboard/scoring/coverage.js +230 -0
  55. package/dist/cloudflare/apps/design-system-dashboard/scoring/engine.js +92 -0
  56. package/dist/cloudflare/apps/design-system-dashboard/scoring/naming-semantics.js +308 -0
  57. package/dist/cloudflare/apps/design-system-dashboard/scoring/token-architecture.js +349 -0
  58. package/dist/cloudflare/apps/design-system-dashboard/scoring/types.js +40 -0
  59. package/dist/cloudflare/apps/design-system-dashboard/server.js +159 -0
  60. package/dist/cloudflare/apps/token-browser/server.js +136 -0
  61. package/dist/cloudflare/browser-manager.js +157 -0
  62. package/dist/cloudflare/core/accessibility-tools.js +361 -0
  63. package/dist/cloudflare/core/annotation-tools.js +230 -0
  64. package/dist/cloudflare/core/cloud-websocket-connector.js +419 -0
  65. package/dist/cloudflare/core/cloud-websocket-relay.js +198 -0
  66. package/dist/cloudflare/core/comment-tools.js +292 -0
  67. package/dist/cloudflare/core/config.js +153 -0
  68. package/dist/cloudflare/core/console-monitor.js +427 -0
  69. package/dist/cloudflare/core/deep-component-tools.js +128 -0
  70. package/dist/cloudflare/core/design-code-tools.js +2793 -0
  71. package/dist/cloudflare/core/design-system-manifest.js +265 -0
  72. package/dist/cloudflare/core/design-system-tools.js +882 -0
  73. package/dist/cloudflare/core/diagnose-tool.js +100 -0
  74. package/dist/cloudflare/core/diff/changelog-formatter.js +275 -0
  75. package/dist/cloudflare/core/diff/diff-engine.js +334 -0
  76. package/dist/cloudflare/core/diff/property-compare.js +36 -0
  77. package/dist/cloudflare/core/diff/version-cache.js +74 -0
  78. package/dist/cloudflare/core/enrichment/enrichment-service.js +374 -0
  79. package/dist/cloudflare/core/enrichment/index.js +7 -0
  80. package/dist/cloudflare/core/enrichment/relationship-mapper.js +351 -0
  81. package/dist/cloudflare/core/enrichment/style-resolver.js +346 -0
  82. package/dist/cloudflare/core/figjam-tools.js +547 -0
  83. package/dist/cloudflare/core/figma-api.js +509 -0
  84. package/dist/cloudflare/core/figma-connector.js +7 -0
  85. package/dist/cloudflare/core/figma-reconstruction-spec.js +402 -0
  86. package/dist/cloudflare/core/figma-style-extractor.js +311 -0
  87. package/dist/cloudflare/core/figma-tools.js +3302 -0
  88. package/dist/cloudflare/core/identity.js +96 -0
  89. package/dist/cloudflare/core/library-tools.js +580 -0
  90. package/dist/cloudflare/core/logger.js +53 -0
  91. package/dist/cloudflare/core/port-discovery.js +935 -0
  92. package/dist/cloudflare/core/resolve-package-root.js +11 -0
  93. package/dist/cloudflare/core/slides-tools.js +714 -0
  94. package/dist/cloudflare/core/slot-tools.js +334 -0
  95. package/dist/cloudflare/core/snippet-injector.js +96 -0
  96. package/dist/cloudflare/core/tokens/alias-resolver.js +205 -0
  97. package/dist/cloudflare/core/tokens/config.js +294 -0
  98. package/dist/cloudflare/core/tokens/dialect.js +232 -0
  99. package/dist/cloudflare/core/tokens/figma-converter.js +323 -0
  100. package/dist/cloudflare/core/tokens/formatters/css-vars.js +338 -0
  101. package/dist/cloudflare/core/tokens/formatters/dtcg.js +376 -0
  102. package/dist/cloudflare/core/tokens/formatters/index.js +45 -0
  103. package/dist/cloudflare/core/tokens/formatters/json.js +205 -0
  104. package/dist/cloudflare/core/tokens/formatters/less.js +4 -0
  105. package/dist/cloudflare/core/tokens/formatters/scss.js +258 -0
  106. package/dist/cloudflare/core/tokens/formatters/stubs.js +13 -0
  107. package/dist/cloudflare/core/tokens/formatters/style-dictionary-v3.js +213 -0
  108. package/dist/cloudflare/core/tokens/formatters/tailwind-v3.js +237 -0
  109. package/dist/cloudflare/core/tokens/formatters/tailwind-v4.js +335 -0
  110. package/dist/cloudflare/core/tokens/formatters/tokens-studio.js +256 -0
  111. package/dist/cloudflare/core/tokens/formatters/ts-module.js +198 -0
  112. package/dist/cloudflare/core/tokens/index.js +16 -0
  113. package/dist/cloudflare/core/tokens/parsers/css-vars.js +4 -0
  114. package/dist/cloudflare/core/tokens/parsers/dtcg.js +280 -0
  115. package/dist/cloudflare/core/tokens/parsers/index.js +138 -0
  116. package/dist/cloudflare/core/tokens/parsers/json.js +7 -0
  117. package/dist/cloudflare/core/tokens/parsers/scss.js +4 -0
  118. package/dist/cloudflare/core/tokens/parsers/stubs.js +20 -0
  119. package/dist/cloudflare/core/tokens/parsers/style-dictionary-v3.js +4 -0
  120. package/dist/cloudflare/core/tokens/parsers/tailwind-v3.js +4 -0
  121. package/dist/cloudflare/core/tokens/parsers/tailwind-v4.js +4 -0
  122. package/dist/cloudflare/core/tokens/parsers/tokens-studio.js +4 -0
  123. package/dist/cloudflare/core/tokens/schemas.js +152 -0
  124. package/dist/cloudflare/core/tokens/transforms/color.js +12 -0
  125. package/dist/cloudflare/core/tokens/transforms/index.js +29 -0
  126. package/dist/cloudflare/core/tokens/transforms/size.js +7 -0
  127. package/dist/cloudflare/core/tokens/types.js +18 -0
  128. package/dist/cloudflare/core/tokens-tools.js +1788 -0
  129. package/dist/cloudflare/core/types/design-code.js +4 -0
  130. package/dist/cloudflare/core/types/enriched.js +5 -0
  131. package/dist/cloudflare/core/types/index.js +4 -0
  132. package/dist/cloudflare/core/variable-resolver.js +85 -0
  133. package/dist/cloudflare/core/version-tools.js +1199 -0
  134. package/dist/cloudflare/core/websocket-connector.js +436 -0
  135. package/dist/cloudflare/core/websocket-server.js +956 -0
  136. package/dist/cloudflare/core/write-tools.js +2506 -0
  137. package/dist/cloudflare/index.js +3010 -0
  138. package/dist/core/accessibility-tools.d.ts +21 -0
  139. package/dist/core/accessibility-tools.d.ts.map +1 -0
  140. package/dist/core/accessibility-tools.js +362 -0
  141. package/dist/core/accessibility-tools.js.map +1 -0
  142. package/dist/core/annotation-tools.d.ts +14 -0
  143. package/dist/core/annotation-tools.d.ts.map +1 -0
  144. package/dist/core/annotation-tools.js +231 -0
  145. package/dist/core/annotation-tools.js.map +1 -0
  146. package/dist/core/comment-tools.d.ts +11 -0
  147. package/dist/core/comment-tools.d.ts.map +1 -0
  148. package/dist/core/comment-tools.js +293 -0
  149. package/dist/core/comment-tools.js.map +1 -0
  150. package/dist/core/config.d.ts +17 -0
  151. package/dist/core/config.d.ts.map +1 -0
  152. package/dist/core/config.js +154 -0
  153. package/dist/core/config.js.map +1 -0
  154. package/dist/core/console-monitor.d.ts +82 -0
  155. package/dist/core/console-monitor.d.ts.map +1 -0
  156. package/dist/core/console-monitor.js +428 -0
  157. package/dist/core/console-monitor.js.map +1 -0
  158. package/dist/core/deep-component-tools.d.ts +14 -0
  159. package/dist/core/deep-component-tools.d.ts.map +1 -0
  160. package/dist/core/deep-component-tools.js +129 -0
  161. package/dist/core/deep-component-tools.js.map +1 -0
  162. package/dist/core/design-code-tools.d.ts +116 -0
  163. package/dist/core/design-code-tools.d.ts.map +1 -0
  164. package/dist/core/design-code-tools.js +2794 -0
  165. package/dist/core/design-code-tools.js.map +1 -0
  166. package/dist/core/design-system-manifest.d.ts +273 -0
  167. package/dist/core/design-system-manifest.d.ts.map +1 -0
  168. package/dist/core/design-system-manifest.js +266 -0
  169. package/dist/core/design-system-manifest.js.map +1 -0
  170. package/dist/core/design-system-tools.d.ts +67 -0
  171. package/dist/core/design-system-tools.d.ts.map +1 -0
  172. package/dist/core/design-system-tools.js +883 -0
  173. package/dist/core/design-system-tools.js.map +1 -0
  174. package/dist/core/diagnose-tool.d.ts +41 -0
  175. package/dist/core/diagnose-tool.d.ts.map +1 -0
  176. package/dist/core/diagnose-tool.js +101 -0
  177. package/dist/core/diagnose-tool.js.map +1 -0
  178. package/dist/core/diff/changelog-formatter.d.ts +35 -0
  179. package/dist/core/diff/changelog-formatter.d.ts.map +1 -0
  180. package/dist/core/diff/changelog-formatter.js +276 -0
  181. package/dist/core/diff/changelog-formatter.js.map +1 -0
  182. package/dist/core/diff/diff-engine.d.ts +127 -0
  183. package/dist/core/diff/diff-engine.d.ts.map +1 -0
  184. package/dist/core/diff/diff-engine.js +335 -0
  185. package/dist/core/diff/diff-engine.js.map +1 -0
  186. package/dist/core/diff/property-compare.d.ts +19 -0
  187. package/dist/core/diff/property-compare.d.ts.map +1 -0
  188. package/dist/core/diff/property-compare.js +37 -0
  189. package/dist/core/diff/property-compare.js.map +1 -0
  190. package/dist/core/diff/version-cache.d.ts +40 -0
  191. package/dist/core/diff/version-cache.d.ts.map +1 -0
  192. package/dist/core/diff/version-cache.js +75 -0
  193. package/dist/core/diff/version-cache.js.map +1 -0
  194. package/dist/core/enrichment/enrichment-service.d.ts +52 -0
  195. package/dist/core/enrichment/enrichment-service.d.ts.map +1 -0
  196. package/dist/core/enrichment/enrichment-service.js +375 -0
  197. package/dist/core/enrichment/enrichment-service.js.map +1 -0
  198. package/dist/core/enrichment/index.d.ts +8 -0
  199. package/dist/core/enrichment/index.d.ts.map +1 -0
  200. package/dist/core/enrichment/index.js +8 -0
  201. package/dist/core/enrichment/index.js.map +1 -0
  202. package/dist/core/enrichment/relationship-mapper.d.ts +106 -0
  203. package/dist/core/enrichment/relationship-mapper.d.ts.map +1 -0
  204. package/dist/core/enrichment/relationship-mapper.js +352 -0
  205. package/dist/core/enrichment/relationship-mapper.js.map +1 -0
  206. package/dist/core/enrichment/style-resolver.d.ts +85 -0
  207. package/dist/core/enrichment/style-resolver.d.ts.map +1 -0
  208. package/dist/core/enrichment/style-resolver.js +347 -0
  209. package/dist/core/enrichment/style-resolver.js.map +1 -0
  210. package/dist/core/figjam-tools.d.ts +8 -0
  211. package/dist/core/figjam-tools.d.ts.map +1 -0
  212. package/dist/core/figjam-tools.js +548 -0
  213. package/dist/core/figjam-tools.js.map +1 -0
  214. package/dist/core/figma-api.d.ts +254 -0
  215. package/dist/core/figma-api.d.ts.map +1 -0
  216. package/dist/core/figma-api.js +510 -0
  217. package/dist/core/figma-api.js.map +1 -0
  218. package/dist/core/figma-connector.d.ts +214 -0
  219. package/dist/core/figma-connector.d.ts.map +1 -0
  220. package/dist/core/figma-connector.js +8 -0
  221. package/dist/core/figma-connector.js.map +1 -0
  222. package/dist/core/figma-desktop-connector.d.ts +312 -0
  223. package/dist/core/figma-desktop-connector.d.ts.map +1 -0
  224. package/dist/core/figma-desktop-connector.js +1298 -0
  225. package/dist/core/figma-desktop-connector.js.map +1 -0
  226. package/dist/core/figma-reconstruction-spec.d.ts +166 -0
  227. package/dist/core/figma-reconstruction-spec.d.ts.map +1 -0
  228. package/dist/core/figma-reconstruction-spec.js +403 -0
  229. package/dist/core/figma-reconstruction-spec.js.map +1 -0
  230. package/dist/core/figma-style-extractor.d.ts +76 -0
  231. package/dist/core/figma-style-extractor.d.ts.map +1 -0
  232. package/dist/core/figma-style-extractor.js +312 -0
  233. package/dist/core/figma-style-extractor.js.map +1 -0
  234. package/dist/core/figma-tools.d.ts +22 -0
  235. package/dist/core/figma-tools.d.ts.map +1 -0
  236. package/dist/core/figma-tools.js +3303 -0
  237. package/dist/core/figma-tools.js.map +1 -0
  238. package/dist/core/identity.d.ts +41 -0
  239. package/dist/core/identity.d.ts.map +1 -0
  240. package/dist/core/identity.js +97 -0
  241. package/dist/core/identity.js.map +1 -0
  242. package/dist/core/library-tools.d.ts +17 -0
  243. package/dist/core/library-tools.d.ts.map +1 -0
  244. package/dist/core/library-tools.js +581 -0
  245. package/dist/core/library-tools.js.map +1 -0
  246. package/dist/core/logger.d.ts +22 -0
  247. package/dist/core/logger.d.ts.map +1 -0
  248. package/dist/core/logger.js +54 -0
  249. package/dist/core/logger.js.map +1 -0
  250. package/dist/core/port-discovery.d.ts +211 -0
  251. package/dist/core/port-discovery.d.ts.map +1 -0
  252. package/dist/core/port-discovery.js +936 -0
  253. package/dist/core/port-discovery.js.map +1 -0
  254. package/dist/core/resolve-package-root.d.ts +2 -0
  255. package/dist/core/resolve-package-root.d.ts.map +1 -0
  256. package/dist/core/resolve-package-root.js +12 -0
  257. package/dist/core/resolve-package-root.js.map +1 -0
  258. package/dist/core/slides-tools.d.ts +8 -0
  259. package/dist/core/slides-tools.d.ts.map +1 -0
  260. package/dist/core/slides-tools.js +715 -0
  261. package/dist/core/slides-tools.js.map +1 -0
  262. package/dist/core/slot-tools.d.ts +7 -0
  263. package/dist/core/slot-tools.d.ts.map +1 -0
  264. package/dist/core/slot-tools.js +335 -0
  265. package/dist/core/slot-tools.js.map +1 -0
  266. package/dist/core/snippet-injector.d.ts +24 -0
  267. package/dist/core/snippet-injector.d.ts.map +1 -0
  268. package/dist/core/snippet-injector.js +97 -0
  269. package/dist/core/snippet-injector.js.map +1 -0
  270. package/dist/core/tokens/alias-resolver.d.ts +97 -0
  271. package/dist/core/tokens/alias-resolver.d.ts.map +1 -0
  272. package/dist/core/tokens/alias-resolver.js +206 -0
  273. package/dist/core/tokens/alias-resolver.js.map +1 -0
  274. package/dist/core/tokens/config.d.ts +380 -0
  275. package/dist/core/tokens/config.d.ts.map +1 -0
  276. package/dist/core/tokens/config.js +295 -0
  277. package/dist/core/tokens/config.js.map +1 -0
  278. package/dist/core/tokens/dialect.d.ts +107 -0
  279. package/dist/core/tokens/dialect.d.ts.map +1 -0
  280. package/dist/core/tokens/dialect.js +233 -0
  281. package/dist/core/tokens/dialect.js.map +1 -0
  282. package/dist/core/tokens/figma-converter.d.ts +102 -0
  283. package/dist/core/tokens/figma-converter.d.ts.map +1 -0
  284. package/dist/core/tokens/figma-converter.js +324 -0
  285. package/dist/core/tokens/figma-converter.js.map +1 -0
  286. package/dist/core/tokens/formatters/css-vars.d.ts +24 -0
  287. package/dist/core/tokens/formatters/css-vars.d.ts.map +1 -0
  288. package/dist/core/tokens/formatters/css-vars.js +339 -0
  289. package/dist/core/tokens/formatters/css-vars.js.map +1 -0
  290. package/dist/core/tokens/formatters/dtcg.d.ts +28 -0
  291. package/dist/core/tokens/formatters/dtcg.d.ts.map +1 -0
  292. package/dist/core/tokens/formatters/dtcg.js +377 -0
  293. package/dist/core/tokens/formatters/dtcg.js.map +1 -0
  294. package/dist/core/tokens/formatters/index.d.ts +30 -0
  295. package/dist/core/tokens/formatters/index.d.ts.map +1 -0
  296. package/dist/core/tokens/formatters/index.js +46 -0
  297. package/dist/core/tokens/formatters/index.js.map +1 -0
  298. package/dist/core/tokens/formatters/json.d.ts +37 -0
  299. package/dist/core/tokens/formatters/json.d.ts.map +1 -0
  300. package/dist/core/tokens/formatters/json.js +206 -0
  301. package/dist/core/tokens/formatters/json.js.map +1 -0
  302. package/dist/core/tokens/formatters/less.d.ts +4 -0
  303. package/dist/core/tokens/formatters/less.d.ts.map +1 -0
  304. package/dist/core/tokens/formatters/less.js +5 -0
  305. package/dist/core/tokens/formatters/less.js.map +1 -0
  306. package/dist/core/tokens/formatters/scss.d.ts +26 -0
  307. package/dist/core/tokens/formatters/scss.d.ts.map +1 -0
  308. package/dist/core/tokens/formatters/scss.js +259 -0
  309. package/dist/core/tokens/formatters/scss.js.map +1 -0
  310. package/dist/core/tokens/formatters/stubs.d.ts +9 -0
  311. package/dist/core/tokens/formatters/stubs.d.ts.map +1 -0
  312. package/dist/core/tokens/formatters/stubs.js +14 -0
  313. package/dist/core/tokens/formatters/stubs.js.map +1 -0
  314. package/dist/core/tokens/formatters/style-dictionary-v3.d.ts +45 -0
  315. package/dist/core/tokens/formatters/style-dictionary-v3.d.ts.map +1 -0
  316. package/dist/core/tokens/formatters/style-dictionary-v3.js +214 -0
  317. package/dist/core/tokens/formatters/style-dictionary-v3.js.map +1 -0
  318. package/dist/core/tokens/formatters/tailwind-v3.d.ts +37 -0
  319. package/dist/core/tokens/formatters/tailwind-v3.d.ts.map +1 -0
  320. package/dist/core/tokens/formatters/tailwind-v3.js +238 -0
  321. package/dist/core/tokens/formatters/tailwind-v3.js.map +1 -0
  322. package/dist/core/tokens/formatters/tailwind-v4.d.ts +41 -0
  323. package/dist/core/tokens/formatters/tailwind-v4.d.ts.map +1 -0
  324. package/dist/core/tokens/formatters/tailwind-v4.js +336 -0
  325. package/dist/core/tokens/formatters/tailwind-v4.js.map +1 -0
  326. package/dist/core/tokens/formatters/tokens-studio.d.ts +44 -0
  327. package/dist/core/tokens/formatters/tokens-studio.d.ts.map +1 -0
  328. package/dist/core/tokens/formatters/tokens-studio.js +257 -0
  329. package/dist/core/tokens/formatters/tokens-studio.js.map +1 -0
  330. package/dist/core/tokens/formatters/ts-module.d.ts +35 -0
  331. package/dist/core/tokens/formatters/ts-module.d.ts.map +1 -0
  332. package/dist/core/tokens/formatters/ts-module.js +199 -0
  333. package/dist/core/tokens/formatters/ts-module.js.map +1 -0
  334. package/dist/core/tokens/index.d.ts +18 -0
  335. package/dist/core/tokens/index.d.ts.map +1 -0
  336. package/dist/core/tokens/index.js +17 -0
  337. package/dist/core/tokens/index.js.map +1 -0
  338. package/dist/core/tokens/parsers/css-vars.d.ts +3 -0
  339. package/dist/core/tokens/parsers/css-vars.d.ts.map +1 -0
  340. package/dist/core/tokens/parsers/css-vars.js +5 -0
  341. package/dist/core/tokens/parsers/css-vars.js.map +1 -0
  342. package/dist/core/tokens/parsers/dtcg.d.ts +21 -0
  343. package/dist/core/tokens/parsers/dtcg.d.ts.map +1 -0
  344. package/dist/core/tokens/parsers/dtcg.js +281 -0
  345. package/dist/core/tokens/parsers/dtcg.js.map +1 -0
  346. package/dist/core/tokens/parsers/index.d.ts +37 -0
  347. package/dist/core/tokens/parsers/index.d.ts.map +1 -0
  348. package/dist/core/tokens/parsers/index.js +139 -0
  349. package/dist/core/tokens/parsers/index.js.map +1 -0
  350. package/dist/core/tokens/parsers/json.d.ts +4 -0
  351. package/dist/core/tokens/parsers/json.d.ts.map +1 -0
  352. package/dist/core/tokens/parsers/json.js +8 -0
  353. package/dist/core/tokens/parsers/json.js.map +1 -0
  354. package/dist/core/tokens/parsers/scss.d.ts +3 -0
  355. package/dist/core/tokens/parsers/scss.d.ts.map +1 -0
  356. package/dist/core/tokens/parsers/scss.js +5 -0
  357. package/dist/core/tokens/parsers/scss.js.map +1 -0
  358. package/dist/core/tokens/parsers/stubs.d.ts +15 -0
  359. package/dist/core/tokens/parsers/stubs.d.ts.map +1 -0
  360. package/dist/core/tokens/parsers/stubs.js +21 -0
  361. package/dist/core/tokens/parsers/stubs.js.map +1 -0
  362. package/dist/core/tokens/parsers/style-dictionary-v3.d.ts +3 -0
  363. package/dist/core/tokens/parsers/style-dictionary-v3.d.ts.map +1 -0
  364. package/dist/core/tokens/parsers/style-dictionary-v3.js +5 -0
  365. package/dist/core/tokens/parsers/style-dictionary-v3.js.map +1 -0
  366. package/dist/core/tokens/parsers/tailwind-v3.d.ts +3 -0
  367. package/dist/core/tokens/parsers/tailwind-v3.d.ts.map +1 -0
  368. package/dist/core/tokens/parsers/tailwind-v3.js +5 -0
  369. package/dist/core/tokens/parsers/tailwind-v3.js.map +1 -0
  370. package/dist/core/tokens/parsers/tailwind-v4.d.ts +3 -0
  371. package/dist/core/tokens/parsers/tailwind-v4.d.ts.map +1 -0
  372. package/dist/core/tokens/parsers/tailwind-v4.js +5 -0
  373. package/dist/core/tokens/parsers/tailwind-v4.js.map +1 -0
  374. package/dist/core/tokens/parsers/tokens-studio.d.ts +3 -0
  375. package/dist/core/tokens/parsers/tokens-studio.d.ts.map +1 -0
  376. package/dist/core/tokens/parsers/tokens-studio.js +5 -0
  377. package/dist/core/tokens/parsers/tokens-studio.js.map +1 -0
  378. package/dist/core/tokens/schemas.d.ts +155 -0
  379. package/dist/core/tokens/schemas.d.ts.map +1 -0
  380. package/dist/core/tokens/schemas.js +153 -0
  381. package/dist/core/tokens/schemas.js.map +1 -0
  382. package/dist/core/tokens/transforms/color.d.ts +9 -0
  383. package/dist/core/tokens/transforms/color.d.ts.map +1 -0
  384. package/dist/core/tokens/transforms/color.js +13 -0
  385. package/dist/core/tokens/transforms/color.js.map +1 -0
  386. package/dist/core/tokens/transforms/index.d.ts +36 -0
  387. package/dist/core/tokens/transforms/index.d.ts.map +1 -0
  388. package/dist/core/tokens/transforms/index.js +30 -0
  389. package/dist/core/tokens/transforms/index.js.map +1 -0
  390. package/dist/core/tokens/transforms/size.d.ts +7 -0
  391. package/dist/core/tokens/transforms/size.d.ts.map +1 -0
  392. package/dist/core/tokens/transforms/size.js +8 -0
  393. package/dist/core/tokens/transforms/size.js.map +1 -0
  394. package/dist/core/tokens/types.d.ts +284 -0
  395. package/dist/core/tokens/types.d.ts.map +1 -0
  396. package/dist/core/tokens/types.js +19 -0
  397. package/dist/core/tokens/types.js.map +1 -0
  398. package/dist/core/tokens-tools.d.ts +285 -0
  399. package/dist/core/tokens-tools.d.ts.map +1 -0
  400. package/dist/core/tokens-tools.js +1789 -0
  401. package/dist/core/tokens-tools.js.map +1 -0
  402. package/dist/core/types/design-code.d.ts +271 -0
  403. package/dist/core/types/design-code.d.ts.map +1 -0
  404. package/dist/core/types/design-code.js +5 -0
  405. package/dist/core/types/design-code.js.map +1 -0
  406. package/dist/core/types/enriched.d.ts +213 -0
  407. package/dist/core/types/enriched.d.ts.map +1 -0
  408. package/dist/core/types/enriched.js +6 -0
  409. package/dist/core/types/enriched.js.map +1 -0
  410. package/dist/core/types/index.d.ts +104 -0
  411. package/dist/core/types/index.d.ts.map +1 -0
  412. package/dist/core/types/index.js +5 -0
  413. package/dist/core/types/index.js.map +1 -0
  414. package/dist/core/variable-resolver.d.ts +45 -0
  415. package/dist/core/variable-resolver.d.ts.map +1 -0
  416. package/dist/core/variable-resolver.js +86 -0
  417. package/dist/core/variable-resolver.js.map +1 -0
  418. package/dist/core/version-tools.d.ts +59 -0
  419. package/dist/core/version-tools.d.ts.map +1 -0
  420. package/dist/core/version-tools.js +1200 -0
  421. package/dist/core/version-tools.js.map +1 -0
  422. package/dist/core/websocket-connector.d.ts +247 -0
  423. package/dist/core/websocket-connector.d.ts.map +1 -0
  424. package/dist/core/websocket-connector.js +437 -0
  425. package/dist/core/websocket-connector.js.map +1 -0
  426. package/dist/core/websocket-server.d.ts +290 -0
  427. package/dist/core/websocket-server.d.ts.map +1 -0
  428. package/dist/core/websocket-server.js +957 -0
  429. package/dist/core/websocket-server.js.map +1 -0
  430. package/dist/core/write-tools.d.ts +7 -0
  431. package/dist/core/write-tools.d.ts.map +1 -0
  432. package/dist/core/write-tools.js +2507 -0
  433. package/dist/core/write-tools.js.map +1 -0
  434. package/dist/local.d.ts +105 -0
  435. package/dist/local.d.ts.map +1 -0
  436. package/dist/local.js +3314 -0
  437. package/dist/local.js.map +1 -0
  438. package/figma-desktop-bridge/README.md +365 -0
  439. package/figma-desktop-bridge/code.js +7359 -0
  440. package/figma-desktop-bridge/icon.png +0 -0
  441. package/figma-desktop-bridge/manifest.json +67 -0
  442. package/figma-desktop-bridge/ui.html +2783 -0
  443. package/package.json +103 -0
@@ -0,0 +1,377 @@
1
+ /**
2
+ * DTCG (Design Tokens Community Group) JSON formatter.
3
+ *
4
+ * Produces W3C-spec DTCG output (https://tr.designtokens.org/format/) with
5
+ * three nuances:
6
+ *
7
+ * 1. Multi-mode tokens. The DTCG v1 spec doesn't natively express modes;
8
+ * we use a separate file per mode (driven by `splitByMode: true`) or a
9
+ * single file with values keyed by mode under a vendor extension when
10
+ * splitByMode is false. The split-file approach is the recommended
11
+ * pattern in the broader DTCG community and is what Style Dictionary
12
+ * v4, Tokens Studio, and Figma's announced native export all use.
13
+ *
14
+ * 2. $extensions["figma-console-mcp"]. We stash Figma variable IDs and
15
+ * last-synced values here for non-destructive round-trip. Other DTCG
16
+ * tools preserve $extensions verbatim.
17
+ *
18
+ * 3. Composite tokens (typography, shadow, gradient) emit DTCG's
19
+ * structured $value form. Aliases emit `"$value": "{path.to.target}"`.
20
+ *
21
+ * This formatter is the canonical output — the format every other
22
+ * formatter (CSS variables, Tailwind v4/v3, SCSS, TS module, JSON
23
+ * flat/nested, Style Dictionary v3, Tokens Studio) ultimately derives from.
24
+ */
25
+ import { FIGMA_MCP_EXTENSION_KEY } from "../types.js";
26
+ import { formatDtcgReference } from "../alias-resolver.js";
27
+ import { colorValueTo2025, dimensionLiteralTo2025, } from "../dialect.js";
28
+ export function formatDtcg(doc, opts) {
29
+ const warnings = [];
30
+ const files = [];
31
+ // Figure out which sets and modes to emit, and how they map to files.
32
+ // Three layout strategies:
33
+ // 1. splitByMode + splitByCollection → one file per (set, mode) pair
34
+ // 2. splitByMode → one file per mode, all sets merged
35
+ // 3. splitByCollection → one file per set, all modes in one tree
36
+ // 4. neither → one file with everything
37
+ const splitByMode = opts.target.splitByMode ?? false;
38
+ const splitByCollection = opts.target.splitByCollection ?? false;
39
+ // Value-encoding dialect. 'legacy' (default) is byte-identical to the
40
+ // historical output; '2025' opts into DTCG 2025.10 object colors/dimensions.
41
+ const dialect = opts.target.dtcgDialect ?? "legacy";
42
+ if (splitByMode && splitByCollection) {
43
+ for (const set of doc.sets) {
44
+ for (const mode of set.modes) {
45
+ const fileTokens = set.tokens
46
+ .map((t) => projectTokenToMode(t, mode, warnings))
47
+ .filter((t) => t !== null);
48
+ files.push({
49
+ path: filenameFor(opts, set, mode),
50
+ content: serializeAsDtcg({ sets: [{ ...set, modes: [mode], tokens: fileTokens }], meta: doc.meta }, warnings, dialect, mode),
51
+ });
52
+ }
53
+ }
54
+ }
55
+ else if (splitByMode) {
56
+ const allModes = new Set();
57
+ for (const set of doc.sets)
58
+ for (const m of set.modes)
59
+ allModes.add(m);
60
+ for (const mode of allModes) {
61
+ const fileSets = doc.sets
62
+ .filter((s) => s.modes.includes(mode))
63
+ .map((s) => ({
64
+ ...s,
65
+ modes: [mode],
66
+ tokens: s.tokens
67
+ .map((t) => projectTokenToMode(t, mode, warnings))
68
+ .filter((t) => t !== null),
69
+ }));
70
+ files.push({
71
+ path: filenameFor(opts, undefined, mode),
72
+ content: serializeAsDtcg({ sets: fileSets, meta: doc.meta }, warnings, dialect, mode),
73
+ });
74
+ }
75
+ }
76
+ else if (splitByCollection) {
77
+ for (const set of doc.sets) {
78
+ files.push({
79
+ path: filenameFor(opts, set),
80
+ content: serializeAsDtcg({ sets: [set], meta: doc.meta }, warnings, dialect),
81
+ });
82
+ }
83
+ }
84
+ else {
85
+ files.push({
86
+ path: filenameFor(opts),
87
+ content: serializeAsDtcg(doc, warnings, dialect),
88
+ });
89
+ }
90
+ return { files, warnings };
91
+ }
92
+ /**
93
+ * Project a token's values down to a single mode. Returns null if the token
94
+ * has no value for the requested mode (skip rather than emit a blank).
95
+ */
96
+ function projectTokenToMode(token, mode, warnings) {
97
+ const value = token.values[mode];
98
+ if (!value) {
99
+ // Token wasn't defined for this mode. Could happen when sets share tokens
100
+ // but only some have multi-mode values. Skip silently — not an error.
101
+ return null;
102
+ }
103
+ return { ...token, values: { [mode]: value } };
104
+ }
105
+ /**
106
+ * Compute the output filename for a given (set?, mode?) tuple based on the
107
+ * target options.
108
+ */
109
+ function filenameFor(opts, set, mode) {
110
+ // Caller-specified filename wins.
111
+ if (opts.target.filename)
112
+ return opts.target.filename;
113
+ const parts = [];
114
+ if (set)
115
+ parts.push(slugify(set.name));
116
+ if (mode)
117
+ parts.push(slugify(mode));
118
+ if (parts.length === 0)
119
+ parts.push("tokens");
120
+ return `${parts.join(".")}.tokens.json`;
121
+ }
122
+ function slugify(s) {
123
+ return s
124
+ .trim()
125
+ .toLowerCase()
126
+ .replace(/[^a-z0-9]+/g, "-")
127
+ .replace(/^-+|-+$/g, "");
128
+ }
129
+ /**
130
+ * Serialize a TokenDocument as DTCG JSON. Returns a pretty-printed JSON string
131
+ * with stable key order so git diffs stay minimal across runs.
132
+ *
133
+ * When `fileMode` is provided (splitByMode output), it's stamped into
134
+ * document-level $extensions so the parser can recover which mode this
135
+ * file represents — otherwise the parser sees only `$value` literals and
136
+ * labels them "Default", which breaks round-trip diffs on multi-mode files.
137
+ */
138
+ function serializeAsDtcg(doc, warnings, dialect, fileMode) {
139
+ // Build the nested DTCG group tree by walking every token's path and
140
+ // building groups along the way.
141
+ const tree = {};
142
+ // Document-level $extensions: stash file-level metadata (Figma file key,
143
+ // export timestamp, MCP version, optionally the file's mode for
144
+ // splitByMode output) so round-trip preserves it.
145
+ const mcpDocMeta = {};
146
+ if (doc.meta?.figmaFileKey)
147
+ mcpDocMeta.figmaFileKey = doc.meta.figmaFileKey;
148
+ if (doc.meta?.exportedAt)
149
+ mcpDocMeta.exportedAt = doc.meta.exportedAt;
150
+ if (doc.meta?.mcpVersion)
151
+ mcpDocMeta.mcpVersion = doc.meta.mcpVersion;
152
+ if (fileMode)
153
+ mcpDocMeta.fileMode = fileMode;
154
+ if (Object.keys(mcpDocMeta).length > 0) {
155
+ tree.$extensions = { [FIGMA_MCP_EXTENSION_KEY]: mcpDocMeta };
156
+ }
157
+ for (const set of doc.sets) {
158
+ // Each set lives under a top-level group named after the set. Set-level
159
+ // metadata (Figma collection ID, original name, etc.) goes in that
160
+ // group's $extensions so round-trip recovers the original name even
161
+ // after we slugify it for the JSON key.
162
+ const setKey = setKeyFor(set);
163
+ let setGroup = tree[setKey];
164
+ if (!setGroup) {
165
+ setGroup = {};
166
+ if (set.description)
167
+ setGroup.$description = set.description;
168
+ const mcpMeta = {};
169
+ if (set.meta?.figmaCollectionId) {
170
+ mcpMeta.figmaCollectionId = set.meta.figmaCollectionId;
171
+ }
172
+ // Always stash the original name when it differs from the slug — this
173
+ // is what makes diff matching work after round-trip.
174
+ if (set.name !== setKey) {
175
+ mcpMeta.originalName = set.name;
176
+ }
177
+ if (Object.keys(mcpMeta).length > 0) {
178
+ setGroup.$extensions = { [FIGMA_MCP_EXTENSION_KEY]: mcpMeta };
179
+ }
180
+ tree[setKey] = setGroup;
181
+ }
182
+ for (const token of set.tokens) {
183
+ writeTokenIntoTree(setGroup, token, set.modes, warnings, dialect, fileMode);
184
+ }
185
+ }
186
+ return JSON.stringify(sortKeys(tree), null, 2) + "\n";
187
+ }
188
+ /**
189
+ * Key used for the top-level set group in DTCG. We slugify the set name to
190
+ * keep it a valid JSON key under any consumer's expectations. The original
191
+ * (un-slugged) name is preserved in the set's $extensions so round-trip
192
+ * recovers it.
193
+ */
194
+ function setKeyFor(set) {
195
+ return slugify(set.name);
196
+ }
197
+ /**
198
+ * Insert a token into the DTCG group tree at the right nested path.
199
+ * Creates intermediate groups as needed.
200
+ *
201
+ * Leaf/group name conflicts (a variable named "color" alongside
202
+ * "color/primary") are kept — the leaf is emitted under the reserved "@"
203
+ * key inside the group, flagged with `leafRemap: true` in its
204
+ * figma-console-mcp $extensions so the parser can restore the original
205
+ * name on round-trip. A warning names both sides of the conflict.
206
+ */
207
+ function writeTokenIntoTree(root, token, setModes, warnings, dialect, fileMode) {
208
+ let cursor = root;
209
+ for (let i = 0; i < token.path.length - 1; i++) {
210
+ const segment = token.path[i];
211
+ let next = cursor[segment];
212
+ if (next && isToken(next)) {
213
+ // A leaf token already occupies this segment and we need a group
214
+ // here. Keep both: demote the existing leaf to the reserved "@" key
215
+ // inside the new group.
216
+ const conflictPath = token.path.slice(0, i + 1).join("/");
217
+ warnings.push(`Name conflict: "${conflictPath}" is both a token and a group (needed by "${token.path.join("/")}"). Kept both — the leaf token "${conflictPath}" was emitted under "${conflictPath}/@" and round-trips back to its original name.`);
218
+ const group = { "@": markLeafRemap(next) };
219
+ cursor[segment] = group;
220
+ next = group;
221
+ }
222
+ else if (!next) {
223
+ next = {};
224
+ cursor[segment] = next;
225
+ }
226
+ cursor = next;
227
+ }
228
+ const leafKey = token.path[token.path.length - 1];
229
+ const rendered = renderToken(token, setModes, warnings, dialect, fileMode);
230
+ const existing = cursor[leafKey];
231
+ if (existing &&
232
+ typeof existing === "object" &&
233
+ !isToken(existing)) {
234
+ // A group already exists at this name (some other token nests under
235
+ // it). Keep both: emit this leaf under the reserved "@" key.
236
+ const conflictPath = token.path.join("/");
237
+ warnings.push(`Name conflict: token "${conflictPath}" collides with the group "${conflictPath}" (created by tokens nested under it). Kept both — the leaf was emitted under "${conflictPath}/@" and round-trips back to its original name.`);
238
+ existing["@"] = markLeafRemap(rendered);
239
+ return;
240
+ }
241
+ cursor[leafKey] = rendered;
242
+ }
243
+ /**
244
+ * Flag a rendered leaf token as remapped under the reserved "@" key so the
245
+ * parser can strip that synthetic path segment on round-trip.
246
+ */
247
+ function markLeafRemap(tok) {
248
+ const existing = tok.$extensions?.[FIGMA_MCP_EXTENSION_KEY] ?? {};
249
+ tok.$extensions ??= {};
250
+ tok.$extensions[FIGMA_MCP_EXTENSION_KEY] = { ...existing, leafRemap: true };
251
+ return tok;
252
+ }
253
+ function isToken(node) {
254
+ return "$value" in node;
255
+ }
256
+ /**
257
+ * Convert an internal Token to its DTCG-encoded leaf form.
258
+ *
259
+ * Single-mode token: emits `{ $value, $type, ... }`.
260
+ * Multi-mode token: emits the primary mode as `$value` and stashes BOTH the
261
+ * primary mode's name (`primaryMode`) and the remaining mode values
262
+ * (`modes`) under `$extensions["figma-console-mcp"]`, because vanilla DTCG
263
+ * doesn't have a native multi-mode encoding. The parser reads the same keys
264
+ * back, so a Light/Dark collection round-trips losslessly even without
265
+ * splitByMode. Callers who want one-file-per-mode should set splitByMode at
266
+ * the formatter level.
267
+ */
268
+ function renderToken(token, setModes, warnings, dialect, fileMode) {
269
+ const result = {
270
+ $value: "",
271
+ $type: token.type,
272
+ };
273
+ if (token.description)
274
+ result.$description = token.description;
275
+ const modeKeys = Object.keys(token.values);
276
+ const isSingleMode = modeKeys.length === 1;
277
+ // Pick the primary mode: the set's first mode when the token has a value
278
+ // for it, otherwise the token's first mode.
279
+ const primaryMode = setModes[0] in token.values ? setModes[0] : modeKeys[0];
280
+ result.$value = encodeValue(token.values[primaryMode], token, warnings, dialect);
281
+ const otherModes = {};
282
+ if (!isSingleMode) {
283
+ for (const m of modeKeys) {
284
+ if (m === primaryMode)
285
+ continue;
286
+ otherModes[m] = encodeValue(token.values[m], token, warnings, dialect);
287
+ }
288
+ }
289
+ // Preserve any pre-existing extensions (e.g. studio.tokens, our own metadata).
290
+ if (token.extensions) {
291
+ for (const [vendor, payload] of Object.entries(token.extensions)) {
292
+ if (vendor === FIGMA_MCP_EXTENSION_KEY) {
293
+ mergeExtension(result, vendor, payload);
294
+ }
295
+ else {
296
+ mergeExtension(result, vendor, payload);
297
+ }
298
+ }
299
+ }
300
+ // Mode round-trip metadata goes under OUR extension key (merged on top of
301
+ // any preserved figma-console-mcp payload so variableId etc. survive):
302
+ // - `primaryMode` whenever the parser couldn't otherwise recover the
303
+ // primary mode's name (i.e. it isn't covered by the file-level
304
+ // fileMode stamp and isn't the "Default" fallback).
305
+ // - `modes` with every non-primary mode's value for multi-mode tokens.
306
+ const needsPrimaryStash = primaryMode !== (fileMode ?? "Default");
307
+ const hasOtherModes = Object.keys(otherModes).length > 0;
308
+ if (needsPrimaryStash || hasOtherModes) {
309
+ const existing = result.$extensions?.[FIGMA_MCP_EXTENSION_KEY] ?? {};
310
+ mergeExtension(result, FIGMA_MCP_EXTENSION_KEY, {
311
+ ...existing,
312
+ primaryMode,
313
+ ...(hasOtherModes ? { modes: otherModes } : {}),
314
+ });
315
+ }
316
+ return result;
317
+ }
318
+ function encodeValue(value, token, warnings, dialect) {
319
+ if (!value) {
320
+ warnings.push(`Token ${token.path.join(".")} has no mode values — emitting empty string.`);
321
+ return "";
322
+ }
323
+ if (value.reference) {
324
+ return formatDtcgReference(value.reference.replace(/^\{|\}$/g, "").split("."));
325
+ }
326
+ if (value.literal === undefined) {
327
+ warnings.push(`Token ${token.path.join(".")} has neither literal nor reference — emitting empty string.`);
328
+ return "";
329
+ }
330
+ // DTCG 2025.10 dialect: colors emit the object form (components from the
331
+ // converter's full-precision rawColor floats, hex kept as the interop
332
+ // courtesy field); dimension-typed bare numbers emit { value, unit: "px" }.
333
+ // duration already emits { value, unit: "ms" } in both dialects. Anything
334
+ // the encoders don't recognize keeps the legacy rendering.
335
+ if (dialect === "2025") {
336
+ if (token.type === "color") {
337
+ const encoded = colorValueTo2025(value);
338
+ if (encoded)
339
+ return encoded;
340
+ }
341
+ else if (token.type === "dimension") {
342
+ const encoded = dimensionLiteralTo2025(value.literal);
343
+ if (encoded)
344
+ return encoded;
345
+ }
346
+ }
347
+ return value.literal;
348
+ }
349
+ function mergeExtension(token, key, payload) {
350
+ token.$extensions ??= {};
351
+ token.$extensions[key] = payload;
352
+ }
353
+ /**
354
+ * Recursively sort object keys for stable serialization (so git diffs only
355
+ * show meaningful changes). $-prefixed keys come first (DTCG convention),
356
+ * then alphabetical.
357
+ */
358
+ function sortKeys(node) {
359
+ if (node === null || typeof node !== "object" || Array.isArray(node)) {
360
+ return node;
361
+ }
362
+ const obj = node;
363
+ const sorted = {};
364
+ const keys = Object.keys(obj).sort((a, b) => {
365
+ const aDollar = a.startsWith("$");
366
+ const bDollar = b.startsWith("$");
367
+ if (aDollar && !bDollar)
368
+ return -1;
369
+ if (!aDollar && bDollar)
370
+ return 1;
371
+ return a.localeCompare(b);
372
+ });
373
+ for (const k of keys)
374
+ sorted[k] = sortKeys(obj[k]);
375
+ return sorted;
376
+ }
377
+ //# sourceMappingURL=dtcg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtcg.js","sourceRoot":"","sources":["../../../../src/core/tokens/formatters/dtcg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,eAAe,CAAC;AAqBvB,MAAM,UAAU,UAAU,CACxB,GAAkB,EAClB,IAAmB;IAEnB,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,KAAK,GAA0B,EAAE,CAAC;IAExC,sEAAsE;IACtE,2BAA2B;IAC3B,uEAAuE;IACvE,wDAAwD;IACxD,mEAAmE;IACnE,0CAA0C;IAE1C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;IACrD,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,KAAK,CAAC;IACjE,sEAAsE;IACtE,6EAA6E;IAC7E,MAAM,OAAO,GAAgB,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC;IAEjE,IAAI,WAAW,IAAI,iBAAiB,EAAE,CAAC;QACrC,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM;qBAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;qBACjD,MAAM,CAAC,CAAC,CAAC,E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,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,OAAO,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,IAAI,OAAO;YAAE,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,KAAK,MAAM,CAAC,IAAI,IAAI;QAAE,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAY,CAAC,CAAC;IAC9D,OAAO,MAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Formatter dispatcher. Each formatter converts our canonical internal
3
+ * TokenDocument into a specific output format (DTCG JSON, CSS custom
4
+ * properties, Tailwind v4 @theme, SCSS, etc.).
5
+ */
6
+ import type { ExportFormat, TokenDocument } from "../types.js";
7
+ import type { OutputTarget } from "../config.js";
8
+ export interface FormatOptions {
9
+ /** Output target options merged from per-call args and tokens.config.json. */
10
+ target: OutputTarget;
11
+ /** Project root path. Resolves output filenames relative to this. */
12
+ projectRoot?: string;
13
+ }
14
+ export interface FormatResult {
15
+ /**
16
+ * Output files to write. Single-file formats return one entry; split formats
17
+ * (splitByMode, splitByCollection) return one per file.
18
+ */
19
+ files: Array<{
20
+ /** Relative path from the configured generated.dir or projectRoot. */
21
+ path: string;
22
+ /** UTF-8 content. */
23
+ content: string;
24
+ }>;
25
+ /** Format-specific warnings (e.g. "composite typography expanded to primitives"). */
26
+ warnings: string[];
27
+ }
28
+ export declare function format(doc: TokenDocument, options: FormatOptions): FormatResult;
29
+ export type { ExportFormat };
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tokens/formatters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAajD,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,MAAM,EAAE,YAAY,CAAC;IACrB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC;QACX,sEAAsE;QACtE,IAAI,EAAE,MAAM,CAAC;QACb,qBAAqB;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,qFAAqF;IACrF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,MAAM,CACpB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,aAAa,GACrB,YAAY,CA+Bd;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Formatter dispatcher. Each formatter converts our canonical internal
3
+ * TokenDocument into a specific output format (DTCG JSON, CSS custom
4
+ * properties, Tailwind v4 @theme, SCSS, etc.).
5
+ */
6
+ import { formatDtcg } from "./dtcg.js";
7
+ import { formatTokensStudio } from "./tokens-studio.js";
8
+ import { formatCssVars } from "./css-vars.js";
9
+ import { formatTailwindV4 } from "./tailwind-v4.js";
10
+ import { formatTailwindV3 } from "./tailwind-v3.js";
11
+ import { formatScss } from "./scss.js";
12
+ import { formatLess } from "./less.js";
13
+ import { formatTsModule } from "./ts-module.js";
14
+ import { formatJsonFlat, formatJsonNested } from "./json.js";
15
+ import { formatStyleDictionaryV3 } from "./style-dictionary-v3.js";
16
+ export function format(doc, options) {
17
+ switch (options.target.format) {
18
+ case "dtcg":
19
+ return formatDtcg(doc, options);
20
+ case "tokens-studio":
21
+ return formatTokensStudio(doc, options);
22
+ case "css-vars":
23
+ return formatCssVars(doc, options);
24
+ case "tailwind-v4":
25
+ return formatTailwindV4(doc, options);
26
+ case "tailwind-v3":
27
+ return formatTailwindV3(doc, options);
28
+ case "scss":
29
+ return formatScss(doc, options);
30
+ case "less":
31
+ return formatLess(doc, options);
32
+ case "ts-module":
33
+ return formatTsModule(doc, options);
34
+ case "json-flat":
35
+ return formatJsonFlat(doc, options);
36
+ case "json-nested":
37
+ return formatJsonNested(doc, options);
38
+ case "style-dictionary-v3":
39
+ return formatStyleDictionaryV3(doc, options);
40
+ default: {
41
+ const _exhaustive = options.target.format;
42
+ throw new Error(`[figma-console-mcp] Unknown export format: ${_exhaustive}`);
43
+ }
44
+ }
45
+ }
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/tokens/formatters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,UA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8C,WAAW,EAAE,CAC5D,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Plain JSON formatters — flat and nested.
3
+ *
4
+ * These are dumps without the DTCG `$type`/`$value` envelope, for custom
5
+ * build scripts that just need a key-value map of resolved tokens.
6
+ *
7
+ * Flat shape:
8
+ *
9
+ * {
10
+ * "ds-color-primary": "#4085F2",
11
+ * "ds-spacing-md": "16px",
12
+ * "ds-color-bg--dark": "#0A0A0A"
13
+ * }
14
+ *
15
+ * Multi-mode tokens flatten with `--<mode>` suffix (primary mode keeps
16
+ * the bare name; other modes get suffixed).
17
+ *
18
+ * Nested shape:
19
+ *
20
+ * {
21
+ * "color": {
22
+ * "primary": "#4085F2",
23
+ * "brand": { "primary": "#FF00AA" }
24
+ * },
25
+ * "spacing": { "md": "16px" }
26
+ * }
27
+ *
28
+ * Multi-mode tokens become objects: `{ Light: "...", Dark: "..." }`.
29
+ *
30
+ * Aliases resolve to the literal value where possible; cross-library
31
+ * aliases get a `null` (caller can decide how to fill those in).
32
+ */
33
+ import type { TokenDocument } from "../types.js";
34
+ import type { FormatOptions, FormatResult } from "./index.js";
35
+ export declare function formatJsonFlat(doc: TokenDocument, opts: FormatOptions): FormatResult;
36
+ export declare function formatJsonNested(doc: TokenDocument, opts: FormatOptions): FormatResult;
37
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/core/tokens/formatters/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAS,aAAa,EAAwB,MAAM,aAAa,CAAC;AAO9E,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,aAAa,GAClB,YAAY,CA0Bd;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,aAAa,GAClB,YAAY,CAuBd"}