@agent-native/core 0.79.26 → 0.80.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 (2322) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +39 -0
  3. package/corpus/core/docs/content/a2a-protocol.mdx +97 -9
  4. package/corpus/core/docs/content/actions.mdx +65 -4
  5. package/corpus/core/docs/content/agent-mentions.mdx +68 -4
  6. package/corpus/core/docs/content/agent-surfaces.mdx +112 -8
  7. package/corpus/core/docs/content/agent-teams.mdx +171 -12
  8. package/corpus/core/docs/content/agent-web-surfaces.mdx +51 -4
  9. package/corpus/core/docs/content/authentication.mdx +122 -8
  10. package/corpus/core/docs/content/automations.mdx +110 -8
  11. package/corpus/core/docs/content/blueprint-installer.mdx +42 -4
  12. package/corpus/core/docs/content/cli-adapters.mdx +44 -4
  13. package/corpus/core/docs/content/client.mdx +79 -8
  14. package/corpus/core/docs/content/cloneable-saas.mdx +85 -8
  15. package/corpus/core/docs/content/code-agents-ui.mdx +98 -8
  16. package/corpus/core/docs/content/components.mdx +118 -8
  17. package/corpus/core/docs/content/context-awareness.mdx +98 -8
  18. package/corpus/core/docs/content/creating-templates.mdx +49 -4
  19. package/corpus/core/docs/content/cross-app-sso.mdx +109 -8
  20. package/corpus/core/docs/content/database.mdx +56 -4
  21. package/corpus/core/docs/content/deployment.mdx +103 -8
  22. package/corpus/core/docs/content/dispatch.mdx +134 -8
  23. package/corpus/core/docs/content/drop-in-agent.mdx +63 -4
  24. package/corpus/core/docs/content/durable-background-runs.mdx +98 -8
  25. package/corpus/core/docs/content/durable-resume.mdx +47 -4
  26. package/corpus/core/docs/content/embedding-sdk.mdx +83 -8
  27. package/corpus/core/docs/content/evals.mdx +102 -8
  28. package/corpus/core/docs/content/extensions.mdx +113 -9
  29. package/corpus/core/docs/content/external-agents.mdx +119 -8
  30. package/corpus/core/docs/content/faq.mdx +98 -8
  31. package/corpus/core/docs/content/file-uploads.mdx +61 -4
  32. package/corpus/core/docs/content/frames.mdx +90 -8
  33. package/corpus/core/docs/content/generative-ui.mdx +50 -4
  34. package/corpus/core/docs/content/getting-started.mdx +34 -4
  35. package/corpus/core/docs/content/harness-agents.mdx +77 -8
  36. package/corpus/core/docs/content/human-approval.mdx +50 -4
  37. package/corpus/core/docs/content/key-concepts.mdx +102 -8
  38. package/corpus/core/docs/content/local-file-mode.mdx +58 -4
  39. package/corpus/core/docs/content/locales/ar-SA/a2a-protocol.mdx +97 -9
  40. package/corpus/core/docs/content/locales/ar-SA/actions.mdx +65 -4
  41. package/corpus/core/docs/content/locales/ar-SA/agent-mentions.mdx +68 -4
  42. package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +114 -8
  43. package/corpus/core/docs/content/locales/ar-SA/agent-teams.mdx +174 -12
  44. package/corpus/core/docs/content/locales/ar-SA/agent-web-surfaces.mdx +49 -4
  45. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +120 -8
  46. package/corpus/core/docs/content/locales/ar-SA/automations.mdx +110 -8
  47. package/corpus/core/docs/content/locales/ar-SA/blueprint-installer.mdx +42 -4
  48. package/corpus/core/docs/content/locales/ar-SA/cli-adapters.mdx +40 -4
  49. package/corpus/core/docs/content/locales/ar-SA/client.mdx +80 -8
  50. package/corpus/core/docs/content/locales/ar-SA/cloneable-saas.mdx +85 -8
  51. package/corpus/core/docs/content/locales/ar-SA/code-agents-ui.mdx +99 -8
  52. package/corpus/core/docs/content/locales/ar-SA/components.mdx +114 -8
  53. package/corpus/core/docs/content/locales/ar-SA/context-awareness.mdx +100 -8
  54. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +51 -4
  55. package/corpus/core/docs/content/locales/ar-SA/cross-app-sso.mdx +109 -8
  56. package/corpus/core/docs/content/locales/ar-SA/database.mdx +52 -4
  57. package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +103 -8
  58. package/corpus/core/docs/content/locales/ar-SA/dispatch.mdx +134 -8
  59. package/corpus/core/docs/content/locales/ar-SA/drop-in-agent.mdx +63 -4
  60. package/corpus/core/docs/content/locales/ar-SA/durable-resume.mdx +47 -4
  61. package/corpus/core/docs/content/locales/ar-SA/embedding-sdk.mdx +83 -8
  62. package/corpus/core/docs/content/locales/ar-SA/evals.mdx +102 -8
  63. package/corpus/core/docs/content/locales/ar-SA/extensions.mdx +113 -9
  64. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +119 -8
  65. package/corpus/core/docs/content/locales/ar-SA/faq.mdx +98 -8
  66. package/corpus/core/docs/content/locales/ar-SA/file-uploads.mdx +61 -4
  67. package/corpus/core/docs/content/locales/ar-SA/frames.mdx +88 -8
  68. package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +34 -4
  69. package/corpus/core/docs/content/locales/ar-SA/harness-agents.mdx +79 -8
  70. package/corpus/core/docs/content/locales/ar-SA/human-approval.mdx +50 -4
  71. package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +107 -8
  72. package/corpus/core/docs/content/locales/ar-SA/local-file-mode.mdx +56 -4
  73. package/corpus/core/docs/content/locales/ar-SA/mcp-apps.mdx +120 -10
  74. package/corpus/core/docs/content/locales/ar-SA/mcp-clients.mdx +133 -8
  75. package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +105 -8
  76. package/corpus/core/docs/content/locales/ar-SA/messaging.mdx +115 -8
  77. package/corpus/core/docs/content/locales/ar-SA/migration-workbench.mdx +47 -4
  78. package/corpus/core/docs/content/locales/ar-SA/multi-app-workspace.mdx +91 -8
  79. package/corpus/core/docs/content/locales/ar-SA/multi-tenancy.mdx +80 -8
  80. package/corpus/core/docs/content/locales/ar-SA/native-chat-ui.mdx +104 -8
  81. package/corpus/core/docs/content/locales/ar-SA/notifications.mdx +135 -8
  82. package/corpus/core/docs/content/locales/ar-SA/observability.mdx +102 -8
  83. package/corpus/core/docs/content/locales/ar-SA/observational-memory.mdx +87 -8
  84. package/corpus/core/docs/content/locales/ar-SA/onboarding.mdx +45 -4
  85. package/corpus/core/docs/content/locales/ar-SA/plan-plugin.mdx +99 -8
  86. package/corpus/core/docs/content/locales/ar-SA/pr-visual-recap.mdx +125 -8
  87. package/corpus/core/docs/content/locales/ar-SA/processors.mdx +41 -4
  88. package/corpus/core/docs/content/locales/ar-SA/progress.mdx +46 -4
  89. package/corpus/core/docs/content/locales/ar-SA/pure-agent-apps.mdx +48 -4
  90. package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +102 -8
  91. package/corpus/core/docs/content/locales/ar-SA/recurring-jobs.mdx +59 -4
  92. package/corpus/core/docs/content/locales/ar-SA/routing.mdx +44 -5
  93. package/corpus/core/docs/content/locales/ar-SA/sandbox-adapters.mdx +43 -4
  94. package/corpus/core/docs/content/locales/ar-SA/security.mdx +80 -8
  95. package/corpus/core/docs/content/locales/ar-SA/server.mdx +173 -12
  96. package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +45 -4
  97. package/corpus/core/docs/content/locales/ar-SA/skills-guide.mdx +118 -9
  98. package/corpus/core/docs/content/locales/ar-SA/template-analytics.mdx +46 -4
  99. package/corpus/core/docs/content/locales/ar-SA/template-assets.mdx +62 -4
  100. package/corpus/core/docs/content/locales/ar-SA/template-brain.mdx +65 -4
  101. package/corpus/core/docs/content/locales/ar-SA/template-calendar.mdx +62 -4
  102. package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +61 -4
  103. package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +52 -4
  104. package/corpus/core/docs/content/locales/ar-SA/template-content.mdx +62 -4
  105. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +101 -4
  106. package/corpus/core/docs/content/locales/ar-SA/template-dispatch.mdx +57 -4
  107. package/corpus/core/docs/content/locales/ar-SA/template-forms.mdx +62 -4
  108. package/corpus/core/docs/content/locales/ar-SA/template-mail.mdx +60 -4
  109. package/corpus/core/docs/content/locales/ar-SA/template-plan.mdx +61 -4
  110. package/corpus/core/docs/content/locales/ar-SA/template-slides.mdx +49 -4
  111. package/corpus/core/docs/content/locales/ar-SA/template-videos.mdx +53 -4
  112. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +54 -4
  113. package/corpus/core/docs/content/locales/ar-SA/using-your-agent.mdx +51 -4
  114. package/corpus/core/docs/content/locales/ar-SA/voice-input.mdx +43 -4
  115. package/corpus/core/docs/content/locales/ar-SA/what-is-agent-native.mdx +96 -8
  116. package/corpus/core/docs/content/locales/ar-SA/workspace-connections.mdx +128 -8
  117. package/corpus/core/docs/content/locales/ar-SA/workspace-management.mdx +50 -4
  118. package/corpus/core/docs/content/locales/ar-SA/workspace.mdx +112 -8
  119. package/corpus/core/docs/content/locales/ar-SA/writing-agent-instructions.mdx +41 -4
  120. package/corpus/core/docs/content/locales/de-DE/a2a-protocol.mdx +99 -9
  121. package/corpus/core/docs/content/locales/de-DE/actions.mdx +67 -4
  122. package/corpus/core/docs/content/locales/de-DE/agent-mentions.mdx +68 -4
  123. package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +116 -8
  124. package/corpus/core/docs/content/locales/de-DE/agent-teams.mdx +171 -12
  125. package/corpus/core/docs/content/locales/de-DE/agent-web-surfaces.mdx +51 -4
  126. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +122 -8
  127. package/corpus/core/docs/content/locales/de-DE/automations.mdx +110 -8
  128. package/corpus/core/docs/content/locales/de-DE/blueprint-installer.mdx +42 -4
  129. package/corpus/core/docs/content/locales/de-DE/cli-adapters.mdx +44 -4
  130. package/corpus/core/docs/content/locales/de-DE/client.mdx +79 -8
  131. package/corpus/core/docs/content/locales/de-DE/cloneable-saas.mdx +85 -8
  132. package/corpus/core/docs/content/locales/de-DE/code-agents-ui.mdx +100 -8
  133. package/corpus/core/docs/content/locales/de-DE/components.mdx +118 -8
  134. package/corpus/core/docs/content/locales/de-DE/context-awareness.mdx +98 -8
  135. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +51 -4
  136. package/corpus/core/docs/content/locales/de-DE/cross-app-sso.mdx +109 -8
  137. package/corpus/core/docs/content/locales/de-DE/database.mdx +52 -4
  138. package/corpus/core/docs/content/locales/de-DE/deployment.mdx +103 -8
  139. package/corpus/core/docs/content/locales/de-DE/dispatch.mdx +134 -8
  140. package/corpus/core/docs/content/locales/de-DE/drop-in-agent.mdx +63 -4
  141. package/corpus/core/docs/content/locales/de-DE/durable-resume.mdx +47 -4
  142. package/corpus/core/docs/content/locales/de-DE/embedding-sdk.mdx +85 -8
  143. package/corpus/core/docs/content/locales/de-DE/evals.mdx +102 -8
  144. package/corpus/core/docs/content/locales/de-DE/extensions.mdx +113 -9
  145. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +119 -8
  146. package/corpus/core/docs/content/locales/de-DE/faq.mdx +98 -8
  147. package/corpus/core/docs/content/locales/de-DE/file-uploads.mdx +61 -4
  148. package/corpus/core/docs/content/locales/de-DE/frames.mdx +88 -8
  149. package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +34 -4
  150. package/corpus/core/docs/content/locales/de-DE/harness-agents.mdx +79 -8
  151. package/corpus/core/docs/content/locales/de-DE/human-approval.mdx +50 -4
  152. package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +104 -8
  153. package/corpus/core/docs/content/locales/de-DE/local-file-mode.mdx +58 -4
  154. package/corpus/core/docs/content/locales/de-DE/mcp-apps.mdx +120 -10
  155. package/corpus/core/docs/content/locales/de-DE/mcp-clients.mdx +133 -8
  156. package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +105 -8
  157. package/corpus/core/docs/content/locales/de-DE/messaging.mdx +115 -8
  158. package/corpus/core/docs/content/locales/de-DE/migration-workbench.mdx +47 -4
  159. package/corpus/core/docs/content/locales/de-DE/multi-app-workspace.mdx +91 -8
  160. package/corpus/core/docs/content/locales/de-DE/multi-tenancy.mdx +80 -8
  161. package/corpus/core/docs/content/locales/de-DE/native-chat-ui.mdx +108 -8
  162. package/corpus/core/docs/content/locales/de-DE/notifications.mdx +135 -8
  163. package/corpus/core/docs/content/locales/de-DE/observability.mdx +102 -8
  164. package/corpus/core/docs/content/locales/de-DE/observational-memory.mdx +92 -8
  165. package/corpus/core/docs/content/locales/de-DE/onboarding.mdx +45 -4
  166. package/corpus/core/docs/content/locales/de-DE/plan-plugin.mdx +99 -8
  167. package/corpus/core/docs/content/locales/de-DE/pr-visual-recap.mdx +125 -8
  168. package/corpus/core/docs/content/locales/de-DE/processors.mdx +41 -4
  169. package/corpus/core/docs/content/locales/de-DE/progress.mdx +46 -4
  170. package/corpus/core/docs/content/locales/de-DE/pure-agent-apps.mdx +50 -4
  171. package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +104 -8
  172. package/corpus/core/docs/content/locales/de-DE/recurring-jobs.mdx +59 -4
  173. package/corpus/core/docs/content/locales/de-DE/routing.mdx +44 -5
  174. package/corpus/core/docs/content/locales/de-DE/sandbox-adapters.mdx +43 -4
  175. package/corpus/core/docs/content/locales/de-DE/security.mdx +80 -8
  176. package/corpus/core/docs/content/locales/de-DE/server.mdx +171 -12
  177. package/corpus/core/docs/content/locales/de-DE/sharing.mdx +45 -4
  178. package/corpus/core/docs/content/locales/de-DE/skills-guide.mdx +118 -9
  179. package/corpus/core/docs/content/locales/de-DE/template-analytics.mdx +46 -4
  180. package/corpus/core/docs/content/locales/de-DE/template-assets.mdx +62 -4
  181. package/corpus/core/docs/content/locales/de-DE/template-brain.mdx +69 -4
  182. package/corpus/core/docs/content/locales/de-DE/template-calendar.mdx +62 -4
  183. package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +61 -4
  184. package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +52 -4
  185. package/corpus/core/docs/content/locales/de-DE/template-content.mdx +60 -4
  186. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +109 -4
  187. package/corpus/core/docs/content/locales/de-DE/template-dispatch.mdx +57 -4
  188. package/corpus/core/docs/content/locales/de-DE/template-forms.mdx +64 -4
  189. package/corpus/core/docs/content/locales/de-DE/template-mail.mdx +60 -4
  190. package/corpus/core/docs/content/locales/de-DE/template-plan.mdx +63 -4
  191. package/corpus/core/docs/content/locales/de-DE/template-slides.mdx +49 -4
  192. package/corpus/core/docs/content/locales/de-DE/template-videos.mdx +53 -4
  193. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +54 -4
  194. package/corpus/core/docs/content/locales/de-DE/using-your-agent.mdx +51 -4
  195. package/corpus/core/docs/content/locales/de-DE/voice-input.mdx +45 -4
  196. package/corpus/core/docs/content/locales/de-DE/what-is-agent-native.mdx +100 -8
  197. package/corpus/core/docs/content/locales/de-DE/workspace-connections.mdx +128 -8
  198. package/corpus/core/docs/content/locales/de-DE/workspace-management.mdx +50 -4
  199. package/corpus/core/docs/content/locales/de-DE/workspace.mdx +111 -8
  200. package/corpus/core/docs/content/locales/de-DE/writing-agent-instructions.mdx +45 -4
  201. package/corpus/core/docs/content/locales/es-ES/a2a-protocol.mdx +99 -9
  202. package/corpus/core/docs/content/locales/es-ES/actions.mdx +67 -4
  203. package/corpus/core/docs/content/locales/es-ES/agent-mentions.mdx +68 -4
  204. package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +120 -8
  205. package/corpus/core/docs/content/locales/es-ES/agent-teams.mdx +172 -12
  206. package/corpus/core/docs/content/locales/es-ES/agent-web-surfaces.mdx +51 -4
  207. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +122 -8
  208. package/corpus/core/docs/content/locales/es-ES/automations.mdx +110 -8
  209. package/corpus/core/docs/content/locales/es-ES/blueprint-installer.mdx +42 -4
  210. package/corpus/core/docs/content/locales/es-ES/cli-adapters.mdx +44 -4
  211. package/corpus/core/docs/content/locales/es-ES/client.mdx +79 -8
  212. package/corpus/core/docs/content/locales/es-ES/cloneable-saas.mdx +85 -8
  213. package/corpus/core/docs/content/locales/es-ES/code-agents-ui.mdx +101 -8
  214. package/corpus/core/docs/content/locales/es-ES/components.mdx +118 -8
  215. package/corpus/core/docs/content/locales/es-ES/context-awareness.mdx +98 -8
  216. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +51 -4
  217. package/corpus/core/docs/content/locales/es-ES/cross-app-sso.mdx +109 -8
  218. package/corpus/core/docs/content/locales/es-ES/database.mdx +52 -4
  219. package/corpus/core/docs/content/locales/es-ES/deployment.mdx +103 -8
  220. package/corpus/core/docs/content/locales/es-ES/dispatch.mdx +134 -8
  221. package/corpus/core/docs/content/locales/es-ES/drop-in-agent.mdx +63 -4
  222. package/corpus/core/docs/content/locales/es-ES/durable-resume.mdx +47 -4
  223. package/corpus/core/docs/content/locales/es-ES/embedding-sdk.mdx +87 -8
  224. package/corpus/core/docs/content/locales/es-ES/evals.mdx +102 -8
  225. package/corpus/core/docs/content/locales/es-ES/extensions.mdx +113 -9
  226. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +119 -8
  227. package/corpus/core/docs/content/locales/es-ES/faq.mdx +98 -8
  228. package/corpus/core/docs/content/locales/es-ES/file-uploads.mdx +61 -4
  229. package/corpus/core/docs/content/locales/es-ES/frames.mdx +88 -8
  230. package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +34 -4
  231. package/corpus/core/docs/content/locales/es-ES/harness-agents.mdx +79 -8
  232. package/corpus/core/docs/content/locales/es-ES/human-approval.mdx +50 -4
  233. package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +104 -8
  234. package/corpus/core/docs/content/locales/es-ES/local-file-mode.mdx +60 -4
  235. package/corpus/core/docs/content/locales/es-ES/mcp-apps.mdx +120 -10
  236. package/corpus/core/docs/content/locales/es-ES/mcp-clients.mdx +135 -8
  237. package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +105 -8
  238. package/corpus/core/docs/content/locales/es-ES/messaging.mdx +115 -8
  239. package/corpus/core/docs/content/locales/es-ES/migration-workbench.mdx +47 -4
  240. package/corpus/core/docs/content/locales/es-ES/multi-app-workspace.mdx +91 -8
  241. package/corpus/core/docs/content/locales/es-ES/multi-tenancy.mdx +80 -8
  242. package/corpus/core/docs/content/locales/es-ES/native-chat-ui.mdx +108 -8
  243. package/corpus/core/docs/content/locales/es-ES/notifications.mdx +135 -8
  244. package/corpus/core/docs/content/locales/es-ES/observability.mdx +104 -8
  245. package/corpus/core/docs/content/locales/es-ES/observational-memory.mdx +92 -8
  246. package/corpus/core/docs/content/locales/es-ES/onboarding.mdx +45 -4
  247. package/corpus/core/docs/content/locales/es-ES/plan-plugin.mdx +99 -8
  248. package/corpus/core/docs/content/locales/es-ES/pr-visual-recap.mdx +125 -8
  249. package/corpus/core/docs/content/locales/es-ES/processors.mdx +41 -4
  250. package/corpus/core/docs/content/locales/es-ES/progress.mdx +46 -4
  251. package/corpus/core/docs/content/locales/es-ES/pure-agent-apps.mdx +50 -4
  252. package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +109 -8
  253. package/corpus/core/docs/content/locales/es-ES/recurring-jobs.mdx +59 -4
  254. package/corpus/core/docs/content/locales/es-ES/routing.mdx +44 -5
  255. package/corpus/core/docs/content/locales/es-ES/sandbox-adapters.mdx +44 -4
  256. package/corpus/core/docs/content/locales/es-ES/security.mdx +82 -8
  257. package/corpus/core/docs/content/locales/es-ES/server.mdx +173 -12
  258. package/corpus/core/docs/content/locales/es-ES/sharing.mdx +45 -4
  259. package/corpus/core/docs/content/locales/es-ES/skills-guide.mdx +118 -9
  260. package/corpus/core/docs/content/locales/es-ES/template-analytics.mdx +46 -4
  261. package/corpus/core/docs/content/locales/es-ES/template-assets.mdx +64 -4
  262. package/corpus/core/docs/content/locales/es-ES/template-brain.mdx +69 -4
  263. package/corpus/core/docs/content/locales/es-ES/template-calendar.mdx +62 -4
  264. package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +61 -4
  265. package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +52 -4
  266. package/corpus/core/docs/content/locales/es-ES/template-content.mdx +64 -4
  267. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +108 -4
  268. package/corpus/core/docs/content/locales/es-ES/template-dispatch.mdx +57 -4
  269. package/corpus/core/docs/content/locales/es-ES/template-forms.mdx +64 -4
  270. package/corpus/core/docs/content/locales/es-ES/template-mail.mdx +60 -4
  271. package/corpus/core/docs/content/locales/es-ES/template-plan.mdx +61 -4
  272. package/corpus/core/docs/content/locales/es-ES/template-slides.mdx +49 -4
  273. package/corpus/core/docs/content/locales/es-ES/template-videos.mdx +53 -4
  274. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +54 -4
  275. package/corpus/core/docs/content/locales/es-ES/using-your-agent.mdx +51 -4
  276. package/corpus/core/docs/content/locales/es-ES/voice-input.mdx +45 -4
  277. package/corpus/core/docs/content/locales/es-ES/what-is-agent-native.mdx +99 -8
  278. package/corpus/core/docs/content/locales/es-ES/workspace-connections.mdx +128 -8
  279. package/corpus/core/docs/content/locales/es-ES/workspace-management.mdx +50 -4
  280. package/corpus/core/docs/content/locales/es-ES/workspace.mdx +112 -8
  281. package/corpus/core/docs/content/locales/es-ES/writing-agent-instructions.mdx +46 -4
  282. package/corpus/core/docs/content/locales/fr-FR/a2a-protocol.mdx +97 -9
  283. package/corpus/core/docs/content/locales/fr-FR/actions.mdx +67 -4
  284. package/corpus/core/docs/content/locales/fr-FR/agent-mentions.mdx +68 -4
  285. package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +118 -8
  286. package/corpus/core/docs/content/locales/fr-FR/agent-teams.mdx +172 -12
  287. package/corpus/core/docs/content/locales/fr-FR/agent-web-surfaces.mdx +51 -4
  288. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +122 -8
  289. package/corpus/core/docs/content/locales/fr-FR/automations.mdx +110 -8
  290. package/corpus/core/docs/content/locales/fr-FR/blueprint-installer.mdx +42 -4
  291. package/corpus/core/docs/content/locales/fr-FR/cli-adapters.mdx +44 -4
  292. package/corpus/core/docs/content/locales/fr-FR/client.mdx +81 -8
  293. package/corpus/core/docs/content/locales/fr-FR/cloneable-saas.mdx +85 -8
  294. package/corpus/core/docs/content/locales/fr-FR/code-agents-ui.mdx +102 -8
  295. package/corpus/core/docs/content/locales/fr-FR/components.mdx +118 -8
  296. package/corpus/core/docs/content/locales/fr-FR/context-awareness.mdx +98 -8
  297. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +49 -4
  298. package/corpus/core/docs/content/locales/fr-FR/cross-app-sso.mdx +109 -8
  299. package/corpus/core/docs/content/locales/fr-FR/database.mdx +52 -4
  300. package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +103 -8
  301. package/corpus/core/docs/content/locales/fr-FR/dispatch.mdx +134 -8
  302. package/corpus/core/docs/content/locales/fr-FR/drop-in-agent.mdx +63 -4
  303. package/corpus/core/docs/content/locales/fr-FR/durable-resume.mdx +47 -4
  304. package/corpus/core/docs/content/locales/fr-FR/embedding-sdk.mdx +87 -8
  305. package/corpus/core/docs/content/locales/fr-FR/evals.mdx +102 -8
  306. package/corpus/core/docs/content/locales/fr-FR/extensions.mdx +113 -9
  307. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +119 -8
  308. package/corpus/core/docs/content/locales/fr-FR/faq.mdx +98 -8
  309. package/corpus/core/docs/content/locales/fr-FR/file-uploads.mdx +61 -4
  310. package/corpus/core/docs/content/locales/fr-FR/frames.mdx +90 -8
  311. package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +34 -4
  312. package/corpus/core/docs/content/locales/fr-FR/harness-agents.mdx +77 -8
  313. package/corpus/core/docs/content/locales/fr-FR/human-approval.mdx +50 -4
  314. package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +106 -8
  315. package/corpus/core/docs/content/locales/fr-FR/local-file-mode.mdx +58 -4
  316. package/corpus/core/docs/content/locales/fr-FR/mcp-apps.mdx +120 -10
  317. package/corpus/core/docs/content/locales/fr-FR/mcp-clients.mdx +135 -8
  318. package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +105 -8
  319. package/corpus/core/docs/content/locales/fr-FR/messaging.mdx +115 -8
  320. package/corpus/core/docs/content/locales/fr-FR/migration-workbench.mdx +47 -4
  321. package/corpus/core/docs/content/locales/fr-FR/multi-app-workspace.mdx +91 -8
  322. package/corpus/core/docs/content/locales/fr-FR/multi-tenancy.mdx +80 -8
  323. package/corpus/core/docs/content/locales/fr-FR/native-chat-ui.mdx +108 -8
  324. package/corpus/core/docs/content/locales/fr-FR/notifications.mdx +135 -8
  325. package/corpus/core/docs/content/locales/fr-FR/observability.mdx +104 -8
  326. package/corpus/core/docs/content/locales/fr-FR/observational-memory.mdx +89 -8
  327. package/corpus/core/docs/content/locales/fr-FR/onboarding.mdx +45 -4
  328. package/corpus/core/docs/content/locales/fr-FR/plan-plugin.mdx +99 -8
  329. package/corpus/core/docs/content/locales/fr-FR/pr-visual-recap.mdx +126 -8
  330. package/corpus/core/docs/content/locales/fr-FR/processors.mdx +41 -4
  331. package/corpus/core/docs/content/locales/fr-FR/progress.mdx +46 -4
  332. package/corpus/core/docs/content/locales/fr-FR/pure-agent-apps.mdx +48 -4
  333. package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +107 -8
  334. package/corpus/core/docs/content/locales/fr-FR/recurring-jobs.mdx +59 -4
  335. package/corpus/core/docs/content/locales/fr-FR/routing.mdx +44 -5
  336. package/corpus/core/docs/content/locales/fr-FR/sandbox-adapters.mdx +44 -4
  337. package/corpus/core/docs/content/locales/fr-FR/security.mdx +82 -8
  338. package/corpus/core/docs/content/locales/fr-FR/server.mdx +173 -12
  339. package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +45 -4
  340. package/corpus/core/docs/content/locales/fr-FR/skills-guide.mdx +118 -9
  341. package/corpus/core/docs/content/locales/fr-FR/template-analytics.mdx +46 -4
  342. package/corpus/core/docs/content/locales/fr-FR/template-assets.mdx +66 -4
  343. package/corpus/core/docs/content/locales/fr-FR/template-brain.mdx +69 -4
  344. package/corpus/core/docs/content/locales/fr-FR/template-calendar.mdx +62 -4
  345. package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +61 -4
  346. package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +52 -4
  347. package/corpus/core/docs/content/locales/fr-FR/template-content.mdx +64 -4
  348. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +107 -4
  349. package/corpus/core/docs/content/locales/fr-FR/template-dispatch.mdx +57 -4
  350. package/corpus/core/docs/content/locales/fr-FR/template-forms.mdx +64 -4
  351. package/corpus/core/docs/content/locales/fr-FR/template-mail.mdx +60 -4
  352. package/corpus/core/docs/content/locales/fr-FR/template-plan.mdx +61 -4
  353. package/corpus/core/docs/content/locales/fr-FR/template-slides.mdx +49 -4
  354. package/corpus/core/docs/content/locales/fr-FR/template-videos.mdx +53 -4
  355. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +54 -4
  356. package/corpus/core/docs/content/locales/fr-FR/using-your-agent.mdx +51 -4
  357. package/corpus/core/docs/content/locales/fr-FR/voice-input.mdx +45 -4
  358. package/corpus/core/docs/content/locales/fr-FR/what-is-agent-native.mdx +101 -8
  359. package/corpus/core/docs/content/locales/fr-FR/workspace-connections.mdx +128 -8
  360. package/corpus/core/docs/content/locales/fr-FR/workspace-management.mdx +50 -4
  361. package/corpus/core/docs/content/locales/fr-FR/workspace.mdx +112 -8
  362. package/corpus/core/docs/content/locales/fr-FR/writing-agent-instructions.mdx +47 -4
  363. package/corpus/core/docs/content/locales/hi-IN/a2a-protocol.mdx +97 -9
  364. package/corpus/core/docs/content/locales/hi-IN/actions.mdx +63 -4
  365. package/corpus/core/docs/content/locales/hi-IN/agent-mentions.mdx +68 -4
  366. package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +112 -8
  367. package/corpus/core/docs/content/locales/hi-IN/agent-teams.mdx +171 -12
  368. package/corpus/core/docs/content/locales/hi-IN/agent-web-surfaces.mdx +51 -4
  369. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +122 -8
  370. package/corpus/core/docs/content/locales/hi-IN/automations.mdx +110 -8
  371. package/corpus/core/docs/content/locales/hi-IN/blueprint-installer.mdx +42 -4
  372. package/corpus/core/docs/content/locales/hi-IN/cli-adapters.mdx +44 -4
  373. package/corpus/core/docs/content/locales/hi-IN/client.mdx +79 -8
  374. package/corpus/core/docs/content/locales/hi-IN/cloneable-saas.mdx +85 -8
  375. package/corpus/core/docs/content/locales/hi-IN/code-agents-ui.mdx +96 -8
  376. package/corpus/core/docs/content/locales/hi-IN/components.mdx +114 -8
  377. package/corpus/core/docs/content/locales/hi-IN/context-awareness.mdx +102 -8
  378. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +53 -4
  379. package/corpus/core/docs/content/locales/hi-IN/cross-app-sso.mdx +109 -8
  380. package/corpus/core/docs/content/locales/hi-IN/database.mdx +52 -4
  381. package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +103 -8
  382. package/corpus/core/docs/content/locales/hi-IN/dispatch.mdx +134 -8
  383. package/corpus/core/docs/content/locales/hi-IN/drop-in-agent.mdx +63 -4
  384. package/corpus/core/docs/content/locales/hi-IN/durable-resume.mdx +47 -4
  385. package/corpus/core/docs/content/locales/hi-IN/embedding-sdk.mdx +83 -8
  386. package/corpus/core/docs/content/locales/hi-IN/evals.mdx +100 -8
  387. package/corpus/core/docs/content/locales/hi-IN/extensions.mdx +113 -9
  388. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +119 -8
  389. package/corpus/core/docs/content/locales/hi-IN/faq.mdx +96 -8
  390. package/corpus/core/docs/content/locales/hi-IN/file-uploads.mdx +61 -4
  391. package/corpus/core/docs/content/locales/hi-IN/frames.mdx +88 -8
  392. package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +34 -4
  393. package/corpus/core/docs/content/locales/hi-IN/harness-agents.mdx +77 -8
  394. package/corpus/core/docs/content/locales/hi-IN/human-approval.mdx +51 -4
  395. package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +104 -8
  396. package/corpus/core/docs/content/locales/hi-IN/local-file-mode.mdx +58 -4
  397. package/corpus/core/docs/content/locales/hi-IN/mcp-apps.mdx +120 -10
  398. package/corpus/core/docs/content/locales/hi-IN/mcp-clients.mdx +133 -8
  399. package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +105 -8
  400. package/corpus/core/docs/content/locales/hi-IN/messaging.mdx +115 -8
  401. package/corpus/core/docs/content/locales/hi-IN/migration-workbench.mdx +45 -4
  402. package/corpus/core/docs/content/locales/hi-IN/multi-app-workspace.mdx +91 -8
  403. package/corpus/core/docs/content/locales/hi-IN/multi-tenancy.mdx +80 -8
  404. package/corpus/core/docs/content/locales/hi-IN/native-chat-ui.mdx +106 -8
  405. package/corpus/core/docs/content/locales/hi-IN/notifications.mdx +135 -8
  406. package/corpus/core/docs/content/locales/hi-IN/observability.mdx +102 -8
  407. package/corpus/core/docs/content/locales/hi-IN/observational-memory.mdx +89 -8
  408. package/corpus/core/docs/content/locales/hi-IN/onboarding.mdx +45 -4
  409. package/corpus/core/docs/content/locales/hi-IN/plan-plugin.mdx +99 -8
  410. package/corpus/core/docs/content/locales/hi-IN/pr-visual-recap.mdx +126 -8
  411. package/corpus/core/docs/content/locales/hi-IN/processors.mdx +41 -4
  412. package/corpus/core/docs/content/locales/hi-IN/progress.mdx +46 -4
  413. package/corpus/core/docs/content/locales/hi-IN/pure-agent-apps.mdx +48 -4
  414. package/corpus/core/docs/content/locales/hi-IN/real-time-collaboration.mdx +106 -8
  415. package/corpus/core/docs/content/locales/hi-IN/recurring-jobs.mdx +59 -4
  416. package/corpus/core/docs/content/locales/hi-IN/routing.mdx +44 -5
  417. package/corpus/core/docs/content/locales/hi-IN/sandbox-adapters.mdx +43 -4
  418. package/corpus/core/docs/content/locales/hi-IN/security.mdx +78 -8
  419. package/corpus/core/docs/content/locales/hi-IN/server.mdx +169 -12
  420. package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +45 -4
  421. package/corpus/core/docs/content/locales/hi-IN/skills-guide.mdx +118 -9
  422. package/corpus/core/docs/content/locales/hi-IN/template-analytics.mdx +46 -4
  423. package/corpus/core/docs/content/locales/hi-IN/template-assets.mdx +62 -4
  424. package/corpus/core/docs/content/locales/hi-IN/template-brain.mdx +69 -4
  425. package/corpus/core/docs/content/locales/hi-IN/template-calendar.mdx +62 -4
  426. package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +59 -4
  427. package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +52 -4
  428. package/corpus/core/docs/content/locales/hi-IN/template-content.mdx +62 -4
  429. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +102 -4
  430. package/corpus/core/docs/content/locales/hi-IN/template-dispatch.mdx +57 -4
  431. package/corpus/core/docs/content/locales/hi-IN/template-forms.mdx +64 -4
  432. package/corpus/core/docs/content/locales/hi-IN/template-mail.mdx +64 -4
  433. package/corpus/core/docs/content/locales/hi-IN/template-plan.mdx +61 -4
  434. package/corpus/core/docs/content/locales/hi-IN/template-slides.mdx +49 -4
  435. package/corpus/core/docs/content/locales/hi-IN/template-videos.mdx +53 -4
  436. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +54 -4
  437. package/corpus/core/docs/content/locales/hi-IN/using-your-agent.mdx +51 -4
  438. package/corpus/core/docs/content/locales/hi-IN/voice-input.mdx +43 -4
  439. package/corpus/core/docs/content/locales/hi-IN/what-is-agent-native.mdx +97 -8
  440. package/corpus/core/docs/content/locales/hi-IN/workspace-connections.mdx +128 -8
  441. package/corpus/core/docs/content/locales/hi-IN/workspace-management.mdx +50 -4
  442. package/corpus/core/docs/content/locales/hi-IN/workspace.mdx +111 -8
  443. package/corpus/core/docs/content/locales/hi-IN/writing-agent-instructions.mdx +40 -4
  444. package/corpus/core/docs/content/locales/ja-JP/a2a-protocol.mdx +97 -9
  445. package/corpus/core/docs/content/locales/ja-JP/actions.mdx +67 -4
  446. package/corpus/core/docs/content/locales/ja-JP/agent-mentions.mdx +68 -4
  447. package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +116 -8
  448. package/corpus/core/docs/content/locales/ja-JP/agent-teams.mdx +172 -12
  449. package/corpus/core/docs/content/locales/ja-JP/agent-web-surfaces.mdx +51 -4
  450. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +122 -8
  451. package/corpus/core/docs/content/locales/ja-JP/automations.mdx +110 -8
  452. package/corpus/core/docs/content/locales/ja-JP/blueprint-installer.mdx +44 -4
  453. package/corpus/core/docs/content/locales/ja-JP/cli-adapters.mdx +44 -4
  454. package/corpus/core/docs/content/locales/ja-JP/client.mdx +79 -8
  455. package/corpus/core/docs/content/locales/ja-JP/cloneable-saas.mdx +85 -8
  456. package/corpus/core/docs/content/locales/ja-JP/code-agents-ui.mdx +100 -8
  457. package/corpus/core/docs/content/locales/ja-JP/components.mdx +116 -8
  458. package/corpus/core/docs/content/locales/ja-JP/context-awareness.mdx +100 -8
  459. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +51 -4
  460. package/corpus/core/docs/content/locales/ja-JP/cross-app-sso.mdx +109 -8
  461. package/corpus/core/docs/content/locales/ja-JP/database.mdx +52 -4
  462. package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +103 -8
  463. package/corpus/core/docs/content/locales/ja-JP/dispatch.mdx +134 -8
  464. package/corpus/core/docs/content/locales/ja-JP/drop-in-agent.mdx +63 -4
  465. package/corpus/core/docs/content/locales/ja-JP/durable-resume.mdx +47 -4
  466. package/corpus/core/docs/content/locales/ja-JP/embedding-sdk.mdx +85 -8
  467. package/corpus/core/docs/content/locales/ja-JP/evals.mdx +102 -8
  468. package/corpus/core/docs/content/locales/ja-JP/extensions.mdx +111 -9
  469. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +119 -8
  470. package/corpus/core/docs/content/locales/ja-JP/faq.mdx +98 -8
  471. package/corpus/core/docs/content/locales/ja-JP/file-uploads.mdx +61 -4
  472. package/corpus/core/docs/content/locales/ja-JP/frames.mdx +88 -8
  473. package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +34 -4
  474. package/corpus/core/docs/content/locales/ja-JP/harness-agents.mdx +79 -8
  475. package/corpus/core/docs/content/locales/ja-JP/human-approval.mdx +50 -4
  476. package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +105 -8
  477. package/corpus/core/docs/content/locales/ja-JP/local-file-mode.mdx +58 -4
  478. package/corpus/core/docs/content/locales/ja-JP/mcp-apps.mdx +119 -10
  479. package/corpus/core/docs/content/locales/ja-JP/mcp-clients.mdx +134 -8
  480. package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +105 -8
  481. package/corpus/core/docs/content/locales/ja-JP/messaging.mdx +115 -8
  482. package/corpus/core/docs/content/locales/ja-JP/migration-workbench.mdx +47 -4
  483. package/corpus/core/docs/content/locales/ja-JP/multi-app-workspace.mdx +91 -8
  484. package/corpus/core/docs/content/locales/ja-JP/multi-tenancy.mdx +80 -8
  485. package/corpus/core/docs/content/locales/ja-JP/native-chat-ui.mdx +104 -8
  486. package/corpus/core/docs/content/locales/ja-JP/notifications.mdx +135 -8
  487. package/corpus/core/docs/content/locales/ja-JP/observability.mdx +104 -8
  488. package/corpus/core/docs/content/locales/ja-JP/observational-memory.mdx +89 -8
  489. package/corpus/core/docs/content/locales/ja-JP/onboarding.mdx +45 -4
  490. package/corpus/core/docs/content/locales/ja-JP/plan-plugin.mdx +99 -8
  491. package/corpus/core/docs/content/locales/ja-JP/pr-visual-recap.mdx +123 -8
  492. package/corpus/core/docs/content/locales/ja-JP/processors.mdx +39 -4
  493. package/corpus/core/docs/content/locales/ja-JP/progress.mdx +46 -4
  494. package/corpus/core/docs/content/locales/ja-JP/pure-agent-apps.mdx +48 -4
  495. package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +106 -8
  496. package/corpus/core/docs/content/locales/ja-JP/recurring-jobs.mdx +59 -4
  497. package/corpus/core/docs/content/locales/ja-JP/routing.mdx +44 -5
  498. package/corpus/core/docs/content/locales/ja-JP/sandbox-adapters.mdx +43 -4
  499. package/corpus/core/docs/content/locales/ja-JP/security.mdx +82 -8
  500. package/corpus/core/docs/content/locales/ja-JP/server.mdx +171 -12
  501. package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +45 -4
  502. package/corpus/core/docs/content/locales/ja-JP/skills-guide.mdx +118 -9
  503. package/corpus/core/docs/content/locales/ja-JP/template-analytics.mdx +46 -4
  504. package/corpus/core/docs/content/locales/ja-JP/template-assets.mdx +64 -4
  505. package/corpus/core/docs/content/locales/ja-JP/template-brain.mdx +67 -4
  506. package/corpus/core/docs/content/locales/ja-JP/template-calendar.mdx +62 -4
  507. package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +61 -4
  508. package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +52 -4
  509. package/corpus/core/docs/content/locales/ja-JP/template-content.mdx +62 -4
  510. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +106 -4
  511. package/corpus/core/docs/content/locales/ja-JP/template-dispatch.mdx +57 -4
  512. package/corpus/core/docs/content/locales/ja-JP/template-forms.mdx +62 -4
  513. package/corpus/core/docs/content/locales/ja-JP/template-mail.mdx +62 -4
  514. package/corpus/core/docs/content/locales/ja-JP/template-plan.mdx +63 -4
  515. package/corpus/core/docs/content/locales/ja-JP/template-slides.mdx +49 -4
  516. package/corpus/core/docs/content/locales/ja-JP/template-videos.mdx +53 -4
  517. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +54 -4
  518. package/corpus/core/docs/content/locales/ja-JP/using-your-agent.mdx +51 -4
  519. package/corpus/core/docs/content/locales/ja-JP/voice-input.mdx +43 -4
  520. package/corpus/core/docs/content/locales/ja-JP/what-is-agent-native.mdx +96 -8
  521. package/corpus/core/docs/content/locales/ja-JP/workspace-connections.mdx +128 -8
  522. package/corpus/core/docs/content/locales/ja-JP/workspace-management.mdx +50 -4
  523. package/corpus/core/docs/content/locales/ja-JP/workspace.mdx +111 -8
  524. package/corpus/core/docs/content/locales/ja-JP/writing-agent-instructions.mdx +44 -4
  525. package/corpus/core/docs/content/locales/ko-KR/a2a-protocol.mdx +97 -9
  526. package/corpus/core/docs/content/locales/ko-KR/actions.mdx +63 -4
  527. package/corpus/core/docs/content/locales/ko-KR/agent-mentions.mdx +68 -4
  528. package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +113 -8
  529. package/corpus/core/docs/content/locales/ko-KR/agent-teams.mdx +171 -12
  530. package/corpus/core/docs/content/locales/ko-KR/agent-web-surfaces.mdx +51 -4
  531. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +122 -8
  532. package/corpus/core/docs/content/locales/ko-KR/automations.mdx +110 -8
  533. package/corpus/core/docs/content/locales/ko-KR/blueprint-installer.mdx +42 -4
  534. package/corpus/core/docs/content/locales/ko-KR/cli-adapters.mdx +44 -4
  535. package/corpus/core/docs/content/locales/ko-KR/client.mdx +79 -8
  536. package/corpus/core/docs/content/locales/ko-KR/cloneable-saas.mdx +85 -8
  537. package/corpus/core/docs/content/locales/ko-KR/code-agents-ui.mdx +96 -8
  538. package/corpus/core/docs/content/locales/ko-KR/components.mdx +112 -8
  539. package/corpus/core/docs/content/locales/ko-KR/context-awareness.mdx +96 -8
  540. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +51 -4
  541. package/corpus/core/docs/content/locales/ko-KR/cross-app-sso.mdx +109 -8
  542. package/corpus/core/docs/content/locales/ko-KR/database.mdx +52 -4
  543. package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +103 -8
  544. package/corpus/core/docs/content/locales/ko-KR/dispatch.mdx +132 -8
  545. package/corpus/core/docs/content/locales/ko-KR/drop-in-agent.mdx +63 -4
  546. package/corpus/core/docs/content/locales/ko-KR/durable-resume.mdx +47 -4
  547. package/corpus/core/docs/content/locales/ko-KR/embedding-sdk.mdx +81 -8
  548. package/corpus/core/docs/content/locales/ko-KR/evals.mdx +102 -8
  549. package/corpus/core/docs/content/locales/ko-KR/extensions.mdx +111 -9
  550. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +119 -8
  551. package/corpus/core/docs/content/locales/ko-KR/faq.mdx +96 -8
  552. package/corpus/core/docs/content/locales/ko-KR/file-uploads.mdx +61 -4
  553. package/corpus/core/docs/content/locales/ko-KR/frames.mdx +86 -8
  554. package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +34 -4
  555. package/corpus/core/docs/content/locales/ko-KR/harness-agents.mdx +77 -8
  556. package/corpus/core/docs/content/locales/ko-KR/human-approval.mdx +50 -4
  557. package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +104 -8
  558. package/corpus/core/docs/content/locales/ko-KR/local-file-mode.mdx +56 -4
  559. package/corpus/core/docs/content/locales/ko-KR/mcp-apps.mdx +120 -10
  560. package/corpus/core/docs/content/locales/ko-KR/mcp-clients.mdx +133 -8
  561. package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +105 -8
  562. package/corpus/core/docs/content/locales/ko-KR/messaging.mdx +115 -8
  563. package/corpus/core/docs/content/locales/ko-KR/migration-workbench.mdx +45 -4
  564. package/corpus/core/docs/content/locales/ko-KR/multi-app-workspace.mdx +91 -8
  565. package/corpus/core/docs/content/locales/ko-KR/multi-tenancy.mdx +80 -8
  566. package/corpus/core/docs/content/locales/ko-KR/native-chat-ui.mdx +104 -8
  567. package/corpus/core/docs/content/locales/ko-KR/notifications.mdx +135 -8
  568. package/corpus/core/docs/content/locales/ko-KR/observability.mdx +102 -8
  569. package/corpus/core/docs/content/locales/ko-KR/observational-memory.mdx +87 -8
  570. package/corpus/core/docs/content/locales/ko-KR/onboarding.mdx +44 -4
  571. package/corpus/core/docs/content/locales/ko-KR/plan-plugin.mdx +99 -8
  572. package/corpus/core/docs/content/locales/ko-KR/pr-visual-recap.mdx +125 -8
  573. package/corpus/core/docs/content/locales/ko-KR/processors.mdx +39 -4
  574. package/corpus/core/docs/content/locales/ko-KR/progress.mdx +46 -4
  575. package/corpus/core/docs/content/locales/ko-KR/pure-agent-apps.mdx +46 -4
  576. package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +104 -8
  577. package/corpus/core/docs/content/locales/ko-KR/recurring-jobs.mdx +59 -4
  578. package/corpus/core/docs/content/locales/ko-KR/routing.mdx +44 -5
  579. package/corpus/core/docs/content/locales/ko-KR/sandbox-adapters.mdx +41 -4
  580. package/corpus/core/docs/content/locales/ko-KR/security.mdx +78 -8
  581. package/corpus/core/docs/content/locales/ko-KR/server.mdx +171 -12
  582. package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +45 -4
  583. package/corpus/core/docs/content/locales/ko-KR/skills-guide.mdx +118 -9
  584. package/corpus/core/docs/content/locales/ko-KR/template-analytics.mdx +46 -4
  585. package/corpus/core/docs/content/locales/ko-KR/template-assets.mdx +62 -4
  586. package/corpus/core/docs/content/locales/ko-KR/template-brain.mdx +65 -4
  587. package/corpus/core/docs/content/locales/ko-KR/template-calendar.mdx +60 -4
  588. package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +59 -4
  589. package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +52 -4
  590. package/corpus/core/docs/content/locales/ko-KR/template-content.mdx +60 -4
  591. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +102 -4
  592. package/corpus/core/docs/content/locales/ko-KR/template-dispatch.mdx +57 -4
  593. package/corpus/core/docs/content/locales/ko-KR/template-forms.mdx +60 -4
  594. package/corpus/core/docs/content/locales/ko-KR/template-mail.mdx +60 -4
  595. package/corpus/core/docs/content/locales/ko-KR/template-plan.mdx +57 -4
  596. package/corpus/core/docs/content/locales/ko-KR/template-slides.mdx +49 -4
  597. package/corpus/core/docs/content/locales/ko-KR/template-videos.mdx +53 -4
  598. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +54 -4
  599. package/corpus/core/docs/content/locales/ko-KR/using-your-agent.mdx +51 -4
  600. package/corpus/core/docs/content/locales/ko-KR/voice-input.mdx +43 -4
  601. package/corpus/core/docs/content/locales/ko-KR/what-is-agent-native.mdx +95 -8
  602. package/corpus/core/docs/content/locales/ko-KR/workspace-connections.mdx +128 -8
  603. package/corpus/core/docs/content/locales/ko-KR/workspace-management.mdx +50 -4
  604. package/corpus/core/docs/content/locales/ko-KR/workspace.mdx +111 -8
  605. package/corpus/core/docs/content/locales/ko-KR/writing-agent-instructions.mdx +38 -4
  606. package/corpus/core/docs/content/locales/pt-BR/a2a-protocol.mdx +99 -9
  607. package/corpus/core/docs/content/locales/pt-BR/actions.mdx +67 -4
  608. package/corpus/core/docs/content/locales/pt-BR/agent-mentions.mdx +68 -4
  609. package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +116 -8
  610. package/corpus/core/docs/content/locales/pt-BR/agent-teams.mdx +172 -12
  611. package/corpus/core/docs/content/locales/pt-BR/agent-web-surfaces.mdx +51 -4
  612. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +122 -8
  613. package/corpus/core/docs/content/locales/pt-BR/automations.mdx +110 -8
  614. package/corpus/core/docs/content/locales/pt-BR/blueprint-installer.mdx +42 -4
  615. package/corpus/core/docs/content/locales/pt-BR/cli-adapters.mdx +44 -4
  616. package/corpus/core/docs/content/locales/pt-BR/client.mdx +81 -8
  617. package/corpus/core/docs/content/locales/pt-BR/cloneable-saas.mdx +85 -8
  618. package/corpus/core/docs/content/locales/pt-BR/code-agents-ui.mdx +98 -8
  619. package/corpus/core/docs/content/locales/pt-BR/components.mdx +118 -8
  620. package/corpus/core/docs/content/locales/pt-BR/context-awareness.mdx +100 -8
  621. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +51 -4
  622. package/corpus/core/docs/content/locales/pt-BR/cross-app-sso.mdx +109 -8
  623. package/corpus/core/docs/content/locales/pt-BR/database.mdx +52 -4
  624. package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +103 -8
  625. package/corpus/core/docs/content/locales/pt-BR/dispatch.mdx +134 -8
  626. package/corpus/core/docs/content/locales/pt-BR/drop-in-agent.mdx +63 -4
  627. package/corpus/core/docs/content/locales/pt-BR/durable-resume.mdx +47 -4
  628. package/corpus/core/docs/content/locales/pt-BR/embedding-sdk.mdx +87 -8
  629. package/corpus/core/docs/content/locales/pt-BR/evals.mdx +102 -8
  630. package/corpus/core/docs/content/locales/pt-BR/extensions.mdx +113 -9
  631. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +119 -8
  632. package/corpus/core/docs/content/locales/pt-BR/faq.mdx +98 -8
  633. package/corpus/core/docs/content/locales/pt-BR/file-uploads.mdx +61 -4
  634. package/corpus/core/docs/content/locales/pt-BR/frames.mdx +88 -8
  635. package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +34 -4
  636. package/corpus/core/docs/content/locales/pt-BR/harness-agents.mdx +79 -8
  637. package/corpus/core/docs/content/locales/pt-BR/human-approval.mdx +50 -4
  638. package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +104 -8
  639. package/corpus/core/docs/content/locales/pt-BR/local-file-mode.mdx +60 -4
  640. package/corpus/core/docs/content/locales/pt-BR/mcp-apps.mdx +120 -10
  641. package/corpus/core/docs/content/locales/pt-BR/mcp-clients.mdx +133 -8
  642. package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +105 -8
  643. package/corpus/core/docs/content/locales/pt-BR/messaging.mdx +115 -8
  644. package/corpus/core/docs/content/locales/pt-BR/migration-workbench.mdx +47 -4
  645. package/corpus/core/docs/content/locales/pt-BR/multi-app-workspace.mdx +91 -8
  646. package/corpus/core/docs/content/locales/pt-BR/multi-tenancy.mdx +80 -8
  647. package/corpus/core/docs/content/locales/pt-BR/native-chat-ui.mdx +108 -8
  648. package/corpus/core/docs/content/locales/pt-BR/notifications.mdx +135 -8
  649. package/corpus/core/docs/content/locales/pt-BR/observability.mdx +104 -8
  650. package/corpus/core/docs/content/locales/pt-BR/observational-memory.mdx +92 -8
  651. package/corpus/core/docs/content/locales/pt-BR/onboarding.mdx +45 -4
  652. package/corpus/core/docs/content/locales/pt-BR/plan-plugin.mdx +99 -8
  653. package/corpus/core/docs/content/locales/pt-BR/pr-visual-recap.mdx +125 -8
  654. package/corpus/core/docs/content/locales/pt-BR/processors.mdx +41 -4
  655. package/corpus/core/docs/content/locales/pt-BR/progress.mdx +46 -4
  656. package/corpus/core/docs/content/locales/pt-BR/pure-agent-apps.mdx +48 -4
  657. package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +107 -8
  658. package/corpus/core/docs/content/locales/pt-BR/recurring-jobs.mdx +59 -4
  659. package/corpus/core/docs/content/locales/pt-BR/routing.mdx +44 -5
  660. package/corpus/core/docs/content/locales/pt-BR/sandbox-adapters.mdx +43 -4
  661. package/corpus/core/docs/content/locales/pt-BR/security.mdx +82 -8
  662. package/corpus/core/docs/content/locales/pt-BR/server.mdx +173 -12
  663. package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +45 -4
  664. package/corpus/core/docs/content/locales/pt-BR/skills-guide.mdx +118 -9
  665. package/corpus/core/docs/content/locales/pt-BR/template-analytics.mdx +46 -4
  666. package/corpus/core/docs/content/locales/pt-BR/template-assets.mdx +64 -4
  667. package/corpus/core/docs/content/locales/pt-BR/template-brain.mdx +69 -4
  668. package/corpus/core/docs/content/locales/pt-BR/template-calendar.mdx +62 -4
  669. package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +61 -4
  670. package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +52 -4
  671. package/corpus/core/docs/content/locales/pt-BR/template-content.mdx +64 -4
  672. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +106 -4
  673. package/corpus/core/docs/content/locales/pt-BR/template-dispatch.mdx +57 -4
  674. package/corpus/core/docs/content/locales/pt-BR/template-forms.mdx +64 -4
  675. package/corpus/core/docs/content/locales/pt-BR/template-mail.mdx +60 -4
  676. package/corpus/core/docs/content/locales/pt-BR/template-plan.mdx +63 -4
  677. package/corpus/core/docs/content/locales/pt-BR/template-slides.mdx +49 -4
  678. package/corpus/core/docs/content/locales/pt-BR/template-videos.mdx +53 -4
  679. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +54 -4
  680. package/corpus/core/docs/content/locales/pt-BR/using-your-agent.mdx +51 -4
  681. package/corpus/core/docs/content/locales/pt-BR/voice-input.mdx +43 -4
  682. package/corpus/core/docs/content/locales/pt-BR/what-is-agent-native.mdx +101 -8
  683. package/corpus/core/docs/content/locales/pt-BR/workspace-connections.mdx +128 -8
  684. package/corpus/core/docs/content/locales/pt-BR/workspace-management.mdx +50 -4
  685. package/corpus/core/docs/content/locales/pt-BR/workspace.mdx +111 -8
  686. package/corpus/core/docs/content/locales/pt-BR/writing-agent-instructions.mdx +46 -4
  687. package/corpus/core/docs/content/locales/zh-CN/a2a-protocol.mdx +97 -9
  688. package/corpus/core/docs/content/locales/zh-CN/actions.mdx +65 -4
  689. package/corpus/core/docs/content/locales/zh-CN/agent-mentions.mdx +68 -4
  690. package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +108 -8
  691. package/corpus/core/docs/content/locales/zh-CN/agent-teams.mdx +171 -12
  692. package/corpus/core/docs/content/locales/zh-CN/agent-web-surfaces.mdx +51 -4
  693. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +122 -8
  694. package/corpus/core/docs/content/locales/zh-CN/automations.mdx +110 -8
  695. package/corpus/core/docs/content/locales/zh-CN/blueprint-installer.mdx +42 -4
  696. package/corpus/core/docs/content/locales/zh-CN/cli-adapters.mdx +44 -4
  697. package/corpus/core/docs/content/locales/zh-CN/client.mdx +79 -8
  698. package/corpus/core/docs/content/locales/zh-CN/cloneable-saas.mdx +83 -8
  699. package/corpus/core/docs/content/locales/zh-CN/code-agents-ui.mdx +94 -8
  700. package/corpus/core/docs/content/locales/zh-CN/components.mdx +112 -8
  701. package/corpus/core/docs/content/locales/zh-CN/context-awareness.mdx +96 -8
  702. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +51 -4
  703. package/corpus/core/docs/content/locales/zh-CN/cross-app-sso.mdx +107 -8
  704. package/corpus/core/docs/content/locales/zh-CN/database.mdx +52 -4
  705. package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +103 -8
  706. package/corpus/core/docs/content/locales/zh-CN/dispatch.mdx +134 -8
  707. package/corpus/core/docs/content/locales/zh-CN/drop-in-agent.mdx +63 -4
  708. package/corpus/core/docs/content/locales/zh-CN/durable-resume.mdx +45 -4
  709. package/corpus/core/docs/content/locales/zh-CN/embedding-sdk.mdx +81 -8
  710. package/corpus/core/docs/content/locales/zh-CN/evals.mdx +100 -8
  711. package/corpus/core/docs/content/locales/zh-CN/extensions.mdx +111 -9
  712. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +119 -8
  713. package/corpus/core/docs/content/locales/zh-CN/faq.mdx +96 -8
  714. package/corpus/core/docs/content/locales/zh-CN/file-uploads.mdx +61 -4
  715. package/corpus/core/docs/content/locales/zh-CN/frames.mdx +86 -8
  716. package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +34 -4
  717. package/corpus/core/docs/content/locales/zh-CN/harness-agents.mdx +79 -8
  718. package/corpus/core/docs/content/locales/zh-CN/human-approval.mdx +50 -4
  719. package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +100 -8
  720. package/corpus/core/docs/content/locales/zh-CN/local-file-mode.mdx +56 -4
  721. package/corpus/core/docs/content/locales/zh-CN/mcp-apps.mdx +120 -10
  722. package/corpus/core/docs/content/locales/zh-CN/mcp-clients.mdx +133 -8
  723. package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +105 -8
  724. package/corpus/core/docs/content/locales/zh-CN/messaging.mdx +115 -8
  725. package/corpus/core/docs/content/locales/zh-CN/migration-workbench.mdx +45 -4
  726. package/corpus/core/docs/content/locales/zh-CN/multi-app-workspace.mdx +91 -8
  727. package/corpus/core/docs/content/locales/zh-CN/multi-tenancy.mdx +80 -8
  728. package/corpus/core/docs/content/locales/zh-CN/native-chat-ui.mdx +104 -8
  729. package/corpus/core/docs/content/locales/zh-CN/notifications.mdx +135 -8
  730. package/corpus/core/docs/content/locales/zh-CN/observability.mdx +102 -8
  731. package/corpus/core/docs/content/locales/zh-CN/observational-memory.mdx +85 -8
  732. package/corpus/core/docs/content/locales/zh-CN/onboarding.mdx +44 -4
  733. package/corpus/core/docs/content/locales/zh-CN/plan-plugin.mdx +97 -8
  734. package/corpus/core/docs/content/locales/zh-CN/pr-visual-recap.mdx +123 -8
  735. package/corpus/core/docs/content/locales/zh-CN/processors.mdx +39 -4
  736. package/corpus/core/docs/content/locales/zh-CN/progress.mdx +46 -4
  737. package/corpus/core/docs/content/locales/zh-CN/pure-agent-apps.mdx +46 -4
  738. package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +98 -8
  739. package/corpus/core/docs/content/locales/zh-CN/recurring-jobs.mdx +59 -4
  740. package/corpus/core/docs/content/locales/zh-CN/routing.mdx +42 -5
  741. package/corpus/core/docs/content/locales/zh-CN/sandbox-adapters.mdx +41 -4
  742. package/corpus/core/docs/content/locales/zh-CN/security.mdx +78 -8
  743. package/corpus/core/docs/content/locales/zh-CN/server.mdx +169 -12
  744. package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +45 -4
  745. package/corpus/core/docs/content/locales/zh-CN/skills-guide.mdx +118 -9
  746. package/corpus/core/docs/content/locales/zh-CN/template-analytics.mdx +46 -4
  747. package/corpus/core/docs/content/locales/zh-CN/template-assets.mdx +58 -4
  748. package/corpus/core/docs/content/locales/zh-CN/template-brain.mdx +65 -4
  749. package/corpus/core/docs/content/locales/zh-CN/template-calendar.mdx +58 -4
  750. package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +57 -4
  751. package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +52 -4
  752. package/corpus/core/docs/content/locales/zh-CN/template-content.mdx +58 -4
  753. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +94 -4
  754. package/corpus/core/docs/content/locales/zh-CN/template-dispatch.mdx +57 -4
  755. package/corpus/core/docs/content/locales/zh-CN/template-forms.mdx +58 -4
  756. package/corpus/core/docs/content/locales/zh-CN/template-mail.mdx +60 -4
  757. package/corpus/core/docs/content/locales/zh-CN/template-plan.mdx +57 -4
  758. package/corpus/core/docs/content/locales/zh-CN/template-slides.mdx +49 -4
  759. package/corpus/core/docs/content/locales/zh-CN/template-videos.mdx +51 -4
  760. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +54 -4
  761. package/corpus/core/docs/content/locales/zh-CN/using-your-agent.mdx +51 -4
  762. package/corpus/core/docs/content/locales/zh-CN/voice-input.mdx +43 -4
  763. package/corpus/core/docs/content/locales/zh-CN/what-is-agent-native.mdx +94 -8
  764. package/corpus/core/docs/content/locales/zh-CN/workspace-connections.mdx +126 -8
  765. package/corpus/core/docs/content/locales/zh-CN/workspace-management.mdx +50 -4
  766. package/corpus/core/docs/content/locales/zh-CN/workspace.mdx +110 -8
  767. package/corpus/core/docs/content/locales/zh-CN/writing-agent-instructions.mdx +38 -4
  768. package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.mdx +97 -9
  769. package/corpus/core/docs/content/locales/zh-TW/actions.mdx +63 -4
  770. package/corpus/core/docs/content/locales/zh-TW/agent-mentions.mdx +68 -4
  771. package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +108 -8
  772. package/corpus/core/docs/content/locales/zh-TW/agent-teams.mdx +171 -12
  773. package/corpus/core/docs/content/locales/zh-TW/agent-web-surfaces.mdx +51 -4
  774. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +122 -8
  775. package/corpus/core/docs/content/locales/zh-TW/automations.mdx +110 -8
  776. package/corpus/core/docs/content/locales/zh-TW/blueprint-installer.mdx +42 -4
  777. package/corpus/core/docs/content/locales/zh-TW/cli-adapters.mdx +44 -4
  778. package/corpus/core/docs/content/locales/zh-TW/client.mdx +79 -8
  779. package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.mdx +83 -8
  780. package/corpus/core/docs/content/locales/zh-TW/code-agents-ui.mdx +94 -8
  781. package/corpus/core/docs/content/locales/zh-TW/components.mdx +112 -8
  782. package/corpus/core/docs/content/locales/zh-TW/context-awareness.mdx +96 -8
  783. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +51 -4
  784. package/corpus/core/docs/content/locales/zh-TW/cross-app-sso.mdx +107 -8
  785. package/corpus/core/docs/content/locales/zh-TW/database.mdx +52 -4
  786. package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +103 -8
  787. package/corpus/core/docs/content/locales/zh-TW/dispatch.mdx +134 -8
  788. package/corpus/core/docs/content/locales/zh-TW/drop-in-agent.mdx +63 -4
  789. package/corpus/core/docs/content/locales/zh-TW/durable-background-runs.mdx +88 -8
  790. package/corpus/core/docs/content/locales/zh-TW/durable-resume.mdx +45 -4
  791. package/corpus/core/docs/content/locales/zh-TW/embedding-sdk.mdx +83 -8
  792. package/corpus/core/docs/content/locales/zh-TW/evals.mdx +100 -8
  793. package/corpus/core/docs/content/locales/zh-TW/extensions.mdx +111 -9
  794. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +119 -8
  795. package/corpus/core/docs/content/locales/zh-TW/faq.mdx +96 -8
  796. package/corpus/core/docs/content/locales/zh-TW/file-uploads.mdx +61 -4
  797. package/corpus/core/docs/content/locales/zh-TW/frames.mdx +86 -8
  798. package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +34 -4
  799. package/corpus/core/docs/content/locales/zh-TW/harness-agents.mdx +79 -8
  800. package/corpus/core/docs/content/locales/zh-TW/human-approval.mdx +50 -4
  801. package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +100 -8
  802. package/corpus/core/docs/content/locales/zh-TW/local-file-mode.mdx +56 -4
  803. package/corpus/core/docs/content/locales/zh-TW/mcp-apps.mdx +120 -10
  804. package/corpus/core/docs/content/locales/zh-TW/mcp-clients.mdx +133 -8
  805. package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +105 -8
  806. package/corpus/core/docs/content/locales/zh-TW/messaging.mdx +115 -8
  807. package/corpus/core/docs/content/locales/zh-TW/migration-workbench.mdx +45 -4
  808. package/corpus/core/docs/content/locales/zh-TW/multi-app-workspace.mdx +91 -8
  809. package/corpus/core/docs/content/locales/zh-TW/multi-tenancy.mdx +80 -8
  810. package/corpus/core/docs/content/locales/zh-TW/native-chat-ui.mdx +104 -8
  811. package/corpus/core/docs/content/locales/zh-TW/notifications.mdx +135 -8
  812. package/corpus/core/docs/content/locales/zh-TW/observability.mdx +102 -8
  813. package/corpus/core/docs/content/locales/zh-TW/observational-memory.mdx +85 -8
  814. package/corpus/core/docs/content/locales/zh-TW/onboarding.mdx +44 -4
  815. package/corpus/core/docs/content/locales/zh-TW/plan-plugin.mdx +97 -8
  816. package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.mdx +123 -8
  817. package/corpus/core/docs/content/locales/zh-TW/processors.mdx +39 -4
  818. package/corpus/core/docs/content/locales/zh-TW/progress.mdx +46 -4
  819. package/corpus/core/docs/content/locales/zh-TW/pure-agent-apps.mdx +46 -4
  820. package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +98 -8
  821. package/corpus/core/docs/content/locales/zh-TW/recurring-jobs.mdx +59 -4
  822. package/corpus/core/docs/content/locales/zh-TW/routing.mdx +42 -5
  823. package/corpus/core/docs/content/locales/zh-TW/sandbox-adapters.mdx +41 -4
  824. package/corpus/core/docs/content/locales/zh-TW/security.mdx +80 -8
  825. package/corpus/core/docs/content/locales/zh-TW/server.mdx +169 -12
  826. package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +45 -4
  827. package/corpus/core/docs/content/locales/zh-TW/skills-guide.mdx +118 -9
  828. package/corpus/core/docs/content/locales/zh-TW/template-analytics.mdx +46 -4
  829. package/corpus/core/docs/content/locales/zh-TW/template-assets.mdx +58 -4
  830. package/corpus/core/docs/content/locales/zh-TW/template-brain.mdx +65 -4
  831. package/corpus/core/docs/content/locales/zh-TW/template-calendar.mdx +58 -4
  832. package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +59 -4
  833. package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +52 -4
  834. package/corpus/core/docs/content/locales/zh-TW/template-content.mdx +58 -4
  835. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +96 -4
  836. package/corpus/core/docs/content/locales/zh-TW/template-dispatch.mdx +57 -4
  837. package/corpus/core/docs/content/locales/zh-TW/template-forms.mdx +58 -4
  838. package/corpus/core/docs/content/locales/zh-TW/template-mail.mdx +60 -4
  839. package/corpus/core/docs/content/locales/zh-TW/template-plan.mdx +57 -4
  840. package/corpus/core/docs/content/locales/zh-TW/template-slides.mdx +49 -4
  841. package/corpus/core/docs/content/locales/zh-TW/template-videos.mdx +51 -4
  842. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +54 -4
  843. package/corpus/core/docs/content/locales/zh-TW/using-your-agent.mdx +51 -4
  844. package/corpus/core/docs/content/locales/zh-TW/voice-input.mdx +43 -4
  845. package/corpus/core/docs/content/locales/zh-TW/what-is-agent-native.mdx +94 -8
  846. package/corpus/core/docs/content/locales/zh-TW/workspace-connections.mdx +126 -8
  847. package/corpus/core/docs/content/locales/zh-TW/workspace-management.mdx +50 -4
  848. package/corpus/core/docs/content/locales/zh-TW/workspace.mdx +111 -8
  849. package/corpus/core/docs/content/locales/zh-TW/writing-agent-instructions.mdx +38 -4
  850. package/corpus/core/docs/content/mcp-apps.mdx +120 -10
  851. package/corpus/core/docs/content/mcp-clients.mdx +161 -8
  852. package/corpus/core/docs/content/mcp-protocol.mdx +105 -8
  853. package/corpus/core/docs/content/messaging.mdx +115 -8
  854. package/corpus/core/docs/content/migration-workbench.mdx +45 -4
  855. package/corpus/core/docs/content/multi-app-workspace.mdx +91 -8
  856. package/corpus/core/docs/content/multi-tenancy.mdx +80 -8
  857. package/corpus/core/docs/content/native-chat-ui.mdx +106 -8
  858. package/corpus/core/docs/content/notifications.mdx +135 -8
  859. package/corpus/core/docs/content/observability.mdx +102 -8
  860. package/corpus/core/docs/content/observational-memory.mdx +89 -8
  861. package/corpus/core/docs/content/onboarding.mdx +45 -4
  862. package/corpus/core/docs/content/plan-plugin.mdx +99 -8
  863. package/corpus/core/docs/content/pr-visual-recap.mdx +125 -8
  864. package/corpus/core/docs/content/processors.mdx +41 -4
  865. package/corpus/core/docs/content/progress.mdx +46 -4
  866. package/corpus/core/docs/content/pure-agent-apps.mdx +46 -4
  867. package/corpus/core/docs/content/real-time-collaboration.mdx +104 -8
  868. package/corpus/core/docs/content/recurring-jobs.mdx +59 -4
  869. package/corpus/core/docs/content/routing.mdx +44 -5
  870. package/corpus/core/docs/content/sandbox-adapters.mdx +43 -4
  871. package/corpus/core/docs/content/security.mdx +80 -8
  872. package/corpus/core/docs/content/server.mdx +173 -12
  873. package/corpus/core/docs/content/sharing.mdx +45 -4
  874. package/corpus/core/docs/content/skills-guide.mdx +118 -9
  875. package/corpus/core/docs/content/template-analytics.mdx +46 -4
  876. package/corpus/core/docs/content/template-assets.mdx +60 -4
  877. package/corpus/core/docs/content/template-brain.mdx +67 -4
  878. package/corpus/core/docs/content/template-calendar.mdx +62 -4
  879. package/corpus/core/docs/content/template-chat.mdx +61 -4
  880. package/corpus/core/docs/content/template-clips.mdx +52 -4
  881. package/corpus/core/docs/content/template-content.mdx +60 -4
  882. package/corpus/core/docs/content/template-design.mdx +103 -4
  883. package/corpus/core/docs/content/template-dispatch.mdx +57 -4
  884. package/corpus/core/docs/content/template-forms.mdx +62 -4
  885. package/corpus/core/docs/content/template-mail.mdx +60 -4
  886. package/corpus/core/docs/content/template-plan.mdx +61 -4
  887. package/corpus/core/docs/content/template-slides.mdx +49 -4
  888. package/corpus/core/docs/content/template-videos.mdx +51 -4
  889. package/corpus/core/docs/content/tracking.mdx +54 -4
  890. package/corpus/core/docs/content/using-your-agent.mdx +51 -4
  891. package/corpus/core/docs/content/voice-input.mdx +43 -4
  892. package/corpus/core/docs/content/what-is-agent-native.mdx +188 -8
  893. package/corpus/core/docs/content/workspace-connections.mdx +128 -8
  894. package/corpus/core/docs/content/workspace-management.mdx +50 -4
  895. package/corpus/core/docs/content/workspace.mdx +111 -8
  896. package/corpus/core/docs/content/writing-agent-instructions.mdx +45 -4
  897. package/corpus/core/package.json +2 -1
  898. package/corpus/core/src/agent/engine/index.ts +1 -0
  899. package/corpus/core/src/agent/engine/registry.ts +40 -0
  900. package/corpus/core/src/agent/production-agent.ts +6 -2
  901. package/corpus/core/src/application-state/store.ts +5 -5
  902. package/corpus/core/src/chat-threads/store.ts +2 -2
  903. package/corpus/core/src/cli/content-local.ts +374 -0
  904. package/corpus/core/src/cli/design-connect.ts +490 -0
  905. package/corpus/core/src/cli/index.ts +33 -0
  906. package/corpus/core/src/cli/skills.ts +355 -200
  907. package/corpus/core/src/client/AssistantChat.tsx +39 -3
  908. package/corpus/core/src/client/MultiTabAssistantChat.tsx +11 -93
  909. package/corpus/core/src/client/agent-chat.ts +27 -3
  910. package/corpus/core/src/client/analytics.ts +68 -15
  911. package/corpus/core/src/client/blocks/index.ts +2 -0
  912. package/corpus/core/src/client/blocks/library/MermaidBlock.tsx +1 -1
  913. package/corpus/core/src/client/blocks/library/diagram.config.ts +42 -18
  914. package/corpus/core/src/client/blocks/library/diagram.tsx +2 -2
  915. package/corpus/core/src/client/blocks/library/sanitize-html.ts +71 -6
  916. package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +2 -2
  917. package/corpus/core/src/client/blocks/library/wireframe.tsx +9 -3
  918. package/corpus/core/src/client/blocks/mdx.ts +62 -1
  919. package/corpus/core/src/client/blocks/server.ts +2 -0
  920. package/corpus/core/src/client/blocks/types.ts +5 -4
  921. package/corpus/core/src/client/chat/message-components.tsx +2 -98
  922. package/corpus/core/src/client/chat-model-groups.ts +147 -0
  923. package/corpus/core/src/client/components/LiveCursorOverlay.tsx +33 -66
  924. package/corpus/core/src/client/components/ui/dialog.tsx +91 -0
  925. package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +33 -290
  926. package/corpus/core/src/client/composer/TiptapComposer.tsx +99 -24
  927. package/corpus/core/src/client/composer/useVoiceDictation.ts +429 -260
  928. package/corpus/core/src/client/frame-protocol.ts +17 -2
  929. package/corpus/core/src/client/index.ts +2 -0
  930. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +614 -0
  931. package/corpus/core/src/client/resources/ResourcesPanel.tsx +411 -644
  932. package/corpus/core/src/client/resources/mcp-integration-catalog.ts +239 -0
  933. package/corpus/core/src/client/rich-markdown-editor/RegistryBlockNode.tsx +2 -2
  934. package/corpus/core/src/client/settings/SettingsPanel.tsx +1 -1
  935. package/corpus/core/src/client/sharing/ShareButton.tsx +20 -15
  936. package/corpus/core/src/client/use-agent-engine-configured.ts +80 -28
  937. package/corpus/core/src/client/use-chat-models.ts +12 -104
  938. package/corpus/core/src/db/client.ts +0 -5
  939. package/corpus/core/src/integrations/adapters/email.ts +2 -2
  940. package/corpus/core/src/local-artifacts/index.ts +18 -0
  941. package/corpus/core/src/localization/default-messages.ts +81 -0
  942. package/corpus/core/src/localization/shared.ts +3 -3
  943. package/corpus/core/src/org/handlers.ts +2 -2
  944. package/corpus/core/src/resources/store.ts +7 -7
  945. package/corpus/core/src/server/core-routes-plugin.ts +34 -12
  946. package/corpus/core/src/server/transcribe-voice.ts +57 -22
  947. package/corpus/core/src/shared/mcp-embed-headers.ts +23 -1
  948. package/corpus/core/src/shared/mcp-integration-config.ts +101 -0
  949. package/corpus/core/src/styles/agent-native.css +58 -107
  950. package/corpus/core/src/styles/blocks.css +15 -3
  951. package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +10 -0
  952. package/corpus/core/src/vite/client.ts +19 -0
  953. package/corpus/core/src/voice/index.ts +18 -0
  954. package/corpus/core/src/voice/voice-cleanup-prompt.ts +38 -0
  955. package/corpus/core/src/voice/voice-context.ts +217 -0
  956. package/corpus/core/src/voice/voice-replacements.ts +75 -0
  957. package/corpus/templates/analytics/AGENTS.md +4 -3
  958. package/corpus/templates/analytics/actions/list-session-recordings.ts +6 -1
  959. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +557 -400
  960. package/corpus/templates/analytics/app/global.css +22 -4
  961. package/corpus/templates/analytics/app/i18n/zh-TW.ts +3 -0
  962. package/corpus/templates/analytics/app/i18n-data.ts +21 -0
  963. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +33 -8
  964. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +7 -0
  965. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +32 -10
  966. package/corpus/templates/analytics/changelog/2026-06-28-ask-tab-now-matches-the-darker-app-background.md +6 -0
  967. package/corpus/templates/analytics/changelog/2026-06-28-dashboard-email-reports-now-use-cleaner-light-mode-snapshots.md +6 -0
  968. package/corpus/templates/analytics/changelog/2026-06-28-left-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  969. package/corpus/templates/analytics/changelog/2026-06-28-sessions-now-show-only-signed-in-recordings-with-playable-re.md +6 -0
  970. package/corpus/templates/analytics/changelog/2026-06-28-sessions-shows-scoped-recordings-even-when-replay-events-are.md +6 -0
  971. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +3 -3
  972. package/corpus/templates/analytics/server/lib/dashboard-report.ts +29 -7
  973. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +5 -2
  974. package/corpus/templates/analytics/server/lib/session-replay.ts +21 -7
  975. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +4 -4
  976. package/corpus/templates/assets/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  977. package/corpus/templates/brain/app/components/layout/Layout.tsx +29 -2
  978. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +131 -42
  979. package/corpus/templates/brain/app/i18n/zh-TW.ts +2 -0
  980. package/corpus/templates/brain/app/i18n-data.ts +20 -0
  981. package/corpus/templates/brain/changelog/2026-06-28-left-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  982. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +29 -1
  983. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +417 -299
  984. package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
  985. package/corpus/templates/calendar/app/i18n-data.ts +20 -0
  986. package/corpus/templates/calendar/changelog/2026-06-28-left-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  987. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +6 -19
  988. package/corpus/templates/chat/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  989. package/corpus/templates/clips/AGENTS.md +8 -0
  990. package/corpus/templates/clips/actions/cleanup-transcript.ts +58 -10
  991. package/corpus/templates/clips/actions/finalize-meeting.ts +81 -12
  992. package/corpus/templates/clips/actions/get-builder-credit-status.ts +22 -0
  993. package/corpus/templates/clips/actions/get-recording-player-data.ts +18 -3
  994. package/corpus/templates/clips/actions/lib/agents-md-context.ts +4 -1
  995. package/corpus/templates/clips/actions/lib/builder-credits-state.ts +46 -0
  996. package/corpus/templates/clips/actions/lib/provider-transcript.ts +51 -0
  997. package/corpus/templates/clips/actions/regenerate-title.ts +18 -0
  998. package/corpus/templates/clips/actions/request-transcript.ts +56 -33
  999. package/corpus/templates/clips/actions/save-browser-transcript.ts +1 -17
  1000. package/corpus/templates/clips/app/components/library/library-layout.tsx +3 -3
  1001. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +1 -1
  1002. package/corpus/templates/clips/app/components/player/share-dialog.tsx +2 -2
  1003. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +120 -11
  1004. package/corpus/templates/clips/app/i18n/ar-SA.ts +25 -0
  1005. package/corpus/templates/clips/app/i18n/de-DE.ts +25 -0
  1006. package/corpus/templates/clips/app/i18n/en-US.ts +25 -0
  1007. package/corpus/templates/clips/app/i18n/es-ES.ts +25 -0
  1008. package/corpus/templates/clips/app/i18n/fr-FR.ts +25 -0
  1009. package/corpus/templates/clips/app/i18n/hi-IN.ts +25 -0
  1010. package/corpus/templates/clips/app/i18n/ja-JP.ts +25 -0
  1011. package/corpus/templates/clips/app/i18n/ko-KR.ts +25 -0
  1012. package/corpus/templates/clips/app/i18n/pt-BR.ts +25 -0
  1013. package/corpus/templates/clips/app/i18n/zh-CN.ts +23 -0
  1014. package/corpus/templates/clips/app/i18n/zh-TW.ts +23 -0
  1015. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +69 -0
  1016. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +52 -2
  1017. package/corpus/templates/clips/app/routes/record.tsx +26 -15
  1018. package/corpus/templates/clips/changelog/2026-06-28-builder-credit-pauses-show-friendly-upgrade-guidance.md +6 -0
  1019. package/corpus/templates/clips/changelog/2026-06-28-left-sidebar-footer-controls-use-less-divider-chrome.md +6 -0
  1020. package/corpus/templates/clips/changelog/2026-06-28-transcription-now-auto-detects-spoken-language-instead-of-following.md +6 -0
  1021. package/corpus/templates/clips/changelog/2026-06-28-video-uploads-now-finish-when-duration-metadata-is-unavailable.md +6 -0
  1022. package/corpus/templates/clips/desktop/src/lib/personal-vocabulary.ts +13 -8
  1023. package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +7 -3
  1024. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +60 -1
  1025. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +30 -12
  1026. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +6 -19
  1027. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +4 -3
  1028. package/corpus/templates/clips/shared/builder-credits.ts +120 -0
  1029. package/corpus/templates/clips/shared/recording-core.ts +26 -8
  1030. package/corpus/templates/content/AGENTS.md +23 -2
  1031. package/corpus/templates/content/actions/_builder-docs-client.ts +952 -0
  1032. package/corpus/templates/content/actions/_document-flush.ts +62 -0
  1033. package/corpus/templates/content/actions/_local-file-documents.ts +115 -18
  1034. package/corpus/templates/content/actions/check-builder-doc.ts +38 -0
  1035. package/corpus/templates/content/actions/delete-document.ts +8 -0
  1036. package/corpus/templates/content/actions/import-content-source.ts +12 -0
  1037. package/corpus/templates/content/actions/list-builder-docs.ts +29 -0
  1038. package/corpus/templates/content/actions/pull-builder-doc.ts +42 -0
  1039. package/corpus/templates/content/actions/pull-document.ts +9 -59
  1040. package/corpus/templates/content/actions/push-builder-doc.ts +45 -0
  1041. package/corpus/templates/content/app/blocks/BuilderDocsBlocks.tsx +254 -0
  1042. package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +4 -0
  1043. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +1 -1
  1044. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +1 -1
  1045. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +5 -5
  1046. package/corpus/templates/content/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  1047. package/corpus/templates/content/server/db/schema.ts +12 -0
  1048. package/corpus/templates/content/server/plugins/db.ts +23 -0
  1049. package/corpus/templates/content/shared/api.ts +1 -0
  1050. package/corpus/templates/content/shared/builder-docs-blocks.ts +361 -0
  1051. package/corpus/templates/content/shared/builder-mdx.ts +1037 -0
  1052. package/corpus/templates/content/shared/content-source.ts +6 -0
  1053. package/corpus/templates/content/shared/nfm-registry.ts +4 -0
  1054. package/corpus/templates/content/vite.config.ts +13 -0
  1055. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +137 -0
  1056. package/corpus/templates/design/AGENTS.md +95 -5
  1057. package/corpus/templates/design/DESIGN.md +82 -0
  1058. package/corpus/templates/design/DEVELOPING.md +43 -0
  1059. package/corpus/templates/design/actions/add-localhost-screens.ts +426 -0
  1060. package/corpus/templates/design/actions/apply-shader.ts +277 -0
  1061. package/corpus/templates/design/actions/apply-visual-edit.ts +303 -0
  1062. package/corpus/templates/design/actions/connect-localhost.ts +183 -0
  1063. package/corpus/templates/design/actions/edit-design.ts +195 -42
  1064. package/corpus/templates/design/actions/generate-design.ts +71 -1
  1065. package/corpus/templates/design/actions/generate-screens.ts +193 -0
  1066. package/corpus/templates/design/actions/get-code-layer-projection.ts +191 -0
  1067. package/corpus/templates/design/actions/get-shader.ts +119 -0
  1068. package/corpus/templates/design/actions/list-localhost-connections.ts +95 -0
  1069. package/corpus/templates/design/actions/navigate.ts +55 -2
  1070. package/corpus/templates/design/actions/view-screen.ts +68 -1
  1071. package/corpus/templates/design/agent-native.app-skill.json +10 -0
  1072. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +761 -0
  1073. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +2057 -103
  1074. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +74 -38
  1075. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +399 -0
  1076. package/corpus/templates/design/app/components/design/EditPanel.tsx +3185 -439
  1077. package/corpus/templates/design/app/components/design/LayersPanel.tsx +1124 -0
  1078. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +3116 -147
  1079. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +700 -13
  1080. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +107 -63
  1081. package/corpus/templates/design/app/components/design/index.ts +0 -5
  1082. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +286 -0
  1083. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +699 -0
  1084. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +461 -0
  1085. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +166 -0
  1086. package/corpus/templates/design/app/components/design/inspector/FigmaColorPicker.tsx +1420 -0
  1087. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +420 -0
  1088. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +215 -0
  1089. package/corpus/templates/design/app/components/design/inspector/ShaderControls.stories.tsx +71 -0
  1090. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +518 -0
  1091. package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +106 -0
  1092. package/corpus/templates/design/app/components/design/inspector/figma-icons.tsx +361 -0
  1093. package/corpus/templates/design/app/components/design/inspector/index.ts +60 -0
  1094. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +201 -0
  1095. package/corpus/templates/design/app/components/design/types.ts +23 -0
  1096. package/corpus/templates/design/app/components/layout/Layout.tsx +24 -13
  1097. package/corpus/templates/design/app/components/layout/Sidebar.tsx +4 -4
  1098. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +474 -36
  1099. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +22 -5
  1100. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +24 -11
  1101. package/corpus/templates/design/app/global.css +121 -3
  1102. package/corpus/templates/design/app/hooks/use-agent-generating.ts +4 -0
  1103. package/corpus/templates/design/app/hooks/use-navigation-state.ts +130 -8
  1104. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +329 -0
  1105. package/corpus/templates/design/app/i18n/zh-TW.ts +264 -0
  1106. package/corpus/templates/design/app/i18n-data.ts +2790 -1
  1107. package/corpus/templates/design/app/pages/DesignEditor.tsx +5108 -851
  1108. package/corpus/templates/design/changelog/2026-06-28-annotate-mode-now-combines-drawing-and-comment-pins-in-one-c.md +6 -0
  1109. package/corpus/templates/design/changelog/2026-06-28-design-editor-panel-borders-are-cleaner-so-the-canvas-edge-s.md +6 -0
  1110. package/corpus/templates/design/changelog/2026-06-28-drawing-prompts-now-reliably-open-and-submit-to-the-design-a.md +6 -0
  1111. package/corpus/templates/design/changelog/2026-06-28-editor-app-menus-now-use-an-outline-agent-native-mark-with-b.md +6 -0
  1112. package/corpus/templates/design/changelog/2026-06-28-figma-style-code-design-mode.md +6 -0
  1113. package/corpus/templates/design/changelog/2026-06-28-layer-selection-now-updates-chat-context-without-opening-the.md +6 -0
  1114. package/corpus/templates/design/changelog/2026-06-28-layer-selections-now-preserve-hidden-and-locked-canvas-state.md +6 -0
  1115. package/corpus/templates/design/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  1116. package/corpus/templates/design/changelog/2026-06-28-live-cursors-now-keep-names-beside-a-cleaner-pointer-marker.md +6 -0
  1117. package/corpus/templates/design/changelog/2026-06-28-mode-switching-now-lives-in-a-compact-bottom-right-icon-dock.md +6 -0
  1118. package/corpus/templates/design/changelog/2026-06-28-screen-overview-now-handles-zooming-drawing-opening-and-dele.md +6 -0
  1119. package/corpus/templates/design/changelog/2026-06-28-screen-overview-now-selects-screens-on-click-and-opens-them-.md +6 -0
  1120. package/corpus/templates/design/changelog/2026-06-28-screen-overview-zooms-into-the-active-screen-with-smoother-e.md +6 -0
  1121. package/corpus/templates/design/changelog/2026-06-28-selected-element-chips-in-chat-are-shorter-and-easier-to-sca.md +6 -0
  1122. package/corpus/templates/design/changelog/2026-06-28-the-design-editor-toolbar-is-more-compact-and-the-app-menu-m.md +6 -0
  1123. package/corpus/templates/design/changelog/2026-06-28-tweaks-now-live-at-the-top-of-the-design-sidebar-instead-of-.md +6 -0
  1124. package/corpus/templates/design/changelog/2026-06-28-tweaks-now-live-in-the-right-inspector-beside-the-design-tab.md +6 -0
  1125. package/corpus/templates/design/changelog/2026-06-29-active-sidebar-rows-use-soft-highlights.md +6 -0
  1126. package/corpus/templates/design/changelog/2026-06-29-agents-can-now-open-screen-overview-focus-screens-and-add.md +6 -0
  1127. package/corpus/templates/design/changelog/2026-06-29-design-agents-now-edit-broad-copy-changes-more-reliably.md +6 -0
  1128. package/corpus/templates/design/changelog/2026-06-29-design-editor-extensions-now-run-inline-beside-the-artboard.md +6 -0
  1129. package/corpus/templates/design/changelog/2026-06-29-sidebars-use-darker-chrome-and-chat-warns-immediately.md +6 -0
  1130. package/corpus/templates/design/changelog/2026-06-29-visual-edit-can-open-localhost-routes-as-url-backed-screens.md +6 -0
  1131. package/corpus/templates/design/package.json +1 -0
  1132. package/corpus/templates/design/server/db/schema.ts +26 -0
  1133. package/corpus/templates/design/server/lib/design-snapshot.ts +1 -1
  1134. package/corpus/templates/design/server/plugins/agent-chat.ts +3 -0
  1135. package/corpus/templates/design/shared/api.ts +27 -0
  1136. package/corpus/templates/design/shared/canvas-frames.ts +103 -0
  1137. package/corpus/templates/design/shared/canvas-math.ts +1058 -0
  1138. package/corpus/templates/design/shared/code-layer.ts +2212 -0
  1139. package/corpus/templates/design/shared/color-utils.ts +180 -0
  1140. package/corpus/templates/design/shared/generation-session.ts +61 -0
  1141. package/corpus/templates/design/shared/shader-presets.ts +782 -0
  1142. package/corpus/templates/design/shared/shader-safety.ts +137 -0
  1143. package/corpus/templates/design/shared/source-mode.ts +237 -0
  1144. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +149 -6
  1145. package/corpus/templates/forms/app/i18n/ar-SA.ts +2 -0
  1146. package/corpus/templates/forms/app/i18n/de-DE.ts +2 -0
  1147. package/corpus/templates/forms/app/i18n/en-US.ts +2 -0
  1148. package/corpus/templates/forms/app/i18n/es-ES.ts +2 -0
  1149. package/corpus/templates/forms/app/i18n/fr-FR.ts +2 -0
  1150. package/corpus/templates/forms/app/i18n/hi-IN.ts +2 -0
  1151. package/corpus/templates/forms/app/i18n/ja-JP.ts +2 -0
  1152. package/corpus/templates/forms/app/i18n/ko-KR.ts +2 -0
  1153. package/corpus/templates/forms/app/i18n/pt-BR.ts +2 -0
  1154. package/corpus/templates/forms/app/i18n/zh-CN.ts +2 -0
  1155. package/corpus/templates/forms/app/i18n/zh-TW.ts +2 -0
  1156. package/corpus/templates/forms/changelog/2026-06-28-left-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  1157. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +2 -2
  1158. package/corpus/templates/macros/changelog/2026-06-28-left-sidebar-footer-controls-use-less-divider-chrome.md +6 -0
  1159. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +408 -247
  1160. package/corpus/templates/mail/app/i18n/ar-SA.ts +4 -0
  1161. package/corpus/templates/mail/app/i18n/de-DE.ts +4 -0
  1162. package/corpus/templates/mail/app/i18n/en-US.ts +4 -0
  1163. package/corpus/templates/mail/app/i18n/es-ES.ts +4 -0
  1164. package/corpus/templates/mail/app/i18n/fr-FR.ts +4 -0
  1165. package/corpus/templates/mail/app/i18n/hi-IN.ts +4 -0
  1166. package/corpus/templates/mail/app/i18n/ja-JP.ts +4 -0
  1167. package/corpus/templates/mail/app/i18n/ko-KR.ts +4 -0
  1168. package/corpus/templates/mail/app/i18n/pt-BR.ts +4 -0
  1169. package/corpus/templates/mail/app/i18n/zh-CN.ts +4 -0
  1170. package/corpus/templates/mail/app/i18n/zh-TW.ts +4 -0
  1171. package/corpus/templates/mail/changelog/2026-06-28-pinned-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  1172. package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +25 -92
  1173. package/corpus/templates/plan/.agents/skills/visual-plan/references/connection.md +51 -0
  1174. package/corpus/templates/plan/.agents/skills/visual-plan/references/document-quality.md +5 -1
  1175. package/corpus/templates/plan/.agents/skills/visual-plan/references/local-files.md +85 -0
  1176. package/corpus/templates/plan/.agents/skills/visual-plan/references/wireframe.md +21 -0
  1177. package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +32 -104
  1178. package/corpus/templates/plan/.agents/skills/visual-recap/references/connection.md +51 -0
  1179. package/corpus/templates/plan/.agents/skills/visual-recap/references/local-files.md +85 -0
  1180. package/corpus/templates/plan/.agents/skills/visual-recap/references/wireframe.md +21 -0
  1181. package/corpus/templates/plan/actions/create-prototype-plan.ts +1 -1
  1182. package/corpus/templates/plan/actions/delete-visual-plan.ts +2 -2
  1183. package/corpus/templates/plan/actions/get-plan-blocks.ts +2 -0
  1184. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +6 -8
  1185. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +25 -29
  1186. package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +10 -5
  1187. package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +15 -3
  1188. package/corpus/templates/plan/app/components/plan/wireframe/kit/rough.tsx +6 -6
  1189. package/corpus/templates/plan/app/components/plan/wireframe/sanitize-html.ts +71 -6
  1190. package/corpus/templates/plan/app/global.css +67 -81
  1191. package/corpus/templates/plan/app/pages/PlansPage.tsx +8 -0
  1192. package/corpus/templates/plan/app/root.tsx +31 -1
  1193. package/corpus/templates/plan/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  1194. package/corpus/templates/plan/changelog/2026-06-28-plan-canvases-stay-stable-while-panning-and-zooming-in-chrom.md +6 -0
  1195. package/corpus/templates/plan/changelog/2026-06-28-plan-wireframes-avoid-overlapping-sketch-lines-in-dense-mockups.md +6 -0
  1196. package/corpus/templates/plan/changelog/2026-06-28-plan-wireframes-ignore-host-color-utility-classes-so-canvas-.md +6 -0
  1197. package/corpus/templates/plan/changelog/2026-06-28-plans-use-the-shared-neutral-light-and-dark-theme.md +6 -0
  1198. package/corpus/templates/plan/changelog/2026-06-28-sending-open-feedback-from-a-plan-now-opens-the-inline-plan-.md +6 -0
  1199. package/corpus/templates/plan/changelog/2026-06-28-wireframe-style-can-now-be-switched-between-sketchy-and-clean.md +6 -0
  1200. package/corpus/templates/plan/server/plan-content.ts +62 -3
  1201. package/corpus/templates/plan/server/plan-mdx.ts +177 -2
  1202. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +5 -5
  1203. package/corpus/templates/slides/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  1204. package/corpus/templates/videos/app/components/Sidebar.tsx +2 -2
  1205. package/corpus/templates/videos/app/components/layout/Layout.tsx +29 -2
  1206. package/corpus/templates/videos/app/components/layout/NavSidebar.tsx +113 -30
  1207. package/corpus/templates/videos/app/i18n/ar-SA.ts +2 -0
  1208. package/corpus/templates/videos/app/i18n/de-DE.ts +2 -0
  1209. package/corpus/templates/videos/app/i18n/en-US.ts +2 -0
  1210. package/corpus/templates/videos/app/i18n/es-ES.ts +2 -0
  1211. package/corpus/templates/videos/app/i18n/fr-FR.ts +2 -0
  1212. package/corpus/templates/videos/app/i18n/hi-IN.ts +2 -0
  1213. package/corpus/templates/videos/app/i18n/ja-JP.ts +2 -0
  1214. package/corpus/templates/videos/app/i18n/ko-KR.ts +2 -0
  1215. package/corpus/templates/videos/app/i18n/pt-BR.ts +2 -0
  1216. package/corpus/templates/videos/app/i18n/zh-CN.ts +2 -0
  1217. package/corpus/templates/videos/app/i18n/zh-TW.ts +2 -0
  1218. package/corpus/templates/videos/changelog/2026-06-28-left-sidebar-collapses-into-an-animated-icon-rail.md +6 -0
  1219. package/dist/agent/engine/index.d.ts +1 -1
  1220. package/dist/agent/engine/index.d.ts.map +1 -1
  1221. package/dist/agent/engine/index.js +1 -1
  1222. package/dist/agent/engine/index.js.map +1 -1
  1223. package/dist/agent/engine/registry.d.ts +9 -0
  1224. package/dist/agent/engine/registry.d.ts.map +1 -1
  1225. package/dist/agent/engine/registry.js +37 -0
  1226. package/dist/agent/engine/registry.js.map +1 -1
  1227. package/dist/agent/production-agent.d.ts.map +1 -1
  1228. package/dist/agent/production-agent.js +4 -3
  1229. package/dist/agent/production-agent.js.map +1 -1
  1230. package/dist/application-state/store.js +5 -5
  1231. package/dist/application-state/store.js.map +1 -1
  1232. package/dist/chat-threads/store.js +2 -2
  1233. package/dist/chat-threads/store.js.map +1 -1
  1234. package/dist/cli/content-local.d.ts +31 -0
  1235. package/dist/cli/content-local.d.ts.map +1 -0
  1236. package/dist/cli/content-local.js +300 -0
  1237. package/dist/cli/content-local.js.map +1 -0
  1238. package/dist/cli/design-connect.d.ts +52 -0
  1239. package/dist/cli/design-connect.d.ts.map +1 -0
  1240. package/dist/cli/design-connect.js +409 -0
  1241. package/dist/cli/design-connect.js.map +1 -0
  1242. package/dist/cli/index.js +31 -0
  1243. package/dist/cli/index.js.map +1 -1
  1244. package/dist/cli/skills.d.ts +13 -4
  1245. package/dist/cli/skills.d.ts.map +1 -1
  1246. package/dist/cli/skills.js +348 -200
  1247. package/dist/cli/skills.js.map +1 -1
  1248. package/dist/client/AssistantChat.d.ts.map +1 -1
  1249. package/dist/client/AssistantChat.js +34 -4
  1250. package/dist/client/AssistantChat.js.map +1 -1
  1251. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  1252. package/dist/client/MultiTabAssistantChat.js +8 -69
  1253. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  1254. package/dist/client/agent-chat.d.ts +6 -0
  1255. package/dist/client/agent-chat.d.ts.map +1 -1
  1256. package/dist/client/agent-chat.js +17 -3
  1257. package/dist/client/agent-chat.js.map +1 -1
  1258. package/dist/client/analytics.d.ts.map +1 -1
  1259. package/dist/client/analytics.js +48 -13
  1260. package/dist/client/analytics.js.map +1 -1
  1261. package/dist/client/blocks/index.d.ts +1 -1
  1262. package/dist/client/blocks/index.d.ts.map +1 -1
  1263. package/dist/client/blocks/index.js +1 -1
  1264. package/dist/client/blocks/index.js.map +1 -1
  1265. package/dist/client/blocks/library/MermaidBlock.js +1 -1
  1266. package/dist/client/blocks/library/MermaidBlock.js.map +1 -1
  1267. package/dist/client/blocks/library/diagram.config.d.ts +9 -9
  1268. package/dist/client/blocks/library/diagram.config.d.ts.map +1 -1
  1269. package/dist/client/blocks/library/diagram.config.js +36 -12
  1270. package/dist/client/blocks/library/diagram.config.js.map +1 -1
  1271. package/dist/client/blocks/library/diagram.js +1 -1
  1272. package/dist/client/blocks/library/diagram.js.map +1 -1
  1273. package/dist/client/blocks/library/sanitize-html.d.ts +3 -1
  1274. package/dist/client/blocks/library/sanitize-html.d.ts.map +1 -1
  1275. package/dist/client/blocks/library/sanitize-html.js +53 -5
  1276. package/dist/client/blocks/library/sanitize-html.js.map +1 -1
  1277. package/dist/client/blocks/library/wireframe-kit.d.ts +2 -2
  1278. package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
  1279. package/dist/client/blocks/library/wireframe-kit.js +2 -2
  1280. package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
  1281. package/dist/client/blocks/library/wireframe.d.ts.map +1 -1
  1282. package/dist/client/blocks/library/wireframe.js +5 -2
  1283. package/dist/client/blocks/library/wireframe.js.map +1 -1
  1284. package/dist/client/blocks/mdx.d.ts +11 -0
  1285. package/dist/client/blocks/mdx.d.ts.map +1 -1
  1286. package/dist/client/blocks/mdx.js +47 -1
  1287. package/dist/client/blocks/mdx.js.map +1 -1
  1288. package/dist/client/blocks/server.d.ts +1 -1
  1289. package/dist/client/blocks/server.d.ts.map +1 -1
  1290. package/dist/client/blocks/server.js +1 -1
  1291. package/dist/client/blocks/server.js.map +1 -1
  1292. package/dist/client/blocks/types.d.ts +5 -4
  1293. package/dist/client/blocks/types.d.ts.map +1 -1
  1294. package/dist/client/blocks/types.js.map +1 -1
  1295. package/dist/client/chat/message-components.d.ts.map +1 -1
  1296. package/dist/client/chat/message-components.js +2 -12
  1297. package/dist/client/chat/message-components.js.map +1 -1
  1298. package/dist/client/chat-model-groups.d.ts +22 -0
  1299. package/dist/client/chat-model-groups.d.ts.map +1 -0
  1300. package/dist/client/chat-model-groups.js +93 -0
  1301. package/dist/client/chat-model-groups.js.map +1 -0
  1302. package/dist/client/components/LiveCursorOverlay.d.ts +1 -2
  1303. package/dist/client/components/LiveCursorOverlay.d.ts.map +1 -1
  1304. package/dist/client/components/LiveCursorOverlay.js +19 -40
  1305. package/dist/client/components/LiveCursorOverlay.js.map +1 -1
  1306. package/dist/client/components/ui/dialog.d.ts +14 -0
  1307. package/dist/client/components/ui/dialog.d.ts.map +1 -0
  1308. package/dist/client/components/ui/dialog.js +21 -0
  1309. package/dist/client/components/ui/dialog.js.map +1 -0
  1310. package/dist/client/composer/ComposerPlusMenu.d.ts.map +1 -1
  1311. package/dist/client/composer/ComposerPlusMenu.js +24 -149
  1312. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  1313. package/dist/client/composer/TiptapComposer.d.ts +3 -1
  1314. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  1315. package/dist/client/composer/TiptapComposer.js +86 -24
  1316. package/dist/client/composer/TiptapComposer.js.map +1 -1
  1317. package/dist/client/composer/useVoiceDictation.d.ts +9 -0
  1318. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
  1319. package/dist/client/composer/useVoiceDictation.js +154 -32
  1320. package/dist/client/composer/useVoiceDictation.js.map +1 -1
  1321. package/dist/client/frame-protocol.d.ts +17 -2
  1322. package/dist/client/frame-protocol.d.ts.map +1 -1
  1323. package/dist/client/frame-protocol.js.map +1 -1
  1324. package/dist/client/index.d.ts +1 -1
  1325. package/dist/client/index.d.ts.map +1 -1
  1326. package/dist/client/index.js +1 -1
  1327. package/dist/client/index.js.map +1 -1
  1328. package/dist/client/resources/McpIntegrationDialog.d.ts +13 -0
  1329. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -0
  1330. package/dist/client/resources/McpIntegrationDialog.js +261 -0
  1331. package/dist/client/resources/McpIntegrationDialog.js.map +1 -0
  1332. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  1333. package/dist/client/resources/ResourcesPanel.js +74 -190
  1334. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  1335. package/dist/client/resources/mcp-integration-catalog.d.ts +30 -0
  1336. package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -0
  1337. package/dist/client/resources/mcp-integration-catalog.js +191 -0
  1338. package/dist/client/resources/mcp-integration-catalog.js.map +1 -0
  1339. package/dist/client/rich-markdown-editor/RegistryBlockNode.js +2 -2
  1340. package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
  1341. package/dist/client/settings/SettingsPanel.js +1 -1
  1342. package/dist/client/settings/SettingsPanel.js.map +1 -1
  1343. package/dist/client/sharing/ShareButton.d.ts +2 -0
  1344. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  1345. package/dist/client/sharing/ShareButton.js +7 -6
  1346. package/dist/client/sharing/ShareButton.js.map +1 -1
  1347. package/dist/client/use-agent-engine-configured.d.ts +5 -0
  1348. package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
  1349. package/dist/client/use-agent-engine-configured.js +51 -25
  1350. package/dist/client/use-agent-engine-configured.js.map +1 -1
  1351. package/dist/client/use-chat-models.d.ts +2 -7
  1352. package/dist/client/use-chat-models.d.ts.map +1 -1
  1353. package/dist/client/use-chat-models.js +8 -78
  1354. package/dist/client/use-chat-models.js.map +1 -1
  1355. package/dist/collab/awareness.d.ts +2 -2
  1356. package/dist/collab/awareness.d.ts.map +1 -1
  1357. package/dist/collab/routes.d.ts +2 -2
  1358. package/dist/db/client.d.ts.map +1 -1
  1359. package/dist/db/client.js +0 -5
  1360. package/dist/db/client.js.map +1 -1
  1361. package/dist/integrations/adapters/email.js +2 -2
  1362. package/dist/integrations/adapters/email.js.map +1 -1
  1363. package/dist/local-artifacts/index.d.ts +6 -0
  1364. package/dist/local-artifacts/index.d.ts.map +1 -1
  1365. package/dist/local-artifacts/index.js +12 -0
  1366. package/dist/local-artifacts/index.js.map +1 -1
  1367. package/dist/localization/default-messages.d.ts +76 -0
  1368. package/dist/localization/default-messages.d.ts.map +1 -1
  1369. package/dist/localization/default-messages.js +76 -0
  1370. package/dist/localization/default-messages.js.map +1 -1
  1371. package/dist/localization/shared.d.ts +1 -1
  1372. package/dist/localization/shared.js +3 -3
  1373. package/dist/localization/shared.js.map +1 -1
  1374. package/dist/notifications/routes.d.ts +3 -3
  1375. package/dist/observability/routes.d.ts +6 -6
  1376. package/dist/org/handlers.js +2 -2
  1377. package/dist/org/handlers.js.map +1 -1
  1378. package/dist/progress/routes.d.ts +1 -1
  1379. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  1380. package/dist/resources/handlers.d.ts +2 -2
  1381. package/dist/resources/store.js +7 -7
  1382. package/dist/resources/store.js.map +1 -1
  1383. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  1384. package/dist/server/core-routes-plugin.d.ts +1 -0
  1385. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  1386. package/dist/server/core-routes-plugin.js +29 -11
  1387. package/dist/server/core-routes-plugin.js.map +1 -1
  1388. package/dist/server/transcribe-voice.d.ts +1 -1
  1389. package/dist/server/transcribe-voice.d.ts.map +1 -1
  1390. package/dist/server/transcribe-voice.js +40 -24
  1391. package/dist/server/transcribe-voice.js.map +1 -1
  1392. package/dist/shared/mcp-embed-headers.d.ts +1 -0
  1393. package/dist/shared/mcp-embed-headers.d.ts.map +1 -1
  1394. package/dist/shared/mcp-embed-headers.js +20 -1
  1395. package/dist/shared/mcp-embed-headers.js.map +1 -1
  1396. package/dist/shared/mcp-integration-config.d.ts +27 -0
  1397. package/dist/shared/mcp-integration-config.d.ts.map +1 -0
  1398. package/dist/shared/mcp-integration-config.js +56 -0
  1399. package/dist/shared/mcp-integration-config.js.map +1 -0
  1400. package/dist/styles/agent-native.css +58 -107
  1401. package/dist/styles/blocks.css +15 -3
  1402. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +10 -0
  1403. package/dist/vite/client.d.ts +11 -0
  1404. package/dist/vite/client.d.ts.map +1 -1
  1405. package/dist/vite/client.js +4 -0
  1406. package/dist/vite/client.js.map +1 -1
  1407. package/dist/voice/index.d.ts +5 -0
  1408. package/dist/voice/index.d.ts.map +1 -0
  1409. package/dist/voice/index.js +4 -0
  1410. package/dist/voice/index.js.map +1 -0
  1411. package/dist/voice/voice-cleanup-prompt.d.ts +6 -0
  1412. package/dist/voice/voice-cleanup-prompt.d.ts.map +1 -0
  1413. package/dist/voice/voice-cleanup-prompt.js +26 -0
  1414. package/dist/voice/voice-cleanup-prompt.js.map +1 -0
  1415. package/dist/voice/voice-context.d.ts +25 -0
  1416. package/dist/voice/voice-context.d.ts.map +1 -0
  1417. package/dist/voice/voice-context.js +156 -0
  1418. package/dist/voice/voice-context.js.map +1 -0
  1419. package/dist/voice/voice-replacements.d.ts +4 -0
  1420. package/dist/voice/voice-replacements.d.ts.map +1 -0
  1421. package/dist/voice/voice-replacements.js +52 -0
  1422. package/dist/voice/voice-replacements.js.map +1 -0
  1423. package/docs/content/a2a-protocol.mdx +97 -9
  1424. package/docs/content/actions.mdx +65 -4
  1425. package/docs/content/agent-mentions.mdx +68 -4
  1426. package/docs/content/agent-surfaces.mdx +112 -8
  1427. package/docs/content/agent-teams.mdx +171 -12
  1428. package/docs/content/agent-web-surfaces.mdx +51 -4
  1429. package/docs/content/authentication.mdx +122 -8
  1430. package/docs/content/automations.mdx +110 -8
  1431. package/docs/content/blueprint-installer.mdx +42 -4
  1432. package/docs/content/cli-adapters.mdx +44 -4
  1433. package/docs/content/client.mdx +79 -8
  1434. package/docs/content/cloneable-saas.mdx +85 -8
  1435. package/docs/content/code-agents-ui.mdx +98 -8
  1436. package/docs/content/components.mdx +118 -8
  1437. package/docs/content/context-awareness.mdx +98 -8
  1438. package/docs/content/creating-templates.mdx +49 -4
  1439. package/docs/content/cross-app-sso.mdx +109 -8
  1440. package/docs/content/database.mdx +56 -4
  1441. package/docs/content/deployment.mdx +103 -8
  1442. package/docs/content/dispatch.mdx +134 -8
  1443. package/docs/content/drop-in-agent.mdx +63 -4
  1444. package/docs/content/durable-background-runs.mdx +98 -8
  1445. package/docs/content/durable-resume.mdx +47 -4
  1446. package/docs/content/embedding-sdk.mdx +83 -8
  1447. package/docs/content/evals.mdx +102 -8
  1448. package/docs/content/extensions.mdx +113 -9
  1449. package/docs/content/external-agents.mdx +119 -8
  1450. package/docs/content/faq.mdx +98 -8
  1451. package/docs/content/file-uploads.mdx +61 -4
  1452. package/docs/content/frames.mdx +90 -8
  1453. package/docs/content/generative-ui.mdx +50 -4
  1454. package/docs/content/getting-started.mdx +34 -4
  1455. package/docs/content/harness-agents.mdx +77 -8
  1456. package/docs/content/human-approval.mdx +50 -4
  1457. package/docs/content/key-concepts.mdx +102 -8
  1458. package/docs/content/local-file-mode.mdx +58 -4
  1459. package/docs/content/locales/ar-SA/a2a-protocol.mdx +97 -9
  1460. package/docs/content/locales/ar-SA/actions.mdx +65 -4
  1461. package/docs/content/locales/ar-SA/agent-mentions.mdx +68 -4
  1462. package/docs/content/locales/ar-SA/agent-surfaces.mdx +114 -8
  1463. package/docs/content/locales/ar-SA/agent-teams.mdx +174 -12
  1464. package/docs/content/locales/ar-SA/agent-web-surfaces.mdx +49 -4
  1465. package/docs/content/locales/ar-SA/authentication.mdx +120 -8
  1466. package/docs/content/locales/ar-SA/automations.mdx +110 -8
  1467. package/docs/content/locales/ar-SA/blueprint-installer.mdx +42 -4
  1468. package/docs/content/locales/ar-SA/cli-adapters.mdx +40 -4
  1469. package/docs/content/locales/ar-SA/client.mdx +80 -8
  1470. package/docs/content/locales/ar-SA/cloneable-saas.mdx +85 -8
  1471. package/docs/content/locales/ar-SA/code-agents-ui.mdx +99 -8
  1472. package/docs/content/locales/ar-SA/components.mdx +114 -8
  1473. package/docs/content/locales/ar-SA/context-awareness.mdx +100 -8
  1474. package/docs/content/locales/ar-SA/creating-templates.mdx +51 -4
  1475. package/docs/content/locales/ar-SA/cross-app-sso.mdx +109 -8
  1476. package/docs/content/locales/ar-SA/database.mdx +52 -4
  1477. package/docs/content/locales/ar-SA/deployment.mdx +103 -8
  1478. package/docs/content/locales/ar-SA/dispatch.mdx +134 -8
  1479. package/docs/content/locales/ar-SA/drop-in-agent.mdx +63 -4
  1480. package/docs/content/locales/ar-SA/durable-resume.mdx +47 -4
  1481. package/docs/content/locales/ar-SA/embedding-sdk.mdx +83 -8
  1482. package/docs/content/locales/ar-SA/evals.mdx +102 -8
  1483. package/docs/content/locales/ar-SA/extensions.mdx +113 -9
  1484. package/docs/content/locales/ar-SA/external-agents.mdx +119 -8
  1485. package/docs/content/locales/ar-SA/faq.mdx +98 -8
  1486. package/docs/content/locales/ar-SA/file-uploads.mdx +61 -4
  1487. package/docs/content/locales/ar-SA/frames.mdx +88 -8
  1488. package/docs/content/locales/ar-SA/getting-started.mdx +34 -4
  1489. package/docs/content/locales/ar-SA/harness-agents.mdx +79 -8
  1490. package/docs/content/locales/ar-SA/human-approval.mdx +50 -4
  1491. package/docs/content/locales/ar-SA/key-concepts.mdx +107 -8
  1492. package/docs/content/locales/ar-SA/local-file-mode.mdx +56 -4
  1493. package/docs/content/locales/ar-SA/mcp-apps.mdx +120 -10
  1494. package/docs/content/locales/ar-SA/mcp-clients.mdx +133 -8
  1495. package/docs/content/locales/ar-SA/mcp-protocol.mdx +105 -8
  1496. package/docs/content/locales/ar-SA/messaging.mdx +115 -8
  1497. package/docs/content/locales/ar-SA/migration-workbench.mdx +47 -4
  1498. package/docs/content/locales/ar-SA/multi-app-workspace.mdx +91 -8
  1499. package/docs/content/locales/ar-SA/multi-tenancy.mdx +80 -8
  1500. package/docs/content/locales/ar-SA/native-chat-ui.mdx +104 -8
  1501. package/docs/content/locales/ar-SA/notifications.mdx +135 -8
  1502. package/docs/content/locales/ar-SA/observability.mdx +102 -8
  1503. package/docs/content/locales/ar-SA/observational-memory.mdx +87 -8
  1504. package/docs/content/locales/ar-SA/onboarding.mdx +45 -4
  1505. package/docs/content/locales/ar-SA/plan-plugin.mdx +99 -8
  1506. package/docs/content/locales/ar-SA/pr-visual-recap.mdx +125 -8
  1507. package/docs/content/locales/ar-SA/processors.mdx +41 -4
  1508. package/docs/content/locales/ar-SA/progress.mdx +46 -4
  1509. package/docs/content/locales/ar-SA/pure-agent-apps.mdx +48 -4
  1510. package/docs/content/locales/ar-SA/real-time-collaboration.mdx +102 -8
  1511. package/docs/content/locales/ar-SA/recurring-jobs.mdx +59 -4
  1512. package/docs/content/locales/ar-SA/routing.mdx +44 -5
  1513. package/docs/content/locales/ar-SA/sandbox-adapters.mdx +43 -4
  1514. package/docs/content/locales/ar-SA/security.mdx +80 -8
  1515. package/docs/content/locales/ar-SA/server.mdx +173 -12
  1516. package/docs/content/locales/ar-SA/sharing.mdx +45 -4
  1517. package/docs/content/locales/ar-SA/skills-guide.mdx +118 -9
  1518. package/docs/content/locales/ar-SA/template-analytics.mdx +46 -4
  1519. package/docs/content/locales/ar-SA/template-assets.mdx +62 -4
  1520. package/docs/content/locales/ar-SA/template-brain.mdx +65 -4
  1521. package/docs/content/locales/ar-SA/template-calendar.mdx +62 -4
  1522. package/docs/content/locales/ar-SA/template-chat.mdx +61 -4
  1523. package/docs/content/locales/ar-SA/template-clips.mdx +52 -4
  1524. package/docs/content/locales/ar-SA/template-content.mdx +62 -4
  1525. package/docs/content/locales/ar-SA/template-design.mdx +101 -4
  1526. package/docs/content/locales/ar-SA/template-dispatch.mdx +57 -4
  1527. package/docs/content/locales/ar-SA/template-forms.mdx +62 -4
  1528. package/docs/content/locales/ar-SA/template-mail.mdx +60 -4
  1529. package/docs/content/locales/ar-SA/template-plan.mdx +61 -4
  1530. package/docs/content/locales/ar-SA/template-slides.mdx +49 -4
  1531. package/docs/content/locales/ar-SA/template-videos.mdx +53 -4
  1532. package/docs/content/locales/ar-SA/tracking.mdx +54 -4
  1533. package/docs/content/locales/ar-SA/using-your-agent.mdx +51 -4
  1534. package/docs/content/locales/ar-SA/voice-input.mdx +43 -4
  1535. package/docs/content/locales/ar-SA/what-is-agent-native.mdx +96 -8
  1536. package/docs/content/locales/ar-SA/workspace-connections.mdx +128 -8
  1537. package/docs/content/locales/ar-SA/workspace-management.mdx +50 -4
  1538. package/docs/content/locales/ar-SA/workspace.mdx +112 -8
  1539. package/docs/content/locales/ar-SA/writing-agent-instructions.mdx +41 -4
  1540. package/docs/content/locales/de-DE/a2a-protocol.mdx +99 -9
  1541. package/docs/content/locales/de-DE/actions.mdx +67 -4
  1542. package/docs/content/locales/de-DE/agent-mentions.mdx +68 -4
  1543. package/docs/content/locales/de-DE/agent-surfaces.mdx +116 -8
  1544. package/docs/content/locales/de-DE/agent-teams.mdx +171 -12
  1545. package/docs/content/locales/de-DE/agent-web-surfaces.mdx +51 -4
  1546. package/docs/content/locales/de-DE/authentication.mdx +122 -8
  1547. package/docs/content/locales/de-DE/automations.mdx +110 -8
  1548. package/docs/content/locales/de-DE/blueprint-installer.mdx +42 -4
  1549. package/docs/content/locales/de-DE/cli-adapters.mdx +44 -4
  1550. package/docs/content/locales/de-DE/client.mdx +79 -8
  1551. package/docs/content/locales/de-DE/cloneable-saas.mdx +85 -8
  1552. package/docs/content/locales/de-DE/code-agents-ui.mdx +100 -8
  1553. package/docs/content/locales/de-DE/components.mdx +118 -8
  1554. package/docs/content/locales/de-DE/context-awareness.mdx +98 -8
  1555. package/docs/content/locales/de-DE/creating-templates.mdx +51 -4
  1556. package/docs/content/locales/de-DE/cross-app-sso.mdx +109 -8
  1557. package/docs/content/locales/de-DE/database.mdx +52 -4
  1558. package/docs/content/locales/de-DE/deployment.mdx +103 -8
  1559. package/docs/content/locales/de-DE/dispatch.mdx +134 -8
  1560. package/docs/content/locales/de-DE/drop-in-agent.mdx +63 -4
  1561. package/docs/content/locales/de-DE/durable-resume.mdx +47 -4
  1562. package/docs/content/locales/de-DE/embedding-sdk.mdx +85 -8
  1563. package/docs/content/locales/de-DE/evals.mdx +102 -8
  1564. package/docs/content/locales/de-DE/extensions.mdx +113 -9
  1565. package/docs/content/locales/de-DE/external-agents.mdx +119 -8
  1566. package/docs/content/locales/de-DE/faq.mdx +98 -8
  1567. package/docs/content/locales/de-DE/file-uploads.mdx +61 -4
  1568. package/docs/content/locales/de-DE/frames.mdx +88 -8
  1569. package/docs/content/locales/de-DE/getting-started.mdx +34 -4
  1570. package/docs/content/locales/de-DE/harness-agents.mdx +79 -8
  1571. package/docs/content/locales/de-DE/human-approval.mdx +50 -4
  1572. package/docs/content/locales/de-DE/key-concepts.mdx +104 -8
  1573. package/docs/content/locales/de-DE/local-file-mode.mdx +58 -4
  1574. package/docs/content/locales/de-DE/mcp-apps.mdx +120 -10
  1575. package/docs/content/locales/de-DE/mcp-clients.mdx +133 -8
  1576. package/docs/content/locales/de-DE/mcp-protocol.mdx +105 -8
  1577. package/docs/content/locales/de-DE/messaging.mdx +115 -8
  1578. package/docs/content/locales/de-DE/migration-workbench.mdx +47 -4
  1579. package/docs/content/locales/de-DE/multi-app-workspace.mdx +91 -8
  1580. package/docs/content/locales/de-DE/multi-tenancy.mdx +80 -8
  1581. package/docs/content/locales/de-DE/native-chat-ui.mdx +108 -8
  1582. package/docs/content/locales/de-DE/notifications.mdx +135 -8
  1583. package/docs/content/locales/de-DE/observability.mdx +102 -8
  1584. package/docs/content/locales/de-DE/observational-memory.mdx +92 -8
  1585. package/docs/content/locales/de-DE/onboarding.mdx +45 -4
  1586. package/docs/content/locales/de-DE/plan-plugin.mdx +99 -8
  1587. package/docs/content/locales/de-DE/pr-visual-recap.mdx +125 -8
  1588. package/docs/content/locales/de-DE/processors.mdx +41 -4
  1589. package/docs/content/locales/de-DE/progress.mdx +46 -4
  1590. package/docs/content/locales/de-DE/pure-agent-apps.mdx +50 -4
  1591. package/docs/content/locales/de-DE/real-time-collaboration.mdx +104 -8
  1592. package/docs/content/locales/de-DE/recurring-jobs.mdx +59 -4
  1593. package/docs/content/locales/de-DE/routing.mdx +44 -5
  1594. package/docs/content/locales/de-DE/sandbox-adapters.mdx +43 -4
  1595. package/docs/content/locales/de-DE/security.mdx +80 -8
  1596. package/docs/content/locales/de-DE/server.mdx +171 -12
  1597. package/docs/content/locales/de-DE/sharing.mdx +45 -4
  1598. package/docs/content/locales/de-DE/skills-guide.mdx +118 -9
  1599. package/docs/content/locales/de-DE/template-analytics.mdx +46 -4
  1600. package/docs/content/locales/de-DE/template-assets.mdx +62 -4
  1601. package/docs/content/locales/de-DE/template-brain.mdx +69 -4
  1602. package/docs/content/locales/de-DE/template-calendar.mdx +62 -4
  1603. package/docs/content/locales/de-DE/template-chat.mdx +61 -4
  1604. package/docs/content/locales/de-DE/template-clips.mdx +52 -4
  1605. package/docs/content/locales/de-DE/template-content.mdx +60 -4
  1606. package/docs/content/locales/de-DE/template-design.mdx +109 -4
  1607. package/docs/content/locales/de-DE/template-dispatch.mdx +57 -4
  1608. package/docs/content/locales/de-DE/template-forms.mdx +64 -4
  1609. package/docs/content/locales/de-DE/template-mail.mdx +60 -4
  1610. package/docs/content/locales/de-DE/template-plan.mdx +63 -4
  1611. package/docs/content/locales/de-DE/template-slides.mdx +49 -4
  1612. package/docs/content/locales/de-DE/template-videos.mdx +53 -4
  1613. package/docs/content/locales/de-DE/tracking.mdx +54 -4
  1614. package/docs/content/locales/de-DE/using-your-agent.mdx +51 -4
  1615. package/docs/content/locales/de-DE/voice-input.mdx +45 -4
  1616. package/docs/content/locales/de-DE/what-is-agent-native.mdx +100 -8
  1617. package/docs/content/locales/de-DE/workspace-connections.mdx +128 -8
  1618. package/docs/content/locales/de-DE/workspace-management.mdx +50 -4
  1619. package/docs/content/locales/de-DE/workspace.mdx +111 -8
  1620. package/docs/content/locales/de-DE/writing-agent-instructions.mdx +45 -4
  1621. package/docs/content/locales/es-ES/a2a-protocol.mdx +99 -9
  1622. package/docs/content/locales/es-ES/actions.mdx +67 -4
  1623. package/docs/content/locales/es-ES/agent-mentions.mdx +68 -4
  1624. package/docs/content/locales/es-ES/agent-surfaces.mdx +120 -8
  1625. package/docs/content/locales/es-ES/agent-teams.mdx +172 -12
  1626. package/docs/content/locales/es-ES/agent-web-surfaces.mdx +51 -4
  1627. package/docs/content/locales/es-ES/authentication.mdx +122 -8
  1628. package/docs/content/locales/es-ES/automations.mdx +110 -8
  1629. package/docs/content/locales/es-ES/blueprint-installer.mdx +42 -4
  1630. package/docs/content/locales/es-ES/cli-adapters.mdx +44 -4
  1631. package/docs/content/locales/es-ES/client.mdx +79 -8
  1632. package/docs/content/locales/es-ES/cloneable-saas.mdx +85 -8
  1633. package/docs/content/locales/es-ES/code-agents-ui.mdx +101 -8
  1634. package/docs/content/locales/es-ES/components.mdx +118 -8
  1635. package/docs/content/locales/es-ES/context-awareness.mdx +98 -8
  1636. package/docs/content/locales/es-ES/creating-templates.mdx +51 -4
  1637. package/docs/content/locales/es-ES/cross-app-sso.mdx +109 -8
  1638. package/docs/content/locales/es-ES/database.mdx +52 -4
  1639. package/docs/content/locales/es-ES/deployment.mdx +103 -8
  1640. package/docs/content/locales/es-ES/dispatch.mdx +134 -8
  1641. package/docs/content/locales/es-ES/drop-in-agent.mdx +63 -4
  1642. package/docs/content/locales/es-ES/durable-resume.mdx +47 -4
  1643. package/docs/content/locales/es-ES/embedding-sdk.mdx +87 -8
  1644. package/docs/content/locales/es-ES/evals.mdx +102 -8
  1645. package/docs/content/locales/es-ES/extensions.mdx +113 -9
  1646. package/docs/content/locales/es-ES/external-agents.mdx +119 -8
  1647. package/docs/content/locales/es-ES/faq.mdx +98 -8
  1648. package/docs/content/locales/es-ES/file-uploads.mdx +61 -4
  1649. package/docs/content/locales/es-ES/frames.mdx +88 -8
  1650. package/docs/content/locales/es-ES/getting-started.mdx +34 -4
  1651. package/docs/content/locales/es-ES/harness-agents.mdx +79 -8
  1652. package/docs/content/locales/es-ES/human-approval.mdx +50 -4
  1653. package/docs/content/locales/es-ES/key-concepts.mdx +104 -8
  1654. package/docs/content/locales/es-ES/local-file-mode.mdx +60 -4
  1655. package/docs/content/locales/es-ES/mcp-apps.mdx +120 -10
  1656. package/docs/content/locales/es-ES/mcp-clients.mdx +135 -8
  1657. package/docs/content/locales/es-ES/mcp-protocol.mdx +105 -8
  1658. package/docs/content/locales/es-ES/messaging.mdx +115 -8
  1659. package/docs/content/locales/es-ES/migration-workbench.mdx +47 -4
  1660. package/docs/content/locales/es-ES/multi-app-workspace.mdx +91 -8
  1661. package/docs/content/locales/es-ES/multi-tenancy.mdx +80 -8
  1662. package/docs/content/locales/es-ES/native-chat-ui.mdx +108 -8
  1663. package/docs/content/locales/es-ES/notifications.mdx +135 -8
  1664. package/docs/content/locales/es-ES/observability.mdx +104 -8
  1665. package/docs/content/locales/es-ES/observational-memory.mdx +92 -8
  1666. package/docs/content/locales/es-ES/onboarding.mdx +45 -4
  1667. package/docs/content/locales/es-ES/plan-plugin.mdx +99 -8
  1668. package/docs/content/locales/es-ES/pr-visual-recap.mdx +125 -8
  1669. package/docs/content/locales/es-ES/processors.mdx +41 -4
  1670. package/docs/content/locales/es-ES/progress.mdx +46 -4
  1671. package/docs/content/locales/es-ES/pure-agent-apps.mdx +50 -4
  1672. package/docs/content/locales/es-ES/real-time-collaboration.mdx +109 -8
  1673. package/docs/content/locales/es-ES/recurring-jobs.mdx +59 -4
  1674. package/docs/content/locales/es-ES/routing.mdx +44 -5
  1675. package/docs/content/locales/es-ES/sandbox-adapters.mdx +44 -4
  1676. package/docs/content/locales/es-ES/security.mdx +82 -8
  1677. package/docs/content/locales/es-ES/server.mdx +173 -12
  1678. package/docs/content/locales/es-ES/sharing.mdx +45 -4
  1679. package/docs/content/locales/es-ES/skills-guide.mdx +118 -9
  1680. package/docs/content/locales/es-ES/template-analytics.mdx +46 -4
  1681. package/docs/content/locales/es-ES/template-assets.mdx +64 -4
  1682. package/docs/content/locales/es-ES/template-brain.mdx +69 -4
  1683. package/docs/content/locales/es-ES/template-calendar.mdx +62 -4
  1684. package/docs/content/locales/es-ES/template-chat.mdx +61 -4
  1685. package/docs/content/locales/es-ES/template-clips.mdx +52 -4
  1686. package/docs/content/locales/es-ES/template-content.mdx +64 -4
  1687. package/docs/content/locales/es-ES/template-design.mdx +108 -4
  1688. package/docs/content/locales/es-ES/template-dispatch.mdx +57 -4
  1689. package/docs/content/locales/es-ES/template-forms.mdx +64 -4
  1690. package/docs/content/locales/es-ES/template-mail.mdx +60 -4
  1691. package/docs/content/locales/es-ES/template-plan.mdx +61 -4
  1692. package/docs/content/locales/es-ES/template-slides.mdx +49 -4
  1693. package/docs/content/locales/es-ES/template-videos.mdx +53 -4
  1694. package/docs/content/locales/es-ES/tracking.mdx +54 -4
  1695. package/docs/content/locales/es-ES/using-your-agent.mdx +51 -4
  1696. package/docs/content/locales/es-ES/voice-input.mdx +45 -4
  1697. package/docs/content/locales/es-ES/what-is-agent-native.mdx +99 -8
  1698. package/docs/content/locales/es-ES/workspace-connections.mdx +128 -8
  1699. package/docs/content/locales/es-ES/workspace-management.mdx +50 -4
  1700. package/docs/content/locales/es-ES/workspace.mdx +112 -8
  1701. package/docs/content/locales/es-ES/writing-agent-instructions.mdx +46 -4
  1702. package/docs/content/locales/fr-FR/a2a-protocol.mdx +97 -9
  1703. package/docs/content/locales/fr-FR/actions.mdx +67 -4
  1704. package/docs/content/locales/fr-FR/agent-mentions.mdx +68 -4
  1705. package/docs/content/locales/fr-FR/agent-surfaces.mdx +118 -8
  1706. package/docs/content/locales/fr-FR/agent-teams.mdx +172 -12
  1707. package/docs/content/locales/fr-FR/agent-web-surfaces.mdx +51 -4
  1708. package/docs/content/locales/fr-FR/authentication.mdx +122 -8
  1709. package/docs/content/locales/fr-FR/automations.mdx +110 -8
  1710. package/docs/content/locales/fr-FR/blueprint-installer.mdx +42 -4
  1711. package/docs/content/locales/fr-FR/cli-adapters.mdx +44 -4
  1712. package/docs/content/locales/fr-FR/client.mdx +81 -8
  1713. package/docs/content/locales/fr-FR/cloneable-saas.mdx +85 -8
  1714. package/docs/content/locales/fr-FR/code-agents-ui.mdx +102 -8
  1715. package/docs/content/locales/fr-FR/components.mdx +118 -8
  1716. package/docs/content/locales/fr-FR/context-awareness.mdx +98 -8
  1717. package/docs/content/locales/fr-FR/creating-templates.mdx +49 -4
  1718. package/docs/content/locales/fr-FR/cross-app-sso.mdx +109 -8
  1719. package/docs/content/locales/fr-FR/database.mdx +52 -4
  1720. package/docs/content/locales/fr-FR/deployment.mdx +103 -8
  1721. package/docs/content/locales/fr-FR/dispatch.mdx +134 -8
  1722. package/docs/content/locales/fr-FR/drop-in-agent.mdx +63 -4
  1723. package/docs/content/locales/fr-FR/durable-resume.mdx +47 -4
  1724. package/docs/content/locales/fr-FR/embedding-sdk.mdx +87 -8
  1725. package/docs/content/locales/fr-FR/evals.mdx +102 -8
  1726. package/docs/content/locales/fr-FR/extensions.mdx +113 -9
  1727. package/docs/content/locales/fr-FR/external-agents.mdx +119 -8
  1728. package/docs/content/locales/fr-FR/faq.mdx +98 -8
  1729. package/docs/content/locales/fr-FR/file-uploads.mdx +61 -4
  1730. package/docs/content/locales/fr-FR/frames.mdx +90 -8
  1731. package/docs/content/locales/fr-FR/getting-started.mdx +34 -4
  1732. package/docs/content/locales/fr-FR/harness-agents.mdx +77 -8
  1733. package/docs/content/locales/fr-FR/human-approval.mdx +50 -4
  1734. package/docs/content/locales/fr-FR/key-concepts.mdx +106 -8
  1735. package/docs/content/locales/fr-FR/local-file-mode.mdx +58 -4
  1736. package/docs/content/locales/fr-FR/mcp-apps.mdx +120 -10
  1737. package/docs/content/locales/fr-FR/mcp-clients.mdx +135 -8
  1738. package/docs/content/locales/fr-FR/mcp-protocol.mdx +105 -8
  1739. package/docs/content/locales/fr-FR/messaging.mdx +115 -8
  1740. package/docs/content/locales/fr-FR/migration-workbench.mdx +47 -4
  1741. package/docs/content/locales/fr-FR/multi-app-workspace.mdx +91 -8
  1742. package/docs/content/locales/fr-FR/multi-tenancy.mdx +80 -8
  1743. package/docs/content/locales/fr-FR/native-chat-ui.mdx +108 -8
  1744. package/docs/content/locales/fr-FR/notifications.mdx +135 -8
  1745. package/docs/content/locales/fr-FR/observability.mdx +104 -8
  1746. package/docs/content/locales/fr-FR/observational-memory.mdx +89 -8
  1747. package/docs/content/locales/fr-FR/onboarding.mdx +45 -4
  1748. package/docs/content/locales/fr-FR/plan-plugin.mdx +99 -8
  1749. package/docs/content/locales/fr-FR/pr-visual-recap.mdx +126 -8
  1750. package/docs/content/locales/fr-FR/processors.mdx +41 -4
  1751. package/docs/content/locales/fr-FR/progress.mdx +46 -4
  1752. package/docs/content/locales/fr-FR/pure-agent-apps.mdx +48 -4
  1753. package/docs/content/locales/fr-FR/real-time-collaboration.mdx +107 -8
  1754. package/docs/content/locales/fr-FR/recurring-jobs.mdx +59 -4
  1755. package/docs/content/locales/fr-FR/routing.mdx +44 -5
  1756. package/docs/content/locales/fr-FR/sandbox-adapters.mdx +44 -4
  1757. package/docs/content/locales/fr-FR/security.mdx +82 -8
  1758. package/docs/content/locales/fr-FR/server.mdx +173 -12
  1759. package/docs/content/locales/fr-FR/sharing.mdx +45 -4
  1760. package/docs/content/locales/fr-FR/skills-guide.mdx +118 -9
  1761. package/docs/content/locales/fr-FR/template-analytics.mdx +46 -4
  1762. package/docs/content/locales/fr-FR/template-assets.mdx +66 -4
  1763. package/docs/content/locales/fr-FR/template-brain.mdx +69 -4
  1764. package/docs/content/locales/fr-FR/template-calendar.mdx +62 -4
  1765. package/docs/content/locales/fr-FR/template-chat.mdx +61 -4
  1766. package/docs/content/locales/fr-FR/template-clips.mdx +52 -4
  1767. package/docs/content/locales/fr-FR/template-content.mdx +64 -4
  1768. package/docs/content/locales/fr-FR/template-design.mdx +107 -4
  1769. package/docs/content/locales/fr-FR/template-dispatch.mdx +57 -4
  1770. package/docs/content/locales/fr-FR/template-forms.mdx +64 -4
  1771. package/docs/content/locales/fr-FR/template-mail.mdx +60 -4
  1772. package/docs/content/locales/fr-FR/template-plan.mdx +61 -4
  1773. package/docs/content/locales/fr-FR/template-slides.mdx +49 -4
  1774. package/docs/content/locales/fr-FR/template-videos.mdx +53 -4
  1775. package/docs/content/locales/fr-FR/tracking.mdx +54 -4
  1776. package/docs/content/locales/fr-FR/using-your-agent.mdx +51 -4
  1777. package/docs/content/locales/fr-FR/voice-input.mdx +45 -4
  1778. package/docs/content/locales/fr-FR/what-is-agent-native.mdx +101 -8
  1779. package/docs/content/locales/fr-FR/workspace-connections.mdx +128 -8
  1780. package/docs/content/locales/fr-FR/workspace-management.mdx +50 -4
  1781. package/docs/content/locales/fr-FR/workspace.mdx +112 -8
  1782. package/docs/content/locales/fr-FR/writing-agent-instructions.mdx +47 -4
  1783. package/docs/content/locales/hi-IN/a2a-protocol.mdx +97 -9
  1784. package/docs/content/locales/hi-IN/actions.mdx +63 -4
  1785. package/docs/content/locales/hi-IN/agent-mentions.mdx +68 -4
  1786. package/docs/content/locales/hi-IN/agent-surfaces.mdx +112 -8
  1787. package/docs/content/locales/hi-IN/agent-teams.mdx +171 -12
  1788. package/docs/content/locales/hi-IN/agent-web-surfaces.mdx +51 -4
  1789. package/docs/content/locales/hi-IN/authentication.mdx +122 -8
  1790. package/docs/content/locales/hi-IN/automations.mdx +110 -8
  1791. package/docs/content/locales/hi-IN/blueprint-installer.mdx +42 -4
  1792. package/docs/content/locales/hi-IN/cli-adapters.mdx +44 -4
  1793. package/docs/content/locales/hi-IN/client.mdx +79 -8
  1794. package/docs/content/locales/hi-IN/cloneable-saas.mdx +85 -8
  1795. package/docs/content/locales/hi-IN/code-agents-ui.mdx +96 -8
  1796. package/docs/content/locales/hi-IN/components.mdx +114 -8
  1797. package/docs/content/locales/hi-IN/context-awareness.mdx +102 -8
  1798. package/docs/content/locales/hi-IN/creating-templates.mdx +53 -4
  1799. package/docs/content/locales/hi-IN/cross-app-sso.mdx +109 -8
  1800. package/docs/content/locales/hi-IN/database.mdx +52 -4
  1801. package/docs/content/locales/hi-IN/deployment.mdx +103 -8
  1802. package/docs/content/locales/hi-IN/dispatch.mdx +134 -8
  1803. package/docs/content/locales/hi-IN/drop-in-agent.mdx +63 -4
  1804. package/docs/content/locales/hi-IN/durable-resume.mdx +47 -4
  1805. package/docs/content/locales/hi-IN/embedding-sdk.mdx +83 -8
  1806. package/docs/content/locales/hi-IN/evals.mdx +100 -8
  1807. package/docs/content/locales/hi-IN/extensions.mdx +113 -9
  1808. package/docs/content/locales/hi-IN/external-agents.mdx +119 -8
  1809. package/docs/content/locales/hi-IN/faq.mdx +96 -8
  1810. package/docs/content/locales/hi-IN/file-uploads.mdx +61 -4
  1811. package/docs/content/locales/hi-IN/frames.mdx +88 -8
  1812. package/docs/content/locales/hi-IN/getting-started.mdx +34 -4
  1813. package/docs/content/locales/hi-IN/harness-agents.mdx +77 -8
  1814. package/docs/content/locales/hi-IN/human-approval.mdx +51 -4
  1815. package/docs/content/locales/hi-IN/key-concepts.mdx +104 -8
  1816. package/docs/content/locales/hi-IN/local-file-mode.mdx +58 -4
  1817. package/docs/content/locales/hi-IN/mcp-apps.mdx +120 -10
  1818. package/docs/content/locales/hi-IN/mcp-clients.mdx +133 -8
  1819. package/docs/content/locales/hi-IN/mcp-protocol.mdx +105 -8
  1820. package/docs/content/locales/hi-IN/messaging.mdx +115 -8
  1821. package/docs/content/locales/hi-IN/migration-workbench.mdx +45 -4
  1822. package/docs/content/locales/hi-IN/multi-app-workspace.mdx +91 -8
  1823. package/docs/content/locales/hi-IN/multi-tenancy.mdx +80 -8
  1824. package/docs/content/locales/hi-IN/native-chat-ui.mdx +106 -8
  1825. package/docs/content/locales/hi-IN/notifications.mdx +135 -8
  1826. package/docs/content/locales/hi-IN/observability.mdx +102 -8
  1827. package/docs/content/locales/hi-IN/observational-memory.mdx +89 -8
  1828. package/docs/content/locales/hi-IN/onboarding.mdx +45 -4
  1829. package/docs/content/locales/hi-IN/plan-plugin.mdx +99 -8
  1830. package/docs/content/locales/hi-IN/pr-visual-recap.mdx +126 -8
  1831. package/docs/content/locales/hi-IN/processors.mdx +41 -4
  1832. package/docs/content/locales/hi-IN/progress.mdx +46 -4
  1833. package/docs/content/locales/hi-IN/pure-agent-apps.mdx +48 -4
  1834. package/docs/content/locales/hi-IN/real-time-collaboration.mdx +106 -8
  1835. package/docs/content/locales/hi-IN/recurring-jobs.mdx +59 -4
  1836. package/docs/content/locales/hi-IN/routing.mdx +44 -5
  1837. package/docs/content/locales/hi-IN/sandbox-adapters.mdx +43 -4
  1838. package/docs/content/locales/hi-IN/security.mdx +78 -8
  1839. package/docs/content/locales/hi-IN/server.mdx +169 -12
  1840. package/docs/content/locales/hi-IN/sharing.mdx +45 -4
  1841. package/docs/content/locales/hi-IN/skills-guide.mdx +118 -9
  1842. package/docs/content/locales/hi-IN/template-analytics.mdx +46 -4
  1843. package/docs/content/locales/hi-IN/template-assets.mdx +62 -4
  1844. package/docs/content/locales/hi-IN/template-brain.mdx +69 -4
  1845. package/docs/content/locales/hi-IN/template-calendar.mdx +62 -4
  1846. package/docs/content/locales/hi-IN/template-chat.mdx +59 -4
  1847. package/docs/content/locales/hi-IN/template-clips.mdx +52 -4
  1848. package/docs/content/locales/hi-IN/template-content.mdx +62 -4
  1849. package/docs/content/locales/hi-IN/template-design.mdx +102 -4
  1850. package/docs/content/locales/hi-IN/template-dispatch.mdx +57 -4
  1851. package/docs/content/locales/hi-IN/template-forms.mdx +64 -4
  1852. package/docs/content/locales/hi-IN/template-mail.mdx +64 -4
  1853. package/docs/content/locales/hi-IN/template-plan.mdx +61 -4
  1854. package/docs/content/locales/hi-IN/template-slides.mdx +49 -4
  1855. package/docs/content/locales/hi-IN/template-videos.mdx +53 -4
  1856. package/docs/content/locales/hi-IN/tracking.mdx +54 -4
  1857. package/docs/content/locales/hi-IN/using-your-agent.mdx +51 -4
  1858. package/docs/content/locales/hi-IN/voice-input.mdx +43 -4
  1859. package/docs/content/locales/hi-IN/what-is-agent-native.mdx +97 -8
  1860. package/docs/content/locales/hi-IN/workspace-connections.mdx +128 -8
  1861. package/docs/content/locales/hi-IN/workspace-management.mdx +50 -4
  1862. package/docs/content/locales/hi-IN/workspace.mdx +111 -8
  1863. package/docs/content/locales/hi-IN/writing-agent-instructions.mdx +40 -4
  1864. package/docs/content/locales/ja-JP/a2a-protocol.mdx +97 -9
  1865. package/docs/content/locales/ja-JP/actions.mdx +67 -4
  1866. package/docs/content/locales/ja-JP/agent-mentions.mdx +68 -4
  1867. package/docs/content/locales/ja-JP/agent-surfaces.mdx +116 -8
  1868. package/docs/content/locales/ja-JP/agent-teams.mdx +172 -12
  1869. package/docs/content/locales/ja-JP/agent-web-surfaces.mdx +51 -4
  1870. package/docs/content/locales/ja-JP/authentication.mdx +122 -8
  1871. package/docs/content/locales/ja-JP/automations.mdx +110 -8
  1872. package/docs/content/locales/ja-JP/blueprint-installer.mdx +44 -4
  1873. package/docs/content/locales/ja-JP/cli-adapters.mdx +44 -4
  1874. package/docs/content/locales/ja-JP/client.mdx +79 -8
  1875. package/docs/content/locales/ja-JP/cloneable-saas.mdx +85 -8
  1876. package/docs/content/locales/ja-JP/code-agents-ui.mdx +100 -8
  1877. package/docs/content/locales/ja-JP/components.mdx +116 -8
  1878. package/docs/content/locales/ja-JP/context-awareness.mdx +100 -8
  1879. package/docs/content/locales/ja-JP/creating-templates.mdx +51 -4
  1880. package/docs/content/locales/ja-JP/cross-app-sso.mdx +109 -8
  1881. package/docs/content/locales/ja-JP/database.mdx +52 -4
  1882. package/docs/content/locales/ja-JP/deployment.mdx +103 -8
  1883. package/docs/content/locales/ja-JP/dispatch.mdx +134 -8
  1884. package/docs/content/locales/ja-JP/drop-in-agent.mdx +63 -4
  1885. package/docs/content/locales/ja-JP/durable-resume.mdx +47 -4
  1886. package/docs/content/locales/ja-JP/embedding-sdk.mdx +85 -8
  1887. package/docs/content/locales/ja-JP/evals.mdx +102 -8
  1888. package/docs/content/locales/ja-JP/extensions.mdx +111 -9
  1889. package/docs/content/locales/ja-JP/external-agents.mdx +119 -8
  1890. package/docs/content/locales/ja-JP/faq.mdx +98 -8
  1891. package/docs/content/locales/ja-JP/file-uploads.mdx +61 -4
  1892. package/docs/content/locales/ja-JP/frames.mdx +88 -8
  1893. package/docs/content/locales/ja-JP/getting-started.mdx +34 -4
  1894. package/docs/content/locales/ja-JP/harness-agents.mdx +79 -8
  1895. package/docs/content/locales/ja-JP/human-approval.mdx +50 -4
  1896. package/docs/content/locales/ja-JP/key-concepts.mdx +105 -8
  1897. package/docs/content/locales/ja-JP/local-file-mode.mdx +58 -4
  1898. package/docs/content/locales/ja-JP/mcp-apps.mdx +119 -10
  1899. package/docs/content/locales/ja-JP/mcp-clients.mdx +134 -8
  1900. package/docs/content/locales/ja-JP/mcp-protocol.mdx +105 -8
  1901. package/docs/content/locales/ja-JP/messaging.mdx +115 -8
  1902. package/docs/content/locales/ja-JP/migration-workbench.mdx +47 -4
  1903. package/docs/content/locales/ja-JP/multi-app-workspace.mdx +91 -8
  1904. package/docs/content/locales/ja-JP/multi-tenancy.mdx +80 -8
  1905. package/docs/content/locales/ja-JP/native-chat-ui.mdx +104 -8
  1906. package/docs/content/locales/ja-JP/notifications.mdx +135 -8
  1907. package/docs/content/locales/ja-JP/observability.mdx +104 -8
  1908. package/docs/content/locales/ja-JP/observational-memory.mdx +89 -8
  1909. package/docs/content/locales/ja-JP/onboarding.mdx +45 -4
  1910. package/docs/content/locales/ja-JP/plan-plugin.mdx +99 -8
  1911. package/docs/content/locales/ja-JP/pr-visual-recap.mdx +123 -8
  1912. package/docs/content/locales/ja-JP/processors.mdx +39 -4
  1913. package/docs/content/locales/ja-JP/progress.mdx +46 -4
  1914. package/docs/content/locales/ja-JP/pure-agent-apps.mdx +48 -4
  1915. package/docs/content/locales/ja-JP/real-time-collaboration.mdx +106 -8
  1916. package/docs/content/locales/ja-JP/recurring-jobs.mdx +59 -4
  1917. package/docs/content/locales/ja-JP/routing.mdx +44 -5
  1918. package/docs/content/locales/ja-JP/sandbox-adapters.mdx +43 -4
  1919. package/docs/content/locales/ja-JP/security.mdx +82 -8
  1920. package/docs/content/locales/ja-JP/server.mdx +171 -12
  1921. package/docs/content/locales/ja-JP/sharing.mdx +45 -4
  1922. package/docs/content/locales/ja-JP/skills-guide.mdx +118 -9
  1923. package/docs/content/locales/ja-JP/template-analytics.mdx +46 -4
  1924. package/docs/content/locales/ja-JP/template-assets.mdx +64 -4
  1925. package/docs/content/locales/ja-JP/template-brain.mdx +67 -4
  1926. package/docs/content/locales/ja-JP/template-calendar.mdx +62 -4
  1927. package/docs/content/locales/ja-JP/template-chat.mdx +61 -4
  1928. package/docs/content/locales/ja-JP/template-clips.mdx +52 -4
  1929. package/docs/content/locales/ja-JP/template-content.mdx +62 -4
  1930. package/docs/content/locales/ja-JP/template-design.mdx +106 -4
  1931. package/docs/content/locales/ja-JP/template-dispatch.mdx +57 -4
  1932. package/docs/content/locales/ja-JP/template-forms.mdx +62 -4
  1933. package/docs/content/locales/ja-JP/template-mail.mdx +62 -4
  1934. package/docs/content/locales/ja-JP/template-plan.mdx +63 -4
  1935. package/docs/content/locales/ja-JP/template-slides.mdx +49 -4
  1936. package/docs/content/locales/ja-JP/template-videos.mdx +53 -4
  1937. package/docs/content/locales/ja-JP/tracking.mdx +54 -4
  1938. package/docs/content/locales/ja-JP/using-your-agent.mdx +51 -4
  1939. package/docs/content/locales/ja-JP/voice-input.mdx +43 -4
  1940. package/docs/content/locales/ja-JP/what-is-agent-native.mdx +96 -8
  1941. package/docs/content/locales/ja-JP/workspace-connections.mdx +128 -8
  1942. package/docs/content/locales/ja-JP/workspace-management.mdx +50 -4
  1943. package/docs/content/locales/ja-JP/workspace.mdx +111 -8
  1944. package/docs/content/locales/ja-JP/writing-agent-instructions.mdx +44 -4
  1945. package/docs/content/locales/ko-KR/a2a-protocol.mdx +97 -9
  1946. package/docs/content/locales/ko-KR/actions.mdx +63 -4
  1947. package/docs/content/locales/ko-KR/agent-mentions.mdx +68 -4
  1948. package/docs/content/locales/ko-KR/agent-surfaces.mdx +113 -8
  1949. package/docs/content/locales/ko-KR/agent-teams.mdx +171 -12
  1950. package/docs/content/locales/ko-KR/agent-web-surfaces.mdx +51 -4
  1951. package/docs/content/locales/ko-KR/authentication.mdx +122 -8
  1952. package/docs/content/locales/ko-KR/automations.mdx +110 -8
  1953. package/docs/content/locales/ko-KR/blueprint-installer.mdx +42 -4
  1954. package/docs/content/locales/ko-KR/cli-adapters.mdx +44 -4
  1955. package/docs/content/locales/ko-KR/client.mdx +79 -8
  1956. package/docs/content/locales/ko-KR/cloneable-saas.mdx +85 -8
  1957. package/docs/content/locales/ko-KR/code-agents-ui.mdx +96 -8
  1958. package/docs/content/locales/ko-KR/components.mdx +112 -8
  1959. package/docs/content/locales/ko-KR/context-awareness.mdx +96 -8
  1960. package/docs/content/locales/ko-KR/creating-templates.mdx +51 -4
  1961. package/docs/content/locales/ko-KR/cross-app-sso.mdx +109 -8
  1962. package/docs/content/locales/ko-KR/database.mdx +52 -4
  1963. package/docs/content/locales/ko-KR/deployment.mdx +103 -8
  1964. package/docs/content/locales/ko-KR/dispatch.mdx +132 -8
  1965. package/docs/content/locales/ko-KR/drop-in-agent.mdx +63 -4
  1966. package/docs/content/locales/ko-KR/durable-resume.mdx +47 -4
  1967. package/docs/content/locales/ko-KR/embedding-sdk.mdx +81 -8
  1968. package/docs/content/locales/ko-KR/evals.mdx +102 -8
  1969. package/docs/content/locales/ko-KR/extensions.mdx +111 -9
  1970. package/docs/content/locales/ko-KR/external-agents.mdx +119 -8
  1971. package/docs/content/locales/ko-KR/faq.mdx +96 -8
  1972. package/docs/content/locales/ko-KR/file-uploads.mdx +61 -4
  1973. package/docs/content/locales/ko-KR/frames.mdx +86 -8
  1974. package/docs/content/locales/ko-KR/getting-started.mdx +34 -4
  1975. package/docs/content/locales/ko-KR/harness-agents.mdx +77 -8
  1976. package/docs/content/locales/ko-KR/human-approval.mdx +50 -4
  1977. package/docs/content/locales/ko-KR/key-concepts.mdx +104 -8
  1978. package/docs/content/locales/ko-KR/local-file-mode.mdx +56 -4
  1979. package/docs/content/locales/ko-KR/mcp-apps.mdx +120 -10
  1980. package/docs/content/locales/ko-KR/mcp-clients.mdx +133 -8
  1981. package/docs/content/locales/ko-KR/mcp-protocol.mdx +105 -8
  1982. package/docs/content/locales/ko-KR/messaging.mdx +115 -8
  1983. package/docs/content/locales/ko-KR/migration-workbench.mdx +45 -4
  1984. package/docs/content/locales/ko-KR/multi-app-workspace.mdx +91 -8
  1985. package/docs/content/locales/ko-KR/multi-tenancy.mdx +80 -8
  1986. package/docs/content/locales/ko-KR/native-chat-ui.mdx +104 -8
  1987. package/docs/content/locales/ko-KR/notifications.mdx +135 -8
  1988. package/docs/content/locales/ko-KR/observability.mdx +102 -8
  1989. package/docs/content/locales/ko-KR/observational-memory.mdx +87 -8
  1990. package/docs/content/locales/ko-KR/onboarding.mdx +44 -4
  1991. package/docs/content/locales/ko-KR/plan-plugin.mdx +99 -8
  1992. package/docs/content/locales/ko-KR/pr-visual-recap.mdx +125 -8
  1993. package/docs/content/locales/ko-KR/processors.mdx +39 -4
  1994. package/docs/content/locales/ko-KR/progress.mdx +46 -4
  1995. package/docs/content/locales/ko-KR/pure-agent-apps.mdx +46 -4
  1996. package/docs/content/locales/ko-KR/real-time-collaboration.mdx +104 -8
  1997. package/docs/content/locales/ko-KR/recurring-jobs.mdx +59 -4
  1998. package/docs/content/locales/ko-KR/routing.mdx +44 -5
  1999. package/docs/content/locales/ko-KR/sandbox-adapters.mdx +41 -4
  2000. package/docs/content/locales/ko-KR/security.mdx +78 -8
  2001. package/docs/content/locales/ko-KR/server.mdx +171 -12
  2002. package/docs/content/locales/ko-KR/sharing.mdx +45 -4
  2003. package/docs/content/locales/ko-KR/skills-guide.mdx +118 -9
  2004. package/docs/content/locales/ko-KR/template-analytics.mdx +46 -4
  2005. package/docs/content/locales/ko-KR/template-assets.mdx +62 -4
  2006. package/docs/content/locales/ko-KR/template-brain.mdx +65 -4
  2007. package/docs/content/locales/ko-KR/template-calendar.mdx +60 -4
  2008. package/docs/content/locales/ko-KR/template-chat.mdx +59 -4
  2009. package/docs/content/locales/ko-KR/template-clips.mdx +52 -4
  2010. package/docs/content/locales/ko-KR/template-content.mdx +60 -4
  2011. package/docs/content/locales/ko-KR/template-design.mdx +102 -4
  2012. package/docs/content/locales/ko-KR/template-dispatch.mdx +57 -4
  2013. package/docs/content/locales/ko-KR/template-forms.mdx +60 -4
  2014. package/docs/content/locales/ko-KR/template-mail.mdx +60 -4
  2015. package/docs/content/locales/ko-KR/template-plan.mdx +57 -4
  2016. package/docs/content/locales/ko-KR/template-slides.mdx +49 -4
  2017. package/docs/content/locales/ko-KR/template-videos.mdx +53 -4
  2018. package/docs/content/locales/ko-KR/tracking.mdx +54 -4
  2019. package/docs/content/locales/ko-KR/using-your-agent.mdx +51 -4
  2020. package/docs/content/locales/ko-KR/voice-input.mdx +43 -4
  2021. package/docs/content/locales/ko-KR/what-is-agent-native.mdx +95 -8
  2022. package/docs/content/locales/ko-KR/workspace-connections.mdx +128 -8
  2023. package/docs/content/locales/ko-KR/workspace-management.mdx +50 -4
  2024. package/docs/content/locales/ko-KR/workspace.mdx +111 -8
  2025. package/docs/content/locales/ko-KR/writing-agent-instructions.mdx +38 -4
  2026. package/docs/content/locales/pt-BR/a2a-protocol.mdx +99 -9
  2027. package/docs/content/locales/pt-BR/actions.mdx +67 -4
  2028. package/docs/content/locales/pt-BR/agent-mentions.mdx +68 -4
  2029. package/docs/content/locales/pt-BR/agent-surfaces.mdx +116 -8
  2030. package/docs/content/locales/pt-BR/agent-teams.mdx +172 -12
  2031. package/docs/content/locales/pt-BR/agent-web-surfaces.mdx +51 -4
  2032. package/docs/content/locales/pt-BR/authentication.mdx +122 -8
  2033. package/docs/content/locales/pt-BR/automations.mdx +110 -8
  2034. package/docs/content/locales/pt-BR/blueprint-installer.mdx +42 -4
  2035. package/docs/content/locales/pt-BR/cli-adapters.mdx +44 -4
  2036. package/docs/content/locales/pt-BR/client.mdx +81 -8
  2037. package/docs/content/locales/pt-BR/cloneable-saas.mdx +85 -8
  2038. package/docs/content/locales/pt-BR/code-agents-ui.mdx +98 -8
  2039. package/docs/content/locales/pt-BR/components.mdx +118 -8
  2040. package/docs/content/locales/pt-BR/context-awareness.mdx +100 -8
  2041. package/docs/content/locales/pt-BR/creating-templates.mdx +51 -4
  2042. package/docs/content/locales/pt-BR/cross-app-sso.mdx +109 -8
  2043. package/docs/content/locales/pt-BR/database.mdx +52 -4
  2044. package/docs/content/locales/pt-BR/deployment.mdx +103 -8
  2045. package/docs/content/locales/pt-BR/dispatch.mdx +134 -8
  2046. package/docs/content/locales/pt-BR/drop-in-agent.mdx +63 -4
  2047. package/docs/content/locales/pt-BR/durable-resume.mdx +47 -4
  2048. package/docs/content/locales/pt-BR/embedding-sdk.mdx +87 -8
  2049. package/docs/content/locales/pt-BR/evals.mdx +102 -8
  2050. package/docs/content/locales/pt-BR/extensions.mdx +113 -9
  2051. package/docs/content/locales/pt-BR/external-agents.mdx +119 -8
  2052. package/docs/content/locales/pt-BR/faq.mdx +98 -8
  2053. package/docs/content/locales/pt-BR/file-uploads.mdx +61 -4
  2054. package/docs/content/locales/pt-BR/frames.mdx +88 -8
  2055. package/docs/content/locales/pt-BR/getting-started.mdx +34 -4
  2056. package/docs/content/locales/pt-BR/harness-agents.mdx +79 -8
  2057. package/docs/content/locales/pt-BR/human-approval.mdx +50 -4
  2058. package/docs/content/locales/pt-BR/key-concepts.mdx +104 -8
  2059. package/docs/content/locales/pt-BR/local-file-mode.mdx +60 -4
  2060. package/docs/content/locales/pt-BR/mcp-apps.mdx +120 -10
  2061. package/docs/content/locales/pt-BR/mcp-clients.mdx +133 -8
  2062. package/docs/content/locales/pt-BR/mcp-protocol.mdx +105 -8
  2063. package/docs/content/locales/pt-BR/messaging.mdx +115 -8
  2064. package/docs/content/locales/pt-BR/migration-workbench.mdx +47 -4
  2065. package/docs/content/locales/pt-BR/multi-app-workspace.mdx +91 -8
  2066. package/docs/content/locales/pt-BR/multi-tenancy.mdx +80 -8
  2067. package/docs/content/locales/pt-BR/native-chat-ui.mdx +108 -8
  2068. package/docs/content/locales/pt-BR/notifications.mdx +135 -8
  2069. package/docs/content/locales/pt-BR/observability.mdx +104 -8
  2070. package/docs/content/locales/pt-BR/observational-memory.mdx +92 -8
  2071. package/docs/content/locales/pt-BR/onboarding.mdx +45 -4
  2072. package/docs/content/locales/pt-BR/plan-plugin.mdx +99 -8
  2073. package/docs/content/locales/pt-BR/pr-visual-recap.mdx +125 -8
  2074. package/docs/content/locales/pt-BR/processors.mdx +41 -4
  2075. package/docs/content/locales/pt-BR/progress.mdx +46 -4
  2076. package/docs/content/locales/pt-BR/pure-agent-apps.mdx +48 -4
  2077. package/docs/content/locales/pt-BR/real-time-collaboration.mdx +107 -8
  2078. package/docs/content/locales/pt-BR/recurring-jobs.mdx +59 -4
  2079. package/docs/content/locales/pt-BR/routing.mdx +44 -5
  2080. package/docs/content/locales/pt-BR/sandbox-adapters.mdx +43 -4
  2081. package/docs/content/locales/pt-BR/security.mdx +82 -8
  2082. package/docs/content/locales/pt-BR/server.mdx +173 -12
  2083. package/docs/content/locales/pt-BR/sharing.mdx +45 -4
  2084. package/docs/content/locales/pt-BR/skills-guide.mdx +118 -9
  2085. package/docs/content/locales/pt-BR/template-analytics.mdx +46 -4
  2086. package/docs/content/locales/pt-BR/template-assets.mdx +64 -4
  2087. package/docs/content/locales/pt-BR/template-brain.mdx +69 -4
  2088. package/docs/content/locales/pt-BR/template-calendar.mdx +62 -4
  2089. package/docs/content/locales/pt-BR/template-chat.mdx +61 -4
  2090. package/docs/content/locales/pt-BR/template-clips.mdx +52 -4
  2091. package/docs/content/locales/pt-BR/template-content.mdx +64 -4
  2092. package/docs/content/locales/pt-BR/template-design.mdx +106 -4
  2093. package/docs/content/locales/pt-BR/template-dispatch.mdx +57 -4
  2094. package/docs/content/locales/pt-BR/template-forms.mdx +64 -4
  2095. package/docs/content/locales/pt-BR/template-mail.mdx +60 -4
  2096. package/docs/content/locales/pt-BR/template-plan.mdx +63 -4
  2097. package/docs/content/locales/pt-BR/template-slides.mdx +49 -4
  2098. package/docs/content/locales/pt-BR/template-videos.mdx +53 -4
  2099. package/docs/content/locales/pt-BR/tracking.mdx +54 -4
  2100. package/docs/content/locales/pt-BR/using-your-agent.mdx +51 -4
  2101. package/docs/content/locales/pt-BR/voice-input.mdx +43 -4
  2102. package/docs/content/locales/pt-BR/what-is-agent-native.mdx +101 -8
  2103. package/docs/content/locales/pt-BR/workspace-connections.mdx +128 -8
  2104. package/docs/content/locales/pt-BR/workspace-management.mdx +50 -4
  2105. package/docs/content/locales/pt-BR/workspace.mdx +111 -8
  2106. package/docs/content/locales/pt-BR/writing-agent-instructions.mdx +46 -4
  2107. package/docs/content/locales/zh-CN/a2a-protocol.mdx +97 -9
  2108. package/docs/content/locales/zh-CN/actions.mdx +65 -4
  2109. package/docs/content/locales/zh-CN/agent-mentions.mdx +68 -4
  2110. package/docs/content/locales/zh-CN/agent-surfaces.mdx +108 -8
  2111. package/docs/content/locales/zh-CN/agent-teams.mdx +171 -12
  2112. package/docs/content/locales/zh-CN/agent-web-surfaces.mdx +51 -4
  2113. package/docs/content/locales/zh-CN/authentication.mdx +122 -8
  2114. package/docs/content/locales/zh-CN/automations.mdx +110 -8
  2115. package/docs/content/locales/zh-CN/blueprint-installer.mdx +42 -4
  2116. package/docs/content/locales/zh-CN/cli-adapters.mdx +44 -4
  2117. package/docs/content/locales/zh-CN/client.mdx +79 -8
  2118. package/docs/content/locales/zh-CN/cloneable-saas.mdx +83 -8
  2119. package/docs/content/locales/zh-CN/code-agents-ui.mdx +94 -8
  2120. package/docs/content/locales/zh-CN/components.mdx +112 -8
  2121. package/docs/content/locales/zh-CN/context-awareness.mdx +96 -8
  2122. package/docs/content/locales/zh-CN/creating-templates.mdx +51 -4
  2123. package/docs/content/locales/zh-CN/cross-app-sso.mdx +107 -8
  2124. package/docs/content/locales/zh-CN/database.mdx +52 -4
  2125. package/docs/content/locales/zh-CN/deployment.mdx +103 -8
  2126. package/docs/content/locales/zh-CN/dispatch.mdx +134 -8
  2127. package/docs/content/locales/zh-CN/drop-in-agent.mdx +63 -4
  2128. package/docs/content/locales/zh-CN/durable-resume.mdx +45 -4
  2129. package/docs/content/locales/zh-CN/embedding-sdk.mdx +81 -8
  2130. package/docs/content/locales/zh-CN/evals.mdx +100 -8
  2131. package/docs/content/locales/zh-CN/extensions.mdx +111 -9
  2132. package/docs/content/locales/zh-CN/external-agents.mdx +119 -8
  2133. package/docs/content/locales/zh-CN/faq.mdx +96 -8
  2134. package/docs/content/locales/zh-CN/file-uploads.mdx +61 -4
  2135. package/docs/content/locales/zh-CN/frames.mdx +86 -8
  2136. package/docs/content/locales/zh-CN/getting-started.mdx +34 -4
  2137. package/docs/content/locales/zh-CN/harness-agents.mdx +79 -8
  2138. package/docs/content/locales/zh-CN/human-approval.mdx +50 -4
  2139. package/docs/content/locales/zh-CN/key-concepts.mdx +100 -8
  2140. package/docs/content/locales/zh-CN/local-file-mode.mdx +56 -4
  2141. package/docs/content/locales/zh-CN/mcp-apps.mdx +120 -10
  2142. package/docs/content/locales/zh-CN/mcp-clients.mdx +133 -8
  2143. package/docs/content/locales/zh-CN/mcp-protocol.mdx +105 -8
  2144. package/docs/content/locales/zh-CN/messaging.mdx +115 -8
  2145. package/docs/content/locales/zh-CN/migration-workbench.mdx +45 -4
  2146. package/docs/content/locales/zh-CN/multi-app-workspace.mdx +91 -8
  2147. package/docs/content/locales/zh-CN/multi-tenancy.mdx +80 -8
  2148. package/docs/content/locales/zh-CN/native-chat-ui.mdx +104 -8
  2149. package/docs/content/locales/zh-CN/notifications.mdx +135 -8
  2150. package/docs/content/locales/zh-CN/observability.mdx +102 -8
  2151. package/docs/content/locales/zh-CN/observational-memory.mdx +85 -8
  2152. package/docs/content/locales/zh-CN/onboarding.mdx +44 -4
  2153. package/docs/content/locales/zh-CN/plan-plugin.mdx +97 -8
  2154. package/docs/content/locales/zh-CN/pr-visual-recap.mdx +123 -8
  2155. package/docs/content/locales/zh-CN/processors.mdx +39 -4
  2156. package/docs/content/locales/zh-CN/progress.mdx +46 -4
  2157. package/docs/content/locales/zh-CN/pure-agent-apps.mdx +46 -4
  2158. package/docs/content/locales/zh-CN/real-time-collaboration.mdx +98 -8
  2159. package/docs/content/locales/zh-CN/recurring-jobs.mdx +59 -4
  2160. package/docs/content/locales/zh-CN/routing.mdx +42 -5
  2161. package/docs/content/locales/zh-CN/sandbox-adapters.mdx +41 -4
  2162. package/docs/content/locales/zh-CN/security.mdx +78 -8
  2163. package/docs/content/locales/zh-CN/server.mdx +169 -12
  2164. package/docs/content/locales/zh-CN/sharing.mdx +45 -4
  2165. package/docs/content/locales/zh-CN/skills-guide.mdx +118 -9
  2166. package/docs/content/locales/zh-CN/template-analytics.mdx +46 -4
  2167. package/docs/content/locales/zh-CN/template-assets.mdx +58 -4
  2168. package/docs/content/locales/zh-CN/template-brain.mdx +65 -4
  2169. package/docs/content/locales/zh-CN/template-calendar.mdx +58 -4
  2170. package/docs/content/locales/zh-CN/template-chat.mdx +57 -4
  2171. package/docs/content/locales/zh-CN/template-clips.mdx +52 -4
  2172. package/docs/content/locales/zh-CN/template-content.mdx +58 -4
  2173. package/docs/content/locales/zh-CN/template-design.mdx +94 -4
  2174. package/docs/content/locales/zh-CN/template-dispatch.mdx +57 -4
  2175. package/docs/content/locales/zh-CN/template-forms.mdx +58 -4
  2176. package/docs/content/locales/zh-CN/template-mail.mdx +60 -4
  2177. package/docs/content/locales/zh-CN/template-plan.mdx +57 -4
  2178. package/docs/content/locales/zh-CN/template-slides.mdx +49 -4
  2179. package/docs/content/locales/zh-CN/template-videos.mdx +51 -4
  2180. package/docs/content/locales/zh-CN/tracking.mdx +54 -4
  2181. package/docs/content/locales/zh-CN/using-your-agent.mdx +51 -4
  2182. package/docs/content/locales/zh-CN/voice-input.mdx +43 -4
  2183. package/docs/content/locales/zh-CN/what-is-agent-native.mdx +94 -8
  2184. package/docs/content/locales/zh-CN/workspace-connections.mdx +126 -8
  2185. package/docs/content/locales/zh-CN/workspace-management.mdx +50 -4
  2186. package/docs/content/locales/zh-CN/workspace.mdx +110 -8
  2187. package/docs/content/locales/zh-CN/writing-agent-instructions.mdx +38 -4
  2188. package/docs/content/locales/zh-TW/a2a-protocol.mdx +97 -9
  2189. package/docs/content/locales/zh-TW/actions.mdx +63 -4
  2190. package/docs/content/locales/zh-TW/agent-mentions.mdx +68 -4
  2191. package/docs/content/locales/zh-TW/agent-surfaces.mdx +108 -8
  2192. package/docs/content/locales/zh-TW/agent-teams.mdx +171 -12
  2193. package/docs/content/locales/zh-TW/agent-web-surfaces.mdx +51 -4
  2194. package/docs/content/locales/zh-TW/authentication.mdx +122 -8
  2195. package/docs/content/locales/zh-TW/automations.mdx +110 -8
  2196. package/docs/content/locales/zh-TW/blueprint-installer.mdx +42 -4
  2197. package/docs/content/locales/zh-TW/cli-adapters.mdx +44 -4
  2198. package/docs/content/locales/zh-TW/client.mdx +79 -8
  2199. package/docs/content/locales/zh-TW/cloneable-saas.mdx +83 -8
  2200. package/docs/content/locales/zh-TW/code-agents-ui.mdx +94 -8
  2201. package/docs/content/locales/zh-TW/components.mdx +112 -8
  2202. package/docs/content/locales/zh-TW/context-awareness.mdx +96 -8
  2203. package/docs/content/locales/zh-TW/creating-templates.mdx +51 -4
  2204. package/docs/content/locales/zh-TW/cross-app-sso.mdx +107 -8
  2205. package/docs/content/locales/zh-TW/database.mdx +52 -4
  2206. package/docs/content/locales/zh-TW/deployment.mdx +103 -8
  2207. package/docs/content/locales/zh-TW/dispatch.mdx +134 -8
  2208. package/docs/content/locales/zh-TW/drop-in-agent.mdx +63 -4
  2209. package/docs/content/locales/zh-TW/durable-background-runs.mdx +88 -8
  2210. package/docs/content/locales/zh-TW/durable-resume.mdx +45 -4
  2211. package/docs/content/locales/zh-TW/embedding-sdk.mdx +83 -8
  2212. package/docs/content/locales/zh-TW/evals.mdx +100 -8
  2213. package/docs/content/locales/zh-TW/extensions.mdx +111 -9
  2214. package/docs/content/locales/zh-TW/external-agents.mdx +119 -8
  2215. package/docs/content/locales/zh-TW/faq.mdx +96 -8
  2216. package/docs/content/locales/zh-TW/file-uploads.mdx +61 -4
  2217. package/docs/content/locales/zh-TW/frames.mdx +86 -8
  2218. package/docs/content/locales/zh-TW/getting-started.mdx +34 -4
  2219. package/docs/content/locales/zh-TW/harness-agents.mdx +79 -8
  2220. package/docs/content/locales/zh-TW/human-approval.mdx +50 -4
  2221. package/docs/content/locales/zh-TW/key-concepts.mdx +100 -8
  2222. package/docs/content/locales/zh-TW/local-file-mode.mdx +56 -4
  2223. package/docs/content/locales/zh-TW/mcp-apps.mdx +120 -10
  2224. package/docs/content/locales/zh-TW/mcp-clients.mdx +133 -8
  2225. package/docs/content/locales/zh-TW/mcp-protocol.mdx +105 -8
  2226. package/docs/content/locales/zh-TW/messaging.mdx +115 -8
  2227. package/docs/content/locales/zh-TW/migration-workbench.mdx +45 -4
  2228. package/docs/content/locales/zh-TW/multi-app-workspace.mdx +91 -8
  2229. package/docs/content/locales/zh-TW/multi-tenancy.mdx +80 -8
  2230. package/docs/content/locales/zh-TW/native-chat-ui.mdx +104 -8
  2231. package/docs/content/locales/zh-TW/notifications.mdx +135 -8
  2232. package/docs/content/locales/zh-TW/observability.mdx +102 -8
  2233. package/docs/content/locales/zh-TW/observational-memory.mdx +85 -8
  2234. package/docs/content/locales/zh-TW/onboarding.mdx +44 -4
  2235. package/docs/content/locales/zh-TW/plan-plugin.mdx +97 -8
  2236. package/docs/content/locales/zh-TW/pr-visual-recap.mdx +123 -8
  2237. package/docs/content/locales/zh-TW/processors.mdx +39 -4
  2238. package/docs/content/locales/zh-TW/progress.mdx +46 -4
  2239. package/docs/content/locales/zh-TW/pure-agent-apps.mdx +46 -4
  2240. package/docs/content/locales/zh-TW/real-time-collaboration.mdx +98 -8
  2241. package/docs/content/locales/zh-TW/recurring-jobs.mdx +59 -4
  2242. package/docs/content/locales/zh-TW/routing.mdx +42 -5
  2243. package/docs/content/locales/zh-TW/sandbox-adapters.mdx +41 -4
  2244. package/docs/content/locales/zh-TW/security.mdx +80 -8
  2245. package/docs/content/locales/zh-TW/server.mdx +169 -12
  2246. package/docs/content/locales/zh-TW/sharing.mdx +45 -4
  2247. package/docs/content/locales/zh-TW/skills-guide.mdx +118 -9
  2248. package/docs/content/locales/zh-TW/template-analytics.mdx +46 -4
  2249. package/docs/content/locales/zh-TW/template-assets.mdx +58 -4
  2250. package/docs/content/locales/zh-TW/template-brain.mdx +65 -4
  2251. package/docs/content/locales/zh-TW/template-calendar.mdx +58 -4
  2252. package/docs/content/locales/zh-TW/template-chat.mdx +59 -4
  2253. package/docs/content/locales/zh-TW/template-clips.mdx +52 -4
  2254. package/docs/content/locales/zh-TW/template-content.mdx +58 -4
  2255. package/docs/content/locales/zh-TW/template-design.mdx +96 -4
  2256. package/docs/content/locales/zh-TW/template-dispatch.mdx +57 -4
  2257. package/docs/content/locales/zh-TW/template-forms.mdx +58 -4
  2258. package/docs/content/locales/zh-TW/template-mail.mdx +60 -4
  2259. package/docs/content/locales/zh-TW/template-plan.mdx +57 -4
  2260. package/docs/content/locales/zh-TW/template-slides.mdx +49 -4
  2261. package/docs/content/locales/zh-TW/template-videos.mdx +51 -4
  2262. package/docs/content/locales/zh-TW/tracking.mdx +54 -4
  2263. package/docs/content/locales/zh-TW/using-your-agent.mdx +51 -4
  2264. package/docs/content/locales/zh-TW/voice-input.mdx +43 -4
  2265. package/docs/content/locales/zh-TW/what-is-agent-native.mdx +94 -8
  2266. package/docs/content/locales/zh-TW/workspace-connections.mdx +126 -8
  2267. package/docs/content/locales/zh-TW/workspace-management.mdx +50 -4
  2268. package/docs/content/locales/zh-TW/workspace.mdx +111 -8
  2269. package/docs/content/locales/zh-TW/writing-agent-instructions.mdx +38 -4
  2270. package/docs/content/mcp-apps.mdx +120 -10
  2271. package/docs/content/mcp-clients.mdx +161 -8
  2272. package/docs/content/mcp-protocol.mdx +105 -8
  2273. package/docs/content/messaging.mdx +115 -8
  2274. package/docs/content/migration-workbench.mdx +45 -4
  2275. package/docs/content/multi-app-workspace.mdx +91 -8
  2276. package/docs/content/multi-tenancy.mdx +80 -8
  2277. package/docs/content/native-chat-ui.mdx +106 -8
  2278. package/docs/content/notifications.mdx +135 -8
  2279. package/docs/content/observability.mdx +102 -8
  2280. package/docs/content/observational-memory.mdx +89 -8
  2281. package/docs/content/onboarding.mdx +45 -4
  2282. package/docs/content/plan-plugin.mdx +99 -8
  2283. package/docs/content/pr-visual-recap.mdx +125 -8
  2284. package/docs/content/processors.mdx +41 -4
  2285. package/docs/content/progress.mdx +46 -4
  2286. package/docs/content/pure-agent-apps.mdx +46 -4
  2287. package/docs/content/real-time-collaboration.mdx +104 -8
  2288. package/docs/content/recurring-jobs.mdx +59 -4
  2289. package/docs/content/routing.mdx +44 -5
  2290. package/docs/content/sandbox-adapters.mdx +43 -4
  2291. package/docs/content/security.mdx +80 -8
  2292. package/docs/content/server.mdx +173 -12
  2293. package/docs/content/sharing.mdx +45 -4
  2294. package/docs/content/skills-guide.mdx +118 -9
  2295. package/docs/content/template-analytics.mdx +46 -4
  2296. package/docs/content/template-assets.mdx +60 -4
  2297. package/docs/content/template-brain.mdx +67 -4
  2298. package/docs/content/template-calendar.mdx +62 -4
  2299. package/docs/content/template-chat.mdx +61 -4
  2300. package/docs/content/template-clips.mdx +52 -4
  2301. package/docs/content/template-content.mdx +60 -4
  2302. package/docs/content/template-design.mdx +103 -4
  2303. package/docs/content/template-dispatch.mdx +57 -4
  2304. package/docs/content/template-forms.mdx +62 -4
  2305. package/docs/content/template-mail.mdx +60 -4
  2306. package/docs/content/template-plan.mdx +61 -4
  2307. package/docs/content/template-slides.mdx +49 -4
  2308. package/docs/content/template-videos.mdx +51 -4
  2309. package/docs/content/tracking.mdx +54 -4
  2310. package/docs/content/using-your-agent.mdx +51 -4
  2311. package/docs/content/voice-input.mdx +43 -4
  2312. package/docs/content/what-is-agent-native.mdx +188 -8
  2313. package/docs/content/workspace-connections.mdx +128 -8
  2314. package/docs/content/workspace-management.mdx +50 -4
  2315. package/docs/content/workspace.mdx +111 -8
  2316. package/docs/content/writing-agent-instructions.mdx +45 -4
  2317. package/package.json +2 -1
  2318. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +10 -0
  2319. package/corpus/templates/design/app/components/design/DesignToolbar.tsx +0 -339
  2320. package/corpus/templates/design/app/components/design/PresentMode.tsx +0 -68
  2321. package/corpus/templates/design/app/components/design/ViewportTabs.tsx +0 -149
  2322. package/corpus/templates/design/app/components/design/ZoomControls.tsx +0 -157
@@ -1,10 +1,27 @@
1
- import { useRef, useState, useCallback, useEffect } from "react";
2
-
1
+ import { useT } from "@agent-native/core/client";
2
+ import {
3
+ DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
4
+ appendPolylinePoint,
5
+ computeMoveSnap,
6
+ computeResizeSnap,
7
+ getDraftGeometryFromPoints,
8
+ getFrameGroupBounds,
9
+ getNudgeDelta,
10
+ getPanForZoomToCursor,
11
+ resizeFrameGroupFromDelta,
12
+ resizeFrameGroupToBounds,
13
+ screenToCanvasPoint,
14
+ type ArrowNudgeKey,
15
+ } from "@shared/canvas-math";
16
+ import { IconCopy, IconMaximize } from "@tabler/icons-react";
3
17
  import {
4
- Tooltip,
5
- TooltipContent,
6
- TooltipTrigger,
7
- } from "@/components/ui/tooltip";
18
+ useRef,
19
+ useState,
20
+ useCallback,
21
+ useEffect,
22
+ type ReactNode,
23
+ } from "react";
24
+
8
25
  import { prettyScreenName } from "@/lib/screen-names";
9
26
  import { cn } from "@/lib/utils";
10
27
 
@@ -12,42 +29,524 @@ interface ScreenFile {
12
29
  id: string;
13
30
  filename: string;
14
31
  content: string;
32
+ source?: string;
33
+ sourceType?: string;
34
+ lod?: string;
35
+ previewState?: string;
36
+ status?: string;
37
+ title?: string;
38
+ width?: number;
39
+ height?: number;
40
+ url?: string;
41
+ previewUrl?: string;
42
+ }
43
+
44
+ type ScreenSourceType = "localhost" | "fusion" | "inline";
45
+ type ScreenPreviewState = "live" | "snapshot" | "preview";
46
+ type MultiScreenCanvasTool =
47
+ | "move"
48
+ | "frame"
49
+ | "rect"
50
+ | "rectangle"
51
+ | "text"
52
+ | "pen"
53
+ | "hand"
54
+ | "comment"
55
+ | "draw"
56
+ | "scale"
57
+ | "overview";
58
+
59
+ interface CanvasToolProps {
60
+ fill?: string;
61
+ stroke?: string;
62
+ strokeWidth?: number;
63
+ text?: string;
64
+ }
65
+
66
+ export interface CanvasPrimitiveInsert {
67
+ kind: DraftPrimitiveKind;
68
+ geometry: FrameGeometry;
69
+ points?: Point[];
70
+ text?: string;
71
+ fill?: string;
72
+ stroke?: string;
73
+ strokeWidth?: number;
74
+ }
75
+
76
+ interface ScreenMetadata {
77
+ source?: string;
78
+ sourceType?: string;
79
+ lod?: string;
80
+ previewState?: string;
81
+ title?: string;
82
+ width?: number;
83
+ height?: number;
84
+ url?: string;
85
+ previewUrl?: string;
86
+ }
87
+
88
+ interface DuplicateRequest {
89
+ mode: "alt-click" | "alt-drag";
90
+ screen: ScreenFile;
91
+ canvasPosition: { x: number; y: number };
92
+ canvasOffset?: { x: number; y: number };
93
+ dropCanvasPosition?: { x: number; y: number };
15
94
  }
16
95
 
17
96
  interface MultiScreenCanvasProps {
18
97
  screens: ScreenFile[];
19
98
  zoom: number;
20
99
  activeId?: string | null;
100
+ activeTool?: MultiScreenCanvasTool;
101
+ toolProps?: CanvasToolProps;
102
+ onActiveToolChange?: (tool: MultiScreenCanvasTool) => void;
21
103
  onPick: (id: string) => void;
104
+ onEdit?: (id: string) => void;
105
+ metadataById?: Record<string, ScreenMetadata | undefined>;
106
+ getScreenMetadata?: (screen: ScreenFile) => ScreenMetadata | undefined;
107
+ onDuplicate?: (id: string, request: DuplicateRequest) => void;
108
+ geometryById?: Record<string, Partial<FrameGeometry> | undefined>;
109
+ onGeometryChange?: (geometryById: FrameGeometryById) => void;
110
+ onGeometryCommit?: (
111
+ before: FrameGeometryById,
112
+ after: FrameGeometryById,
113
+ ) => void;
114
+ onCreatePrimitive?: (
115
+ screenId: string,
116
+ primitive: CanvasPrimitiveInsert,
117
+ ) => boolean;
118
+ onDeleteSelection?: (ids: string[]) => boolean | void;
119
+ onZoomChange?: (zoom: number) => void;
120
+ onZoomToEdit?: (id: string) => void;
121
+ zoomToEditThreshold?: number;
122
+ renderScreenContent?: (
123
+ screen: ScreenFile,
124
+ metadata: ResolvedScreenMetadata,
125
+ geometry: FrameGeometry,
126
+ ) => ReactNode;
127
+ selectAllRequest?: number;
128
+ clearSelectionRequest?: number;
22
129
  }
23
130
 
24
131
  /**
25
- * Figma-style overview canvas. Renders every file in the design as a fixed-
26
- * size preview iframe, laid out in a wrap-flow inside an infinite, pannable
27
- * surface (drag with middle mouse OR left-click on background; click a screen
28
- * to enter the single-file editor for that file).
29
- *
30
- * Each screen is a 320×640 thumbnail; large enough to read, small enough to
31
- * fit several across. The dot grid background extends well past the screens
32
- * so panning never reveals the page outside.
132
+ * Figma-style overview canvas. Renders every file in the design as a movable,
133
+ * resizable frame inside an infinite, pannable surface.
33
134
  */
34
135
  const SCREEN_WIDTH = 320;
35
136
  const SCREEN_HEIGHT = 640;
36
137
  const SCREEN_CARD_HEIGHT = SCREEN_HEIGHT + 26;
37
138
  const SCREEN_GAP = 56;
38
139
  const SURFACE_PADDING = 240;
140
+ const DUPLICATE_DRAG_THRESHOLD = 6;
141
+ const DRAG_THRESHOLD = 3;
142
+ const FRAME_LABEL_HEIGHT = 28;
143
+ const MIN_ZOOM = 2;
144
+ const MAX_ZOOM = 800;
145
+ const ZOOM_SENSITIVITY = 0.002;
146
+ const MAX_WHEEL_ZOOM_DELTA = 80;
147
+ const MAX_WHEEL_PAN_DELTA = 140;
148
+ const PIXEL_GRID_ZOOM = 800;
149
+ const DRAFT_FRAME_WIDTH = 320;
150
+ const DRAFT_FRAME_HEIGHT = 240;
151
+ const DRAFT_RECT_WIDTH = 160;
152
+ const DRAFT_RECT_HEIGHT = 120;
153
+ const DRAFT_TEXT_WIDTH = 180;
154
+ const DRAFT_TEXT_HEIGHT = 48;
155
+ const DRAFT_PATH_MIN_SIZE = 12;
156
+ const PEN_SAMPLE_DISTANCE_SCREEN_PX = 5;
157
+
158
+ interface ResolvedScreenMetadata {
159
+ source: ScreenSourceType;
160
+ previewState: ScreenPreviewState;
161
+ title?: string;
162
+ width: number;
163
+ height: number;
164
+ previewUrl?: string;
165
+ }
166
+
167
+ interface DuplicatePreview {
168
+ display: string;
169
+ x: number;
170
+ y: number;
171
+ canDuplicate: boolean;
172
+ moved: boolean;
173
+ }
174
+
175
+ interface TransformBadge {
176
+ x: number;
177
+ y: number;
178
+ text: string;
179
+ }
180
+
181
+ export interface FrameGeometry {
182
+ x: number;
183
+ y: number;
184
+ width: number;
185
+ height: number;
186
+ rotation?: number;
187
+ z?: number;
188
+ }
189
+
190
+ type FrameGeometryById = Record<string, FrameGeometry>;
191
+
192
+ export interface Point {
193
+ x: number;
194
+ y: number;
195
+ }
196
+
197
+ export type DraftPrimitiveKind = "frame" | "rectangle" | "text" | "path";
198
+ type DraftCreationTool = "frame" | "rect" | "text" | "pen";
199
+
200
+ interface DraftPrimitive {
201
+ id: string;
202
+ kind: DraftPrimitiveKind;
203
+ geometry: FrameGeometry;
204
+ points?: Point[];
205
+ text?: string;
206
+ fill?: string;
207
+ stroke?: string;
208
+ strokeWidth?: number;
209
+ }
210
+
211
+ type DraftPrimitiveById = Record<string, DraftPrimitive>;
212
+
213
+ interface DraftPrimitiveInput {
214
+ tool: DraftCreationTool;
215
+ start: Point;
216
+ end: Point;
217
+ points?: Point[];
218
+ moved: boolean;
219
+ toolProps?: CanvasToolProps;
220
+ fallbackText: string;
221
+ }
222
+
223
+ interface MarqueeRect {
224
+ x: number;
225
+ y: number;
226
+ width: number;
227
+ height: number;
228
+ }
229
+
230
+ type ResizeHandle = "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" | "w";
231
+
232
+ interface AlignmentGuide {
233
+ orientation: "vertical" | "horizontal";
234
+ position: number;
235
+ start: number;
236
+ end: number;
237
+ }
238
+
239
+ interface MoveDragState {
240
+ type: "move";
241
+ originClient: Point;
242
+ originFrames: FrameGeometryById;
243
+ targetIds: string[];
244
+ primaryId: string;
245
+ hasMoved: boolean;
246
+ }
247
+
248
+ interface ResizeDragState {
249
+ type: "resize";
250
+ originClient: Point;
251
+ originFrames: FrameGeometryById;
252
+ originBounds: FrameGeometry;
253
+ targetIds: string[];
254
+ handle: ResizeHandle;
255
+ hasMoved: boolean;
256
+ }
257
+
258
+ interface RotateDragState {
259
+ type: "rotate";
260
+ originClient: Point;
261
+ originFrame: FrameGeometry;
262
+ frameId: string;
263
+ originPointerAngle: number;
264
+ originRotation: number;
265
+ hasMoved: boolean;
266
+ }
267
+
268
+ interface MarqueeDragState {
269
+ type: "marquee";
270
+ originClient: Point;
271
+ originCanvas: Point;
272
+ baseSelectedIds: string[];
273
+ baseSelectedDraftIds: string[];
274
+ additive: boolean;
275
+ hasMoved: boolean;
276
+ }
277
+
278
+ interface PanDragState {
279
+ type: "pan";
280
+ originClient: Point;
281
+ originPan: Point;
282
+ }
283
+
284
+ interface DraftMoveDragState {
285
+ type: "draft-move";
286
+ originClient: Point;
287
+ originDrafts: DraftPrimitiveById;
288
+ targetIds: string[];
289
+ primaryId: string;
290
+ hasMoved: boolean;
291
+ }
292
+
293
+ interface DraftResizeDragState {
294
+ type: "draft-resize";
295
+ originClient: Point;
296
+ originDrafts: DraftPrimitiveById;
297
+ originBounds: FrameGeometry;
298
+ targetIds: string[];
299
+ handle: ResizeHandle;
300
+ hasMoved: boolean;
301
+ }
302
+
303
+ interface DraftCreateDragState {
304
+ type: "draft-create";
305
+ tool: DraftCreationTool;
306
+ originClient: Point;
307
+ originCanvas: Point;
308
+ points: Point[];
309
+ hasMoved: boolean;
310
+ }
311
+
312
+ interface DraftCreationPreview {
313
+ tool: DraftCreationTool;
314
+ geometry: FrameGeometry;
315
+ points?: Point[];
316
+ }
317
+
318
+ type DragState =
319
+ | MoveDragState
320
+ | ResizeDragState
321
+ | RotateDragState
322
+ | MarqueeDragState
323
+ | PanDragState
324
+ | DraftMoveDragState
325
+ | DraftResizeDragState
326
+ | DraftCreateDragState;
39
327
 
40
328
  export function MultiScreenCanvas({
41
329
  screens,
42
330
  zoom,
43
331
  activeId,
332
+ activeTool,
333
+ toolProps,
334
+ onActiveToolChange,
44
335
  onPick,
336
+ onEdit,
337
+ metadataById,
338
+ getScreenMetadata,
339
+ onDuplicate,
340
+ geometryById,
341
+ onGeometryChange,
342
+ onGeometryCommit,
343
+ onCreatePrimitive,
344
+ onDeleteSelection,
345
+ onZoomChange,
346
+ onZoomToEdit,
347
+ zoomToEditThreshold,
348
+ renderScreenContent,
349
+ selectAllRequest,
350
+ clearSelectionRequest,
45
351
  }: MultiScreenCanvasProps) {
352
+ const t = useT();
46
353
  const surfaceRef = useRef<HTMLDivElement>(null);
47
354
  const [pan, setPan] = useState({ x: 0, y: 0 });
48
- const dragging = useRef<{ x: number; y: number } | null>(null);
355
+ const panRef = useRef(pan);
356
+ const [canvasZoom, setCanvasZoom] = useState(zoom);
357
+ const zoomRef = useRef(zoom);
358
+ const [frameGeometry, setFrameGeometry] = useState<FrameGeometryById>({});
359
+ const frameGeometryRef = useRef(frameGeometry);
360
+ const onGeometryChangeRef = useRef(onGeometryChange);
361
+ const onGeometryCommitRef = useRef(onGeometryCommit);
362
+ const [draftPrimitives, setDraftPrimitives] = useState<DraftPrimitive[]>([]);
363
+ const draftPrimitivesRef = useRef(draftPrimitives);
364
+ const [selectedDraftIds, setSelectedDraftIds] = useState<string[]>([]);
365
+ const selectedDraftIdsRef = useRef(selectedDraftIds);
366
+ const [creationPreview, setCreationPreview] =
367
+ useState<DraftCreationPreview | null>(null);
368
+ const [localActiveTool, setLocalActiveTool] =
369
+ useState<MultiScreenCanvasTool>("move");
370
+ const [selectedIds, setSelectedIds] = useState<string[]>(
371
+ activeId ? [activeId] : [],
372
+ );
373
+ const selectedIdsRef = useRef(selectedIds);
374
+ const dragState = useRef<DragState | null>(null);
49
375
  const dragCleanup = useRef<(() => void) | null>(null);
376
+ const duplicateCleanup = useRef<(() => void) | null>(null);
377
+ const handledSelectAllRequestRef = useRef(selectAllRequest);
378
+ const handledClearSelectionRequestRef = useRef(clearSelectionRequest);
50
379
  const [isDragging, setIsDragging] = useState(false);
380
+ const [isPanning, setIsPanning] = useState(false);
381
+ const [marquee, setMarquee] = useState<MarqueeRect | null>(null);
382
+ const [alignmentGuides, setAlignmentGuides] = useState<AlignmentGuide[]>([]);
383
+ const [duplicatePreview, setDuplicatePreview] =
384
+ useState<DuplicatePreview | null>(null);
385
+ const [transformBadge, setTransformBadge] = useState<TransformBadge | null>(
386
+ null,
387
+ );
388
+ const [dragCursor, setDragCursor] = useState<string | null>(null);
389
+ const suppressNextPick = useRef(false);
390
+ const feedbackTimerRef = useRef<number | null>(null);
391
+
392
+ useEffect(() => {
393
+ onGeometryChangeRef.current = onGeometryChange;
394
+ }, [onGeometryChange]);
395
+
396
+ useEffect(() => {
397
+ onGeometryCommitRef.current = onGeometryCommit;
398
+ }, [onGeometryCommit]);
399
+
400
+ const updateFrameGeometry = useCallback(
401
+ (updater: (current: FrameGeometryById) => FrameGeometryById) => {
402
+ setFrameGeometry((current) => {
403
+ const next = updater(current);
404
+ frameGeometryRef.current = next;
405
+ onGeometryChangeRef.current?.(next);
406
+ return next;
407
+ });
408
+ },
409
+ [],
410
+ );
411
+
412
+ const updateSelectedIds = useCallback(
413
+ (updater: (current: string[]) => string[]) => {
414
+ setSelectedIds((current) => {
415
+ const next = dedupeIds(updater(current));
416
+ if (sameIds(current, next)) {
417
+ selectedIdsRef.current = current;
418
+ return current;
419
+ }
420
+ selectedIdsRef.current = next;
421
+ return next;
422
+ });
423
+ },
424
+ [],
425
+ );
426
+
427
+ const updateDraftPrimitives = useCallback(
428
+ (updater: (current: DraftPrimitive[]) => DraftPrimitive[]) => {
429
+ setDraftPrimitives((current) => {
430
+ const next = updater(current);
431
+ draftPrimitivesRef.current = next;
432
+ return next;
433
+ });
434
+ },
435
+ [],
436
+ );
437
+
438
+ const updateSelectedDraftIds = useCallback(
439
+ (updater: (current: string[]) => string[]) => {
440
+ setSelectedDraftIds((current) => {
441
+ const currentIds = new Set(
442
+ draftPrimitivesRef.current.map(({ id }) => id),
443
+ );
444
+ const next = dedupeIds(updater(current)).filter((id) =>
445
+ currentIds.has(id),
446
+ );
447
+ if (sameIds(current, next)) {
448
+ selectedDraftIdsRef.current = current;
449
+ return current;
450
+ }
451
+ selectedDraftIdsRef.current = next;
452
+ return next;
453
+ });
454
+ },
455
+ [],
456
+ );
457
+
458
+ useEffect(() => {
459
+ panRef.current = pan;
460
+ }, [pan]);
461
+
462
+ useEffect(() => {
463
+ zoomRef.current = canvasZoom;
464
+ }, [canvasZoom]);
465
+
466
+ useEffect(() => {
467
+ frameGeometryRef.current = frameGeometry;
468
+ }, [frameGeometry]);
469
+
470
+ useEffect(() => {
471
+ selectedIdsRef.current = selectedIds;
472
+ }, [selectedIds]);
473
+
474
+ useEffect(() => {
475
+ draftPrimitivesRef.current = draftPrimitives;
476
+ }, [draftPrimitives]);
477
+
478
+ useEffect(() => {
479
+ selectedDraftIdsRef.current = selectedDraftIds;
480
+ }, [selectedDraftIds]);
481
+
482
+ useEffect(() => {
483
+ setCanvasZoom(zoom);
484
+ zoomRef.current = zoom;
485
+ }, [zoom]);
486
+
487
+ useEffect(() => {
488
+ const currentIds = new Set(screens.map((screen) => screen.id));
489
+ updateFrameGeometry((current) => {
490
+ const next: FrameGeometryById = {};
491
+ let changed = Object.keys(current).some((id) => !currentIds.has(id));
492
+
493
+ screens.forEach((screen, index) => {
494
+ const existing = current[screen.id];
495
+ const persisted = geometryById?.[screen.id];
496
+ const resolved = {
497
+ ...getInitialFrameGeometry(index),
498
+ ...persisted,
499
+ } as FrameGeometry;
500
+ next[screen.id] = persisted ? resolved : (existing ?? resolved);
501
+ if (
502
+ !existing ||
503
+ (persisted && !sameFrameGeometry(existing, resolved))
504
+ ) {
505
+ changed = true;
506
+ }
507
+ });
508
+
509
+ return changed ? next : current;
510
+ });
511
+ updateSelectedIds((current) => {
512
+ const next = current.filter((id) => currentIds.has(id));
513
+ return next.length === current.length ? current : next;
514
+ });
515
+ }, [geometryById, screens, updateFrameGeometry, updateSelectedIds]);
516
+
517
+ useEffect(() => {
518
+ if (!activeId) return;
519
+ updateSelectedIds((current) =>
520
+ current.includes(activeId) ? current : [activeId],
521
+ );
522
+ }, [activeId, updateSelectedIds]);
523
+
524
+ useEffect(() => {
525
+ if (
526
+ selectAllRequest === undefined ||
527
+ selectAllRequest === handledSelectAllRequestRef.current
528
+ ) {
529
+ return;
530
+ }
531
+ handledSelectAllRequestRef.current = selectAllRequest;
532
+ updateSelectedDraftIds(() => []);
533
+ updateSelectedIds(() => screens.map((screen) => screen.id));
534
+ }, [screens, selectAllRequest, updateSelectedDraftIds, updateSelectedIds]);
535
+
536
+ useEffect(() => {
537
+ if (
538
+ clearSelectionRequest === undefined ||
539
+ clearSelectionRequest === handledClearSelectionRequestRef.current
540
+ ) {
541
+ return;
542
+ }
543
+ handledClearSelectionRequestRef.current = clearSelectionRequest;
544
+ updateSelectedDraftIds(() => []);
545
+ updateSelectedIds(() => []);
546
+ setMarquee(null);
547
+ setAlignmentGuides([]);
548
+ setTransformBadge(null);
549
+ }, [clearSelectionRequest, updateSelectedDraftIds, updateSelectedIds]);
51
550
 
52
551
  // Center the lineup on first mount so the user sees screens, not whitespace.
53
552
  useEffect(() => {
@@ -55,169 +554,2639 @@ export function MultiScreenCanvas({
55
554
  const rect = surfaceRef.current.getBoundingClientRect();
56
555
  const columns = Math.min(screens.length, 3);
57
556
  const rows = Math.ceil(screens.length / columns);
58
- const scale = zoom / 100;
557
+ const scale = zoomRef.current / 100;
59
558
  const totalWidth = columns * SCREEN_WIDTH + (columns - 1) * SCREEN_GAP;
60
559
  const totalHeight = rows * SCREEN_CARD_HEIGHT + (rows - 1) * SCREEN_GAP;
61
560
  const visualLeft = Math.max(24, (rect.width - totalWidth * scale) / 2);
62
561
  const visualTop = Math.max(24, (rect.height - totalHeight * scale) / 2);
63
- setPan({
562
+ const nextPan = {
64
563
  x: visualLeft - SURFACE_PADDING * scale,
65
564
  y: visualTop - SURFACE_PADDING * scale,
66
- });
565
+ };
566
+ panRef.current = nextPan;
567
+ setPan(nextPan);
67
568
  // Only on mount or when screen count changes, not on every pan update.
68
569
  // eslint-disable-next-line react-hooks/exhaustive-deps
69
- }, [screens.length, zoom]);
570
+ }, [screens.length]);
70
571
 
71
572
  useEffect(() => {
72
573
  return () => {
73
574
  dragCleanup.current?.();
575
+ duplicateCleanup.current?.();
576
+ if (feedbackTimerRef.current !== null) {
577
+ window.clearTimeout(feedbackTimerRef.current);
578
+ }
74
579
  };
75
580
  }, []);
76
581
 
77
- const handleMouseDown = useCallback(
582
+ const canvasPointFromClient = useCallback(
583
+ (clientX: number, clientY: number) => {
584
+ const rect = surfaceRef.current?.getBoundingClientRect();
585
+ if (!rect) return { x: 0, y: 0 };
586
+ return screenToCanvasPoint(
587
+ { x: clientX, y: clientY },
588
+ { ...panRef.current, zoom: zoomRef.current },
589
+ { x: rect.left, y: rect.top },
590
+ SURFACE_PADDING,
591
+ true,
592
+ );
593
+ },
594
+ [],
595
+ );
596
+
597
+ const getCanvasPoint = useCallback((clientX: number, clientY: number) => {
598
+ const rect = surfaceRef.current?.getBoundingClientRect();
599
+ if (!rect) return { x: 0, y: 0 };
600
+ return screenToCanvasPoint(
601
+ { x: clientX, y: clientY },
602
+ { ...panRef.current, zoom: zoomRef.current },
603
+ { x: rect.left, y: rect.top },
604
+ SURFACE_PADDING,
605
+ );
606
+ }, []);
607
+
608
+ const getCurrentFrameEntries = useCallback(
609
+ () => getFrameEntries(screens, frameGeometryRef.current),
610
+ [screens],
611
+ );
612
+
613
+ const getCurrentDraftEntries = useCallback(
614
+ () =>
615
+ draftPrimitivesRef.current.map((draft) => ({
616
+ id: draft.id,
617
+ geometry: draft.geometry,
618
+ })),
619
+ [],
620
+ );
621
+
622
+ const getCurrentCanvasEntries = useCallback(
623
+ () => [...getCurrentFrameEntries(), ...getCurrentDraftEntries()],
624
+ [getCurrentDraftEntries, getCurrentFrameEntries],
625
+ );
626
+
627
+ const getFrameAtClientPoint = useCallback(
628
+ (clientX: number, clientY: number) => {
629
+ const point = canvasPointFromClient(clientX, clientY);
630
+ return getCurrentFrameEntries()
631
+ .map((entry, index) => ({ ...entry, index }))
632
+ .filter((entry) =>
633
+ rectContainsPoint(getSelectableBounds(entry.geometry), point),
634
+ )
635
+ .sort(
636
+ (a, b) =>
637
+ (b.geometry.z ?? 0) - (a.geometry.z ?? 0) || b.index - a.index,
638
+ )[0]?.id;
639
+ },
640
+ [canvasPointFromClient, getCurrentFrameEntries],
641
+ );
642
+
643
+ const deleteSelectedItems = useCallback(() => {
644
+ const frameIds = selectedIdsRef.current.filter(
645
+ (id) => frameGeometryRef.current[id],
646
+ );
647
+ const draftIds = selectedDraftIdsRef.current.filter((id) =>
648
+ draftPrimitivesRef.current.some((draft) => draft.id === id),
649
+ );
650
+ if (frameIds.length === 0 && draftIds.length === 0) return false;
651
+
652
+ if (draftIds.length > 0) {
653
+ updateDraftPrimitives((current) =>
654
+ current.filter((draft) => !draftIds.includes(draft.id)),
655
+ );
656
+ updateSelectedDraftIds((current) =>
657
+ current.filter((id) => !draftIds.includes(id)),
658
+ );
659
+ }
660
+
661
+ if (frameIds.length > 0) {
662
+ const accepted = onDeleteSelection?.(frameIds);
663
+ if (accepted !== false && onDeleteSelection) {
664
+ const before = cloneFrameGeometryById(frameGeometryRef.current);
665
+ const after = cloneFrameGeometryById(before);
666
+ frameIds.forEach((id) => {
667
+ delete after[id];
668
+ });
669
+ updateFrameGeometry(() => after);
670
+ onGeometryCommitRef.current?.(before, after);
671
+ updateSelectedIds((current) =>
672
+ current.filter((id) => !frameIds.includes(id)),
673
+ );
674
+ }
675
+ }
676
+
677
+ setMarquee(null);
678
+ setAlignmentGuides([]);
679
+ setTransformBadge(null);
680
+ return true;
681
+ }, [
682
+ onDeleteSelection,
683
+ updateDraftPrimitives,
684
+ updateFrameGeometry,
685
+ updateSelectedDraftIds,
686
+ updateSelectedIds,
687
+ ]);
688
+
689
+ const installDragListeners = useCallback(
690
+ (
691
+ handleMouseMove: (ev: MouseEvent) => void,
692
+ handleMouseUp: (ev: MouseEvent) => void,
693
+ ) => {
694
+ dragCleanup.current?.();
695
+ const move = (ev: MouseEvent) => {
696
+ ev.preventDefault();
697
+ handleMouseMove(ev);
698
+ };
699
+ const up = (ev: MouseEvent) => {
700
+ ev.preventDefault();
701
+ handleMouseUp(ev);
702
+ };
703
+ const cleanupOnBlur = () => handleMouseUp(new MouseEvent("mouseup"));
704
+ dragCleanup.current = () => {
705
+ window.removeEventListener("mousemove", move);
706
+ window.removeEventListener("mouseup", up);
707
+ window.removeEventListener("blur", cleanupOnBlur);
708
+ dragCleanup.current = null;
709
+ };
710
+ window.addEventListener("mousemove", move);
711
+ window.addEventListener("mouseup", up);
712
+ window.addEventListener("blur", cleanupOnBlur);
713
+ },
714
+ [],
715
+ );
716
+
717
+ const scheduleFeedbackClear = useCallback(() => {
718
+ if (feedbackTimerRef.current !== null) {
719
+ window.clearTimeout(feedbackTimerRef.current);
720
+ }
721
+ feedbackTimerRef.current = window.setTimeout(() => {
722
+ setAlignmentGuides([]);
723
+ setTransformBadge(null);
724
+ feedbackTimerRef.current = null;
725
+ }, 650);
726
+ }, []);
727
+
728
+ const showTransformFeedback = useCallback(
729
+ (text: string, clientX: number, clientY: number) => {
730
+ setTransformBadge({
731
+ text,
732
+ x: clientX + 12,
733
+ y: clientY + 12,
734
+ });
735
+ },
736
+ [],
737
+ );
738
+
739
+ const finishDrag = useCallback(() => {
740
+ if (feedbackTimerRef.current !== null) {
741
+ window.clearTimeout(feedbackTimerRef.current);
742
+ feedbackTimerRef.current = null;
743
+ }
744
+ dragState.current = null;
745
+ setIsDragging(false);
746
+ setIsPanning(false);
747
+ setMarquee(null);
748
+ setCreationPreview(null);
749
+ setAlignmentGuides([]);
750
+ setTransformBadge(null);
751
+ setDragCursor(null);
752
+ dragCleanup.current?.();
753
+ }, []);
754
+
755
+ const beginPan = useCallback(
756
+ (e: React.MouseEvent) => {
757
+ e.preventDefault();
758
+ e.stopPropagation();
759
+ dragState.current = {
760
+ type: "pan",
761
+ originClient: { x: e.clientX, y: e.clientY },
762
+ originPan: panRef.current,
763
+ };
764
+ setIsPanning(true);
765
+
766
+ const handleMouseMove = (ev: MouseEvent) => {
767
+ const state = dragState.current;
768
+ if (!state || state.type !== "pan") return;
769
+ const nextPan = {
770
+ x: state.originPan.x + ev.clientX - state.originClient.x,
771
+ y: state.originPan.y + ev.clientY - state.originClient.y,
772
+ };
773
+ panRef.current = nextPan;
774
+ setPan(nextPan);
775
+ };
776
+
777
+ installDragListeners(handleMouseMove, finishDrag);
778
+ },
779
+ [finishDrag, installDragListeners],
780
+ );
781
+
782
+ const beginMarquee = useCallback(
78
783
  (e: React.MouseEvent) => {
79
- // Middle mouse, or left mouse anywhere that is not a screen card.
80
- const target = e.target as HTMLElement;
81
- const onScreen = !!target.closest("[data-screen-card]");
82
- if (e.button !== 1 && !(e.button === 0 && !onScreen)) return;
83
784
  e.preventDefault();
84
785
  e.stopPropagation();
85
- const dragOrigin = { x: e.clientX - pan.x, y: e.clientY - pan.y };
86
- dragging.current = dragOrigin;
786
+ const originCanvas = getCanvasPoint(e.clientX, e.clientY);
787
+ dragState.current = {
788
+ type: "marquee",
789
+ originClient: { x: e.clientX, y: e.clientY },
790
+ originCanvas,
791
+ baseSelectedIds: selectedIdsRef.current,
792
+ baseSelectedDraftIds: selectedDraftIdsRef.current,
793
+ additive: e.shiftKey,
794
+ hasMoved: false,
795
+ };
796
+ setMarquee({ ...originCanvas, width: 0, height: 0 });
797
+ if (!e.shiftKey) {
798
+ updateSelectedIds(() => []);
799
+ updateSelectedDraftIds(() => []);
800
+ }
87
801
  setIsDragging(true);
88
802
 
89
803
  const handleMouseMove = (ev: MouseEvent) => {
90
- if (!dragging.current) return;
91
- setPan({
92
- x: ev.clientX - dragOrigin.x,
93
- y: ev.clientY - dragOrigin.y,
94
- });
804
+ const state = dragState.current;
805
+ if (!state || state.type !== "marquee") return;
806
+ const nextPoint = getCanvasPoint(ev.clientX, ev.clientY);
807
+ const rect = normalizeRectFromPoints(state.originCanvas, nextPoint);
808
+ if (
809
+ !state.hasMoved &&
810
+ Math.hypot(
811
+ ev.clientX - state.originClient.x,
812
+ ev.clientY - state.originClient.y,
813
+ ) >= DRAG_THRESHOLD
814
+ ) {
815
+ state.hasMoved = true;
816
+ }
817
+ setMarquee(rect);
818
+
819
+ const hitIds = getCurrentFrameEntries()
820
+ .filter((entry) =>
821
+ rectIntersects(rect, getSelectableBounds(entry.geometry)),
822
+ )
823
+ .map((entry) => entry.id);
824
+ const hitDraftIds = getCurrentDraftEntries()
825
+ .filter((entry) =>
826
+ rectIntersects(rect, getSelectableBounds(entry.geometry)),
827
+ )
828
+ .map((entry) => entry.id);
829
+ updateSelectedIds(() =>
830
+ state.additive
831
+ ? dedupeIds([...state.baseSelectedIds, ...hitIds])
832
+ : hitIds,
833
+ );
834
+ updateSelectedDraftIds(() =>
835
+ state.additive
836
+ ? dedupeIds([...state.baseSelectedDraftIds, ...hitDraftIds])
837
+ : hitDraftIds,
838
+ );
95
839
  };
96
840
 
97
841
  const handleMouseUp = () => {
98
- dragging.current = null;
99
- setIsDragging(false);
100
- window.removeEventListener("mousemove", handleMouseMove);
101
- window.removeEventListener("mouseup", handleMouseUp);
102
- dragCleanup.current = null;
842
+ const state = dragState.current;
843
+ if (state?.type === "marquee" && !state.hasMoved && !state.additive) {
844
+ updateSelectedIds(() => []);
845
+ updateSelectedDraftIds(() => []);
846
+ }
847
+ finishDrag();
103
848
  };
104
849
 
105
- dragCleanup.current?.();
106
- dragCleanup.current = handleMouseUp;
107
- window.addEventListener("mousemove", handleMouseMove);
108
- window.addEventListener("mouseup", handleMouseUp);
850
+ installDragListeners(handleMouseMove, handleMouseUp);
109
851
  },
110
- [pan],
852
+ [
853
+ finishDrag,
854
+ getCanvasPoint,
855
+ getCurrentDraftEntries,
856
+ getCurrentFrameEntries,
857
+ installDragListeners,
858
+ updateSelectedDraftIds,
859
+ updateSelectedIds,
860
+ ],
111
861
  );
112
862
 
113
- return (
114
- <div
115
- ref={surfaceRef}
116
- className="relative h-full w-full overflow-hidden"
117
- onMouseDown={handleMouseDown}
118
- style={{ cursor: isDragging ? "grabbing" : "grab" }}
119
- >
120
- {/* Dot grid extends past the surface so panning never shows page bg. */}
121
- <div
122
- className="pointer-events-none absolute inset-0"
123
- style={{
124
- backgroundImage:
125
- "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)",
126
- backgroundSize: "24px 24px",
127
- }}
128
- />
863
+ const beginDraftCreation = useCallback(
864
+ (tool: DraftCreationTool, e: React.MouseEvent) => {
865
+ if (e.button !== 0) return;
866
+ e.preventDefault();
867
+ e.stopPropagation();
129
868
 
130
- {/* Lineup */}
131
- <div
132
- className="absolute"
133
- style={{
134
- left: pan.x,
135
- top: pan.y,
136
- padding: SURFACE_PADDING,
137
- transform: `scale(${zoom / 100})`,
138
- transformOrigin: "top left",
139
- }}
140
- >
141
- <div
142
- className="flex flex-wrap"
143
- style={{
144
- gap: SCREEN_GAP,
145
- maxWidth: SCREEN_WIDTH * 3 + SCREEN_GAP * 2,
146
- }}
147
- >
148
- {screens.map((screen) => (
149
- <Screen
150
- key={screen.id}
151
- screen={screen}
152
- isActive={screen.id === activeId}
153
- onPick={onPick}
154
- />
155
- ))}
156
- </div>
157
- </div>
158
- </div>
869
+ const originCanvas = getCanvasPoint(e.clientX, e.clientY);
870
+ const initialGeometry = getDraftGeometryForTool(
871
+ tool,
872
+ originCanvas,
873
+ originCanvas,
874
+ );
875
+ const initialPoints = tool === "pen" ? [originCanvas] : undefined;
876
+ dragState.current = {
877
+ type: "draft-create",
878
+ tool,
879
+ originClient: { x: e.clientX, y: e.clientY },
880
+ originCanvas,
881
+ points: initialPoints ?? [],
882
+ hasMoved: false,
883
+ };
884
+ setCreationPreview({
885
+ tool,
886
+ geometry: initialGeometry,
887
+ points: initialPoints,
888
+ });
889
+ setIsDragging(true);
890
+ setDragCursor(tool === "pen" ? "crosshair" : "crosshair");
891
+
892
+ const handleMouseMove = (ev: MouseEvent) => {
893
+ const state = dragState.current;
894
+ if (!state || state.type !== "draft-create") return;
895
+ const nextCanvas = getCanvasPoint(ev.clientX, ev.clientY);
896
+ if (
897
+ !state.hasMoved &&
898
+ Math.hypot(
899
+ ev.clientX - state.originClient.x,
900
+ ev.clientY - state.originClient.y,
901
+ ) >= DRAG_THRESHOLD
902
+ ) {
903
+ state.hasMoved = true;
904
+ }
905
+
906
+ if (state.tool === "pen") {
907
+ const minDistance =
908
+ PEN_SAMPLE_DISTANCE_SCREEN_PX / (zoomRef.current / 100);
909
+ state.points = appendPolylinePoint(
910
+ state.points,
911
+ nextCanvas,
912
+ minDistance,
913
+ );
914
+ setCreationPreview({
915
+ tool,
916
+ geometry: getPathGeometry(state.points),
917
+ points: state.points,
918
+ });
919
+ return;
920
+ }
921
+
922
+ setCreationPreview({
923
+ tool,
924
+ geometry: getDraftGeometryForTool(
925
+ tool,
926
+ state.originCanvas,
927
+ nextCanvas,
928
+ ),
929
+ });
930
+ };
931
+
932
+ const handleMouseUp = (ev: MouseEvent) => {
933
+ const state = dragState.current;
934
+ if (!state || state.type !== "draft-create") {
935
+ finishDrag();
936
+ return;
937
+ }
938
+
939
+ let endCanvas = getCanvasPoint(ev.clientX, ev.clientY);
940
+ let points = state.tool === "pen" ? state.points : undefined;
941
+ if (state.tool === "pen") {
942
+ points = appendPolylinePoint(state.points, endCanvas, 0);
943
+ if (!state.hasMoved || points.length < 2) {
944
+ finishDrag();
945
+ return;
946
+ }
947
+ endCanvas = points[points.length - 1] ?? endCanvas;
948
+ }
949
+ const nextDraft = createDraftPrimitive({
950
+ tool: state.tool,
951
+ start: state.originCanvas,
952
+ end: endCanvas,
953
+ points,
954
+ moved: state.hasMoved,
955
+ toolProps,
956
+ fallbackText: t("designEditor.tools.text"),
957
+ });
958
+ const targetFrame = getCurrentFrameEntries()
959
+ .filter(({ geometry }) =>
960
+ rectContainsPoint(
961
+ {
962
+ left: geometry.x,
963
+ top: geometry.y,
964
+ right: geometry.x + geometry.width,
965
+ bottom: geometry.y + geometry.height,
966
+ },
967
+ getFrameCenter(nextDraft.geometry),
968
+ ),
969
+ )
970
+ .sort((a, b) => (b.geometry.z ?? 0) - (a.geometry.z ?? 0))[0];
971
+
972
+ if (targetFrame && onCreatePrimitive) {
973
+ const localPrimitive = draftPrimitiveToInsert(
974
+ nextDraft,
975
+ targetFrame.geometry,
976
+ );
977
+ const persisted = onCreatePrimitive(targetFrame.id, localPrimitive);
978
+ if (persisted) {
979
+ updateDraftPrimitives((current) =>
980
+ current.filter((draft) => draft.id !== nextDraft.id),
981
+ );
982
+ updateSelectedDraftIds(() => []);
983
+ updateSelectedIds(() => [targetFrame.id]);
984
+ } else {
985
+ updateDraftPrimitives((current) => [...current, nextDraft]);
986
+ updateSelectedIds(() => []);
987
+ updateSelectedDraftIds(() => [nextDraft.id]);
988
+ }
989
+ } else {
990
+ updateDraftPrimitives((current) => [...current, nextDraft]);
991
+ updateSelectedIds(() => []);
992
+ updateSelectedDraftIds(() => [nextDraft.id]);
993
+ }
994
+ if (activeTool === undefined) {
995
+ setLocalActiveTool("move");
996
+ }
997
+ if (state.tool === "pen") {
998
+ if (activeTool === undefined) {
999
+ setLocalActiveTool("pen");
1000
+ }
1001
+ onActiveToolChange?.("pen");
1002
+ } else {
1003
+ onActiveToolChange?.("move");
1004
+ }
1005
+ finishDrag();
1006
+ };
1007
+
1008
+ installDragListeners(handleMouseMove, handleMouseUp);
1009
+ },
1010
+ [
1011
+ activeTool,
1012
+ finishDrag,
1013
+ getCanvasPoint,
1014
+ getCurrentFrameEntries,
1015
+ installDragListeners,
1016
+ onActiveToolChange,
1017
+ onCreatePrimitive,
1018
+ t,
1019
+ toolProps,
1020
+ updateDraftPrimitives,
1021
+ updateSelectedDraftIds,
1022
+ updateSelectedIds,
1023
+ ],
159
1024
  );
160
- }
161
1025
 
162
- function Screen({
163
- screen,
164
- isActive,
165
- onPick,
166
- }: {
167
- screen: ScreenFile;
168
- isActive: boolean;
169
- onPick: (id: string) => void;
170
- }) {
171
- const display = prettyScreenName(screen.filename);
172
- return (
173
- <div className="flex flex-col gap-2">
174
- <span
175
- className={cn(
176
- "px-1 text-[11px] font-medium",
177
- isActive ? "text-foreground" : "text-muted-foreground",
178
- )}
179
- title={screen.filename}
180
- >
181
- {display}
182
- </span>
183
- <Tooltip>
184
- <TooltipTrigger asChild>
185
- <button
186
- data-screen-card
187
- type="button"
188
- onClick={(e) => {
189
- e.stopPropagation();
190
- onPick(screen.id);
191
- }}
192
- onMouseDown={(e) => e.stopPropagation()}
193
- className={cn(
194
- "block overflow-hidden rounded-lg border-2 bg-white shadow-2xl transition-colors",
195
- isActive
196
- ? "border-primary"
197
- : "border-border hover:border-muted-foreground/50",
198
- )}
199
- style={{
200
- width: SCREEN_WIDTH,
201
- height: SCREEN_HEIGHT,
202
- cursor: "pointer",
203
- }}
204
- >
205
- <iframe
206
- srcDoc={screen.content}
207
- sandbox="allow-scripts"
208
- className="pointer-events-none border-0"
209
- style={{
210
- width: 1280,
211
- height: 2560,
212
- transform: `scale(${SCREEN_WIDTH / 1280})`,
213
- transformOrigin: "top left",
214
- }}
215
- title={screen.filename}
216
- />
217
- </button>
218
- </TooltipTrigger>
219
- <TooltipContent>{`Open ${display}`}</TooltipContent>
220
- </Tooltip>
221
- </div>
1026
+ const beginDraftDrag = useCallback(
1027
+ (id: string, e: React.MouseEvent) => {
1028
+ if (e.button !== 0 || e.shiftKey) return;
1029
+ e.preventDefault();
1030
+ e.stopPropagation();
1031
+
1032
+ const currentSelectedDraftIds = selectedDraftIdsRef.current;
1033
+ const targetIds = currentSelectedDraftIds.includes(id)
1034
+ ? currentSelectedDraftIds
1035
+ : [id];
1036
+ const originDrafts = Object.fromEntries(
1037
+ draftPrimitivesRef.current
1038
+ .filter((draft) => targetIds.includes(draft.id))
1039
+ .map((draft) => [draft.id, cloneDraftPrimitive(draft)]),
1040
+ ) as DraftPrimitiveById;
1041
+ if (!originDrafts[id]) return;
1042
+ updateSelectedIds(() => []);
1043
+ updateSelectedDraftIds((current) =>
1044
+ current.includes(id) ? current : [id],
1045
+ );
1046
+
1047
+ dragState.current = {
1048
+ type: "draft-move",
1049
+ originClient: { x: e.clientX, y: e.clientY },
1050
+ originDrafts,
1051
+ targetIds,
1052
+ primaryId: id,
1053
+ hasMoved: false,
1054
+ };
1055
+ setIsDragging(true);
1056
+ setDragCursor("grabbing");
1057
+
1058
+ const handleMouseMove = (ev: MouseEvent) => {
1059
+ const state = dragState.current;
1060
+ if (!state || state.type !== "draft-move") return;
1061
+ const scale = zoomRef.current / 100;
1062
+ const dx = (ev.clientX - state.originClient.x) / scale;
1063
+ const dy = (ev.clientY - state.originClient.y) / scale;
1064
+ if (
1065
+ !state.hasMoved &&
1066
+ Math.hypot(
1067
+ ev.clientX - state.originClient.x,
1068
+ ev.clientY - state.originClient.y,
1069
+ ) >= DRAG_THRESHOLD
1070
+ ) {
1071
+ state.hasMoved = true;
1072
+ }
1073
+
1074
+ const movingEntries = state.targetIds.map((targetId) => {
1075
+ const origin = state.originDrafts[targetId].geometry;
1076
+ return {
1077
+ id: targetId,
1078
+ geometry: {
1079
+ ...origin,
1080
+ x: origin.x + dx,
1081
+ y: origin.y + dy,
1082
+ },
1083
+ };
1084
+ });
1085
+ const stationaryEntries = getCurrentCanvasEntries().filter(
1086
+ (entry) => !state.targetIds.includes(entry.id),
1087
+ );
1088
+ const snap = computeMoveSnap(movingEntries, stationaryEntries, {
1089
+ thresholdScreenPx: DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
1090
+ zoom: zoomRef.current,
1091
+ bypass: ev.metaKey || ev.ctrlKey,
1092
+ });
1093
+
1094
+ updateDraftPrimitives((current) =>
1095
+ current.map((draft) => {
1096
+ const origin = state.originDrafts[draft.id];
1097
+ if (!origin) return draft;
1098
+ return moveDraftPrimitive(origin, dx + snap.dx, dy + snap.dy);
1099
+ }),
1100
+ );
1101
+ setAlignmentGuides(snap.guides);
1102
+ const primary = state.originDrafts[state.primaryId].geometry;
1103
+ showTransformFeedback(
1104
+ `X ${Math.round(primary.x + dx + snap.dx)} Y ${Math.round(
1105
+ primary.y + dy + snap.dy,
1106
+ )}`,
1107
+ ev.clientX,
1108
+ ev.clientY,
1109
+ );
1110
+ };
1111
+
1112
+ const handleMouseUp = () => {
1113
+ finishDrag();
1114
+ };
1115
+
1116
+ installDragListeners(handleMouseMove, handleMouseUp);
1117
+ },
1118
+ [
1119
+ finishDrag,
1120
+ getCurrentCanvasEntries,
1121
+ installDragListeners,
1122
+ showTransformFeedback,
1123
+ updateDraftPrimitives,
1124
+ updateSelectedDraftIds,
1125
+ updateSelectedIds,
1126
+ ],
222
1127
  );
1128
+
1129
+ const beginDraftResize = useCallback(
1130
+ (id: string, handle: ResizeHandle, e: React.MouseEvent) => {
1131
+ if (e.button !== 0) return;
1132
+ e.preventDefault();
1133
+ e.stopPropagation();
1134
+
1135
+ const currentSelectedDraftIds = selectedDraftIdsRef.current;
1136
+ const targetIds = currentSelectedDraftIds.includes(id)
1137
+ ? currentSelectedDraftIds
1138
+ : [id];
1139
+ const originDrafts = Object.fromEntries(
1140
+ draftPrimitivesRef.current
1141
+ .filter((draft) => targetIds.includes(draft.id))
1142
+ .map((draft) => [draft.id, cloneDraftPrimitive(draft)]),
1143
+ ) as DraftPrimitiveById;
1144
+ const originEntries = Object.values(originDrafts).map((draft) => ({
1145
+ id: draft.id,
1146
+ geometry: draft.geometry,
1147
+ }));
1148
+ const originBounds = getFrameGroupBounds(originEntries);
1149
+ if (!originBounds || !originDrafts[id]) return;
1150
+ updateSelectedIds(() => []);
1151
+ updateSelectedDraftIds((current) =>
1152
+ current.includes(id) ? current : [id],
1153
+ );
1154
+
1155
+ dragState.current = {
1156
+ type: "draft-resize",
1157
+ originClient: { x: e.clientX, y: e.clientY },
1158
+ originDrafts,
1159
+ originBounds: frameBoundsToGeometry(originBounds),
1160
+ targetIds,
1161
+ handle,
1162
+ hasMoved: false,
1163
+ };
1164
+ setIsDragging(true);
1165
+ setDragCursor(getResizeCursor(handle));
1166
+
1167
+ const handleMouseMove = (ev: MouseEvent) => {
1168
+ const state = dragState.current;
1169
+ if (!state || state.type !== "draft-resize") return;
1170
+ const scale = zoomRef.current / 100;
1171
+ const dx = (ev.clientX - state.originClient.x) / scale;
1172
+ const dy = (ev.clientY - state.originClient.y) / scale;
1173
+ if (
1174
+ !state.hasMoved &&
1175
+ Math.hypot(
1176
+ ev.clientX - state.originClient.x,
1177
+ ev.clientY - state.originClient.y,
1178
+ ) >= DRAG_THRESHOLD
1179
+ ) {
1180
+ state.hasMoved = true;
1181
+ }
1182
+
1183
+ const originEntries = state.targetIds.map((targetId) => ({
1184
+ id: targetId,
1185
+ geometry: state.originDrafts[targetId].geometry,
1186
+ }));
1187
+ const resized = resizeFrameGroupFromDelta(
1188
+ originEntries,
1189
+ state.originBounds,
1190
+ state.handle,
1191
+ dx,
1192
+ dy,
1193
+ {
1194
+ preserveAspectRatio: ev.shiftKey,
1195
+ resizeFromCenter: ev.altKey,
1196
+ minWidth: 8,
1197
+ minHeight: 8,
1198
+ },
1199
+ );
1200
+ const snap = computeResizeSnap(
1201
+ resized.bounds,
1202
+ getCurrentCanvasEntries().filter(
1203
+ (entry) => !state.targetIds.includes(entry.id),
1204
+ ),
1205
+ state.handle,
1206
+ {
1207
+ thresholdScreenPx: DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
1208
+ zoom: zoomRef.current,
1209
+ bypass: ev.metaKey || ev.ctrlKey,
1210
+ },
1211
+ );
1212
+ const resizedEntries = resizeFrameGroupToBounds(
1213
+ originEntries,
1214
+ state.originBounds,
1215
+ snap.frame,
1216
+ );
1217
+ const resizedById = Object.fromEntries(
1218
+ resizedEntries.map((entry) => [entry.id, entry.geometry]),
1219
+ ) as FrameGeometryById;
1220
+
1221
+ updateDraftPrimitives((current) =>
1222
+ current.map((draft) => {
1223
+ const origin = state.originDrafts[draft.id];
1224
+ const geometry = resizedById[draft.id];
1225
+ if (!origin || !geometry) return draft;
1226
+ return applyDraftGeometry(origin, geometry);
1227
+ }),
1228
+ );
1229
+ setAlignmentGuides(snap.guides);
1230
+ showTransformFeedback(
1231
+ `${Math.round(snap.frame.width)} x ${Math.round(snap.frame.height)}`,
1232
+ ev.clientX,
1233
+ ev.clientY,
1234
+ );
1235
+ };
1236
+
1237
+ installDragListeners(handleMouseMove, finishDrag);
1238
+ },
1239
+ [
1240
+ finishDrag,
1241
+ getCurrentCanvasEntries,
1242
+ installDragListeners,
1243
+ showTransformFeedback,
1244
+ updateDraftPrimitives,
1245
+ updateSelectedDraftIds,
1246
+ updateSelectedIds,
1247
+ ],
1248
+ );
1249
+
1250
+ const beginDraftGroupResize = useCallback(
1251
+ (handle: ResizeHandle, e: React.MouseEvent) => {
1252
+ const firstSelectedId = selectedDraftIdsRef.current[0];
1253
+ if (!firstSelectedId) return;
1254
+ beginDraftResize(firstSelectedId, handle, e);
1255
+ },
1256
+ [beginDraftResize],
1257
+ );
1258
+
1259
+ const handleDraftClick = useCallback(
1260
+ (id: string, e: React.MouseEvent) => {
1261
+ e.stopPropagation();
1262
+ updateSelectedIds(() => []);
1263
+ updateSelectedDraftIds((current) => {
1264
+ if (e.shiftKey) {
1265
+ return current.includes(id)
1266
+ ? current.filter((selectedId) => selectedId !== id)
1267
+ : [...current, id];
1268
+ }
1269
+ return [id];
1270
+ });
1271
+ },
1272
+ [updateSelectedDraftIds, updateSelectedIds],
1273
+ );
1274
+
1275
+ const beginFrameDrag = useCallback(
1276
+ (id: string, e: React.MouseEvent) => {
1277
+ if (e.button !== 0 || e.shiftKey) return;
1278
+ e.preventDefault();
1279
+ e.stopPropagation();
1280
+
1281
+ const currentSelectedIds = selectedIdsRef.current;
1282
+ const targetIds = currentSelectedIds.includes(id)
1283
+ ? currentSelectedIds
1284
+ : [id];
1285
+ if (!currentSelectedIds.includes(id)) {
1286
+ updateSelectedIds(() => [id]);
1287
+ }
1288
+ updateSelectedDraftIds(() => []);
1289
+
1290
+ const entries = getCurrentFrameEntries();
1291
+ const originFrames = Object.fromEntries(
1292
+ entries
1293
+ .filter((entry) => targetIds.includes(entry.id))
1294
+ .map((entry) => [entry.id, entry.geometry]),
1295
+ ) as FrameGeometryById;
1296
+ if (!originFrames[id]) return;
1297
+
1298
+ dragState.current = {
1299
+ type: "move",
1300
+ originClient: { x: e.clientX, y: e.clientY },
1301
+ originFrames,
1302
+ targetIds,
1303
+ primaryId: id,
1304
+ hasMoved: false,
1305
+ };
1306
+ setIsDragging(true);
1307
+ setDragCursor("grabbing");
1308
+
1309
+ const handleMouseMove = (ev: MouseEvent) => {
1310
+ const state = dragState.current;
1311
+ if (!state || state.type !== "move") return;
1312
+ const scale = zoomRef.current / 100;
1313
+ const dx = (ev.clientX - state.originClient.x) / scale;
1314
+ const dy = (ev.clientY - state.originClient.y) / scale;
1315
+ if (
1316
+ !state.hasMoved &&
1317
+ Math.hypot(
1318
+ ev.clientX - state.originClient.x,
1319
+ ev.clientY - state.originClient.y,
1320
+ ) >= DRAG_THRESHOLD
1321
+ ) {
1322
+ state.hasMoved = true;
1323
+ }
1324
+
1325
+ const movingEntries = state.targetIds.map((targetId) => ({
1326
+ id: targetId,
1327
+ geometry: {
1328
+ ...state.originFrames[targetId],
1329
+ x: state.originFrames[targetId].x + dx,
1330
+ y: state.originFrames[targetId].y + dy,
1331
+ },
1332
+ }));
1333
+ const stationaryEntries = getCurrentFrameEntries().filter(
1334
+ (entry) => !state.targetIds.includes(entry.id),
1335
+ );
1336
+ const snap = computeMoveSnap(movingEntries, stationaryEntries, {
1337
+ thresholdScreenPx: DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
1338
+ zoom: zoomRef.current,
1339
+ bypass: ev.metaKey || ev.ctrlKey,
1340
+ });
1341
+
1342
+ updateFrameGeometry((current) => {
1343
+ const next = { ...current };
1344
+ state.targetIds.forEach((targetId) => {
1345
+ const origin = state.originFrames[targetId];
1346
+ next[targetId] = {
1347
+ ...origin,
1348
+ x: origin.x + dx + snap.dx,
1349
+ y: origin.y + dy + snap.dy,
1350
+ };
1351
+ });
1352
+ return next;
1353
+ });
1354
+ setAlignmentGuides(snap.guides);
1355
+ const primary = state.originFrames[state.primaryId];
1356
+ showTransformFeedback(
1357
+ `X ${Math.round(primary.x + dx + snap.dx)} Y ${Math.round(
1358
+ primary.y + dy + snap.dy,
1359
+ )}`,
1360
+ ev.clientX,
1361
+ ev.clientY,
1362
+ );
1363
+ };
1364
+
1365
+ const handleMouseUp = () => {
1366
+ const state = dragState.current;
1367
+ if (state?.type === "move" && state.hasMoved) {
1368
+ const after = cloneFrameGeometryById(frameGeometryRef.current);
1369
+ onGeometryCommitRef.current?.(
1370
+ frameGeometryWithOverrides(after, state.originFrames),
1371
+ after,
1372
+ );
1373
+ suppressNextPick.current = true;
1374
+ }
1375
+ finishDrag();
1376
+ };
1377
+
1378
+ installDragListeners(handleMouseMove, handleMouseUp);
1379
+ },
1380
+ [
1381
+ finishDrag,
1382
+ getCurrentFrameEntries,
1383
+ installDragListeners,
1384
+ showTransformFeedback,
1385
+ updateFrameGeometry,
1386
+ updateSelectedDraftIds,
1387
+ updateSelectedIds,
1388
+ ],
1389
+ );
1390
+
1391
+ const beginResize = useCallback(
1392
+ (id: string, handle: ResizeHandle, e: React.MouseEvent) => {
1393
+ if (e.button !== 0) return;
1394
+ e.preventDefault();
1395
+ e.stopPropagation();
1396
+ suppressNextPick.current = true;
1397
+
1398
+ const currentSelectedIds = selectedIdsRef.current;
1399
+ const targetIds = currentSelectedIds.includes(id)
1400
+ ? currentSelectedIds
1401
+ : [id];
1402
+ const originEntries = getCurrentFrameEntries().filter((entry) =>
1403
+ targetIds.includes(entry.id),
1404
+ );
1405
+ const originBounds = getFrameGroupBounds(originEntries);
1406
+ if (!originBounds || originEntries.length === 0) return;
1407
+ updateSelectedIds((current) => (current.includes(id) ? current : [id]));
1408
+
1409
+ dragState.current = {
1410
+ type: "resize",
1411
+ originClient: { x: e.clientX, y: e.clientY },
1412
+ originFrames: Object.fromEntries(
1413
+ originEntries.map((entry) => [entry.id, entry.geometry]),
1414
+ ) as FrameGeometryById,
1415
+ originBounds: frameBoundsToGeometry(originBounds),
1416
+ targetIds: originEntries.map((entry) => entry.id),
1417
+ handle,
1418
+ hasMoved: false,
1419
+ };
1420
+ setIsDragging(true);
1421
+ setDragCursor(getResizeCursor(handle));
1422
+
1423
+ const handleMouseMove = (ev: MouseEvent) => {
1424
+ const state = dragState.current;
1425
+ if (!state || state.type !== "resize") return;
1426
+ const scale = zoomRef.current / 100;
1427
+ const dx = (ev.clientX - state.originClient.x) / scale;
1428
+ const dy = (ev.clientY - state.originClient.y) / scale;
1429
+ if (
1430
+ !state.hasMoved &&
1431
+ Math.hypot(
1432
+ ev.clientX - state.originClient.x,
1433
+ ev.clientY - state.originClient.y,
1434
+ ) >= DRAG_THRESHOLD
1435
+ ) {
1436
+ state.hasMoved = true;
1437
+ }
1438
+
1439
+ const originEntries = state.targetIds.map((targetId) => ({
1440
+ id: targetId,
1441
+ geometry: state.originFrames[targetId],
1442
+ }));
1443
+ const resized = resizeFrameGroupFromDelta(
1444
+ originEntries,
1445
+ state.originBounds,
1446
+ state.handle,
1447
+ dx,
1448
+ dy,
1449
+ {
1450
+ preserveAspectRatio: ev.shiftKey,
1451
+ resizeFromCenter: ev.altKey,
1452
+ },
1453
+ );
1454
+ const snap = computeResizeSnap(
1455
+ resized.bounds,
1456
+ getCurrentFrameEntries().filter(
1457
+ (entry) => !state.targetIds.includes(entry.id),
1458
+ ),
1459
+ state.handle,
1460
+ {
1461
+ thresholdScreenPx: DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
1462
+ zoom: zoomRef.current,
1463
+ bypass: ev.metaKey || ev.ctrlKey,
1464
+ },
1465
+ );
1466
+ const resizedEntries = resizeFrameGroupToBounds(
1467
+ originEntries,
1468
+ state.originBounds,
1469
+ snap.frame,
1470
+ );
1471
+ updateFrameGeometry((current) => {
1472
+ const next = { ...current };
1473
+ resizedEntries.forEach((entry) => {
1474
+ next[entry.id] = {
1475
+ ...state.originFrames[entry.id],
1476
+ ...entry.geometry,
1477
+ };
1478
+ });
1479
+ return next;
1480
+ });
1481
+ setAlignmentGuides(snap.guides);
1482
+ showTransformFeedback(
1483
+ `${Math.round(snap.frame.width)} x ${Math.round(snap.frame.height)}`,
1484
+ ev.clientX,
1485
+ ev.clientY,
1486
+ );
1487
+ };
1488
+
1489
+ const handleMouseUp = () => {
1490
+ const state = dragState.current;
1491
+ if (state?.type === "resize" && state.hasMoved) {
1492
+ const after = cloneFrameGeometryById(frameGeometryRef.current);
1493
+ onGeometryCommitRef.current?.(
1494
+ frameGeometryWithOverrides(after, state.originFrames),
1495
+ after,
1496
+ );
1497
+ }
1498
+ finishDrag();
1499
+ };
1500
+
1501
+ installDragListeners(handleMouseMove, handleMouseUp);
1502
+ },
1503
+ [
1504
+ finishDrag,
1505
+ getCurrentFrameEntries,
1506
+ installDragListeners,
1507
+ showTransformFeedback,
1508
+ updateFrameGeometry,
1509
+ updateSelectedIds,
1510
+ ],
1511
+ );
1512
+
1513
+ const beginGroupResize = useCallback(
1514
+ (handle: ResizeHandle, e: React.MouseEvent) => {
1515
+ const firstSelectedId = selectedIdsRef.current[0];
1516
+ if (!firstSelectedId) return;
1517
+ beginResize(firstSelectedId, handle, e);
1518
+ },
1519
+ [beginResize],
1520
+ );
1521
+
1522
+ const beginRotate = useCallback(
1523
+ (id: string, e: React.MouseEvent) => {
1524
+ if (e.button !== 0) return;
1525
+ e.preventDefault();
1526
+ e.stopPropagation();
1527
+ suppressNextPick.current = true;
1528
+
1529
+ const originFrame = getCurrentFrameEntries().find(
1530
+ (entry) => entry.id === id,
1531
+ )?.geometry;
1532
+ if (!originFrame) return;
1533
+ updateSelectedIds((current) => (current.includes(id) ? current : [id]));
1534
+
1535
+ const pointer = getCanvasPoint(e.clientX, e.clientY);
1536
+ const center = getFrameCenter(originFrame);
1537
+ dragState.current = {
1538
+ type: "rotate",
1539
+ originClient: { x: e.clientX, y: e.clientY },
1540
+ originFrame,
1541
+ frameId: id,
1542
+ originPointerAngle: angleBetween(center, pointer),
1543
+ originRotation: originFrame.rotation ?? 0,
1544
+ hasMoved: false,
1545
+ };
1546
+ setIsDragging(true);
1547
+ setDragCursor("grabbing");
1548
+
1549
+ const handleMouseMove = (ev: MouseEvent) => {
1550
+ const state = dragState.current;
1551
+ if (!state || state.type !== "rotate") return;
1552
+ if (
1553
+ !state.hasMoved &&
1554
+ Math.hypot(
1555
+ ev.clientX - state.originClient.x,
1556
+ ev.clientY - state.originClient.y,
1557
+ ) >= DRAG_THRESHOLD
1558
+ ) {
1559
+ state.hasMoved = true;
1560
+ }
1561
+ const pointer = getCanvasPoint(ev.clientX, ev.clientY);
1562
+ const center = getFrameCenter(state.originFrame);
1563
+ const raw =
1564
+ state.originRotation +
1565
+ angleBetween(center, pointer) -
1566
+ state.originPointerAngle;
1567
+ const rotation = ev.shiftKey ? Math.round(raw / 15) * 15 : raw;
1568
+ updateFrameGeometry((current) => ({
1569
+ ...current,
1570
+ [state.frameId]: {
1571
+ ...state.originFrame,
1572
+ rotation: Math.round(rotation * 10) / 10,
1573
+ },
1574
+ }));
1575
+ showTransformFeedback(
1576
+ `${Math.round(rotation)}deg`,
1577
+ ev.clientX,
1578
+ ev.clientY,
1579
+ );
1580
+ };
1581
+
1582
+ const handleMouseUp = () => {
1583
+ const state = dragState.current;
1584
+ if (state?.type === "rotate" && state.hasMoved) {
1585
+ const after = cloneFrameGeometryById(frameGeometryRef.current);
1586
+ onGeometryCommitRef.current?.(
1587
+ frameGeometryWithOverrides(after, {
1588
+ [state.frameId]: state.originFrame,
1589
+ }),
1590
+ after,
1591
+ );
1592
+ }
1593
+ suppressNextPick.current = true;
1594
+ finishDrag();
1595
+ };
1596
+
1597
+ installDragListeners(handleMouseMove, handleMouseUp);
1598
+ },
1599
+ [
1600
+ finishDrag,
1601
+ getCanvasPoint,
1602
+ getCurrentFrameEntries,
1603
+ installDragListeners,
1604
+ showTransformFeedback,
1605
+ updateFrameGeometry,
1606
+ updateSelectedIds,
1607
+ ],
1608
+ );
1609
+
1610
+ const handleFrameClick = useCallback(
1611
+ (id: string, e: React.MouseEvent<HTMLElement>) => {
1612
+ e.stopPropagation();
1613
+ if (suppressNextPick.current) {
1614
+ suppressNextPick.current = false;
1615
+ return;
1616
+ }
1617
+
1618
+ if (e.shiftKey) {
1619
+ updateSelectedDraftIds(() => []);
1620
+ updateSelectedIds((current) =>
1621
+ current.includes(id)
1622
+ ? current.filter((selectedId) => selectedId !== id)
1623
+ : [...current, id],
1624
+ );
1625
+ return;
1626
+ }
1627
+
1628
+ updateSelectedDraftIds(() => []);
1629
+ updateSelectedIds(() => [id]);
1630
+ onPick(id);
1631
+ },
1632
+ [onPick, updateSelectedDraftIds, updateSelectedIds],
1633
+ );
1634
+
1635
+ const handleFrameDoubleClick = useCallback(
1636
+ (id: string, e: React.MouseEvent<HTMLElement>) => {
1637
+ e.preventDefault();
1638
+ e.stopPropagation();
1639
+ updateSelectedDraftIds(() => []);
1640
+ updateSelectedIds(() => [id]);
1641
+ onPick(id);
1642
+ onEdit?.(id);
1643
+ },
1644
+ [onEdit, onPick, updateSelectedDraftIds, updateSelectedIds],
1645
+ );
1646
+
1647
+ const beginDuplicateGesture = useCallback(
1648
+ (screen: ScreenFile, display: string, e: React.MouseEvent<HTMLElement>) => {
1649
+ if (e.button !== 0 || !e.altKey) return;
1650
+ e.preventDefault();
1651
+ e.stopPropagation();
1652
+ duplicateCleanup.current?.();
1653
+
1654
+ const surfaceRect = surfaceRef.current?.getBoundingClientRect();
1655
+ const origin = { x: e.clientX, y: e.clientY };
1656
+ const originCanvas = canvasPointFromClient(e.clientX, e.clientY);
1657
+ const sourceFrame = getCurrentFrameEntries().find(
1658
+ (entry) => entry.id === screen.id,
1659
+ );
1660
+ const pointerOffset = sourceFrame
1661
+ ? {
1662
+ x: originCanvas.x - sourceFrame.geometry.x,
1663
+ y: originCanvas.y - sourceFrame.geometry.y,
1664
+ }
1665
+ : { x: 0, y: 0 };
1666
+ const previewPoint = {
1667
+ x: surfaceRect ? e.clientX - surfaceRect.left + 16 : e.clientX,
1668
+ y: surfaceRect ? e.clientY - surfaceRect.top + 16 : e.clientY,
1669
+ };
1670
+
1671
+ setDuplicatePreview({
1672
+ display,
1673
+ x: previewPoint.x,
1674
+ y: previewPoint.y,
1675
+ canDuplicate: !!onDuplicate,
1676
+ moved: false,
1677
+ });
1678
+
1679
+ const handleMouseMove = (ev: MouseEvent) => {
1680
+ const dx = ev.clientX - origin.x;
1681
+ const dy = ev.clientY - origin.y;
1682
+ const moved = Math.hypot(dx, dy) >= DUPLICATE_DRAG_THRESHOLD;
1683
+ const rect = surfaceRef.current?.getBoundingClientRect();
1684
+ setDuplicatePreview({
1685
+ display,
1686
+ x: rect ? ev.clientX - rect.left + 16 : ev.clientX,
1687
+ y: rect ? ev.clientY - rect.top + 16 : ev.clientY,
1688
+ canDuplicate: !!onDuplicate,
1689
+ moved,
1690
+ });
1691
+ };
1692
+
1693
+ const cleanupDuplicateGesture = () => {
1694
+ setDuplicatePreview(null);
1695
+ window.removeEventListener("mousemove", handleMouseMove);
1696
+ window.removeEventListener("mouseup", handleMouseUp);
1697
+ duplicateCleanup.current = null;
1698
+ };
1699
+
1700
+ const handleMouseUp = (ev: MouseEvent) => {
1701
+ const moved =
1702
+ Math.hypot(ev.clientX - origin.x, ev.clientY - origin.y) >=
1703
+ DUPLICATE_DRAG_THRESHOLD;
1704
+ const mode = moved ? "alt-drag" : "alt-click";
1705
+
1706
+ if (onDuplicate) {
1707
+ const dropCanvasPosition = canvasPointFromClient(
1708
+ ev.clientX,
1709
+ ev.clientY,
1710
+ );
1711
+ const canvasPosition =
1712
+ moved || !sourceFrame
1713
+ ? {
1714
+ x: dropCanvasPosition.x - pointerOffset.x,
1715
+ y: dropCanvasPosition.y - pointerOffset.y,
1716
+ }
1717
+ : {
1718
+ x: sourceFrame.geometry.x + SCREEN_GAP / 2,
1719
+ y: sourceFrame.geometry.y + SCREEN_GAP / 2,
1720
+ };
1721
+ onDuplicate(screen.id, {
1722
+ mode,
1723
+ screen,
1724
+ canvasPosition,
1725
+ canvasOffset: pointerOffset,
1726
+ dropCanvasPosition,
1727
+ });
1728
+ } else if (!moved) {
1729
+ onPick(screen.id);
1730
+ }
1731
+
1732
+ cleanupDuplicateGesture();
1733
+ };
1734
+
1735
+ duplicateCleanup.current = cleanupDuplicateGesture;
1736
+ window.addEventListener("mousemove", handleMouseMove);
1737
+ window.addEventListener("mouseup", handleMouseUp);
1738
+ },
1739
+ [canvasPointFromClient, getCurrentFrameEntries, onDuplicate, onPick],
1740
+ );
1741
+
1742
+ const handleMouseDown = useCallback(
1743
+ (e: React.MouseEvent) => {
1744
+ const target = e.target as HTMLElement;
1745
+ const onFrame = !!target.closest("[data-frame-shell]");
1746
+ const tool = normalizeCanvasTool(activeTool ?? localActiveTool);
1747
+ if (e.button === 1) {
1748
+ beginPan(e);
1749
+ return;
1750
+ }
1751
+ if (e.button === 0 && tool === "hand") {
1752
+ beginPan(e);
1753
+ return;
1754
+ }
1755
+ if (e.button === 0 && !onFrame) {
1756
+ const creationTool = getDraftCreationTool(tool);
1757
+ if (creationTool) {
1758
+ beginDraftCreation(creationTool, e);
1759
+ return;
1760
+ }
1761
+ beginMarquee(e);
1762
+ }
1763
+ },
1764
+ [activeTool, beginDraftCreation, beginMarquee, beginPan, localActiveTool],
1765
+ );
1766
+
1767
+ const handleWheelEvent = useCallback(
1768
+ (event: WheelEvent) => {
1769
+ const rect = surfaceRef.current?.getBoundingClientRect();
1770
+ if (!rect) return;
1771
+ event.preventDefault();
1772
+ event.stopPropagation();
1773
+ const delta = getWheelDelta(event);
1774
+
1775
+ if (event.ctrlKey || event.metaKey) {
1776
+ const currentZoom = zoomRef.current;
1777
+ const zoomDeltaY = clamp(
1778
+ delta.y,
1779
+ -MAX_WHEEL_ZOOM_DELTA,
1780
+ MAX_WHEEL_ZOOM_DELTA,
1781
+ );
1782
+ const nextZoom = clamp(
1783
+ currentZoom * Math.exp(-zoomDeltaY * ZOOM_SENSITIVITY),
1784
+ MIN_ZOOM,
1785
+ MAX_ZOOM,
1786
+ );
1787
+ if (nextZoom === currentZoom) return;
1788
+
1789
+ const nextPan = getPanForZoomToCursor({
1790
+ pan: panRef.current,
1791
+ cursor: { x: event.clientX - rect.left, y: event.clientY - rect.top },
1792
+ oldZoom: currentZoom,
1793
+ nextZoom,
1794
+ });
1795
+ const zoomEditFrameId =
1796
+ zoomToEditThreshold !== undefined &&
1797
+ currentZoom < zoomToEditThreshold &&
1798
+ nextZoom >= zoomToEditThreshold
1799
+ ? getFrameAtClientPoint(event.clientX, event.clientY)
1800
+ : undefined;
1801
+
1802
+ zoomRef.current = nextZoom;
1803
+ panRef.current = nextPan;
1804
+ setCanvasZoom(nextZoom);
1805
+ setPan(nextPan);
1806
+ onZoomChange?.(nextZoom);
1807
+ if (zoomEditFrameId) {
1808
+ onZoomToEdit?.(zoomEditFrameId);
1809
+ }
1810
+ return;
1811
+ }
1812
+
1813
+ const deltaX = clamp(
1814
+ event.shiftKey && delta.x === 0 ? delta.y : delta.x,
1815
+ -MAX_WHEEL_PAN_DELTA,
1816
+ MAX_WHEEL_PAN_DELTA,
1817
+ );
1818
+ const deltaY = clamp(
1819
+ event.shiftKey && delta.x === 0 ? 0 : delta.y,
1820
+ -MAX_WHEEL_PAN_DELTA,
1821
+ MAX_WHEEL_PAN_DELTA,
1822
+ );
1823
+ const nextPan = {
1824
+ x: panRef.current.x - deltaX,
1825
+ y: panRef.current.y - deltaY,
1826
+ };
1827
+ panRef.current = nextPan;
1828
+ setPan(nextPan);
1829
+ },
1830
+ [getFrameAtClientPoint, onZoomChange, onZoomToEdit, zoomToEditThreshold],
1831
+ );
1832
+
1833
+ useEffect(() => {
1834
+ const surface = surfaceRef.current;
1835
+ if (!surface) return;
1836
+ surface.addEventListener("wheel", handleWheelEvent, {
1837
+ capture: true,
1838
+ passive: false,
1839
+ });
1840
+ return () => {
1841
+ surface.removeEventListener("wheel", handleWheelEvent, {
1842
+ capture: true,
1843
+ });
1844
+ };
1845
+ }, [handleWheelEvent]);
1846
+
1847
+ useEffect(() => {
1848
+ const handleKeyDown = (event: KeyboardEvent) => {
1849
+ if (!isArrowNudgeKey(event.key) || isEditableHotkeyTarget(event.target)) {
1850
+ return;
1851
+ }
1852
+
1853
+ const targetIds = selectedIdsRef.current.filter(
1854
+ (id) => frameGeometryRef.current[id],
1855
+ );
1856
+ const targetDraftIds = selectedDraftIdsRef.current.filter((id) =>
1857
+ draftPrimitivesRef.current.some((draft) => draft.id === id),
1858
+ );
1859
+ if (targetIds.length === 0 && targetDraftIds.length === 0) return;
1860
+
1861
+ event.preventDefault();
1862
+ event.stopPropagation();
1863
+
1864
+ const nudge = getNudgeDelta(event.key, {
1865
+ altKey: event.altKey,
1866
+ ctrlKey: event.ctrlKey,
1867
+ metaKey: event.metaKey,
1868
+ shiftKey: event.shiftKey,
1869
+ });
1870
+ const movingFrameEntries = targetIds.map((targetId) => {
1871
+ const origin = frameGeometryRef.current[targetId];
1872
+ return {
1873
+ id: targetId,
1874
+ geometry: {
1875
+ ...origin,
1876
+ x: origin.x + nudge.dx,
1877
+ y: origin.y + nudge.dy,
1878
+ },
1879
+ };
1880
+ });
1881
+ const movingDraftEntries = targetDraftIds
1882
+ .map((targetId) =>
1883
+ draftPrimitivesRef.current.find((draft) => draft.id === targetId),
1884
+ )
1885
+ .filter(isDraftPrimitive)
1886
+ .map((draft) => ({
1887
+ id: draft.id,
1888
+ geometry: {
1889
+ ...draft.geometry,
1890
+ x: draft.geometry.x + nudge.dx,
1891
+ y: draft.geometry.y + nudge.dy,
1892
+ },
1893
+ }));
1894
+ const movingEntries = [...movingFrameEntries, ...movingDraftEntries];
1895
+ const movingIds = [...targetIds, ...targetDraftIds];
1896
+ const stationaryEntries = getCurrentCanvasEntries().filter(
1897
+ (entry) => !movingIds.includes(entry.id),
1898
+ );
1899
+ const snap = computeMoveSnap(movingEntries, stationaryEntries, {
1900
+ thresholdScreenPx: DEFAULT_SNAP_THRESHOLD_SCREEN_PX,
1901
+ zoom: zoomRef.current,
1902
+ bypass: nudge.snap.bypass,
1903
+ });
1904
+
1905
+ if (targetIds.length > 0) {
1906
+ const before = cloneFrameGeometryById(frameGeometryRef.current);
1907
+ const next = { ...before };
1908
+ targetIds.forEach((targetId) => {
1909
+ const origin = before[targetId] ?? frameGeometryRef.current[targetId];
1910
+ next[targetId] = {
1911
+ ...origin,
1912
+ x: origin.x + nudge.dx + snap.dx,
1913
+ y: origin.y + nudge.dy + snap.dy,
1914
+ };
1915
+ });
1916
+ updateFrameGeometry(() => next);
1917
+ onGeometryCommitRef.current?.(before, cloneFrameGeometryById(next));
1918
+ }
1919
+ if (targetDraftIds.length > 0) {
1920
+ updateDraftPrimitives((current) =>
1921
+ current.map((draft) =>
1922
+ targetDraftIds.includes(draft.id)
1923
+ ? moveDraftPrimitive(
1924
+ draft,
1925
+ nudge.dx + snap.dx,
1926
+ nudge.dy + snap.dy,
1927
+ )
1928
+ : draft,
1929
+ ),
1930
+ );
1931
+ }
1932
+ setAlignmentGuides(snap.guides);
1933
+ scheduleFeedbackClear();
1934
+ };
1935
+
1936
+ window.addEventListener("keydown", handleKeyDown, true);
1937
+ return () => {
1938
+ window.removeEventListener("keydown", handleKeyDown, true);
1939
+ };
1940
+ }, [
1941
+ getCurrentCanvasEntries,
1942
+ scheduleFeedbackClear,
1943
+ updateDraftPrimitives,
1944
+ updateFrameGeometry,
1945
+ ]);
1946
+
1947
+ useEffect(() => {
1948
+ const handleKeyDown = (event: KeyboardEvent) => {
1949
+ if (
1950
+ (event.key !== "Delete" && event.key !== "Backspace") ||
1951
+ event.metaKey ||
1952
+ event.ctrlKey ||
1953
+ isEditableHotkeyTarget(event.target)
1954
+ ) {
1955
+ return;
1956
+ }
1957
+ if (!deleteSelectedItems()) return;
1958
+ event.preventDefault();
1959
+ event.stopPropagation();
1960
+ event.stopImmediatePropagation();
1961
+ };
1962
+
1963
+ window.addEventListener("keydown", handleKeyDown, true);
1964
+ return () => {
1965
+ window.removeEventListener("keydown", handleKeyDown, true);
1966
+ };
1967
+ }, [deleteSelectedItems]);
1968
+
1969
+ const scale = canvasZoom / 100;
1970
+ const showPixelGrid = canvasZoom >= PIXEL_GRID_ZOOM;
1971
+ const effectiveTool = normalizeCanvasTool(activeTool ?? localActiveTool);
1972
+ const selectedIdSet = new Set(selectedIds);
1973
+ const selectedDraftIdSet = new Set(selectedDraftIds);
1974
+ const surfaceCursor = isPanning
1975
+ ? "grabbing"
1976
+ : dragCursor
1977
+ ? dragCursor
1978
+ : isDragging && marquee
1979
+ ? "crosshair"
1980
+ : getDraftCreationTool(effectiveTool)
1981
+ ? "crosshair"
1982
+ : effectiveTool === "hand"
1983
+ ? "grab"
1984
+ : "default";
1985
+ const canvasFrames = screens.map((screen, index) => ({
1986
+ screen,
1987
+ geometry: frameGeometry[screen.id] ?? getInitialFrameGeometry(index),
1988
+ }));
1989
+ const selectedFrameEntries = canvasFrames
1990
+ .filter(({ screen }) => selectedIdSet.has(screen.id))
1991
+ .map(({ screen, geometry }) => ({ id: screen.id, geometry }));
1992
+ const selectedGroupBounds =
1993
+ selectedFrameEntries.length > 1
1994
+ ? getFrameGroupBounds(selectedFrameEntries)
1995
+ : null;
1996
+ const hasGroupSelection = !!selectedGroupBounds;
1997
+ const selectedDraftEntries = draftPrimitives
1998
+ .filter((draft) => selectedDraftIdSet.has(draft.id))
1999
+ .map((draft) => ({ id: draft.id, geometry: draft.geometry }));
2000
+ const selectedDraftGroupBounds =
2001
+ selectedDraftEntries.length > 1
2002
+ ? getFrameGroupBounds(selectedDraftEntries)
2003
+ : null;
2004
+ return (
2005
+ <div
2006
+ ref={surfaceRef}
2007
+ className="relative h-full w-full select-none overflow-hidden bg-background"
2008
+ onMouseDown={handleMouseDown}
2009
+ style={{ cursor: surfaceCursor, touchAction: "none" }}
2010
+ >
2011
+ {showPixelGrid ? (
2012
+ <div
2013
+ className="pointer-events-none absolute inset-0 opacity-60"
2014
+ style={{
2015
+ backgroundImage:
2016
+ "linear-gradient(to right, hsl(var(--border)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--border)) 1px, transparent 1px)",
2017
+ backgroundPosition: `${pan.x}px ${pan.y}px`,
2018
+ backgroundSize: `${scale}px ${scale}px`,
2019
+ }}
2020
+ />
2021
+ ) : null}
2022
+
2023
+ <div
2024
+ className="pointer-events-none absolute"
2025
+ style={{
2026
+ left: pan.x,
2027
+ top: pan.y,
2028
+ transform: `scale(${scale})`,
2029
+ transformOrigin: "top left",
2030
+ }}
2031
+ >
2032
+ {canvasFrames.map(({ screen, geometry }) => {
2033
+ const metadata = resolveScreenMetadata(
2034
+ screen,
2035
+ metadataById?.[screen.id],
2036
+ getScreenMetadata?.(screen),
2037
+ );
2038
+ return (
2039
+ <Screen
2040
+ key={screen.id}
2041
+ screen={screen}
2042
+ metadata={metadata}
2043
+ geometry={geometry}
2044
+ screenContent={renderScreenContent?.(screen, metadata, geometry)}
2045
+ isActive={screen.id === activeId}
2046
+ isSelected={selectedIdSet.has(screen.id)}
2047
+ groupSelected={hasGroupSelection}
2048
+ handlesEnabled={!hasGroupSelection}
2049
+ onPick={handleFrameClick}
2050
+ onEdit={handleFrameDoubleClick}
2051
+ onStartFrameDrag={beginFrameDrag}
2052
+ onStartResize={beginResize}
2053
+ onStartRotate={beginRotate}
2054
+ onStartDuplicateGesture={beginDuplicateGesture}
2055
+ />
2056
+ );
2057
+ })}
2058
+
2059
+ {draftPrimitives.map((draft) => (
2060
+ <DraftPrimitiveLayer
2061
+ key={draft.id}
2062
+ draft={draft}
2063
+ isSelected={selectedDraftIdSet.has(draft.id)}
2064
+ groupSelected={Boolean(selectedDraftGroupBounds)}
2065
+ onClick={handleDraftClick}
2066
+ onStartDrag={beginDraftDrag}
2067
+ onStartResize={beginDraftResize}
2068
+ />
2069
+ ))}
2070
+
2071
+ {creationPreview ? (
2072
+ <DraftPrimitiveLayer
2073
+ draft={previewDraftPrimitive(creationPreview)}
2074
+ isSelected
2075
+ preview
2076
+ groupSelected={false}
2077
+ onClick={() => {}}
2078
+ onStartDrag={() => {}}
2079
+ onStartResize={() => {}}
2080
+ />
2081
+ ) : null}
2082
+
2083
+ {selectedGroupBounds ? (
2084
+ <GroupSelectionBox
2085
+ bounds={selectedGroupBounds}
2086
+ onStartResize={beginGroupResize}
2087
+ />
2088
+ ) : null}
2089
+
2090
+ {selectedDraftGroupBounds ? (
2091
+ <GroupSelectionBox
2092
+ bounds={selectedDraftGroupBounds}
2093
+ onStartResize={beginDraftGroupResize}
2094
+ />
2095
+ ) : null}
2096
+
2097
+ {alignmentGuides.map((guide, index) => (
2098
+ <span
2099
+ key={`${guide.orientation}-${guide.position}-${index}`}
2100
+ className="pointer-events-none absolute z-30 bg-destructive/90"
2101
+ style={
2102
+ guide.orientation === "vertical"
2103
+ ? {
2104
+ left: SURFACE_PADDING + guide.position,
2105
+ top: SURFACE_PADDING + guide.start,
2106
+ width: 1,
2107
+ height: Math.max(1, guide.end - guide.start),
2108
+ }
2109
+ : {
2110
+ left: SURFACE_PADDING + guide.start,
2111
+ top: SURFACE_PADDING + guide.position,
2112
+ width: Math.max(1, guide.end - guide.start),
2113
+ height: 1,
2114
+ }
2115
+ }
2116
+ />
2117
+ ))}
2118
+
2119
+ {marquee ? (
2120
+ <span
2121
+ className="pointer-events-none absolute z-40 border border-[var(--design-editor-accent-color)] bg-[var(--design-editor-selection-color)]"
2122
+ style={{
2123
+ left: SURFACE_PADDING + marquee.x,
2124
+ top: SURFACE_PADDING + marquee.y,
2125
+ width: marquee.width,
2126
+ height: marquee.height,
2127
+ }}
2128
+ />
2129
+ ) : null}
2130
+ </div>
2131
+
2132
+ {duplicatePreview ? (
2133
+ <div
2134
+ className={cn(
2135
+ "pointer-events-none absolute z-20 rounded-lg border bg-background/90 shadow-2xl backdrop-blur-sm transition-colors",
2136
+ duplicatePreview.canDuplicate
2137
+ ? "border-primary/80 ring-4 ring-primary/15"
2138
+ : "border-dashed border-muted-foreground/45",
2139
+ )}
2140
+ style={{
2141
+ left: duplicatePreview.x,
2142
+ top: duplicatePreview.y,
2143
+ width: SCREEN_WIDTH * Math.min(scale, 1),
2144
+ height: SCREEN_HEIGHT * Math.min(scale, 1),
2145
+ maxWidth: SCREEN_WIDTH,
2146
+ maxHeight: SCREEN_HEIGHT,
2147
+ }}
2148
+ >
2149
+ <div className="flex h-full w-full items-start justify-between rounded-lg bg-muted/20 p-2">
2150
+ <span className="max-w-[190px] truncate text-[11px] font-medium text-foreground">
2151
+ {duplicatePreview.display}
2152
+ </span>
2153
+ <span className="flex items-center gap-1 rounded-md border border-border bg-background px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground shadow-sm">
2154
+ <IconCopy className="h-3 w-3" />
2155
+ {duplicatePreview.canDuplicate
2156
+ ? duplicatePreview.moved
2157
+ ? t("multiScreenCanvas.fork")
2158
+ : t("multiScreenCanvas.duplicate")
2159
+ : t("multiScreenCanvas.preview")}
2160
+ </span>
2161
+ </div>
2162
+ </div>
2163
+ ) : null}
2164
+
2165
+ {transformBadge ? (
2166
+ <div
2167
+ className="pointer-events-none absolute z-50 rounded border border-border bg-background/95 px-1.5 py-0.5 font-mono text-[11px] leading-5 text-foreground shadow-lg backdrop-blur"
2168
+ style={{ left: transformBadge.x, top: transformBadge.y }}
2169
+ >
2170
+ {transformBadge.text}
2171
+ </div>
2172
+ ) : null}
2173
+ </div>
2174
+ );
2175
+ }
2176
+
2177
+ function DraftPrimitiveLayer({
2178
+ draft,
2179
+ isSelected,
2180
+ groupSelected,
2181
+ preview = false,
2182
+ onClick,
2183
+ onStartDrag,
2184
+ onStartResize,
2185
+ }: {
2186
+ draft: DraftPrimitive;
2187
+ isSelected: boolean;
2188
+ groupSelected: boolean;
2189
+ preview?: boolean;
2190
+ onClick: (id: string, e: React.MouseEvent) => void;
2191
+ onStartDrag: (id: string, e: React.MouseEvent) => void;
2192
+ onStartResize: (
2193
+ id: string,
2194
+ handle: ResizeHandle,
2195
+ e: React.MouseEvent,
2196
+ ) => void;
2197
+ }) {
2198
+ const { geometry } = draft;
2199
+ const selected = isSelected && !groupSelected;
2200
+ return (
2201
+ <button
2202
+ data-frame-shell
2203
+ type="button"
2204
+ className={cn(
2205
+ "group/artboard pointer-events-auto absolute block overflow-visible text-left outline-none",
2206
+ preview ? "cursor-crosshair" : "cursor-move",
2207
+ )}
2208
+ style={{
2209
+ left: SURFACE_PADDING + geometry.x,
2210
+ top: SURFACE_PADDING + geometry.y,
2211
+ width: geometry.width,
2212
+ height: geometry.height,
2213
+ zIndex: geometry.z ?? 40,
2214
+ transform: geometry.rotation
2215
+ ? `rotate(${geometry.rotation}deg)`
2216
+ : undefined,
2217
+ }}
2218
+ onClick={(event) => {
2219
+ if (!preview) onClick(draft.id, event);
2220
+ }}
2221
+ onMouseDown={(event) => {
2222
+ if (!preview) onStartDrag(draft.id, event);
2223
+ }}
2224
+ >
2225
+ <DraftPrimitiveContent draft={draft} preview={preview} />
2226
+ <span
2227
+ className={cn(
2228
+ "pointer-events-none absolute -inset-[5px] rounded-sm border transition-opacity",
2229
+ selected
2230
+ ? "border-[var(--design-editor-accent-color)] opacity-100"
2231
+ : "border-[var(--design-editor-accent-color)] opacity-0 group-hover/artboard:opacity-100",
2232
+ )}
2233
+ />
2234
+ <ResizeHandles
2235
+ active={selected || preview}
2236
+ enabled={(isSelected && !groupSelected) || preview}
2237
+ showRotate={false}
2238
+ onStartResize={(handle, event) =>
2239
+ onStartResize(draft.id, handle, event)
2240
+ }
2241
+ onStartRotate={() => {}}
2242
+ />
2243
+ </button>
2244
+ );
2245
+ }
2246
+
2247
+ function DraftPrimitiveContent({
2248
+ draft,
2249
+ preview,
2250
+ }: {
2251
+ draft: DraftPrimitive;
2252
+ preview: boolean;
2253
+ }) {
2254
+ const muted = preview ? "opacity-70" : "";
2255
+ if (draft.kind === "path") {
2256
+ return (
2257
+ <svg
2258
+ className={cn("block size-full overflow-visible", muted)}
2259
+ viewBox={`${draft.geometry.x} ${draft.geometry.y} ${draft.geometry.width} ${draft.geometry.height}`}
2260
+ >
2261
+ <path
2262
+ d={pointsToPath(draft.points ?? [])}
2263
+ fill="none"
2264
+ stroke={draft.stroke ?? "hsl(var(--primary))"}
2265
+ strokeLinecap="round"
2266
+ strokeLinejoin="round"
2267
+ strokeWidth={draft.strokeWidth ?? 3}
2268
+ />
2269
+ </svg>
2270
+ );
2271
+ }
2272
+
2273
+ if (draft.kind === "text") {
2274
+ return (
2275
+ <div
2276
+ className={cn(
2277
+ "flex size-full items-start rounded-sm border border-dashed border-primary/60 bg-primary/5 px-2 py-1 text-sm font-medium text-foreground",
2278
+ muted,
2279
+ )}
2280
+ >
2281
+ <span className="truncate">{draft.text}</span>
2282
+ </div>
2283
+ );
2284
+ }
2285
+
2286
+ if (draft.kind === "frame") {
2287
+ return (
2288
+ <div
2289
+ className={cn(
2290
+ "size-full rounded-sm border-2 border-dashed border-primary/70 bg-primary/5",
2291
+ muted,
2292
+ )}
2293
+ />
2294
+ );
2295
+ }
2296
+
2297
+ return (
2298
+ <div
2299
+ className={cn("size-full rounded-sm border", muted)}
2300
+ style={{
2301
+ background: draft.fill ?? "hsl(var(--primary) / 0.12)",
2302
+ borderColor: draft.stroke ?? "hsl(var(--primary) / 0.7)",
2303
+ borderWidth: draft.strokeWidth ?? 1,
2304
+ }}
2305
+ />
2306
+ );
2307
+ }
2308
+
2309
+ function Screen({
2310
+ screen,
2311
+ metadata,
2312
+ geometry,
2313
+ isActive,
2314
+ isSelected,
2315
+ groupSelected,
2316
+ handlesEnabled,
2317
+ onPick,
2318
+ onEdit,
2319
+ onStartFrameDrag,
2320
+ onStartResize,
2321
+ onStartRotate,
2322
+ onStartDuplicateGesture,
2323
+ screenContent,
2324
+ }: {
2325
+ screen: ScreenFile;
2326
+ metadata: ResolvedScreenMetadata;
2327
+ geometry: FrameGeometry;
2328
+ isActive: boolean;
2329
+ isSelected: boolean;
2330
+ groupSelected: boolean;
2331
+ handlesEnabled: boolean;
2332
+ screenContent?: ReactNode;
2333
+ onPick: (id: string, e: React.MouseEvent<HTMLElement>) => void;
2334
+ onEdit: (id: string, e: React.MouseEvent<HTMLElement>) => void;
2335
+ onStartFrameDrag: (id: string, e: React.MouseEvent) => void;
2336
+ onStartResize: (
2337
+ id: string,
2338
+ handle: ResizeHandle,
2339
+ e: React.MouseEvent,
2340
+ ) => void;
2341
+ onStartRotate: (id: string, e: React.MouseEvent) => void;
2342
+ onStartDuplicateGesture: (
2343
+ screen: ScreenFile,
2344
+ display: string,
2345
+ e: React.MouseEvent<HTMLElement>,
2346
+ ) => void;
2347
+ }) {
2348
+ const t = useT();
2349
+ const display = metadata.title ?? prettyScreenName(screen.filename);
2350
+ const previewUrl = metadata.previewUrl ?? getPreviewUrl(screen.content);
2351
+ const suppressNextClick = useRef(false);
2352
+ const emphasized = isActive || isSelected;
2353
+ const selectionOutlined = isSelected && !groupSelected;
2354
+ const showHoverOutline = !isSelected || !groupSelected;
2355
+
2356
+ return (
2357
+ <div
2358
+ data-frame-shell
2359
+ className="group/frame pointer-events-auto absolute"
2360
+ style={{
2361
+ left: SURFACE_PADDING + geometry.x,
2362
+ top: SURFACE_PADDING + geometry.y - FRAME_LABEL_HEIGHT,
2363
+ width: geometry.width,
2364
+ transform: geometry.rotation
2365
+ ? `rotate(${geometry.rotation}deg)`
2366
+ : undefined,
2367
+ transformOrigin: `${geometry.width / 2}px ${FRAME_LABEL_HEIGHT + geometry.height / 2}px`,
2368
+ zIndex: geometry.z,
2369
+ }}
2370
+ >
2371
+ <div
2372
+ className="flex h-7 w-full cursor-default items-center justify-between gap-2 px-1"
2373
+ onMouseDown={(e) => {
2374
+ if (e.button !== 0) return;
2375
+ if (e.shiftKey) {
2376
+ e.stopPropagation();
2377
+ return;
2378
+ }
2379
+ onStartFrameDrag(screen.id, e);
2380
+ }}
2381
+ >
2382
+ <div className="flex min-w-0 items-center gap-1.5">
2383
+ <span
2384
+ className={cn(
2385
+ "h-1.5 w-1.5 shrink-0 rounded-full",
2386
+ emphasized ? "bg-primary" : "bg-muted-foreground/40",
2387
+ )}
2388
+ />
2389
+ <span
2390
+ className={cn(
2391
+ "truncate text-[11px] font-medium",
2392
+ emphasized ? "text-foreground" : "text-muted-foreground",
2393
+ )}
2394
+ title={screen.filename}
2395
+ >
2396
+ {display}
2397
+ </span>
2398
+ <span className="hidden shrink-0 text-[10px] tabular-nums text-muted-foreground/70 sm:inline">
2399
+ {metadata.width} x {metadata.height}
2400
+ </span>
2401
+ </div>
2402
+ <div className="h-5 shrink-0" />
2403
+ </div>
2404
+ <div
2405
+ data-screen-card
2406
+ role="button"
2407
+ tabIndex={0}
2408
+ onClick={(e) => {
2409
+ e.stopPropagation();
2410
+ if (suppressNextClick.current) {
2411
+ suppressNextClick.current = false;
2412
+ return;
2413
+ }
2414
+ if (e.detail > 1) return;
2415
+ onPick(screen.id, e);
2416
+ }}
2417
+ onDoubleClick={(e) => {
2418
+ e.preventDefault();
2419
+ e.stopPropagation();
2420
+ }}
2421
+ onMouseDown={(e) => {
2422
+ if (e.detail > 1) {
2423
+ e.stopPropagation();
2424
+ return;
2425
+ }
2426
+ if (e.altKey && e.button === 0) {
2427
+ suppressNextClick.current = true;
2428
+ onStartDuplicateGesture(screen, display, e);
2429
+ return;
2430
+ }
2431
+ if (e.button === 0) {
2432
+ if (e.shiftKey) {
2433
+ e.stopPropagation();
2434
+ return;
2435
+ }
2436
+ onStartFrameDrag(screen.id, e);
2437
+ }
2438
+ }}
2439
+ className={cn(
2440
+ "group/artboard relative block overflow-visible rounded-lg bg-background text-left outline-none transition-colors",
2441
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2442
+ emphasized
2443
+ ? "text-foreground"
2444
+ : "text-muted-foreground hover:text-foreground",
2445
+ )}
2446
+ style={{
2447
+ width: geometry.width,
2448
+ height: geometry.height,
2449
+ cursor: isSelected ? "move" : "pointer",
2450
+ touchAction: "none",
2451
+ }}
2452
+ >
2453
+ <span
2454
+ className={cn(
2455
+ "pointer-events-none absolute -inset-[5px] rounded-[13px] border transition-opacity",
2456
+ selectionOutlined
2457
+ ? "border-[var(--design-editor-accent-color)] opacity-100"
2458
+ : showHoverOutline
2459
+ ? "border-[var(--design-editor-accent-color)] opacity-0 group-hover/artboard:opacity-100"
2460
+ : "border-transparent opacity-0",
2461
+ )}
2462
+ />
2463
+ <span
2464
+ className={cn(
2465
+ "relative block h-full w-full overflow-hidden rounded-lg border bg-white shadow-2xl transition-colors",
2466
+ "border-border group-hover/artboard:border-muted-foreground/60",
2467
+ )}
2468
+ >
2469
+ {screenContent ?? (
2470
+ <iframe
2471
+ src={previewUrl}
2472
+ srcDoc={previewUrl ? undefined : screen.content}
2473
+ sandbox="allow-scripts"
2474
+ loading="lazy"
2475
+ className="pointer-events-none border-0"
2476
+ style={{
2477
+ width: metadata.width,
2478
+ height: metadata.height,
2479
+ transform: `scale(${geometry.width / metadata.width}, ${
2480
+ geometry.height / metadata.height
2481
+ })`,
2482
+ transformOrigin: "top left",
2483
+ }}
2484
+ title={screen.filename}
2485
+ />
2486
+ )}
2487
+ <span className="pointer-events-none absolute inset-0 rounded-[7px] border border-black/5" />
2488
+ <button
2489
+ type="button"
2490
+ className={cn(
2491
+ "absolute right-2 top-2 z-20 flex h-7 max-w-[calc(100%-1rem)] translate-y-1 items-center gap-1 rounded-md border border-border bg-background/95 px-2 text-[10px] font-medium text-foreground opacity-0 shadow-sm backdrop-blur transition-all",
2492
+ "hover:bg-accent hover:text-accent-foreground focus-visible:translate-y-0 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2493
+ "group-hover/artboard:translate-y-0 group-hover/artboard:opacity-100 group-focus-visible/artboard:translate-y-0 group-focus-visible/artboard:opacity-100",
2494
+ emphasized && "translate-y-0 opacity-100",
2495
+ )}
2496
+ aria-label={t("multiScreenCanvas.fullView")}
2497
+ title={t("multiScreenCanvas.fullView")}
2498
+ onClick={(event) => onEdit(screen.id, event)}
2499
+ onMouseDown={(event) => {
2500
+ event.preventDefault();
2501
+ event.stopPropagation();
2502
+ }}
2503
+ >
2504
+ <IconMaximize className="size-3" />
2505
+ <span>{t("multiScreenCanvas.fullView")}</span>
2506
+ </button>
2507
+ </span>
2508
+ <ResizeHandles
2509
+ active={selectionOutlined}
2510
+ enabled={handlesEnabled}
2511
+ showRotate={false}
2512
+ onStartResize={(handle, e) => onStartResize(screen.id, handle, e)}
2513
+ onStartRotate={(e) => onStartRotate(screen.id, e)}
2514
+ />
2515
+ </div>
2516
+ </div>
2517
+ );
2518
+ }
2519
+
2520
+ function GroupSelectionBox({
2521
+ bounds,
2522
+ onStartResize,
2523
+ }: {
2524
+ bounds: NonNullable<ReturnType<typeof getFrameGroupBounds>>;
2525
+ onStartResize: (handle: ResizeHandle, e: React.MouseEvent) => void;
2526
+ }) {
2527
+ return (
2528
+ <div
2529
+ data-frame-shell
2530
+ className="pointer-events-none absolute z-30 rounded-[13px] border border-[var(--design-editor-accent-color)]"
2531
+ style={{
2532
+ left: SURFACE_PADDING + bounds.left,
2533
+ top: SURFACE_PADDING + bounds.top,
2534
+ width: bounds.width,
2535
+ height: bounds.height,
2536
+ }}
2537
+ >
2538
+ <ResizeHandles
2539
+ active
2540
+ enabled
2541
+ showRotate={false}
2542
+ onStartResize={onStartResize}
2543
+ onStartRotate={() => {}}
2544
+ />
2545
+ </div>
2546
+ );
2547
+ }
2548
+
2549
+ function ResizeHandles({
2550
+ active,
2551
+ enabled,
2552
+ showRotate = true,
2553
+ onStartResize,
2554
+ onStartRotate,
2555
+ }: {
2556
+ active: boolean;
2557
+ enabled: boolean;
2558
+ showRotate?: boolean;
2559
+ onStartResize: (handle: ResizeHandle, e: React.MouseEvent) => void;
2560
+ onStartRotate: (e: React.MouseEvent) => void;
2561
+ }) {
2562
+ if (!enabled) return null;
2563
+
2564
+ const visibleHandleClass = cn(
2565
+ "pointer-events-auto absolute z-20 size-2 rounded-[2px] border border-[var(--design-editor-accent-color)] bg-[var(--design-editor-accent-contrast-color)] shadow-sm transition-opacity",
2566
+ active
2567
+ ? "opacity-100"
2568
+ : "opacity-0 group-hover/artboard:opacity-100 group-focus-visible/artboard:opacity-100",
2569
+ );
2570
+ const edgeHandleClass =
2571
+ "pointer-events-auto absolute z-10 bg-transparent opacity-0";
2572
+
2573
+ return (
2574
+ <>
2575
+ {EDGE_RESIZE_HANDLE_CONFIGS.map((config) => (
2576
+ <span
2577
+ key={config.handle}
2578
+ data-resize-handle
2579
+ className={cn(edgeHandleClass, config.className)}
2580
+ style={{ cursor: config.cursor }}
2581
+ onMouseDown={(e) => onStartResize(config.handle, e)}
2582
+ />
2583
+ ))}
2584
+ {CORNER_RESIZE_HANDLE_CONFIGS.map((config) => (
2585
+ <span
2586
+ key={config.handle}
2587
+ data-resize-handle
2588
+ className={cn(visibleHandleClass, config.className)}
2589
+ style={{ cursor: config.cursor }}
2590
+ onMouseDown={(e) => onStartResize(config.handle, e)}
2591
+ />
2592
+ ))}
2593
+ {showRotate
2594
+ ? ROTATE_HANDLE_CONFIGS.map((config) => (
2595
+ <span
2596
+ key={config.corner}
2597
+ data-rotate-handle
2598
+ className={cn(
2599
+ "pointer-events-auto absolute z-10 size-5 rounded-full transition-opacity active:cursor-grabbing",
2600
+ active
2601
+ ? "opacity-100"
2602
+ : "opacity-0 group-hover/artboard:opacity-100 group-focus-visible/artboard:opacity-100",
2603
+ config.className,
2604
+ )}
2605
+ style={{ cursor: "grab" }}
2606
+ onMouseDown={onStartRotate}
2607
+ />
2608
+ ))
2609
+ : null}
2610
+ </>
2611
+ );
2612
+ }
2613
+
2614
+ const CORNER_RESIZE_HANDLE_CONFIGS: Array<{
2615
+ handle: ResizeHandle;
2616
+ className: string;
2617
+ cursor: string;
2618
+ }> = [
2619
+ { handle: "nw", className: "-left-1 -top-1", cursor: "nwse-resize" },
2620
+ { handle: "ne", className: "-right-1 -top-1", cursor: "nesw-resize" },
2621
+ { handle: "se", className: "-bottom-1 -right-1", cursor: "nwse-resize" },
2622
+ { handle: "sw", className: "-bottom-1 -left-1", cursor: "nesw-resize" },
2623
+ ];
2624
+
2625
+ const EDGE_RESIZE_HANDLE_CONFIGS: Array<{
2626
+ handle: ResizeHandle;
2627
+ className: string;
2628
+ cursor: string;
2629
+ }> = [
2630
+ {
2631
+ handle: "n",
2632
+ className: "-top-1 left-0 right-0 h-2",
2633
+ cursor: "ns-resize",
2634
+ },
2635
+ {
2636
+ handle: "e",
2637
+ className: "-right-1 bottom-0 top-0 w-2",
2638
+ cursor: "ew-resize",
2639
+ },
2640
+ {
2641
+ handle: "s",
2642
+ className: "-bottom-1 left-0 right-0 h-2",
2643
+ cursor: "ns-resize",
2644
+ },
2645
+ {
2646
+ handle: "w",
2647
+ className: "-left-1 bottom-0 top-0 w-2",
2648
+ cursor: "ew-resize",
2649
+ },
2650
+ ];
2651
+
2652
+ const ALL_RESIZE_HANDLE_CONFIGS = [
2653
+ ...CORNER_RESIZE_HANDLE_CONFIGS,
2654
+ ...EDGE_RESIZE_HANDLE_CONFIGS,
2655
+ ];
2656
+
2657
+ const ROTATE_HANDLE_CONFIGS: Array<{
2658
+ corner: string;
2659
+ className: string;
2660
+ }> = [
2661
+ { corner: "nw", className: "-left-7 -top-7" },
2662
+ { corner: "ne", className: "-right-7 -top-7" },
2663
+ { corner: "se", className: "-bottom-7 -right-7" },
2664
+ { corner: "sw", className: "-bottom-7 -left-7" },
2665
+ ];
2666
+
2667
+ interface FrameEntry {
2668
+ id: string;
2669
+ geometry: FrameGeometry;
2670
+ }
2671
+
2672
+ interface BoundsRect {
2673
+ left: number;
2674
+ top: number;
2675
+ right: number;
2676
+ bottom: number;
2677
+ }
2678
+
2679
+ function getInitialFrameGeometry(index: number): FrameGeometry {
2680
+ const column = index % 3;
2681
+ const row = Math.floor(index / 3);
2682
+ return {
2683
+ x: column * (SCREEN_WIDTH + SCREEN_GAP),
2684
+ y: row * (SCREEN_CARD_HEIGHT + SCREEN_GAP),
2685
+ width: SCREEN_WIDTH,
2686
+ height: SCREEN_HEIGHT,
2687
+ };
2688
+ }
2689
+
2690
+ function getFrameEntries(
2691
+ screens: ScreenFile[],
2692
+ geometryById: FrameGeometryById,
2693
+ ): FrameEntry[] {
2694
+ return screens.map((screen, index) => ({
2695
+ id: screen.id,
2696
+ geometry: geometryById[screen.id] ?? getInitialFrameGeometry(index),
2697
+ }));
2698
+ }
2699
+
2700
+ function dedupeIds(ids: string[]) {
2701
+ return [...new Set(ids)];
2702
+ }
2703
+
2704
+ function sameIds(a: string[], b: string[]) {
2705
+ return a.length === b.length && a.every((id, index) => id === b[index]);
2706
+ }
2707
+
2708
+ function isArrowNudgeKey(key: string): key is ArrowNudgeKey {
2709
+ return (
2710
+ key === "ArrowUp" ||
2711
+ key === "ArrowRight" ||
2712
+ key === "ArrowDown" ||
2713
+ key === "ArrowLeft"
2714
+ );
2715
+ }
2716
+
2717
+ function isEditableHotkeyTarget(target: EventTarget | null) {
2718
+ if (!target || typeof Element === "undefined") return false;
2719
+ if (!(target instanceof Element)) return false;
2720
+ const editable = target.closest(
2721
+ [
2722
+ "input",
2723
+ "textarea",
2724
+ "select",
2725
+ "[contenteditable]",
2726
+ '[role="textbox"]',
2727
+ '[data-hotkeys-scope="text"]',
2728
+ ].join(","),
2729
+ );
2730
+ if (!editable) return false;
2731
+ if (editable instanceof HTMLElement && editable.isContentEditable) {
2732
+ return true;
2733
+ }
2734
+ const tagName = editable.tagName.toLowerCase();
2735
+ return tagName === "input" || tagName === "textarea" || tagName === "select";
2736
+ }
2737
+
2738
+ function frameBoundsToGeometry(bounds: {
2739
+ left: number;
2740
+ top: number;
2741
+ width: number;
2742
+ height: number;
2743
+ }): FrameGeometry {
2744
+ return {
2745
+ x: bounds.left,
2746
+ y: bounds.top,
2747
+ width: bounds.width,
2748
+ height: bounds.height,
2749
+ };
2750
+ }
2751
+
2752
+ function getResizeCursor(handle: ResizeHandle) {
2753
+ return (
2754
+ ALL_RESIZE_HANDLE_CONFIGS.find((config) => config.handle === handle)
2755
+ ?.cursor ?? "default"
2756
+ );
2757
+ }
2758
+
2759
+ function normalizeRectFromPoints(start: Point, end: Point): MarqueeRect {
2760
+ const x = Math.min(start.x, end.x);
2761
+ const y = Math.min(start.y, end.y);
2762
+ return {
2763
+ x,
2764
+ y,
2765
+ width: Math.abs(end.x - start.x),
2766
+ height: Math.abs(end.y - start.y),
2767
+ };
2768
+ }
2769
+
2770
+ function rectIntersects(rect: MarqueeRect, bounds: BoundsRect) {
2771
+ const right = rect.x + rect.width;
2772
+ const bottom = rect.y + rect.height;
2773
+ return (
2774
+ rect.x <= bounds.right &&
2775
+ right >= bounds.left &&
2776
+ rect.y <= bounds.bottom &&
2777
+ bottom >= bounds.top
2778
+ );
2779
+ }
2780
+
2781
+ function rectContainsPoint(bounds: BoundsRect, point: Point) {
2782
+ return (
2783
+ point.x >= bounds.left &&
2784
+ point.x <= bounds.right &&
2785
+ point.y >= bounds.top &&
2786
+ point.y <= bounds.bottom
2787
+ );
2788
+ }
2789
+
2790
+ function sameFrameGeometry(a: FrameGeometry, b: FrameGeometry) {
2791
+ return (
2792
+ a.x === b.x &&
2793
+ a.y === b.y &&
2794
+ a.width === b.width &&
2795
+ a.height === b.height &&
2796
+ (a.rotation ?? 0) === (b.rotation ?? 0) &&
2797
+ (a.z ?? 0) === (b.z ?? 0)
2798
+ );
2799
+ }
2800
+
2801
+ function cloneFrameGeometryById(
2802
+ geometryById: FrameGeometryById,
2803
+ ): FrameGeometryById {
2804
+ return Object.fromEntries(
2805
+ Object.entries(geometryById).map(([id, geometry]) => [id, { ...geometry }]),
2806
+ );
2807
+ }
2808
+
2809
+ function frameGeometryWithOverrides(
2810
+ base: FrameGeometryById,
2811
+ overrides: FrameGeometryById,
2812
+ ): FrameGeometryById {
2813
+ const next = cloneFrameGeometryById(base);
2814
+ Object.entries(overrides).forEach(([id, geometry]) => {
2815
+ next[id] = { ...geometry };
2816
+ });
2817
+ return next;
2818
+ }
2819
+
2820
+ function isDraftPrimitive(
2821
+ value: DraftPrimitive | undefined,
2822
+ ): value is DraftPrimitive {
2823
+ return Boolean(value);
2824
+ }
2825
+
2826
+ function getDraftGeometryForTool(
2827
+ tool: DraftCreationTool,
2828
+ start: Point,
2829
+ end: Point,
2830
+ ): FrameGeometry {
2831
+ if (tool === "pen") return getPathGeometry([start, end]);
2832
+ const options =
2833
+ tool === "frame"
2834
+ ? {
2835
+ minWidth: 24,
2836
+ minHeight: 24,
2837
+ defaultWidth: DRAFT_FRAME_WIDTH,
2838
+ defaultHeight: DRAFT_FRAME_HEIGHT,
2839
+ }
2840
+ : tool === "text"
2841
+ ? {
2842
+ minWidth: 24,
2843
+ minHeight: 18,
2844
+ defaultWidth: DRAFT_TEXT_WIDTH,
2845
+ defaultHeight: DRAFT_TEXT_HEIGHT,
2846
+ }
2847
+ : {
2848
+ minWidth: 8,
2849
+ minHeight: 8,
2850
+ defaultWidth: DRAFT_RECT_WIDTH,
2851
+ defaultHeight: DRAFT_RECT_HEIGHT,
2852
+ };
2853
+ return getDraftGeometryFromPoints(start, end, options);
2854
+ }
2855
+
2856
+ function getPathGeometry(points: readonly Point[]): FrameGeometry {
2857
+ if (points.length === 0) {
2858
+ return {
2859
+ x: 0,
2860
+ y: 0,
2861
+ width: DRAFT_PATH_MIN_SIZE,
2862
+ height: DRAFT_PATH_MIN_SIZE,
2863
+ };
2864
+ }
2865
+ const xs = points.map((point) => point.x);
2866
+ const ys = points.map((point) => point.y);
2867
+ const left = Math.min(...xs);
2868
+ const top = Math.min(...ys);
2869
+ const right = Math.max(...xs);
2870
+ const bottom = Math.max(...ys);
2871
+ return {
2872
+ x: left,
2873
+ y: top,
2874
+ width: Math.max(DRAFT_PATH_MIN_SIZE, right - left),
2875
+ height: Math.max(DRAFT_PATH_MIN_SIZE, bottom - top),
2876
+ };
2877
+ }
2878
+
2879
+ function createDraftPrimitive({
2880
+ tool,
2881
+ start,
2882
+ end,
2883
+ points,
2884
+ moved,
2885
+ toolProps,
2886
+ fallbackText,
2887
+ }: DraftPrimitiveInput): DraftPrimitive {
2888
+ const id = `draft-${tool}-${Date.now()}-${Math.random()
2889
+ .toString(36)
2890
+ .slice(2, 8)}`;
2891
+ const geometry = moved
2892
+ ? getDraftGeometryForTool(tool, start, end)
2893
+ : getDraftGeometryForTool(tool, start, start);
2894
+ if (tool === "pen") {
2895
+ const pathPoints =
2896
+ points && points.length > 1
2897
+ ? points
2898
+ : [
2899
+ start,
2900
+ { x: start.x + 64, y: start.y + 24 },
2901
+ { x: start.x + 128, y: start.y },
2902
+ ];
2903
+ return {
2904
+ id,
2905
+ kind: "path",
2906
+ geometry: getPathGeometry(pathPoints),
2907
+ points: pathPoints,
2908
+ stroke: toolProps?.stroke,
2909
+ strokeWidth: toolProps?.strokeWidth ?? 3,
2910
+ };
2911
+ }
2912
+ if (tool === "text") {
2913
+ return {
2914
+ id,
2915
+ kind: "text",
2916
+ geometry,
2917
+ text: toolProps?.text ?? fallbackText,
2918
+ fill: toolProps?.fill,
2919
+ stroke: toolProps?.stroke,
2920
+ };
2921
+ }
2922
+ return {
2923
+ id,
2924
+ kind: tool === "frame" ? "frame" : "rectangle",
2925
+ geometry,
2926
+ fill: toolProps?.fill,
2927
+ stroke: toolProps?.stroke,
2928
+ strokeWidth: toolProps?.strokeWidth,
2929
+ };
2930
+ }
2931
+
2932
+ function cloneDraftPrimitive(draft: DraftPrimitive): DraftPrimitive {
2933
+ return {
2934
+ ...draft,
2935
+ geometry: { ...draft.geometry },
2936
+ points: draft.points?.map((point) => ({ ...point })),
2937
+ };
2938
+ }
2939
+
2940
+ function draftPrimitiveToInsert(
2941
+ draft: DraftPrimitive,
2942
+ frameGeometry: FrameGeometry,
2943
+ ): CanvasPrimitiveInsert {
2944
+ return {
2945
+ kind: draft.kind,
2946
+ geometry: {
2947
+ ...draft.geometry,
2948
+ x: Math.round(draft.geometry.x - frameGeometry.x),
2949
+ y: Math.round(draft.geometry.y - frameGeometry.y),
2950
+ },
2951
+ points: draft.points?.map((point) => ({
2952
+ x: Math.round(point.x - frameGeometry.x),
2953
+ y: Math.round(point.y - frameGeometry.y),
2954
+ })),
2955
+ text: draft.text,
2956
+ fill: draft.fill,
2957
+ stroke: draft.stroke,
2958
+ strokeWidth: draft.strokeWidth,
2959
+ };
2960
+ }
2961
+
2962
+ function moveDraftPrimitive(
2963
+ draft: DraftPrimitive,
2964
+ dx: number,
2965
+ dy: number,
2966
+ ): DraftPrimitive {
2967
+ return {
2968
+ ...draft,
2969
+ geometry: {
2970
+ ...draft.geometry,
2971
+ x: draft.geometry.x + dx,
2972
+ y: draft.geometry.y + dy,
2973
+ },
2974
+ points: draft.points?.map((point) => ({
2975
+ x: point.x + dx,
2976
+ y: point.y + dy,
2977
+ })),
2978
+ };
2979
+ }
2980
+
2981
+ function applyDraftGeometry(
2982
+ draft: DraftPrimitive,
2983
+ geometry: FrameGeometry,
2984
+ ): DraftPrimitive {
2985
+ if (!draft.points?.length) return { ...draft, geometry };
2986
+ const origin = draft.geometry;
2987
+ const scaleX = geometry.width / Math.max(1, origin.width);
2988
+ const scaleY = geometry.height / Math.max(1, origin.height);
2989
+ return {
2990
+ ...draft,
2991
+ geometry,
2992
+ points: draft.points.map((point) => ({
2993
+ x: geometry.x + (point.x - origin.x) * scaleX,
2994
+ y: geometry.y + (point.y - origin.y) * scaleY,
2995
+ })),
2996
+ };
2997
+ }
2998
+
2999
+ function normalizeCanvasTool(
3000
+ tool: MultiScreenCanvasTool,
3001
+ ): MultiScreenCanvasTool {
3002
+ return tool === "rectangle" ? "rect" : tool;
3003
+ }
3004
+
3005
+ function getDraftCreationTool(
3006
+ tool: MultiScreenCanvasTool,
3007
+ ): DraftCreationTool | null {
3008
+ if (
3009
+ tool === "frame" ||
3010
+ tool === "rect" ||
3011
+ tool === "text" ||
3012
+ tool === "pen"
3013
+ ) {
3014
+ return tool;
3015
+ }
3016
+ return null;
3017
+ }
3018
+
3019
+ function pointsToPath(points: readonly Point[]) {
3020
+ if (points.length === 0) return "";
3021
+ const [first, ...rest] = points;
3022
+ return [
3023
+ `M ${roundCoord(first.x)} ${roundCoord(first.y)}`,
3024
+ ...rest.map((point) => `L ${roundCoord(point.x)} ${roundCoord(point.y)}`),
3025
+ ].join(" ");
3026
+ }
3027
+
3028
+ function roundCoord(value: number) {
3029
+ return Math.round(value * 10) / 10;
3030
+ }
3031
+
3032
+ function previewDraftPrimitive(preview: DraftCreationPreview): DraftPrimitive {
3033
+ return {
3034
+ id: "draft-preview",
3035
+ kind:
3036
+ preview.tool === "pen"
3037
+ ? "path"
3038
+ : preview.tool === "frame"
3039
+ ? "frame"
3040
+ : preview.tool === "text"
3041
+ ? "text"
3042
+ : "rectangle",
3043
+ geometry: preview.geometry,
3044
+ points: preview.points,
3045
+ text: "Text", // i18n-ignore preview-only canvas placeholder
3046
+ };
3047
+ }
3048
+
3049
+ function getFrameCenter(frame: FrameGeometry): Point {
3050
+ return {
3051
+ x: frame.x + frame.width / 2,
3052
+ y: frame.y + frame.height / 2,
3053
+ };
3054
+ }
3055
+
3056
+ function angleBetween(center: Point, point: Point) {
3057
+ return (Math.atan2(point.y - center.y, point.x - center.x) * 180) / Math.PI;
3058
+ }
3059
+
3060
+ function getSelectableBounds(geometry: FrameGeometry): BoundsRect {
3061
+ return {
3062
+ left: geometry.x,
3063
+ top: geometry.y - FRAME_LABEL_HEIGHT,
3064
+ right: geometry.x + geometry.width,
3065
+ bottom: geometry.y + geometry.height,
3066
+ };
3067
+ }
3068
+
3069
+ function getWheelDelta(event: WheelEvent) {
3070
+ const multiplier =
3071
+ event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? 800 : 1;
3072
+ return {
3073
+ x: event.deltaX * multiplier,
3074
+ y: event.deltaY * multiplier,
3075
+ };
3076
+ }
3077
+
3078
+ function clamp(value: number, min: number, max: number) {
3079
+ return Math.min(max, Math.max(min, value));
3080
+ }
3081
+
3082
+ function resolveScreenMetadata(
3083
+ screen: ScreenFile,
3084
+ keyedMetadata?: ScreenMetadata,
3085
+ getterMetadata?: ScreenMetadata,
3086
+ ): ResolvedScreenMetadata {
3087
+ const metadata = { ...screen, ...keyedMetadata, ...getterMetadata };
3088
+ const previewUrl =
3089
+ metadata.url ??
3090
+ metadata.previewUrl ??
3091
+ screen.previewUrl ??
3092
+ getPreviewUrl(screen.content);
3093
+ const width = metadata.width && metadata.width > 0 ? metadata.width : 1280;
3094
+ const height =
3095
+ metadata.height && metadata.height > 0 ? metadata.height : 2560;
3096
+ return {
3097
+ source:
3098
+ normalizeSource(metadata.sourceType ?? metadata.source) ??
3099
+ deriveSource(screen, previewUrl),
3100
+ previewState:
3101
+ normalizePreviewState(
3102
+ metadata.lod ?? metadata.previewState ?? metadata.status,
3103
+ ) ?? derivePreviewState(screen, previewUrl),
3104
+ title: metadata.title,
3105
+ width,
3106
+ height,
3107
+ previewUrl,
3108
+ };
3109
+ }
3110
+
3111
+ function normalizeSource(value?: string): ScreenSourceType | undefined {
3112
+ const normalized = value?.toLowerCase();
3113
+ if (!normalized) return undefined;
3114
+ if (normalized === "local" || normalized === "localhost") return "localhost";
3115
+ if (normalized === "fusion" || normalized === "remote-fusion")
3116
+ return "fusion";
3117
+ if (normalized === "inline" || normalized === "code") return "inline";
3118
+ return undefined;
3119
+ }
3120
+
3121
+ function normalizePreviewState(value?: string): ScreenPreviewState | undefined {
3122
+ const normalized = value?.toLowerCase();
3123
+ if (!normalized) return undefined;
3124
+ if (normalized === "live") return "live";
3125
+ if (normalized === "snapshot" || normalized === "cached") return "snapshot";
3126
+ if (normalized === "preview" || normalized === "draft") return "preview";
3127
+ return undefined;
3128
+ }
3129
+
3130
+ function deriveSource(
3131
+ screen: ScreenFile,
3132
+ previewUrl?: string,
3133
+ ): ScreenSourceType {
3134
+ const haystack =
3135
+ `${screen.filename} ${screen.content.slice(0, 4000)}`.toLowerCase();
3136
+ const url = getUrl(previewUrl ?? screen.content);
3137
+
3138
+ if (
3139
+ url?.hostname === "localhost" ||
3140
+ url?.hostname === "127.0.0.1" ||
3141
+ url?.hostname.endsWith(".local") ||
3142
+ haystack.includes("localhost") ||
3143
+ haystack.includes("127.0.0.1")
3144
+ ) {
3145
+ return "localhost";
3146
+ }
3147
+
3148
+ if (haystack.includes("fusion") || url?.hostname.includes("fusion")) {
3149
+ return "fusion";
3150
+ }
3151
+
3152
+ return "inline";
3153
+ }
3154
+
3155
+ function derivePreviewState(
3156
+ screen: ScreenFile,
3157
+ previewUrl?: string,
3158
+ ): ScreenPreviewState {
3159
+ const haystack =
3160
+ `${screen.filename} ${screen.content.slice(0, 4000)}`.toLowerCase();
3161
+
3162
+ if (
3163
+ haystack.includes("snapshot") ||
3164
+ haystack.includes("screenshot") ||
3165
+ haystack.includes("cached") ||
3166
+ haystack.includes("data:image/")
3167
+ ) {
3168
+ return "snapshot";
3169
+ }
3170
+
3171
+ if (previewUrl || deriveSource(screen, previewUrl) !== "inline") {
3172
+ return "live";
3173
+ }
3174
+
3175
+ return "preview";
3176
+ }
3177
+
3178
+ function getPreviewUrl(content: string) {
3179
+ return getUrl(content.trim())?.toString();
3180
+ }
3181
+
3182
+ function getUrl(value: string | undefined) {
3183
+ if (!value) return undefined;
3184
+ try {
3185
+ const url = new URL(value);
3186
+ return url.protocol === "http:" || url.protocol === "https:"
3187
+ ? url
3188
+ : undefined;
3189
+ } catch {
3190
+ return undefined;
3191
+ }
223
3192
  }