@agent-native/core 0.80.4 → 0.80.6

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 (341) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +28 -2
  3. package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
  4. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +1 -1
  5. package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
  6. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +1 -1
  7. package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
  8. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +1 -1
  9. package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
  10. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +1 -1
  11. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +1 -1
  12. package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
  13. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +1 -1
  14. package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
  15. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +1 -1
  16. package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
  17. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +1 -1
  18. package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
  19. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +1 -1
  20. package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
  21. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +1 -1
  22. package/corpus/core/docs/content/real-time-collaboration.mdx +2 -2
  23. package/corpus/core/docs/content/template-design.mdx +1 -1
  24. package/corpus/core/package.json +3 -7
  25. package/corpus/core/src/action.ts +21 -0
  26. package/corpus/core/src/agent/durable-background.ts +32 -11
  27. package/corpus/core/src/agent/production-agent.ts +11 -1
  28. package/corpus/core/src/agent/run-loop-with-resume.ts +3 -1
  29. package/corpus/core/src/brand-kit/fig/index.ts +17 -37
  30. package/corpus/core/src/cli/create.ts +1 -0
  31. package/corpus/core/src/cli/index.ts +1 -1
  32. package/corpus/core/src/cli/mcp-config-writers.ts +187 -51
  33. package/corpus/core/src/cli/skills.ts +18 -3
  34. package/corpus/core/src/client/AssistantChat.tsx +11 -1
  35. package/corpus/core/src/client/agent-chat.ts +12 -1
  36. package/corpus/core/src/client/composer/PromptComposer.tsx +100 -41
  37. package/corpus/core/src/client/org/OrgSwitcher.tsx +1 -1
  38. package/corpus/core/src/client/sharing/ShareButton.tsx +3 -27
  39. package/corpus/core/src/collab/presence.ts +1 -1
  40. package/corpus/core/src/mcp/connect-route.ts +34 -5
  41. package/corpus/core/src/server/action-discovery.ts +4 -0
  42. package/corpus/core/src/server/agent-chat-plugin.ts +20 -0
  43. package/corpus/core/src/sharing/registry.ts +17 -0
  44. package/corpus/core/src/templates/default/pnpm-workspace.yaml +1 -0
  45. package/corpus/core/src/templates/workspace-root/pnpm-workspace.yaml +1 -0
  46. package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +2 -0
  47. package/corpus/templates/analytics/actions/update-dashboard.ts +8 -0
  48. package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
  49. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +117 -33
  50. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +4 -0
  51. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +7 -0
  52. package/corpus/templates/analytics/changelog/2026-06-27-dashboards-can-now-nest-under-a-parent-in-the-sidebar-via-a-.md +6 -0
  53. package/corpus/templates/analytics/changelog/2026-06-29-analytics-pages-now-sit-closer-under-the-header-with-tighter.md +6 -0
  54. package/corpus/templates/assets/actions/generate-image-batch.ts +3 -0
  55. package/corpus/templates/assets/actions/generate-image.ts +3 -0
  56. package/corpus/templates/assets/changelog/2026-06-29-longer-agent-generation-window.md +6 -0
  57. package/corpus/templates/assets/netlify.toml +3 -3
  58. package/corpus/templates/assets/server/plugins/agent-chat.ts +4 -1
  59. package/corpus/templates/clips/app/components/capture-install-options.tsx +7 -8
  60. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +1 -1
  61. package/corpus/templates/content/AGENTS.md +57 -44
  62. package/corpus/templates/content/README.md +16 -0
  63. package/corpus/templates/content/actions/_builder-cms-read-client.ts +125 -0
  64. package/corpus/templates/content/actions/_builder-cms-source-adapter.ts +28 -6
  65. package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +238 -69
  66. package/corpus/templates/content/actions/_builder-cms-write-settings.ts +125 -43
  67. package/corpus/templates/content/actions/_database-source-utils.ts +746 -97
  68. package/corpus/templates/content/actions/_database-utils.ts +17 -14
  69. package/corpus/templates/content/actions/_federation-join.ts +14 -2
  70. package/corpus/templates/content/actions/_join-suggestion.ts +89 -14
  71. package/corpus/templates/content/actions/_local-file-documents.ts +2 -1
  72. package/corpus/templates/content/actions/attach-content-database-source.ts +124 -5
  73. package/corpus/templates/content/actions/bind-content-database-source-field.ts +256 -0
  74. package/corpus/templates/content/actions/change-content-database-source-role.ts +420 -0
  75. package/corpus/templates/content/actions/create-document.ts +8 -0
  76. package/corpus/templates/content/actions/execute-builder-source-batch.ts +282 -0
  77. package/corpus/templates/content/actions/execute-builder-source-execution.ts +220 -8
  78. package/corpus/templates/content/actions/get-content-database.ts +10 -2
  79. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +19 -2
  80. package/corpus/templates/content/actions/prepare-builder-source-review.ts +47 -15
  81. package/corpus/templates/content/actions/refresh-content-database-source.ts +11 -4
  82. package/corpus/templates/content/actions/review-content-database-source-change-set.ts +6 -2
  83. package/corpus/templates/content/actions/set-content-database-source-write-mode.ts +32 -12
  84. package/corpus/templates/content/actions/stage-builder-revision.ts +14 -10
  85. package/corpus/templates/content/actions/validate-builder-source-execution.ts +25 -3
  86. package/corpus/templates/content/app/blocks/BuilderDocsBlocks.tsx +10 -0
  87. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -0
  88. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +185 -0
  89. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +1520 -553
  90. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -0
  91. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +150 -1
  92. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +19 -0
  93. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +647 -66
  94. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +543 -204
  95. package/corpus/templates/content/app/components/editor/extensions/ContentReferenceNode.tsx +82 -0
  96. package/corpus/templates/content/app/global.css +9 -0
  97. package/corpus/templates/content/app/hooks/use-content-database.ts +62 -0
  98. package/corpus/templates/content/app/i18n/zh-TW.ts +76 -0
  99. package/corpus/templates/content/app/i18n-data.ts +924 -0
  100. package/corpus/templates/content/changelog/2026-06-29-builder-review-checks-now-preserve-publish-and-unpublish-cho.md +6 -0
  101. package/corpus/templates/content/changelog/2026-06-29-database-sources-can-now-be-added-as-more-rows-or-matched.md +6 -0
  102. package/corpus/templates/content/changelog/2026-06-29-fixed-loading-the-final-rows-in-larger-databases-without-bre.md +6 -0
  103. package/corpus/templates/content/changelog/2026-06-29-reusable-mdx-references-now-preview-linked-local-documents-i.md +6 -0
  104. package/corpus/templates/content/shared/api.ts +91 -1
  105. package/corpus/templates/content/shared/builder-docs-blocks.ts +8 -0
  106. package/corpus/templates/content/shared/builder-mdx.ts +141 -4
  107. package/corpus/templates/content/shared/nfm.ts +62 -0
  108. package/corpus/templates/content/vite.config.ts +14 -7
  109. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +10 -11
  110. package/corpus/templates/design/AGENTS.md +5 -0
  111. package/corpus/templates/design/_gitignore +7 -0
  112. package/corpus/templates/design/actions/apply-visual-edit.ts +22 -12
  113. package/corpus/templates/design/actions/create-design-system.ts +15 -4
  114. package/corpus/templates/design/actions/create-file.ts +20 -1
  115. package/corpus/templates/design/actions/delete-design-system.ts +2 -2
  116. package/corpus/templates/design/actions/duplicate-design.ts +35 -9
  117. package/corpus/templates/design/actions/generate-design.ts +146 -69
  118. package/corpus/templates/design/actions/generate-screens.ts +51 -19
  119. package/corpus/templates/design/actions/get-design-snapshot.ts +5 -1
  120. package/corpus/templates/design/actions/get-design.ts +2 -0
  121. package/corpus/templates/design/actions/import-design-project.ts +28 -9
  122. package/corpus/templates/design/actions/import-document.ts +22 -8
  123. package/corpus/templates/design/actions/index-design-system-with-builder.ts +6 -153
  124. package/corpus/templates/design/actions/navigate.ts +105 -54
  125. package/corpus/templates/design/actions/set-default-design-system.ts +17 -3
  126. package/corpus/templates/design/actions/show-design-questions.ts +2 -0
  127. package/corpus/templates/design/actions/update-design.ts +2 -1
  128. package/corpus/templates/design/actions/view-screen.ts +12 -6
  129. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +4 -4
  130. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +159 -41
  131. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +8 -4
  132. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +37 -42
  133. package/corpus/templates/design/app/components/design/EditPanel.tsx +336 -183
  134. package/corpus/templates/design/app/components/design/LayersPanel.tsx +153 -34
  135. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +135 -33
  136. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +6 -0
  137. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
  138. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +4 -10
  139. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +84 -43
  140. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +4 -4
  141. package/corpus/templates/design/app/components/design/inspector/{FigmaColorPicker.tsx → DesignColorPicker.tsx} +89 -62
  142. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +14 -26
  143. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +40 -12
  144. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +13 -4
  145. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +13 -13
  146. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -9
  147. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +13 -4
  148. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
  149. package/corpus/templates/design/app/components/design/inspector/{figma-icons.tsx → design-icons.tsx} +2 -2
  150. package/corpus/templates/design/app/components/design/inspector/index.ts +12 -12
  151. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +5 -2
  152. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
  153. package/corpus/templates/design/app/components/layout/Layout.tsx +5 -2
  154. package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
  155. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +167 -91
  156. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +16 -3
  157. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +15 -0
  158. package/corpus/templates/design/app/global.css +4 -0
  159. package/corpus/templates/design/app/hooks/use-design-system.ts +4 -1
  160. package/corpus/templates/design/app/hooks/use-navigation-state.ts +38 -3
  161. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +9 -2
  162. package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
  163. package/corpus/templates/design/app/i18n-data.ts +527 -0
  164. package/corpus/templates/design/app/lib/design-systems.ts +6 -4
  165. package/corpus/templates/design/app/lib/design-templates.ts +15 -3
  166. package/corpus/templates/design/app/pages/DesignEditor.tsx +641 -158
  167. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +42 -34
  168. package/corpus/templates/design/app/pages/VisualEdit.tsx +100 -0
  169. package/corpus/templates/design/app/root.tsx +42 -9
  170. package/corpus/templates/design/app/routes/visual-edit.tsx +7 -0
  171. package/corpus/templates/design/changelog/2026-06-28-live-cursors-now-keep-names-beside-a-cleaner-pointer-marker.md +1 -1
  172. package/corpus/templates/design/changelog/2026-06-28-mode-switching-now-lives-in-a-compact-bottom-right-icon-dock.md +1 -1
  173. package/corpus/templates/design/changelog/2026-06-28-visual-code-design-mode.md +6 -0
  174. package/corpus/templates/design/changelog/2026-06-29-design-generation-prompts-now-show-connect-ai-before-sending.md +6 -0
  175. package/corpus/templates/design/changelog/2026-06-29-design-mode-top-chrome-now-groups-collaborators-preview-shar.md +1 -1
  176. package/corpus/templates/design/changelog/2026-06-29-fixed-design-editor-exports-and-gradient-edits-so-multi-scre.md +6 -0
  177. package/corpus/templates/design/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
  178. package/corpus/templates/design/changelog/2026-06-29-png-export-handles-modern-css-color-functions-more-reliably.md +6 -0
  179. package/corpus/templates/design/changelog/2026-06-29-png-export-now-ignores-duplicate-clicks-while-a-download-is-.md +6 -0
  180. package/corpus/templates/design/changelog/2026-06-29-public-visual-edit-and-shared-design-links-now-invite-visito.md +6 -0
  181. package/corpus/templates/design/changelog/2026-06-29-visual-edit-actions-now-reject-missing-design-targets-before.md +6 -0
  182. package/corpus/templates/design/e2e/README.md +71 -0
  183. package/corpus/templates/design/e2e/global-setup.ts +157 -0
  184. package/corpus/templates/design/e2e/helpers.ts +148 -0
  185. package/corpus/templates/design/netlify.toml +3 -4
  186. package/corpus/templates/design/package.json +5 -1
  187. package/corpus/templates/design/playwright.config.ts +51 -0
  188. package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +121 -0
  189. package/corpus/templates/design/server/handlers/uploads.ts +89 -38
  190. package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +181 -0
  191. package/corpus/templates/design/server/lib/coding-handoff.ts +33 -4
  192. package/corpus/templates/design/server/lib/design-export.ts +35 -8
  193. package/corpus/templates/design/server/plugins/agent-chat.ts +4 -0
  194. package/corpus/templates/design/server/plugins/auth.ts +10 -1
  195. package/corpus/templates/design/server/routes/api/index-design-system-with-builder.post.ts +1 -0
  196. package/corpus/templates/design/shared/api.ts +2 -0
  197. package/corpus/templates/design/shared/apply-edits.ts +12 -8
  198. package/corpus/templates/design/shared/canvas-math.ts +19 -1
  199. package/corpus/templates/design/shared/code-layer.ts +87 -28
  200. package/corpus/templates/design/shared/generation-session.ts +1 -0
  201. package/corpus/templates/design/shared/resolve-tweaks.ts +4 -3
  202. package/corpus/templates/design/shared/shader-presets.ts +10 -0
  203. package/corpus/templates/design/shared/source-mode.ts +9 -0
  204. package/corpus/templates/design/vitest.config.ts +2 -1
  205. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -1
  206. package/corpus/templates/plan/.agents/skills/visual-plan/references/canvas.md +1 -1
  207. package/corpus/templates/plan/AGENTS.md +1 -1
  208. package/corpus/templates/plan/actions/create-plan-design.ts +1 -1
  209. package/corpus/templates/plan/actions/validate-local-plan-source.ts +2 -10
  210. package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -0
  211. package/corpus/templates/plan/docs/commenting-ux-plan.md +2 -2
  212. package/corpus/templates/plan/server/plan-content.ts +1 -1
  213. package/corpus/templates/plan/server/ui-plan-html.ts +2 -2
  214. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +6 -153
  215. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +53 -38
  216. package/corpus/templates/slides/app/components/design-system/{fig-import-response.ts → builder-index-response.ts} +9 -6
  217. package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
  218. package/corpus/templates/slides/changelog/2026-06-29-design-system-setup-now-indexes-uploaded-design-files-throug.md +6 -0
  219. package/corpus/templates/slides/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
  220. package/corpus/templates/slides/netlify.toml +3 -6
  221. package/corpus/templates/slides/server/handlers/index-design-system-with-builder.ts +116 -0
  222. package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +179 -0
  223. package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -1
  224. package/corpus/templates/slides/server/routes/api/index-design-system-with-builder.post.ts +1 -0
  225. package/dist/action.d.ts +15 -0
  226. package/dist/action.d.ts.map +1 -1
  227. package/dist/action.js +6 -0
  228. package/dist/action.js.map +1 -1
  229. package/dist/agent/durable-background.d.ts +9 -7
  230. package/dist/agent/durable-background.d.ts.map +1 -1
  231. package/dist/agent/durable-background.js +27 -11
  232. package/dist/agent/durable-background.js.map +1 -1
  233. package/dist/agent/production-agent.d.ts +7 -0
  234. package/dist/agent/production-agent.d.ts.map +1 -1
  235. package/dist/agent/production-agent.js +4 -1
  236. package/dist/agent/production-agent.js.map +1 -1
  237. package/dist/agent/run-loop-with-resume.d.ts +2 -1
  238. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  239. package/dist/agent/run-loop-with-resume.js +2 -2
  240. package/dist/agent/run-loop-with-resume.js.map +1 -1
  241. package/dist/brand-kit/fig/index.d.ts +4 -4
  242. package/dist/brand-kit/fig/index.d.ts.map +1 -1
  243. package/dist/brand-kit/fig/index.js +14 -27
  244. package/dist/brand-kit/fig/index.js.map +1 -1
  245. package/dist/cli/create.d.ts.map +1 -1
  246. package/dist/cli/create.js +1 -0
  247. package/dist/cli/create.js.map +1 -1
  248. package/dist/cli/index.js +1 -1
  249. package/dist/cli/index.js.map +1 -1
  250. package/dist/cli/mcp-config-writers.d.ts +15 -7
  251. package/dist/cli/mcp-config-writers.d.ts.map +1 -1
  252. package/dist/cli/mcp-config-writers.js +198 -45
  253. package/dist/cli/mcp-config-writers.js.map +1 -1
  254. package/dist/cli/skills.d.ts +1 -1
  255. package/dist/cli/skills.d.ts.map +1 -1
  256. package/dist/cli/skills.js +18 -3
  257. package/dist/cli/skills.js.map +1 -1
  258. package/dist/client/AssistantChat.d.ts.map +1 -1
  259. package/dist/client/AssistantChat.js +11 -1
  260. package/dist/client/AssistantChat.js.map +1 -1
  261. package/dist/client/agent-chat.d.ts.map +1 -1
  262. package/dist/client/agent-chat.js +15 -2
  263. package/dist/client/agent-chat.js.map +1 -1
  264. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  265. package/dist/client/composer/PromptComposer.js +35 -1
  266. package/dist/client/composer/PromptComposer.js.map +1 -1
  267. package/dist/client/org/OrgSwitcher.js +1 -1
  268. package/dist/client/org/OrgSwitcher.js.map +1 -1
  269. package/dist/client/sharing/ShareButton.d.ts +1 -1
  270. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  271. package/dist/client/sharing/ShareButton.js +2 -15
  272. package/dist/client/sharing/ShareButton.js.map +1 -1
  273. package/dist/collab/presence.d.ts +1 -1
  274. package/dist/collab/presence.js +1 -1
  275. package/dist/collab/presence.js.map +1 -1
  276. package/dist/collab/routes.d.ts +1 -1
  277. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  278. package/dist/mcp/connect-route.d.ts.map +1 -1
  279. package/dist/mcp/connect-route.js +34 -5
  280. package/dist/mcp/connect-route.js.map +1 -1
  281. package/dist/notifications/routes.d.ts +2 -2
  282. package/dist/observability/routes.d.ts +8 -8
  283. package/dist/resources/handlers.d.ts +1 -1
  284. package/dist/server/action-discovery.d.ts.map +1 -1
  285. package/dist/server/action-discovery.js +5 -0
  286. package/dist/server/action-discovery.js.map +1 -1
  287. package/dist/server/agent-chat-plugin.d.ts +6 -0
  288. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  289. package/dist/server/agent-chat-plugin.js +12 -3
  290. package/dist/server/agent-chat-plugin.js.map +1 -1
  291. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  292. package/dist/sharing/registry.d.ts.map +1 -1
  293. package/dist/sharing/registry.js +11 -0
  294. package/dist/sharing/registry.js.map +1 -1
  295. package/dist/templates/default/pnpm-workspace.yaml +1 -0
  296. package/dist/templates/workspace-root/pnpm-workspace.yaml +1 -0
  297. package/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
  298. package/docs/content/locales/ar-SA/template-design.mdx +1 -1
  299. package/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
  300. package/docs/content/locales/de-DE/template-design.mdx +1 -1
  301. package/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
  302. package/docs/content/locales/es-ES/template-design.mdx +1 -1
  303. package/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
  304. package/docs/content/locales/fr-FR/template-design.mdx +1 -1
  305. package/docs/content/locales/hi-IN/template-design.mdx +1 -1
  306. package/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
  307. package/docs/content/locales/ja-JP/template-design.mdx +1 -1
  308. package/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
  309. package/docs/content/locales/ko-KR/template-design.mdx +1 -1
  310. package/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
  311. package/docs/content/locales/pt-BR/template-design.mdx +1 -1
  312. package/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
  313. package/docs/content/locales/zh-CN/template-design.mdx +1 -1
  314. package/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
  315. package/docs/content/locales/zh-TW/template-design.mdx +1 -1
  316. package/docs/content/real-time-collaboration.mdx +2 -2
  317. package/docs/content/template-design.mdx +1 -1
  318. package/package.json +3 -7
  319. package/src/templates/default/pnpm-workspace.yaml +1 -0
  320. package/src/templates/workspace-root/pnpm-workspace.yaml +1 -0
  321. package/corpus/core/src/brand-kit/fig/decode.ts +0 -410
  322. package/corpus/core/src/brand-kit/fig/extract-design-system.ts +0 -947
  323. package/corpus/core/src/brand-kit/fig/fig-to-html.ts +0 -1906
  324. package/corpus/templates/design/actions/import-figma.ts +0 -55
  325. package/corpus/templates/design/changelog/2026-06-28-figma-style-code-design-mode.md +0 -6
  326. package/corpus/templates/design/server/handlers/import-figma-system.ts +0 -86
  327. package/corpus/templates/design/server/routes/api/import-figma-system.post.ts +0 -1
  328. package/corpus/templates/slides/server/handlers/import-figma-system.ts +0 -101
  329. package/corpus/templates/slides/server/routes/api/import-figma-system.post.ts +0 -1
  330. package/dist/brand-kit/fig/decode.d.ts +0 -33
  331. package/dist/brand-kit/fig/decode.d.ts.map +0 -1
  332. package/dist/brand-kit/fig/decode.js +0 -358
  333. package/dist/brand-kit/fig/decode.js.map +0 -1
  334. package/dist/brand-kit/fig/extract-design-system.d.ts +0 -44
  335. package/dist/brand-kit/fig/extract-design-system.d.ts.map +0 -1
  336. package/dist/brand-kit/fig/extract-design-system.js +0 -752
  337. package/dist/brand-kit/fig/extract-design-system.js.map +0 -1
  338. package/dist/brand-kit/fig/fig-to-html.d.ts +0 -246
  339. package/dist/brand-kit/fig/fig-to-html.d.ts.map +0 -1
  340. package/dist/brand-kit/fig/fig-to-html.js +0 -1506
  341. package/dist/brand-kit/fig/fig-to-html.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-design-system.js","sourceRoot":"","sources":["../../../src/brand-kit/fig/extract-design-system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AA+BzD,6EAA6E;AAE7E,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;2EAC2E;AAC3E,SAAS,UAAU,CAAC,CAAoB,EAAE,QAAQ,GAAG,CAAC;IACpD,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QA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GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClF,CAAC","sourcesContent":["/**\n * Walk a decoded Figma document (the kiwi `Message` tree produced by\n * `decodeFig`) and distil a rich brand profile from it: color roles + palette,\n * a full typographic system (families, weights, scale, letter-spacing, label\n * case), spacing rhythm, corner character, an elevation ramp, and — crucially —\n * the SIGNATURE GRADIENTS and a synthesized brand-character brief.\n *\n * The goal is on-brand generation: not just \"use the right fonts and colors\",\n * but capture what is distinctive about the brand (its gradient, density,\n * corner language, contrast, type personality) so generated designs feel\n * unmistakably on-brand. The brief is emitted as `customInstructions` (the\n * free-form guidance the generator follows) and the gradients/elevation as\n * `customCSS` tokens.\n *\n * Heuristic by necessity: Figma documents carry no canonical \"design system\",\n * so we cluster/weight observed values and assign roles by saturation,\n * lightness, contrast, and area. The result is reviewable before saving.\n */\n\nimport type { BrandKitData, BrandKitDefaults } from \"../types.js\";\nimport { guidKey, type FigNode } from \"./fig-to-html.js\";\n\ninterface Color {\n r: number;\n g: number;\n b: number;\n a: number;\n}\n\ninterface GradientStop {\n color: Color;\n position: number;\n}\n\ninterface Paint {\n type?: string;\n color?: Color;\n opacity?: number;\n visible?: boolean;\n stops?: GradientStop[];\n}\n\ninterface Effect {\n type?: string;\n visible?: boolean;\n color?: Color;\n offset?: { x: number; y: number };\n radius?: number;\n spread?: number;\n}\n\n// --- color helpers --------------------------------------------------------\n\nfunction clamp255(n: number): number {\n return Math.max(0, Math.min(255, Math.round(n)));\n}\n\n/** Convert a Figma 0-1 RGBA color (folding paint opacity into the channels\n * over white) to a `#rrggbb` hex string. Returns null on invalid input. */\nfunction colorToHex(c: Color | undefined, alphaMul = 1): string | null {\n if (!c) return null;\n if (![c.r, c.g, c.b].every((v) => typeof v === \"number\" && isFinite(v))) {\n return null;\n }\n const a = (typeof c.a === \"number\" ? c.a : 1) * alphaMul;\n const composite = (channel: number) => channel * a + 1 * (1 - a);\n const r = clamp255(composite(c.r) * 255);\n const g = clamp255(composite(c.g) * 255);\n const b = clamp255(composite(c.b) * 255);\n const hex = (n: number) => n.toString(16).padStart(2, \"0\");\n return `#${hex(r)}${hex(g)}${hex(b)}`;\n}\n\n/** Raw rgba() string for a Figma 0-1 color, preserving alpha (for gradients).\n * `alphaMul` folds in a paint-level opacity that scales every stop's alpha. */\nfunction colorToRgba(c: Color | undefined, alphaMul = 1): string | null {\n if (!c) return null;\n if (![c.r, c.g, c.b].every((v) => typeof v === \"number\" && isFinite(v))) {\n return null;\n }\n const a = (typeof c.a === \"number\" ? c.a : 1) * alphaMul;\n return `rgba(${clamp255(c.r * 255)}, ${clamp255(c.g * 255)}, ${clamp255(c.b * 255)}, ${Number(a.toFixed(3))})`;\n}\n\nfunction hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());\n if (!m) return null;\n const int = parseInt(m[1]!, 16);\n return { r: (int >> 16) & 255, g: (int >> 8) & 255, b: int & 255 };\n}\n\n/** Relative luminance (0 dark .. 1 light) per WCAG. */\nfunction luminance(hex: string): number {\n const rgb = hexToRgb(hex);\n if (!rgb) return 0;\n const lin = (c: number) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);\n };\n return 0.2126 * lin(rgb.r) + 0.7152 * lin(rgb.g) + 0.0722 * lin(rgb.b);\n}\n\n/** HSL saturation (0..1) of a hex color. */\nfunction saturation(hex: string): number {\n const rgb = hexToRgb(hex);\n if (!rgb) return 0;\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n if (max === min) return 0;\n const l = (max + min) / 2;\n const d = max - min;\n return l > 0.5 ? d / (2 - max - min) : d / (max + min);\n}\n\n/** Hue in degrees (0..360) of a hex color. */\nfunction hue(hex: string): number {\n const rgb = hexToRgb(hex);\n if (!rgb) return 0;\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n if (d === 0) return 0;\n let h: number;\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n return h < 0 ? h + 360 : h;\n}\n\n/** Human-readable hue name for a saturated color, for the brand brief. */\nfunction hueName(hex: string): string {\n if (saturation(hex) < 0.12) {\n const l = luminance(hex);\n if (l > 0.8) return \"near-white\";\n if (l < 0.08) return \"near-black\";\n return \"neutral grey\";\n }\n const h = hue(hex);\n if (h < 15 || h >= 345) return \"red\";\n if (h < 45) return \"orange\";\n if (h < 70) return \"amber/yellow\";\n if (h < 160) return \"green\";\n if (h < 200) return \"teal/cyan\";\n if (h < 250) return \"blue\";\n if (h < 290) return \"indigo/violet\";\n if (h < 330) return \"magenta/pink\";\n return \"rose\";\n}\n\nfunction contrastRatio(a: string, b: string): number {\n const la = luminance(a);\n const lb = luminance(b);\n const hi = Math.max(la, lb);\n const lo = Math.min(la, lb);\n return (hi + 0.05) / (lo + 0.05);\n}\n\n// --- collection types -----------------------------------------------------\n\ninterface ColorStat {\n hex: string;\n count: number;\n area: number;\n name?: string;\n}\n\ninterface TextStat {\n family: string;\n weights: Map<number, number>;\n sizes: Map<number, number>;\n lineHeights: number[];\n letterSpacings: number[];\n count: number;\n area: number;\n}\n\ninterface GradientStat {\n css: string;\n /** A representative key (stop hexes) for dedupe. */\n key: string;\n area: number;\n count: number;\n}\n\nfunction fontWeightFromStyle(style: string | undefined): number {\n if (!style) return 400;\n const s = style.toLowerCase();\n if (s.includes(\"thin\")) return 100;\n if (s.includes(\"extralight\") || s.includes(\"ultralight\")) return 200;\n if (s.includes(\"light\")) return 300;\n if (s.includes(\"medium\")) return 500;\n if (s.includes(\"semibold\") || s.includes(\"demibold\")) return 600;\n if (s.includes(\"extrabold\") || s.includes(\"ultrabold\")) return 800;\n if (s.includes(\"black\") || s.includes(\"heavy\")) return 900;\n if (s.includes(\"bold\")) return 700;\n return 400;\n}\n\nfunction weightWord(w: number): string {\n if (w <= 200) return \"ultra-light\";\n if (w <= 300) return \"light\";\n if (w === 400) return \"regular\";\n if (w === 500) return \"medium\";\n if (w === 600) return \"semibold\";\n if (w === 700) return \"bold\";\n return \"heavy/black\";\n}\n\nfunction nodeArea(node: FigNode): number {\n const x = node.size?.x ?? 0;\n const y = node.size?.y ?? 0;\n if (!isFinite(x) || !isFinite(y) || x <= 0 || y <= 0) return 0;\n return x * y;\n}\n\nfunction gcd(a: number, b: number): number {\n a = Math.abs(Math.round(a));\n b = Math.abs(Math.round(b));\n while (b) {\n [a, b] = [b, a % b];\n }\n return a;\n}\n\nfunction inferSpacingStep(values: number[]): number {\n const positives = values\n .map((v) => Math.round(v))\n .filter((v) => v > 0 && v <= 256);\n if (positives.length === 0) return 8;\n const divisibleBy = (d: number) =>\n positives.filter((v) => v % d === 0).length / positives.length;\n if (divisibleBy(8) >= 0.6) return 8;\n if (divisibleBy(4) >= 0.6) return 4;\n let g = positives[0]!;\n for (const v of positives.slice(1)) g = gcd(g, v);\n return g >= 2 ? g : 4;\n}\n\n/** Build a CSS gradient string from a Figma gradient Paint. Angle is\n * approximated (the exact handle vector isn't always recoverable); the stop\n * colors — the brand-signature part — are captured faithfully. */\nfunction gradientToCss(paint: Paint): { css: string; key: string } | null {\n const stops = (paint.stops ?? [])\n .filter((s) => s && s.color)\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0));\n if (stops.length < 2) return null;\n const parts: string[] = [];\n const keyParts: string[] = [];\n for (const s of stops) {\n // Fold the paint-level opacity into every stop's alpha.\n const rgba = colorToRgba(s.color, paint.opacity ?? 1);\n if (!rgba) return null;\n const pct = clampPct(s.position);\n parts.push(`${rgba} ${pct}%`);\n // Key on color AND position so two gradients with the same colors but\n // different stop placement aren't treated as duplicates.\n keyParts.push(`${colorToHex(s.color) ?? rgba}@${pct}`);\n }\n const body = parts.join(\", \");\n let css: string;\n switch (paint.type) {\n case \"GRADIENT_RADIAL\":\n css = `radial-gradient(circle at 30% 30%, ${body})`;\n break;\n case \"GRADIENT_ANGULAR\":\n css = `conic-gradient(from 180deg, ${body})`;\n break;\n case \"GRADIENT_DIAMOND\":\n css = `radial-gradient(${body})`;\n break;\n default:\n css = `linear-gradient(135deg, ${body})`;\n }\n return { css, key: `${paint.type}:${keyParts.join(\"|\")}` };\n}\n\nfunction clampPct(p: number | undefined): number {\n const v = typeof p === \"number\" ? p * 100 : 0;\n return Math.max(0, Math.min(100, Math.round(v)));\n}\n\nfunction indexStyleNames(nodes: FigNode[]): Map<string, string> {\n const out = new Map<string, string>();\n for (const n of nodes) {\n if ((n.styleType || n.type === \"STYLE\") && n.name) {\n out.set(guidKey(n.guid), n.name.trim());\n }\n }\n return out;\n}\n\nfunction resolveFillStyleName(\n node: FigNode,\n styleNames: Map<string, string>,\n): string | undefined {\n const g = node.styleIdForFill?.guid;\n if (!g) return undefined;\n return styleNames.get(guidKey(g));\n}\n\nfunction resolveTextStyleName(\n node: FigNode,\n styleNames: Map<string, string>,\n): string | undefined {\n const g = node.styleIdForText?.guid;\n if (!g) return undefined;\n return styleNames.get(guidKey(g));\n}\n\n// --- result type ----------------------------------------------------------\n\nexport interface ExtractedFigTokens extends Partial<BrandKitData> {\n /** Surface defaults inferred from the file. Templates map this to their\n * persisted defaults key, e.g. `defaults` or `slideDefaults`. */\n defaults?: BrandKitDefaults;\n /** Raw, de-duplicated color palette (most frequent first) for reference. */\n palette?: { hex: string; name?: string; count: number }[];\n /** Named color styles found in the file (key = style name). */\n namedColors?: Record<string, string>;\n /** Signature gradients found in the file, as ready-to-use CSS. */\n gradients?: string[];\n /**\n * A synthesized brand-character brief — the free-form guidance the generator\n * should follow to produce on-brand designs. Goes into the design system's\n * `customInstructions`.\n */\n customInstructions?: string;\n /** Count of nodes walked, for provenance/preview. */\n nodeCount?: number;\n}\n\nexport function extractDesignSystemFromFig(\n document: unknown,\n): ExtractedFigTokens {\n const doc = document as { nodeChanges?: FigNode[] } | null | undefined;\n const nodes = doc?.nodeChanges ?? [];\n if (nodes.length === 0) return {};\n\n const styleNames = indexStyleNames(nodes);\n\n const colorStats = new Map<string, ColorStat>();\n const namedColors: Record<string, string> = {};\n const textStats = new Map<string, TextStat>();\n const radii: number[] = [];\n const spacingValues: number[] = [];\n const shadows: string[] = [];\n const gradientStats = new Map<string, GradientStat>();\n // Gradient stop colors are collected separately and only folded into the\n // palette when SOLID fills are too sparse to derive roles — otherwise a\n // bright gradient stop can hijack the accent over the real solid brand color.\n const gradientStopColors: { hex: string; area: number; name?: string }[] = [];\n // Heuristic label-case signal: small text whose content is all-caps.\n let upperLabelHits = 0;\n let smallTextSamples = 0;\n\n const addColor = (hex: string | null, area: number, name?: string): void => {\n if (!hex) return;\n const existing = colorStats.get(hex);\n if (existing) {\n existing.count += 1;\n existing.area += area;\n if (!existing.name && name) existing.name = name;\n } else {\n colorStats.set(hex, { hex, count: 1, area, name });\n }\n if (name && !namedColors[name]) namedColors[name] = hex;\n };\n\n for (const node of nodes) {\n if (node.visible === false) continue;\n const area = nodeArea(node);\n\n const fillStyleName = resolveFillStyleName(node, styleNames);\n for (const paint of (node.fillPaints ?? []) as Paint[]) {\n if (paint.visible === false) continue;\n if (paint.type === \"SOLID\") {\n addColor(\n colorToHex(paint.color, paint.opacity ?? 1),\n area,\n fillStyleName,\n );\n } else if (paint.type?.startsWith(\"GRADIENT_\")) {\n const grad = gradientToCss(paint);\n if (grad) {\n const existing = gradientStats.get(grad.key);\n if (existing) {\n existing.area += area;\n existing.count += 1;\n } else {\n gradientStats.set(grad.key, {\n css: grad.css,\n key: grad.key,\n area,\n count: 1,\n });\n }\n // Stash gradient stop colors; only used for roles if SOLID fills\n // turn out to be too sparse (handled after the walk).\n for (const s of paint.stops ?? []) {\n const hex = colorToHex(s.color);\n if (hex) gradientStopColors.push({ hex, area: area * 0.2 });\n }\n }\n }\n }\n for (const paint of (node.strokePaints ?? []) as Paint[]) {\n if (paint.visible === false) continue;\n if (paint.type !== \"SOLID\") continue;\n addColor(colorToHex(paint.color, paint.opacity ?? 1), 0);\n }\n\n // Typography from TEXT nodes.\n if (node.type === \"TEXT\" && node.fontName?.family) {\n const family = node.fontName.family;\n const weight = fontWeightFromStyle(node.fontName.style);\n const size =\n typeof node.fontSize === \"number\" ? Math.round(node.fontSize) : 0;\n const textStyleName = resolveTextStyleName(node, styleNames);\n const key = textStyleName ? `style:${textStyleName}|${family}` : family;\n let stat = textStats.get(key);\n if (!stat) {\n stat = {\n family,\n weights: new Map(),\n sizes: new Map(),\n lineHeights: [],\n letterSpacings: [],\n count: 0,\n area: 0,\n };\n textStats.set(key, stat);\n }\n stat.count += 1;\n stat.area += area;\n stat.weights.set(weight, (stat.weights.get(weight) ?? 0) + 1);\n if (size > 0) stat.sizes.set(size, (stat.sizes.get(size) ?? 0) + 1);\n if (node.lineHeight && typeof node.lineHeight.value === \"number\") {\n if (node.lineHeight.units === \"PIXELS\") {\n stat.lineHeights.push(node.lineHeight.value);\n } else if (node.lineHeight.units === \"PERCENT\" && size > 0) {\n stat.lineHeights.push((node.lineHeight.value / 100) * size);\n }\n }\n if (\n node.letterSpacing &&\n typeof node.letterSpacing.value === \"number\" &&\n size > 0\n ) {\n const ls =\n node.letterSpacing.units === \"PERCENT\"\n ? (node.letterSpacing.value / 100) * size\n : node.letterSpacing.value;\n stat.letterSpacings.push(ls / size); // em-relative\n }\n // Label-case heuristic: short, small text rendered in all caps.\n const chars = node.textData?.characters;\n if (size > 0 && size <= 18 && chars && chars.trim().length > 0) {\n smallTextSamples += 1;\n const letters = chars.replace(/[^a-z]/gi, \"\");\n if (letters.length >= 2 && letters === letters.toUpperCase()) {\n upperLabelHits += 1;\n }\n }\n }\n\n // Corner radii.\n const corner =\n node.cornerRadius ??\n node.rectangleTopLeftCornerRadius ??\n node.rectangleTopRightCornerRadius;\n if (typeof corner === \"number\" && corner > 0 && corner <= 200) {\n radii.push(Math.round(corner));\n }\n\n // Spacing: auto-layout gaps and padding.\n if (node.stackMode && node.stackMode !== \"NONE\") {\n if (typeof node.stackSpacing === \"number\")\n spacingValues.push(node.stackSpacing);\n for (const pad of [\n node.stackPaddingLeft,\n node.stackPaddingRight,\n node.stackPaddingTop,\n node.stackPaddingBottom,\n node.stackHorizontalPadding,\n node.stackVerticalPadding,\n ]) {\n if (typeof pad === \"number\" && pad > 0) spacingValues.push(pad);\n }\n }\n\n // Effects -> shadows.\n for (const effect of (node.effects ?? []) as Effect[]) {\n if (effect.visible === false) continue;\n if (effect.type !== \"DROP_SHADOW\" && effect.type !== \"INNER_SHADOW\")\n continue;\n const c = effect.color;\n const a = c && typeof c.a === \"number\" ? c.a : 0.25;\n const rgb = c\n ? `rgba(${clamp255(c.r * 255)}, ${clamp255(c.g * 255)}, ${clamp255(c.b * 255)}, ${Number(a.toFixed(3))})`\n : \"rgba(0, 0, 0, 0.25)\";\n const inset = effect.type === \"INNER_SHADOW\" ? \"inset \" : \"\";\n const ox = Math.round(effect.offset?.x ?? 0);\n const oy = Math.round(effect.offset?.y ?? 0);\n const blur = Math.round(effect.radius ?? 0);\n const spread = Math.round(effect.spread ?? 0);\n // Skip artboard-scale shadows (giant blurs/offsets common on Figma frame\n // backgrounds) — keep only UI-plausible elevation.\n if (\n blur > 80 ||\n Math.abs(spread) > 64 ||\n Math.abs(ox) > 120 ||\n Math.abs(oy) > 120\n ) {\n continue;\n }\n shadows.push(`${inset}${ox}px ${oy}px ${blur}px ${spread}px ${rgb}`);\n }\n }\n\n // --- assign color roles -------------------------------------------------\n\n // Fold gradient stop colors into the palette only when solid fills are too\n // sparse to characterize the brand (e.g. a gradient-only file).\n if (colorStats.size < 4) {\n for (const g of gradientStopColors) addColor(g.hex, g.area, g.name);\n }\n\n const palette = Array.from(colorStats.values()).sort(\n (a, b) => b.count - a.count || b.area - a.area,\n );\n\n const result: ExtractedFigTokens = { nodeCount: nodes.length };\n let roles: BrandKitData[\"colors\"] | null = null;\n\n if (palette.length > 0) {\n const byArea = [...palette].sort((a, b) => b.area - a.area);\n const background =\n byArea.find((c) => {\n const l = luminance(c.hex);\n return l > 0.85 || l < 0.08;\n }) ?? byArea[0]!;\n\n const accent =\n palette\n .filter((c) => c.hex !== background.hex)\n .sort((a, b) => saturation(b.hex) - saturation(a.hex))[0] ?? background;\n\n const text = palette\n .filter((c) => c.hex !== background.hex)\n .sort(\n (a, b) =>\n contrastRatio(b.hex, background.hex) -\n contrastRatio(a.hex, background.hex),\n )[0] ?? { hex: luminance(background.hex) > 0.5 ? \"#111111\" : \"#ffffff\" };\n\n const saturated = palette\n .filter(\n (c) =>\n saturation(c.hex) > 0.15 &&\n c.hex !== background.hex &&\n c.hex !== text.hex,\n )\n .sort((a, b) => b.count - a.count);\n const primary = saturated[0] ?? accent;\n const secondary = saturated[1] ?? saturated[0] ?? primary;\n\n const surface =\n byArea.find(\n (c) =>\n c.hex !== background.hex &&\n Math.abs(luminance(c.hex) - luminance(background.hex)) < 0.15,\n ) ?? background;\n\n const textMuted =\n palette\n .filter((c) => {\n const cr = contrastRatio(c.hex, background.hex);\n return c.hex !== text.hex && cr >= 2 && cr <= 7;\n })\n .sort(\n (a, b) =>\n contrastRatio(b.hex, background.hex) -\n contrastRatio(a.hex, background.hex),\n )[0]?.hex ?? mixHex(text.hex, background.hex, 0.45);\n\n roles = {\n primary: primary.hex,\n secondary: secondary.hex,\n accent: accent.hex,\n background: background.hex,\n surface: surface.hex,\n text: text.hex,\n textMuted: typeof textMuted === \"string\" ? textMuted : text.hex,\n };\n result.colors = roles;\n\n result.palette = palette\n .slice(0, 24)\n .map((c) => ({ hex: c.hex, name: c.name, count: c.count }));\n if (Object.keys(namedColors).length > 0) result.namedColors = namedColors;\n }\n\n // --- typography ---------------------------------------------------------\n\n let typo: {\n headingStat: TextStat;\n bodyStat: TextStat;\n headingWeight: number;\n bodyWeight: number;\n h1: number;\n body: number;\n headingTracking: number;\n } | null = null;\n\n if (textStats.size > 0) {\n const stats = Array.from(textStats.values());\n const byArea = [...stats].sort(\n (a, b) => b.area - a.area || b.count - a.count,\n );\n const bodyStat = byArea[0]!;\n const maxSizeOf = (s: TextStat) =>\n Math.max(0, ...Array.from(s.sizes.keys()));\n const byMaxSize = [...stats].sort((a, b) => maxSizeOf(b) - maxSizeOf(a));\n const headingStat =\n byMaxSize.find((s) => s.family !== bodyStat.family) ??\n byMaxSize[0] ??\n bodyStat;\n\n const topWeight = (s: TextStat): number => {\n let best = 400;\n let bestCount = -1;\n for (const [w, c] of s.weights) {\n if (c > bestCount) {\n best = w;\n bestCount = c;\n }\n }\n return best;\n };\n\n // Web-plausible sizes only. Figma marketing boards carry display text at\n // hundreds/thousands of px, which is useless as a web type scale — keep\n // 8..200px and clamp the final scale into a sane web range.\n const webSizes = Array.from(\n new Set(stats.flatMap((s) => Array.from(s.sizes.keys()))),\n )\n .filter((n) => n >= 8 && n <= 200)\n .sort((a, b) => b - a);\n const clampHead = (n: number) => Math.min(72, Math.max(18, Math.round(n)));\n const h1 = clampHead(webSizes[0] ?? 48);\n const h2 = clampHead(webSizes.find((n) => n < h1) ?? Math.round(h1 * 0.72));\n const h3 = clampHead(webSizes.find((n) => n < h2) ?? Math.round(h2 * 0.72));\n\n const avgTracking =\n headingStat.letterSpacings.length > 0\n ? headingStat.letterSpacings.reduce((a, b) => a + b, 0) /\n headingStat.letterSpacings.length\n : 0;\n\n const rawBody =\n Array.from(bodyStat.sizes.entries())\n .filter(([s]) => s >= 8 && s <= 28)\n .sort((a, b) => b[1] - a[1])[0]?.[0] ?? 16;\n const bodySize = Math.min(20, Math.max(14, Math.round(rawBody)));\n\n result.typography = {\n headingFont: headingStat.family,\n bodyFont: bodyStat.family,\n headingWeight: String(topWeight(headingStat)),\n bodyWeight: String(topWeight(bodyStat)),\n headingSizes: { h1: `${h1}px`, h2: `${h2}px`, h3: `${h3}px` },\n };\n typo = {\n headingStat,\n bodyStat,\n headingWeight: topWeight(headingStat),\n bodyWeight: topWeight(bodyStat),\n h1,\n body: bodySize,\n headingTracking: avgTracking,\n };\n }\n\n // --- spacing ------------------------------------------------------------\n\n let elementGapPx = 0;\n if (spacingValues.length > 0) {\n const step = inferSpacingStep(spacingValues);\n const rounded = spacingValues\n .map((v) => Math.round(v))\n .sort((a, b) => a - b);\n const median = rounded[Math.floor(rounded.length / 2)] ?? step * 2;\n const max = rounded[rounded.length - 1] ?? step * 3;\n const snap = (v: number) => Math.max(step, Math.round(v / step) * step);\n elementGapPx = snap(median);\n result.spacing = {\n pagePadding: `${snap(Math.min(max, step * 8))}px`,\n elementGap: `${elementGapPx}px`,\n };\n }\n\n // --- borders / corner character -----------------------------------------\n\n let radiusPx = 0;\n if (radii.length > 0) {\n const counts = new Map<number, number>();\n for (const r of radii) counts.set(r, (counts.get(r) ?? 0) + 1);\n radiusPx = Array.from(counts.entries()).sort(\n (a, b) => b[1] - a[1] || a[0] - b[0],\n )[0]![0];\n result.borders = { radius: `${radiusPx}px`, accentWidth: \"2px\" };\n }\n\n // --- gradients + elevation into customCSS -------------------------------\n\n // Rank by colorfulness first: a saturated brand gradient should beat the\n // big black/white scrim overlays that dominate by area in marketing files.\n const gradientColorfulness = (key: string): number => {\n const parts = key.split(\":\")[1]?.split(\"|\") ?? [];\n let s = 0;\n for (const p of parts) {\n // Each part is \"<hex>@<pos>\" — score on the hex.\n const hex = p.split(\"@\")[0]?.trim() ?? \"\";\n if (/^#[0-9a-f]{6}$/i.test(hex)) s += saturation(hex);\n }\n return s;\n };\n const topGradients = Array.from(gradientStats.values())\n .sort(\n (a, b) =>\n gradientColorfulness(b.key) - gradientColorfulness(a.key) ||\n b.area - a.area ||\n b.count - a.count,\n )\n .slice(0, 4);\n if (topGradients.length > 0) {\n result.gradients = topGradients.map((g) => g.css);\n }\n\n const cssVars: string[] = [];\n topGradients.forEach((g, i) => {\n cssVars.push(` --gradient-${i === 0 ? \"brand\" : i}: ${g.css};`);\n });\n const uniqueShadows = Array.from(new Set(shadows)).slice(0, 6);\n uniqueShadows.forEach((s, i) => {\n cssVars.push(` --shadow-${i + 1}: ${s};`);\n });\n if (cssVars.length > 0) {\n result.customCSS = `:root {\\n${cssVars.join(\"\\n\")}\\n}`;\n }\n\n // --- defaults -----------------------------------------------------------\n\n const bgHex = roles?.background;\n const isDark = bgHex ? luminance(bgHex) < 0.4 : false;\n const labelStyle: BrandKitDefaults[\"labelStyle\"] =\n smallTextSamples >= 3 && upperLabelHits / smallTextSamples > 0.4\n ? \"uppercase\"\n : \"none\";\n result.defaults = {\n background: isDark ? \"dark\" : \"light\",\n labelStyle,\n };\n\n // --- synthesize the brand brief + imagery hint --------------------------\n\n const brief = synthesizeBrandBrief({\n roles,\n isDark,\n saturatedCount: palette.filter((c) => saturation(c.hex) > 0.2).length,\n gradients: result.gradients ?? [],\n typo,\n elementGapPx,\n radiusPx,\n hasShadows: uniqueShadows.length > 0,\n labelStyle,\n namedStyleCount: styleNames.size,\n });\n if (brief.instructions) result.customInstructions = brief.instructions;\n if (brief.imageryDescription) {\n result.imageStyle = {\n referenceUrls: [],\n styleDescription: brief.imageryDescription,\n };\n }\n\n result.notes = `Imported from a Figma .fig file — ${nodes.length.toLocaleString()} nodes, ${styleNames.size} named styles${\n result.gradients ? `, ${result.gradients.length} signature gradient(s)` : \"\"\n }. Tokens + brand brief were auto-extracted and are editable.`;\n\n return result;\n}\n\n// --- brand brief synthesis ------------------------------------------------\n\nfunction synthesizeBrandBrief(input: {\n roles: BrandKitData[\"colors\"] | null;\n isDark: boolean;\n saturatedCount: number;\n gradients: string[];\n typo: {\n headingStat: TextStat;\n bodyStat: TextStat;\n headingWeight: number;\n bodyWeight: number;\n h1: number;\n body: number;\n headingTracking: number;\n } | null;\n elementGapPx: number;\n radiusPx: number;\n hasShadows: boolean;\n labelStyle: string;\n namedStyleCount: number;\n}): { instructions: string; imageryDescription: string } {\n const lines: string[] = [];\n const adjectives: string[] = [];\n\n // Theme + color character.\n if (input.roles) {\n const theme = input.isDark ? \"dark-first\" : \"light/airy\";\n adjectives.push(input.isDark ? \"dark\" : \"bright\");\n const colorChar =\n input.saturatedCount <= 1\n ? \"restrained and largely monochromatic\"\n : input.saturatedCount <= 3\n ? \"focused — a tight palette with one or two signature hues\"\n : \"expressive and multi-color\";\n adjectives.push(input.saturatedCount <= 1 ? \"minimal\" : \"vivid\");\n lines.push(\n `Palette: ${theme}, ${colorChar}. The signature accent is ${hueName(\n input.roles.accent,\n )} (${input.roles.accent}); background ${input.roles.background}, text ${\n input.roles.text\n }. Use the exact token colors above for every surface — never hardcode off-brand colors.`,\n );\n }\n\n // Signature gradient — usually the single most recognizable brand element.\n if (input.gradients.length > 0) {\n adjectives.push(\"gradient-forward\");\n lines.push(\n `Signature gradient(s) are core to this brand — lead with them on hero backgrounds, primary buttons, and accents (available as \\`--gradient-brand\\` in customCSS): ${input.gradients\n .slice(0, 2)\n .join(\" • \")}.`,\n );\n }\n\n // Typography personality.\n if (input.typo) {\n const hw = weightWord(input.typo.headingWeight);\n const ratio = input.typo.body > 0 ? input.typo.h1 / input.typo.body : 2;\n const scaleChar =\n ratio >= 3\n ? \"a dramatic, oversized display scale\"\n : ratio >= 2\n ? \"a confident, clear type scale\"\n : \"a restrained, editorial scale\";\n adjectives.push(input.typo.headingWeight >= 700 ? \"bold\" : \"refined\");\n const tracking =\n input.typo.headingTracking <= -0.02\n ? \" with tight, negative letter-spacing on headings\"\n : input.typo.headingTracking >= 0.04\n ? \" with wide, airy letter-spacing on headings\"\n : \"\";\n lines.push(\n `Typography: headings in ${input.typo.headingStat.family} (${hw}, ~${input.typo.h1}px at the top of ${scaleChar})${tracking}; body in ${input.typo.bodyStat.family} (~${input.typo.body}px). Load these exact families from Google Fonts and honor the weight contrast.`,\n );\n }\n\n // Spacing rhythm.\n if (input.elementGapPx > 0) {\n const dense = input.elementGapPx <= 12;\n adjectives.push(dense ? \"compact\" : \"spacious\");\n lines.push(\n `Density: ${dense ? \"tight and information-dense\" : \"generous, with confident whitespace\"} — typical element gap ~${input.elementGapPx}px. Keep that rhythm consistent.`,\n );\n }\n\n // Corner language.\n if (input.radiusPx >= 0 && (input.radiusPx > 0 || input.roles)) {\n const corner =\n input.radiusPx <= 4\n ? \"sharp, squared corners (precise / technical)\"\n : input.radiusPx <= 12\n ? \"softly rounded corners\"\n : input.radiusPx <= 22\n ? \"noticeably rounded, friendly corners\"\n : \"very round, pill-like corners\";\n adjectives.push(input.radiusPx <= 4 ? \"precise\" : \"approachable\");\n lines.push(\n `Corner language: ${corner} (~${input.radiusPx}px). Apply it consistently to cards, buttons, and inputs.`,\n );\n }\n\n // Elevation.\n if (input.hasShadows) {\n adjectives.push(\"layered\");\n lines.push(\n `Depth: uses layered, soft shadows (see \\`--shadow-*\\` tokens) — favor subtle elevation over hard borders.`,\n );\n } else {\n lines.push(\n `Depth: largely flat — prefer borders, tonal surfaces, and color over drop shadows.`,\n );\n }\n\n if (input.labelStyle === \"uppercase\") {\n lines.push(\n `Labels/eyebrows are set in UPPERCASE with letter-spacing — use that for small section labels.`,\n );\n }\n\n const character = Array.from(new Set(adjectives)).slice(0, 5).join(\", \");\n const header = character\n ? `This brand reads as: ${character}. Generate every design so it feels unmistakably on-brand — a stranger should recognize it as the same brand as the source.`\n : `Generate designs that match the extracted tokens precisely so output stays on-brand.`;\n\n const instructions = [header, \"\", ...lines].join(\"\\n\");\n\n const imageryDescription = input.roles\n ? `${input.isDark ? \"Dark, high-contrast\" : \"Bright, clean\"} brand imagery; ${\n input.gradients.length > 0\n ? \"lean on the signature gradient and bold color\"\n : \"lean on confident color blocking and whitespace\"\n }. Avoid generic stock-photo clichés and off-brand color.`\n : \"\";\n\n return { instructions, imageryDescription };\n}\n\n/** Linear blend of two hex colors. `t` = weight of `a` (0..1). */\nfunction mixHex(a: string, b: string, t: number): string {\n const ca = hexToRgb(a);\n const cb = hexToRgb(b);\n if (!ca || !cb) return a;\n const mix = (x: number, y: number) => clamp255(x * t + y * (1 - t));\n const hex = (n: number) => n.toString(16).padStart(2, \"0\");\n return `#${hex(mix(ca.r, cb.r))}${hex(mix(ca.g, cb.g))}${hex(mix(ca.b, cb.b))}`;\n}\n"]}
@@ -1,246 +0,0 @@
1
- /**
2
- * Convert a decoded Figma document (NODE_CHANGES message) into one HTML
3
- * file per top-level frame. Each node renders as a <div> (or <span> for
4
- * TEXT) with an inline `style="..."` covering layout, background, border,
5
- * radius, shadows, blurs, text, transform, autolayout (flexbox), and
6
- * opacity/blend. Component instances are inlined and tagged with
7
- * data-component-name / data-variant-name / data-component-description /
8
- * data-component-doc-link / data-annotations attributes, matching the
9
- * figma-plugin smart-export conventions.
10
- */
11
- export interface Guid {
12
- sessionID: number;
13
- localID: number;
14
- }
15
- interface Color {
16
- r: number;
17
- g: number;
18
- b: number;
19
- a: number;
20
- }
21
- interface Paint {
22
- type?: string;
23
- color?: Color;
24
- opacity?: number;
25
- visible?: boolean;
26
- blendMode?: string;
27
- stops?: Array<{
28
- color: Color;
29
- position: number;
30
- }>;
31
- transform?: {
32
- m00: number;
33
- m01: number;
34
- m02: number;
35
- m10: number;
36
- m11: number;
37
- m12: number;
38
- };
39
- image?: {
40
- hash?: string | Uint8Array | number[];
41
- name?: string;
42
- };
43
- imageScaleMode?: string;
44
- rotation?: number;
45
- scale?: number;
46
- }
47
- interface Effect {
48
- type?: string;
49
- visible?: boolean;
50
- color?: Color;
51
- offset?: {
52
- x: number;
53
- y: number;
54
- };
55
- radius?: number;
56
- spread?: number;
57
- blendMode?: string;
58
- }
59
- interface Annotation {
60
- label?: string;
61
- labelV2?: string;
62
- properties?: unknown[];
63
- }
64
- interface ComponentPropDef {
65
- id?: Guid;
66
- name?: string;
67
- type?: string;
68
- }
69
- export interface FigNode {
70
- guid?: Guid;
71
- overrideKey?: Guid;
72
- parentIndex?: {
73
- guid?: Guid;
74
- position?: string;
75
- };
76
- type?: string;
77
- name?: string;
78
- description?: string;
79
- componentKey?: string;
80
- componentPropDefs?: ComponentPropDef[];
81
- componentPropAssignments?: unknown[];
82
- componentPropRefs?: unknown[];
83
- annotations?: Annotation[];
84
- isSymbolPublishable?: boolean;
85
- visible?: boolean;
86
- size?: {
87
- x: number;
88
- y: number;
89
- };
90
- transform?: {
91
- m00: number;
92
- m01: number;
93
- m02: number;
94
- m10: number;
95
- m11: number;
96
- m12: number;
97
- };
98
- fillPaints?: Paint[];
99
- strokePaints?: Paint[];
100
- styleIdForFill?: {
101
- guid?: Guid;
102
- assetRef?: {
103
- key?: string;
104
- version?: string;
105
- };
106
- };
107
- styleIdForStroke?: {
108
- guid?: Guid;
109
- assetRef?: {
110
- key?: string;
111
- version?: string;
112
- };
113
- };
114
- styleIdForText?: {
115
- guid?: Guid;
116
- assetRef?: {
117
- key?: string;
118
- version?: string;
119
- };
120
- };
121
- key?: string;
122
- styleType?: string;
123
- strokeWeight?: number;
124
- strokeAlign?: string;
125
- effects?: Effect[];
126
- opacity?: number;
127
- blendMode?: string;
128
- cornerRadius?: number;
129
- rectangleTopLeftCornerRadius?: number;
130
- rectangleTopRightCornerRadius?: number;
131
- rectangleBottomLeftCornerRadius?: number;
132
- rectangleBottomRightCornerRadius?: number;
133
- fontSize?: number;
134
- fontName?: {
135
- family?: string;
136
- style?: string;
137
- };
138
- letterSpacing?: {
139
- value: number;
140
- units?: string;
141
- };
142
- lineHeight?: {
143
- value: number;
144
- units?: string;
145
- };
146
- textAlignHorizontal?: string;
147
- textAlignVertical?: string;
148
- textData?: {
149
- characters?: string;
150
- };
151
- textAutoResize?: string;
152
- symbolData?: {
153
- symbolID?: Guid;
154
- symbolOverrides?: SymbolOverride[];
155
- };
156
- stackMode?: string;
157
- stackPrimaryAlignItems?: string;
158
- stackCounterAlignItems?: string;
159
- stackSpacing?: number;
160
- stackHorizontalPadding?: number;
161
- stackVerticalPadding?: number;
162
- stackPaddingLeft?: number;
163
- stackPaddingRight?: number;
164
- stackPaddingTop?: number;
165
- stackPaddingBottom?: number;
166
- stackPrimarySizing?: string;
167
- stackCounterSizing?: string;
168
- stackChildPrimaryGrow?: number;
169
- stackChildAlignSelf?: string;
170
- resizeToFit?: boolean;
171
- horizontalConstraint?: string;
172
- verticalConstraint?: string;
173
- frameMaskDisabled?: boolean;
174
- internalOnly?: boolean;
175
- fillGeometry?: Array<{
176
- commandsBlob?: number;
177
- windingRule?: string;
178
- styleID?: number;
179
- }>;
180
- strokeGeometry?: Array<{
181
- commandsBlob?: number;
182
- windingRule?: string;
183
- styleID?: number;
184
- }>;
185
- strokeJoin?: string;
186
- strokeCap?: string;
187
- strokeDashes?: number[];
188
- vectorData?: {
189
- normalizedSize?: {
190
- x: number;
191
- y: number;
192
- };
193
- vectorNetworkBlob?: number;
194
- };
195
- }
196
- export declare function guidKey(g: Guid | undefined): string;
197
- /**
198
- * A raw symbol override entry from `symbolData.symbolOverrides`. It is
199
- * effectively a partial NodeChange targeting a descendant of the master
200
- * symbol via `guidPath`. Any field present (other than `guidPath` and
201
- * `overriddenSymbolID`) is shallow-merged onto the descendant node when
202
- * it's emitted, so layout-affecting overrides like `size`, `textAutoResize`,
203
- * `stackChildAlignSelf`, `stackCounterSizing`, `textAlignVertical`, etc.
204
- * all flow through.
205
- */
206
- interface SymbolOverride extends Partial<FigNode> {
207
- overriddenSymbolID?: Guid;
208
- guidPath?: {
209
- guids?: Guid[];
210
- };
211
- }
212
- export interface RenderedFrame {
213
- pageName: string;
214
- pageDirName: string;
215
- frameName: string;
216
- /** Sanitized + de-duplicated filename including the `.html` extension. */
217
- fileName: string;
218
- /** Path relative to the render root, e.g. `page-1/login.html`. */
219
- relativePath: string;
220
- html: string;
221
- }
222
- export interface RenderHtmlResult {
223
- pageCount: number;
224
- frameCount: number;
225
- frames: RenderedFrame[];
226
- }
227
- export interface RenderHtmlOptions {
228
- /** Optional prefix for image url() references (default: "../images") */
229
- imageRefBase?: string;
230
- /** Pre-built `hash -> filename` map for image references. */
231
- imageMap?: Map<string, string>;
232
- /*** Optional set of page (CANVAS) and/or frame GUID keys */
233
- selection?: Set<string>;
234
- }
235
- /**
236
- * Collect the renderable top-level units on a page. Figma allows SECTION
237
- * nodes (and nested sections) to wrap frames; sections are organizational
238
- * containers, not standalone designs, so we recurse THROUGH them and
239
- * collect the frames inside. Anything that isn't a SECTION or a
240
- * renderable type is ignored. Children are returned in document order
241
- * (depth-first across sections).
242
- */
243
- export declare function collectTopLevelFrames(parent: FigNode, childrenOf: Map<string, FigNode[]>): FigNode[];
244
- export declare function renderHtmlTemplates(document: unknown, options?: RenderHtmlOptions): RenderHtmlResult;
245
- export {};
246
- //# sourceMappingURL=fig-to-html.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fig-to-html.d.ts","sourceRoot":"","sources":["../../../src/brand-kit/fig/fig-to-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAA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